2.2.5 Out-Of-Band Commissioning
通俗地讲就是node通过IEEE802.15.4 packets operating 之外的其他方式在network中通讯。例如inter-PAN packets 或者是NFC
- Co-ordinatro可以用Out-of-band commissioning 创建一个new network;
- Router or End Device可以加入一个existing network;
- network中数据通过out-of-band方式传输,与network相关的数据送到ZigBee Base Device;
- 用函数BDB_u8OutOfBandCommissionStartDevice()来启动out-of-band commissioning。
- 如果用out-of-band commissioning加入一个centralised network,the trust centre会核实the correct network、Trust Centre address等网络参数。如果node收到validation request,下面两种方式可用来获得data values
- BDB_vOutOfBandCommissionGetData()读相关datas。在将data送到Trust Centre之前,需要encrypt(编码)network key。 The install code 与encrypt有关。
- BDB_eOutOfBandCommissionGetDataEncrypted()不仅可以读数据同时也完成encrypt network key 工作。
- The Trust Centre收到相关data后,用BDB_bOutOfBandCommissionGetKey()函数来decrypt(解码)network key。,然后核实相关参数。
2.3 Network Security
- ZigBee Base Device支持两种security modes:
- Centralised security
- Distributed security
- 所有的router 和end device nodes必须支持以上两种security modes。A co-ordinator仅支持centralised security。
- 在调用BDB_vInit()函数时,函数内部就调用BDB_vSetKeys(),这个函数会load the appropriate pre-configured link key,由此决定了node 所支持的security mode。The pre-configured link keys 放在bdb_link_keys.c中。
2.3.1 Centralised Security Networks
- A centralised security network is formed by a Co-ordinator,同时在network中也扮演着Trust Centre的工作。
- A node 尝试加入网络之前,必须得到Trust Center的认证(authenticated)。
- All nodes 必须pre-configured 一个link key。This key用来encrypt network key ,当从Trust Centre将network key传到 a newly joined node时候。
- 当node加入一个centrialised security network,the ZigBee Base Device会自动使用相关的pre-configured link key。
- 对于centralised security来说,有下面几种类型:
- Default Global Trust Centre Link Key: This key 出厂前就烧入所有nodes 用来encrypt Trust Centre 和 node之间的communications。
- Touchlink Pre-configured Link Key: This key 出厂前就烧入用touchlink commissioning 的nodes,用来encrypt Router parents和node之间的communications。 有3种类型:
- Development key;
- Master key; 成品都用这个;
- Certification key;
- Install Code-derived Pre-configured Link Key: 有ZigBee stack 根据随机的install code生成的key。
- Install Codes
- An individual node 和 centralised securtiy network之间通信的时候,install code 被用来创建一个initial link key。
- An install code to commission a node 如下:
In the factory:
- Individual node 随机生成一个install code;
- 下装到node上;
- ZigBee stack由install code 生成一个pre-configured link key;
- Install code 封装到node上;
During installation:
- Node里面的install code 被安装进co-ordinator/Trust Centre;
- Co-ordinator/Trust Center的ZigBee stack根据install code生成pre-configured link key;
- Trust Centre和node根据pre-configured link key 来管理网络。