Disclosure of Invention
In view of this, the present invention provides a multi-rf multi-channel tree routing method that is robust and can recover or switch to other paths for transmission as soon as possible when node failure and path failure occur.
Based on the above purpose, the method for establishing tree-shaped routing in a power distribution and utilization wireless ad hoc network provided by the invention comprises the following steps:
a first node in the signal coverage range of the gateway node updates a routing table, performs local broadcast and sends a routing request to a neighbor node;
after receiving the routing request, the neighbor node sends a routing response message to the first node;
after receiving the routing response message, the first node calculates a path consumption value reaching a gateway node through the neighbor node, selects a node with the lowest path consumption value as a father node, adds corresponding channel information into an application adding message packet, and sends the application adding message packet to the father node;
after receiving the application joining message packet, the father node modifies a routing table of the father node, allocates a selected channel carried in the application joining message packet for an idle interface, sends a receiving joining message packet to the first node, and simultaneously sends a notification upper layer joining message packet to an upper layer by taking the gateway node as a destination node;
after receiving the join message packet, the first node updates a routing table of the first node;
and other nodes in the signal coverage range of the gateway node establish routes according to the process, when any node receives the notification upper layer adding message packet, the respective route table is updated, if any node is not the gateway node, the notification upper layer adding message packet is continuously sent until the gateway node receives the notification upper layer adding message packet.
Further, the routing table includes two parts of information, namely a destination node and a next hop node.
Further, the method also comprises the following steps:
and after receiving the routing request, the neighbor node searches whether a route reaching the gateway exists in a routing table of the neighbor node, if so, the neighbor node sends a routing response message to the first node, and if not, the neighbor node does not perform any processing.
Further, the method also comprises the following steps:
and if all the neighbor nodes do not have the route reaching the gateway, the first node waits for a period and then sends the route request again.
Further, the algorithm of the path cost value includes:
calculating the interference probability of each channel used by the node J, wherein the node J is the first node, and finding out the used channel f of the node Jm1,2 and 3 hop neighbor set V of (m ═ 1,2,3 … …)J,mAssuming that each node sends data to all neighbors with equal probability, when i belongs to VJ,mAnd i is a 1-hop neighbor of J:
PJ,i,m=1
wherein P isJ,i,mIndicating the use of channel fmThe probability that the node i generates interference on the node J is determined;
when i ∈ VJ,mAnd when the distance between i and J is 2 hops, interference can be generated only when i sends data to the neighbor of J or when J sends data to the neighbor of i while i sends data to other nodes, and at the moment, the interference exists
Wherein Vt,m-khopIndicating that the distance node t is k hops and a radio frequency interface uses a channel fmA neighbor set of (2); i Vt,m-khopI represents the number of elements in the set, the left part of the plus sign in the formula represents the probability that i sends data to the neighbor of J, and the right part of the plus sign represents the probability that J sends data to the neighbor of i while sending data to other nodes;
when i ∈ VJ,mAnd J is 3 hops away from i, interference occurs if and only if the receivers of J and i to send data are neighbors, at which time
Calculating the using channel f of the node J according to the interference probabilitymDesired value n of interfering nodeJ,m
Node J uses channel fmExpected transmission time ETT for communicating with neighbor nodeJ,mIs composed of
Wherein
Which represents the number of expected transmissions to be made,p represents the link packet loss rate; s represents the length of the data packet, B
mRepresentative channel f
mThe bandwidth of (d);
routing cost Path _ ETT with each neighbor node as parent nodeJIs Path _ ETTJ=Path_ETTn+ETTJ,m
Wherein Path _ ETTnRepresents the route cost of node n to the gateway node.
Further, the method also comprises the following steps:
and inquiring the channel use information of the neighbor node n, judging whether the neighbor node n has an idle radio frequency interface, if so, selecting the corresponding channel from all channels, and if not, selecting the corresponding channel from the channel set used by the neighbor node.
Further, the establishing, by other nodes in the signal coverage of the gateway node, a route according to the above process includes:
and other nodes in the signal coverage range of the gateway node establish a route according to the process, firstly add the address of the source node and the information of the selected child node into a route table, and the child node selected by the source node as the next hop node is the destination node, if any node is not the gateway node, change the source address in the message into the local address, and continue to send a notification upper-layer addition message packet until the gateway node receives the notification upper-layer addition message packet.
Furthermore, when a node in the network performs route lookup, the node first looks up in the local routing table, and if the destination node is not found in the local routing table, the node directly forwards the data packet to the father node, and the father node forwards the data packet.
Further, the method also comprises the following steps:
after route calculation and channel selection, a newly added node reserves information of a backup reachable father node, then sends an application adding message packet to an optimal father node, and when the father node is invalid, the node can send the application adding message packet to the backup father node;
when a node in the network fails, a child node firstly judges whether a backup father node exists or not, and if so, a quick route recovery process is started; if not, immediately sending a fault message packet to the lower-layer child node, informing the invalid parent node list, and starting a fast route repair process by the child node.
From the above, the method for establishing the tree-shaped route in the power distribution and utilization wireless self-organizing network provided by the invention comprises the steps that the nodes in the signal coverage range of the gateway node update the route table, local broadcast is carried out, the route request is sent to the neighbor nodes, the neighbor nodes send route response messages after receiving the route request, after receiving the route response messages, the nodes calculate the path consumption value reaching the gateway node through the neighbor nodes, select the node with the lowest path consumption value as a father node, add the corresponding channel information into an application adding message packet, and send the application adding message packet to the father node; and after receiving the application adding message packet, the father node modifies a routing table of the father node, allocates a selected channel carried in the application adding message packet for an idle interface, and simultaneously sends a notification upper layer adding message packet to an upper layer by taking the gateway node as a destination node. The route established by the routing method of the invention has robustness, and can be recovered as soon as possible or switched to other paths for transmission when node failure and path failure occur.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to specific embodiments and the accompanying drawings.
The embodiment of the invention provides a method for establishing tree-shaped routing in a power distribution and utilization wireless self-organizing network, which comprises the following steps:
a first node in the signal coverage range of the gateway node updates a routing table, performs local broadcast and sends a routing request to a neighbor node;
after receiving the routing request, the neighbor node sends a routing response message to the first node;
after receiving the routing response message, the first node calculates a path consumption value reaching a gateway node through the neighbor node, selects a node with the lowest path consumption value as a father node, adds corresponding channel information into an application adding message packet, and sends the application adding message packet to the father node;
after receiving the application joining message packet, the father node modifies a routing table of the father node, allocates a selected channel carried in the application joining message packet for an idle interface, sends a receiving joining message packet to the first node, and simultaneously sends a notification upper layer joining message packet to an upper layer by taking the gateway node as a destination node;
after receiving the join message packet, the first node updates a routing table of the first node;
and other nodes in the signal coverage range of the gateway node establish routes according to the process, when any node receives the notification upper layer adding message packet, the respective route table is updated, if any node is not the gateway node, the notification upper layer adding message packet is continuously sent until the gateway node receives the notification upper layer adding message packet.
The method for establishing the tree-shaped route in the power distribution and utilization wireless self-organizing network provided by the embodiment of the invention considers key factors such as link interference, network throughput and the like, the routing protocol has robustness, the routing protocol can select a path with optimal transmission quality, and when node failure and path failure occur, the routing protocol can be recovered or switched to other paths for transmission as soon as possible.
In the above embodiment, the routing table includes two pieces of information, namely, the destination node and the next hop node.
Further, the method also comprises the following steps: and after receiving the routing request, the neighbor node searches whether a route reaching the gateway exists in a routing table of the neighbor node, if so, the neighbor node sends a routing response message to the first node, and if not, the neighbor node does not perform any processing.
As an embodiment of the present invention, the method further includes:
and if all the neighbor nodes do not have the route reaching the gateway, the first node waits for a period and then sends the route request again.
In the above embodiment of the present invention, the algorithm of the path cost value includes:
calculating the interference probability of each channel used by the node J, wherein the node J is the first node, and finding out the used channel f of the node Jm1,2 and 3 hop neighbor set V of (m ═ 1,2,3 … …)J,mAssuming that each node sends data to all neighbors with equal probability, when i belongs to VJ,mAnd i is a 1-hop neighbor of J:
PJ,i,m=1
wherein P isJ,i,mIndicating the use of channel fmThe probability that the node i generates interference on the node J is determined;
when i ∈ VJ,mAnd when the distance between i and J is 2 hops, interference can be generated only when i sends data to the neighbor of J or when J sends data to the neighbor of i while i sends data to other nodes, and at the moment, the interference exists
Wherein Vt,m-khopIndicating that the distance node t is k hops and a radio frequency interface uses a channel fmA neighbor set of (2); i Vt,m-khopI represents the number of elements in the set, the left part of the plus sign in the formula represents the probability that i sends data to the neighbor of J, and the right part of the plus sign represents the probability that J sends data to the neighbor of i while sending data to other nodes;
when i ∈ VJ,mAnd J is 3 hops away from i, interference occurs if and only if the receivers of J and i to send data are neighbors, at which time
Calculating the using channel f of the node J according to the interference probabilitymDesired value n of interfering nodeJ,m
Node J uses channel fmExpected transmission time ETT for communicating with neighbor nodeJ,mIs composed of
Wherein
Representing the expected transmission times, and p representing the link packet loss rate; s represents the length of the data packet, B
mRepresentative channel f
mThe bandwidth of (d);
routing cost Path _ ETT with each neighbor node as parent nodeJIs Path _ ETTJ=Path_ETTn+ETTJ,m
Wherein Path _ ETTnRepresents the route cost of node n to the gateway node. It should be noted that the J node is any point within the range of the gateway node, and here, it is only illustrated that one node is used as an example to show how the routing is established between the nodes.
In some embodiments of the invention, further comprising:
and inquiring the channel use information of the neighbor node n, judging whether the neighbor node n has an idle radio frequency interface, if so, selecting the corresponding channel from all channels, and if not, selecting the corresponding channel from the channel set used by the neighbor node.
In some other embodiments of the present invention, the establishing, by other nodes in the signal coverage of the gateway node, a route according to the above process includes:
and other nodes in the signal coverage range of the gateway node establish a route according to the process, firstly add the address of the source node and the information of the selected child node into a route table, and the child node selected by the source node as the next hop node is the destination node, if any node is not the gateway node, change the source address in the message into the local address, and continue to send a notification upper-layer addition message packet until the gateway node receives the notification upper-layer addition message packet.
When the nodes in the network search the route, firstly searching in the local routing table, if the local routing table has no target node found, the nodes directly transmit the data packet to the father node, and the father node transmits the data packet.
In addition, the method further comprises the following steps: after route calculation and channel selection, a newly added node reserves information of a backup reachable father node, then sends an application adding message packet to an optimal father node, and when the father node is invalid, the node can send the application adding message packet to the backup father node;
when a node in the network fails, a child node firstly judges whether a backup father node exists or not, and if so, a quick route recovery process is started; if not, immediately sending a fault message packet to the lower-layer child node, informing the invalid parent node list, and starting a fast route repair process by the child node.
Fig. 1 is a flowchart illustrating an embodiment of a method for establishing a tree route in a wireless ad hoc network. In the process of implementing the technical solution of this embodiment, a message packet in 6 is defined as the following table:
Request
|
routing request message packet
|
|
Respond
|
Route reply message packet
|
Involving the cost of routing from the local node to the gateway node
|
Join
|
Application joining message package
|
Including selected channel information
|
Accept
|
Receiving join message packets
|
Including gateway node information and channel information accessible by itself
|
Up-Add
|
Notification upper layer to add message packet
|
Containing information of selected child nodes
|
FAILUR
|
Failure message packet
|
Including a list of failed parents |
On the basis of the above defined message packet, the technical solution of this embodiment includes:
step 101: and the node S carries out local broadcast according to the period T and sends a routing Request message Request to the neighbor node.
Step 102: and the neighbor node of the node S receives the routing Request message Request sent by the node S.
Step 103: the neighbor nodes of the node S judge whether the respective routing tables have routes reaching the gateway node, and if not, no processing is carried out; if yes, go to step 104.
Step 104: the neighbor node of the node S that receives the Request message Request sends a response message reply to the node S.
Step 105: and judging whether the node S receives a response message sent by the neighbor node, if not, returning to the step 101, and if so, entering the step 106.
Step 106: after receiving the reply message sent by the neighbor node, the node J calculates the Path cost value Path _ ETT of the Path passing through the node J and reaching the gateway nodeJSelecting the node with the lowest consumption (such as the node B) as a father node, adding the corresponding channel information into the Join message packet, and sending a Join request Join to the node B.
Step 107: the node B receives the Join message.
Step 108: and the node B modifies the routing table, adds a node J as a child node, wherein the node J is a destination node and a next hop node, and allocates a selected channel carried in Join for an idle interface.
Step 109: and the node B sends an Accept message to the node J, and sends an Up-Add message to an upper layer by taking the gateway node as a destination node.
Step 110: and the node J receives the Accept message.
Step 111: and the node J adds the address of the node B and the address of the gateway node into the routing table, wherein the node B is a next hop node, and the gateway node is a destination node.
Step 112: the upper node X receives the Up-Add message.
Step 113: and the upper node X adds the source node address and the selected child node information into the routing table, and the source node selects the child node as the destination node for the next hop node.
Step 114: the upper node X determines whether the local node is a gateway node, if so, step 115 is performed, otherwise, step 116 is performed.
Step 115: the node S completes the route establishment.
Step 116: and the upper layer node X changes the source address in the message into a local address, and continuously sends the Up-Add message to the gateway node until the gateway node receives the Up-Add message.
Thus, the routing establishment of the node J is realized, other nodes simultaneously carry out the operation of the steps, periodically send routing requests until receiving neighbor responses which can reach the gateway node, establish the routing and update the routing table; this process continues until all nodes in the network have found a suitable parent node, establishing a route to the gateway node.
When a node in the network searches for a route, the node firstly searches in a local routing table, and if the local routing table does not have the found destination node, the node directly forwards the data packet to a father node, and the father node forwards the data packet.
The method for establishing the tree-shaped route in the power distribution and utilization wireless self-organizing network provided by the embodiment of the invention considers key factors such as link interference, network throughput and the like, the routing protocol has robustness, the routing protocol can select a path with optimal transmission quality, and when node failure and path failure occur, the routing protocol can be recovered or switched to other paths for transmission as soon as possible.
As shown in fig. 2, a flow chart of a method for calculating a path cost value for reaching a gateway node is shown. The method comprises the following steps:
step 201: calculating the interference probability of each channel used by the node S;
step 202: and calculating the expected value of the interference node when the node S uses each channel.
Step 203: expected transmission times for the nodes to communicate with the neighboring nodes using the respective channels are calculated.
Step 204: and calculating the route consumption taking each neighbor node as a parent node.
Specifically, the calculation method of the path consumption value is as follows:
firstly, the interference probability of each channel used by the node J is calculated, and the used channel f of the node J is foundm1,2 and 3 hop neighbor set V of (m ═ 1,2,3 … …)J,m. Assuming that each node sends data to all neighbors with equal probability, when i belongs to VJ,mAnd i is a 1-hop neighbor of J:
PJ,i,m=1
wherein P isJ,i,mIndicating the use of channel fmThe probability of node i causing interference to node J.
When i ∈ VJ,mAnd when the distance between i and J is 2 hops, interference can be generated only when i sends data to the neighbor of J or when J sends data to the neighbor of i while i sends data to other nodes, and at the moment, the interference exists
Wherein Vt,m-khopIndicating that the distance node t is k hops and a radio frequency interface uses a channel fmA neighbor set of (2); i Vt,m-khopAnd | represents the number of elements in the set. The left part of the plus sign represents the probability that i sends data to the neighbor of J, and the right part of the plus sign represents the probability that J will send data to the neighbor of i while i sends data to other nodes.
When i ∈ VJ,mAnd J is 3 hops away from i, interference occurs if and only if the receivers of J and i to send data are neighbors, at which time
According to the interference model, nodes more than 4 hops away do not generate interference.
Then, the channel f used by the node J is calculated according to the interference probabilitymDesired value n of interfering nodeJ,m
Node J uses channel fmExpected transmission time ETT for communicating with neighbor nodeJ,mIs composed of
Wherein
Representing the expected transmission times, and p representing the link packet loss rate; s represents the length of the data packet, B
mRepresentative channel f
mThe bandwidth of (c).
In summary, the routing using each neighbor node as the parent node consumes Path _ ETTJIs Path _ ETTJ=Path_ETTn+ETTJ,m
Wherein Path _ ETTnThe route cost on behalf of node n to the gateway node is available from the response message packet.
Minimum route cost min { Path _ ETT }J}。
As shown in fig. 3, a schematic diagram of a route recovery process in a tree route established by the method of the present invention is shown. The method comprises the following steps:
and when the node is invalid, judging whether the invalid child node has a backup parent node, if so, entering a step 301, otherwise, entering a step 302.
Step 301: a fast route restoration procedure is initiated.
Step 302: and sending a FAILURE message to the lower-layer child node, informing the lower-layer child node of the failed father node list, and further judging whether the lower-layer child node has a backup father node.
In the route discovery phase, after route calculation and channel selection, a newly added node reserves information of a backup reachable father node, then sends Join information to an optimal father node, and when the father node is invalid, the node can send the Join information to the backup father node. When a node in the network fails, a child node firstly judges whether a backup father node exists or not, and if so, a quick route recovery process is started; if not, immediately sending a FAILURE message to the lower-layer child node, informing the failed parent node list (including the child node), and starting a fast route repair process by the child node (if the child node also has no backup parent node, adding the child node into the failed parent node list, and recursively sending the FAILURE message to the child node).
Fig. 4 is a schematic diagram of route repair. When the node A fails, the node A sends a FAILURE message to a lower node B because the node A does not have a backup father node, the node B sends the FAILURE message to lower nodes C and D because the lower node B also does not have the backup father node, the lower node D restores the route through the backup father node F because the lower node D has the backup father node F, and meanwhile, the node D is the backup father node of the node B and the node C, and the node B and the node C restore the route through the backup father node D.
It should be noted that all expressions using "first" and "second" in the embodiments of the present invention are used for distinguishing two entities with the same name but different names or different parameters, and it should be noted that "first" and "second" are merely for convenience of description and should not be construed as limitations of the embodiments of the present invention, and they are not described in any more detail in the following embodiments.
Those of ordinary skill in the art will understand that: the discussion of any embodiment above is meant to be exemplary only, and is not intended to intimate that the scope of the disclosure, including the claims, is limited to these examples; within the idea of the invention, also features in the above embodiments or in different embodiments may be combined, steps may be implemented in any order, and there are many other variations of the different aspects of the invention as described above, which are not provided in detail for the sake of brevity.
In addition, well known power/ground connections to Integrated Circuit (IC) chips and other components may or may not be shown within the provided figures for simplicity of illustration and discussion, and so as not to obscure the invention. Furthermore, devices may be shown in block diagram form in order to avoid obscuring the invention, and also in view of the fact that specifics with respect to implementation of such block diagram devices are highly dependent upon the platform within which the present invention is to be implemented (i.e., specifics should be well within purview of one skilled in the art). Where specific details (e.g., circuits) are set forth in order to describe example embodiments of the invention, it should be apparent to one skilled in the art that the invention can be practiced without, or with variation of, these specific details. Accordingly, the description is to be regarded as illustrative instead of restrictive.
While the present invention has been described in conjunction with specific embodiments thereof, many alternatives, modifications, and variations of these embodiments will be apparent to those of ordinary skill in the art in light of the foregoing description. For example, other memory architectures (e.g., dynamic ram (dram)) may use the discussed embodiments.
The embodiments of the invention are intended to embrace all such alternatives, modifications and variances that fall within the broad scope of the appended claims. Therefore, any omissions, modifications, substitutions, improvements and the like that may be made without departing from the spirit and principles of the invention are intended to be included within the scope of the invention.