Zigbee protocol stack overview 2018
ASSUMPTIONS FOR USING THIS TEACHING MATERIAL DSR and OTSL takes no responsibility about the problem which occurs as a result of applying the technical information written in this document in a commercial product, although the information is based on actual implementation and our experiences, is reliable enough.
BASIC ZIGBEE OVERVIEW ZigBee is a specification for a high level protocol stack using small, low-power and low-cost radios. It based on IEEE 802.15.4 standard for Personal Area Network. ZigBee standard maintained by ZigBee Alliance (www.zigbee.org) Usually vendors of ZigBee devices use system-on-chip (SoC) solutions with integrated radio and 60-250KB of flash memory. ZigBee data transmission rate varies from 20 to 900kbits.
WHY ZIGBEE? Mesh Networking Technology Self-healing mesh networks Low cost, long battery life, good range, secure Open Global Standard 2.4GHz is unlicensed, available Worldwide Anyone can join the ZigBee Alliance Where can ZigBee fit? Secure, reliable, Personal Area Networks for sensor, control and low bandwidth data communications.
ZIGBEE ARCHITECTURE Applications Zigbee 802.15.4 MAC 802.15.4 PHY 2.4 GHz PHY 868/915 MHz PHY
802.15.4 IEEE 802.15.4 specifies physical and MAC layer of low-rate WPANs. IEEE 802 networking group IEEE 802.15 wireless networking IEEE 802.15.4 LR WPAN It could be and it used as a basis for different protocols and standards. ZigBee, WirelessHART, 6LoWPAN etc.
802.15.4 BASICS Has guaranteed time-slots. Uses network beaconing. Has no routing mechanism => only star and peer-to-peer allowed. Enables the transmission of MAC frames through the use of the physical channel. Controls frame validation, guarantees time slots and handles node associations. Most of the applications often use only part of 802.15.4 that is suitable for their purposes.
802.15.4 PHYSICAL DEVICE TYPES Full-function device (FFD) Talks to any other device Can be a PAN coordinator Reduced-function device (RFD) Associates and communicates with a single FFD Can be implemented using minimal resources
802.15.4 LOGICAL DEVICE TYPES PAN coordinator (FFD) Establishes the network Coordinator (FFD) Capable of relaying messages Device (RFD or FFD)
802.15.4 TOPOLOGIES
802.15.4 ADDRESSING Each 802.15.4 device has a unique, 64-bit address. 24 bits: OUI (Organizational Unique Identifier). The following 48 bits are assigned by the manufacturer. The address is called IEEE address, long address, extended address. PAN coordinator assigns each joined device a short 16-bit address, most of the time the device is addressed using this short address.
802.15.4 PAN ID S PAN ID is used to logically separate devices from different networks. PAN ID 16 bit Extended PAN ID 64 bit, used only while joining PAN ID of a network is randomly chosen by PAN coordinator during the network formation process. Before selecting PAN ID, PAN coordinator ensures that no other network with such PAN ID exists in the vicinity.
802.15.4 2.4 GHZ CHANNELS 802.15.4 defines 16 channels in the 2.4 GHz ISM band. Channel 11 has 2405 MHz frequency, Channel 26 has 2480 MHz frequency
2.4 GHZ PHY PACKET Preamble SFD PHR PSDU 6 bytes <= 127 bytes Preamble 32 bits, used for synchronizations Start of Frame Delimiter (SFD) 8 bits, indicates start of packet data, 11100101 PHY header (PHR) 8 bits, packet length (7 bit) + reserved (1 bit) PHY Service Data Unit (PSDU)
802.15.4 MAC FRAME Frame Control Sequence Number Addressing information MSDU FCS 2 bytes 1 byte 4 20 bytes 2 bytes Frame Control various flags Sequence Number 8 bit counter Addressing Information depends on FC flags MAC Service Data Unit (MSDU) Frame Check Sequence (FCS) error detection
802.15.4 MAC FRAME TYPES MAC frame type is specified in Frame Control field. Data frame Acknowledgement frame Beacon frame MAC command frame
PRIMITIVES Primitives are interfaces for 802.15.4 (and Zigbee) services. Higher layer Higher layer request confirm indication response Lower layer Lower layer
PRIMITIVES: EXAMPLE Let s take one of MAC layer primitives. MCPS-DATA.request used by next higher layer to transmit a packet. MCPS-DATA.confirm used by MAC layer to report the final status of a previous MCPS-DATA.request operation. MCPS-DATA.indication used by MAC layer to pass a received packet up.
ZIGBEE ARCHITECTURE
ZIGBEE ARCHITECTURE (CONT.) MAC layer Network (NWK) layer: Routing, addressing, discovery and join. APS (Application Support Sub-layer): Bridge between NWK and upper layers. Binding tables, separate addressing scheme etc. ZDO (Zigbee Device Object) layer: Different stack parameters management, security keys and policies. Application/Profiles: Profiles and customer's application.
ZIGBEE: MAC LAYER Provides the concept of a network. Networking discovery (through beacons). Acknowledged and non-acknowledged data transmission. No multihopping.
ZIGBEE: NWK LAYER NWK layer handles network addressing and routing by invoking actions from MAC layer. Responsibilities: Starting the network. Assigning network addresses. Adding/removing devices to/from network. Routing messages to the intended destination Applying security to the incoming/outgoing messages. Discovery and store routing information
ZIGBEE: APS LAYER Endpoints are application instances on a node. They allow multiple applications to share a single radio. For example, a node might be measuring temperature and humidity, each of which is an application instance. Each endpoint is given a number, from 1 to 240. Therefore, to identify a particular application instance in a Zigbee network, you need to supply the relevant network address and then the required endpoint address on the node.
ZIGBEE: APS LAYER (CONT.) Clusters encapsulate commands and data. Also, clusters have direction. Example: OnOffCluster has two commands and an attribute. A switch might have OnOffCluster as output, a light bulb might have OnOffCluster as input.
ZIGBEE: APS LAYER (CONT.) The application support sub-layer (APS) provides the services necessary for application objects (endpoints): Data and commands exchange between endpoints. Binding: For example, a switch might be bound to one or many light bulbs, fans, etc.
ZIGBEE: ZDO Endpoint address 0 on each node is reserved for a special application called the ZDO (Zigbee Device Objects). Initializes all layers below. Security management. Network management. Binding management.
ZIGBEE PROFILES Is it possible to think of a profile as a domain space of related applications and devices. Public profiles specified by Zigbee alliance Private profiles specified by individual OEMs A profile is identified by 16-bit number. A complete message address in Zigbee: Network address, Profile, Cluster, Endpoint
ZIGBEE PROFILE EXAMPLES Home automation Defines various domestic devices (light switches, door locks, smart plugs, thermometers, etc.) and clusters that can be used to manage these devices. Smart Energy Various metering devices, complex resource pricing systems, power consumption control.