(配套源码、软件、开发板等资源,可移步博客同名QQ群:拿破仑940911)
1. Joining direct to Trust Center
Once the transport key is received by the joining device, it will proceed to check the source address of thistransport key command. In this case the 64-bit IEEE address will be different from 0’s and FF’s, since the TC exists in this network. The following steps describe the unsecure joining process to a Centralized network.
1. Joining device sends association request.
2. Parent device sends association response.
3. Trust Center delivers the network key in a Transport key command. This transport key command is APS encrypted either withDefault Global Centralized Key or an Install Code derived key.
4. Joining device is able toget the network key from the encrypted Transport Key command andannounces itself with a ZDO device announce command.
5. Joining device then queries the ZDO Node Descriptor from the trust center.
6. Joining device parses the Node Descriptor to look at the stack version revision (this field has been added by R21 version of ZigBee specification).
a. If the stack version supported by the TC is not present (0x00), this means it supports a version from before to R21, so the joining process will finish at this step.
b. If the TC of the joined network is R21 or later, the joining device must update its APS Key. This is done by thejoining device by sending an APS Request Key command.
7. Trust Center will deliver the Unique Trust Center link key with an APS Transport Key command.
8. Joining device will update its key from Default status or Provisional status if install code was used, to Unverified, after which the key must be verified. To verify the key, thejoining device will send an APS Verify Key command to the TC containing the Unique key hashed (to avoid sending the key in plain text).
9. Trust Center hashed the key associated to this device and compares against the hash received. If those are the same, it willsend an APS Confirm Key command with status Success, after which the TCLK exchange procedure is finished for the joining device.
The joining process into a Z3.0 Centralized network directly to the TC is illustrated in the following picture.
The joining device will attempt up to BDBC_REC_SAME_NETWORK_RETRY_ATTEMPS each step from steps 1 to 4, upon failure in any of these steps; the device will retry the next suitable network in the network descriptor list.
In the same way, the steps 5 to 8 are attempted up to BDB_DEFAULT_TC_LINK_KEY_EXCHANGE_ATTEMPS_MAX times each step, upon failure in any of these steps; the device will perform a Factory New reset, to erase the network parameters and keys obtained at the failing step.
The application will receive a notification on these according to BDB notifications.
2. Joining when parent is not the Trust Center
A similar process occurs when the device joins through a parent device that is not the TC. The parent device sends APS Update device commands to the TC to notify about the new device and from then the parent device only relays the frames between the joining device and the TC as illustrated in the following picture.
(配套源码、软件、开发板等资源,可移步博客同名QQ群:拿破仑940911)