The 802.15.4 specification describes a protocol for distributed wireless communication among large networks of devices with modest bandwidth requirements but low latency and extremely low power consumption. Such a system is perfect for many control and sensor functions.
ZigBee is the term adopted by the standard's industry promoters to describe the 802.14.4 standard, when combined with a few additional protocol-stack layers which govern network configuration, synchronization, security, routing and application support.
ZigBee devices have countless uses -- everything from TV remote controls to wearable medical diagnositcs and monitors to home security networks to global industrial inventory tracking systems. Requiring only an 8-bit microprocessor, with simple nodes using only a 6kB protocol stack, ZigBee devices can be produced very cheaply. Current models are available for as little as $2. Furthermore, their short range and extremely low duty cycle lead to extremely low power consumption. For many applications, battery life should be measurable in years.
For example, one study suggests that a ZigBee wireless keyboard powered by a single AAA cell, used daily by a competent typist, might last more than eight months. By contrast, a Bluetooth keyboard would drain itself in less than a week. Systems with lower communications requirements than a keyboard, which include most sensor networks, should last that much longer.
General characteristics
Some references:
The ZigBee standard defines two types of physical devices. The "full function" device can function in peer-to-peer fashion or any other network topology. They can also assume the role of network coordinator, and consume enough electricity that we assume that such devices would be connected to a power grid or have a fairly large battery (at least AA!). "Reduced function" devices, on the other hand, communicate only with a single network coordinator in a star topology. This allows them to be made with very low cost, tiny form factor and miniscule power consumption. Very large sensor networks can be created with this layout, with full-function devices connected along a backbone or distributed peer-to-peer. Each of these devices can then coordinate a cluster of reduced-function sensor and control devices.
The communications frame is intended to be as simple as possible, while still robust enough to work on a noisy channel. There are four frame structures -- one for data, one for acknowledgement, one for peer entity control transfers and one for beacons. The data frame is structured as follows:
ZigBee devices all use 64-bit IEEE addresses, but they can be configured to use only a 16-bit address to reduce communication overhead. Thus the physical and MAC layers add as little as 120 bits to each transmitted packet.
In a network without low latency requirements, transmission can proceed via standard Aloha CSMA/CA communications. Packet receipt is positively acknowledged via an 88-bit ACK frame sent during a "quiet time" that immediately follows packet transmission. For sensors that occasionally report their data but require no communication from their network coordinator (or only receive such communications at their own request), this setup is ideal. When data comes in, the sensor immediately croaks out a message and waits for acknowledgement, trying again until it succeeds. The transceiver is only occasionally awake, and only for brief moments.
The downside to this approach, however, are that in noisy environments, latency may be a problem as transmissions must be tried over and over. Furthermore, in order to receive information a node must always be listening, which consumes power. Thus the standard defines a beacon network, in which the network coordinator periodically (between 15 ms and 252 sec) sends out a beacon frame:
This beacon serves several purposes -- it defines the boundaries of a communications period, specifies guaranteed time slots (GTSs) and identifies nodes to which the network coordinator wishes to send information. Nodes wake up periodically to listen for the beacon, then communicate during their assigned GTS. This way, packet collisions are minimized and two-way communication is possible even though node transceivers are only intermittently powered. Note that the standard only allows a portion of the time between beacons to be assigned as GTSs. This way, new nodes have a means of joining the network on the fly, simply by announcing their presence during the unassigned period (known as the Contention Access Period (CAP)).
The IEEE standard only specifies the lower levels of the protocol stack. The entire ZigBee structure is designed for handling by an 8-bit microprocessor. The full stack occupies less than 32kB, and simplified stack structures for reduced-function devices consume only 6kB. Network coordinators require some extra RAM for transaction and pairing tables and node device databases, but simple nodes do not.
The network layer handles methods for establishing a network, joining or leaving one, configuring a new device, assigning addresses to new devices, providing synchronization, security and routing. The routing strategy is hierarchical, with table-driven optimizations where possible. It uses a variant of the AODV algorithm.
Encryption is handled both by the MAC layer and the network layer -- the MAC layer handles single-hop transmissions, but secure multihop messaging requires the participation of the upper layer. Both use the AES algorithm, though in slightly different ways. For the MAC layer, each key is associated with a single security suite and the MAC frame header simply has a bit to indicate whether the packet is encrypted or not. The network layer allows the same key to be used for different suites, and can specify which to apply to any particular packet. Both levels allow the appending of a calculated Message Integrity Code (MIC) combined with frame and sequence counts to form a nonce to prevent replay attacks.
Finally, the application interface layer provides discovery and binding services. This allows devices to learn what other devices may be accessible and what data or functionality they provide, then match nodes together based on their services and needs. The layer then provides for message forwarding between these bound devices.
Here are some potential applications:
A detailed example of an inventory control application (was available at the ZigBee site a week ago, but the link no longer works):
Imagine a high-value consumer electronics shipment from Singapore to Chicago.
If you need more four-color glossies, here's an over-the-top marketing brochure from Philips.