An IP Format Based Algorithm for ZigBee Routing Protocol Optimization

Learning from the conventional practice of network IP address format, this paper proposed an IP-format-based algorithm for ZigBee energy-balanced routing protocol optimization. The algorithm combines node’s cluster address and node’s network short address into a new address and divides the address’s field as IP-format. So that the address will contain information of the network’s topology and provide decision base for a routing algorithm to optimize the original algorithm selection criteria. Meanwhile, in order to improve the ratio of valid data packets and reduce routing overhead, the new algorithm controls the general direction and the number of hops of the RREQ packets to reduce unwarranted data packet transmission. Finally, the simulation carried out on NS platform demonstrates the algorithm’s superiority on network’s delay jitter, overhead and residual energy.


Introduction
Recent years, WSN (Wireless Sensor Networks) is widely used in all walks of life owing to the development of wireless technology and the embedded intelligent control system [1].With the escalation of basic communication technology, wireless sensor network technology is developing rapidly towards the direction of low cost, low power, small size, versatility and high-density deployment to meet the increasingly demand [2].However, a large-scale and high-density WSN will surely produce a large amount of raw data and cause the multi-hop data transmission phenomenon.Generally, due to the battery-powered WSN nodes and the changeable and complex environment, WSN has defects of unbalanced network energy consumption, dynamic changes of networks topology and low network reliability [3] [4] etc.By learning the traditional practice of network IP-address format and the cluster heads in WSN [5] [6], we proposed an optimized algorithm for ZigBee routing protocol based on a new IP-format short address.
The structure of this paper is as follows.In section 1, we address the research background and the problem issue.In Section 2, we briefly describe the standard ZigBee protocol and analyze its shortcomings.In Section 3, a model of IP-format address and a more flexible routing decision in WSN are carried out.In Section 4, several simulation results are given.Finally, this paper is concluded in Section 5.

Analysis of Standard ZigBee Protocol
Generally, ZigBee network transfers data in a bidirectional way.Its network layer supports three topologies: star, tree and mesh.Traditionally, ZigBee network combines two routing algorithms: Cluster-Tree based algorithm and AODV-based routing algorithm.As for cluster tree algorithm [7] [8], the main idea is that the nodes are pre-assigned static addresses according to the given formula, thus forming the parent-child relationship, as is shown in Figure 1.Nodes do not need to maintain router information, and destination can be found according to the static network addresses.To achieve this purpose, three network parameters must be pre-defined: the maximum number of child nodes C m , the maximum depth of network L m , and the maximum number of routers R m .Afterward, the address space of node in depth d, i.e.C skip (d), satisfies Equation (1).Assuming that the address of a parent in depth d is A father , then its k-th sub-ZR's Addresses is assigned to the Equation ( 2) and its n-th sub-ZED's address is assigned to the Equation (3).If D is father A 's child, then they satisfy formula (4), but not vise versa.
( ) ( ) ( ) ( ) In a mesh topology network, ZigBee prefers to use AODVjr algorithm to establish a routing path.It abstracts three data packets: RREQ (Route Request), RREP (Route Reply), RERR (Route Error).If the source node maintains the effective path to the destination, data will be transmitted directly.Otherwise, the network will start a router-discovery process.
Despite the fact that the standard ZigBee protocol, to a certain extent, can avoid defects separately caused by an AODVjr or a Cluster-Tree [9] [10], but it still has some deficiency.First, the routing decision is inflexible.In Figure 1, node 1 needs to send data to node 43.The most likely path to be found is 1-0-43.But the standard  ZigBee protocol will start the AODVjr route-discovery process, which is unnecessary as the path can be easily calculated by the cluster-tree algorithm without consuming energy to broadcast RREQ packets.Second, the AODVjr's router-discovery process has redundant packets.If node 23 sends data to node 38, node 22 and node 24 will also broadcast RREQ packet, which is redundant in most cases.The relationship between nodes can be obtained by analyzing their new addresses.Taking node 38 and node 2 as an example: 38's address is [21.5.ff.ff.38], we can see that 38 is in the second layer and the step size to its sibling's address is 5; Node 2's address is [21.5.ff.ff.2], so it's also in the second layer.However, because (|38-2|) %5 doesn't equal 0, so these two nodes do not belong to the same sub-branch, i.e. they are not siblings.If we use the cluster-tree algorithm to transmit data, there are at least 4 hops.The AODVjr will only take one hop if both nodes are routers and can communicate with each other directly.So that we can analysis the positional relationship between source and destination in advance, especially for hops.

Related Work
Based on the new address, the improved algorithm is described as follows.Flowchart for proposed methodology is depicted in Figure 3 (C stands for the current node).
In order to balance network's power consumption, the improved algorithm optimized the direction and the flooding scope of RREQ packets.First, we can acquire the relationship between S and D by pre-analyzing their addresses, and we can set RREQ'S TTL to an appropriate value.Second, we optimize redundant RREQ packets: if the destination is a child of the current node, then the current node's parents should discard RREQ; else if the destination is a parent of the current node, then the current node's children discard RREQ.Last, during the route discovery process, nodes in relatively high energy level have priority to the route.Improved AODVjr router discovery process is shown in Figure 4.

Simulation
In order to effectively evaluate the improved algorithm, this paper carried out several simulations based on NS2 platform.Simulation parameters are shown in Table 1.
Data's format is CBR (Constant Bit Rate); the packet size is set to 80 Bytes; sending interval is 0.2 seconds.Experimental results of this analysis are shown as follows.

Jitter
Delay jitter is the assessment of the network's stability at a certain frequency.Network's traffic rate is 250 Kbps, transmission interval is 0.2 seconds.Simulation curves are shown in Figure 5.
As is shown above, the upper and lower limits of two algorithms' network delay jitter are basically bet-ween±0.05s, which means that network has high stability.The comparison also shows that the improved algorithm's delay jitter spikes are significantly reduced, indicating that network latency is relatively stable and network stability has also improved to some extent.

Network Residual Energy Percentage
Figure 6 shows that network with the improved algorithm has a higher level of residual energy: First, the improved algorithm pre-analyzed relationship between source and destination, making routing-decision more flexible.Second, the improved algorithm optimized the direction and flooding scope of RREQ packets, thus reducing packet redundancy.Last, during the routing discovery process, nodes in relatively high energy level have priority to route, making energy consumption more balanced.

Network Routing Overhead
Figure 7 shows that the improved algorithm optimized the direction and flood scope of RREQ packets and dropped useless RREQs, reducing the routing overhead to some extent.

Network Throughput
Figure 8 shows that the improved algorithm's network throughput is relatively lower than the standard algorithm.The reason is that each network packet needs to add a 4-byte prefix representing the depth of the node and a 1-byte node relationship flag, thus causing a decrease in the proportion of valid data.However, the decline of network throughput is slightly, and the new network throughput still remains at a relatively high level; So that, taking its good performance in delay jitter, network residual energy and routing overhead into account, the algorithm's performance has been greatly improved on the whole.

Conclusions
The Internet assigns a unique IP address to each host in all sub-networks and divides the IP address into 4 segments.This format makes IP address contain much information about the network's topology.Learning from this practice, this paper creatively combined the nodes' short address and their cluster head into a new address and divided the new address's field according to IP format.Based on the new address, this paper optimized routing decisions by pre-analyzing the relationship between source and destination and enhanced the control of RREQs' direction and flooding scope.The simulation shows the new algorithm's superiority over the standard algorithm in network's delay jitter, overhead and residual energy.Our work will provide a research direction for node localization in the large-scale network as well as attracting researchers to draw more attention to existing effective techniques in the cable network.In the future, we will focus on solving the decrease in the proportion of valid data and reduce throughput the by using compressed sensing technology.
In the Internet, terminals can easily transmit data to each other via IP addresses.Learning from this practice, we set up a new address and format it according to IP's segment format.Define the depth of node i as CL i .Assuming that L m = 4, the new address's default value is [ff.ff.ff.ff.shortAddr].The coordinator's address is [0.0.0.0.0].Nodes distributed in depth 1 are assigned addresses like [Cskip (1).ff.ff.ff.shortAddr] and CLequals 1; nodes distributed in depth 2 are assigned addresses like [Cskip (1).Cskip (2).ff.ff.shortAddr] and CLequals 2, and so on.

Figure 2
shows how the network looks like with brand new addresses.
Assuming S sends data to D: • Step 1: If S is ZED, the data are transmitted directly to its parent.Otherwise, skip to step 2. • Step 2: If S is a router and has a valid path to D, then transmits data directly.Otherwise, skip to step 3. • Step 3: If S and D are in a parent-child relationship (That's to say, hop equals 1), then transmit data directly.If the hop between S and D equals 2, set RREQ's TTL to 1 and wait for ALLOWED_HELLO_LOSS * HELLO_INTERVAL (AHLHI for short) milliseconds.If S do not receive RREP, then transmits data using the Cluster-Tree algorithm, otherwise establish a new communication link based on the content of the RREP to transmit data.Otherwise, skip to step 4. • Step 4: Start an improved AODVjr router-discovery sub-process to find a path to transmit data.

Figure 2 .
Figure 2. Network with new addresses.