Background technology
Topological node claims again the network topology node.For distributed apparatus, can by be distributed in equipment everywhere, can process information and the abstract topological node that is called of physical entity of transmission information, the corresponding CPU (CPU, Central Processing Unit) of a common topological node.
For simplicity, hereinafter by " topological node " all referred to as " node ".
A kind of common network topology is the full syndeton between each node in network, and single layer structure, do not have layering, do not support to need the network configuration of layering; In network, each node exists as peer-to-peer, and nodal information is synchronous consistent between all nodes, as shown in Figure 1.
Need a kind of effective network node testing mechanism to carry out adding (Up) and leaving (Down) of sensing network node.New node adds fashionable, in network, has existed node to need and the mutual synchronizing information of new node; When node leaves, remain in network at node and need to delete the information of having left node.
For whole local area network (LAN) or wide area network, adding/leaving of certain equipment can abstractly be the Up/Down state of topological node.For distributed apparatus, in equipment, the power on/lower electricity of certain cpu node can abstractly be the Up/Down state of topological node.
At present, usually by three-way handshake, complete alternately the topology foundation of fully-connected network, relate to following three kinds of messages in this process:
Greet (Hello) message: broadcasting packet in network, timed sending on each network node.For the node newly added in network, by hello packet, can find mutually the other side; For the node of built vertical topology in network, hello packet is for the heartbeat keep-alive.
Synchronous (Syn) message: unicast message, the point-to-point response message of hello packet.
Confirm (Ack message): unicast message, the point-to-point response message of Syn message.
Simultaneously, in this process, each node will be safeguarded the state of peer node, relates generally to following three kinds of states:
Down: the initial condition of newly added node in network, topology is left state.
Down-Up: the interim state in the topological node handshake procedure, wait acknowledge state.
Up: the stable state after topological node is set up, topology is set up state.
Fig. 2 is the existing message flow chart that completes alternately the topology foundation of fully-connected network by three-way handshake, and as shown in Figure 2, its concrete steps are as follows:
Step 201: node x powers on, and the state of other nodes in default network is all Down, and node x sends hello packet.
Step 202: arbitrary other nodes in network are received the hello packet (being made as event E1) that node x sends, the state of node x is changed to Down-Up by Down, simultaneously, return to the Ack timer (being made as action A1) of Syn message starter node x to node x, with wait node x, return to the Ack message.
Step 203: node x receives the Syn message (being made as event E2) that arbitrary other nodes return, the state of this node is changed to Up by Down, simultaneously, to this node, return to Ack message (being made as action A2), the hello packet time-out count device of this node of simultaneously resetting (being made as action A3).
Step 204: arbitrary other nodes in network are received the Ack message (being made as event E3) that node x sends, the state of node x is changed to Up by Down-Up, the Ack timer of deletion of node x (being made as action A4), and the hello packet time-out count device of replacement node x (being made as action A3).
If arbitrary other nodes in network are when the Ack timer expiry of the node x of self maintained, do not receive yet the Ack message (being made as event E5) that node x sends, the state of node x is changed to Down by Down-Up, simultaneously the Ack timer of deletion of node x (being made as action A4).
In addition, when if the arbitrary node in network finishes at the counting of the hello packet time-out count device for other nodes, do not receive yet the hello packet (being made as event E4) of these other nodes, the state of these other nodes is changed to Down by Up, and delete the hello packet time-out count device (being made as action A5) for these other nodes.
In addition, if the arbitrary node in network is before the counting of the hello packet time-out count device for other nodes finishes, receive the hello packet (being made as event E1) of these other nodes, keep the state Up of these other nodes constant, and the hello packet time-out count device of these other nodes of resetting (being made as action A3).
Table 1,2 has provided respectively all events in the existing topological process of establishing that completes alternately fully-connected network by three-way handshake, the definition of action:
Event |
Explanation |
E1 |
Receive hello packet |
E2 |
Receive the Syn message |
E3 |
Receive the Ack message |
E4 |
The hello packet wait timeout |
E5 |
Ack message wait timeout |
Table 1 is existing completes the definition of all events in the topological process of establishing of fully-connected network alternately by three-way handshake
Action |
Explanation |
A1 |
Send the Syn message, start the Ack timer |
A2 |
Send the Ack message |
A3 |
Replacement hello packet time-out count device |
A4 |
Delete the Ack timer |
A5 |
Delete hello packet time-out count device |
Table 2 is existing completes the definition of the everything in the topological process of establishing of fully-connected network alternately by three-way handshake
Table 3 is the topological state transition table in the existing topological process of establishing that completes alternately fully-connected network by three-way handshake, wherein, E1~E5 in the 1st row means the local terminal event, the state that opposite end Down, Down-Up in the 1st row and Up mean opposite end, in 2nd~6 row 2nd~4 row mean that respectively local terminal event shown in row and opposite end has occurred when state shown in row, the treatment step of local terminal:
Table 3 is existing completes the topological state transition table in the topological process of establishing of fully-connected network alternately by three-way handshake
There is following defect in the existing topological method for building up that completes alternately fully-connected network by three-way handshake:
In table 3, when opposite end, during in the Up state, local terminal is received the Syn message of sending opposite end, the state of opposite end first need to be changed to Down by Up and change to again Up, be for following scene:
Node x and node y have set up to shake hands mutually and have been connected, and the x end thinks that the state of y end is Up, x to y synchronous the information of x oneself, same, y holds and thinks that the state that x holds is Up, y to x synchronous the information of y oneself;
Now, the lower electricity of y end, before the x end perceives the hello packet wait timeout of y end, the y end powers on again, again adds network topology.Now, the x end still thinks that the state of y end is Up, but the y end but thinks that the state of x end is Down; Then, the x end is shaken hands mutually with the y end, and the x end is received the hello packet of y end, thinks that this message is for the heartbeat keep-alive, does not process; The y end is received the hello packet of x end, thinks that this message is for finding the other side, replys x end Syn message;
After x end is received the Syn message of y end, must by the state of y end, from the Up migration, be first Down, and delete local residual y client information, then the state of y end be moved back to Up again from Down, and hold the own information of synchronous x end to y, hold transmission Ack message to y after; After the y end is received the Ack message of x end, by the state transition of x end, be Up, and hold the information of oneself to x end re-synchronization y.
Summary of the invention
The invention provides the topological method for building up of fully-connected network and the node in fully-connected network, to improve the reliability of fully-connected network topology.
Technical scheme of the present invention is achieved in that
Topological method for building up in a kind of fully-connected network, the method comprises:
When the arbitrary node in fully-connected network powers on, be that self generates a characteristic value, to Web broadcast, greet hello packet, this message carries the state of all nodes in the network that this node safeguards: leave Down;
When described node receives the periodic broadcast hello packet that in network, arbitrary peer node is sent, this message carries the state of all nodes in the network that this peer node safeguards, the state of finding this node in this message is Down, and the state of this peer node of self maintained is Down, the reset hello packet time-out count device of peer node, and return to unicast response Reply message to this peer node, this message carries the characteristic value of self, to impel peer node, the state of this node is changed to Up by Down;
When described node receives the Reply message that in network, arbitrary peer node is sent, the characteristic value of finding this peer node in this message is the new feature value, record this new feature value of this peer node, the state of finding this peer node of self maintained is Down, the state of this peer node of self maintained is changed to and is added Up by Down;
When described node receives the periodic broadcast hello packet that in network, arbitrary peer node is sent, this message carries the state of all nodes in the network that this peer node safeguards, the state of finding this node in this message is Down, and the state of this peer node of self maintained is Up, the reset hello packet time-out count device of this peer node, and return to clean culture Reply message to this peer node, carry the characteristic value of self in this message, to impel peer node, the state of this node is changed to Up by Down.
Described method further comprises:
When described node receives the periodic broadcast hello packet that in network, arbitrary peer node is sent, this message carries the state of all nodes in the network that this peer node safeguards, the state of finding this node in message is Up, and the state of this peer node of self maintained is Down, to this peer node, return to clean culture Reply message, this message carries the characteristic value of self, and the hello packet time-out count device of this peer node of resetting; When described node receives the clean culture Reply message that in network, arbitrary peer node is sent, the characteristic value of finding this peer node in this message is not the new feature value, and the state of this peer node of self maintained is Up, keep the Up state of this peer node constant.
Described method further comprises:
When described node receives the periodic broadcast hello packet that in network, arbitrary peer node is sent, this message carries the state of all nodes in the network that this peer node safeguards, the state of finding this node in message is Up, and the state of this peer node of self maintained is Up, the hello packet time-out count device of this peer node of resetting.
Described method further comprises:
While not receiving the hello packet that this peer node sends within the current hello packet time-out count cycle of described node arbitrary peer node in network, and the state of finding this peer node of self maintained is Up, upgrade the characteristic value of this node, the state of this peer node is changed to Down by Up, and within a hello packet time-out count cycle, to Web broadcast Hello-Ext message, this message carries the state of all nodes in the network of self maintained, wherein, the state of this peer node is Down;
When described node receives the Hello-Ext message that in network, arbitrary peer node is sent, find that in message, the state of self is Down, and the state of this peer node of self maintained is Up, upgrade the characteristic value of self, and return to clean culture Reply message to this peer node, this message carries the new feature value of self, and the hello packet time-out count device of this peer node of resetting, and the state of this peer node is changed to Down by Up simultaneously.
Described method further comprises:
When described node receives the Hello-Ext message that in network, arbitrary peer node is sent, find that in message, the state of self is Down, and the state of this peer node of self maintained is Down, to this peer node, return to clean culture Reply message, this message carries the characteristic value of self, and the hello packet time-out count device of this peer node of resetting;
Perhaps, when described node receives the Hello-Ext message that in network, arbitrary peer node is sent, find that in message, the state of self is Up, and the state of this peer node of self maintained is Up, the hello packet time-out count device of this peer node of resetting;
Perhaps, when described node receives the Hello-Ext message that in network, arbitrary peer node is sent, find that in message, the state of self is Up, and the state of this peer node of self maintained is Down, to this peer node, return to clean culture Reply message, this message carries the characteristic value of self, and the hello packet time-out count device of this peer node of resetting.
Node in a kind of fully-connected network, this node comprises:
The first module: when powering on, for characteristic value of this section dot generation, to the Web broadcast hello packet, this message carries the state of all nodes in the network that this node safeguards: Down;
The second module: the periodic broadcast hello packet that arbitrary peer node is sent in receiving network, this message carries the state of all nodes in the network that this peer node safeguards, the state of finding this node in this message is Down, and the state of this peer node that this node is safeguarded is Down, the reset hello packet time-out count device of peer node, and return to clean culture Reply message to this peer node, this message carries the characteristic value of this node, to impel peer node, the state of this node is changed to Up by Down; The broadcast hello packet that arbitrary peer node is sent in receiving network, this message carries the state of all nodes in the network that this peer node safeguards, the state of finding this node in this message is Down, and the state of this peer node that this node is safeguarded is Up, the reset hello packet time-out count device of this peer node, and return to clean culture Reply message to this peer node, carry the characteristic value of this node in this message, to impel peer node, the state of this node is changed to Up by Down;
The 3rd module: the Reply message that arbitrary peer node is sent in receiving network, the characteristic value of finding this peer node in this message is the new feature value, record this new feature value of this peer node, the state of finding this peer node that this node is safeguarded is Down, and the state of this peer node of this node being safeguarded changes to Up by Down.
Described the second module is further used for, the periodic broadcast hello packet that arbitrary peer node is sent in receiving network, this message carries the state of all nodes in the network that this peer node safeguards, the state of finding this node in message is Up, and the state of this peer node that this node is safeguarded is Down, to this peer node, return to clean culture Reply message, this message carries the characteristic value of this node, and the hello packet time-out count device of this peer node of resetting;
And, described the 3rd module is further used for, the clean culture Reply message that arbitrary peer node is sent in receiving network, the characteristic value of finding this peer node in this message is not the new feature value, and the state of this peer node that this node is safeguarded is Up, keeps the Up state of this peer node constant.
Described the second module is further used for, the periodic broadcast hello packet that arbitrary peer node is sent in receiving network, this message carries the state of all nodes in the network that this peer node safeguards, the state of finding this node in message is Up, and the state of this peer node that this node is safeguarded is Up, the hello packet time-out count device of this peer node of resetting.
Described the second module is further used for, while not receiving the hello packet that this peer node sends within the current hello packet time-out count cycle of arbitrary peer node in network, and the state of finding this peer node that this node is safeguarded is Up, upgrade the characteristic value of this node, the state of this peer node is changed to Down by Up, and within a hello packet time-out count cycle, to Web broadcast Hello-Ext message, this message carries the state of all nodes in the network that this node safeguards, wherein, the state of this peer node is Down; The Hello-Ext message that arbitrary peer node is sent in receiving network, the state of finding this node in message is Down, and the state of this peer node that this node is safeguarded is Up, upgrade the characteristic value of this node, and return to clean culture Reply message to this peer node, this message carries the new feature value of this node, and the hello packet time-out count device of this peer node of resetting, and the state of this peer node is changed to Down by Up simultaneously.
Described the second module is further used for, the Hello-Ext message that arbitrary peer node is sent in receiving network, the state of finding this node in message is Down, and the state of this peer node that this node is safeguarded is Down, to this peer node, return to clean culture Reply message, this message carries the characteristic value of this node, and the hello packet time-out count device of this peer node of resetting; Perhaps, the Hello-Ext message that arbitrary peer node is sent in receiving network, find that the state of this node in message is Up, and the state of this peer node of safeguarding of this node is Up, the hello packet time-out count device of this peer node of resetting; Perhaps, the Hello-Ext message that arbitrary peer node is sent in receiving network, the state of finding this node in message is Up, and the state of this peer node that this node is safeguarded is Down, to this peer node, return to clean culture Reply message, this message carries the characteristic value of this node, and the hello packet time-out count device of this peer node of resetting.
Visible, the present invention has improved stability and the reliability of fully-connected network topology.
Embodiment
Below in conjunction with drawings and the specific embodiments, the present invention is further described in more detail.
The inventor the analysis found that, the existing topological method for building up of fully-connected network node that completes alternately by three-way handshake is when following situation occurs, the y end does not have real Down, but the x end has been removed the synchronizing information of y, thereby causes the information of x and y end asynchronous:
1) link packet is out of order.
As shown in Figure 3, after x powers on, successively send two hello packet to y, but first received the Syn message that y replys for second hello packet, now, the state of y is changed to Up by Down, receive again subsequently the Syn message that y replys for first hello packet, now, the state of y is first become to Down by Up and become again Up.Visible, in whole process, y does not have real Down mistake, and still, x but thinks y Down mistake.
2) x end and y end node link are unidirectional obstructed.
As shown in Figure 4, at x, y, all after Up, x can receive the hello packet that y sends, think that the state of y is Up, but y can not receive the hello packet that x sends, so y changes to Down by the state of x by Up, after this, after y has received the hello packet that x sends, can think that x re-powers, thereby return to the Syn message to x, x receives the Syn message, the state of y is first become to Down by Up and become again Up, return to the Ack message to y simultaneously.Visible, in whole process, y does not have real Down mistake, and still, x but thinks y Down mistake.
For situation 1), the reason that produces this problem is: only the Syn message can't obtain the whether genuine information that once Down crosses in opposite end; For situation 2), when problem is that y end perceives x and holds own link obstructed, notice x does not hold in time.
In a word,, in the face of the more unsettled network of link circuit condition the time, there is the nonsynchronous hidden danger of nodal information in the existing topological process of establishing that completes alternately fully-connected network by three-way handshake.
For above-mentioned analysis, the inventor has proposed to set up scheme by twice topology that completes alternately fully-connected network of shaking hands.
At first, the message the present invention relates to is described:
The present invention relates to two kinds of basic messages and a kind of amplifying message:
Two kinds of basic messages are as follows:
1) hello packet: broadcasting packet.The form of this message, as shown in Fig. 5-1, comprises three fields altogether: identification field, expansion (Ext) field and information 1(Info1) field, wherein:
Identification field: mean that this message is hello packet;
The Ext field: mean that this message is common hello packet or expansion hello packet (Hello-Ext) message, as: value 0 means common hello packet, and value 1 means the Hello-Ext message; For the sake of simplicity, hello packet hereinafter refers to common hello packet.
The Info1 field: the state of all nodes of safeguarding on this node, the state of giving tacit consent to all nodes when node has just powered on is Down.
2) response (Reply) message: unicast message is the back message using to hello packet, for shaking hands.The form of Reply message, as shown in Fig. 5-2, comprises two fields altogether: identification field and characteristic value, wherein:
Identification field: mean that this message is the Reply message;
Characteristic value: for meaning the characteristic value of this node.
The state of current existing network node in the topology that this node perceives of take is topological state, characteristic value is for identifying described topological state, and if this node perceives arbitrary network node and leaves topology, described topological state changes, now will upgrade described characteristic value, the characteristic value after renewal is all not identical with characteristic value before.For example: can perceive all topological nodes that add at every turn after node powers on, now generate a current topological state characteristic of correspondence value, after this often perceive other network nodes and leave, just regenerate a characteristic value.May produce repeatedly and shake hands in a topological state procedure, but the characteristic value of node is unique constant.For a node, the different topological state characteristic of correspondence value of this node is different, and meet this point can have multiple implementation, such as: can utilize random number as characteristic value.
A kind of amplifying message is as follows:
Hello-Ext message: broadcasting packet, when this section point discovery has node to shake hands heartbeat timeout, within a count cycle of hello packet time-out count, the hello packet sent is replaced with to the Hello-Ext message, with in the unidirectional obstructed time notice peer node Down event of network link.The form of Hello-Ext message, as shown in Fig. 5-3, comprises 4 fields altogether:
Identification field: mean that this message is hello packet;
The Ext field: its implication is with the Ext field of hello packet;
The Info1 field: its implication is with the Info1 field of hello packet;
The Info2 field: the state of all nodes of safeguarding on this node, wherein, the state of the node of the heartbeat timeout of shaking hands is Down, the state of other all nodes all is defaulted as Up.
When the node that Fig. 6 provides for the embodiment of the present invention powers on, the message flow chart of the topological method for building up of fully-connected network, as shown in Figure 6, its concrete steps are as follows:
Step 601: the arbitrary node in fully-connected network, be made as node x and power on, in default network, the state of all nodes is Down, for self generates an initial characteristic value X1, to the Web broadcast hello packet, in the Info1 field of this message, the state of all nodes is Down.
Here, when node x has just powered on, which node is not known in network has, and how does node x identify each node in the Info1 field so? usually adopt following method:
All configured the spendable IP address range of node in this network on each node due to fully-connected network, therefore, can preset a mapping algorithm, this IP address range is mapped to a bitmap, each point value on bitmap represents an IP address.Like this, node x carries this bitmap in Info1, wherein, the corresponding node that may exist of each point in bitmap, the state of all nodes is Down.After other nodes are received this hello packet, the IP address of oneself is shone upon, according to mapping value, to bitmap, searched corresponding value, thereby obtained the state of this node of node x maintenance: Down.
Step 602: arbitrary other nodes in network, be made as node y and receive this hello packet, the state of finding this node y in this message is that Down(is made as event F2), and the state of the node x that this node is safeguarded is Down, to node x, return to clean culture Reply message (being made as action B1), this Reply message carries the characteristic value Y1 of this node y, and the hello packet time-out count device of replacement node x (being made as action B3).
Step 603: node x receives arbitrary other nodes in network, be made as the Reply message that node y sends, the characteristic value of finding node y in this message is new feature value (being made as event F3), record this new feature value of node y, the state of finding the node y of self maintained is Down, the state of the node y of self maintained is changed to Up by Down.
Step 604: arbitrary other nodes in network, be made as node y before the hello packet time-out count device counting of node x finishes, while receiving the follow-up hello packet of sending of node x, if in the discovery message, the state of this node y is that Up(is event F1), and the state of the node x of self maintained is Down, to node x, return to clean culture Reply message (move B1), this message carries the characteristic value Y1 of this node y, and the hello packet time-out count device of replacement node x (move B3).
Step 605: node x receives arbitrary other nodes in network, be made as the clean culture Reply message that node y sends, by the characteristic value Y1 of the node y of the characteristic value Y1 of the node y in this message and self state-of-the-art record relatively, find that the two is identical, the characteristic value of confirming node y in this message is not new feature value (being made as event F4), and the state of the node y of self maintained is Up, keep the Up state of node y constant.
Step 606: node x receives arbitrary other nodes in network, be made as the broadcast hello packet that node y sends, the state of finding this node x in the Info1 of this message is that Down(is event F2), and the state of the node y of self maintained is Up, to node y, return to clean culture Reply message (move B1), carry the new feature value X1 of this node x in this message, and the hello packet time-out count device of replacement node y (move B3).
Step 607: arbitrary other nodes in network, be made as node y and receive the clean culture Reply message that node x sends, the characteristic value X1 that finds node x in this message is new feature value (being event F3), record this new feature value of node x, the state of finding the node x of self maintained is Down, and the state of node x is changed to Up by Down.
So far, the network topology process of establishing of node x after powering on completes.Node x has obtained the real state of other nodes in the network, and on other in network, electrical nodes is also all changed the state of node x for Up by Down.
As can be seen from Figure 6, after node x powers on, with other nodes, through twice, shake hands and just completed the network topology process of establishing.After this, node x fixed time broadcast hello packet, after other nodes are received this hello packet, in the Info of discovery message, the state of self is that Up(is event F1), and the state of the node x of self maintained is Up, the hello packet time-out count device of the node x that resets (move B3).
Fig. 7 for the embodiment of the present invention provide when link unidirectional when obstructed, the message flow chart of the topological method for building up of fully-connected network, as shown in Figure 7, its concrete steps are as follows:
Step 701: when node x arbitrary other nodes in network, the hello packet time-out count device counting that is made as node y does not receive the hello packet that node y sends while finishing, from the hello packet wait timeout (being made as event F5) of node y, and the state of finding the node y of self maintained is Up, the characteristic value of upgrading this node x is that X2(is made as action B2), the state of the node y of self maintained is changed to Down by Up, simultaneously the reset hello packet time-out count device of node y, during this rolling counters forward, to Web broadcast Hello-Ext message, wherein, in the Info2 of message, the state of node y is Down, the state of other nodes is all Up.
Here, node x finds the hello packet wait timeout from node y, only within a hello packet time-out count cycle subsequently, hello packet is replaced with to the Hello-Ext message.If, before this rolling counters forward finishes, received the Reply message that node y sends, the hello packet time-out count device of the node y that resets, recover to send hello packet; Otherwise, determined the certain Down of y, the hello packet time-out count device of deletion of node y.
It should be noted that, in actual applications, in the Info2 of the Hello-Ext message in this step, the state that removes other nodes of node y also can be the virtual condition of these other nodes of node x maintenance.
Step 702: if node y has received the Hello-Ext message that node x sends, the state of finding this node y in message is that Down(is made as event F7), and the state of the node x of self maintained is Up, the characteristic value of upgrading this node y is that Y2(moves B2), and return to clean culture Reply message (move B1) to node x, this message carries the new feature value Y2 of this node y, and the hello packet time-out count device of replacement node x (move B3), the state of node x is changed to Down by Up simultaneously.
In this step, if node y has received the Hello-Ext message that node x sends, the state of finding this node y in message is that Down(is made as event F7), and the state of the node x of self maintained is Down, to node x, return to clean culture Reply message (move B1), this message carries the characteristic value of this node y, and the hello packet time-out count device of replacement node x (move B3).
When receiving the Hello-Ext message that node x sends except other nodes of node y, the state of finding this node in message is that Up(is made as event F6), and the state of the node x of self maintained is Up, the hello packet time-out count device of the node x that resets (move B3).
When receiving the Hello-Ext message that node x sends except other nodes of node y, find that the oneself state in message is that Up(is made as event F6), and the state of the node x of self maintained is Down, to node x, return to clean culture Reply message (move B1), this message carries the characteristic value of self, and the hello packet time-out count device of replacement node x (move B3).
Step 703: node x receives the clean culture Reply message that node y sends, the characteristic value of finding node y in this message is new feature value (being event F3), record this new feature value of node y, the state of finding the node y of self maintained is Down, the state of the node y of self maintained is changed to Up by Down.
Step 704: the hello packet that node x receiving node y sends subsequently, the state of finding in this message self node is that Down(is event F2), and the state of the node y of self maintained is Up, to node y, return to clean culture Reply message (move B1), this message carries the new feature value X2 of self, the hello packet time-out count device of the node y that simultaneously resets (move B3).
Step 705: node y receives the clean culture Reply message that node x sends, the characteristic value X2 that finds the node x in message is new feature value (being event F3), record this new feature value of node x, the state of finding the node x of self maintained is Down, the state of the node x of self maintained is changed to Up by Down.
In actual applications, also there is a kind of situation: power on again after electricity within a hello packet time-out count cycle under node x, , node y does not perceive electricity under node x and powers on again, after node x receives the hello packet that node y sends, can return to clean culture Reply message to node y, this message carries the newly-generated characteristic value of node x, node y receives this clean culture Reply message that node x sends, the characteristic value of finding the node x in message is new feature value (being event F3), record this new feature value of node x, the state of finding the node x of self maintained is Up, the state of the node x of self maintained is first become to Down by Up and become again Up.
From flow process shown in Fig. 6,7, can find out: no matter received hello packet or Hello-Ext message that peer node is sent; this end node all can think that this heartbeat keep-alive of peer node is successful, thus the hello packet time-out count device of the peer node of can resetting.
The event related to due to the embodiment of the present invention and move morely, for convenience of understanding more intuitively the present invention, existing by the embodiment of the present invention, the mode with form describes:
Wherein, table 4,5 has provided respectively all events in the topological process of establishing that completes alternately fully-connected network of passing through to shake hands for twice that the embodiment of the present invention provides, the definition of action:
Event |
Explanation |
F1 |
Receive hello packet, and in message, this node state is Up |
F2 |
Receive hello packet, and in message, this node state is Down |
F3 |
Receive the Reply message, message carries the new feature value of peer node |
F4 |
Receive the Reply message, the characteristic value of the peer node that message carries is not the new feature value |
F5 |
The hello packet wait timeout |
F6 |
Receive the Hello-Ext message, in the info2 of message, the state of this node is Up |
F7 |
Receive the Hello-Ext message, in the info2 of message, the state of this node is Down |
The definition of all events in the topological process of establishing that completes alternately fully-connected network of passing through to shake hands for twice that table 4 embodiment of the present invention provides
The definition of the everything in the topological process of establishing that completes alternately fully-connected network of passing through to shake hands for twice that table 5 embodiment of the present invention provides
Topological state transition table in the topological process of establishing that completes alternately fully-connected network of passing through to shake hands for twice that table 6 provides for the embodiment of the present invention, wherein, F1~F7 in the 1st row means the local terminal event, the state that opposite end Down in the 1st row, Up mean opposite end, in 2nd~8 row 2nd~3 row mean that respectively local terminal event shown in row and opposite end has occurred when state shown in row, the treatment step of local terminal:
Topological state transition table in the topological process of establishing that completes alternately fully-connected network of passing through to shake hands for twice that table 6 provides for the embodiment of the present invention
From flow process shown in Fig. 6,7, can find out: the present invention, only adopting shakes hands for twice just can complete the foundation of network topology, has simplified topological process of establishing; Simultaneously, because a node is used a characteristic value in each the connection,, the characteristic value of using in once connecting is constant, uses different characteristic values in difference connects, so only when the real Up of node, Down, just can be changed the state of node, and, when packet out-ordering, with regard to not carrying out unnecessary Up, arrive again the operation of UP to Down, also guaranteed the synchronous of information between node; In addition, in the present invention, finding that link is unidirectional when obstructed, notice peer node in time, thus also avoided the conversion of unnecessary node state, guaranteed the synchronous of information between node.Visible, the present invention has increased the reliability of network topology, at network, exists packet out-ordering, link unidirectional when obstructed, still can guarantee the stability that connects between node and the integrality of synchrodata.
The composition schematic diagram of the node in the fully-connected network that Fig. 8 provides for the embodiment of the present invention, as shown in Figure 8, this node comprises: the first module 81, the second module 82, the 3rd module 83 and four module 84, wherein:
The first module 81: when powering on, for characteristic value of this section dot generation, this characteristic value is put into to four module 84, and in initialization four module 84, the state of all-network node is Down, to the Web broadcast hello packet, this message carries the state of all nodes in network: Down.
The second module 82: the periodic broadcast hello packet that arbitrary peer node is sent in receiving network, this message carries the state of all nodes in the network that this peer node safeguards, the state of finding this node in this message is that Down(is made as event F2), and the state of this peer node of safeguarding in four module 84 is Down, the reset hello packet time-out count device (be made as action B3) of peer node, and return to clean culture Reply message (being made as action B1) to this peer node, this message carries the characteristic value of this node of four module 84 maintenances, to impel peer node that the state of this node is changed to Up by Down, the broadcast hello packet that arbitrary peer node is sent in receiving network, this message carries the state of all nodes in the network that this peer node safeguards, the state of finding this node in this message is that Down(is event F2), and the state of this peer node that four module 84 is safeguarded is Up, the reset hello packet time-out count device (move B3) of this peer node, and return to clean culture Reply message (move B1) to this peer node, carry the characteristic value of this node of four module 84 maintenances in this message, to impel peer node that the state of this node is changed to Up by Down,
The 3rd module 83: the Reply message that arbitrary peer node is sent in receiving network, the characteristic value of finding this peer node in this message is new feature value (being made as event F3), with the new feature value of this peer node, upgrade the characteristic value of this peer node of four module 84 maintenances, the state of finding this peer node that four module 84 is safeguarded is Down, and the state of this peer node of four module 84 being safeguarded changes to Up by Down.
Four module 84: the characteristic value of all nodes and state in maintaining network.
The second module 82 is further used for, the periodic broadcast hello packet that arbitrary peer node is sent in receiving network, this message carries the state of all nodes in the network that this peer node safeguards, the state of finding this node in message is that Up(is event F1), and the state of this peer node that four module 84 is safeguarded is Down, to this peer node, return to clean culture Reply message (move B1), this message carries the characteristic value of this node that four module 84 safeguards, and the hello packet time-out count device of this peer node of resetting (move B3);
And, the 3rd module 83 is further used for, the clean culture Reply message that arbitrary peer node is sent in receiving network, by the characteristic value of this peer node of the characteristic value of this peer node in this message and four module 84 maintenances relatively, the two is identical, the characteristic value of confirming this peer node is not new feature value (being made as event F4), and the state of this peer node of safeguarding of four module 84 is Up, keeps the Up state of this peer node constant.
The second module 82 is further used for, the periodic broadcast hello packet that arbitrary peer node is sent in receiving network, this message carries the state of all nodes in the network that this peer node safeguards, the state of finding this node that four module 84 is safeguarded is that Up(is event F1), and the state of this peer node that four module 84 is safeguarded is Up, the hello packet time-out count device of this peer node of resetting (move B3).
The second module 82 is further used for, while not receiving the hello packet that this peer node sends within the current hello packet time-out count cycle of arbitrary peer node in network (being made as event F5), and the state of finding this peer node that four module 84 is safeguarded is Up, upgrade the characteristic value (being made as action B2) of this node of four module 84 maintenances, the state of this peer node that four module 84 is safeguarded changes to Down by Up, and within a hello packet time-out count cycle, to Web broadcast Hello-Ext message, this message carries the state of all nodes in the network that four module 84 safeguards, wherein, the state of this peer node is Down, the Hello-Ext message that arbitrary peer node is sent in receiving network, the state of finding this node in message is that Down(is made as event F7), and the state of this peer node that four module 84 is safeguarded is Up, upgrade the characteristic value (move B2) of this node that four module 84 safeguards, and return to clean culture Reply message (move B1) to this peer node, this message carries the new feature value of this node, and the hello packet time-out count device of this peer node of resetting (move B3), the state of this peer node of simultaneously four module 84 being safeguarded changes to Down by Up.
The second module 82 is further used for, the Hello-Ext message that arbitrary peer node is sent in receiving network, the state of finding this node in message is that Down(is made as event F7), and the state of this peer node that four module 84 is safeguarded is Down, to this peer node, return to clean culture Reply message (move B1), this message carries the characteristic value of this node that four module 84 safeguards, and the hello packet time-out count device of this peer node of resetting (move B3); Perhaps, the Hello-Ext message that arbitrary peer node is sent in receiving network, the state of finding this node in message is that Up(is made as event F6), and the state of this peer node that four module 84 is safeguarded is Up, the hello packet time-out count device of this peer node of resetting (move B3); Perhaps, the Hello-Ext message that arbitrary peer node is sent in receiving network, the state of finding this node in message is that Up(is made as event F6), and the state of this peer node that four module 84 is safeguarded is Down, to this peer node, return to clean culture Reply message (move B1), this message carries the characteristic value of this node that four module 84 safeguards, and the hello packet time-out count device of this peer node of resetting (move B3).
The foregoing is only preferred embodiment of the present invention, in order to limit the present invention, within the spirit and principles in the present invention not all, any modification of making, be equal to replacement, improvement etc., within all should being included in the scope of protection of the invention.