A brief description of the stack structure in the ZigBee standard
[Copy link]
The ZigBee standard defines a stack protocol that ensures interoperability of wireless devices in low-cost, low-power, and low-data-rate networks. This article briefly describes the ZigBee stack structure specified in the ZigBee standard.
The ZigBee stack is built on the IEEE 802.15.4 standard, which defines the MAC and PHY layers of the protocol. ZigBee devices should include the PHY and MAC layers of IEEE802.15.4 (which defines the RF radio frequency and communication with neighboring devices), as well as the ZigBee stack layers: the network layer (NWK), the application layer, and the security service provider layer. Figure 1 gives an overview of these components.
ZigBee stack layer
Each ZigBee device is associated with a specific template, which may be a public template or a private template. These templates define the application environment of the device, the device type, and the cluster used for communication between devices. The public template ensures the interoperability of devices from different vendors in the same application field.
Devices are defined by templates and implemented as Application Objects. Each application object is connected to the rest of the ZigBee stack through an endpoint and is an addressable component in the device.
From an application perspective, the essence of communication is an endpoint-to-endpoint connection (for example, a device with a switch component communicates with a remote device with one or more light components in order to turn on those lights).
Communication between endpoints is achieved through data structures called clusters. These clusters are containers for all the properties required to share information between application objects. The clusters used in a particular application are defined in the template. Figure 2 is an example of a device and its interface:
Each interface can receive (for input) or send (for output) data in cluster format. There are two special endpoints, endpoint 0 and endpoint 255. Endpoint 0 is used for configuration and management of the entire ZigBee device. Applications can communicate with other layers of the ZigBee stack through endpoint 0 to initialize and configure these layers. The object attached to endpoint 0 is called the ZigBee device object (ZD0). Endpoint 255 is used for broadcasting to all endpoints. Endpoints 241 to 254 are reserved endpoints.
All endpoints use services provided by the Application Support Sublayer (APS). The APS connects to the endpoints through the network layer and the security service provider layer and provides services for data transmission, security and binding, so that different but compatible devices can be adapted, such as a switch with a light.
APS uses the services provided by the network layer (NWK). NWK is responsible for device-to-device communication and is responsible for the activities involved in device initialization in the network, message routing, and network discovery. The application layer can configure and access network layer parameters through the ZigBee device object (ZD0).
802.15.4 MAC layer
The IEEE 802.15.4 standard defines the first two layers of the OSI model for low-rate wireless personal area networks (LR-WPANs). The PHY layer defines the characteristics that a wireless radio should have. It supports two different radio signals, located in the 2450MHz band and the 868/915MHz band. The 2450MHz band radio can provide a data rate of 250kbps and 16 different channels. In the 868/915MHz band, 868MHz supports 1 channel with a data rate of 20kbps, and 915MHz supports 10 channels with a data rate of 40kbps.
The MAC layer is responsible for single-hop data communication between adjacent devices. It is responsible for establishing synchronization with the network, supporting association and disassociation, and MAC layer security: it can provide a reliable link between two devices.
About Service Access Points
The different layers of the ZigBee stack communicate with the 802.15.4 MAC via a Service Access Point (SAP). The SAP is the interface between the services provided by a particular layer and the upper layers.
A device description defined by a template.
Most layers of the ZigBee stack have two interfaces: a data entity interface and a management entity interface. The goal of the data entity interface is to provide the upper layer with the required general data services. The goal of the management entity interface is to provide the upper layer with a mechanism to access internal layer parameters, configuration, and management data.
ZigBee security
is provided by the security service provider layer. However, it is worth noting that the overall security of the system is defined at the template level, which means that the template should define what type of security should be implemented in a particular network.
Each layer (MAC, network or application layer) can be protected and they can share security keys to reduce storage requirements. The SSP is initialized and configured through ZD0 and requires the implementation of the Advanced Encryption Standard (AES). The ZigBee specification defines the purpose of the Trust Center. The Trust Center is a trusted device that distributes security keys in the network.
ZigBee Stack Capacity and ZigBee Devices
Based on all the functionality and support specified by the ZigBee stack, it is easy to surmise that a ZigBee stack implementation requires a significant amount of memory resources in a device.
However, the ZigBee specification defines three types of devices, each with its own functional requirements: ZigBee coordinator is a device that starts and configures the network. The coordinator can maintain the binding table for indirect addressing, support associations, and design trust centers and perform other activities. A ZigBee network is only allowed to have one ZigBee coordinator.
A ZigBee router is a device that supports association and is able to forward messages to other devices. A ZigBee mesh or tree network can have multiple ZigBee routers. A ZigBee star network does not support ZigBee routers.
A ZigBee end device can perform its related functions and use the ZigBee network to reach other devices that need to communicate with it. Its memory capacity requirements are minimal.
However, it is important to note that the specific architecture of the network will dramatically affect the resources required by the device. The network topologies supported by NWK are star, tree, and mesh. Among these network topologies, the star network has the lowest resource requirements.
Summary of this article
The ZigBee stack should provide all the functions required by the ZigBee specification, so the focus of manufacturers is to develop practical applications. To make it easier to implement, if manufacturers use some kind of public template, most of the ready-made configurations can be used. If there is no suitable public template, you can make full use of the work done by other templates to create your own template.
|