An Automatic Networking and Routing Algorithm for Mesh Network in PLC System

Power line communication (PLC) is considered to be one of the best communication technologies in smart grid. However, the topology of low voltage distribution network is complex, meanwhile power line channel has characteristics of time varying and attenuation, which lead to the unreliability of power line communication. In this paper, an automatic networking and routing algorithm is introduced which can be adapted to the "blind state" topology. The results of simulation and test show that the scheme is feasible, the routing overhead is small, and the load balance performance is good, which can achieve the establishment and maintenance of network quickly and effectively. The scheme is of great significance to improve the reliability of PLC.


Contribution rate of links to network reliability.
According to two-state Markov probability theory model [11], factorization method is used to analyze the influence of links on the reliability of the network. We theoretically analyze the full-end reliability of the network mentioned above. The theory calculation formula is shown as (1).
(1) Where G is the topology of network; P g is the probability that any two nodes in the network G can communicate with each other by link e, that is, the probability of channel in good state; R ALL (G, P g ) is the full-end reliability of network G, that is, the probability of reliable communication between any two nodes in the network; Ge is the topology of a new network obtained by combining two nodes connected by link e in the network G; G-e is the new network topology obtained by deleting link e. The full-end reliability of network is determined by the number of nodes and links in the network. To ensure the rationality of the reliability analysis results of different networks, the number of nodes in this paper is 32, and the above four network topologies are analysed respectively.
Simulation results are shown in Fig.3, we can clearly see that in the same link working state, the full-end reliability of Mesh network topology is much higher than other topologies. From node and link to the network reliability contribution rate aspect, Mesh network topology has obvious superiority in reliability aspect.

Master node selection algorithm
In order to facilitate the management and maintenance of the network, a node is selected as the master node to manage and maintain the reliable operation of the network. For a newly powered on node, it is necessary to know whether there is a communication network in the area, and whether all the nodes in the area are powered on at the same time, and whether it can become the master node of the area. In the process of master node selection, node state transition is shown as Fig.4.
 After powered on, node keeps silent for a period of time. During the silence period, it can only listen to the channel but can't send any frames. The length of the silence period is determined by beacon period, at which time the node state is INIT.  In the silence period, if there is a communication listened by the node, that indicates a network exists. The node should exit the master node selection process, and wait for the reception of the beacon frame and register to join the network. The node state switches to UC_STA  In the silence period, if there is no communication listened by the node, the node sends master node beacon frame and switches to UC_CCO.  For a node in UC_CCO state, if there are other nodes registering to join the network in a certain period of time, the node becomes the master node and the node state switches to C_CCO. The nodes joining the network switch to C_STA and begin networking process. The MAC address of the selected master node is used as the network identifier (NID).  For the node in UC_CCO state, if no node registers to join its network for a certain period of time, it will exit the master node selection process, and the state will be switched to INIT.  For the node in C_STA state, if there is no networking beacon frame received from local network within a certain period of time, the state will be switched to UC_STA. After the completion of network constructing, there is only one master node in PLC network. But for PLC network, nodes are not concentrated, that means the physical distribution between the nodes are scattered, the distance is relatively far, or some channel status is not good. There are two or more master nodes in the networking process. How to make multiple master nodes converge to one master node becomes the key point, that is, network convergence. Whenever a node receives a beacon frame with a higher priority (smaller NID), the state switches to UC_STA and re-registers to the network.

Networking algorithm
Network constructing is the process that all nodes switch to C_STA state under master node's control. The flowchart of new node joining an existing network is shown in Fig.5. The formats of frames during the networking process are shown from Table I to Table IV respectively. TEI represents the logical address of node allocated by master node. Ability represents the role that node plays in the network, including master node, proxy node and terminal node.

Simulation results
We select OMNeT++ as the platform of simulation, to verify the networking algorithm. The simulation parameters are shown in Table V.  Master node selection time indicates the time when node in C_CCO state appears in the network, and the network construction time indicates the time when all nodes join the network. At the moment, there is only one master node in the network, and all nodes in this network are in C_CCO or C_STA state. As shown in the Fig.7, master node selection and network construction time are related to the physical topology.

Distributed and symmetric multipath routing algorithm
Conventional centralized management routing algorithm abandons the communication link redundancy, communication link has been cut, limiting the flexibility and reliability of data transmission. In addition, the existing routing algorithms are based on the premise that communication link is symmetric, without considering the problem of single-pass channel. This paper proposes a routing arbitration mechanism, which allows nodes to identify the communication link status and select the best communication link.

Routing table design
Routing table is established during the process that nodes join the network. The routing table needs to be updated and maintained when local nodes rejoin the network or neighbor node's state changes. The size of routing table is (n-1)*14 bytes, n represents the maximum number of nodes . The routing table  format is shown as Table VI. ODTEI represents TEI of original destination node. Next_hop [6] restore the TEI of next hop to destination node, 6 routes at most. The routes restored in Next_hop [6] are classified by priority. In the process of communication, node selects the highest priority route. Only when this route fails or doesn't exist, node selects next route.

Routing arbitration mechanism
To avoid communication failure caused by single-pass channel problem, in this paper, we propose routing arbitration mechanism based on beacon frame and neighbour node B is disconnected. Node A adds the link status to neighbour table. After two beacon periods, link from each node to its neighbour nodes can be known.

Route learning mechanism
Route learning mechanism is designed for establishing and maintaining routing table during communication process. Each node in the network start route learning when receives frame from other nodes. Route learning mechanism includes following situations:  In the process of joining network, when a new node creates association request frame, set ODTEI and Next_hop to the TEI of proxy node.  When master node receives association request frame of a certain node, it judges whether the proxy in the request frame is CCO.

Figure 8. Route learning in the process of association
It can be found that the routing table is established by the route learning mechanism, mainly in the process of node association, beacon transmission, frame transfer, and neighbour table establishment and maintenance. Fig.8 shows route learning in the process of node joining network, and route learning of other process is similar.
In ideal conditions, local nodes restore at least one route to all the other nodes in the network to satisfy communication need. The first time that nodes belong to different clusters communicate with each other, there is no routing information restored in routing table. But there is routing information to master node restored in routing table, so the source node transmit data packet to master node.

Route selection mechanism
In a Mesh network, there are multiple communication links between two nodes. We can select symmetric links by routing arbitration mechanism. In order to improve communication efficiency, routes learned by route learning mechanism are prioritized, and the routes of higher priority are selected in the communication process.

Performance analysis
As the size of the network increases, the size of routing table also increases. In address routing algorithm [12], each node in the network stores a routing table with a size of n bytes. In conventional centralized transmission matrix routing algorithm, master node stores routing table of all nodes, with a size of n 2 bytes. In the distributed multi-path symmetric routing algorithm, the routing table information is evenly distributed by each node, and the size is 15n bytes. The routing table overhead of three routing algorithms is shown in Fig.9, we can see that with the increase of n, the routing table overhead of centralized transmission matrix routing algorithm is much larger than that of distributed routing algorithm. The routing table in the distributed routing algorithm is managed and maintained by all nodes in the network. On one hand, it can avoid the shortcomings of centralized management flexibility and scalability. On the other hand, the routing overhead is greatly reduced and the hardware storage requirements are reduced.
Network load balance performance mainly refers to the degree of transmission congestion when data traffic increases in the channel. Good load balance performance refers to the number of proxy nodes in the network is large, and they can evenly share data traffic in the network. So as to avoid a large number of data concentrated in one or several proxy nodes, thus to some extent alleviate the transmission delay, packet collision and packet congestion.
We select Matlab as the platform of simulation. In 100m*100m area, we set the maximum communication distance as 20m, and simulate four kinds of logical topologies mentioned in sector one. The simulation results are shown in Fig.10.  According to four logical topologies shown in Fig.10, times of each node as proxy node in the network is counted and the number of proxy nodes is counted too. Finally the standard deviation is calculated. The smaller the standard deviation is, the better the load balance is. As can be seen from Fig.11, Mesh network topology load balance performance is the best.

Conclusion
Based on the background of industrial field equipment monitoring system, this paper proposes a complete automatic networking algorithm based on beacon frame to improve the reliability of power line communication.
Firstly, the physical topology and logical topology of low voltage DC power line network are compared. From node invulnerability and link invulnerability points, we verify the superiority of Mesh network topology and confirm the necessity of automatic networking and distributed routing.
Secondly, automatic networking algorithm based on beacon frame is designed. Node automatically joins the network after powered on, and maintains the integrity of network automatically under the coordination of master node. The simulation results show that the networking process can be completed in 30 seconds for the topology with 32 nodes.
Finally, a distributed multipath symmetric routing algorithm is designed to guarantee the validity of the algorithm through routing arbitration mechanism, route learning mechanism and route selection mechanism. At the same time, the algorithm proposed in this paper is compared with conventional routing algorithms from routing table overhead and load balance aspects. Simulation results show that routing table overhead of the proposed routing algorithm is small, load balance performance is good.