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.

How to detect that an insecure device has associated to a secure ZigBee Pro network? (then send it a Leave command)

Other Parts Discussed in Thread: Z-STACK

I've turned on network-layer security/encryption for our router and coordinator running Z-Stack v1.2.2a using a pre-shared key and no link-layer security.

#define SECURE = 1
defaultKey = DEFAULT_KEY;
zgPreConfigKeys = TRUE;
zgApsLinkKeyType = ZG_GLOBAL_LINK_KEY;
don't define TC_LINKKEY_JOIN.

The secure router can associate with the coordinator and then performs Device Announcement using network-layer encryption.  The coordinator begins talking to it with network-layer encrypted packets.  That's great.  However, a router with security turned off also can associate with the same secure coordinator and then just hangs out.  It performs Device Announcement unsecured, the coordinator sends it an encrypted Transport Key message (all zeros because zgPreConfigKeys==TRUE) and then the coordinator keeps sending it network-level encrypted packets, which the un-secure router can't understand.  But by being associated with the coordinator, it's taking up space in the routing/neighbor tables and could be used to attack the coordinator by exhausting the coordinator's allocated address tables.

At the network layer, how can my coordinator differentiate association requests from devices which are capable or not capable of secure communication before every accepting the association request?

Looking at Wireshark captures, the Beacon Request -> Beacon -> Association Request -> Data Request -> Association Response sequence doesn't include capability information about the network layer I guess because they're MAC-layer messages.  The Frame Control Fields for them indicate Security=0/false and I assume that would later be used for the link layer security that ZigBee supports.

Side note:

* ZDApp_ProcessSecEvent->ZDSecMgrNewDeviceEvent->ZDSecMgrAssocDevAuth appears to automatically authenticate device association requests without verifying that the device requesting association actually is capable of secure communication.  I thought the sequence was supposed to be Associate (unsecure) and then Authenticate?

  • If ZR/ZED doesn't enable Zigbee security and join a secure Zigbee network, ZC won't send transport key to those ZR/ZED.
  • Actually, it will still send a "Transport Key" APS command (encrypted with ZigBee network security header), but it will be filled with zeros. That seems primarily due to (zgPreconfigKeys==True) on the coordinator, not really due to the security or lack of the security in the joining node.

    Still the only way that I know of to detect non-secure nodes joining the network is to set a timer in the coordinator to track whether they send any encrypted application layer packets within a certain amount of time.  I'm still looking for any suggestions on how to detect a non-secure node joining a network using network-layer encryption/security.

  • Are you sure about this? I suggest you to use Ubiqua Packet Analyzer to check it.