A directional broadcasting algorithm for routing discovery in ZigBee networks

ZigBee provides a simple and reliable solution for the low-cost networks. The ZigBee ad hoc on-demand distance vector (Z-AODV) could use the global shortest path for data transmission by flooding the routing quest when necessary. However, the current routing algorithms cannot fully address the energy consumption issue. In this paper, we propose a directional broadcasting algorithm in routing discovery (DBRD) to reduce the routing overhead. Based on the network addresses, the network is divided into several continuous ‘clusters’. The node relative positioning and direction information are represented by the sequence of the clusters, and the devices which are not in the clusters covering the shortest path may not take part in the routing request rebroadcasting. The simulation results show that the DBRD could improve the performances of routing discovery, the routing overhead was effectively reduced and the end-to-end delay was also shortened since the algorithm occupied less finding time.


Introduction
ZigBee uses a mixed routing mechanism combined with hierarchical routing protocol (HRP) and ZigBee ad hoc on-demand distance vector (Z-AODV) [1]. For the Z-AODV, each node may initiate routing discovery when necessary; a global shortest path between the source and destination is obtained during the process and the data frame was sent along the route. However, ZigBee devices have limited processing capabilities, storage, power supplies and communication bandwidth. They may also move about randomly, which results in topology changes of the network. These constraints make it very difficult to find proper routing mechanisms that ensure high network throughput [2,3]. The routing protocols described in the specification still need more improvement [4,5].
In this paper, we focus on the improvement of the performance in routing discovery. In the original Z-AODV, an intermediate node may rebroadcast a certain routing request only once and abandon the other duplications. By this method, the routing request can arrive every device in the network. Nevertheless, this mechanism is not efficient since not all the devices have to take part in this procedure [6]. The coverage of the routing request broadcasting should be the whole network theoretically to ensure that the global shortest path can be found. However, this range can be reduced if some prior knowledge is available. The path length and direction are two common parameters to optimize the routing discovery if they are predictable in some level. Some improved broadcasting strategies based on the length control have been proposed in the ZigBee networks, e.g. the rebroadcasting times of the routing request can be limited to no more than the hierarchical hop counts [7]. By contrast, the path direction is more difficult to forecast because of the lack of the nodes' spatial information and the high cost of operation and maintenance [8].
In this paper, a simple directional rebroadcasting algorithm in routing discovery which follows the ZigBee specification is proposed. In our method, the two difficulties mentioned above are solved as follows. In the ZigBee networks, the recommended distributed address allocation mechanism (DAAM) guarantees a hierarchical topology, in which each subtree and its root can be regarded as the cluster and the cluster head. The transmission link between the nodes in different clusters can be described by a sequence of clusters. If the clusters are organized based on the location information, this sequence may also contain the directional information. Due to the limited resources and power supply in the ZigBee devices, it is impossible to realize positioning by itself or external devices. However, the relative position information would be enough to indicate the direction, and it can be easily obtained from the neighbour table, which is specified in the ZigBee specification. We propose an address reassignment algorithm based on relative position to ensure that the hierarchical structure is formed according to the nodes' spatial deployment. To address the energy cost issue, all the needed information are sent to the ZC, which has sufficient computing and storage capabilities. The ZC is responsible to calculate the cluster sequence to represent the direction and announce it to all the other devices.
The rest of this paper is organized as follows: The related works are reviewed in Section 2. Section 3 briefly introduces the ZigBee specification, and the directional broadcasting algorithm in routing discovery is proposed in Section 4. In Section 5, simulation results are presented. Finally, the conclusion is drawn in Section 6.

Related works
Considering the improvement of the routing discovery broadcasting, some progress has been made [9]. In [10], a hybrid routing algorithm without flooding is proposed. The hierarchical topology information is utilized to optimize the routing request broadcasting to reduce the overhead, and the residential energy of nodes is considered as one routing metric to balance the energy consumption. Because the link may follow the hierarchical path when a corresponding entry is found in the neighbour table of a certain intermediate node, the path it found is not proved the global shortest. In [11], an improved architecture for the combined routing mechanism is studied. The subtree parameter of the ZigBee network and network addresses of destination nodes are used to control the transmission range and restrict its transmission direction in Z-AODV. The algorithm could significantly improve the routing performance, but the routing cost and routing selection is not considered. It requires the accurate location information which is from external positioning devices. Sahinoglu et al. [12] propose self-pruning and forward node selection algorithms that exploit the hierarchical address space in ZigBee networks. The simulation results show that it improves the performance in terms of the number of rebroadcast nodes, number of duplicates received, coverage time and communication overhead. Nevertheless, this method is designed for data transmission, and it only excludes some high-depth nodes from the ones which rebroadcast a certain frame. The retransmission range is not well controlled. In [13], an effective broadcast algorithm called ZigBee broadcasting algorithm on route discovery (ZBARD) is proposed. As a known path, the HRP hop counts, which can be obtained when the network addresses of the source and destination devices are given, must be no less than the shortest path, and it can be used as the maximum retransmission times of the routing request. The ZBARD sets the broadcast radius to this value to reduce the control packets issued by the route discovery. This work effectively limits the retransmission range of routing requests, yet the direction of the coverage is not considered.
3 ZigBee specification and routing methods

Overview of ZigBee
Based on the IEEE 802.15.4 protocol, the ZigBee specification defines the standard of higher layers. Three device types are defined: ZigBee coordinator (ZC), ZigBee routers (ZR) and ZigBee end devices (ZED). ZC is responsible for starting a new network. ZC and ZR are routing capable, while the ZED cannot participate in routing and have to rely on their corresponding ZigBee parent routers for that functionality [14].
ZigBee network layer (NWK) provides functionality such as dynamic network formation, addressing, routing and discovering 1-hop neighbours. The network address is recommended to be assigned in a hierarchical tree structure with the DAAM. The deployed ZigBee devices automatically construct the network, and then changes such as joining/leaving of devices are automatically reflected in the network configuration [15].

Link quality indication
ZigBee devices support the function of testing the link quality indication (LQI) measurement every time they receive a frame. The LQI measurement is a characterization of the strength and/or quality of a received packet. The measurement may be implemented using receiver energy detection (ED), a signal-to-noise ratio estimation or a combination of these methods. The use of the LQI result by the network or application layers is not specified in IEEE 802.15.4 standard.
The LQI measurement shall be performed for each received packet, and the result shall be reported to the MAC sublayer. The minimum and maximum LQI values (0x00 and 0xff ) should be associated with the lowest and highest quality IEEE 802.15.4 signals detectable by the receiver, and link quality (LQ) values in between is uniformly distributed between these two limits. The LQI information of every single received packet can be simply acquired according to the standard with no more extra calculation and communication [15].

Address allocation and HRP
In ZigBee specification, it is recommended to use DAAM for address assignment to form a tree structure. The parameter Cm represents the largest number of children nodes, Rm means the number of children nodes which can be a router and Lm decides the maximum depth in the network. For the same network, different nodes usually have constant Cm and Rm. Every potential parent is provided with a finite subblock of the address space, which is used to assign network addresses to its children. Given Cm, Lm and Rm, we can compute the function Cskip(d) as the size of the address subblock distributed by each parent at depth d as (1) [15]: The network addresses A d+1,rn and A d+1,el shall be assigned to the n-th router child and l-th end device child at depth d + 1 in a sequential manner, respectively, as shown in (2): where A parent represents the address of the parent and 1 ≤ n ≤ Rm. The hierarchical topology in ZigBee network is based on DAAM. In this tree-shaped structure, if the destination address is in the address space that a node is managing, the node forwards the packet to one of its child nodes. Otherwise, it forwards the packet to its parent.

Neighbour table
Each ZigBee device maintains a neighbour table which has all its neighbours' information in the 1-hop transmission range. The contents for a neighbour entry are the network's personal area network (PAN) identifier, node's extended address, network address, device type, relationship, LQI, etc. Optionally, additional information such as the depth can be included. Entries in the table are created when the node joins to an existing network. Conversely, the neighbour entry is removed when the neighbour node leaves the network. Since the information on the neighbour table is updated every time a device receives any frame from some neighbour node, the information of the neighbour table can be said to be upto-date all the time.

Directional broadcasting algorithm in routing discovery
In the routing discovery, the broadcasting coverage of the routing request has to be large enough to ensure that the global shortest path can be found, while it also should be as small as possible to save the bandwidth and energy consumption. A common method in the ZigBee network is to limit the retransmission times to control the range, like the ZBARD in [13]. Limited to the resources in the ZigBee devices, the location-based controlling strategies are difficult to implement. However, the hierarchical ZigBee networks can be seen as clustering ones. If these clusters are organized by nearby principle and not overlapping, they may imply the inaccurate relative location of the devices. Considering the case in Figure 1, we assume the parameter Cm is 5; the network can be seen as consisting of five clusters that take the nodes in depth 1 as the cluster heads. If node A tries to send a packet to node B by Z-AODV, the global shortest path must start in cluster 1 and finish in cluster 4. Moreover, when we treat the network as round, the two radiuses through the nodes A and B divide it into two sectors; the intermediate nodes of the global shortest path are almost certainly in the smaller one (including the ZC), as the shaded area shown in Figure 1. By limiting the routing request within this region, the overhead in the routing discovery can be reduced.
Firstly, we have to find a proper method to represent the area and the direction. Based on the DAAM, one device can easily decide its cluster by searching its ancestor in the cluster head list. So, the cluster headers should contain all the network addresses without overlapping. The number of clusters is preset, and the cluster heads are chosen based on the principle mentioned above by the ZC; for a simple case, if the cluster count is equal to the Cm, all the routers in depth 1 are selected. The network address of the k-th router in depth d, according to (2), can be represented as The A parent is the address of its parent, which is also a router. For the depth 1 routers, their parent is the ZC whose address is 0. So, we can use the sequential number k to differentiate the clusters. Since the clusters are fan-shaped and not overlapping with a common vertex, each one may have at most two neighbours on both sides. Their relative positioning information can be represented by a sequence of adjacency (SoA). Since the neighbour device information is maintained by the neighbour table for each node, and we can tell which cluster a node belongs to if its network address is given, the SoA can be easily obtained. In Figure 1, nodes 1 and C can find each other in their neighbour tables, so it is the case with nodes D and 3; therefore, it can be concluded that cluster 1 is adjacent to clusters 2 and 3. However, if two clusters are too far apart to communicate, it may lead to the isolation. If all the nodes in one cluster can only find neighbours for the only other cluster, the cluster is isolated on one side, and if the communication is limited in the cluster, it is completely isolated. We use an isolation indicator (II) to announce such situations. Cluster 5 is a completely isolated cluster; the whole SoA of the network is [2,1,3,4,II,5,II]. The SoA is recursive and the last and the first clusters are adjacent by default, so another II is needed at the last.
The ZigBee network is organized as a hierarchical structure based on the DAAM, so the only task in the clustering is to choose the proper heads. Since the nodes in the same depth have different address spaces, it results in the fact that the number of the clusters can be only some specific integers, such as Cm and 2 × Cm − 1. This may decline the performance of the algorithm. In the hierarchical network, the address subblock overlapping of two routers (not including the ZC) only occurs when one node is the ancestor of the other, and the smaller space must be part of the greater one. So, we may allow the overlapping by making the nodes in the common parts only belong to the cluster with the smaller address space. For the cluster members, if it finds more than one ancestor in the cluster head list, the principle can be simply implemented by joining the cluster with the greatest depth. The above mechanism guarantees that the clusters are not overlapping by any cluster numbers.
In our algorithm, the clustering begins a short time after the network initialized. The ZC is in the charge of deciding the cluster heads (will be explained later). Then, all the devices that may find neighbours from other clusters are asked to report the adjacency to the head. Considering the overhead, if a certain device has announce its neighbour nodes from another cluster, all its descendants may be allowed to not monitor their neighbour tables anymore. Each cluster head may also report its adjacent cluster to the ZC, and the ZC may work out the SoA and announce it to the whole network.
During the routing discovery, besides the range and duplication control, all the receiving nodes have to decide whether to rebroadcast or not based on the following principle: the node may find which clusters the source and the destination belong to separately; if possible, it may obtain the intervals between the two clusters in the SoA for both the forward and the reverse sequence. If the node is in the cluster which is part of the shorter path, it may rebroadcast the request; otherwise, the frame is abandoned. As shown in Figure 1, the nodes in clusters 2 and 5 may not participate the routing discovery from nodes 1 to 2. By this method, the routing request rebroadcasting can be roughly limited in the smaller sector. If there is one II in the SoA, the mechanism of calculating the length of the bi-directional sequence is similar, whereas if the II is in the shorter part, it can be deduced that the best link is a polyline whose inflection point is or near the ZC, so only the nodes in the source and target clusters may rebroadcast the routing request. In the case of at least two IIs in the SoA, the network is absolutely segmented into more than two parts. If the start and the end devices are in the same section, the rebroadcasting is limited in the area from the source cluster to the destination one; otherwise, the request can be transmitted within only these two clusters.
Based on the principle above, the direction of the routing request flooding can be well controlled. However, its effectiveness and efficiency are closely related to the geometric parameters of the clusters. The expected clustering should have the similar scales, be uniformly distributed and not overlapping. The original networking method in the ZigBee specification cannot meet these requirements. So, a cluster head decision method is also proposed. Suppose the cluster number is n, the ZC has to decide n cluster heads, denoted as CH i . Based on the ZigBee specification, the LQI is a mandatory term in the neighbour table, and this value could reflect the distance between two devices (is approximately proportional to the square of the space). So, the distance between a node to the ZC, d i , and that between two nodes, d i,j , can be denoted by the LQI of the corresponding links 1/LQI i and 1/ LQI i,j , respectively. The cosine of the angle between the two lines of the ZC to the devices CH i and CH j , α i,j , can be calculated by the Cosine Theorem, as (4): For n clusters, there should be n lines from the ZC to the cluster heads. We only focus on the angles between two adjacent lines, α <i,j> . To a uniformly distributed clustering, each α <i,j> is 2π/n. Based on the neighbour table information, the mechanism of finding the adjacent lines is similar as the one deciding the relative position relationship in the SoA. Among all its neighbours, the ZC will choose n nodes that have the minimum mean square error (MSE) of the cosα ij to be the cluster heads, as shown in (5): Note that due to the limited transmission range of the ZigBee nodes, it is possible that two neighbours of the ZC may not find each other in their own neighbour tables. For that case, it implies that one node is out of the transmission range of the other, the LQI i,j is considered the least value.
However, this method cannot guarantee that every device outside the ZC's neighbourhood belongs to a certain cluster. To solve this problem, when the n candidates are decided, the address space of all the clusters is also obtained. If it cannot cover the whole network, the ancestor nodes that contain the missing region may substitute the origin candidates. In the rare case that part of addresses are still not included, if the k routers with lower depths which have the corresponding address subblocks have other child devices, they will be selected as k determined cluster heads and the deciding process will be repeated for the other n-k candidates. If one candidate has missing addresses, but it is the only child of the parent, it is decided as the cluster head and its parent may take part in all the routing discovery as a free node.
There is only one more issue we should consider. The effectiveness of the directional broadcasting algorithm requires that all the newly joining devices have to decide their parents (clusters) based on the minimum distance. The specified mechanism in the ZigBee, which meet this demand, is that a node tries to take the node with the best LQI as its parent. However, when the router with the best LQI has no more addresses to allocate, it may decline the joining request, and the joining node has to be the child of the second best candidate that may be from different clusters. In our algorithm, a node should be aware of the SoA when joining the network. When finding the potential parent refuses its joining, it is only allowed to be the descendant of the declining device by checking the network addresses.  Based on the scheme described in the subsection, the direction of the routing request broadcasting is controlled. In our algorithm, the transmission range is also limited by a similar method as the ZBARD. As a known path, the length of the hierarchical path that passes through the first common ancestor is used as the maximum hops in the routing discovery, and that length can be worked out if the network addresses of the source and destination are given.

Simulations
The performance of the proposed directional broadcasting algorithm in routing discovery is discussed in this section. The simulation was implemented in the MATLAB. Some parameters in the simulation were set as follows: the time duration was 300 s; the simulation area was 300 m × 300 m; the node numbers in the network varied from 25 to 200 (with the interval 25), and all of them were the ZigBee routers; the nodes were randomly deployed following the uniform distribution; Cm, Rm and Lm were set 4, 4 and 5 separately; the packet interval time was 1 s; the first packet arrival time followed a uniform distribution from 10 to 11 for each node; the source and destination were randomly chosen; and the cluster number was 5. For one scenario, the simulation was carried out 500 times to calculate the average.
The node mobility should be considered in the wireless networks. Since the ZigBee network is not for mobile communication, the node mobility is not high. In our simulations, each node was stationary for a random time that followed a uniform distribution from 50 to 150 s. Then, the node moved to a new position which is randomly chosen, and the moving speed was uniformly distributed from 1 to 10 m/s. We also made a mapping from the LQI in received data to the signal power. In our simulation, the channel followed Rayleigh fading with the δ 2 is 5. The slow fading was also considered. The amplitude loss followed a log-normal distribution, where the γ was 2.6 and the δ 2 was 15 dB based on the empirical coefficient values tested in indoor with soft partition. We mapped the best LQI (−3 dB loss) to 0xff (255) and the lowest quality compliant signals detectable by the receiver (−20 dB loss) to 0x00 (0); the values in between were uniformly distributed.
To the best of our knowledge, we cannot find similar direction controlling algorithms based on the ZigBee specification; thus, the directional broadcasting algorithm in routing discovery (DBRD) was compared with the original Z-AODV and the ZBARD. An example of the network clustering by the DBRD is shown in Figure 2. The cluster head candidates were decided according to Equations 4 and 5. However, these five nodes did not cover the whole network. Based on the mechanism described in Section 4, their ancestors containing the missing addresses might be chosen as the real cluster heads if they had already distributed some address blocks to other children. For the two candidates on the left side of the ZC, their father devices were selected as the grey nodes shown in the figure. On the other hand, although the candidate at the right bottom also had limited address subblock, its parent would not be selected because of the nonexistence of other descendants, and the other two candidates were decided as the cluster heads since they were able to cover all the devices in their direction. We can see that the network was successfully divided into five parts with similar sizes. On that basis, the directional broadcasting algorithm in routing discovery could be effectively applied.
The normalized routing overhead, which was defined as the ratio of the number of routing packets transmitted per data packets sent to the destination, was used to evaluate the performance in our simulations. The performances of different algorithms are shown in Figure 3. The Z-AODV had the greatest routing overhead for a fixed node number, because the routing request was flooding without any extra control. The ZBARD performed better due to its range limitation. We could see the DBRD could significantly reduce the cost in the routing discovery. That was mainly because it could suppress the rebroadcasting that probably not benefits the shortest path. Ideally, the overhead should be 50% less than the ZBARD, however, due to the nodes' uneven distribution, the improvement in our simulation was about 40.7% on average. Also, all the three methods had increasing normalized routing overhead according to the node number added. The DBRD curve had the least slope which implied the slowest increase.
In Figure 4, the execution time of routing discovery is also compared. The Z-AODV had the longest duration because nearly all the nodes had to join the rebroadcasting. As the flooding range was well controlled, the ZBARD could bring about the shorter delay. For the DBRD, since much less devices were involved, the wireless channel was more likely to be free. Thus, the routing discovery could be more quickly completed. On average, the routing discovery in the DBRD was 4.2% less time than the ZBARD.
The average path length obtained by different algorithms is shown in Figure 5A. It implied the average performance of different flooding methods. As all the nodes might take part in the routing discovery, the Z-AODV could guarantee the routing was the global shortest. The ZBARD had exactly the same performance since its limit range was no shorter than the best path. However, our method could not always get the best link. That was because the clustering could not divide the network into equal parts accurately. Moreover, the random node deployment and joining sequence might result in the  Figure 5B illustrates the performance of the DBRD in detail. Since the path in the Z-AODV was definitely the shortest, it was used as a reference, and the ratio of the average hops in one scenario was taken to indicate the performance of the DBRD. As shown, the DBRD which had a probability about 35% had the same paths to the Z-AODV in one simulation duration. This happened when the node locations were nearly uniform. It implied the DBRD could effectively find the optimizing path if the clustering was well applied. The DBRD also had satisfactory performance in the worse conditions. The totality of the hop rate from 1.05 to 1.2 was 52%. In these scenarios, only part of paths that passed through the nodes near some certain cluster boundaries had more hops. If the nodes are strongly asymmetric, the DBRD paths might be 1.25, 1.3 or more times of the Z-AODV; the chance was about 13%. Even in that situation, considering its much lower overhead, the performance of the DBRD could still be considered acceptable.
The overall comparison of different methods in routing discovery is shown in Table 1. The DBRD had better performances on the routing overhead and the time consumed. The DBRD could not always take the global shortest path. Compared with the greater improvement, especially the about 40% reduction on the routing overhead, the DBRD only had 15% less chance to have the hop counts 1.3 times the shortest path. The simulation results indicated that the performance of the DBRD is closely related to the node distribution, and the compatibility of our algorithm needed further investigation. Based on the analysis above, we could say that the DBRD improved the performance on the routing discovery.

Conclusions
In this paper, we proposed a DBRD to reduce the routing overhead. Due to the sufficient computational and memory recourses in the ZC, it was required to gather the node distribution information and clustering the network into parts with similar coverage. The adjacency of the clusters, also the direction, was represented by the SoA that was announced to every device in the network. The routing request was limited in the area of the shorter path in the SoA to reduce the routing overhead. Our algorithm was compared with the ones specified in the ZigBee and some classic improved methods. Although the DBRD could not always find the global shortest path, it had an acceptable performance. The simulation results showed that the DBRD could significantly lower the routing overhead. The normalized routing overhead might be 40% cut and the latency was slightly reduced.
Our further work will keep optimizing the clustering method in the directional broadcasting algorithm since the routing overhead is closely related to the size and node numbers in each cluster.