Wireless Control That Simply Works ZigBee Mesh Networking - In Control Ian Marsden Chairman ZigBee Network Working Group Director, Software Engineering, Integration Associates Copyright 2004 ZigBee TM Alliance. All Rights Reserved.
ZigBee is built upon the foundations provided by the IEEE 802.15.4 standard. Application Framework Application Object 240 [On Endpoint 240] Application Object 1 [On Endpoint 1] ZPUI ZigBee Device Object (ZDO) [On Endpoint 0] APSDE-SAP APSDE-SAP APSDE-SAP Security Service Provider APSSE-SAP NLSE-SAP NLDE-SAP Application Support (APS) Layer Network (NWK) Layer APSME-SAP NLME-SAP MCPS-SAP MLME-SAP Medium Access Layer (MAC) Layer PD-SAP PLME-SAP Physical (PHY) Layer ZigBee Stack 2
ZigBee Devices Type Model Application Device Type e.g. Light Sensor e.g. Lighting Controller... Distinguishes the type of device from an end-user perspective ZigBee Logical Device Type ZigBee Coordinator ZigBee Router ZigBee End Device Distinguishes the Logical Device Types deployed in a specific ZigBee network 802.15.4 Device Type FFD Full Function Device RFD Reduced Function Device Distinguishes the type of ZigBee hardware platform ZigBee products are a combination of Application, ZigBee Logical, and ZigBee Physical device types 3
802.15.4 Architecture: PHY Frequency Options Network Structure 802.15.4 Device Types Locating Networks Joining / Rejoining Networks Direct / Indirect Data Transmission 4
Architecture: 802.15.4 PHY Options Freq Band Bit Rate Channels 868 / 915 MHz 20 / 40 kbps 1 / 10 2.4 GHz 250 kbps 16 5
Architecture: Network Structure in 802.15.4 802.15.4 FFD 802.15.4 RFD Network Association 6
Architecture: 802.15.4 Device Types Full Function Device (FFD) Capable of being the PAN Coordinator Implements processing of Association Request Implements processing of Orphan Notification Implements processing of Start Request Implements processing of Disassociation Notification Reduced Function Device (RFD) Can only associate and communicate with a FFD Reduced stack removes optional components 7
Architecture: Communication paths in 802.15.4 8
MLME_SCAN: Locating Networks MAC / PHY MLME_SCAN_request( ACTIVE ) Channel n ScanDuration CMD_BEACON_REQUEST BEACON BEACON Channel n+1 CMD_BEACON_REQUEST BEACON ScanDuration BEACON MLME_SCAN_confirm( Descriptors ) 9
MLME_ASSOCIATE: Joining a Network 10
MLME_SCAN: Rejoining a Network MAC / PHY MLME_SCAN_request( ORPHAN ) Channel n CMD_ORPHAN_NOTIFICATION ScanDuration Channel n+1 CMD_ORPHAN_NOTIFICATION ScanDuration CMD_COORD_REALIGNMENT MLME_SCAN_confirm( Descriptors ) 11
Data Transmission: Direct Direct (FFD FFD, or RFD FFD) The receiving device has its receiver on (RxOnIdle) (There is always someone to answer the call) The data packet can be set unsolicited (Just dial the number) The MAC schedules it for immediate delivery (using CSMA-CA) 12
Architecture: Direct communication paths in 802.15.4 OK, Got it. Sending you a message Direct Data Flow 13
Data Transmission: Indirect In-Direct (FFD RFD) The receiving device is asleep with its receiver off (The phone is unplugged) The data packet has to be requested (Polled) (Are there any messages for me?) The FFD MAC stores it for later retrieval by the RFD. 14
Architecture: Indirect communication paths in 802.15.4 Yes, sending them across now Have you Got them, got any thanks. messages for me? Indirect Data Flow 15
802.15.4 Summary Wireless Personal Area Network (WPAN) Used to convey information over short distances. Star network topology Devices communicate only with the Coordinator In-direct data transmission enables small, power efficient, inexpensive solutions to be implemented. But 802.15.4 does not provide multi-hop networking 802.15.4 does not provide mesh networking Enter ZigBee 16
ZigBee Overview Enable low-cost, low-power embedded mesh networking for monitoring and control. Provide a platform and implementation for wirelessly networked devices Make it easy to design and develop ZigBee devices Reduce today s cost of building wireless solutions Ensure interoperability through the definition of application profiles Enable out-of-the-box interoperable devices where desired by manufacturers 17
ZigBee Network Design Considerations Network Size Number of devices Geographic layout Network Density Data flow patterns Latency and throughput Power consumption System cost Commissioning and installation Maintenance 18
Architecture: NWK layer details ZigBee Device Types Stack Profile, Network Rules Network Management and Addressing Message Routing Route Discovery and Maintenance Security 19
Architecture: Network Structure in ZigBee 20
Architecture: Stack Profile Sets the rules that the network adheres to: nwkmaxdepth nwkmaxchildren nwkmaxrouters nwksecuritylevel And many more Table sizes Timeouts Route Cost Calculation Algorithm Govern stack interoperability Provide targeted solutions for different market segments 21
Architecture: Stack Profiles Stack Profile Name Network Specific Home Controls Commercial Building Automation Industrial Plant Monitoring Ultra Low Power Sensor Network Synchronous Star Network Reserved Identifier 0x0 0x1 0x2 0x3 0x4 0x5 0x6 0xF Planned Development 22
Architecture: ZigBee Device Types ZigBee Coordinator (ZC) One and only one required for each ZigBee network. First device to turn up Initiates network formation. Sets the house rules (Channel, PANId, Stack Profile) Acts as IEEE 802.15.4 2003 PAN coordinator (FFD). Also performs as router once network is formed. Not necessarily a dedicated device can perform an application too. 23
Architecture: ZigBee Device Types ZigBee Router (ZR) Optional network component. Discovers and associates with ZC or ZR. Extends the network coverage Acts as IEEE 802.15.4 2003 coordinator (FFD). Manages local address allocation / de-allocation Participates in multi-hop / mesh routing of messages. Looks after its ZED s when it comes to broadcasting and routing messages 24
Architecture: ZigBee Device Types ZigBee End Device (ZED) Optional network component. Discovers and associates with ZC or ZR. Acts as IEEE 802.15.4 2003 device (RFD). Can be optimised for very low power operation Relies on its parent to let it sleep Shall not allow association. Shall not participate in routing. 25
General Frame Format Octets: 2 2 2 1 1 Variable Frame Control Destination Address Source Address Routing Fields Radius Sequence Number Frame Payload NWK Header NWK Payload Bits: 0-1 2-5 6-7 8 9 10-15 Frame type Protocol version Discover route Reserved Security Reserved 26
Network Initiation: ZC Performs an Energy Detect Scan Performs an Active Scan Selects the nicest channel Selects an unused PANId Starts a network 27
NLME-NETWORK-FORMATION.request NLME-NETWORK-FORMATION.request { ScanChannels, ScanDuration, BeaconOrder, SuperframeOrder, PANId, BatteryLifeExtension } Directs the MAC to start up a PAN with the specified parameters using the MLME-START.request{} primitive. 28
Network Initiation: ZC ZigBee Coord. APL ZigBee Coord. NWK ZigBee Coord. MAC NLME-NETWORK- FORMATION.request MLME- SCAN.request MLME- SCAN.confirm Perform energy detection scan MLME- SCAN.request Select channel, PAN ID and logical address MLME- SCAN.confirm Perform active scan MLME- SET.request MLME- SET.confirm MLME- START.request NLME-NETWORK- FORMATION.confirm MLME- START.confirm 29
Network Association: ZR & ZED Performs an Active Scan Selects a compatible network Selects the highest acceptable router Associates with the router Allocated an address on the network 30
NLME-NETWORK-DISCOVERY.request NLME-NETWORK-DISCOVERY.request { ScanChannels, ScanDuration } Directs the NWK layer to scan for existing networks on a specified set of channels. The parameters are passed through to MLME-SCAN.request{}. 31
NLME-JOIN.request NLME-JOIN.request PANId, JoinAsRouter, RejoinNetwork, ScanChannels, ScanDuration, PowerSource, RxOnWhenIdle, MACSecurity Used on a ZR or ZED to request association with a particular PAN. Some MLME-ASSOCIATE.request parameters are passed through, e.g ScanChannels, some are synthesized, e.g. CapabilityInfo. 32
NLME-JOIN.indication NLME-JOIN.indication { ShortAddress, ExtendedAddress, CapabilityInformation SecureJoin } On a ZigBee coordinator or ZigBee router reports the successful joining of a child device. The parameters are as received from the MLME-ASSOCIATION.indication{} primitive. 33
NLME-START-ROUTER.request NLME-START-ROUTER.request { BeaconOrder, SuperframeOrder, BatteryLifeExtension } Used on a ZigBee router to start beaconing and other router activities after a network has been joined. Parameters are passed through to the MLME- START.request{} primitive. 34
Network Association: ZR & ZED Child APL Child NWK Child MAC NLME-NETWORK- DISCOVERY.request MLME- SCAN.request Perform active or passive scan MLME-BEACON- NOTIFY.indication... MLME-BEACON- NOTIFY.indication NLME-NETWORK- DISCOVERY.confirm MLME- SCAN.confirm Select suitable PAN NLME- JOIN.request MLME- ASSOCIATE.request NLME- JOIN.confirm Association procedure MLME- ASSOCIATE.confirm Authentication procedure NLME- START-ROUTER.request NLME- START-ROUTER.confirm MLME- START.request MLME- START.confirm 35
Addressing: Tree-structured Address Assignment CSkip based address assignment Address determined from tree location Address 0x0 0x7FFF 0xFFFF Depth 0 nwkmaxdepth Depth 1 Depth 2 Depth 3 nwkmaxchildren 36
NLDE-DATA.request NLDE-DATA.request { DstAddr, NsduLength, Nsdu, NsduHandle, Radius, DiscoverRoute, SecurityEnable } Used by higher layers for all data transmissions, broadcast and unicast. 37
NLDE-DATA.confirm NLDE-DATA.confirm { NsduHandle, Status } Reports the status of a transmission indexed by handle. Status values are INVALID_REQUEST or any status returned by the MCPS-DATA.confirm{} primitive. 38
NLDE-DATA.indication NLDE-DATA.indication { SrcAddress, NsduLength, Nsdu, LinkQuality } Reports the receipt of a NWK data frame. 39
Tree Routing: The address tells you where the destination is Simple equation gives route up or route down If LocalAddr < DestAddr < LocalAddr + CSkip(d-1) Route Down Else Route Up Address 0x0 0x7FFF 0xFFFF Depth 0 Depth 1 Depth 2 Depth 3 CSkip d= 1 Obviously not necessarily the most efficient route CSkip d= 2 40
Neighbour Routing: A ZC or ZR maintains a table of devices in its neighbourhood If the target device is physically in range it can send the message directly. Address 0x0 0x7FFF 0xFFFF Depth 0 Depth 1 Depth 2 Depth 3 Devices Neighbourhood But what happens if the destination is not in the local neighbourhood? 41
Mesh Routing: ZC or ZR maintains a routing table of next hop addresses If the target device has a routing table entry then the message can be sent using this route. Address 0x0 0x7FFF 0xFFFF Depth 0 Depth 1 Depth 2 Depth 3 That s great, but where do the routing table entries come from? 42
Routing: Route Discovery A device wishing to discover a route issues a route request command frame which is broadcast throughout the network. When the intended destination receives the route request command frame it responds with a route reply command frame. Potential routes are evaluated with respect to a routing cost metric. Best route is added to the routing tables of all devices on the route 43
Message Routing: The Basic Algorithm 1. See if the destination is in the Neighbour Table 2. Check for a Routing Table entry 3. Finally resort to Tree Routing NB. ZRs store messages for sleeping ZED s 44
Broadcast: The Basic Algorithm Transmit broadcast message Rebroadcast by local ZRs if it is new. Traverses the tree structure Time & radius limited. ZRs store messages for sleeping ZED s ZRs issue broadcasts on behalf of sleeping ZEDs 45
Network Layer Management Primitives NLME-PERMIT-JOINING.request NLME-PERMIT-JOINING.confirm NLME-RESET.request NLME-RESET.confirm NLME-DIRECT-JOIN.request NLME-DIRECT-JOIN.confirm NLME-GET.request NLME-GET.confirm NLME-LEAVE.request NLME-LEAVE.confirm NLME-LEAVE.indication NLME-SET.request NLME-SET.confirm NLME-SYNC.request NLME-SYNC.confirm NLME-SYNC.indication 46
Security: NWK Layer The Stack Profile defines the security level in use. Uses Network Key unless Link Key has been applied. Tool box offers both authentication and encryption facilities. Auxiliary Header and Message Integrity Code add overhead to the packet. nibsecuritylevel Security Suite 0 NONE 1 2 3 4 5 6 7 MIC-32 MIC-64 MIC-128 ENC ENC-MIC-32 ENC-MIC-64 ENC-MIN-128 47
To summarise the ZigBee network layer: Has 3 device types; ZC, ZR and ZED. Performs network discovery and formation Performs address allocation Performs message routing Configured by the stack profile Provides network wide security Allows low power devices to maximize their battery life ZigBee turns 802.15.4 into a low power multi-hop mesh network. 48