One document matched: draft-shelby-6lowapp-encoding-00.xml


<?xml version="1.0" encoding="US-ASCII"?>
<!-- This template is for creating an Internet Draft using xml2rfc,
     which is available here: http://xml.resource.org. -->
<!DOCTYPE rfc SYSTEM "rfc2629.dtd" [
<!ENTITY RFC4944 SYSTEM "reference.RFC.4944.xml">
<!ENTITY RFC2045 SYSTEM "reference.RFC.2045.xml">
<!ENTITY RFC2046 SYSTEM "reference.RFC.2046.xml">
<!ENTITY RFC3023 SYSTEM "reference.RFC.3023.xml">
<!ENTITY RFC3870 SYSTEM "reference.RFC.3870.xml">
<!ENTITY RFC3902 SYSTEM "reference.RFC.3902.xml">
<!ENTITY RFC5023 SYSTEM "reference.RFC.5023.xml">
<!ENTITY W3C.WD-exi-20080919 SYSTEM "reference.W3C.WD-exi-20080919.xml">
<!ENTITY W3C.WD-exi-primer-20071219 SYSTEM "reference.W3C.WD-exi-primer-20071219.xml">
<!ENTITY W3C.WD-exi-best-practices-20071219 SYSTEM "reference.W3C.WD-exi-best-practices-20071219.xml">
<!ENTITY W3C.WD-exi-evaluation-20090407 SYSTEM "reference.W3C.WD-exi-evaluation-20090407.xml">
<!ENTITY I-D.bormann-6lowpan-6lowapp-problem SYSTEM "reference.I-D.bormann-6lowpan-6lowapp-problem.xml">
<!ENTITY I-D.frank-6lowapp-chopan SYSTEM "reference.I-D.frank-6lowapp-chopan.xml">
]>
<?xml-stylesheet type='text/xsl' href='rfc2629.xslt' ?>
<!-- used by XSLT processors -->
<!-- For a complete list and description of processing instructions (PIs), 
     please see http://xml.resource.org/authoring/README.html. -->
<!-- Below are generally applicable Processing Instructions (PIs) that most I-Ds might want to use.
     (Here they are set differently than their defaults in xml2rfc v1.32) -->
<?rfc strict="yes" ?>
<!-- give errors regarding ID-nits and DTD validation -->
<!-- control the table of contents (ToC) -->
<?rfc toc="yes"?>
<!-- generate a ToC -->
<?rfc tocdepth="3"?>
<!-- the number of levels of subsections in ToC. default: 3 -->
<!-- control references -->
<?rfc symrefs="yes"?>
<!-- use symbolic references tags, i.e, [RFC2119] instead of [1] -->
<?rfc sortrefs="yes" ?>
<!-- sort the reference entries alphabetically -->
<!-- control vertical white space
     (using these PIs as follows is recommended by the RFC Editor) -->
<?rfc compact="yes" ?>
<!-- do not start each main section on a new page -->
<?rfc subcompact="no" ?>
<!-- keep one blank line between list items -->
<!-- end of list of popular I-D processing instructions -->
<rfc category="info" ipr="pre5378Trust200902" docName="draft-shelby-6lowapp-encoding-00">

<?xml-stylesheet type='text/xsl' href='rfc2629.xslt' ?>

<?rfc toc="yes" ?>
<?rfc symrefs="yes" ?>
<?rfc sortrefs="yes"?>
<?rfc iprnotified="no" ?>
<?rfc strict="yes" ?>

    <front>
        <title>Efficient XML Encoding and 6LowApp</title>


        <author initials="Z" surname="Shelby" fullname="Zach Shelby">
          <organization>
             Sensinode
          </organization>
          <address>
            <postal>
             <street>Kidekuja 2</street>
             <city>Vuokatti</city>
             <code>88600</code>
             <country>FINLAND</country>
            </postal>
            <phone>+358407796297</phone>
            <email>zach@sensinode.com</email>
	  </address>
        </author>
        

        <author initials="M" surname="Luimula" fullname="Mika Luimula">
          <organization>
             CENTRIA
          </organization>
          <address>
            <postal>
             <street>Vierimaantie 7</street>
             <city>Ylivieska</city>
             <code>84100</code>
             <country>Finland</country>
            </postal>
            <phone>+358444492543</phone>
            <email>Mika.Luimula@centria.fi</email>
	  </address>
        </author>
 
	<author initials="D" surname="Peintner" fullname="Daniel Peintner">
	  <organization>Siemens AG</organization>
	  <address>
		<postal>
		<street>Otto-Hahn-Ring 6</street>
		<city>Munich</city>
		<code>81739</code>
		<country>Germany</country>
		</postal>
	  <phone>+49-89-636-41274</phone>
	  <email>Daniel.Peintner.EXT@siemens.com</email>
	  </address>
	</author>
   

	<date year="2009"/>

	<area>Internet</area>

	<workgroup>6lowapp</workgroup>
	<keyword>Requirements</keyword>

        <abstract>
	  <t>
	  For the resource constrained devices and networks of 6LowApp it is essential that the payload of messages are compact. The use of XML to represent data in web applications has become almost universal. The interoperability of 6LowApp with these applications will require that XML can also be carried over the embedded web. This document introduces and compares techniques for encoding or compressing XML for use with 6LowApp including EXI, BXML and Fast Infoset. The performance and requirements for using these encodings are analyzed in the scope of 6LowApp. It is shown that these standard encodings can represent XML in a compact form, with reasonable overhead, and require only Internet media type and content transfer encoding indication from the application protocol. 
	  </t>
	  
	</abstract>
    </front>

    <middle>

	<!-- **************************************************************** -->
	<!-- **************************************************************** -->
	<!-- **************************************************************** -->
	<!-- **************************************************************** -->
	<section anchor='introduction' title="Introduction">

	<t>
	  For the resource constrained devices and networks of 6LowApp <xref target="I-D.bormann-6lowpan-6lowapp-problem"/> it is essential that the message payloads are compact. The use of XML to represent data in web applications has become almost universal. The interoperability of 6LowApp with these applications will require that XML can also be carried over the embedded web. Examples include Smart Energy using IEC XML markup, building automation with open Building Information Exchange (oBIX), and the OGC Sensor Markup Language (SensorML) <xref target="OGC-SensorML"/> to name a few. In the vast majority of enterprise and machine-to-machine (M2M) systems it is expected that data is represented in some form of XML. The size of typical XML payloads for even simple sensor data ranges from 100s to 1000s of bytes. This overhead is unreasonable over e.g. 6LoWPAN networks <xref target="RFC4944"/>. Furthermore, full XML parsing requires additional resources from embedded devices. 
	</t>
	
	<t>
	  Fortunately, the text form of XML we are all familiar with is only one way to represent an XML document or fragment. XML can also be respresented using much more compact and easy to parse encodings. The underlying XML Information Set is the same. One good example is the new Efficient XML Interchange (EXI) standard from the W3C <xref target="W3C.WD-exi-20080919"/>. This alternative encoding for XML represents namespaces, tags, attributes and data using optimal bit codes, supporting very simple encoding/decoding based on well-known schema knowledge. Other examples include the Binary XML (BXML) specification from the OGC <xref target="OGC-BXML"/>, the Fast Infoset (FI) standard from the ITU <xref target="FI"/> and the WAP Binary XML (WBXML) technique from the mobile industry.  
	</t>

	<t>
	 This document introduces and compares techniques for encoding or compressing XML for use with 6LowApp including EXI, BXML and Fast Infoset. The performance and requirements for using these encodings are analyzed in the scope of 6LowApp. It is shown that these standard encodings can represent XML in a compact form, with reasonable overhead, and require only Internet media type and possible transfer encoding indication from the application protocol.
	</t>

      </section>

	<!-- **************************************************************** -->
	<!-- **************************************************************** -->
	<!-- **************************************************************** -->
	<!-- **************************************************************** -->
	<section anchor='binaryxml' title="Efficient XML Encoding">

	<t>
	In this section we introduce a few of the promising efficient XML encoding schemes available as standards or draft standards. We are aware of other standard encodings such as WBXML and compression schemes like gzip and deflate. These techniques have similar properties and requirements to the ones presented here. In general techniques can be categorized into two categories, encoding techniques and compression techniques. The following three techniques can be categorized as encodings, which are typically more suitable for very limited devices.
	</t>

	  <section anchor='exi' title="Efficient XML Interchange (EXI)">

	  <t>
	  EXI is a very compact representation for the XML Information Set that is intended to simultaneously optimize performance and the utilization of computational resources <xref target="W3C.WD-exi-20080919"/>. The EXI format uses a hybrid approach drawn from the information and formal language theories, plus practical techniques verified by measurements, for entropy encoding XML information. Using a relatively simple algorithm, which is amenable to fast and compact implementation, and a small set of data types, it reliably produces efficient encodings of XML event streams. The event production system and format definition of EXI are introduced in <xref target="W3C.WD-exi-primer-20071219"/>. 
	  </t>
	  <t>
	  The EXI specification allows for a simplified mode of operation called schema-informed mode. Here a schema is used to form a grammar and state-machine limited to that schema, enabling an extremely efficient encoding. The result of the simple state machine is that even the most minimal embedded devices can work directly with the encoding without the need to work with a full XML parser.
	  </t>
	 	  
	  </section>

	  <section anchor='fi' title="Fast Infoset (FI)">
	  
	  <t>
	  Fast Infoset is an ITU-T (X.891) <xref target="FI"/> and ISO (IEC 24824-1) defined standard that specifies a binary encoding for the XML Information Set. Unlike other XML representations, the Fast Infoset standard has the dual benefits of both compression and performance, making it the ideal choice for moving large XML data between disparate low bandwidth systems or for high performance systems such as those utilizing Web services. 
	  </t>
	  
	  </section>

	  <section anchor='bxml' title="Binary XML (BXML)">
	  
	  <t>
	  BXML is a straightforward encoding for XML that is designed for efficient processing in general with an emphasis on dense numeric data, which is one of the weakest areas for textual XML. This encoding specification designed by Open Geospatial Consortium (OGC) is specified for GML compression <xref target="OGC-BXML"/>. Thus it is an interesting technique even though it is still in best practices phase and currently meant only for GML.  It is open and about as straightforward to implement a parser/generator for as for textual XML. 
	  </t>
	  
	  </section>


      </section>

	<!-- **************************************************************** -->
	<!-- **************************************************************** -->
	<!-- **************************************************************** -->
	<!-- **************************************************************** -->
	<section anchor='results' title="Results">

	<t>
	In this section the results of encoding XML content with EXI, BXML and Fast Infoset techniques are presented. The goal is to give an example of how the encoding of some typical XML content for simple embedded devices works. In this comparison RDF/XML sensor data, a Smart Energy example and a simplified SensorML example have been used which represent a good range of content for 6LowApp applications.
	</t>
	
	<t>
	The results were carried out using <xref target="EXIficient">EXIficcient v0.3</xref> and 
	<xref target="FI@GlassFish">FastInfoset v1.1.9</xref> from GlassFish along with a custom BXML implementation from CENTRIA <xref target="Locawe-BXML"/>. All test content had a corresponding XML Schema, and the original content size was normalized. EXI encoding was performed in schema-informed mode using bit-alignment. Fast Infoset and BXML were both performed with schema information. Complexity is considered for using the technique on constrained  microcontrollers and was estimated based on implementations of EXI and BXML on CC2430 and MSP430 platforms, and an estimation of FI complexity to be similar to BXML. 
	</t>
	
	<t>
	The following figures show the XML content used for the comparison:
	</t>
	
		 <figure anchor='rdftest' title="XML content used for the RDF Test">
	       <artwork><![CDATA[
<?xml version='1.0' encoding='UTF-8'?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:res="urn:sensei:rai">
    <res:Temperature rdf:about="2" 
     res:hasDecimalValue="5.5"/>
</rdf:RDF>
	       ]]></artwork>
	     </figure>

		 <figure anchor='setest' title="XML content used for the Smart Energy Test">
	       <artwork><![CDATA[
<?xml version="1.0" encoding="UTF-8"?>
<simpleMetering>
   <CurrentSummationDelivered>0</CurrentSummationDelivered>
   <Status>0</Status>
   <UnitOfMeasure>0</UnitOfMeasure>
   <SummationFormatting>85</SummationFormatting>
   <MeteringDeviceType>0</MeteringDeviceType>
   <InstantaneousDemand>1234</InstantaneousDemand>
   <CurrentDayConsumptionReceived>23
   </CurrentDayConsumptionReceived>
</simpleMetering>
	      ]]></artwork>
	     </figure>
	     
	     	<figure anchor='sensormltest' title="XML content used for the SensorML Test">
	       <artwork><![CDATA[
<?xml version="1.0" encoding="utf-8"?>
<GPS_Temperature_System>
   <TimeOfSample>2009-04-08T09:30:10+02:00</TimeOfSample>
   <Longitude>6404.48220N</Longitude>
   <Latitude>02430.91188E</Latitude>
   <Temperature>20.50</Temperature>
</GPS_Temperature_System>
	      ]]></artwork>
	     </figure>
	     
	<t>
	Table 1 presentes the comparison results. The results show that EXI encoding represents XML content much more efficiently than BXML and FI encodings. The main reason for this can be found from the simplicity of EXI encoding, and the efficiency of its schema-informed grammar that resulsts in a limited state machine. The result is close to that achievable when representing the same raw data content in ASN.1. BXML encoding in turn will encode not only the values but also a part of the XML structure. However, BXML also offers also possibility to store the most common structures in a separate global string table which can be stored and used locally in the node side like the schema file of EXI encoding. The structure of BXML is closer to the stuctures of OGC's markups. Although not very dense, an advantage of BXML is its readability. Fast Infoset works like a compression algorithm for XML, although with higher performance than gzip. The results of Fast Infoset and BXML are on averge equivalent. Further test results for full web content for a wide range of encoding and compression techniques can be found from <xref target="W3C.WD-exi-evaluation-20090407"/>.
	</t>    

        <texttable anchor='result_table' title="Results comparing efficient XML encodings">
        
        <ttcol align='left'>Encoding</ttcol>
        <ttcol align='left'>Complexity</ttcol>
        <ttcol align='left'>RDF Test</ttcol>
        <ttcol align='left'>SE Test</ttcol>
        <ttcol align='left'>SensorML Test</ttcol>


        <c>XML</c>

        <c>med</c>

        <c>206B</c>

        <c>409B</c>

        <c>300B</c>


        <c>EXI</c>

        <c>low</c>

        <c>6B (3%)</c>

        <c>13B (3%)</c>

        <c>57B (19%)</c>


        <c>BXML</c>

        <c>med</c>

        <c>177B (86%)</c>

        <c>210B (51%)</c>

        <c>177B (59%)</c>


        <c>FI</c>

        <c>med</c>

        <c>143B (69%)</c>

        <c>200B (49%)</c>

        <c>185B (62%)</c>

    	  </texttable>


      </section>

	<!-- **************************************************************** -->
	<!-- **************************************************************** -->
	<!-- **************************************************************** -->
	<!-- **************************************************************** -->
	<section anchor='requirements' title="6LowApp Requirements">

		<t>
		The use of compact XML encoding requires very little from the application protocol of 6LowApp. In practice just a payload, and a way to indicate in the header what the Internet media type and the content transfer encoding of that payload are. This allows these standard techniques to be used without modification. One technique for encoding the type and transfer encoding in a binary header is included in <xref target="I-D.frank-6lowapp-chopan"/>.
		</t>
		
		<t>
		When performing application commissioning in 6LowApp some well-known encoding must be used or included in the commissioning technique. If the same application protocol is used also for commissioning, such as done with DPWS, then the payload should use a well-known markup (XML) and encoding. Based on the findings here, EXI would be a recommended choice for XML.
		</t>
		
		<t>The Internet media types (MIME) <xref target="RFC2046"/> should be indicated by the application protocol header. This SHOULD be encoded in a compact form. Examples of typical content-types that need to be supported for efficient XML encoding:
		    <list style="symbols">
			 <t>text/xml <xref target="RFC3023"/></t>
			 <t>application/xml <xref target="RFC3023"/></t>
			 <t>application/rdf+xml <xref target="RFC3870"/></t>
			 <t>application/soap+xml <xref target="RFC3902"/></t>
			 <t>application/atom+xml <xref target="RFC5023"/></t>
			 <t>application/rss+xml</t>
			 <!-- <t>text/x-exi, application/x-exi and *x-exi</t> -->
			 <t>text/x-bxml, application/x-bxml and *+x-bxml <xref target="OGC-BXML"/></t>
			 <t>application/fastinfoset, application/soap+fastinfoset and *+fastinfoset <xref target="FI"/></t>
			 <t>Unknown binary content SHOULD be treated as application/octet-stream <xref target="RFC2045"/><xref target="RFC2046"/></t>
			 <t>For simplicity it is not recommended that multipart/mixed is supported.</t>
		    </list>
		</t>
		
		<t>The content transfer encoding <xref target="RFC2045"/> should be optionally indicated by the application protocol header, and is needed at least by EXI. This SHOULD be encoded in a compact form. At least the following need to be supported:
		    <list style="symbols">
			 <t>x-exi <xref target="W3C.WD-exi-best-practices-20071219"/></t>
			 <t>binary</t>
		    </list>
		</t>
		

      </section>


	<!-- **************************************************************** -->
	<!-- **************************************************************** -->
	<!-- **************************************************************** -->
	<!-- **************************************************************** -->

	<section title="Conclusions">
         <t>  
	   Efficient XML encoding will be a key technology for enabling the embedded web, which 6LowApp will benefit greatly by supporting. The results of this analysis show that efficient XML 
	   encoding is possible within the payload and complexity constraints aimed at by 6LowApp. Although it was found that EXI is highly suitable for these types of applications, the conclusion is that any of these and other encodings may be appropriate depending on the application. 
	   </t>
	   <t>
	   The recommendation is that 6LowApp should support a reasonable range of Internet media types and transfer encodings related to XML and common XML encodings. 
	   </t>

	</section>

	<!-- **************************************************************** -->
	<!-- **************************************************************** -->
	<!-- **************************************************************** -->
	<!-- **************************************************************** -->

	<section title="Security Considerations">
         <t>
	   No security issues have been identified in this draft.
		
	   </t>

	</section>
   
	<!-- **************************************************************** -->
	<!-- **************************************************************** -->
	<!-- **************************************************************** -->
	<!-- **************************************************************** -->  
   
	<section title="IANA Considerations">
         <t>
         This draft requires no IANA consideration.
	   </t>	   
	</section>

<!------------------------------------------------------>
<!--	SECTION: ACKNOWLEDGMENTS		      -->
<!------------------------------------------------------>

<section title="Acknowledgments">
<t></t>
</section>

    </middle>

    <back>
    <references title='Normative References'>
    
       &RFC4944;
       &RFC2045;
       &RFC2046;
       &RFC3023;
       &RFC3870;
       &RFC3902;
       &RFC5023;
       
       &I-D.frank-6lowapp-chopan;
       
       &W3C.WD-exi-20080919;
       
       <reference anchor="OGC-BXML">
        <front>
            <title>Binary Extensible Markup Language (BXML) Encoding Specification, Version 0.0.8</title>
            <author initials="" surname="" fullname="">
                <organization>Open Geospatial Consortium</organization>
            </author>
            <date month="Jan" year="2006" />
        </front>
        <seriesInfo name="" value="" />
       </reference>

       <reference anchor="OGC-SensorML">
        <front>
            <title>OpenGIS Sensor Model Language (SensorML) Implementation Specification, Version 1.0.0</title>
            <author initials="" surname="" fullname="">
                <organization>Open Geospatial Consortium</organization>
            </author>
            <date month="June" year="2007" />
        </front>
        <seriesInfo name="" value="" />
       </reference>


	<reference anchor="FI">
	<front>
	<title> Information technology - Generic applications of ASN.1: Fast infoset</title>
	<author>
	<organization>International Telecommunications Union</organization>
	</author>
	<date month="" year="2005" />
	</front>
	<seriesInfo name="ITU-T" value="Recommendation X.891" />
	</reference>


    </references>

    <references title='Informative References'>

       &I-D.bormann-6lowpan-6lowapp-problem;

       &W3C.WD-exi-primer-20071219;
       &W3C.WD-exi-best-practices-20071219;
       &W3C.WD-exi-evaluation-20090407;

    <reference anchor="Locawe-BXML">
        <front>
            <title>Developing geosensor network support for Locawe platform - application of standards in low-rate communication context</title>
            <author fullname="M. Luimula"><organization/></author>
            <author fullname="Z. Shelby"><organization/></author>
            <author fullname="J. Markkula"><organization/></author>
            <author fullname="J. Ternonen"><organization/></author>
            <author fullname="P. Wickstrom"><organization/></author>
            <author fullname="P. Verronen"><organization/></author>
        </front>
        <seriesInfo name="Proceedings of the 6th International Conference on Pervasive Services" value="London, UK, July 13-16, 2009, 73-82" />
    </reference>

<!--    <reference anchor="SENSEI" target="http://www.sensei-project.eu">
        <front>
            <title>SENSEI (Integrating the Physical with the Digital World of the Network of the Future)</title>
            <author initials="" surname="" fullname="">
                <organization />
            </author>
        </front>
    </reference> 
 -->

    <reference anchor="EXIficient" target="http://exificient.sourceforge.net">
        <front>
            <title>EXIficient Project Home Page</title>
            <author initials="" surname="" fullname="">
                <organization />
            </author>
        </front>
    </reference>
    
    <reference anchor="FI@GlassFish" target="https://fi.dev.java.net">
        <front>
            <title>Fast Infoset GlassFish Project Home Page</title>
            <author initials="" surname="" fullname="">
                <organization />
            </author>
        </front>
    </reference>


    </references>
    
    </back>

</rfc>

PAFTECH AB 2003-20262026-04-23 13:22:57