Welcome!

Industrial IoT Authors: JP Morgenthal, Derek Weeks, Liz McMillan, Elizabeth White, William Schmarzo

Related Topics: Industrial IoT

Industrial IoT: Article

XML Without Wires - Part 1 of 2

XML Without Wires - Part 1 of 2

Wireless transmission is becoming more and more common for many document types, and XML is no exception. But XML itself presents a number of challenges to the wireless medium. This article, the first in a two-part series, describes these challenges, and describes techniques that can be used to tailor an XML-aware system to the wireless world.

Wireless bandwidth continues to be at a premium, despite the long-standing promises of 2.5G and 3G networks. XML isn't binary, and while this means that knotty problems like little-endian/big-endian confusion are avoided, it also means that raw XML data isn't ideal for wireless transmission. In fact, design goal No. 10 for XML states that "terseness in XML markup is of minimal importance." This doesn't rule out XML for wireless transmission, but it does mean that compression is a must.

WBXML - Binary XML
The Wireless Application Protocol is a specification for developing applications that operate over wireless communication networks. The development of WAP is overseen by the WAP Forum, an industry consortium that includes Ericsson, IBM, Motorola, and Openwave. The wireless market is growing very quickly and is expanding to reach new customers with new services. To enable network operators and handset manufacturers to meet the challenge of deploying advanced services, WAP defines a set of protocols in transport, session, and application layers.

One component of the WAP specification that has been submitted to the World Wide Web Consortium is a description of Wireless Binary XML (WBXML for short). WBXML defines a compact binary representation of XML. It reduces the transmission size of XML documents, allowing more effective use of XML data on narrowband communication channels. WBXML achieves this by tokenizing XML files to reduce (1) the number of bytes needed to send data over the wireless channel as well as (2) the need for a complex parser by constraining the file format so it can be rapidly parsed in binary form.

To send a WBXML file most efficiently, it's important to provide an initial token mapping for the channel. Some token mappings are specified in the WAP specification - WML, for example. Other XML formats may be used with WBXML without a mapping, but the transmission is more verbose, since the tag names need to be listed in a string list at the start of the transmission.

ASN.1
If all this talk of tokenizing files for binary transmission sounds familiar, it's because it reflects an older standard, Abstract Syntax Notation 1, published jointly by the International Standards Organization, the International Electrotechnical Commission, and the International Telecommunications Union. It hasn't gone away.

Like WBXML, ASN.1 is a collection of techniques and notations for specifying data structures in a machine-independent manner. Token sets defined using ASN.1 can be used in combination with standardized encoding rules such as the Basic Encoding Rules (BER) and the Packed Encoding Rules (PER). ASN.1 is supported by mature tools for encoding and decoding binary information into and out of BER and PER formats, as well as to other proprietary encoding formats.

ASN.1 is widely deployed in the wireless and fixed-line communications industry as an enabling technology for cell phone messages, radio paging, free and premium phone services, and ISDN telephony. In addition, it is used for streaming audio and video over the Internet, and is fundamental to ISO security and messaging standards, including X.509 digital certificates and X.400 e-mail.

If a widely used protocol like ASN.1 already exists and has widespread adoption, then why generate a new protocol like WBXML especially for wireless adoption? This question has been posed in the past for many wireless initiatives, including WTLS (versus SSL), WScript (versus JavaScript), and, of course, WML (versus HTML). One answer in this case is that WBXML is specifically linked to XML and preserves the treelike nature of an XML document, allowing a recipient system to deal selectively with XML tags. ASN.1 and XML do not have congruent data models, and so the translation between them is not a straightforward exercise.

Another possible drawback is the lack of freely available tools for ASN.1. By contrast, the XML world contains many free tools, such as xalan for XSL stylesheets and xerces for Document Object Model processing. However, if ASN.1 were to be recommended for wireless XML processing, free tools would likely come onto the scene quickly.

This incongruity of XML and ASN.1 is being addressed by two ITU/ISO initiatives that map XML to ASN.1 and vice versa. The first, AML (ASN.1 Markup Language), represents ASN.1 data types as XML, and is to be the ITU-T Recommendation X.693 and ISO/IEC 8825-4. The second maps XML Schemas to ASN.1 in such a way as to preserve all the information contained in the XML Schema definition. This will allow data defined as XML to take advantage of ASN.1 tools such as DER (to encrypt and digitally sign data, for example) and PER (to send data over radio, for example). This initiative is to be the ITU-T Recommendation X.694 and ISO/IEC 8825-5. Information about these two initiatives is available at http://asn1.elibel.tm.fr/xml.

The focus on XML Schemas rather than DTDs for these two ITU/ISO initiatives reflects the fact that Schemas are closer to ANS.1 than DTDs are. However, tools are available to map between the two; one example is the ASN.1/XML Translator, which is part of IBM's XML Security Suite (see www.trl.ibm.com/projects/xml/xss4j).

Encoding Techniques
Focusing on document size, let's compare the encoding formats we've discussed so far: ASN.1, WBXML, and plain XML. First, let's use the DTD that follows to define a simple purchase order document.

<!ELEMENT PurchaseOrder (LineItem+)>
<!ELEMENT LineItem (Description, Quantity)>
<!ELEMENT Description (#PCDATA)>
<!ELEMENT Quantity (#PCDATA)>
<!ATTLIST LineItem
Department ( Food | Hardware | Pharmacy) #REQUIRED>
The next code snippet is an example of an XML document that conforms to this DTD.
<?xml version="1.0" ?>
<!DOCTYPE PurchaseOrder SYSTEM "PO.dtd">
<PurchaseOrder>
<LineItem Department="Food">
<Description>Cookies</Description>
<Quantity>5</Quantity>
</LineItem>
<LineItem Department="Hardware">
<Description>Hammers</Description>
<Quantity>10</Quantity>
</LineItem>
</PurchaseOrder>
Now let's look at an ANS.1 specification for the same simple purchase order document. In the following code you can see that we're using the SEQUENCE, INTEGER, and ENUMERATED ASN.1 data types. Information about the full range of ASN.1 data types is available at http://asn1.elibel.tm.fr/xml.
PurchaseOrder ::= SEQUENCE OF LineItems
LineItem ::= SEQUENCE {
Description VisibleString,
Quantity INTEGER,
department Department }
Department::= ENUMERATED {
Food(0), Hardware(1), Pharmacy(2) }
Using BER encoding, we see that the document is considerably smaller than the plain XML document in the second code snippet. Note that PER encoding is optimized for radio transmission and compresses the document still further:
10 18
1A 07 'C' 'o' 'o' 'k' 'i' 'e' 's'
02 02 05
0A 00 00
0A 01 01
1A 07 'H' 'a' 'm' 'm' 'e' 'r' 's'
02 02 0A
0A 01 01
0A 01 01
Now we come to the WBXML specification for the same document. WBXML caters specifically to XML, so we define tokens to represent XML elements and XML attributes, as follows:
Tag code space (Tag Name : Token ) :

PurchaseOrder : 5
LineItem : 6
Description : 7
Quantity : 8

Attribute start tokens:
(Attribute: Attribute Value Prefix : Token)
Department : Food : 5
The following shows the purchase order data represented in WBXML encoding, using the tokens we defined above. WBXML uses string tables to list strings used in the XML document, and following this string table we see that all the data takes the form of tokens.
01 01 03
10 'C' 'o' 'o' 'k' 'i' 'e' 's' 00 'H' 'a' 'm' 'm' 'e' 'r' 's' 00
45 C5 07 83 00 05 05 01
45 C5 07 83 09 06 0A 01
01
So Many Wireless Devices, So Little Time
The limited display capabilities of mobile handsets has led to the need to optimize data views/formats for display on these devices. While these new developments have benefited the mobile user experience and have increased uptake of mobile applications, they have added greater complexity to the role of content providers. With the increasing numbers of different devices available for retrieval and display of information over the Internet comes the added headache of customizing the display of the data on each device. Content providers who don't offer easy access to their information across multiple devices risk losing customers. What's suitable for one device may be unacceptable for another. However, the problem is that re-creating and customizing data outputs for different media and on different devices is very resource-intensive and may eventually become unmanageable.

Sun Translets: Two Steps Instead of Three
XSLT is a standard that addresses the problem of transformations between the many proprietary and industry-vertical XML vocabularies. It can also be used to format documents for output to different display devices (phone handsets, PDAs) when using XML as a base data storage format.

XSL Transformations are executed using an XSLT engine, which typically tends to be a large and complex program. It reads in an XML file, reads in an XSL stylesheet, loads the XSLT logic into memory, and then applies the XSLT logic to the XML document. This three-step process is often a bottleneck for wireless deployment to multiple devices, losing valuable time for content delivery.

Sun's XSLT compiler simplifies the transformation process. First, a Java class known as a translet is produced from an XSLT stylesheet. This translet is then applied to the XML files that use the original XSL stylesheet. This technique has important advantages of speed and size over the traditional three-step method of applying stylesheets. The speed advantage is that step 1 - compiling the stylesheet into a Java class - only has to be performed once. The compiled translet can then be applied to multiple XML documents.

The size advantage is that only the XSL logic used by the stylesheet is compiled into the translet. The rest of the XSL language logic isn't needed. For most stylesheets this reduces the size of the application logic considerably. XSLT engines weigh in at 700 to 800KB - translets may be only 10 to 50KB. Sun has donated their translet engine to the open-source community, with the result that the xalan XSLT engine now incorporates translet logic. The speed gains from using translets make XSL more palatable as a technology choice to address the problem of content deployment to multiple wireless devices.

The smaller size of translets, compared to using a full XSLT engine, means that this is suitable for wireless devices that incorporate J2ME (Java 2 Micro Edition) implementations. Sun's J2ME specification defines a Connected Limited Device Configuration (CLDC) that can be implemented by a handheld wireless device. A CLDC device may well have a processor of limited prowess (in comparison to a desktop system) and a memory footprint of between 128 and 512KB. This means that running a full XSLT engine is out of the question. However, a translet is much smaller and can run in the tight memory confines of a CLDC device.

The Downside of XSL
Notwithstanding the efficiency gained when using translets, XSL can be an unappealing development tool because of the complexity inherent in creating and maintaining XSL stylesheets. XSL is a templatic (template-based) language that can confound software developers who are used to the logic in their programs being executed in a top-to-bottom sequence. The fact that the templates in an XSL stylesheet can be jumbled up into a different order, yet the stylesheet still produces the same output, is counterintuitive.

The complexity of the XSL language can result in solutions that are difficult to maintain. Adding to this problem is that although XSL doesn't mix presentation with data, it does mix presentation with logic. As mentioned above, logic expressed in XSL can be complex. XSL skills are required by a Web designer who wishes to change the graphical output of a transformation. Technologies such as JSP (JavaServer Pages) or ASP (Active Server Pages) are more similar to traditional programming languages and as such may be more suitable for ongoing maintenance and code reuse.

Summary
In this article I've discussed the compression techniques for XML that are essential for the wireless transmission of XML documents. I also covered the use of XSL, with and without translet technology, to tailor XML base data for multiple wireless devices. In Part 2 I'll discuss other technologies for wireless XML, such as VoiceXML, WAP and WML, and HDML, as well as wireless techniques for signing and encrypting XML documents.

More Stories By Mark O'Neill

Mark O'Neill is VP Innovation at Axway - API and Identity. Previously he was CTO and co-founder at Vordel, which was acquired by Axway. A regular speaker at industry conferences and a contributor to SOA World Magazine and Cloud Computing Journal, Mark holds a degree in mathematics and psychology from Trinity College Dublin and graduate qualifications in neural network programming from Oxford University.

Comments (0)

Share your thoughts on this story.

Add your comment
You must be signed in to add a comment. Sign-in | Register

In accordance with our Comment Policy, we encourage comments that are on topic, relevant and to-the-point. We will remove comments that include profanity, personal attacks, racial slurs, threats of violence, or other inappropriate material that violates our Terms and Conditions, and will block users who make repeated violations. We ask all readers to expect diversity of opinion and to treat one another with dignity and respect.


@ThingsExpo Stories
Web Real-Time Communication APIs have quickly revolutionized what browsers are capable of. In addition to video and audio streams, we can now bi-directionally send arbitrary data over WebRTC's PeerConnection Data Channels. With the advent of Progressive Web Apps and new hardware APIs such as WebBluetooh and WebUSB, we can finally enable users to stitch together the Internet of Things directly from their browsers while communicating privately and securely in a decentralized way.
"Matrix is an ambitious open standard and implementation that's set up to break down the fragmentation problems that exist in IP messaging and VoIP communication," explained John Woolf, Technical Evangelist at Matrix, in this SYS-CON.tv interview at @ThingsExpo, held Nov 4–6, 2014, at the Santa Clara Convention Center in Santa Clara, CA.
"A lot of times people will come to us and have a very diverse set of requirements or very customized need and we'll help them to implement it in a fashion that you can't just buy off of the shelf," explained Nick Rose, CTO of Enzu, in this SYS-CON.tv interview at 18th Cloud Expo, held June 7-9, 2016, at the Javits Center in New York City, NY.
Web Real-Time Communication APIs have quickly revolutionized what browsers are capable of. In addition to video and audio streams, we can now bi-directionally send arbitrary data over WebRTC's PeerConnection Data Channels. With the advent of Progressive Web Apps and new hardware APIs such as WebBluetooh and WebUSB, we can finally enable users to stitch together the Internet of Things directly from their browsers while communicating privately and securely in a decentralized way.
Who are you? How do you introduce yourself? Do you use a name, or do you greet a friend by the last four digits of his social security number? Assuming you don’t, why are we content to associate our identity with 10 random digits assigned by our phone company? Identity is an issue that affects everyone, but as individuals we don’t spend a lot of time thinking about it. In his session at @ThingsExpo, Ben Klang, Founder & President of Mojo Lingo, discussed the impact of technology on identity. Sho...
"Operations is sort of the maturation of cloud utilization and the move to the cloud," explained Steve Anderson, Product Manager for BMC’s Cloud Lifecycle Management, in this SYS-CON.tv interview at 18th Cloud Expo, held June 7-9, 2016, at the Javits Center in New York City, NY.
"I think that everyone recognizes that for IoT to really realize its full potential and value that it is about creating ecosystems and marketplaces and that no single vendor is able to support what is required," explained Esmeralda Swartz, VP, Marketing Enterprise and Cloud at Ericsson, in this SYS-CON.tv interview at @ThingsExpo, held June 7-9, 2016, at the Javits Center in New York City, NY.
The buzz continues for cloud, data analytics and the Internet of Things (IoT) and their collective impact across all industries. But a new conversation is emerging - how do companies use industry disruption and technology enablers to lead in markets undergoing change, uncertainty and ambiguity? Organizations of all sizes need to evolve and transform, often under massive pressure, as industry lines blur and merge and traditional business models are assaulted and turned upside down. In this new da...
Bert Loomis was a visionary. This general session will highlight how Bert Loomis and people like him inspire us to build great things with small inventions. In their general session at 19th Cloud Expo, Harold Hannon, Architect at IBM Bluemix, and Michael O'Neill, Strategic Business Development at Nvidia, discussed the accelerating pace of AI development and how IBM Cloud and NVIDIA are partnering to bring AI capabilities to "every day," on-demand. They also reviewed two "free infrastructure" pr...
With major technology companies and startups seriously embracing IoT strategies, now is the perfect time to attend @ThingsExpo 2016 in New York. Learn what is going on, contribute to the discussions, and ensure that your enterprise is as "IoT-Ready" as it can be! Internet of @ThingsExpo, taking place June 6-8, 2017, at the Javits Center in New York City, New York, is co-located with 20th Cloud Expo and will feature technical sessions from a rock star conference faculty and the leading industry p...
It is one thing to build single industrial IoT applications, but what will it take to build the Smart Cities and truly society changing applications of the future? The technology won’t be the problem, it will be the number of parties that need to work together and be aligned in their motivation to succeed. In his Day 2 Keynote at @ThingsExpo, Henrik Kenani Dahlgren, Portfolio Marketing Manager at Ericsson, discussed how to plan to cooperate, partner, and form lasting all-star teams to change the...
SYS-CON Events announced today that delaPlex will exhibit at SYS-CON's @CloudExpo, which will take place on June 6-8, 2017, at the Javits Center in New York City, NY. delaPlex pioneered Software Development as a Service (SDaaS), which provides scalable resources to build, test, and deploy software. It’s a fast and more reliable way to develop a new product or expand your in-house team.
SYS-CON Events announced today that IoT Now has been named “Media Sponsor” of SYS-CON's 20th International Cloud Expo, which will take place on June 6–8, 2017, at the Javits Center in New York City, NY. IoT Now explores the evolving opportunities and challenges facing CSPs, and it passes on some lessons learned from those who have taken the first steps in next-gen IoT services.
SYS-CON Events announced today that WineSOFT will exhibit at SYS-CON's 20th International Cloud Expo®, which will take place on June 6-8, 2017, at the Javits Center in New York City, NY. Based in Seoul and Irvine, WineSOFT is an innovative software house focusing on internet infrastructure solutions. The venture started as a bootstrap start-up in 2010 by focusing on making the internet faster and more powerful. WineSOFT’s knowledge is based on the expertise of TCP/IP, VPN, SSL, peer-to-peer, mob...
The explosion of new web/cloud/IoT-based applications and the data they generate are transforming our world right before our eyes. In this rush to adopt these new technologies, organizations are often ignoring fundamental questions concerning who owns the data and failing to ask for permission to conduct invasive surveillance of their customers. Organizations that are not transparent about how their systems gather data telemetry without offering shared data ownership risk product rejection, regu...
The Internet of Things can drive efficiency for airlines and airports. In their session at @ThingsExpo, Shyam Varan Nath, Principal Architect with GE, and Sudip Majumder, senior director of development at Oracle, discussed the technical details of the connected airline baggage and related social media solutions. These IoT applications will enhance travelers' journey experience and drive efficiency for the airlines and the airports.
With billions of sensors deployed worldwide, the amount of machine-generated data will soon exceed what our networks can handle. But consumers and businesses will expect seamless experiences and real-time responsiveness. What does this mean for IoT devices and the infrastructure that supports them? More of the data will need to be handled at - or closer to - the devices themselves.
SYS-CON Events announced today that Dataloop.IO, an innovator in cloud IT-monitoring whose products help organizations save time and money, has been named “Bronze Sponsor” of SYS-CON's 20th International Cloud Expo®, which will take place on June 6-8, 2017, at the Javits Center in New York City, NY. Dataloop.IO is an emerging software company on the cutting edge of major IT-infrastructure trends including cloud computing and microservices. The company, founded in the UK but now based in San Fran...
Big Data, cloud, analytics, contextual information, wearable tech, sensors, mobility, and WebRTC: together, these advances have created a perfect storm of technologies that are disrupting and transforming classic communications models and ecosystems. In his session at @ThingsExpo, Erik Perotti, Senior Manager of New Ventures on Plantronics’ Innovation team, provided an overview of this technological shift, including associated business and consumer communications impacts, and opportunities it m...
In his keynote at @ThingsExpo, Chris Matthieu, Director of IoT Engineering at Citrix and co-founder and CTO of Octoblu, focused on building an IoT platform and company. He provided a behind-the-scenes look at Octoblu’s platform, business, and pivots along the way (including the Citrix acquisition of Octoblu).