Embodiment
In the scope of the invention, so-called main frame is meant the device of personal computer or server and so on, just can connect network and have the ability to carry out any device of the present invention.Set passage and build the difference of putting passage and be, set passage and be meant two passages planning between the main frame, for example be stored in the passage configuration in the setting file, not necessarily have true passage to exist, put passage and be meant the actual step of setting up true passage and build.Passage must have the address at two ends just can build to put.The address can be divided static and dynamic two kinds.Just can not change after the static address decision, and dynamic address may change at any time.
Following elder generation illustrates internet protocol channel management method of the present invention with four examples, Figure 2 shows that the flow chart of first example.In first example, have only a passage between host A, the B, wherein A uses static address, and B uses dynamic address, and is as shown in table 1.
Table 1, the path setting of example one
Host A |
Host B |
Static address |
Dynamic address |
At first, the system of host A, B starts in the step 202 and 204 of Fig. 2 respectively.In step 206, B obtains dynamic address in the mode of DHCP or PPPoE and so on.Host B also has the setting of the static address of host A, and this moment, B learnt the address at passage two ends, put passage so can build at this moment, then its dynamic address was sent to A.In step 208, A receives the dynamic address of B.This moment, A also learnt the address at passage two ends, put passage so can build at this moment, sent then to confirm that message (acknowledgement) is to B.In step 210, B receives the affirmation message of A then, and this moment, passage was communicated with.
At interval after one section preset time T, B sends its dynamic address to A once more in step 212.A receives the message of B in step 214.Because the dynamic address of B does not change, A directly returns and confirms that message is to B.B receives the affirmation message of A in step 216.
Same process is recurred after blanking time T, step 218 to 222 and the step 212 of front to 216 identical.
Next in step 224, this moment, the dynamic address of B changed.Because B has learnt the static address of A, B can use new dynamic address to build again and put passage, and the notification message that sends new dynamic address is to A.In step 226, A receives the new address of B, builds again with the new address of B and puts passage, and send the affirmation message to B.In step 228, B receives the affirmation message of A then, and this moment, passage was communicated with once again.
Step 230 after blanking time T, B sends dynamic address once more to A.In step 232, A receives the message of B, because dynamic address does not change, just directly returns and confirms that message is to B.In step 234, B receives the affirmation message of A at last.
In first above example, host A is passive recipient, and host B is the active transmit leg.B periodically sends to A with the dynamic address of oneself, and requires A response confirmation message, confirms message if confiscate in Preset Time, and B can retransmit.So no matter to be that network on-line interrupts or has main frame to restart, can both to guarantee that the passage between host A, the B can Fast Reconstruction.
Below explanation second example of the present invention has two passages between the host A of this example, the B, and the setting of host A is shown in table 2A, and the setting of host B is shown in table 2B.
Table 2A, the path setting of example two host As
Passage |
The near-end address |
Remote address |
#1 |
Static address |
Static address |
#2 |
TKT#2 |
AVT#2 |
Table 2B, the path setting of example two host Bs
Passage |
The near-end address |
Remote address |
#1 |
Static address |
Static address |
#2 |
AVT#2 |
TKT#2 |
In the middle of table 2A, the near-end address is the channel address of host A itself, and remote address is the channel address of the host B on passage opposite.The definition of two kinds of addresses is opposite in the middle of table 2B, and the near-end address is the channel address of host B itself, and remote address is the channel address of host A.
Not only one of the dynamic address of example two, therefore use the combination of main frame code name and special line numbering to be distinguished.Each main frame all has unique main frame code name, and the code name of host A is TKT, and the code name of host B is AVT.Each special line all has a numbering, and host A is exactly TKT#2 at the dynamic address of special line #2.In like manner, host B is exactly AVT#2 at the dynamic address of special line #2.
Fig. 3 is the flow chart of example two.At first, the system of host A, B starts in step 302 and 304 respectively.In step 306, A obtains dynamic address TKT#2.Because the static address at passage #1 two ends is all known, host A can be built at this moment and put passage #1.Host A sends to B with dynamic address TKT#2 then,
And the dynamic address of inquiry B.In step 308, B obtains dynamic address AVT#2.Because the static address at passage #1 two ends is all known, host B can be built at this moment and put passage #1.B sends to A with dynamic address AVT#2 then, and the dynamic address of inquiry A.In step 310, A receives the dynamic address AVT#2 of B, builds and puts passage #2, and the dynamic address TKT#2 of A is sent to B with the affirmation message.In step 312, B receives affirmation message and the dynamic address TKT#2 of A, builds and puts passage #2.This moment, passage #2 was communicated with.Then in step 314, B receives the dynamic address TKT#2 of A.Because having built, B puts passage #2, and the not variation of the dynamic address of A, so needn't building again, B puts passage #2.B sends to A with its dynamic address AVT#2 with the affirmation message then.In step 316, A receives affirmation message and the dynamic address AVT#2 of B.Because having built, A puts passage #2, and the not change of the dynamic address of B, so needn't building again, A puts passage.
Then in step 318, the dynamic address TKT#2 of A has changed, and puts passage #2 so A uses new address to build again.A selects one in two known addresses of B then, and (roundrobin) selects an address for example in a looping fashion, sends to B in order to the new dynamic address message with A.In step 320, B receives the dynamic address of A then, finds that TKT#2 changes, and therefore builds again and puts passage #2, sends then to confirm that message is to A.In step 322, A receives the affirmation message of B at last.
Below explanation the 3rd example of the present invention has two passages equally between host A, the B in this example, but has only a static address, and its excess-three is individual all to be dynamic address, sets shown in table 3A and 3B.
Table 3A, the path setting of example three host As
Passage |
The near-end address |
Remote address |
#1 |
Static address |
AVT#1 |
#2 |
TKT#2 |
AVT#2 |
Table 3B, the path setting of example three host Bs
Passage |
The near-end address |
Remote address |
#1 |
AVT#1 |
Static address |
#2 |
AVT#2 |
TKT#2 |
The flow process of example three as shown in Figure 4.At first, the system of host A, B starts in step 402 and 404 respectively.Then in step 406, A obtains dynamic address TKT#2.This moment, A did not learn the dynamic address of B as yet, can't notify B with TKT#2, can only wait for the notification message of B.In step 408, B obtains dynamic address AVT#1 and AVT#2, builds and puts passage #1, and passage #2 can't not build and put because B does not learn TKT#2 as yet.B sends to A with AVT#1 and AVT#2 then, and inquiry TKT#2.In step 410, A receives the dynamic address notification message of B, builds and puts passage #1 and #2, and reply and confirm that message and TKT#2 give B.Passage #1 is communicated with at this moment.In step 412, B receives affirmation message and the TKT#2 of A then, builds and puts passage #2.Passage #2 is communicated with at this moment.
Then in step 414, dynamic address TKT#2 changes at this moment, puts passage #2 so host A is built again, and sends TKT#2 to B.Step 416 is every the periodicity address of time T notice.B can send to A with own all dynamic address, and all dynamic address of inquiry A.In step 418, A receives the dynamic address notification message of B, because the address of B does not change, needn't build again and put passage.A sends and confirms that message and TKT#2 are to B then.In step 420, B receives new TKT#2, builds again and puts passage #2, and reply and confirm that message is to A.In step 422, A receives the affirmation message of B.In step 424, B receives affirmation message and the TKT#2 of A, because TKT#2 has not changed since step 420, puts passage so B needn't build again.
Following step 426, the dynamic address AVT#1 of B changes at this moment, puts passage #1 so B builds again, and sends AVT#1 to A.In step 428, A receives new AVT#1, builds again and puts passage #1, and send the affirmation message to B.In step 430, B receives the affirmation message of A.
Step 432 is the periodicity notices every time T then, and B can send to A with own all dynamic address, and all dynamic address of inquiry A.In step 434, A receives the dynamic address notification message of B, because the address of B does not change, needn't build again and put passage, only needs to send to confirm that message and TKT#2 are to B.In step 436, B receives affirmation message and the TKT#2 of A at last, also needn't build again and put passage.
The 4th example of the present invention below is described.This example uses a kind of dynamic address of safeguarding by intermediate server (being intermediate address hereinafter to be referred as this kind dynamic address) to build and puts passage.The main frame that has this intermediate address can be connected intermediate server when just startup has changed with intermediate address in system, to upgrade the record of intermediate address, so intermediate server all has correct intermediate address at any time.Other main frame is as long as can learn correct intermediate address to the intermediate server inquiry, in order to connect the main frame that uses intermediate address.Intermediate address can replace static address as reliable contact address, to keep passage unimpeded.
This example uses dynamic Domain Name System (DDNS:dynamic domain name system) to implement intermediate address, and therefore above-mentioned intermediate server is exactly the DDNS server, and intermediate address is just with the usefulness of its dynamic domain name as identification.The host A of this example, B set shown in table 4A and 4B, and foo.ddns.com wherein is exactly an intermediate address.
Table 4A, the path setting of example four host As
Passage |
The near-end address |
Remote address |
#1 |
foo.ddns.com |
AVT#1 |
#2 |
TKT#2 |
AVT#2 |
Table 4B, the path setting of example four host Bs
Passage |
The near-end address |
Remote address |
#1 |
AVT#1 |
foo.ddns.com |
#2 |
AVT#2 |
TKT#2 |
Fig. 5 is the flow chart of example four.At first, the system of host A, B starts in step 502 and 504 respectively.In step 506, host B is obtained dynamic address AVT#1 and AVT#2, and to DDNS server lookup foo.ddns.com, yet the inquiry failure.In step 508, host A is obtained dynamic address TKT#2, connects the DDNS server then to upgrade foo.ddns.com.After default blanking time (with before blanking time T can be different), B once more to DDNS server lookup foo.ddns.com, successfully obtains the corresponding address of foo.ddns.com in step 510.B builds and puts passage #1 then, connects foo.ddns.com with transmission address notification message, and the dynamic address TKT#2 of inquiry A.Then in step 512, A receives the dynamic address notification message of B, builds and puts passage #1 and #2, and passage #1 is communicated with at this moment, and A replys and confirms that message and TKT#2 give B then.Then in step 514, B receives affirmation message and the TKT#2 of A, builds and puts passage #2, and this moment, passage #2 was communicated with.
Step 516 afterwards is the periodicity notices every time T, and B can send to A with own all dynamic address, and inquiry TKT#2.In step 518, A receives the dynamic address notification message of B, because the address of B does not change, needn't build again and put passage, only needs to send to confirm that message and TKT#2 are to B.In step 520, B receives affirmation message and the TKT#2 of A, needn't reset passage.
Next in step 522, the address of foo.ddns.com changes at this moment, so A connects the DDNS server to upgrade the address of foo.ddns.com, builds again then and puts passage #1, and send new address to B.In step 524, B receives the new address of foo.ddns.com, builds again and puts passage #1, replys then and confirms that message is to A.In step 526, A receives the affirmation message of B.
Next in step 528, the address of foo.ddns.com changes once again, so A connects the DDNS server to upgrade the address of foo.ddns.com, builds again and puts passage #1, and send new address to B.In step 530, the dynamic address AVT#1 of host B changes at this moment, puts passage #1 so B builds again, and selects foo.ddns.com to send notification message.But because the address modification of foo.ddns.com, B connects the foo.ddns.com failure, thus B then connect TKT#2, with the notification message that sends AVT#1 to A.In step 532, B receives the new address of foo.ddns.com, builds again and puts passage #1, and reply and confirm message.In step 534, A receives new AVT#1, builds again and puts passage #1, and reply and confirm message.In step 536, B receives the affirmation message of A.In step 538, A receives the affirmation message of B.
Though example four uses the DDNS server, the present invention is not limited to the DDNS server, also can be with the other types intermediate server to implement intermediate address.
Below explanation please refer to Fig. 6 and Fig. 7, and Fig. 6 and Fig. 7 are the general flow chart of concluding gained according to above four examples.Fig. 6 is for sending the part of message, and Fig. 7 is for receiving the part of message.The present invention carries out identical method on the main frame at passage two ends, the flow process of Figure 6 and Figure 7 just, and wherein near-end main frame and distance host are relative.Host A, B with the front are example, and with the viewpoint of host A, host A is exactly the near-end main frame, and host B is a distance host.Otherwise with the viewpoint of B, host B is exactly the near-end main frame, and host A is a distance host.The near-end address of passage and remote address also have same relative definition.
The flow process of Fig. 6 and Fig. 7 adopts the viewpoint of near-end main frame, is set with at least one passage between near-end main frame and the distance host, and in above-mentioned passage, has at least a passage to use static address or intermediate address.
The flow process of explanation Fig. 6 at first starts host computer system in step 605 earlier.In step 610,, then obtain above-mentioned dynamic address then if dynamic address is contained in the near-end address of above-mentioned passage.In step 615,, then connect the intermediate server of corresponding above-mentioned intermediate address, to upgrade above-mentioned intermediate address if above-mentioned near-end address comprises intermediate address.
In step 620,, then inquire about the intermediate address that above-mentioned remote address comprises, just the employed intermediate address of distance host to intermediate server if learn that from the setting of passage the remote address of above-mentioned passage comprises intermediate address.This moment is if the failure of inquiry intermediate address then repeats inquiry every the spacer segment time, till successful inquiring.
Then in step 625, build and put the required near-end address of passage, it is complete no matter to be that static address, dynamic address or intermediate address are all gone up, thus the time build and put in the above-mentioned passage, its remote address is all known passages.Then in step 630, if the remote address of above-mentioned passage wherein has known person, be exactly that known certain address can supply the link man, and dynamic address is contained in above-mentioned near-end address, then send notification message to distance host, above-mentioned notification message comprises all dynamic address in the above-mentioned near-end address.In addition, if contain dynamic address in the remote address of above-mentioned passage, just distance host has dynamic address, just encloses the dynamic address inquiry in the notification message that sends, with the dynamic address of inquiry distance host.
Among step 630, a known address can supply to connect if distance host has not only, can select one in known remote address, and (round robin) selects for example in a looping fashion, connects distance host according to this and sends notification message.If connection failure can select next known address to reattempt connection in remote address.If failure just repeats above-mentioned selection again, till successfully connecting distance host.Use in turn a plurality of address like this, can realize fault-tolerant effect, and can guarantee that dynamic address can in time transmit.If the known whole connection failures of above-mentioned remote address, comprise intermediate address in the remote address of above-mentioned passage, just distance host has under the situation of using intermediate address, can inquire about up-to-date intermediate address to intermediate server, in order to connect distance host.
The near-end address whether next, change arranged step 640 inspection.If no, through (can be different from step 620 blanking time herein) after the preset interval time of step 635, flow process is got back to step 630.
Otherwise if the near-end address of change is arranged, flow process enters step 645, and whether what check change is intermediate address.If flow process enters step 650, connect intermediate server to upgrade the intermediate address that changes, enter step 655 then.If change is not intermediate address, is exactly general dynamic address, flow process meeting skips steps 650 directly enters step 655.
Next, build again in step 655 and to put in the above-mentioned passage, the near-end address has changed and remote address is all known passages.Then in step 660, if the remote address of above-mentioned passage wherein has known person, just have the known address can connect distance host, just send notification message to distance host, this notification message comprises the above-mentioned near-end address that has changed.If not only one of known remote address, available mode as step 630 is selected.If distance host has intermediate address, also can be as step 630, the inquiry intermediate address is to connect distance host.After step 660, flow process can be got back to step 640.
The reception message flow process of following key diagram 7.At first, the near-end main frame receives message in step 705 from distance host, judges the message kind in step 710 then.If notification message, flow process enters step 715, upgrades above-mentioned passage according to the remote address that comprises in the message, and sends corresponding affirmation message to distance host in step 720.In addition, if notification message contains the dynamic address inquiry, the near-end main frame can be enclosed all dynamic address of near-end main frame in the affirmation message that step 720 sends, to inform distance host.After step 720, flow process is got back to step 705, continues to receive message.
The dynamic address of additional near-end is just for distance host can be learnt as early as possible in its tangible affirmation message.The Periodic Notice message of step 630 is the same can inform distance host with the dynamic address of near-end main frame.If very do not take notice of timeliness, just need in confirming message, not add the dynamic address of near-end main frame.
If the message that receives in step 705 is the affirmation message, flow process can enter step 725 from step 710, checks and confirms whether message comprises additional remote address.If just upgrade above-mentioned passage according to additional remote address in step 730.After step 730, flow process is got back to step 705, continues to receive message.
More new tunnel details in step 715 and 730 is as follows.In the above-mentioned passage, if having passage in remote address that the near-end main frame write down for unknown, and corresponding remote address is arranged in the message that receives, then use the corresponding remote address of this message to build and put passage.In addition, in the above-mentioned passage, if the remote address that has passage to be write down at the near-end main frame is known, corresponding remote address is arranged in the message that receives, and above-mentioned two remote address differences, the expression remote address changes to some extent, then uses corresponding remote address in the message to build again and puts passage.
In sum, in internet protocol channel management method of the present invention, the main frame at passage two ends can regularly notify the other side present dynamic address, and whenever there being address modification all can notify the other side immediately, so both sides know that at any time correct address is to keep passage unimpeded.Moreover because have a static address in all passages at least, or an intermediate address of being safeguarded by intermediate server, no matter how other address changes, and no matter whether the main frame at passage two ends restarts, and having a reliable address at least can be for contact.So as long as all normal operations of main frame at passage two ends, it is unimpeded that all passages between the two can both keep eventually.
Though the present invention discloses as above with preferred embodiment; right its is not in order to limit the present invention; those skilled in the art can do some changes and retouching under the premise without departing from the spirit and scope of the present invention, so protection scope of the present invention is as the criterion with the application's claim.