Zig Bee ZDO and ZDP Speaker Chang KaiJia
Zig. Bee, ZDO, and ZDP Speaker : Chang Kai-Jia Date : 2010/5/12
Contents Zigbee network services Zig. Bee Device Object Zig. Bee Device Profile ◦ ◦ Device discovery services Service discovery services Binding services Management services 2
APSME-SAP 3
Zigbee network services Zig. Bee contains two sets of services for network commissioning and maintenance: ◦ The Zig. Bee Device Object (together with the Zig. Bee Device Profile) ◦ The Zig. Bee Cluster Library Ø Zig. Bee Device Object (ZDO) Ø Zig. Bee Device Profile (ZDP) Ø Zig. Bee Cluster Library (ZCL)-Ch 6 4
Zig. Bee Device Object Ø ZDO is a specialized of application object (with profile ID 0 x 0000) which each node must have this to manage: ◦ Configuring, and maintaining Zig. Bee devices and services on the network. ◦ Keeps track of the state of the Zig. Bee device on and off the network. ◦ Provides an interface to the ZDP. ◦ Establish the security relationship between two nodes. Glossary 5
Glossary Profile ID: 16 -bits(0 x 0000~0 x. FFFF) ◦ Application Pro: Each application profile addresses the needs of a specific application market. ◦ Stack Pro: Main provisions of the general nature of the network parameters. (p. 154) Cluster ID: 8 -bits(0 x 00~0 x. FF) ◦ Nwk_Addr_Req (Cluster Id: 0 x 00), according to IEEE address to refer short address. ◦ Nwk_Addr_Rsp (Cluster Id: 0 x 80)。Check myself address match with zdp. Nwk. Addr. Req (Cluster Id: 0 x 00) ,and send response. 6
7
Glossary Endpoint: ◦ Endpoint is like Socket on the same network(PAN). 8 -bits addressing. ◦ Endpoints are a logical extension added to a single Zig. Bee radio which permits support for multiple applications, addressed by the Endpoint number (1 -240). ◦ One Application Profile described per Endpoint. ◦ Maximum of 240 Endpoints per Zig. Bee Device (Endpoint 0 is reserved to describe the generic device capabilities and Endpoint 255 is reserved for broadcasting to all endpoints, Endpoints 241 -254 are reserved for future use) 8
Zig. Bee Device Object ZDO not only interacts with APS, but also interacts directly with the network layer. ZDO controls the network layer, telling it when to form or join a network, and when to leave, and provides the application interface to network layer management services For example, ZDO can be configured to continue attempting to join a network until it is successful, or until a user-specified number-of-retries has occurred before giving up, and informing the application of the join failure. 9
Zig. Bee Device Profile ZDP services include the following categories: ◦ ◦ Device discovery services Service discovery services Binding services Management services ZDP contains a set of commands for discovering various aspects about nodes in the network. 10
Device Discovery Device discovery services have a few things in common: ◦ They provide additional information about a node. ◦ They are all optional from the client side, but some server side processing is mandatory (a common subset among all Zig. Bee devices). ◦ They are node-wide, and do not represent any particular application, or Application Profile residing on an endpoint in the node. Device discovery services Service discovery services Binding services Management services 11
ZDP v. s Endpoint The Zig. Bee specification calls these “ device discovery services, ” which can be confusing because endpoints contain device IDs which really describe individual Zig. Bee applications running in that node. So, when you see ZDP Device Discovery, think node-wide services. (not application/endpoint specific) 12
Device Discovery Notice that all the ZDP services on the client side are optional. Zig. Bee does not require that a node be able to send NWK_addr_req , for example. But on the server side of this equation (a node receiving a NWK_addr_req and responding to it), the ZDP service is mandatory. 13
A tool may want to collect the IEEE (aka MAC) address of every node in the network (using IEEE_addr_req , for example) so all nodes in the network must support the server side ( IEEE_addr_rsp ). Use request. Type 0 x 00 to get only the IEEE and NWK address for one node. Use the extended request. Type 0 x 01 to get the information for the node and for all its children as well. Remember, only routers will have children. 14
Set up ZDP services: ◦ Use ZDP to discover which nodes to talk to in a Zig. Bee network. ◦ Optional ZDP services may be mandatory in the application profile. ◦ Remember to enable the optional services if they are needed by a Bee. Stack application. Because embedded system that are very limited by RAM and Flash (ROM), which means every byte can be precious. 16
Service Discovery In addition to the services related to devices, or nodes, ZDP also contains a variety of standard services for querying the applications within those As with the device discovery services, most of the ZDP service discovery services are optional. Only a few service side responses are required. Device discovery services Service discovery services Binding services Management services 17
18
Discovering and Matching Endpoints ◦ Discovering application endpoints and the services they support is a common commissioning step in Zig. Bee. Backing Up and Caching Discovery Information ◦ Zig. Bee utilizes the concepts of backing up and also caching the discovery information. 19
Example: Use a Discovery_store_req first to allocate the space on the discovery cache for the various items, including endpoints and simple descriptors Then use the various store commands (Simple_Desc_store_req ) to actually store the data on the cache. Using System_Server_Discovery_req , other nodes in the network can find the cache and request the sleeping node’s information using commands such as Active_EP_req. This ZDP commands: • System_Server_Discover_req • Find_node_cache_req • Discovery_Cache_req • Discovery_store_req • Node_Desc_store_req • Power_Desc_store_req • Active_EP_store_req • Simple_Desc_store_req • Remove_node_cache_req 20
Binding provides a mechanism for attaching an endpoint on one node to one or more endpoints on another node. Binding can even be destined for groups of nodes. Then, when using APSDE-DATA. request, simply use the “ indirect ” addressing mode, and the request will be sent to each endpoint or group listed in the local binding table. Device discovery services Service discovery services Binding services Management services 21
Binding( cont. ) The binding table is smart, and keeps track of both the short (16 -bit Nwk. Addr) and long (IEEE) address of a node. If a destination device has changed its short address (either due to a Zig. Bee End-Device moving from one parent to another in Zig. Bee stack profile 0 x 01, or due to a address conflict in Zig. Bee Pro), the binding table entry is updated automatically to point to that new address. 22
Binding( cont. ) 23
Binding( cont. ) Sender: ◦ src EP: 12 ◦ Src EP: 5 -it would go to three destinations node 0 x 1234 endpoint 12 broadcast to group 0 x 9999 node 0 x 5678 endpoint 44 24
End_Device_Bind_req uses an optional state machine on the Zig. Bee Coordinator to bind or unbind two devices. This service can be useful in a “ press-thebutton-on-two-nodes-to-bind-them ” operation, useful on some Home Automation products. 25
Binding( cont. ) Demonstrates a third-party node binding a switch to a light over-the-air. Granted, it shows the concept of Zig. Bee commissioning with a third-party tool. The ZDP bind commands require an IEEE address. If a node receives a ZDP bind command it doesn’t know about the destination address, it will issue a ZDP NWK_Addr_req to find the node, because it actually needs both long and short addresses to complete the operation. 26
Management Services The ZDP Management services are really handy optional services used for reading the various tables contained within Zig. Bee nodes, and to request certain common actions Device discovery services Service discovery services Binding services Management services 27
Starting and Stopping Zig. Bee with ZDO_Start() ◦ ◦ g. Start. With. Out. Nvm_c g. Start. Association. Rejoin. With. Nvm_c g. Start. Nwk. Rejoin. With. Nvm_c g. Start. Silent. Rejoin. With. Nvm_c ZDO_Stop() ZDO_Leave() Ø Non-Volatile Memory(NVM): 「非揮發性記憶體」,或「非消失性記憶體」,即 當電源關掉時,資料仍然存在。 28
Layers addressing : MAC: ◦ 64 bits IEEE address (long address、mac address) ◦ 16 bits NWK address(short address) NWK: ◦ 16 bits NWK address APS: ◦ 8 bits Endpoint 29
Reference Zig. Bee: Addressing Energy Efficiency How to use the Zig. Bee Device Object (ZDO) What is a Zig. Bee Application Profile? Zigbee Alliance 新通訊 2006 年 2 月號 60 期 Zigbee Network Layer Tutorial - Part 3: Broadcasts and Neighbors AODV Design and Application of Zig. Bee/Ethernet Gateway in Remote Control Systems 30
- Slides: 29