Zigbee Tutorial: Zigbee Protocol Basics

zigbee
wireless
protocol
network
iot

This zigbee tutorial provides an overview of the zigbee network architecture. It covers zigbee basics, including the frame structure and the zigbee protocol stack layers, namely the physical layer, MAC layer, and application layer profiles.

Introduction

Zigbee is becoming increasingly popular for low data rate wireless applications. Zigbee devices are utilized in various sectors, including smart energy, medical, and home automation.

  • Smart Energy: Zigbee products monitor and control energy and water consumption, helping consumers save resources and money.
  • Medical Field: Zigbee connects numerous health monitoring devices.
  • Home Automation: It controls domestic lighting, such as switches, dimmers, occupancy sensors, and load controllers.

Zigbee operates on two bands: 868/915MHz and 2450MHz. The 868/915 band provides data rates of about 20-40Kb/s, while the 2450MHz band offers data rates of about 250 kb/s. Additionally, zigbee end devices can enter sleep mode to conserve battery power. Zigbee also incorporates a security layer to protect the transmitted information.

Zigbee Network Overview

zigbee network fig

As illustrated in the network diagram, a zigbee network consists of a coordinator (C), routers (R), and end devices (E). Zigbee supports mesh routing. Detailed information on the routing protocol can be found in the Ad-hoc on-demand Distance Vector Routing protocol (AODV protocol), RFC 3561.

  • Coordinator (C):
    • The first device installed to establish the zigbee network. It initiates a new PAN (Personal Area Network).
    • Responsible for selecting the channel and PAN ID.
    • Assists in routing data through the mesh network and allows join requests from routers and end devices.
    • Mains powered (AC) and supports child devices.
    • Does not enter sleep mode.
  • Router (R):
    • Must join the network before allowing other routers and end devices to join the PAN.
    • Mains powered (AC) and supports child devices.
    • Does not enter sleep mode.
  • End Devices (E):
    • Cannot allow other devices to join the PAN or assist in routing data.
    • Battery powered and does not support child devices.
    • Can enter sleep mode to minimize battery consumption.

Zigbee supports star and mesh topologies, with mesh routing being a key feature. The PAN ID, a 16-bit number, facilitates communication between zigbee devices. The coordinator always has a PAN ID set to zero, while other devices receive a 16-bit address upon joining the PAN.

Zigbee Network Installation

The installation involves two main steps: forming the network by the Coordinator and joining the network by Routers and End devices.

Forming the Zigbee Network

  • The Coordinator searches for a usable RF channel that does not interfere with Wireless LAN frequencies, as both operate in the 2.4GHz bands. This process, known as energy scan, is performed on all 16 channels.
  • The Coordinator starts the network by assigning a PAN ID. Assignment can be manual (pre-configured) or dynamic (by checking existing PAN IDs to avoid conflicts). The Coordinator also assigns itself the network address 0x0000.
  • The Coordinator completes its configuration and is ready to accept network joining requests from routers and end devices.
  • The Coordinator sends a broadcast beacon request frame on the remaining quiet channel, also known as beacon scan or PAN scan. This allows the Coordinator to identify the PAN IDs of nearby routers and end devices and determine whether they allow joining.
  • Routers and end devices can then join by sending an association request to the Coordinator, which responds with an association response.

Joining the Zigbee Network

  • Routers and end devices can join a zigbee network in two ways: MAC association and network re-join.
  • MAC association is implemented by the MAC layer, while network re-join is implemented by the network layer but can also be used to join a network for the first time.
  • MAC association can occur between a Coordinator and a Router/End device, a Router and an End device, or between Routers.
  • Assuming the Coordinator has established the PAN network, the next step for Routers or End devices is to determine if the Coordinator is allowing devices to join. This is achieved through a PAN scan or by sending a beacon request frame.
  • Upon confirmation that joining is permitted, the devices send an association request frame and join the network upon receiving the association response.
  • Whether a Coordinator or Router allows a new device to join depends on two factors: the “Permit joining” attribute and the number of end device children it already has.

One common application of zigbee in homes is controlling switches, speakers, and lamps using zigbee technology.

Zigbee Protocol Stack

zigbee protocol stack

The zigbee protocol stack consists of the physical layer (PHY), MAC layer, network layer, and application layer. The IEEE 802.15.4 standard defines the PHY and MAC specifications, while the Zigbee Alliance specifies the network and application layers.

Zigbee Physical Layer

zigbee tutorial fig1

zigbee tutorial fig2

There are two physical layer versions, categorized by frequency band: 868/915MHz and 2450MHz.

Zigbee MAC Layer

zigbee PHY packet structure

The figure shows the physical layer packet structure, which carries different types of MAC frames as needed.

generic zigbee frame structure

Zigbee MAC frames include beacon, data, acknowledgment, and MAC command frames.

Zigbee Network Layer

Zigbee AODV protocol fig1

The Ad-hoc on-demand Distance Vector Routing protocol (AODV) is used at the network layer.

Zigbee Application Layer Profiles

The zigbee application layer uses two main types of profile IDs: public profiles and manufacturer-specific profiles. Data transmission and reception in zigbee devices occur using application profiles, each with a 16-bit ID. Public profiles range from 0x0000 to 0x7fff, while manufacturer-specific profiles range from 0xbf00 to 0xffff. Public profiles facilitate interoperability between different OEM devices, while manufacturer-specific profiles are used by OEMs that do not require interoperability.

Zigbee Interview Questions and Answers

Prepare for your Zigbee interview with this comprehensive guide. Covers key topics like network architecture, protocols, and comparisons with WiFi.

zigbee
interview
wireless
Weightless System: Basic Overview for IoT

Weightless System: Basic Overview for IoT

Explore the Weightless standard, designed for low-cost, long-battery-life IoT devices using TV white space, including frame structure, specifications, and protocol stack.

weightless
iot
wireless