Welcome!

Industrial IoT Authors: Elizabeth White, Mike Wood, Pat Romanski, Yeshim Deniz, SmartBear Blog

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
In his session at @ThingsExpo, Eric Lachapelle, CEO of the Professional Evaluation and Certification Board (PECB), provided an overview of various initiatives to certify 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 worldwide re...
The Internet giants are fully embracing AI. All the services they offer to their customers are aimed at drawing a map of the world with the data they get. The AIs from these companies are used to build disruptive approaches that cannot be used by established enterprises, which are threatened by these disruptions. However, most leaders underestimate the effect this will have on their businesses. In his session at 21st Cloud Expo, Rene Buest, Director Market Research & Technology Evangelism at Ara...
SYS-CON Events announced today that Enzu will exhibit at SYS-CON's 21st Int\ernational Cloud Expo®, which will take place October 31-November 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Enzu’s mission is to be the leading provider of enterprise cloud solutions worldwide. Enzu enables online businesses to use its IT infrastructure to their competitive advantage. By offering a suite of proven hosting and management services, Enzu wants companies to focus on the core of their ...
With major technology companies and startups seriously embracing Cloud strategies, now is the perfect time to attend 21st Cloud Expo October 31 - November 2, 2017, at the Santa Clara Convention Center, CA, and June 12-14, 2018, at the Javits Center in New York City, NY, and learn what is going on, contribute to the discussions, and ensure that your enterprise is on the right path to Digital Transformation.
Internet of @ThingsExpo, taking place October 31 - November 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA, is co-located with 21st Cloud Expo and will feature technical sessions from a rock star conference faculty and the leading industry players in the world. The Internet of Things (IoT) is the most profound change in personal and enterprise IT since the creation of the Worldwide Web more than 20 years ago. All major researchers estimate there will be tens of billions devic...
Amazon started as an online bookseller 20 years ago. Since then, it has evolved into a technology juggernaut that has disrupted multiple markets and industries and touches many aspects of our lives. It is a relentless technology and business model innovator driving disruption throughout numerous ecosystems. Amazon’s AWS revenues alone are approaching $16B a year making it one of the largest IT companies in the world. With dominant offerings in Cloud, IoT, eCommerce, Big Data, AI, Digital Assista...
SYS-CON Events announced today that Cloud Academy named "Bronze Sponsor" of 21st International Cloud Expo which will take place October 31 - November 2, 2017 at the Santa Clara Convention Center in Santa Clara, CA. Cloud Academy is the industry’s most innovative, vendor-neutral cloud technology training platform. Cloud Academy provides continuous learning solutions for individuals and enterprise teams for Amazon Web Services, Microsoft Azure, Google Cloud Platform, and the most popular cloud com...
When growing capacity and power in the data center, the architectural trade-offs between server scale-up vs. scale-out continue to be debated. Both approaches are valid: scale-out adds multiple, smaller servers running in a distributed computing model, while scale-up adds fewer, more powerful servers that are capable of running larger workloads. It’s worth noting that there are additional, unique advantages that scale-up architectures offer. One big advantage is large memory and compute capacity...
No hype cycles or predictions of zillions of things here. IoT is big. You get it. You know your business and have great ideas for a business transformation strategy. What comes next? Time to make it happen. In his session at @ThingsExpo, Jay Mason, Associate Partner at M&S Consulting, presented a step-by-step plan to develop your technology implementation strategy. He discussed the evaluation of communication standards and IoT messaging protocols, data analytics considerations, edge-to-cloud tec...
"When we talk about cloud without compromise what we're talking about is that when people think about 'I need the flexibility of the cloud' - it's the ability to create applications and run them in a cloud environment that's far more flexible,” explained Matthew Finnie, CTO of Interoute, in this SYS-CON.tv interview at 20th Cloud Expo, held June 6-8, 2017, at the Javits Center in New York City, NY.
SYS-CON Events announced today that MobiDev, a client-oriented software development company, will exhibit at SYS-CON's 21st International Cloud Expo®, which will take place October 31-November 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. MobiDev is a software company that develops and delivers turn-key mobile apps, websites, web services, and complex software systems for startups and enterprises. Since 2009 it has grown from a small group of passionate engineers and business...
SYS-CON Events announced today that GrapeUp, the leading provider of rapid product development at the speed of business, will exhibit at SYS-CON's 21st International Cloud Expo®, which will take place October 31-November 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Grape Up is a software company, specialized in cloud native application development and professional services related to Cloud Foundry PaaS. With five expert teams that operate in various sectors of the market acr...
SYS-CON Events announced today that Ayehu will exhibit at SYS-CON's 21st International Cloud Expo®, which will take place on October 31 - November 2, 2017 at the Santa Clara Convention Center in Santa Clara California. Ayehu provides IT Process Automation & Orchestration solutions for IT and Security professionals to identify and resolve critical incidents and enable rapid containment, eradication, and recovery from cyber security breaches. Ayehu provides customers greater control over IT infras...
We build IoT infrastructure products - when you have to integrate different devices, different systems and cloud you have to build an application to do that but we eliminate the need to build an application. Our products can integrate any device, any system, any cloud regardless of protocol," explained Peter Jung, Chief Product Officer at Pulzze Systems, in this SYS-CON.tv interview at @ThingsExpo, held November 1-3, 2016, at the Santa Clara Convention Center in Santa Clara, CA
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, discussed some of the security challenges of the IoT infrastructure and related how these aspects impact Smart Living. The material was delivered interac...
Artificial intelligence, machine learning, neural networks. We’re in the midst of a wave of excitement around AI such as hasn’t been seen for a few decades. But those previous periods of inflated expectations led to troughs of disappointment. Will this time be different? Most likely. Applications of AI such as predictive analytics are already decreasing costs and improving reliability of industrial machinery. Furthermore, the funding and research going into AI now comes from a wide range of com...
In his session at Cloud Expo, Alan Winters, an entertainment executive/TV producer turned serial entrepreneur, presented a success story of an entrepreneur who has both suffered through and benefited from offshore development across multiple businesses: The smart choice, or how to select the right offshore development partner Warning signs, or how to minimize chances of making the wrong choice Collaboration, or how to establish the most effective work processes Budget control, or how to ma...
IoT solutions exploit operational data generated by Internet-connected smart “things” for the purpose of gaining operational insight and producing “better outcomes” (for example, create new business models, eliminate unscheduled maintenance, etc.). The explosive proliferation of IoT solutions will result in an exponential growth in the volume of IoT data, precipitating significant Information Governance issues: who owns the IoT data, what are the rights/duties of IoT solutions adopters towards t...
SYS-CON Events announced today that CA Technologies has been named "Platinum Sponsor" of SYS-CON's 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 planning to development to management to security, CA creates software that fuels transformation for companies in the applic...
SYS-CON Events announced today that IBM has been named “Diamond Sponsor” of SYS-CON's 21st Cloud Expo, which will take place on October 31 through November 2nd 2017 at the Santa Clara Convention Center in Santa Clara, California.