ZigBee

ZigBee builds upon the IEEE 802.15.4 standard. It specifies the network and the application layers. The network layer provides support to star, tree, and peer-to-peer multihop network topologies, and the application layer provides a framework for distributed application development and communication. The application layer comprises the application framework, the ZigBee device objects (ZDO), and the application support sublayer (APS). The application framework contains up to 240 application objects (APOs), that is, user defined application modules that implement a ZigBee application. The ZDO provides services that allow the APOs to organize themselves into a distributed application. The APS provides data and management services to the APOs and ZDO.

Network layer
The network layer defines three types of devices: the end device that corresponds to an RFD or an FFD acting as a simple device, the router that is an FFD with routing capabilities, and the network coordinator that is a FFD managing the whole network. Besides the star topology (that naturally maps to the star topology of IEEE 802.15.4), the network layer also supports tree and mesh topologies. The network layer provides services for the initialization of the network, device addressing, route management, routing, and management of connections and disconnections of devices. Unlike the IEEE 802.15.4 MAC layer, the network layer services are defined only in terms of request, indication, and confirm primitives. Fig. 1 depicts the ZigBee functional layer architecture and protocol stack.
Next generation WLAN
Fig. 1. ZigBee functional layer architecture and protocol stack [S. Chessa].

Network formation
Fig. 2 shows the different network topology has proposed for ZigBee network. The procedure to establish a new network is initiated by the NETWORK-FORMATION.request primitive. This primitive can be invoked only by FFD devices that can behave as a coordinator and have not joined another network. The primitive first uses the MAC layer services to look for a channel which does not conflict with other existing networks. If a suitable channel is found, the primitive selects a PAN identifier that is not already in use by other PANs, and assigns to the device (which is also the coordinator of the new PAN) the 16-bit network address. The primitive then invokes the SET.request primitive of the MAC layer to set the PAN identifier and the device address; then it invokes the START.request primitive of the MAC layer to start the PAN. In response to this primitive, the MAC layer starts generating the beacons.

Next generation WLAN
Fig. 2. ZigBee network topologies [S. Chessa].

Joining a network
The join procedure can be requested by a device wishing to join an existing network (join through association), by a router, or by the coordinator to force a device to join its PAN (direct join). The join through association procedure is described below. When the application layer running on a device wishes to join an existing network, it first invokes the NETWORK- DISCOVERY service to look for existing PANs. This procedure exploits the MAC layer SCAN service to learn about neighbouring routers that announce their networks. Once this procedure is completed, the application layer is notified of the existing networks. In turn, the application layer selects one network (several ZigBee networks may spatially overlap, using different channels) and invokes the JOIN.request primitive with two parameters: the PAN identifier of the selected network and a flag indicating whether it joins as a router or as an end device. The JOIN.request primitive in the network layer selects a “parent” node from his neighbourhood. The parent should be a device in the PAN allowing joins. For example, in the case of a star topology, the parent is the coordinator and the devices join as an end device. Upon receiving an indication of the association request from the MAC layer, the network layer of that node assign a 16-bit short address and lets the MAC layer successfully reply to the association request.

Routing
On receipt of a data frame, the network layer routes the message depending on the capability of the device. If the sender is an end device, it forwards the message to its parent, which has routing capability. Otherwise, if the sender is a router (or the coordinator), it maintains a routing table (RT) and routes the message according to the following procedure:

  1. If the destination is a child, the message is forwarded directly using the DATA service of the MAC layer. Otherwise, the actual routing protocol depends on the topology used in the network (tree or mesh).
  2. If the topology is a mesh, the network layer looks for an entry corresponding to the destination in RT. If the entry corresponding to the destination in RT is not active or such an entry does not exist, the network layer initiates a route discovery procedure and the message is buffered until the discovery is complete.
  3. Otherwise, if the table entry for the destination is active, the table contains the address of the next hop toward the destination, and the message is forwarded to the destination through the next hop.
If the topology is a tree, the network routes the packets along the tree. In the tree topology, routers maintain the addresses of their children and their parent. Given the way the addresses are assigned, a router that needs to forward a message can easily determine whether the destination is one of its end device children or if it belongs to the sub-tree rooted in one of its children. If the destination is one of its end device children, it routes the packet to the appropriate child; otherwise, it routes the packet to its parent.

Note that tree and mesh topologies may live together, that is, the routers can maintain both information for mesh and tree routing. In this case, a router forwarding the message can switch from one routing algorithm to the other. For example, if a route to a destination in the mesh routing is not yet available, the message can be forwarded through the tree. Also note that while mesh routing is more complex to handle and does not allow, tree routing allows the routers to operate in beacon enabled networks.

    Further reading
  •    J. Zheng and A. Jamalipour (Editors), “Wireless Sensor Networks: A Networking Perspective,” Chapter 13, pp. 407-431, Wiley, Hoboken, NJ, USA, 2009.
  •    ZigBee Alliance , “ZigBee specifications”, Dec. 2009 .
  •    ZigBee, http://www.ZigBee.org/en/index.asp
  •    P. Baronti , P. Pillai , V. Chook , S. Chessa , A. Gotta , and Y. F. Hu , “ Wireless sensor networks: A survey on the state of the art and the 802.15.4 and ZigBee standards,” Computer Communications, vol. 30, no. 7, pp. 1655 – 1695, May 2007.