zigbee: Add Zigbee module support
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: We intend 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 theZigbeeHelper
to quickly install 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 -
Many-To-One Routing
-
-
Implementation of NLME-NETWORK-FORMATION 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 with and without route discovery option. -
Broadcast (No passive acknowledge support)
-
-
-
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.
- MacInterfaceTable (Multiple interface support)
- Security.
- 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)
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 supports Mesh routing and Many-To-One routing. These features are under alpha testing. Refer to examples/zigbee-routing
and examples/zigbee-nwk-routing2
for examples of a ZigBee network with a coordinator and multiple routers. These examples shows:
a) A network formation (coordinator starts a new network)
b) Routers joining the network and address assignation.
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.
d) Route discovery. We can create routes using the mesh routing mechanism or the Many-To-One mechanism.
e) Trace routing to show the complete path to a previously discovered destination.
f) Support for printing of Neighbor, Routing, RREQ and route discovery Tables content for debugging and network management.
Future Work
- Source Routing support
- Tables entries expiration management (Routing Table, Neighbor Table, Route Discovery Table, RREQ retry Table, BTT)
- Implementation of NLME-SET (Request, Confirm)
- Implementation of NLME-GET (Request, Confirm)
- Implementation of NLME-ED-SCAN primitives (Request, Confirm)
- Traces support
- Multicast
Long Term future work:
- Zigbee Application Support Sub-Layer (APS)
- Zigbee Cluster Library (ZCL)
- Zigbee Device Object (ZDO)
- Application Framework (AF)