A Distributed Agents QoS Routing Algorithm to Transmit Electrical Power Measuring Information in Last Mile Access Wireless Sensor Networks

Internet of Things or wireless sensor networks (WSNs) can be utilized in monitoring electrical power consumption. For electrical power application, the main issue is how to effectively apply self-organized WSNs technology to handle the last mile communication and supply the reliable, real-time transmission. For example, great number of renewable generators' instantaneous voltage and power parameters should be reported in real time to dispatching center, which is the primary guarantee to keep the power system's stability. In this paper, integrating traffic engineering and distributed agent technologies, a novel distributed agents QoS routing algorithm is proposed to transmit electrical information flows with multi-QoS constraints. The algorithm can explore fast forward path with multiagents and guarantee transmitting quality with smooth allocating different traffic. We also present the mathematical analysis to prove the algorithm's validity. Finally, in the computer simulation, the average end-to-end delay, routing overhead, and links' bandwidth occupation ratio are computed to evaluate the algorithm performance. Coincident results show that the new algorithm can provide short end-to-end transmission with optimal utilized communication resource. A health infrastructure with load balance can effectively avoid the potential congestion and has robust capability to bear abrupt strong traffic flows.


Introduction
In intelligent home system, Internet of Things (IoTs) or wireless sensor networks (WSNs) are widely employed to transmit different kinds of information, in which electrical power consumption is one of important information effects on people's daily life. On the other hand, smart grid systems also require real-time electrical power consumption information from consumer sides [1,2]. It is necessary to design a network architecture that is capable of providing secure and reliable end-to-end communication among intelligent electrical meters, power supply system, and consumers [1,3].
Presently, there are a number of wired communication technologies and standards that can be used in electrical power communication networks, such as 100 Gbps optical fibers physical infrastructure, Synchronous Digital Hierarchy (SDH) technology, and Automatically Switched Optical Network (ASON) architecture [4]. But there is also another important challenge that is to provide a reliable and flexible last mile communication. Wireless communication technique and self-organized networks theory with the qualities of easy access and cost effectiveness have been extensively considered [5].
For the electrical power application, the main issue is how to effectively apply self-organized WSNs technology to handle the last mile communication and supply the reliable, real-time transmission. As it is well known, many adverse factors in application scene affect data delivery integrally. Unattended sensor nodes have miniaturization size (mm scale for smart dust motes) and low-reliability hardware circuit when coping with harsh conditions, such as the industrial utilization. In addition, different kinds of atrocious conditions and unpredictable accidents are also prone to fail in data transmission, such as from physical damage to the node or malicious attack to the system. Moreover, even if the condition of the hardware is healthy, the communication between sensor nodes is always affected by many factors, such 2 International Journal of Distributed Sensor Networks as fading, signal strength, obstacles, weather conditions, and interference.
On the other hand, while WSNs get the benefit from data aggregation via "intranetwork processing" to reduce communication costs and improve energy efficiency, the aggregated data carries more information than each individual data packet [6]. Losing any part of the aggregated data or long transmission delay will incur a fatal failure. Hence, guaranteeing data delivery multi-QoS and integrality is greatly challenging, which are distinctive from contemporary wireless cellular communications and wireless ad hoc networks [7,8].
Considering the electrical power application, in one selfgoverned smart grid, different kinds of electric information are transmitted among digital secondary meters, called microflows. Different kinds of electrical parameter flows, including switchgear's boolean controlling variable, feeder voltage/current analog signals, and incorrect information files, have different QoS requirements. To control multiple microgrids combined and divided, voltage and power parameter should be reported in real time to dispatching center. Different transmitting attributes of information flows in digital electronics secondary equipments are ubiquitous, in which distributed topologic control and fast protocols should be employed to accurately operate micro grid combined or divided in smart grid system [4]. Unfortunately, achieving multiple kinds of flow requirements in electric power communication networks is NP-complete problem.
Integrating traffic engineering and distributed agent technologies, the paper proposes a novel electrical information flow transmitting algorithm-Distributed Agents QoS Routing Algorithm (DAQRA). The algorithm can explore fast forward path with multiagents and guarantee transmitting quality. Moreover, DAQRA can make the scarce resource in WSNs optimal used by smooth allocating different traffic, with which congestion can be efficiently avoided, and the capability of bidirectional communication is enhanced. In the following section, we will present this algorithm in detail and provide an evaluation of its effectiveness based on mathematical analysis and computing simulations.
The remainder of this paper is organized as follows. Section 2 presented the related work; Section 3 established the mathematical model for the routing in last mile access wireless sensor networks; Section 4 described DAQRA algorithm in detail and presented the algorithm's validity with accurate mathematical analysis; Section 5 described the computer simulation and analyzed the results; Section 6 presented the final conclusion.

Related Work
The chief assignment of wireless sensor network is measure and transmitting quantity of distributed data to users, which decides the difference between WSN and traditional networks. The end-to-end transmission, such as IP telephone service in 3G or 4G cellular mobile communication network, is rarely used in WSN; moreover, its star-shaped topological structures in an infrastructure network are greatly different from the self-original structure of sensor networks. Protocols using in ad hoc consider how to provide a trusted point-topoint interconnection in highly mobilized environment.
In WSNs, unicast and multicast (or reverse-multicast model), such as multiple data sources transmitting to single data recipient (Sink), are always appointed [9]. To achieve these requirements with energy efficiency, many protocols have been studied [10][11][12]. He et al. [13] proposed SPEED, a protocol which combines feedback control and nondeterministic QoS aware geographical forwarding. Felemban et al. [14] proposed the multipath and multispeed routing protocol (MMSPEED) to provide a probabilistic QoS guarantee in WSNs. The algorithm used different delivery speeds and probabilistic multipath forwarding in the reliability domain to transmit data with multiple QoS levels. Djenouri and Balasingham [15] proposed a traffic-differentiation modular routing protocols to consider localized QoS. It is well known that energy consumption is a prime concern in WSNs. Many studies on energy efficient routing have been proposed [10,16,17]. In [10] a multichannel protocol with energy efficient data gathering for wireless sensor networks was designed, EAR-DPS [16] found multiple paths from the source to destination nodes, based on residual energy probability for every neighboring node. Lim and Park proposed energy efficient chain formation (EECF) algorithm to resolve the long-distance data transmission problems [17]. These studies only considered the energy efficiency of routing and did not consider the need to ensure real-time, reliable packets delivery. Only a couple of studies considered a deadline or the reliability of a packet in wireless communication. Considering QoS delivery, Hsu et al. [18] designed a QoS-aware power management method for a kind of spherical energy harvesting sensor network. Mahapatra et al. [19] proposed an energy aware QoS routing protocol for real-time packets. The concept of providing real-time communication is very similar to SPEED and MMSPEED. However, to satisfy realtime transmission with energy efficiency, more overheads are used in the protocol. Some other scholars focus on QoS in forwarding routine data and unusual events in wireless sensor networks.
Different from the WSNs' traditional application, which always detects and perceives single physical metric, different kinds of electrical information have different QoS requirements. For example, to control multimicrogrids combined and divided, the voltage and power parameters should be reported in real time to dispatching center; the correct information files should be transmitted integrally. Different transmitting attributes of information flows among digital electronics secondary equipments are ubiquitous; thus fast forwarding WSNs protocol satisfied multi-QoS is necessary for the electric power communication application.

Self-Organized Network Architecture and System Mathematical Model
The architecture of wireless networks plays a crucial role in reliable access among intelligent electrical meters. For instance, to avoid service disruption, routing protocols must be robust to link failures. In most application scenes, covering a residential area may not terminate in a single access point but requires more than one data aggregation point (DAP) to improve the reliability. Figure 1 shows a network architecture that includes communication between home appliances and their home intelligent electrical meters as well as communication between meters and several AMI access points through DAPs. The difference of the novel architecture from traditional network architecture is that a meter represents a home gateway node. It can access to home appliances and has the communication ability to other DAPs located on neighborhood distribution poles. Flexible self-organized network theory and wireless communication technologies, such as PIEEE 802.11s and IEEE 802.15.4, supply the realization [20]. As shown in Figure 1, meters are represented as the distributed sensor nodes. DAPs are represented as Sinks. Thus, the novel network architecture is a kind of multiple sinks model. Sensor nodes forward packets containing their measurements or observations information towards any of Sinks. As the above all description, because sensor nodes have limited wireless range, multihop communications are generally required to forward the data to the multiple sinks.
Based on graph theory, sensor nodes can represent vertexes set = {V 1 , V 2 , . . . , V }; bidirectional wireless links are defined as edges set = { 1 , 2 , . . . , }. When an adjacent pair V , V shares the same wireless channel, (V , V ) ∈ indicates both vertexes , are within each other wireless transmitting ranges 0 and share the same wireless transmission link. We can rewrite the definition = To satisfy the electrical information's multi-QoS requirements, the WSNs' mathematic model is a connected and weighted simple graph = ( , , ), where = { V , } is the composite weight set, in which V is the set of each vertex's measurements and is the set of each edge's measurements. In each vertex, V = {Color , Delay } : Color is the data type generated by vertex , with which same type of date can be aggregated effectively; otherwise, data will only be transmitted overhead; V .Delay is the delay on the corresponding router (the sum of queuing delay, transmission delay, and propagation delay). In each edge = {EnBW , Metric + } : .EnBW is the maximum available bandwidth provided for applications; .Metric + is the transmission cost, which should be defined by electric power system.
Based on the mathematic model, control algorithms should be distributed to compute different kinds of singlesource shortest paths from dispatching center to each second equipment or sensor with multi-QoS requirements. Therefore, the attitude of information traffic in electrical power system should be analyzed, and classification model should be built.
Traffic is exchanged among the same class logical nodes. In the smart grid operation, the logical nodes information categories are presented with IEC 61850 as follows.
(1) Common logical node information: information independent of the dedicated function, for example, mode, health, and name plate; (2) Status information: information representing either the status of the process or of the function allocated 4 International Journal of Distributed Sensor Networks to the LN, for example, switch type, switch operating capability; (3) Settings: information needed for the function of a logical node, for example, first, second, and third reclose time; (4) Measured values: analogue data measured from the process or calculated in the functions like currents, voltages, power, and so forth, for example, total reactive power, frequency; (5) Controls information: data, which are changed by commands like switchgear state (ON/OFF), resettable counters, for example, position, block opening.
IEC 61850 also defines different kinds of interfaces among the equipments [21]. We specially consider the multiply QoS requirements from the various electrical information in WSNs operation. WSNs must offer characteristics of reliability, availability, and fault-tolerance abilities to collect measuring data, aggregate and transmit them. To achieve these requirements, DAQRA algorithm is designed for dynamic routing with distributed mobile agents, and the established routing path satisfied multi-QoS requirements.

Distributed Agents QoS Routing
Algorithm Description 4.1. DAQRA Algorithm Process. DAQRA uses distribute agent technique to achieve multi-QoS requirements. Each agent maps a class of flows from same source vertex, which has a unique united measurement, shown in Figure 2.
The figure shows compound measurements of traffic. Traffic should be transmitted from "Source" vertex to "Destination" one, satisfied with the multiply QoS requirements { .Color , .delay , .BW + }, where " .Color " is the traffic type; " .delay " is the maximum accepted end-toend delay; " .BW + " is the maximum required bandwidth. Before describing the basic steps of the algorithm, two operations are defined: (1)  Figure 2: Format of mobile agent.
(2) Accumulation Operation: accumulate link ( , ) weight ( , ) to the current delivery path's weight path , and get the delivery path's new weight path .Color = path .Color In the electric power communication network, each logical node real-time monitors its interface state and dynamic updates the set of each vertex's attribute measurements V and the edge's attribute measurements , which is connected with input-output air interfaces.
When any data generated from one logical node V 0 , the united QoS requirements { .Color , .delay , .BW + } are set and bound into a master mobile agent MA . Mobile agent then travels following its optimal direction, till it reaches any one of DAP. Mobile agent used the "Selectexcellence Operation" to decide its next optimal direction. When MA is boarding on logical node V , MA uses the "Accumulation Operation" to count V neighbors' weight, and then uses "Select-excellence Operation" to select the best node as the next forward point. If there are equivalent neighbors, MA will generate several slave agents and send to the different output ports to realize the parallel routing. Another case, if more than one agent with same QoS requirements reach one logical node at the same time, "Select-excellence Operation" will be used and reserve the best one to explore the forwarding path. The mobile agents' master-slave dividing and slave-slave competing patterns are shown as  delivery path. The really transmitting delay has been recorded in the metric of path .delay. Thus, any one agent is valid if only it arrived the destination no longer than × .delay ; here 1 ⩽ ⩽ 1.2. The final optimal routing will be selected among these valid agents by "Select-excellence Operation. "

Proposition 1. Distributed agents QoS routing algorithm can find the single-source shortest path in the bidirectional nonnegative weighted connected graph.
We used the reduction to absurdity to prove this proposition.
In the first issue, if there is more than one edge between vertexes and , master agent will divide into equal number of slave agents and travel those edges. When the agents reach node , the weights of each agent must be changed by "Accumulation Operation. " The following "Select-excellence Operation" will exactly select the best one and delete all the others. It means that is the minimum in all of the edges { ( , )}. It is a contradiction for + < . So the supposition one is in error.
In the second issue, if (∪ ∈ , ) = / (∪ + ∈ + , ), there are two fathers for vertex , supposed = father( ) ∈ and = father( ) ∈ + , . Because of + , < , , +( , ) path + = path + ( , ) must be shorter than ) . Then the algorithm cannot finish until the agent MA , crossing node , arrived. There is a contradiction for MA lost, because "Select-excellence Operation" did not select the best agent MA . So the supposition is in error, and the original proposition is true.

Feasibility for Smart Grid Communication.
DAQRA is a distributed algorithm to suit for smart grid communication. Each vertex only forwards mobile agent with neighbors in its own time sequence. But, in centralized algorithms, such as Dijkstra algorithm, each subprocess must wait for all of the painted vertexes counting its shortest distance.
Moreover, with distributed agents, DAQRA can maximally achieve multi-QoS requirements in the same time. And characters V .Color and .Color restrict the same type of electric information microflows being relayed in the same electrical second equipments, in which effective aggregation can be employed.

Simulation and Performance Evaluation
For simulation, we developed a residential networks consisting of 500 nodes in a community location. In this scenario each meter or sensor node is independent of any Sinks. A free space propagation channel model is assumed with the capacity set to 0.5 Mbps; Packet lengths are 1.5 Kbit for data packets, and 256 bits for routing overheads. The buffers for real-rime data and normal data have default size of 30 packets and the packets are generated at a constant rate of 3 packet/sec. The IEEE 802.11 MAC protocol is adopted to detect links' connectivity, in which the mechanism visiting wireless channel is Carrier Sense Multiple Access with Collision Avoidance (CSMA/CA).
The paper simulates DAQRA, AODV, and SPEED in same simulation scenes, and three performance metrics are utilized to evaluated the algorithms' performance. (1) Average end-to-end delay: it is one of primary metrics for realtime transmission, which includes all possible delays caused by buffering during route discovery latency, queuing at the interface queue, retransmission delays at the MAC, and the delivery path repaired times. been utilized or reserved in each link, which can be defined as Here, Δ( ) is the total wireless bandwidth, ( ) is the used bandwidth of wireless link , and ∑ is the bandwidth retained ratio for command control packets. Without loss of generality, we measured the algorithm during the traffic load increasing from 5% to 50%.

Average End-to-End Delay Analysis.
The average end-toend delay of data packets is one of important QoS factors for the electrical power system WSNs application, especially for real-time application. For example, great number of renewable generators' instantaneous voltage and power parameters should be reported in real time to dispatching center to keep the system's stability. Figure 5 presents such measurement for different algorithms under different traffic load. Because the two previous protocols used routing tables, with which the primal transmission has lower transmitting delay. We can find the 0.138 s delay with the SPEED in the 5% traffic load scenario. However, when traffic load has noticeable increase, SPEED and AODV need to repeatedly update their routing tables to explore alternative hops. Great quantity of routing update packets commingled with heavy traffic load makes the congestion and loss packets occur more often. As a result, the higher the percentage of traffic load is, the more frequent updates are required, and consequently, the longer time is consumed to build paths and transmit data. Comparing with DLS's 0.374 s in 50% failure nodes, SPEED worsened to 0.532 s, and AODV is 0.593 s. DAQRA causes more number of routing overheads among the three algorithms, mainly because distributed mobile agents are counted in the overhead. To explore the best performance delivery path, DAQRA uses the master-slave mobile agents dividing technology. In SPEED and AODV, each node has a routing table to record all nodes adjacent to the destination. Thus, if the current delivery path to DAPs turns faulty, the two algorithms have to reestablish a new path through its "route discovery" process (the rectification mechanisms in AODV). This process will consume much more routing overhead. As a result, for networks with heavy traffic load, up to 40%, AODV and SPEED consume more routing overhead than DAQRA. When the traffic load percentage reached 50%, DAQRA consumes less 9.43% and 21.07% routing overhead than AODV and SPEED, respectively. Therefore, our algorithm is more suitable for big traffic industrial system application.

Bandwidth Occupation Ratio Analysis.
As we know, one of wireless sensor networks inherent defects is the scarce wireless communication resource. Smooth allocating great quantity of traffic to the network and keeping load balance have important significance for WSNs. A health infrastructure with load balance can effectively avoid the potential congestion and have robust capability to bear abrupt strong traffic flows. Bandwidth occupation ratio is employed to evaluate the current traffic allocation, and the standard variance of bandwidth occupation ratio is defined to measure the Load Balance Factor (LBF); the calculation formula is shown as Here is the average bandwidth occupation ratio of all links. traffic load scenario, all of the three algorithms have a severely high LBF , such that, at 10% traffic load, LBF of DAQRA is 19.8, LBF of AODV is 21.8, and LBF of SPEED is 20.4. The reason is that the small quantity of traffic just used few links, and great gap among the used links and unused links make the high value of LBF . With the increasing of traffic load, this figure clearly shows that DAQRA drops the lowest number of standard variance value compared with the other two protocols. At 50% traffic load scenario, LBF of DAQRA is 7.3, but LBF of AODV is 15.1, and LBF of SPEED is 15.4. As was mentioned before, the reason is that, during DAQRA explore routing path, there is We.EnBWk in link's weight set, and both the "Accumulation Operation" and "Select-excellence Operation" exactly count the weight of the maximum available bandwidth. With these mechanisms, mobile agents select the low utilization ratio link for big traffic and make the load balance. On the contrary, AODV and SPEED are more likely to select the shortest path to transmit traffic, with which the central links will load more traffic, while other links bear few, even no, traffic. An unbalance load network is unhealthy. If continued big traffics are injected into the network, congestion will occur, and it will trigger the high probability of loss packet, which is never be allowed for the electrical information transmission.

Conclusion
Smart grid systems require real-time electrical power consumption information communication to keep the stability and controllability. It is necessary to design a network architecture that is capable of providing secure and reliable two-way communication among intelligent electrical meters, power supply system, and consumers. Internet of Things or wireless sensor networks can be employed to realize the reliable and flexible last mile communication.
Considering the electrical power application, different kinds of electrical parameter flows transmitted in smart grid, including switchgear's boolean controlling variable, feeder voltage/current analog signals, and incorrect information files have different QoS requirements. Achieving multiply kinds of flow requirements in one connected communication networks is NP-complete problem.
Integrating traffic engineering and distributed agent technologies, the paper proposes distributed agents QoS routing algorithm to transmit electrical information flow with multi-QoS constraints. The algorithm can explore fast forward path with multiagents and guarantee transmitting quality with smooth allocating different traffic. We also present the mathematical analysis to prove the algorithm's validity. Finally, in the computer simulation, the average end-to-end delay, routing overhead, and links' bandwidth occupation ratio are computed to evaluate the algorithm performance. Coincident results show that the new algorithm can provide short endto-end delivery path with optimal utilized communication resource.