* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Download Document
Computer network wikipedia , lookup
Network tap wikipedia , lookup
Airborne Networking wikipedia , lookup
Recursive InterNetwork Architecture (RINA) wikipedia , lookup
Zero-configuration networking wikipedia , lookup
Wireless USB wikipedia , lookup
Policies promoting wireless broadband in the United States wikipedia , lookup
Wireless security wikipedia , lookup
Piggybacking (Internet access) wikipedia , lookup
Wireless Control That Simply Works ‘Under the Hood‘ of a ZigBee 2006 Network Ian Marsden Chairman ZigBee NWG Director, Software Engineering, Integration Associates Copyright © 2007 ZigBee TM Alliance. All Rights Reserved. ZigBee is built upon the foundations provided by the IEEE 802.15.4 standard. Application Framework ZPUI Application Object 240 Application Object 1 [On Endpoint 240] [On Endpoint 1] [On Endpoint 0] APSDE-SAP APSDE-SAP APSDE-SAP APSME-SAP APSSE-SAP Application Support (APS) Layer NLDE-SAP NLME-SAP NLSE-SAP Security Service Provider ZigBee Device Object (ZDO) Network (NWK) Layer MCPS-SAP MLME-SAP Medium Access Layer (MAC) Layer PD-SAP PLME-SAP Physical (PHY) Layer ZigBee Stack TM ZigBee Alliance | Wireless Control That Simply Works Copyright © 2007. All Rights Reserved. 2 ZigBee Devices Type Model • • Application Device Type e.g. Light Sensor e.g. Lighting Controller ZigBee Logical Device Type ZigBee Coordinator ZigBee Router 802.15.4 Device Type FFD – Full Function Device ... ZigBee End Device RFD – Reduced Function Device • Distinguishes the type of device from an end-user perspective • Distinguishes the Logical Device Types deployed in a specific ZigBee network • Distinguishes the type of ZigBee hardware platform ZigBee products are a combination of Application, ZigBee Logical, and ZigBee Physical device types Profiles may define specific requirements for this combination, but can also leave this up to manufacturers ZigBeeTM Alliance | Wireless Control That Simply Works Copyright © 2007. All Rights Reserved. 3 802.15.4 Architecture: ■ Defines basic network structure ■ Provides methods for locating networks ■ Provides methods for joining / rejoining networks ■ Defines direct / indirect data transmission ZigBeeTM Alliance | Wireless Control That Simply Works Copyright © 2007. All Rights Reserved. 4 Architecture: Network Structure in 802.15.4 802.15.4 FFD 802.15.4 RFD Network Association ZigBeeTM Alliance | Wireless Control That Simply Works Copyright © 2007. All Rights Reserved. 5 MLME_SCAN: Locating Networks ■ Active Scan MLME-SCAN.request ScanChannels ■ Asks on the requested ScanDuration channels for other PANs ■ Returns a list of PANDescriptors ScanType = “Active Scan” MLME-SCAN.confirm status ScanType UnscannedChannels ResultListSize EnergyDetectList PANDescriptorList ZigBeeTM Alliance | Wireless Control That Simply Works Copyright © 2007. All Rights Reserved. 6 MLME_START: Initiating a Network ■ Starts the requested PAN MLME-START.request PANId LogicalChannel BeaconOrder SuperframeOrder PANCoord BatteryLifeExtension Realignment SecurityEnable MLME-START.confirm ZigBeeTM Alliance | Wireless Control That Simply Works Copyright © 2007. All Rights Reserved. status 7 MLME_ASSOCIATE: Joining a Network ■ Associates with the MLME-ASSOCIATE.request requested coordinator LogicalChannel CoordAddrMode CoordPANId CoordAddress CapabilityInformation SecurityEnable MLME-ASSOCIATE.confirm AssocShortAddress status ZigBeeTM Alliance | Wireless Control That Simply Works Copyright © 2007. All Rights Reserved. 8 MLME_SCAN: Rejoining a Network ■ Orphan Scan MLME-SCAN.request ScanChannels ■ Asks on the requested channels for its former parent ScanType = “Orphan Scan” ScanDuration MLME-SCAN.confirm status ScanType UnscannedChannels ResultListSize EnergyDetectList PANDescriptorList ZigBeeTM Alliance | Wireless Control That Simply Works Copyright © 2007. All Rights Reserved. 9 Data Transmission: Direct ■ The receiving device has its receiver on (RxOnIdle) ■ The data packet can be set unsolicited ■ The MAC schedules it for immediate delivery (using CSMA-CA) In-Direct ■ The receiving device is asleep with its receiver off ■ The data packet has to be requested (Polled) ■ The MAC stores it for later retrieval by the RFD. MCPS-DATA.request ZigBeeTM Alliance | Wireless Control That Simply Works Copyright © 2007. All Rights Reserved. SrcAddrMode, SrcPANId, SrcAddr, DstAddrMode, DstPANId, DstAddr, msduLength, msdu, msduHandle, TxOptions 10 Architecture: NWK layer details ■ ZigBee Device Types ■ Stack Profile, Network Rules ■ Network Management and Addressing ■ Message Routing ■ Route Discovery and Maintenance ■ Security ZigBeeTM Alliance | Wireless Control That Simply Works Copyright © 2007. All Rights Reserved. 11 Architecture: Network Structure in ZigBee ZigBeeTM Alliance | Wireless Control That Simply Works Copyright © 2007. All Rights Reserved. 12 Architecture: Stack Profile Sets the rules that the network adheres to: ■ nwkMaxDepth = 5 ■ nwkMaxChildren = 20 ■ nwkMaxRouters = 6 ■ nwkSecurityLevel = 5 (ENC-MIC-32) And many more ■ Minimum Table sizes (Neighbor, Routing) ■ Timeouts (Broadcast) ■ Route Cost Calculation Algorithm ■ Disables features (Multicast, Aggregation routing) ZigBeeTM Alliance | Wireless Control That Simply Works Copyright © 2007. All Rights Reserved. 13 Architecture: ZigBee Device Types ZigBee Coordinator (ZC) ■ One and only one required for each ZigBee network. ► ■ First one to the party Initiates network formation. ► Selects the time and place (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. ZigBeeTM Alliance | Wireless Control That Simply Works Copyright © 2007. All Rights Reserved. 14 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 ZigBeeTM Alliance | Wireless Control That Simply Works Copyright © 2007. All Rights Reserved. 15 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. ZigBeeTM Alliance | Wireless Control That Simply Works Copyright © 2007. All Rights Reserved. 16 General Frame Format Octets: 2 Frame Control 2 2 Dest Addr Srce Addr 1 1 0/8 0/8 0/1 Variable Variable Radius Sequence Number Dest IEEE Addr Srce IEEE Addr Multicast Control Srce Route Frame Payload Routing Fields NWK Payload NWK Header Bits: 0-1 2-5 6-7 8 9 10 11 12 13-15 Frame type Protocol version Discover route MCast Security Srce Route Dest IEEE Addr Srce IEEE Addr Reserved ZigBeeTM Alliance | Wireless Control That Simply Works Copyright © 2007. All Rights Reserved. Bits: 0-1 2-4 5-7 Multicast Mode Non Member Radius MaxNon Member Radius 17 Network Initiation: ZC ■ Initiates a ZigBee network NLME-NETWORKFORMATION.request ■ Performs an Energy Detect SuperframeOrder ■ Performs an Active Scan ■ Selects an unused PANId ScanDuration BeaconOrder Scan ■ Selects the “nicest” channel ScanChannels BatteryLifeExtension NLME-NETWORKFORMATION.confirm status ■ Starts a network ZigBeeTM Alliance | Wireless Control That Simply Works Copyright © 2007. All Rights Reserved. 18 Network Initiation: ZC ZigBeeTM Alliance | Wireless Control That Simply Works Copyright © 2007. All Rights Reserved. 19 Network Discovery: ZR & ZED ■ Locates ZigBee Networks NLME-NETWORKDISCOVERY.request ScanChannels NLME-NETWORKDISCOVERY.confirm NetworkCount ScanDuration ■ Performs an Active Scan ■ Selects a compatible network ZigBeeTM Alliance | Wireless Control That Simply Works Copyright © 2007. All Rights Reserved. NetworkDescriptor status 20 Network Association: ZR & ZED ZigBeeTM Alliance | Wireless Control That Simply Works Copyright © 2007. All Rights Reserved. 21 Network Association: ZR & ZED NLME-JOIN.request ExtendedPANId ■ Join a ZigBee Network JoinAsRouter ■ Selects the highest RejoinNetwork = 0 ScanChannels acceptable router ScanDuration ■ Associates with the PowerSource chosen router RxOnWhenIdle ■ Allocated an address on the network NLME-JOIN.indication ShortAddress ExtendedAddress ■ Inform the NHL CapabilityInformation SecureJoin NLME-JOIN.confirm ShortAddress PANId HaveNetworkKey Status ZigBeeTM Alliance | Wireless Control That Simply Works Copyright © 2007. All Rights Reserved. 22 Network Association: ZR & ZED ZigBeeTM Alliance | Wireless Control That Simply Works Copyright © 2007. All Rights Reserved. 23 Commencing Router Function: ZR ■ Commence Router Function NLME-STARTROUTER.request ■ Once authenticated on the children SuperframeOrder BateryLifeExtension network ■ Prepares addresses for its BeaconOrder NLME-STARTROUTER.confirm Status ■ Starts up the router function ZigBeeTM Alliance | Wireless Control That Simply Works Copyright © 2007. All Rights Reserved. 24 Addressing: Tree-structured Address Assignment ■ CSkip based address assignment ■ Address determined from tree location 0x7FFF Address 0x0 0xFFFF Depth 0 Depth 1 nwkMaxDepth Depth 2 Depth 3 nwkMaxChildren ZigBeeTM Alliance | Wireless Control That Simply Works Copyright © 2007. All Rights Reserved. 25 Sending Data ■ Used by the NHL for NLDE-DATA.request DstAddrMode DstAddr sending broadcasts and unicasts NsduLength Nsdu ■ DstAddr defines the target NsduHandle device Radius NonmemberRadius ■ Radius limits the number DiscoverRoute of hops for the message to traverse, if appropriate ■ DiscoverRoute can inhibit discovery ZigBeeTM Alliance | Wireless Control That Simply Works Copyright © 2007. All Rights Reserved. SecurityEnable NLDE-DATA.confirm NsduHandle Status 26 Receiving Data ■ Created on reception of data for the local device NLDE-DATA.indication DsrAddrMode DstAddr SrcAddr ■ SrcAddr is the originator of the message NsduLength Nsdu LinkQuality ZigBeeTM Alliance | Wireless Control That Simply Works Copyright © 2007. All Rights Reserved. 27 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 0x7FFF Address 0x0 0xFFFF Depth 0 Depth 1 Depth 2 Depth 3 CSkip d= 1 Obviously not necessarily the most efficient route CSkip d= 2 ZigBeeTM Alliance | Wireless Control That Simply Works Copyright © 2007. All Rights Reserved. 28 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. 0x7FFF Address 0x0 0xFFFF Depth 0 Depth 1 Depth 2 Depth 3 Devices Neighbourhood But what happens if the destination is not in the local neighbourhood? ZigBeeTM Alliance | Wireless Control That Simply Works Copyright © 2007. All Rights Reserved. 29 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. 0x7FFF Address 0x0 0xFFFF Depth 0 Depth 1 Depth 2 Depth 3 That’s great, but where do the routing table entries come from? ZigBeeTM Alliance | Wireless Control That Simply Works Copyright © 2007. All Rights Reserved. 30 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 ZigBeeTM Alliance | Wireless Control That Simply Works Copyright © 2007. All Rights Reserved. 31 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 ZigBeeTM Alliance | Wireless Control That Simply Works Copyright © 2007. All Rights Reserved. 32 Broadcast: The Basic Algorithm ■ Transmit broadcast message ■ Rebroadcast by local ZRs if it is new. ■ Time & radius limited. ■ ZRs store messages for sleeping ZED’s ■ ZRs issue broadcasts on behalf of sleeping ZEDs ZigBeeTM Alliance | Wireless Control That Simply Works Copyright © 2007. All Rights Reserved. 33 NLME-PERMIT-JOINING ■ Enable or Disable devices joining NLME-PERMIT-JOINING.request PermitDuration NLME-PERMIT-JOINING.confirm Status ■ Opens up a ZC or ZR for a possibly limited duration to new devices associating ■ Sets or clears the AssociationPermit status ■ PermitDuration in seconds 0 = Disable, 0xFF = Infinite ZigBeeTM Alliance | Wireless Control That Simply Works Copyright © 2007. All Rights Reserved. 34 Network Orphaning: ZR & ZED NLME-JOIN.request ExtendedPANId ■ Rejoin a previous Parent JoinAsRouter ■ Performs an 802.15.4 RejoinNetwork = 1 ScanChannels Orphan Scan ScanDuration ■ Previous parent will PowerSource respond RxOnWhenIdle NLME-JOIN.indication ShortAddress ExtendedAddress CapabilityInformation SecureJoin NLME-JOIN.confirm ShortAddress PANId HaveNetworkKey Status ZigBeeTM Alliance | Wireless Control That Simply Works Copyright © 2007. All Rights Reserved. 35 Network Orphaning: ZR & ZED ZigBeeTM Alliance | Wireless Control That Simply Works Copyright © 2007. All Rights Reserved. 36 Network Rejoining: ZR & ZED NLME-JOIN.request ■ Rejoin a network (New ExtendedPANId JoinAsRouter Parent) RejoinNetwork = 2 ScanChannels ■ Performs an Active scan to ScanDuration find out who is out there PowerSource ■ Selects new parent with RxOnWhenIdle capacity NLME-JOIN.indication ShortAddress ExtendedAddress CapabilityInformation SecureJoin NLME-JOIN.confirm ShortAddress PANId HaveNetworkKey Status ZigBeeTM Alliance | Wireless Control That Simply Works Copyright © 2007. All Rights Reserved. 37 Network Rejoining: ZR & ZED ZigBeeTM Alliance | Wireless Control That Simply Works Copyright © 2007. All Rights Reserved. 38 NLME-DIRECT-JOIN ■ Pre-join a device to a ZR NLME-DIRECT-JOIN.request CapabilityInformation or ZC ■ Enables the device to join later through orphaning DeviceAddress NLME-DIRECT-JOIN.confirm DeviceAddress Status ■ The CapabilityInformation is as the device would provide ZigBeeTM Alliance | Wireless Control That Simply Works Copyright © 2007. All Rights Reserved. 39 NLME-LEAVE ■ Controls the removal of NLME-LEAVE.request RemoveChildren devices from a network ■ Allows a device to leave itself (DeviceAddress = NULL) DeviceAddress Rejoin NLME-LEAVE.confirm DeviceAddress Status ■ Allows a device to request a child to leave NLME-LEAVE.indication DeviceAddress Rejoin ■ RemoveChildren defines if the children below the leaving device should also leave ■ Rejoin defines if the leave is a transient effect and the device should attempt to rejoin ZigBeeTM Alliance | Wireless Control That Simply Works Copyright © 2007. All Rights Reserved. 40 NLME-SYNC ■ Controls the receiving of data NLME-SYNC.request Track NLME-SYNC.confirm Status on a ZED ■ Requests a ZED to issue an MLME-POLL.request to its parent ZigBeeTM Alliance | Wireless Control That Simply Works Copyright © 2007. All Rights Reserved. NLME-SYNC.indication 41 NLME-RESET ■ Returns the stack to a known NLME-RESET.request state ■ In turn calls a MLME- NLME-RESET.confirm Status RESET.request ZigBeeTM Alliance | Wireless Control That Simply Works Copyright © 2007. All Rights Reserved. 42 NLME-GET & NLME-SET ■ Requests the value of configuration parameters from within the NIB NLME-GET.request NIBAttribute NLME-GET.confirm Status NIBAttribute ■ Updates the value of NIBAttributeLength configuration parameters within the NIB NIBAttributeValue NLME-SET.request NIBAttribute NIBAttributeLength NIBAttributeValue NLME-SET.confirm Status NIBAttribute ZigBeeTM Alliance | Wireless Control That Simply Works Copyright © 2007. All Rights Reserved. 43 NLME-ROUTE-ERROR ■ Informs the NHL of some break down in communications NLME-ROUTEERROR.indication ShortAddr Status ■ Used if Route Discovery fails ■ Used if Tree links break ■ Used if a packet cannot be delivered ■ Etc. ZigBeeTM Alliance | Wireless Control That Simply Works Copyright © 2007. All Rights Reserved. 44 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. ZigBeeTM Alliance | Wireless Control That Simply Works Copyright © 2007. All Rights Reserved. nibSecurityLevel Security Suite 0 NONE 1 MIC-32 2 MIC-64 3 MIC-128 4 ENC 5 ENC-MIC-32 6 ENC-MIC-64 7 ENC-MIN-128 46 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. ZigBeeTM Alliance | Wireless Control That Simply Works Copyright © 2007. All Rights Reserved. 47 Contact Details: Ian Marsden Integration UK Ltd Director, Software Engineering mailto:[email protected] DDI: +44 (0) 1737 227721 Cell: +44 (0) 7920 105537 Tel: +44 (0) 1737 227722 Fax: +44 (0) 1737 227744 16 - 18 West Street, Reigate, Surrey, RH2 9BS, United Kingdom http://www.integration.com ZigBeeTM Alliance | Wireless Control That Simply Works Copyright © 2007. All Rights Reserved. 48