Design Article

IMG1

What you need to know to designing a winning ZigBee application

Tim Gillman and Drew Gislason, San Juan Software

3/24/2006 1:49 PM EST

Abstract
This paper introduces ZigBee, a robust, secure, wireless networking protocol built on the IEEE 802.15.4 wireless networking standard. This standard is designed for low data rate, low power, low complexity and short range networking applications.

The reader will learn about how the ZigBee networking protocol extends the capabilities of 802.15.4 radios to include longer range and higher reliability through multi-hop mesh networking, high security through AES 128-bit encryption, device interoperability through application specific profiles, and long battery life (up to years) through a power centric protocol.

The reader will also learn about the various standards bodies involved in defining the ZigBee protocol and what role they take. The reader will learn how to develop applications for a ZigBee networked environment, including understanding what hardware and tools are required, and how a ZigBee application looks in source code form.

Assumptions
This paper assumes that the reader has a reasonable understanding of embedded systems design and is comfortable with both hardware and software issues in a wide range of applications.

A good understanding of the C programming language in an embedded environment is important, but not mandatory. The reader does not need to be familiar with the term ZigBee or the 802.15.4 or any other wireless radio standard.

Overview
ZigBee defines a networking protocol designed to operate in an extremely limited embedded environment. A ZigBee software stack can fit into 60K of ROM (or Flash) memory and 4K of RAM, typically on an 8-bit device, complete with a simple application, depending on the application profile and stack vendor used. ZigBee was designed to fill a niche not filled by any other wireless standard.

Whereas WiFi makes an excellent desktop and laptop connectivity solution, it is not inexpensive enough for many embedded applications. Bluetooth, while designed to be inexpensive, cannot sustain a large enough network (Bluetooth is limited to 7 nodes in a network) or the long battery life required by many ZigBee applications.

Applications for ZigBee are numerous, generally in the sensor network arena. For example, ZigBee is used in lighting and HVAC (heating-ventilation, air conditioning) applications to reduce wiring costs and increase flexibility.

While the lights themselves still require wires, the light switches do not, saving on installation costs. And the installer and/or user can easily reconfigure which lights are controlled by which switch. The figure below compares three wireless technologies used in embedded applications today:

Click here for Table 1
Table 1: Wireless standards comparison.

ZigBee is not designed for high volume traffic over the airwaves. While it coexists well with other standards, it is designed specifically to use a low duty cycle. While sensor data and actuator commands are perfectly reasonable for a ZigBee network, transmitting video data or high quality voice is probably not.

Standards Bodies
Two standards bodies are ultimately involved in defining the ZigBee wireless networking standard: the ZigBee Alliance and the IEEE Computer Society. Both are components of the ZigBee architecture, but should be viewed as separate bodies.

For example, although IEEE defines the 802.15.4 radio standard which is used in the ZigBee networking protocol, other proprietary networking stack solutions have been built on the low-power 802.15.4 radios.

IEEE Defines 802.15.4
The IEEE Computer Society defines a variety of standards, including those for wireless networking. Most familiar is 802.11, which has been termed WiFi and is promoted by the WiFi Alliance. With 802.15.4, IEEE had a goal in mind for low-cost, low-power and short-range wireless communications. IEEE is currently working on an 802.15.4b standard which enhances the 802.15.4 standard, such as adding more channels for 900MHz and 868MHz.

ZigBee Alliance defines ZigBee
The ZigBee Alliance www.zigbee.org was founded in 2002 by Philips, Motorola, Invensys, Mitsubishi and a number of other companies to promote a robust, highly secure, low-cost wireless networking standard built on the IEEE 802.15.4 radio standard. The ZigBee Alliance is now composed of over 100 member companies, over the spectrum of the market including OEMs, software tools, radio and MCU vendors, stack vendors, and support services.

ZigBee Architecture
ZigBee is composed of various layers, similar to the seven (7) layer OSI model for networking. However, due to the low-complexity of the typical ZigBee device, that model has been simplified into a four (4) layer model, which includes the application itself, the application framework, the networking layer and the MAC (and PHY) layer. Figure 1 below illustrates how these layers interact.

Click here for Figure 1
Figure 1: ZigBee architecture.

The IEEE 802.15.4 Specification
The 802.15.4 Media Access Control (MAC) layer handles all access to the physical radio channel and is responsible for the following tasks:

  • Supporting PAN association and disassociation.
  • Supporting device security.
  • Employing the CSMA-CA mechanism for channel access.
  • Handling and maintaining the GTS mechanism.
  • Providing a reliable link between two peer MAC entities.

In addition to the above services, the 802.15.4 MAC also provides beaconing services which are not used by ZigBee.802.15.4 MAC services are listed below. "Requests" means transmit, indication means receive, and confirm means a confirmed response to a request. MCPS commands are the data services, whereas MLME commands are connection management commands. For a complete description of these services and their fields, see the IEEE standard for 802.15.4 [R1] as listed in the reference section.

Click here for Table 2
Table 2: MAC layer services.

The ZigBee Specification
ZigBee provides services at a much higher level than the 802.15.4 MAC. At the application support layer, ZigBee provides the following primitives. The reader should notice that the interface is significantly simpler than the MAC interface. This approach hides a lot of complexity, including multi-hop mesh networking and AES 128- bit encryption.

Click here for Table 3
Table3: ZigBee application support services.

The full ZigBee specification can be downloaded from the ZigBee Alliance website: www.zigbee.org.

Mesh Networking
One of the key strengths of the ZigBee networking protocol is mesh networking. Mesh Networking allows a node to reach another node not directly within the range of its radio by “hopping” the message through another radio.

Another significant feature of mesh networking is that of increasing reliability by offering multiple routes to a destination node. For example, if a node needs to communicate with another node but that path is blocked (say a large chunk of metal, microwaves or the like or characteristics of the antenna), then the message can be routed through alternate nodes, perhaps taking a longer route but still reaching the node.

AES 128-Bit Security
One of the optional, and incredibly powerful features of ZigBee is the ability to encrypt the messages over the air. Encrypting can prevent others from listening to the message or worse, tampering with it. AES 128-bit security was chosen because it is one of strongest encryption techniques available today and has not (yet) been cracked.

AES 128-bit security is optional because of the relatively large code size requirements to implement it (around 10K bytes), at least for a ZigBee type environment, and make it cost-prohibitive for some applications. Some silicon vendors provide AES 128-bit encryption in either the radio or the microcontroller (MCU), freeing the MCU resources for application purposes.

Development Environment This section introduces the reader to the typical development environment used to develop ZigBee applications, including an introduction to an example of ZigBee hardware.

1  2  3 

print

email

rss

Bookmark and Share

Joinpost comment




Please sign in to post comment

Navigate to related information

Product Parts Search

Enter part number or keyword
PartsSearch

FeedbackForm