Skip to content

Draft: zigbee: Add Zigbee module support

Alberto Gallegos requested to merge shattered.feelings/ns-3-dev:zigbee into master

This MR proposes the implementation and addition of a Zigbee module to ns-3 to provide a non-IP-dependent routing alternative to the lr-wpan module. More specifically, we will focus on implementing the Zigbee network layer (NWK) using Zigbee Pro stack profile (Mesh Routing). The implementation will be based on the 2017 Zigbee Protocol specification ZigbeeProSpecificationNWK2017.pdf.

At the moment, the Zigbee Application Support Sub-Layer (APS) is not planned but future support is considered. Likewise, higher layers such s Zigbee Device Profile (ZDP) or Zigbee Cluster Library (ZCL) are not planned in the current proposal.

NOTE: Our intention is to have the described module included in the main repository of ns-3, we welcome comments, suggestions, and code reviews from all ns-developers and ns-users interested in this project. The module will be co-developed with the help of Tokushima University students. Future maintenance of the module is also planned.

In no particular order, the summary of goals for the current implementation are:

  • Implement ZigbeeStack to serve as an encapsulating class for easy management of Zigbee layers.
  • Implement ZigbeeHelper for easy installation and configuration of the ZigbeeStack with the underlying LrWpan MAC layer.
  • Creation of ZigbeeStackContainer used by the ZigbeeHelper for quick installation of ZigbeeStacks on top LrWpanNetDevices.
  • Implement the Zigbee network header (ZigbeeNwkHeader) used by all the frames passing through the NWK layer.
  • Implementation of Zigbee network payload headers (Currently, only RREQ and RREP command frames).
  • Creation of routing tables and neighbor tables to support routing discovery and route creation.
  • Implement Network Layer Data Entity (NLDE) and the Network Layer Management Entity (NLME) primitives:
    • Implementation of NLME-NETWORK-DISCOVERY primitives (Request, Confirm)
      • RREQ retries support
    • Implementation of NLME-ROUTE-DISCOVERY primitives (Request, Confirm)
      • Mesh Routing
      • Source Routing
      • Tree Routing
      • Route maintenance
    • Implementation of NLME-NETWORK-FORMATION primitives (Request, Confirm)
    • Implementation of NLME-ED-SCAN primitives (Request, Confirm)
    • Implementation of NLME-JOIN primitives (Request, Confirm, Indication)
      • Using MAC association procedure
      • Using the orphaning procedure
    • Implementation of NLME-DIRECT-JOIN primitives (Request, Confirm)
    • Implementation of NLME-START-ROUTER primitives (Request, Confirm)
    • Implementation of NLDE-DATA primitives (Request, Confirm, Indication)
      • Unicast
      • Broadcast
      • Multicast
  • Examples of zigbee NWK model (UNICAST)
    • Example zigbee-routing (Network formation, Network Join, Route discovery and Data Tx)
    • Example zigbee-direct-join
    • Example zigbee-association-join
  • Tests of zigbee NWK model
    • Test zigbee-rreq-test

Not considered for the initial implementation of the module:

  • Multicast support of any kind.
  • Security.
  • Routing
    • Source Routing
    • Tree Routing
  • Application layer
    • Zigbee Application Support Sub-Layer (APS)
    • Zigbee Cluster Library (ZCL)
    • Zigbee Device Object (ZDO)
    • Application Framework (AF)
  • Zigbee Stack profile 0x01 (Tree topology and distributed address assignment)

zigbeeStackArch

Present capabilities of the module

In its current state, the module provides a ZigbeeStack that encapsulates aZigbeeNwk object (The NWK layer). With the use of a ZigbeeHelper, all the necessary callback hookups effectively connect the NWK to a LrwpanNetDevice (PHY and MAC layers).

In the same way that lr-wpan, Zigbee NWK communicates with other layers via primitives (interface functions).

Currently, network joining is supported (Both direct join and using the MAC association procedure). The scenarios found in the examples/ show the usage and installation of this Zigbee NWK layer using helpers and some basic use of NWK primitives.

Support for other primitives and operations is added periodically.

The NWK now has Routing Mesh capabilities. This feature is under alpha testing. Refer to examples/zigbee-routing for an example of a zigbee network with a coordinator and multiple routers. This example shows:

a) A network formation (coordinator starts a new network)

b) Routers joining the network

c) Data transmission is performed. During this data transmission, a route discovery is issued to find the best route from the coordinator to the destination device.

Edited by Alberto Gallegos

Merge request reports