欢迎转载,请注明作者:石韧
http://blog.csdn.net/stonerme/article/details/53409732
第二章 ZigBee3.0协议栈的Standard Security
2.1 Standard Security
Standard Security是所有的ZigBee应用规范都使用的安全模型,包括ZigBee3.0。它也是EmberZnet协议栈中唯一支持的安全模型。
Standard Security分别使用Network Key和Link Key在网络层和APS层加密数据。APS层安全允许Trust Center来安全传输Network Key给加入节点或拒绝节点加入,并且它允许应用来增加可选的安全加密消息。网络层安全用来保证所有的ZigBee网络中发送消息的安全性。Standard Security不包括MAC层的通信(比如association,数据请求polling,MAC ACKs)。
2.2 Use of Keys in Standard Security
Standard Security定义了不同类型的Keys,使用不同的方式来保证数据的安全。所有的Keys都是用128位对称密钥(AES-128)来解密和加密数据包。
2.2.1 Network Key
Network Key用来保证网络层的安全传输。所有Standard Security网络中的设备都会对Network Key进行备份。Trust Center可以周期性的更新Network Key。Trust Center通过两种方式进行更新:广播更新或单播更新。在广播更新的情况下,Trust Center首先广播新的Network Key,此时使用旧的Network Key来对广播消息进行加密。在单播更新的情况下,Trust Center发送新的Network Key给每一个设备,此时使用Trust Center Link Key来对其进行加密。当新的Network Key发送给各网络节点之后,Trust Center再发送一条转换命令告诉所有的设备转换为新的Network Key。新Network Key对应一个序列码,这个序列码在旧的Network Key 序列码基础上加1。
2.2.2 Trust Center Link Key
Trust Center Link Key用于两个节点(其中有一个节点是Trust center)之间的端到端的安全通信。在以下情况下使用Trust Center Link Key:
• 当节点初次加入网络时,需加密传输Network Key到加入节点。
• 当Network Key更新时,有些节点因未接收到新的Network Key,因此需要Rejoin。此时,Trust Center使用Trust Center Link Key加密 Network Key发送给该重新入网节点。
• 路由器向发送给Trust Center,或从Trust Center接收APS安全消息时,需要使用Trust Center Link Key。比如路由器发送节点加入或Rejoin的更新给Trust Center时,或由Trust Center发送到路由器以执行一些安全功能的命令时, 需要使用Trust Center Link Key。
• 启用APS加密的应用程序单播消息,其中发送或接收设备是Trust Center。
由Trust Center决定如何管理Trust Center Link Key的选项。它可以为每个设备选择唯一的密钥
(从设备的IEEE地址导出的密钥),或者对于所有的设备采用相同的全局密钥。
2.2.3 Installation Code Keys
ZigBee 3.0支持Installation Code Key,在之前只用于Smart Energy Network(智能能源网络&#