Four types of routing mechanisms in the ZigBee protocol
Tags: react, devops, news, html
Published: 2023-07-27 08:03:51

ZigBee routing has the following types
Table Routing
Broadcast Routing
Multicast Routing
Many-to-One/Source Routing

Part 1
Table Routing
In order for the source node to discover the path to the target node, the source node first sends a route discovery request to form a routing table. When a route between two nodes is established, the source node only needs to send data to the first node in the route, which is stored in the routing table of the source node.

Therefore, each intermediate node forwards the data to the next node of the route by querying its own routing table until the data reaches the target node. If the routing fails, the routing error is sent back to the source node, and then the source node can re-initiate the route discovery request.

Part 2
Broadcast Routing
Broadcast routing is a routing mechanism that sends messages to all devices in the network. The network layer broadcast has an option to choose whether to send the message to the routing device only, or to the non-sleeping terminal device, or to the sleepy terminal device.

The following table, set by broadcast address


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/k6n18zsamhcktfvysq5y.jpg)

A broadcast message will be repeated 3 times by all routing devices in the network to ensure delivery to all devices. While broadcasting is a reliable method of sending messages, it should be used with caution due to the impact on network performance.

Repeated broadcasts may limit other ongoing communications on the network. Broadcasting is also not a reliable way to send messages to sleeping devices, because the parent device is responsible for buffering messages to the sleeping child device, but may lose the message before the sleeping child device wakes up.

Part 3

Multicast Routing
Multicast routing provides routing options for one-to-many communications. Multicasting is used when one device wants to send a message to a group of devices, for example a switch sends a turn-on command to 10 lights. Under this mechanism, all devices join a group.
Only those devices that are members of the group will receive the messages, while other devices will route and forward these multicast messages. Multicast can be understood as a restricted broadcast, and too much use will reduce network performance, and neither broadcast nor multicast has ACK.

Part 4
Many-to-One/Source Routing
Many-to-One Routing is a simple routing mechanism that enables routing devices in the entire network to have a route back to the central node (concentrator). Under this mechanism, the central node (concentrator) periodically sends Many -to-One route discovery broadcast (default 60 seconds can be set according to requirements).
When the routing device in the network receives this broadcast, it has the next-hop route back to the central node (concentrator), and stores this hop node information in its own routing table. So far, as long as the routing devices in the network receive the broadcast of Many-to-One route discovery, they will know the route back to the central node (concentrator).
As shown in the figure below, C periodically broadcasts Many-to-One route discovery, and all routing devices in the network know the routing information from themselves to C, and update their routing tables at the same time.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4wots6sndsj36fvzrhwd.jpg)

Source routing refers to the routing mechanism that the central node (concentrator) will send to other routing devices. For the central node (concentrator), it does not yet know the downlink route, that is, the route for sending information to each routing device is not yet known. Therefore, when each routing device sends unicast to the central node, it will send a Route Record to the central node before that. The central node receives this Route Record, reverses this route and stores it in the Source routing table of the central node (the size of the table needs to store the source routing information of all routing devices in the network). In this way, the central node can obtain the route sent to the destination node by querying the Source routing table.

As shown in the figure below, when R1 sends unicast data to C, it will first send its own routing information to C, and when C receives the routing information from R1, it will reversely store the route in its own source routing table. The routing table will record the routing information of all routing devices in the network.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8e6q1017zu3xas10onxh.jpg)

In short, as long as the routing device receives the Many-to-One route discovery broadcast, it knows the route back to the central node. As long as there is information about the routing device in the Source routing table of the central node, the central node knows the route to the routing device.

If the central node (concentrator) is reset or powered off and restarted under abnormal circumstances, all the information in its Source routing table will be lost. At this time, a corresponding mechanism is required to restore its Source routing table. In this case, the central node (concentrator) can broadcast Many-to-One first.
Route discovery, and then broadcast a piece of data to each routing node, so that the routing node will reply a unicast to the central node (concentrator), and the routing node will send a Route Record before sending this unicast, so the central node can update its Source routing surface.

If all the routing nodes are powered off or restarted under certain abnormal conditions, the routing table of each routing node will also be lost. At this time, it is necessary to wait for at least 16 seconds. After each routing node establishes a link with the neighboring routing node, Then the central node (concentrator) sends the Many-to-One route discovery broadcast. Once each routing node device receives the Many-to-One route discovery broadcast, it has a route back to the central node.

Ebyte Electronic Technology Co., Ltd. specializes in R&D and production of wireless data transmission modules with various functions in various frequency bands. The products have been widely used in various application scenarios such as the Internet of Things, medical care, smart homes, and highways. If you have any needs, please contact email: **_service-es-@cdebyte.com_** or visit the website: [https://www.es-ebyte.com/](https://www.es-ebyte.com/)