Routing Algorithm Based on Communication Quality in Wireless Senor Network

The graph routing is a kind of routing mechanism proposed in the wireless senor network. At present, there is less research on the graph routing algorithm. In this paper, a routing algorithm of wireless senor network based on Received Signal Strength Indication (RSSI) and path stability is presented. The hierarchical algorithm based on RSSI of the communication link was adopted and guaranteed the least hop and communication reliability. The paper takes advantage of the hierarchical algorithm based on RSSI to ensure minimum number of hops and communication availability. A communication link quality mechanism based on path stability and RSSI that is used for communication nodes among layers is proposed. The routing among layers is selected based on the communication quality mechanism. The source routing is realized and used to the unicast downstream data transmission in Wireless senor network. The paper realized the source routing based on path stability.


INTRODUCTION
The development of micro-electronics technology and the research of wireless sensor network lay the technical foundation for process industry being wireless. Highway Addressable Remote Transducer (HART) Communication Foundation released the wireless HART specification and communication protocol in June 2007 [1]. The wireless HART is the application of the wireless senor network in the industry. The Wireless HART that is based on the physical layer of IEEE802.15.4 is combined with the private data link layer protocol, network layer protocol and application layer protocol. The security depends upon 128-bit Advanced Encryption Standard (AES). Time Division Multiple Address (TDMA) scheduling with frequency hopping that takes advantage of multifrequency, many links and the retry information is allocated to ensure the reliability.
Wireless HART that improves over conventional wireless sensor networks with its greater transmission reliability and robustness is realized by following implementation [2].
1) Routing The graph routing in which each hop has a redundant route is used for ensuring the transmission safety of wireless HART.
2) Channel Frequency Hopping Technology In hop Frequency transmission, 16 channels defined in IEEE 802.15.4 is used for the better network antiinterference. 3

) Communication Mode
In order to avoid conflict, TDMA is selected for the communication in wireless HART. It takes advantage of the clock synchronization technology of the whole network to ensure the transmission security.
Graph routing used for information transmission among devices is the key technology for great communication reliability.
In this paper a graph routing algorithm based on the quality of the communication link is proposed. The performance of the communication link is measured by RSSI and path stability. Hierarchical algorithm based on RSSI ensures the least number of hops. The routing selection between layers depends on the quality measure of communication link. The source routing algorithm defined by wireless HART is realized in the paper.

A. Network Compositions of Wireless HART
Wireless HART makes use of MESH technology and all of the network components are shown in figure 1 [3]. It is composed of Field Device, Adapter, Gateway Device, Wireless HART Handheld, Network Access Point and Network Manager [3]. Field devices that are installed in the field of industrial control are designed to collect the data of industrial field and transmit the data to host computer via the gateway. The device is required to be capable of routing other devices data to the gateway. The router that is a specified device used in the field is only responsible for data routing. The function of sensors and control are not required for the router.
2) Adapter An Adapter Device is a Network Device that connects wired HART Devices into the Wireless HART.
3) Gateway Device The gateway is responsible for the data transmission between different networks and the connection between wireless HART networks and factory automation networks. The application command of host PC is sent to the access point (AP) of network device by the gateway. At the same time, the gateway that is the bridge between HART device and other devices including host PC is also designed to complete protocol conversion. There are one or more APs in the gateway. They are capable of connecting between the factory automation network and wireless HART network. In wireless HART, the gateway that is generally functioned as the time synchronization source of the entire networks is responsible for the allocation of the time slot and the Superframe. 4) Wireless HART Hand held Handheld devices are used for establishing, control, monitoring and maintenance of network devices. The handheld device operated by the plant personnel is a kind of portable equipment. 5) Network Access Point Network Access Point is a Network Device that connects Gateways into the Wireless HART Network. The one side of Network Access Point is Wireless HART connection and the other side could be an Ethernet or Wi-Fi connection or a proprietary connection [3]. 6) Network Manager Network manager is responsible for the network management, allocation of the router, scheduling of resources and the parameter maintenance of the network communication. The network manger provides the mechanism for the equipment to join and leave and is able to manage the dedicated and shared resource. The network manger acquires the management and diagnostic information from network devices and adjusts network topology.
In the application of wireless HART, routing technology that is the key to ensure its normal operation is realized in the network manager.

B. Wireless HART routing Technology
There are two categories of routing defined in wireless HART network protocol including graph routing and source routing. They are generated and operated by network managers. In graph routing, each node occupies at least two routing paths that connect to the next hop node. Therefore, if one routing path failure happens, the communication is still available.
Different from the other wireless sensor networks, wireless HART is a kind of centralized mesh network. Its node locations are always fixed and the routing is calculated by the network manager. Therefore, some traditional routing algorithms, such as related routing algorithms for AD Hoc [4,5] and clustering algorithm [6,7], are not suitable for wireless HART.
The routing in Wireless HART Network is computed and maintained by the centralized manger unit(Network manger).There are a lot of research for Routing algorithm in center management control network. Most of them are TBR (Tree-based Routing) algorithm, which Based on Tree Routing algorithm [8,9,10]. The main idea of building a routing tree in the paper9 and paper 10 is that first set up the hierarchical graph, then select parents according to certain rules. The single path routing is generated by these Routing algorithm based on TBR (Tree-based Routing) and not suit to Wireless HART network for low reliability.
Because wireless HART network protocol is released in a short term and there is less relevant research, it is difficult for further research. In current, there are some documents on the characteristics of the wireless HART, protocol analysis and understanding [11,12,13]. Someone focuses on the research of the algorithm realization for the network resource scheduling [14,15]. Liu Yang make use of two redundant routing path instead of the graph routing algorithm in the wireless HART [13]. Zhao Jin dong proposed the graph routing algorithm achieving minimum number of hops, but the quality of the communication link is not considered in the routing selection [16]. A hierarchy algorithm of the graph routing is proposed by Dang Kui. According to the value of RSSI among nodes, the communication link whose link quality is low is forced to remove. However, the routing selection method between layers is not considered [17]. The scheme of adding and deleting routing in wireless HART proposed by Huang Cong is available to reduce the cost of routing maintenance [18]. Although double-tree structure is used, the communication link quality is not considered during the selection of parents trees. The graph routing algorithm proposed by Zhang qian considers the RSSI on communication link quality only [19].
In the paper, RSSI is chosen for the field device layering and the communication link quality depended on the path stability and RSSI is proposed. Simultaneously, inter-layer routing is used for the algorithm realization of graph routing in wireless HART and the implemented method of source routing in wireless HART is provided. Experimental results show that comparing with a single RSSI, the stability combined with RSSI used as the measure of the transmission link quality are better at reducing packet loss during the data transmission and improving the communication stability.
In wireless HART, the upstream that is applied to connect the node (field device) to the gateway is mainly responsible for transmitting the device data periodically. The data stream of the upstream is much more than the service data that is received from the gateway by the field device. The data that is transmitted from the field device to the gateway is not required to end-to-end response and resend. Because the higher reliability is required and a tremendous amount of data is likely to cause congestion, the graph routing is selected in the paper to ensure the security and reliability of the transmission. However, the data that is transmitted from the gateway to the field device is primarily used as the service data. There are endto-end response and retransmission mechanism during the PAPER ROUTING ALGORITHM BASED ON COMMUNICATION QUALITY IN WIRELESS SENOR NETWORK transmission. Therefore source routing is chosen for downstream in the paper.

III. GRAPH ROUTING ALGORITHM AND IMPLEMENTATION
Graph routing is defined by wireless HART network protocol. In this paper the routing algorithm is based on the hierarchy algorithm. The link quality that depends on RSSI and the path stability is introduced to select the inter-layer routing. The hierarchy algorithm proposed in the paper mainly makes use of RSSI to realize hierarchy. RSSI expressed in decibels is the received signal strength indicator. The path stability that is the link quality measure of the physical layer is defined as the ratio of the reception confirmation packet in the physical layer to the sending packet. It is described in percents. According to the link quality, inter-layer routing is calculated on the base of hierarchy algorithm and the upstream routing for each node is provided. Before the reasoning algorithm implementation, the network structure model of the wireless HART is firstly constructed.

A. Network Model of Wireless HART network
Wireless HART network takes advantage of centralized control MESH network and its structure is abstracted as the combination graph of nodes and edges. The graph is represented as G(V,E), where V represents the node, E indicates the connection between nodes. As shown in figure2, there are 10 field devices in the wireless HART network and the maximum number of hops is 4(defined in wireless HART protocol) where node 1 is the root node that is the wireless network AP (access point) while other nodes represents field device node. The edge weight between nodes indicates the link quality including RSSI and the path stability. All the information of the whole system comes from the neighborhood table information that is upgraded periodically. The neighbor information of the whole table is shown in table 1, in which 'RS' represents the value of RSSI, 'Sta' indicates the path stability and '-' expresses that the two node is disconnected in the physical layer. When the value of RSSI is lower than the valve -80db, the link is cancelled by the hierarchy algorithm and its value of the path stability isn't provided in the table1.As an example, the graph routing algorithm in the paper is illustrated in figure  2.

B. Hirarchy Algorithm Based on RSSI
In wireless HART, the field devices (node) is joined into the network in turn. The node that is already added to network regularly upgrades the neighbor table to the network manager. According to the value of RSSI, the node hierarchy is completed by the hierarchy algorithm. The algorithm is available to ensure the minimum number of hops that connect field devices to the network access point. The algorithm in detail is shown as follow: The symbol in the hierarchy algorithm: node[n] is used to represent node, where node [1] expresses the AP, node[2]-node[n] express field device. The order that is joined the network is corresponding to the field device and the smaller of the number the earlier that the device join the network. The layer of node[n] is represented as Level[node [n]]. The initial value is setup zero, it means that the node is not in the network. Algorithm implementation steps are as follow: Step5: If the node is the last one to join the network, exit algorithm. Otherwise, n is equal to n+1 and jump to the step 2; The topology in Fig.2 is completed by the application of the above algorithm and the result hierarchy is shown in figure 3. The related quality parameter of the link is shown in table 1. Node 1 that is AP is setting to level 1. In the neighbor table of node 2, 3, 4 and 5, the layer of node 1 is the smallest among all the nodes whose RSSI is larger than the valve -80db. Therefore, the node whose layer is the smallest than the other neighbor nodes is chosen to be level 2 and node 6, 7 and 8 are level 3. Then node 9 and 10 is setting to level 4 and node 11 is level 5.

C. Graph Routing Algorithm Based on Communication link Quality
The graph routing proposed in the wireless HART points out that there are two or more available neighbor nodes in the next hop of each node to ensure the reliability of the data transmission. Several key innovations that are the emphasis are introduced as follow.
1. The paper proposes the routing selection algorithm in the inter-layer according to the link quality. Instead of the consideration of only RSSI, it combined with the path stability and RSSI (the edge weight of the graph G(V, E) ). The rule that is used for two factors in the link quality is introduced as follow. At first, if RSSI is not larger than -75db, you have to abandon the use of the path. Then if RSSI is larger than -75db, the path stability is selected as the weight. At last, if the stability are the same, the path whose RSSI is larger is available.
2. According to the graph routing algorithm, each node in the wireless HART is required to have a child graph, the new joined node only need to select two upper layer node as the path to realize the graph routing of the node(graph superimposing). This selecting method simplifies the realization of the graph routing algorithm. The definition of above algorithm is defined as follow.
Definition: Node 1-N are graph routing nodes. Node n+1 is the newly joined one. That the two nodes from node 1 to node n are selected as the path is the graph routing of node n+1.

Proof:
Nodes from node 1 to node n are graph routing nodes and more than two paths are available to connect each node to the next hop node. Newly joined node n+1 is required to choose two nodes from node 1 to node n as the path. Therefore, each node that is used in the connection between node n+1 and the target node has two or more paths to the next hop node. It is the graph routing node.
In order to implement the algorithm described above, the graph routing of each node is represented by the chain table and the data structure is introduced as follow, where shortAddr represents the short address of the node, neighInfo [Max] is neighbor table information, *firstHoplink and *secondHopLink separately represent the first path information and the second path information.
typedef struct _Routergraph { U16 shortAddr; NeighInfo neighInfo[Max] ; struct _Routergraph *firstHopLink; struct _Routergraph *secondHopLink; }routerNode,*routerGraphlist; Because when the first node enters the gateway, there is only one path, the graph routing is only one. In practice, the reliability is improved by one routing selection and allocating two resources.
3. The node selects the upper layer node as the next hop node only in order to prevent loop circuit. In the application of wireless HART, if there is only one up-hop node, node sites have to be configured again.
For the first layer node, because the upper node is only one, nodes in the same layer are able to be chose. In order to prevent loop circuit, the neighbor node in the same layer that is earlier to join the network is selected as the next hop node (The address of the earlier joined node is smaller than the later one).

D. Algorithm Implementation of Graph Routing
The symbol in the algorithm: Node[n](n=1~n), represents the network node in wireless HART. Node [1] is the network AP. Node [2]~Node[n] express field device.
Step1: For the routing of node [2], the first path and the second one simultaneously point to the gateway ,then n is equal to n+1; Step2: The hierarchy algorithm of node[n] is used to calculate the layer of node[n]; Step3: If node[n] is on the first layer, the first path points to the gateway and the link quality weight of the neighbor table of the node that is earlier to join network is calculated. Then the 2nd path points to biggest weight neighbor then it is switched to step 6. Otherwise, the upper node in neighbor table is put into the array and the next step is the step 4.
Step4: Sort node in the array according to the link quality.
Step5: The path whose link quality weight is the biggest is selected as the first path by the node. The second biggest weight one is the 2nd path.
Step6: n=n+1 and if n is a new node, you have to switch to step2. Otherwise it goes to the exit.

E. Algorithm Verification and Simulation
In order to verify the effectiveness of the algorithm, the wireless HART network in figure2 is selected as an example. Node 1 is AP and 2 to 11 represent field devices. The graph shown in figure 3 is acquired by the application of the hierarchy algorithm. The link information for all the connections between the node and the upper node is shown in table 1. The graph routings from node 2 to node 11 are obtained respectively by the application of the algorithm proposed in section 2.4. In the paper the graph routing for node 2, 3, 7 and 11 is taken as an example.

IV. WIRELESS HART SOURCE ROUTING ALGORITHM AND IMPLEMENTATION
Because source routing is a category of single path routing, every routing node from the source node to the destination node is required to provide in the algorithm. The source routing in the paper is used to the unicast downstream data transmission in wireless HART. It is used to set up the parameter or test the link of field devices by the network manager or the gateway. Therefore, the source node of the source routing is AP and destination nodes are field devices. The routing sub graph of each node (the field device) is obtained by the graph routing algorithm in the paper. The source node is the field device and the destination node is the gateway in the graph routing. The source routing of the node is the link path that is applied for the connection from the source node to the destination node. In summary, the source routing from the gateway to the field device is the reverse path that is selected from graph routings of field devices came from the source node to the destination node. In graph routings, each node has two paths for the next routing. However, the source routing is the single-path routing. The Path stability is chosen as the performance indicator of the source route in the paper. The source routing algorithm that is from gateway to a node is shown as follow.
Step1: Store the source node S in the queue and assign the neighbor information of node S to intermediate node T.
Step2: Search for the path for the next hop in the graph routing according to the neighbor information of intermediate node T. If there is the gateway in the next hop node, the gateway node is stored into queue and exit. Otherwise turn to step3.
Step 3: The path stability is used to select one path from two paths. Then the selected node(the value of path stability is bigger)is put into the queue and the neighbor information of the selected node is assigned to intermediate node T. Switch to step2. After running the above mentioned algorithm, the reverse sequence of the nodes in the queue is the source routing of the node. The source routing algorithm is applied for each node in wireless HART in figure 2 and source routings are obtained. We illustrate the realizing process of algorithm with node 11. Node 11 is put into the queue and the neighbor information of node 11 to intermediate node T. Search for the neighbor information, node 10 is selected to put into the queue according to the path stability. According to the algorithm, the node 7, node 3 is put into the queue in turn. Node 1that is the neighbor of node 3 is the gateway and is put into the queue, then the algorithm exit. Node 11,10,7,3,1 are put into the queue, so the path from node 1 to node 11 through node 3,7,10 is the source routing of node 11. Source routings of node 7, node 9 and node 11 are shown in figure 5. Because the source routing algorithm is realized based on graph algorithm, it simplifies the algorithmic complexity and the source routing has the shortest hop.

A. Set up Experiment Environment
In order to verify the routing algorithm, we set up the experiment platform of wireless HART network. It is composed of the network manager, access point and the field device. The network manager is realized in Linux on computer and several MC13224 modules of Freescale are functioned as AP and field devices. The communication between AP and network manager is achieved by the PAPER ROUTING ALGORITHM BASED ON COMMUNICATION QUALITY IN WIRELESS SENOR NETWORK serial port. The graph and source routing algorithm are realized in the network manager.

B. Experiment Result
The algorithm is applied respectively for six cases including 5 field devices,10 field devices(see in fig2), 20 field devices, 30 field devices, 40 field devices and 50 field devices. The node of each case has maximum 4 hop from the node to gateway. At the same time, experiments are in three different conditions that are no-link quality measurement, RSSI measurement and the measurement combined with the path stability and RSSI. Each system adopts the same resource assignment algorithm. The experiment time is 24 hours. The end to end data transmission success rate is applied for the comparison and the result is illustrated in figure 6. As shown in the experiment result, no-link quality measurement has the worse result. Two identification mechanisms have little effects on 5 node and 10 node in the wireless HART network. However, while the network scale is increasing, the measurement combined with the path stability and RSSI is better on the communication quality improvement than RSSI. Based on wireless HART graph routing algorithm, a algorithm based on RSSI and path stability is proposed in the paper. According to the characteristics of the wireless HART node, hierarchy algorithm is provide to ensure the minimum hops between the node and the gateway. In addition, RSSI is considered for node layered to ensure the transmission reliability.
At the same time, the paper proposes a quality mechanism of communication link based on RSSI and the path stability and ensures the redundancy and the reliability of the intermediate route. The graph overlay and chain table structure are used for the algorithm simplification and the algorithm implementation of wireless HART graph routing. In the paper, we give the realizing algorithm of the source routing based on graph routing and simplify the algorithmic complexity. The graph routing and source routing algorithm in the paper are used to realize the network manager.