Introduction to Zigbee

Revision as of 08:25, 1 February 2022 by Registered User

1. Introduction

Zigbee® is an IEEE 802.15.4-based communication protocol used to create wireless personal area (WPAN) networks. The aim is to provide a simple networking layer and standard application profiles that can be used to create interoperable solutions, with low-power and low-bandwidth constraints.

Zigbee is used in many application areas:

  • Home automation
  • Industrial control systems
  • Building automation
  • Medical data collection & monitoring
  • HVAC control
  • Wireless sensor networks

The data throughput is 250 kbps in 2.4 GHz band and the typical range is 10-20 meters. 250 kbps is raw data rate at PHY level. At application level, data rate is lower due to protocol stack overhead.

2. Zigbee network

2.1. Topology

Zigbee supports 3 types of network topologies as shown on the figure.

Zigbee network topologies

2.2. Type of devices

In Zigbee, there are 3 logical device types:

  • Coordinator (ZC): This is the first node to be started. The coordinator is responsible for forming the network by allowing other nodes to join the network through it. The coordinator is responsible for starting the network and for choosing certain key network parameters. Once the network is established, the coordinator has a routing role. In a centralized network, every Zigbee mesh network must have one and only one coordinator.
  • Router (ZR): This is a node with a routing capability which is also able to send and receive data. It also allows other nodes to join the network through it. A Zigbee® mesh network can have multiple routers.
  • End Device (ZED): This is a node which is only capable of sending and receiving data. It has no routing capability. A Zigbee mesh network can have multiple end devices. End device can also be sleepy end device (SED) allowing very low power consumption.

The figure below gives an overview of a Zigbee Mesh network with the different device types.

Zigbee mesh network example with device roles

2.3. Type of network

To satisfy a wide range of applications and to ensure the optimal balance of security, Zigbee offers two types of networks: distributed and centralized.

  • In a distributed network, there are no coordinator. In this configuration, any router can issue network security keys. As more routers and end devices join the network, a router that is already on the network securely sends the network key. All devices on the network use the same network key to encrypt messages.
  • In a centralized network, there is an entity named Trust Center (TC), which is typically the coordinator. The TC forms a centralized network and allows routers and end devices to join the network if they have proper credentials. In a centralized network, only the TC can issue encryption keys. The TC also establishes a unique TC Link Key for each device on the network as they join and link keys for each pair of devices as requested.

For obvious reasons, the centralized network is much more secure than the distributed one. Most of the Zigbee examples provided inside the STM32WB firmware package are using a centralized network.

3. Architecture

As described before, Zigbee is built on top of the IEEE 802.15.4 standard. Zigbee provides routing and multi-hop functions to the packet-based radio protocol. It is built on top of two layers specified by 802.15.4: the physical (PHY) and MAC layers. The figure describes the main components of a Zigbee stack and its articulation with IEEE 802.15.4 and general application layer.

Zigbee stack overview

3.1. MAC Layer

In MAC frame there is 2-byte field for control. Bits 0-2 indicate frame type, which could be one of the four following types:

  • Beacon frame (000), used to scan networks
  • Data frame (001), used to transmit data from higher layers
  • Acknowledgment frame (010)
  • MAC command (011), like Association request, Data request, etc.

At the end of each MAC frame, there are two bytes CRC used to verify the integrity of the packet.

3.2. Network Layer

The network layer takes care of topology construction, maintenance, naming, routing, and security.
Zigbee specification defines 2 device types:

  • FFD, Full Feature Device, can accept any role in the network (router, coordinator, or end device).
  • RFD, Reduced Feature Device, can support only end device role.

3.3. Application Layer

The APL layer is composed of several sublayers. The components of the APL layer are shown in following Figure.

Application layer sublayers

3.3.1. Application Support Sublayer (APS)

APS provides an interface between the network layer (NWK) and the application layer through a general set of services that are used by both the ZDO and the manufacturer-defined application objects. The APS is responsible for:

  • Binding management
  • Message forwarding
  • Group address definition and management
  • Address mapping from 64-bit extended addresses to 16-bit NWR addresses
  • fragmentation and reassembly of packets
  • Reliable data transport

3.3.2. Zigbee Device Object (ZDO)

The ZDO component handles the device management and communication functions. It includes:

  • Initializing the APS sublayer and the NWK layer
  • Device discovery
  • service discovery
  • Network management, including defining the operating mode of the device (ZC, ZR or ZED).
  • Security management
  • Initiating and/or responding to binding requests

4. Zigbee Profiles

4.1. Zigbee Application Profiles

A profile is a message-handling agreement between applications on different devices. It describes the logical components and their interfaces. The aim of profiles is to provide interoperability between different manufacturers. There are 3 types of profiles:

  • public (standard), managed by the Zigbee® CSA.
  • private, defined by Zigbee vendors for restricted use.
  • published, this concerns previously private profiles that became published ones the owner profile decided to publish it.

All profiles must have a unique profile identifier.

A profile uses a defined language for data exchange and a defined set of processing actions. Indeed, an application profile will specify the following:

  • set of devices required in the application area
  • functional description for each device
  • set of clusters to implement the functionality
  • which clusters are required by which devices

Each information that can be transferred between devices is called an attribute. Attributes are grouped into clusters. All clusters and attributes are given unique identifiers. There are input cluster identifiers and output cluster identifiers. Input clusters are server ones. Output clusters are client ones.

Zigbee Profiles

4.2. Zigbee Device Profiles

The Zigbee Device Profile is a collection of device descriptions and clusters run directly by the ZDO. It applies to all Zigbee devices. The Zigbee Device Profile is a template that show of how to write an application profile. It is defined in the Zigbee Application Level Specification.

5. Acronyms and definitions

Term Definition
APS Application support sub-layer
MAC Media Access Control
PAN Personal Area Network
SED Sleepy end device
ZDO Zigbee Device Object