This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

怎么防止节点加入不该加入的网络?

Other Parts Discussed in Thread: Z-STACK

有若干个协调器,都烧写相同的HEX。协调器的IEEE地址未知,但是节点的IEEE地址已知,如何让某一个协调器选择这个节点。

  • 你协调器都一样,怎么选?你或者预留配置接口能对协调器做一定配置,或者预留按键触发通过NLME_PermitJoiningRequest()允许或禁止加入。

    如下copy自Z-Stack Developer’s Guide.pdf

    This is an optional configuration item to control which network a ZigBee Router or End Device will join. The ZDO_CONFIG_PAN_ID parameter in f8wConfig.cfg can be set to a value (between 0 and 0xFFFE). A coordinator will use this value as the PANId of the network that it starts. A router or end-device will only join a network that has a PANId configured in this parameter. To turn this feature off, set the parameter to a value of 0xFFFF.
    For further control of the joining procedure, the ZDO_NetworkDiscoveryConfirmCB function in the ZDApp.c should be modified. ZDO_NetworkDiscoveryConfirmCB() is called when the network layer has finished with the Network Discovery process [started by calling NLME_NetworkDiscoveryRequest() defined in the Stack API document].

  • 我用了两种方法,一种是在ZMAC.c中MAC_CbackEvent函数中判断MAC_MLME_ASSOCIATE_IND,如果发起asso的节点IEEE不合法,直接retrun,ASSO请求不会发给NWK。

    第二种方法,ZDO_JoinIndicationCB函数中添加判断,对于加入网络请求的设备判断其IEEE地址,不合法就return ZFailure。

  • 你们的那种方法有漏洞,如果在一套智能家居系统里,用NLME_PermitJoiningRequest的方式加入节点,我就能用一个恶意设备发起加入网络的请求,然后该系统就被我入侵了。

  • 你这就是典型的非标准开发了。建议你去了解下真正标准zigbee的安全性,高安全模式有5种钥匙。你说的方式,我随便用个中间人攻击就给你破了。更别说你都传明文。

  • 这两种方式是可行,但是,你的问题是要生成同样的hex. 既然你co的程序里有判断IEEE地址的部分,你怎么生成同样的hex?

  • coordinate内有个IEEE地址白名单,多个coor,只有白名单输入了节点的IEEE地址,节点才能加入这个coor。

    如果有节点成功加入网络,会广播annce指令,然后coor删除掉白名单。我让节点加入网络后,就把ExtAddr保存在ZCD_NV_APS_USE_EXT_PANID中,下次加入的时候才用Rejoin的方式,跳过Associat这一步(白名单判断只在Associate这步进行)。

    但是现在遇到一个问题,我使能了加密后,节点在向协调器发出rejoin指令时,rejoin指令也是加密了的,coor居然不响应。