Page 1 of 10
Computer science and Control engineering
32 D. X. Uoc, ..., N. D. Anh, “Researching, building the routing algorithm in Zigbee networks.”
Researching, building the routing algorithm in Zigbee networks
Dao Xuan Uoc1*, Do Ngoc Tuan1
, Nguyen Xuan Bac1
,
Le Viet Hoang1
, Nguyen Duc Anh2
1
Information Technology Institute, Academy of Military Science and Technology.
2University of Fire Prevention and Fighting.
*Corresponding author: daoxuanuoc@gmail.com.
Received 5 September 2021; Revised 10 December 2021; Accepted 15 December 2021.
DOI: https://doi.org/10.54939/1859-1043.j.mst.csce5.2021.32-41
ABSTRACT
Zigbee wireless network built on IEEE 802.15.4 standard is becoming one of the most
popular wireless networks in modern IoT devices. One of the disadvantages of Zigbee networks
is the short transmission distance between devices. This paper focuses on researching and
comparing routing algorithms in Zigbee networks, thereby building the optimal routing
algorithm in the existing system. The paper’s objective is to form the basis for making Zigbee
tree and mesh networks, which improves the transmission distance for Zigbee networks better
than the star network.
Keywords: Zigbee Routing; Zigbee Technology; Zigbee.
1. INTRODUCTION
A routing protocol is a process of choosing the right path for data to go from a source
to a destination. This process encounters some difficulties in route selection, which
depends on the network type, channel characteristics, and performance indexes [1].
ZigBee's routing mechanism is designed at the network layer. Data packets are
encapsulated at the DLL (Data Link Layer) and through the physical layer to be forwarded
to the RD (Routing Device). The RD will unpack the data packet at its data link layer,
check the information for the subsequent transmission for its transmission destination, and
repackage the data packet for transport. The end device (ED) will first have to unpack the
data packet at its data link layer. After that, the data packet continues to be opened at the
network layer and transferred to a higher layer.
Frames are routed by ZC (ZigBee Coordinator) and ZR (Zigbee Router) through the
PAN (Private Area Net). Zigbee End Equipment (ZED) does not participate in packet
forwarding. These devices have a Many-to-one relationship in the Zigbee network,
which is shown in Figure 1.
Figure 1. Many-to-one in Zigbee networks [2].
Source Routing is an appropriate concept for static networks because it provides
routing information through previously defined network configuration records. Using
this routing concept shortens the time to route through the network successfully.
Page 2 of 10
Research
Journal of Military Science and Technology, Special issue No.5, 12- 2021 33
For dynamic networks that need to provide the ability to change in the network
topology, a ZigBee device may leave the range of the ZR associated with it and may link
to the network via another ZR.
In many use cases, there will exist a node (a node - a device in the network) in the
PAN network, which collects the data of all other devices. This node is called a central
or aggregation device. Without any optimization, all devices in the network need to
initiate an RREQ to get routing information towards the primary device. Therefore, the
ZigBee specification has defined an optimal routing model for such cases called many- to-one routing. The central device initiates the routing packet, which is to be broadcasted
in the network. Each network router will create a corresponding entry table on the packet
routing route to the central device.
2. RELATED WORK
2.1. The Ad-hoc On-Demand Distance Vector Routing Algorithm – AODV
AODV routing is a pure route acquisition algorithm. It can be understood as follows,
the nodes in the network that are not on the communication route do not maintain any
information about the way and do not participate in the cyclic routing process [3].
The primary purpose of the algorithm is to broadcast routing packets only when
necessary or required; this is done to distinguish between local communication
management and general communication protocol management and promote packages
about changes in the local link to neighboring mobile nodes (those that need information).
A route discovery process is established when a source node needs to connect to another
node, and the source node does not contain route information.
Disadvantages of AODV routing protocol
Due to the demanding nature of the AODV routing protocol, several problems are
associated with high routing costs and packet loss. In addition, the issue of power
consumption is one of the main problems, but it is not fully addressed in the ZigBee
specification. However, the nature of both the discovery and maintenance process creates
several problems that lead to the energy consumption of the nodes, affecting the life of
the network.
Some disadvantages of AODV routing protocol in route to destination establishment:
- Evaluating difficulty priority: The number of hops is used as a priority figure for
AODV routes and ignores other vital statistics.
- Duplicate messages: Sometimes, the intermediate node can receive from the same
RREQ source with fewer hops. The RREQ message must be forwarded again,
contributing to congestion and increasing transmission delay and energy consumption.
- High route discovery latency: Route discovery may take longer when nodes send
random messages; therefore, a waiting period is required until the second path is
established.
2.2. The tree algorithm
Zigbee Tree Routing Protocol is a network layer and data link layer protocol that uses
"connection state" packets to format a single tree network, as well as an extended tree
network. This type of network is essentially a self-organizing and self-supporting type to
Page 3 of 10
Computer science and Control engineering
34 D. X. Uoc, ..., N. D. Anh, “Researching, building the routing algorithm in Zigbee networks.”
limit network failure to an acceptable level of failure; more specifically, because this is a
self-organizing network, it can also repair itself when there is a problem at a certain
network node. Network nodes choose a node as the root of the tree and create branches
freely. Then, the branches grow independently and connect to other units using the
original device (Designated Device-DD).
Disadvantages of tree routing protocol
The ZigBee tree routing algorithm considers only the relationship between the relay
node and the parent nodes and the child nodes between the nodes but ignores the
neighbors. So, there are some problems; even if the destination node is in the sending
node's communication domain, the data packets must be transmitted to the destination
node along with the tree topology but not directly to the destination node. In addition, if
several nodes frequently need to transfer data, these nodes may soon run out of battery,
resulting in reduced network life [4].
2.3. The Hierarchical Routing Algorithm – (HERA)
In the HERA algorithm - a hierarchical algorithm, data generated at the sensors (end
devices) is transferred to the sink and routed along with the branch to the root (gateway)
according to a parent-child relationship; that is, all nodes in the network only pass data to
its parent node. On the other hand, for data transmission between two sensors or from a
sink to a sensor, packets are routed up or down the tree according to the destination
address by exploiting the decentralized address evaluation scheme Zigbee only provides.
Routes to the destination are determined before a sensor node needs to perform routing [5].
The HERA algorithm helps minimize the exchange of information because it utilizes
MAC binding procedures. The HERA algorithm is simple, lightweight, and does not
require large memory for routing tables [5].
3. PROPOSED METHOD
3.1. General description
Zigbee Sleepy End Device (ZED hay ED)
Zigbee Router (ZR) hay Repeater (Rpt)
Zigbee Coordinator (ZC) hay Zigbee
Gateway (GW)
Figure 2. Zigbee network architecture.
The article builds an appropriate routing algorithm in Zigbee networks for the real
problem that gateway and repeater use power from the adapter (with backup battery), so
it may not care much about the power issue of those devices. Terminal devices (ED -
sensors) only use power from lithium batteries, so they should minimize energy use with
these devices; they are often in idle mode, only waking up periodically to check sensor
parameters or have a wake-up effect from the sensor. The terminal device will send a
Page 4 of 10
Research
Journal of Military Science and Technology, Special issue No.5, 12- 2021 35
network maintenance packet for a certain period; after receiving the response message, it
will go to sleep mode. Nodes in the network rarely change locations.
There are four types of packets used in the proposed Zigbee network. The first is the
RRID (Route Request ID) packet; this is the network registration packet. The second is
the RREQ (Route Request) packet; this is the routing packet. The third is the RRDT
(Route Data) packet, which is the data transmission packet. The last one is the ACK
packet (Acknowledgment); this is the feedback packet.
3.2. General system requirements
For Zigbee networks, there are three general requirements that must be satisfied.
Firstly, the packet's route is the shortest, with the smallest number of hops (if the number
of hops is equal, choose the route with the optimal received signal strength indication
(RSSI). Secondly, the processing time for incoming and outgoing packets must be the
fastest (optimization of packets and handling). Thirdly, the density of packets emitted by
the system must be minimal (avoid occupying bandwidth and interfering packets with
each other when transmitting and receiving). Finally, Node will register its routing
network, and when it fails, it has to reroute.
3.3. The pathfinding algorithm
The system applies the HERA pathfinding algorithm with some modifications to suit
the application of the system. In the existing system, packets from sensor nodes will be
sent to the IP address and ID of the destination node. Each device will have a unique ID
identifier. With IP, the nodes have their IP, the IP of the Gateway is the IP of the
network, the Repeaters have a shared IP.
Compared with the original HERA algorithm, the proposed algorithm has the
following adjustments. Information exchanged in the algorithm is bidirectional from ED
to GW and from GW to ED. The routes in the algorithm are managed by GW combined
with load balancing to optimize the management of information flows for the network.
Therefore, some routers in the network are not necessarily the most optimal, but overall
the system will work the most stable. The system has a self-repair function (described in
the experiment section) when the route is broken. Packets in the network are classified,
which optimizes processing time at repeaters and GW, helping to reduce transmission
latency. RRDT packets must have a response when sent for confirmation. If there is no
response, proceed to send RREQ to the nodes to get back the route information (for
uplink packets, downlink packets, reporting an error to GW for rerouting) and then send
data back. Routing is mainly processed on the GW (with a separate processor and
memory from the Zigbee module), which is shown as follows. Firstly, Gateway will
have path information of each node (Gateway -> node), ID list, and a total number of
steps, RSSI to the hierarchical node list. Secondly, the Gateway will stratify the node
based on the number of steps (transmission level) and the received signal strength of
each node to the Gateway. The algorithm determines which route with the smallest
number of hops will be selected; if there are the same transmission hops, the route with
the most optimal RSSI received wave strength will be selected (here, because RSSI has a
negative value so the smaller the displayed value, the more optimal the RSSI). Thirdly,
Nodes store information about the nearest node that has been routed. Finally, when
receiving data from the Gateway through the node, the number of steps must be updated
for optimization.
Page 5 of 10
Computer science and Control engineering
36 D. X. Uoc, ..., N. D. Anh, “Researching, building the routing algorithm in Zigbee networks.”
Figure 3. End Device sends a packet to join a network.
Figure 4. Repeater sends a packet to join a network.