Zigbee mesh topology method for routing
Technical field
The present invention relates to a kind of zigbee mesh topology method for routing, belong to wireless communication technology field.
Background technology
Zigbee mesh topology route technology scheme up-to-date at present can holding each section of link in all optional paths
Pin is added, and to obtain the expense summation in whole path, and selects the minimum path of expense to be communicated.Due to these technical limit spacing
Be expense in whole piece path summation, therefore cannot obtain worst link, and the impact of worst link pair communication quality
Maximum, so path selected by these technology non-optimal.In addition, selecting not considering on path during path in current scheme
Actual loading, so part path congestion can be led to.
The route selection method of prior art is all to select optimal path, therefore prior art according to link overhead summation
There is the minima being unable to acquisition approach link performance figure.And the factor of whole piece path transmission quality is decided by road
One section of footpath link performance figure minimum, therefore using the not optimal path of the path selected by prior art.
Content of the invention
The purpose of the present invention is to overcome the shortcomings of that prior art exists, and provides a kind of zigbee mesh topology method for routing,
Effectively solving distributes the problem of offered load.
The purpose of the present invention is achieved through the following technical solutions:
Zigbee mesh topology method for routing, comprises the following steps:
1) source node sends rreq packet using flooding its adjacent node of normal direction;
2) intermediate node forwards the rreq packet receiving for the first time, and starts routing failure intervalometer, and routing failure is fixed
When device time-out before set up reverse path for all identical rreq that receives;
3), after destination node receives rreq packet, reply rrep and start multipath route intervalometer, multipath route timing
The rreq that before device time-out, reduction into possession receives, and set up reverse route;
4), after intermediate node receives rrep, stop routing failure intervalometer and start multipath route intervalometer, update in rrep
Rlqi value, and forward;
5), after source node receives the rrep of destination node, if routing failure intervalometer has not timed out, log-on data etc. is undetermined
When device, continue to rrep;After this timer expiry, select the link establishment forward route of maximum weight, and send data;
6) if intermediate node receives data before multipath route timer expiry, update route, otherwise delete all phases
Close route table items.
Further, above-mentioned zigbee mesh topology method for routing, step is:
1) source node sends data to destination node, if not reaching the route of destination node in routing table, using flood
Its adjacent node of general normal direction sends rreq packet;After having sent packet, start a routing failure intervalometer at once, if
After timer expiry, source node does not receive rrep then it is assumed that this routing failure;
2) receiving the node of rreq, first checking whether rreq is intended for oneself, if it is not, then forwarding this rreq;When turn
After distributing request data package, start a routing failure intervalometer at once, if this node does not receive after this timer expiry
Rrep, then it is assumed that this node can not reach destination node, removes all information of this route, if receive stopping this timing
Device;Before intervalometer has not timed out and also does not receive rrep, all of rreq that nodes records receive, and set up one for it
Reverse path, but only forward rreq when receiving first rreq, receive below only sets up reverse path, no longer forwards
rreq;
3) after destination node receives rreq, at once to one rrep of this node reverts back and set up reverse route, then
Start a multipath and route intervalometer, in this intervalometer timing, destination node continues to rreq, replys rrep and builds
Found corresponding reverse path;After when the timer times out, if destination node does not also receive data, that is, think routing failure, if
Receive data, that is, stop this intervalometer;
4) after intermediate node receives rrep, if routing failure intervalometer have timed, out then it is assumed that this node wait when
Between long, rrep is not responded;If routing failure intervalometer does not stop, stopping this intervalometer and start a multipath
Route intervalometer, continues to rrep in this intervalometer timing;Often receive a rrep, the thing in this path of detection
Reason layer link-quality index plqi (i) (i=1,2,3 ...), and by rrep rlqi (i) value and this plqi (i) carry out
Contrast, if this plqi (i) value be less than rrep in rlqi (i), by rrep rlqi (i) be changed to plqi (i), if
plqi(i) value be more than or equal to rlqi (i), then do not change rlqi (i), then forward this rrep, by following public affairs after having forwarded
Formula calculates the weights of this rrep
Formula is 1.
Wherein,rlqiIt is updated lqi value,nIt is a configurable multiple, for ensureing weightswPermanent is just
Number,deltatimeBe the half to the time difference receiving rrep after sending rreq, i.e. the time difference of an one way;
5) after destination node receives rrep, if routing failure intervalometer has timed, out, this routing failure;If
No time-out, first stops routing failure intervalometer, then starts a data waiting timer, often receives a rrep and passes through formula
1. calculatew(i), and set up forward route;After data latency timer expiry, select onew(i) maximum path is as number
According to transmitting path, send data, other routing informations are then all removed;
6) if intermediate node did not received data then it is assumed that this node is not optimum before multipath route timer expiry
Node, has been abandoned;If receiving data before timer expiry, stopping multipath route intervalometer, and usingw(i)
Maximum path sends data, and other routing informations are all removed;Thereafter node is all processed by this, until data reaches
Destination node;And data below is transmitted according to the path of the first bag data.
Further, above-mentioned zigbee mesh topology method for routing, step 1), contain actively in rreq packet
Location, destination address information.
Further, above-mentioned zigbee mesh topology method for routing, step 3), there have in the rrep replying to be individual special
Value is routing link performance figure, and initial value is 0xff, and often through a node, this value has corresponding renewal to rrep.
Yet further, above-mentioned zigbee mesh topology method for routing, step 4), 1. Part I is lqi value to formula
Calculate, Part II is time-delay calculation.
The substantive distinguishing features that technical solution of the present invention projects and significantly progress are mainly reflected in:
Technical solution of the present invention, can be permissible with the minima of acquisition approach link quality compared with prior art
Obtain the best path of link total quality, can dynamically balance the load of multipath route simultaneously, overcome traditional routing side
Method effectively can not distribute offered load, causes the technical problems such as subnetwork congestion.By the assessment to chain-circuit time delay, solve
Prior art can not effectively distribute the problem of offered load.
Brief description
Below in conjunction with the accompanying drawings technical solution of the present invention is described further:
Fig. 1: zigbee netted (mesh) network diagram;
The mesh topology schematic diagram of Fig. 2: test zmr-lqsr Routing Protocol;
Fig. 3: rreq sent after topological schematic diagram;
Fig. 4: rrep replied after topological schematic diagram.
Specific embodiment
Zigbee mesh topology method for routing of the present invention, source node sends rreq data using flooding its adjacent node of normal direction
Bag;Intermediate node forwards the rreq packet receiving for the first time, and starts routing failure intervalometer, routing failure timer expiry
The front all identical rreq for receiving sets up reverse path;After destination node receives rreq packet, reply rrep and start many
Footpath route intervalometer, the rreq that before multipath route timer expiry, reduction into possession receives, and sets up reverse route;Middle node is checked and accepted
To after rrep, stop routing failure intervalometer and start multipath route intervalometer, update the rlqi value in rrep, and forward;Source is saved
After point receives the rrep of destination node, if routing failure intervalometer has not timed out, log-on data waiting timer, continue to
rrep;After this timer expiry, select the link establishment forward route of maximum weight, and send data;If intermediate node exists
Receive data before multipath route timer expiry, then update route, otherwise delete all correlation route table items.
As shown in figure 1, zigbee network equipment comprises coordinator 3, router 2 and terminal unit 1, coordinator 3 and route
With intercommunication, and can not be able to communicate between terminal unit 1 between device 2, terminal unit 1 can only be by the coordinator being attached thereto
3 or router 2 could be communicated with other equipment.Zigbee mesh topology method for routing of the present invention is used for coordinator 3 and road
By the route establishment process between device 2.Concretely comprise the following steps:
1) source node will send data to destination node, if not reaching the route of destination node in routing table, utilizes
The adjacent node of flooding normal direction oneself sends rreq(route request) packet;Source address, purpose is contained in this packet
The information such as address;After having sent packet, start routing failure (routing failure) intervalometer at once, if should
After timer expiry, source node does not receive rrep(route reply) then it is assumed that this routing failure;
2) receive the node of rreq, first check whether this rreq is intended for oneself, if it is not, then forwarding this rreq;
After having forwarded request data package, start routing failure (routing failure) intervalometer at once, surpass in this intervalometer
If Shi Houben node does not receive rrep then it is assumed that this node can not reach destination node, remove all information of this route,
Stop this intervalometer if receiving;Before intervalometer has not timed out and also confiscates rrep, node can record the institute receiving
Some rreq, and set up a reverse path for it, but only forward rreq when receiving first rreq, receive below only builds
Vertical reverse path, no longer forwards rreq;
3) after destination node receives rreq, at once to one rrep of this node reverts back and set up reverse route, then
Start a multipath and route (multiple routing) intervalometer, in this intervalometer timing, destination node continues to connect
Receive rreq, reply rrep and set up corresponding reverse path;After when the timer times out, if destination node also confiscates data,
Being considered as routing failure, if receiving data, just stopping this intervalometer;There is individual particular value route chain in the rrep replying
Road performance figure (route link quality index, rlqi), initial value is 0xff;Rrep, should often through a node
Value all can have corresponding renewal;
4) after intermediate node receives rrep, if routing failure (routing failure) intervalometer has timed, out,
Think that this Node latency is long, rrep is not responded;If routing failure intervalometer does not stop, stopping this timing
Device simultaneously starts multipath route (multiple routing) intervalometer, continues in this intervalometer timing
rrep;Often receive a rrep, this path of detection physical layer link performance figure plqi (i) (i=1,2,3 ...), and
By in rrep rlqi (i) value and this plqi (i) contrasted, if this plqi (i) value be less than rrep in
rlqi(i), just by rrep rlqi (i) be changed to plqi (i), if plqi (i) value be more than or equal to rlqi (i), then do not change
rlqi(i), then forward this rrep;Calculate the weights of this rrep by equation below after having forwarded
Formula is 1.
WhereinrlqiIt is updated lqi value,nIt is a configurable multiple, for ensureing weightswPermanent is just
Number,deltatimeBe the half to the time difference receiving rrep after sending rreq, i.e. the time difference of an one way;Public
1. formula is divided into two parts to understand, Part I calculates for lqi value, and Part II is time-delay calculation;
5) after destination node receives rrep, if routing failure (routing failure) intervalometer has timed, out,
This routing failure;If not having time-out, first stopping routing failure intervalometer, then starting a data latency (data
Waiting) intervalometer, often receives a rrep just 1. to calculate by formulaw(i), and set up forward route;Work as data latency
After timer expiry, select onew(i) maximum path, as data is activation path, sends data, other routing informations are then complete
Portion removes;
6) if intermediate node did not received data then it is assumed that this node is not optimum before multipath route timer expiry
Node, has been abandoned;If receiving data before timer expiry, stopping multipath route intervalometer, and usingw(i)
Maximum path sends data, and other routing informations are all removed;Thereafter node is all processed according to this method, until number
According to arrival destination node;And data below is just transmitted according to the path of the first bag data.
As Fig. 2 topology, in figure source node is p, and destination node is q.Numerical value between each two node is the chain of this link
Value after 0xff normalization for the road performance figure (rlqi), the numerical value in bracket after each node is the time delay of this node, single
Position is ms.Node p initiates route finding process, uses flooding approach to send rreq to surroundings nodes, eventually arrives at node q.
Topology after having sent as Fig. 3 rreq, is routing iinformation in figure bracket, expression source node above, below
Represent next-hop node, have just being separated with slash of multiple information.After node q receives rreq, start to reply rrep.Rrep is complete
Portion reply terminate after, and weight computing complete after topological diagram as shown in Figure 4.
It is illustrated in figure 4 the topology after rrep has replied, each nodes records of in figure are forward route and this road
The weights in footpath.If certain node has multiple paths, record successively according to the order that rrep reaches.You Santiao road in node c
Footpath, is c- > b- > g- > q, c- > g- > q and c- > k- > q respectively, the time that the rrep of this three paths reaches be respectively 36ms,
30ms and 25ms, time of arrival mentioned here refers to from node c and sends rreq to receiving the one of rrep elapsed time
Half.If there are identical path, then only need to retain maximum weight, such as node p can receive three differences from node c
Rrep, weights are different, finally only need to retain (c, 103), here for explanation, have all arranged all of out.Whole route
In after all of rrep reaches, the longest used time 76ms, source node p will select the path of maximum weight, according to p- > road of c
Footpath sends data, after node c receives data, according to c- > b sends, node b is then according to b- > g, and node g is according to g- > path of q sends out
Send data.Entirely complete path is: p- > c- > b- > g- > q.
In sum, technical solution of the present invention, can with acquisition approach link quality compared with prior art
Little value, it is possible to obtain the best path of link total quality, can dynamically balance the load of multipath route simultaneously, overcome biography
System method for routing effectively can not distribute offered load, causes the technical problems such as subnetwork congestion.By to chain-circuit time delay
Assessment, solves the problems, such as that prior art can not effectively distribute offered load.
It is to be understood that: the above is only the preferred embodiment of the present invention, common for the art
For technical staff, under the premise without departing from the principles of the invention, some improvements and modifications can also be made, these improve and moisten
Decorations also should be regarded as protection scope of the present invention.