Welcome!

Industrial IoT Authors: Peter Silva, Liz McMillan, Elizabeth White, Kevin Jackson, Chris Colosimo

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
Keeping pace with advancements in software delivery processes and tooling is taxing even for the most proficient organizations. Point tools, platforms, open source and the increasing adoption of private and public cloud services requires strong engineering rigor - all in the face of developer demands to use the tools of choice. As Agile has settled in as a mainstream practice, now DevOps has emerged as the next wave to improve software delivery speed and output. To make DevOps work, organization...
DevOps is often described as a combination of technology and culture. Without both, DevOps isn't complete. However, applying the culture to outdated technology is a recipe for disaster; as response times grow and connections between teams are delayed by technology, the culture will die. A Nutanix Enterprise Cloud has many benefits that provide the needed base for a true DevOps paradigm.
What sort of WebRTC based applications can we expect to see over the next year and beyond? One way to predict development trends is to see what sorts of applications startups are building. In his session at @ThingsExpo, Arin Sime, founder of WebRTC.ventures, will discuss the current and likely future trends in WebRTC application development based on real requests for custom applications from real customers, as well as other public sources of information,
SYS-CON Events announced today that Interoute, owner-operator of one of Europe's largest networks and a global cloud services platform, has been named “Bronze Sponsor” of SYS-CON's 20th Cloud Expo, which will take place on June 6-8, 2017 at the Javits Center in New York, New York. Interoute is the owner-operator of one of Europe's largest networks and a global cloud services platform which encompasses 12 data centers, 14 virtual data centers and 31 colocation centers, with connections to 195 add...
TechTarget storage websites are the best online information resource for news, tips and expert advice for the storage, backup and disaster recovery markets. By creating abundant, high-quality editorial content across more than 140 highly targeted technology-specific websites, TechTarget attracts and nurtures communities of technology buyers researching their companies' information technology needs. By understanding these buyers' content consumption behaviors, TechTarget creates the purchase inte...
With the introduction of IoT and Smart Living in every aspect of our lives, one question has become relevant: What are the security implications? To answer this, first we have to look and explore the security models of the technologies that IoT is founded upon. In his session at @ThingsExpo, Nevi Kaja, a Research Engineer at Ford Motor Company, will discuss some of the security challenges of the IoT infrastructure and relate how these aspects impact Smart Living. The material will be delivered i...
In his session at @ThingsExpo, Eric Lachapelle, CEO of the Professional Evaluation and Certification Board (PECB), will provide an overview of various initiatives to certifiy the security of connected devices and future trends in ensuring public trust of IoT. Eric Lachapelle is the Chief Executive Officer of the Professional Evaluation and Certification Board (PECB), an international certification body. His role is to help companies and individuals to achieve professional, accredited and worldw...
My team embarked on building a data lake for our sales and marketing data to better understand customer journeys. This required building a hybrid data pipeline to connect our cloud CRM with the new Hadoop Data Lake. One challenge is that IT was not in a position to provide support until we proved value and marketing did not have the experience, so we embarked on the journey ourselves within the product marketing team for our line of business within Progress. In his session at @BigDataExpo, Sum...
Your homes and cars can be automated and self-serviced. Why can't your storage? From simply asking questions to analyze and troubleshoot your infrastructure, to provisioning storage with snapshots, recovery and replication, your wildest sci-fi dream has come true. In his session at @DevOpsSummit at 20th Cloud Expo, Dan Florea, Director of Product Management at Tintri, will provide a ChatOps demo where you can talk to your storage and manage it from anywhere, through Slack and similar services ...
SYS-CON Events announced today that SoftLayer, an IBM Company, has been named “Gold Sponsor” of SYS-CON's 18th Cloud Expo, which will take place on June 7-9, 2016, at the Javits Center in New York, New York. SoftLayer, an IBM Company, provides cloud infrastructure as a service from a growing number of data centers and network points of presence around the world. SoftLayer’s customers range from Web startups to global enterprises.
SYS-CON Events announced today that Ocean9will 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. Ocean9 provides cloud services for Backup, Disaster Recovery (DRaaS) and instant Innovation, and redefines enterprise infrastructure with its cloud native subscription offerings for mission critical SAP workloads.
SYS-CON Events announced today that Linux Academy, the foremost online Linux and cloud training platform and community, 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. Linux Academy was founded on the belief that providing high-quality, in-depth training should be available at an affordable price. Industry leaders in quality training, provided services, and student certification passes, its goal is to c...
SYS-CON Events announced today that Telecom Reseller 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. Telecom Reseller reports on Unified Communications, UCaaS, BPaaS for enterprise and SMBs. They report extensively on both customer premises based solutions such as IP-PBX as well as cloud based and hosted platforms.
SYS-CON Events announced today that Loom Systems 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. Founded in 2015, Loom Systems delivers an advanced AI solution to predict and prevent problems in the digital business. Loom stands alone in the industry as an AI analysis platform requiring no prior math knowledge from operators, leveraging the existing staff to succeed in the digital era. With offices in S...
SYS-CON Events announced today that T-Mobile 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. As America's Un-carrier, T-Mobile US, Inc., is redefining the way consumers and businesses buy wireless services through leading product and service innovation. The Company's advanced nationwide 4G LTE network delivers outstanding wireless experiences to 67.4 million customers who are unwilling to compromise on ...
SYS-CON Events announced today that Cloudistics, an on-premises cloud computing company, 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. Cloudistics delivers a complete public cloud experience with composable on-premises infrastructures to medium and large enterprises. Its software-defined technology natively converges network, storage, compute, virtualization, and management into a ...
SYS-CON Events announced today that CA Technologies has been named “Platinum 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, and the 21st International Cloud Expo®, which will take place October 31-November 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. CA Technologies helps customers succeed in a future where every business – from apparel to energy – is being rewritten by software. From ...
SYS-CON Events announced today that Infranics 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. Since 2000, Infranics has developed SysMaster Suite, which is required for the stable and efficient management of ICT infrastructure. The ICT management solution developed and provided by Infranics continues to add intelligence to the ICT infrastructure through the IMC (Infra Management Cycle) based on mathemat...
Now that the world has connected “things,” we need to build these devices as truly intelligent in order to create instantaneous and precise results. This means you have to do as much of the processing at the point of entry as you can: at the edge. The killer use cases for IoT are becoming manifest through AI engines on edge devices. An autonomous car has this dual edge/cloud analytics model, producing precise, real-time results. In his session at @ThingsExpo, John Crupi, Vice President and Eng...
In the enterprise today, connected IoT devices are everywhere – both inside and outside corporate environments. The need to identify, manage, control and secure a quickly growing web of connections and outside devices is making the already challenging task of security even more important, and onerous. In his session at @ThingsExpo, Rich Boyer, CISO and Chief Architect for Security at NTT i3, will discuss new ways of thinking and the approaches needed to address the emerging challenges of securit...