The Zigbee protocol uses the Zigbee Cluster Library (ZCL) as an application layer (APL) to organize data. It relies on the application support sub-layer (APS), which provides an interface between the network (NWK) and application layers.
The APS layer provides end-to-end reliability, with acknowledgment and packet fragmentation for packets that don't fit into a single IEEE 802.15.4 frame.
ZCL defines a catalog of clusters. A cluster specifies a logical function for a device. The Zigbee Cluster Library Specification defines attributes, commands, and behaviors. The On/Off cluster defines the OnOff attribute with a readable value, and commands On, Off, and Toggle.
Zigbee devices communicate with each other by sending commands. The communication scheme
depends on the device type and packets being sent. The following is an example process:
- The bulb device stores the state of the physical bulb in the OnOff attribute of the On/Off cluster. The device checks if the physical bulb is on or off and, based on the bulb's state, it sets its own state in the ZCL cluster's attribute.
- To turn the bulb off, the switch sends an Off command to the bulb, with APS acknowledgment requested and default response disabled.
- Upon receiving the command, the bulb changes state of a physical bulb and the attribute value. If the received frame is valid, the bulb responds to the switch by sending an APS acknowledgment.
Figure 1. Simple Zigbee communication