XML and Appliance Internet Frameworks - Embedded.com

XML and Appliance Internet Frameworks

Inexpensive and easy to install and operate, Internet appliances have enjoyed explosive growth over the past year. Defined as specialized and limited function computing devices that communicate with people or systems through the Internet, internet appliances, while still in their infancy, are rapidly maturing. As the technology evolves, internet appliances are causing fundamental shifts in both hardware and software that will shape the electronics industry of the future.

Although it is now at the forefront of the Internet revolution, Extensible Markup Language (XML) has not often been associated with Internet appliances or embedded devices. XML was recently adopted by the W3C (World Wide Web Consortium) as its “new” standard. XML extends HTML, its forerunner, by allowing more universal communication and information transfer on computer networks.

XML is currently being applied on a wide scale to improve communications of business-to-business (B2B) applications and to manage content for large dynamic web sites. XML has an equally important role in the evolution of Internet appliances.

Using a text base format, XML lets developers describe, deliver, and exchange structured data between or within applications or devices. In Internet appliances, XML has several potential uses in addition to the obvious role of managing data exchange and data display. XML can be used to improve the configuration and interoperability of networked devices. With appliances, XML can play a role in the following areas of operation:

  • Device Initialization
  • Network Address Resolution
  • Salutation and Service Discovery
  • Configuration of Services, Subsystems, and Drivers
  • Remote Procedure Calling
  • Data Exchange
  • Data Rendering.

Driven by industry leaders such as Microsoft, IBM, Oracle, and Sun, support for XML is growing and the availability of tools is increasing. Device manufacturers are beginning to use infrastructures built around XML for improving their device designs and interfaces. Furthermore, these benefits apply equally to all levels of computing platforms, not just Internet appliances.

Embedding XML
Before going in to detail about how XML can be used in Internet appliances, we must first tackle the problems associated with embedding XML in primitive computing platforms.

Unlike general-purpose computers, like PCs or workstations, appliances often run on small memory footprints with relatively primitive processor technology. Many of the tools, technologies, and writings about XML assume operation on general-purpose computer platforms and not on Internet appliances or embedded devices. For this reason, both code size and performance required to handle XML processing must be carefully considered when applying it to appliances.

Figure 1 : This figure depicts the processing of XML for Internet appliances. The processing is broken into two parts—processing executed on an appliance, and processing performed by a more capable computer off the appliance.

The box labeled computer could be any PC or workstation which provides the more computationally-intensive pre- or post-processing of the XML file.

The box on right is what's executed on the limited function simpler Internet appliance. The right half processing is typically performed on Internet appliance servers and the left half by Internet appliance clients.

There are several types of files associated with using XML. Constructing an XML file begins with a Document Type Description (DTD) or Schema (.XSD) file. Both of these files accomplish the same thing—they define the format and type of content included in an XML file. The newer Schema (.XSD) files include additional information about data types (i.e., string, integer, float) and validation rules for the information contained within an XML document.

________________________________________________________________Appliance Configuration DTD     Modified : Jeff Michalski-______________________________________________________________________<ELEMENT Appliance   (General | Hardware | Software )*      ><ELEMENT General    EMPTY               ><ATTLIST General    ServerName   CDATA              'Cybernode'Location         CDATA     #IMPLIED 'Austin, Tx'    EMail        CDATA      #IMPLIED 'info@concursys.com'  ><ELEMENT Processor   EMPTY<!ATTLIST Processor   CPU        (x86 |ARM)             'x86'Frequency   (120Mhz | 200MHz | 400Mhz)     '200Mhz'      ><ELEMENT Hardware    (Processor | Memory )*>        <ELEMENT Memory  (DRAM | Flash)*            ><ELEMENT DRAM    EMPTY>    <ATTLIST DRAM    Base_Address    CDATA      #FIXED      '0x0000000'Size (4MB | 8MB | 16MB | 32MB )'16MB'  ><ELEMENT Flash       EMPTY><ATTLIST Flash       Base_Address  CDATA        #FIXED      '0x4000000'Size        CDATA       #FIXED'4MB'       ><ELEMENT Software    (Operating_System | Services)* ><ELEMENT Operating_System EMPTY<!ATTLIST  Flash      Base_Address    CDATA      #FIXED'0x4000000' Size        CDATA       #FIXED      '4MB'          >                                    <ELEMENT Software    (Operating_System | Services)*       ><ELEMENT Operating_System EMPTY<!ATTLIST Operating_System Type         (Windows_CE |Linux )             'Windows_CE'   ><ELEMENT Services   ( WebServer | FTPServer | POP3_Email | XMLParser )         >...

Figure 2 : An excerpt from an Internet appliance documenttype description (DTD) file for the hardware configuration of anInternet appliance.

While the format for the associated XML file (Figure 3) appearsto be relatively simple, its content is complex. The hierarchy ofelements combined with the data attributes in conjunction withentities makes reading an XML file, checking its syntax, andverifying for valid content complicated. In other programminglanguages, XML elements correspond to data description, dataattributes to parameters, and entitites to aliases. This process iscalled parsing an XML file.

Typically, parsing is broken down into two steps:

  • Reading the information
  • Checking or validating the information.

Validation is particularly intensive for XML files with schema,where syntax, type, and value checking are required.

<--?xml version="1.0" encoding="UTF-8"?--><appliance> <general servername="Cybernode" location="Austin, Tx" email="info@concursys.com"> <hardware>    <processor frequency="33MHz" cpu="i386EX" name="Config.Hardware.Processor">     <memory name="Config.Hardware.Memory">    <flash size="4MB" base_address="0x4000000">    <dram size="16MB" base_address="0x0000000">  </dram></flash></memory>   </processor></hardware>  <software>   <operating_system type="Windows_CE">  <services>    .    .    .  </services>  </operating_system></software></general></appliance>

Figure 3 : This figure shows exerpt from a XML file whichis based on the DTD file in Figure 2. It shows both hardware andsoftware configuration for a typical Internet appliance in XML.

Fortunately, validation of an XML file can be done off-lineprior to transferring the file to or from the appliance. Thiseliminates the need for a validating parser to run resident on theembedded device. A non-validating parser written in an efficientlanguage like C can be implemented in even the most primitive ofappliance designs.

Formatting XML
Coupled with XML files are XSLT, extensible style languagetransformation files. XSTL files serve two purposes. First, theyare used as a format template to render an XML file for display inan HTML browser. They can also be used to describe how to convertthe XML file to an alternate file format prior tocommunications.

Processing XSLT files is also quite intensive. Simplifiedsubsets of XSLT can be created to adequately handle rendering XMLinformation on sub-PC client devices with embedded browsers.

Another issue with XML on embedded systems is the standard datastructure defined for generic XML processing. This structure isreferred to as the document object model or DOM. The DOM isoverkill for embedded devices. Again, the DOM must be simplifiedfor use in many Internet appliances.

XML in Initializing Applications
XML is the accepted universal standard for sharing information. Wecan understand how XML applies to Internet devices by looking atthe types of information the devices need to operate.

Internet appliances, like most things (including people), needto know a few things about themselves and their operatingenvironment before they can function. When an Internet appliancestarts up, it looks to acquire this information within its own filesystems or over the network. This includes information about itsconfiguration, hardware peripherals, software, memory, speed, andcapabilities. These things can be efficiently encoded into XMLfiles and read at power-up.

One of the most important pieces of startup information forInternet appliances is the services they will provide. Servicestypically run continuously, allowing people or other devices tointeract with the appliance using a standard protocol. Examples ofservices found in many Internet appliances are web serving, emailhandling, and FTP file transfer.

An advantage to describing service configuration information inXML is that XML fosters the adoption of a standard for initializingappliances and networked devices. In the future, the various vendorproprietary configuration tools will go away, with vendorsproviding XML files edited using universal XML editors.

The look and feel of the current generation of tools, withdrop-down tree views launching configuration dialogs, can beclosely mimicked using off-the-shelf XML editors. Making this leapinto using XML for configuration eliminates the cost of creatingproprietary configuration tools.

In addition, adopting XML as a universal format increases yourability to exchange and communicate configurations, facilitatingthe creation of re-configurable and remotely bootable networks.Using XML will help you save on device, software, and end-usermoney in development and deployment.

Standards in Appliance XML
Microsoft is driving several XML-based standards, includingUniversal Plug and Play (UPnP). UPnP improves the interoperabilityof devices on IP-based networks, solving the problem associatedwith a new device connecting to an existing network for the firsttime. When a device first connects to the network, one of the firstthings the device needs to know is who it is and how it will beaddressed once hosted on the network. Devices today can broadcastto the network to find out who else is out there and what servicesare available. This process is called salutation.RPC and XML
While services are generally universally understood, devices canalso perform unique functions and communicate though specialinterfaces. Other devices on the network can remotely execute thesefunctions, once they are aware of them, through a softwaremechanism called RPC, or remote procedure call. Again, Microsoftinitiated an XML standard for implementing RPC on networked devicescalled Simple Object Access Protocol (SOAP).

A number of industry leaders including IBM and Oracle haveadopted SOAP as a standard for remotely executing functions andprocedures on devices across a network. The important thing to beaware of with SOAP is it is both simple enough and efficient enoughto be implemented on most embedded Internet appliances.

Using XML and XSLT
A side benefit of describing an Internet appliance configuration inXML is that publishing the configurations information is a snap.Using XSLT, the configuration XML file can be displayed on abrowser.

XML and XSLT are also very useful when publishing dynamic data.Many Internet appliances are constantly gathering data from theirenvironment. Posting the information requires continuously updatingthe displays. By internally creating and then updating XML filesthat contain the information, data can be dynamically communicatedover the network.

The most sophisticated web hosting environments, like VignetteStoryServer, make use of XML for similar reasons. XSLT filesdescribing the information format can be tested off line. Onceoperational, XSLT puts very little or no load requirements onserver appliances.

For client appliances with a local browser and display, XSLTparsers, like their XML counterparts, can be very complex.Implementing a full XSLT rendering engine can beresource-intensive. So for client appliances, only a subset of thefull XSLT can be typically implemented.

XML Appliance Internet Framework
Internet appliances built around an XML framework will becomecommon in the future. The framework allows for the interpretationof XML files for configuring the Internet appliances at startup.Once running, other devices can communicate and instruct theappliance using network services like SOAP. The services that theappliance runs are set up through XML. Data is communicated throughXML as its rendered or transformed by XSLT. Internet appliances ofthe future will be created to be natively XML-aware.

Originally presented at the Embedded Internet Conference2000.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.