Zigbee Protocol Stack Explained: Seven Layers & Architecture Diagram for IoT

zigbee
protocol stack
iot
wireless communication
network layer

The Zigbee protocol stack is a robust communication framework tailored for IoT applications, featuring a detailed seven-layer architecture that ensures reliable, low-power wireless communication.

In this guide, we’ll explore each layer of the Zigbee stack, from the Physical Layer to the Application Layer, and explain how they collaborate to facilitate efficient data transmission in IoT networks. Whether you’re implementing Zigbee in smart home devices, industrial automation, or sensor networks, understanding these seven layers is crucial for optimizing performance and interoperability.

Out of these seven layers, the IEEE 802.15.4 WPAN standard defines two (PHY and MAC), while the Zigbee Alliance manages the other two (network & security and application layer).

The following figure illustrates the Zigbee protocol stack architecture.

zigbee protocol stack

Let’s delve into each of the seven layers.

1. Physical Layer (PHY)

  • Function: This layer manages the actual transmission and reception of data over the wireless medium. It defines the hardware and procedures for modulation, demodulation, and error detection.
  • Standards: Based on IEEE 802.15.4, it operates in the 2.4 GHz ISM band (globally), as well as 868 MHz (Europe) and 915 MHz (North America) frequency bands.
  • Key Components: Radio transceiver, modulation schemes (e.g., Offset Quadrature Phase Shift Keying - O-QPSK), and power management.

2. MAC Layer

This layer governs access to the physical channel, manages channel access (using mechanisms like CSMA/CA), frame validation and maintains the link quality. Each MAC frame consists of three fields: MAC header, MAC payload, and MFR (FCS).

Each MAC frame contains a Frame control field (16 bits), which carries frame type, addressing fields, and other control flags. This MAC control field includes a frame type field, which is the main factor in identifying one MAC frame from another. It is 3 bits in length.

The MAC frames are divided into the following four major categories, which Zigbee devices use to establish a connection to the PAN by exchanging system information:

  1. Beacon
  2. Data
  3. Acknowledgement
  4. MAC command

3. Network Layer and Security Layer

(3.a) Network Layer:

The network layer is responsible for network formation, maintenance, and routing. It handles the creation of network topologies (star, mesh, or tree), node addressing, and routing of data between devices.

Key components of the network layer include network addressing, routing protocols (e.g., AODV - Ad hoc On-demand Distance Vector), and security functions.

(3.b) Security Layer:

Security mechanisms are distributed across multiple layers, ensuring data encryption, authentication, and integrity. Zigbee uses AES-128 encryption for secure communication.

If security is enabled, a Zigbee device will start up using a 128-bit AES encryption key. Devices with the same security key can communicate on the PAN.

How to obtain this key?

  1. Pre-installation
  2. Key is received over the air during joining.

4. Application Support Sublayer

This layer provides an interface between the network layer and the application layer. It manages binding tables (associating clusters with devices), frame formatting, and data encapsulation.

The key components are Binding, group management, and data security. There are two profiles at this layer:

  1. Manufacturer-specific application profile: Operates as closed systems and ensures that they can coexist with other Zigbee systems.
  2. Public application profile: For this to work, interoperability between various Zigbee devices is a must.

A single Zigbee node supports up to 240 application objects called endpoints. An endpoint specifies a specific application; for example, 0 is dedicated to ZDO (Zigbee Device Object) and provides control and management commands; 6 is used for controlling light; 8 is used for managing heating and air conditioning.

5. Application Framework (AF)

  • Function: This layer supports the development of application-specific objects (endpoints) and their communication within the Zigbee network. It defines how application objects can interact with each other.
  • Key Components: Application objects (such as sensors, switches), endpoints (addressable entities), and clusters (groupings of attributes and commands).

6. Zigbee Device Objects (ZDO)

  • Function: The ZDO is a special entity that manages device roles (such as coordinator, router, or end device) and handles network-level functions like joining and leaving networks, device discovery, and security.
  • Key Components: Device management, security management, and network management.

7. Application Layer

  • Function: This is where user-defined applications reside. It includes application profiles, which define the standard behaviors of Zigbee devices for interoperability.
  • Key Components: Application profiles (e.g., Home Automation, Smart Energy), custom applications, and data handling for specific use cases.

Key features

  • Low Power Consumption: Ideal for battery-operated devices.
  • Low Data Rate: Suitable for control and sensor applications.
  • Scalability: Supports large networks with up to 65,000 nodes.
  • Reliability: Mesh networking and multi-hop routing enhance communication reliability.

Topologies

Zigbee supports multiple network topologies:

  • Star: A single central coordinator communicates with multiple end devices.
  • Mesh: Devices can communicate with each other, allowing multi-hop routing and greater reliability.
  • Tree: A hierarchical structure with a root coordinator and multiple levels of routers and end devices.

Summary

Zigbee’s seven-layered architecture enables flexibility, allowing developers to create robust, interoperable, and energy-efficient wireless networks for a wide range of applications.

Understanding Zigbee Layers in IoT

Understanding Zigbee Layers in IoT

Explore the 7 layers of the Zigbee protocol stack used in IoT. From the Physical layer to the Application layer, learn how each contributes to wireless communication.

zigbee
iot
network layer
Zigbee Mesh Network Tutorial: Basics and Features

Zigbee Mesh Network Tutorial: Basics and Features

Learn the fundamentals of Zigbee mesh networks, including topologies, features, advantages, and disadvantages. Explore its role in low-power wireless applications.

zigbee
mesh network
wireless communication
Zigbee: Advantages and Disadvantages

Zigbee: Advantages and Disadvantages

Explore the pros and cons of Zigbee technology, covering its features, benefits, and limitations for applications like home automation and IoT.

zigbee
wireless communication
iot