The content of the invention
The present invention provides a kind of data transmission method and equipment based on DVPN, to transmit data by less path cost, and reduces the forward delay of data.
In order to achieve the above object, the embodiment of the present invention provides a kind of data transmission method based on Dynamic VPN network DVPN, applied in the network including multiple Spoke, safeguard there are neighbours' expense Cost tables on each Spoke, the Cost values between this equipment and neighbours Spoke are have recorded in the neighbours Cost tables, this method comprises the following steps:
Spoke sends the information that purpose Spoke is carried in expense request CostRequest messages, the CostRequest messages to neighbours Spoke;By the neighbours Spoke after the CostRequest messages are received, using neighbours' Cost tables of the information inquiry local maintenance of the purpose Spoke, the Cost values between this equipment and the purpose Spoke are obtained;
The Spoke receives the Cost values carried in the expense response CostResponse messages that neighbours Spoke is returned, the CostResponse messages between the neighbours Spoke and the purpose Spoke;
The Spoke compares Cost values and this equipment between this equipment and the purpose Spoke to the neighbours Spoke to the Cost values between the purpose Spoke, and when needing to send data to the purpose Spoke, data are sent to the purpose Spoke by the minimum path of Cost values.
Also include server in the network, the process of each Spoke maintenance of neighbor Cost tables further comprises:Each Spoke is received in the registration reply message from the server, the registration reply message during registration is initiated to the server and is carried life span ttl value N;
Each Spoke sends in keep-alive Keepalive messages, the Keepalive messages to the neighbours Spoke of this equipment and carries the ttl value N;
Each Spoke obtains the ttl value M carried in Keepalive messages, and determine that the Cost values between this equipment and neighbours Spoke are after the Keepalive messages from neighbours Spoke are received(N-M);
Each Spoke records the information and the Cost values of the neighbours Spoke in neighbours' Cost tables of local maintenance(N-M)Between corresponding relation.
The information of the purpose Spoke includes purpose Spoke public network address;The Spoke sends the process that expense asks CostRequest messages to neighbours Spoke, further comprises:
The Spoke sends the CostRequest messages for the public network address for carrying the purpose Spoke to neighbours Spoke when needing to send data to purpose Spoke.
The Spoke sends data by the minimum path of Cost values to the purpose Spoke, specifically includes:When the Spoke is the Spoke to neighbours Spoke to purpose Spoke in the minimum path of Cost values, first layer encapsulation is carried out to the data by the direct tunnel address between the Spoke and purpose Spoke, and the data after being encapsulated by the direct tunnel address between the Spoke and neighbours Spoke to first layer carry out second layer encapsulation, and data after the second layer is encapsulated are sent to the neighbours Spoke;
By the neighbours Spoke in the data after receiving second layer encapsulation, solution second layer encapsulation obtains the data after first layer encapsulation, and the data after first layer is encapsulated are sent to the purpose Spoke.
The Spoke sends data by the minimum path of Cost values to the purpose Spoke, specifically includes:When the Spoke is the Spoke to neighbours Spoke to purpose Spoke in the minimum path of Cost values, the data are packaged by the direct tunnel address between the Spoke and neighbours Spoke, and the public network address of the purpose Spoke is carried in the specific field of data after packaging, and the data after encapsulation are sent to the neighbours Spoke;
By the neighbours Spoke in the data after receiving encapsulation, if it find that the public network address carried in specific field is not the public network address of this equipment, the destination address of data after encapsulation is then revised as to the public network address carried in the specific field, and amended data are sent to the purpose Spoke.
The embodiment of the present invention provides a kind of data transmission set based on Dynamic VPN network DVPN, and as Spoke applied in the network for including multiple Spoke, the equipment includes:
Maintenance module, for maintenance of neighbor expense Cost tables, have recorded the Cost values between this equipment and neighbours Spoke in the neighbours Cost tables;
Message sending module, purpose Spoke information is carried for being sent to neighbours Spoke in expense request CostRequest messages, the CostRequest messages;By the neighbours Spoke after the CostRequest messages are received, using neighbours' Cost tables of the information inquiry local maintenance of the purpose Spoke, the Cost values between this equipment and the purpose Spoke are obtained;
Receiver module, the expense for receiving neighbours Spoke returns responds the Cost values carried in CostResponse messages, the CostResponse messages between the neighbours Spoke and purpose Spoke;
Comparison module, for comparing Cost values and this equipment between this equipment and the purpose Spoke to the neighbours Spoke to the Cost values between the purpose Spoke;
Data transmission blocks, for when needing to send data to the purpose Spoke, data to be sent to the purpose Spoke by the minimum path of Cost values.
Also include server in the network;The maintenance module, is further used for during registration is initiated to the server, receiving in the registration reply message from the server, and the registration reply message and carrying life span ttl value N;Sent to the neighbours Spoke of this equipment in keep-alive Keepalive messages, the Keepalive messages and carry the ttl value N;After the Keepalive messages from neighbours Spoke are received, the ttl value M carried in Keepalive messages is obtained, and determine that the Cost values between this equipment and neighbours Spoke are(N-M);The information and the Cost values of the neighbours Spoke is recorded in neighbours' Cost tables of local maintenance(N-M)Between corresponding relation.
The information of the purpose Spoke includes the public network address of the purpose Spoke;The message sending module, specifically for when needing to send data to purpose Spoke, the CostRequest messages for the public network address for carrying the purpose Spoke are sent to neighbours Spoke.
The data transmission blocks, when being further used in the minimum path of Cost values as this equipment to neighbours Spoke to purpose Spoke, first layer encapsulation is carried out to the data by the direct tunnel address between this equipment and purpose Spoke, and the data after being encapsulated by the direct tunnel address between this equipment and neighbours Spoke to first layer carry out second layer encapsulation, and data after the second layer is encapsulated are sent to the neighbours Spoke;By the neighbours Spoke in the data after receiving second layer encapsulation, solution second layer encapsulation obtains the data after first layer encapsulation, and the data after first layer is encapsulated are sent to the purpose Spoke.
The data transmission blocks, when being further used in the minimum path of Cost values as this equipment to neighbours Spoke to purpose Spoke, the data are packaged by the direct tunnel address between this equipment and neighbours Spoke, and the public network address of the purpose Spoke is carried in the specific field of data after packaging, and the data after encapsulation are sent to the neighbours Spoke;By the neighbours Spoke in the data after receiving encapsulation, if it find that the public network address carried in specific field is not the public network address of this equipment, the destination address of data after encapsulation is then revised as to the public network address carried in the specific field, and amended data are sent to the purpose Spoke.
Compared with prior art, the embodiment of the present invention at least has advantages below:In the embodiment of the present invention, it can determine the shortest path for forwarding data in DVPN between each Spoke, it is possible to which data are transmitted by shortest path, so as to transmit data with less path cost, and reduce the forward delay of data.
Embodiment
The embodiment of the present invention is described in detail below in conjunction with the accompanying drawings.
For problems of the prior art, the embodiment of the present invention proposes a kind of data transmission method based on DVPN, and this method can be applied in DVPN Full-Mesh networks;And in Full-Mesh networks, can at least include server(Server)With multiple Spoke(Include Hub and Spoke).
Safeguard there are the Cost values that have recorded in neighbours' Cost tables, and neighbours' Cost tables between this equipment and neighbours Spoke in the embodiment of the present invention, on each Spoke(Forward hop count or policy priority level etc.).Assuming that Full-Mesh networks include Spoke1, Spoke2 and Spoke3, then:The Cost values between Cost values, Spoke1 and the Spoke3 between Spoke1 and Spoke2 are recorded on Spoke1;The Cost values between Cost values, Spoke2 and the Spoke3 between Spoke2 and Spoke1 are recorded on Spoke2;The Cost values between Cost values, Spoke3 and the Spoke2 between Spoke3 and Spoke1 are recorded on Spoke3.
Specifically, for maintenance of neighbor Cost tables on each Spoke, then one kind is preferred embodiment:
Each Spoke receives the registration reply message from server during registration is initiated to server(Registerreplay messages), TTL is carried in the registration reply message(TimeToLive, life span)Value N;Ttl value N is the ttl value of Full-Mesh networks, and in the registration reply message transmitted by each Spoke of the server into the Full-Mesh networks, carries identical ttl value N.
Each Spoke is obtained from server after ttl value N, if each Spoke sets up Full-Mesh tunnel connection(Direct tunnels are set up between i.e. all Spoke), then each Spoke is to the neighbours Spoke transmissions Keepalive of this equipment(Keep-alive)Message(Keepalive messages can regularly be sent), and carry ttl value N in the IP heads of the Keepalive messages;For example, Spoke1 sends the Keepalive messages for carrying ttl value N to Spoke2, and the Keepalive messages for carrying ttl value N are sent to Spoke3;Spoke2 sends the Keepalive messages for carrying ttl value N to Spoke1, and the Keepalive messages for carrying ttl value N are sent to Spoke3;Spoke3 sends the Keepalive messages for carrying ttl value N to Spoke1, and the Keepalive messages for carrying ttl value N are sent to Spoke2.
Each Spoke obtains the ttl value M carried in Keepalive messages, and determine that the Cost values between this equipment and neighbours Spoke are after the Keepalive messages from neighbours Spoke are received(N-M);By taking the processing between Spoke1 and Spoke2 as an example, Spoke1 sends the Keepalive messages for carrying ttl value N by the direct tunnels between this equipment and Spoke2 to Spoke2, and Spoke2 sends the Keepalive messages for carrying ttl value N by the direct tunnels between this equipment and Spoke1 to Spoke1;Spoke1 obtains ttl value M, and determine that the Cost values between Spoke1 and Spoke2 are after the Keepalive messages from Spoke2 are received from the IP heads of Keepalive messages(N-M);Spoke2 obtains ttl value M, and determine that the Cost values between Spoke2 and Spoke1 are after the Keepalive messages from Spoke1 are received from the IP heads of Keepalive messages(N-M).
Each Spoke records neighbours Spoke information in the neighbours' Cost tables locally safeguarded(Such as neighbours Spoke public network address)With Cost values(N-M)Between corresponding relation.For example, on Spoke1 neighbours' Cost tables, Spoke2 public network address and Cost values will be recorded(N-M)Between corresponding relation, and record Spoke3 public network address and Cost values(N-M)Between corresponding relation;On Spoke2 neighbours' Cost tables, Spoke1 public network address and Cost values will be recorded(N-M)Between corresponding relation, and record Spoke3 public network address and Cost values(N-M)Between corresponding relation;On Spoke3 neighbours' Cost tables, Spoke1 public network address and Cost values will be recorded(N-M)Between corresponding relation, and record Spoke2 public network address and Cost values(N-M)Between corresponding relation.
In the embodiment of the present invention, due to being the processing for Full-Mesh networks, therefore Full-Mesh networks each Spoke handled in the manner described above after, neighbours Spoke information and Cost values can record in neighbours' Cost tables of local maintenance(N-M)Between corresponding relation.
Neighbours' Cost tables based on local maintenance, as shown in fig. 6, the data transmission method based on DVPN that the embodiment of the present invention is proposed may comprise steps of:
Step 601, Spoke is to neighbours Spoke(That is other neighbours Spoke outside purpose Spoke)Send CostRequest(Expense is asked)Purpose Spoke information is carried in message, the CostRequest messages;Purpose Spoke information includes but is not limited to purpose Spoke public network address.
In the embodiment of the present invention, Spoke sends the process of CostRequest messages to neighbours Spoke, further comprises:Spoke sends the CostRequest messages for the public network address for carrying purpose Spoke to neighbours Spoke when needing to send data to purpose Spoke;For example, Spoke1 sends the CostRequest messages for the public network address for carrying Spoke2 to neighbours Spoke when needing to send data to Spoke2;Or, Spoke clocked flips send the CostRequest messages for the public network address for carrying purpose Spoke to neighbours Spoke;For example, Spoke1 clocked flips send the CostRequest messages for the public network address for carrying Spoke2 to neighbours Spoke and carry the CostRequest messages of Spoke3 public network address.
Using Fig. 7 as the application scenarios schematic diagram of the embodiment of the present invention, then for Spoke1, when there is data to need to be transmitted to Spoke2 by Spoke1, the Spoke1 is needed to all neighbours Spoke(That is Spoke3, SpokeN and Hub)Send CostRequest messages;Wherein, Spoke2 public network address is carried in the CostRequest messages, and the CostRequest messages are used to make each neighbours Spoke inquire about the Cost values that this equipment reaches Spoke2 direct tunnels.
Step 602, neighbours Spoke, using neighbours' Cost tables of purpose Spoke information inquiry local maintenance, obtains the Cost values between this equipment and purpose Spoke after CostRequest messages are received.
Specifically, information and Cost values due to have recorded neighbours Spoke in neighbours' Cost tables of neighbours' Spoke local maintenances(N-M)Between corresponding relation, therefore neighbours Spoke is after CostRequest messages are received, can be directly using purpose Spoke information inquiry to the corresponding Cost values of purpose Spoke, the corresponding Cost values of purpose Spoke are the Cost values between this equipment and purpose Spoke.
Step 603, neighbours Spoke returns to CostResponse to Spoke(Expense is responded)The Cost values between neighbours Spoke and purpose Spoke are carried in message, the CostResponse messages.
Step 604, Spoke is after CostResponse messages are received, compare Cost values and this equipment between this equipment and purpose Spoke to neighbours Spoke to the Cost values between purpose Spoke, and when needing to send data to purpose Spoke, data are sent to purpose Spoke by the minimum path of Cost values.
As shown in fig. 7, Spoke1 is to all neighbours Spoke(That is Spoke3, SpokeN and Hub)Send after CostRequest messages, the CostResponse messages from all neighbours Spoke can be received;Cost values 2 are carried in CostResponse messages from Spoke3(That is the Cost values between Spoke3 and Spoke2 are 2);Cost values 5 are carried in CostResponse messages from SpokeN(That is the Cost values between SpokeN and Spoke2 are 5);Cost values 4 are carried in CostResponse messages from Hub(That is the Cost values between Hub and Spoke2 are 4).
Based on above-mentioned neighbours Spoke to the Spoke CostResponse messages returned and neighbours' Cost tables of Spoke local maintenances, Spoke1 can be known:Cost values between Spoke1 and Spoke2 be 8, Spoke1 to Spoke3 to the Cost values between Spoke2 be 4(2+2), Spoke1 to SpokeN to the Cost values between Spoke2 is 7(2+5), Spoke1 to Hub to the Cost values between Spoke2 is 6(2+4);By comparing Cost values and this equipment between this equipment and purpose Spoke to neighbours Spoke to the Cost values between purpose Spoke, the minimum path of Cost values is Spoke1 to Spoke3 to Spoke2, therefore Spoke1 can pass through the minimum path of Cost values when needing to send data to Spoke2:Spoke1 to Spoke3 to Spoke2 path sends data to purpose Spoke.
In summary, the embodiment of the present invention can optimize tunnel forward-path, and reduce forwarding delay.For example, Spoke1 to Spoke3 to Spoke2 Cost values are 4, it is shortest path;Now PC1 can be sent to PC2 data and is switched to from direct tunnels on Spoke1 to Spoke3 to Spoke2 tunnel by Spoke1 is forwarded, due to reducing the hop count of forward-path, so as to reduce forward delay.
In the embodiment of the present invention, Spoke is before the CostResponse messages that neighbours Spoke is returned to Spoke are received, if Spoke needs to send data to purpose Spoke, Spoke directly can forward data by the direct tunnels between Spoke and purpose Spoke;Or, Spoke can also forward data by Spoke to Hub to the path between purpose Spoke.
In the embodiment of the present invention, by way of Spoke sends data the minimum path of Cost values to purpose Spoke, following manner is specifically including but not limited to:
When mode one, Spoke are Spoke to neighbours Spoke to purpose Spoke in the minimum path of Cost values, first layer encapsulation is carried out to data by the direct tunnel address between Spoke and purpose Spoke, and the data after being encapsulated by the direct tunnel address between Spoke and neighbours Spoke to first layer carry out second layer encapsulation, and data after the second layer is encapsulated are sent to neighbours Spoke;Further, neighbours Spoke can solve second layer encapsulation in the data after receiving second layer encapsulation, to obtain the data after first layer encapsulation, and the data after first layer is encapsulated are sent to purpose Spoke.
As shown in fig. 7, Spoke1 by the direct tunnel address between Spoke1 and Spoke2 to data(PC1 is sent to PC2 data)First layer encapsulation is carried out, but is not sent, and the data after being encapsulated by the direct tunnel address between Spoke1 and Spoke3 to first layer carry out second layer encapsulation, and the data after the second layer is encapsulated are sent to Spoke3;Spoke3 takes off second layer encapsulation in the data after receiving second layer encapsulation, is reduced to the data after the first layer encapsulation that is packaged by the direct tunnel address between Spoke1 and Spoke2, and the data after first layer is encapsulated are sent to Spoke2.
When mode two, Spoke are Spoke to neighbours Spoke to purpose Spoke in the minimum path of Cost values, data are packaged by the direct tunnel address between Spoke and neighbours Spoke, and purpose Spoke public network address is carried in the specific field of data after packaging, and the data after encapsulation are sent to neighbours Spoke;By neighbours Spoke in the data after receiving encapsulation, if it find that the public network address carried in specific field is not the public network address of this equipment, the destination address of data after encapsulation is then revised as to the public network address carried in specific field, and amended data are sent to purpose Spoke.
As shown in fig. 7, Spoke1 by the direct tunnel address between Spoke1 and Spoke3 to data(PC1 is sent to PC2 data)It is packaged, the specific field of data after packaging(Such as proprietary protocol heading)Middle carrying Spoke2 public network address, and the data after encapsulation are sent to Spoke3;Spoke3 is in the data after receiving encapsulation, if it find that the public network address carried in proprietary protocol heading is not the public network address of this equipment, the then source address of retention data, the public network address that the destination address of data after encapsulation is revised as carrying in proprietary protocol heading, and amended data are sent to Spoke2.
Based on the inventive concept same with the above method, the embodiment of the present invention also proposed a kind of data transmission set based on Dynamic VPN network DVPN, as Spoke applied in the network for including multiple Spoke, as shown in figure 8, the equipment(That is Spoke)Including:
Maintenance module 11, for maintenance of neighbor expense Cost tables, have recorded the Cost values between this equipment and neighbours Spoke in the neighbours Cost tables;
Message sending module 12, purpose Spoke information is carried for being sent to neighbours Spoke in expense request CostRequest messages, the CostRequest messages;By the neighbours Spoke after the CostRequest messages are received, using neighbours' Cost tables of the information inquiry local maintenance of the purpose Spoke, the Cost values between this equipment and the purpose Spoke are obtained;
Receiver module 13, the expense for receiving neighbours Spoke returns responds the Cost values carried in CostResponse messages, the CostResponse messages between neighbours Spoke and purpose Spoke;
Comparison module 14, for comparing Cost values and this equipment between this equipment and the purpose Spoke to the neighbours Spoke to the Cost values between the purpose Spoke;
Data transmission blocks 15, for when needing to send data to the purpose Spoke, data to be sent to the purpose Spoke by the minimum path of Cost values.
Also include server in the network;The maintenance module 11, is further used for during registration is initiated to the server, receiving in the registration reply message from the server, and the registration reply message and carrying life span ttl value N;Sent to the neighbours Spoke of this equipment in keep-alive Keepalive messages, the Keepalive messages and carry the ttl value N;After the Keepalive messages from neighbours Spoke are received, the ttl value M carried in Keepalive messages is obtained, and determine that the Cost values between this equipment and neighbours Spoke are(N-M);The information and the Cost values of the neighbours Spoke is recorded in neighbours' Cost tables of local maintenance(N-M)Between corresponding relation.
The information of the purpose Spoke includes the public network address of the purpose Spoke;The message sending module 12, specifically for when needing to send data to purpose Spoke, the CostRequest messages for the public network address for carrying the purpose Spoke are sent to neighbours Spoke.
The data transmission blocks 15, when being further used in the minimum path of Cost values as this equipment to neighbours Spoke to purpose Spoke, first layer encapsulation is carried out to the data by the direct tunnel address between this equipment and purpose Spoke, and the data after being encapsulated by the direct tunnel address between this equipment and neighbours Spoke to first layer carry out second layer encapsulation, and data after the second layer is encapsulated are sent to the neighbours Spoke;By the neighbours Spoke in the data after receiving second layer encapsulation, solution second layer encapsulation obtains the data after first layer encapsulation, and the data after first layer is encapsulated are sent to the purpose Spoke.
The data transmission blocks 15, when being further used in the minimum path of Cost values as this equipment to neighbours Spoke to purpose Spoke, the data are packaged by the direct tunnel address between this equipment and neighbours Spoke, and the public network address of the purpose Spoke is carried in the specific field of data after packaging, and the data after encapsulation are sent to the neighbours Spoke;By the neighbours Spoke in the data after receiving encapsulation, if it find that the public network address carried in specific field is not the public network address of this equipment, the destination address of data after encapsulation is then revised as to the public network address carried in the specific field, and amended data are sent to the purpose Spoke.
Wherein, the modules of apparatus of the present invention can be integrated in one, and can also be deployed separately.Above-mentioned module can merge into a module, can also be further split into multiple submodule.
Through the above description of the embodiments, those skilled in the art can be understood that the present invention can be realized by hardware, the mode of necessary general hardware platform can also be added to realize by software.Understood based on such, technical scheme can be embodied in the form of software product, and the software product can be stored in a non-volatile memory medium(Can be CD-ROM, USB flash disk, mobile hard disk etc.)In, including some instructions are to cause a computer equipment(Can be personal computer, server, or network equipment etc.)Perform the method described in each embodiment of the invention.
It will be appreciated by those skilled in the art that accompanying drawing is the schematic diagram of a preferred embodiment, the module or flow in accompanying drawing are not necessarily implemented necessary to the present invention.
It will be appreciated by those skilled in the art that the module in device in embodiment can carry out being distributed in the device of embodiment according to embodiment description, respective change can also be carried out and be disposed other than in one or more devices of the present embodiment.The module of above-described embodiment can merge into a module, can also be further split into multiple submodule.
The invention described above sequence number is for illustration only, and the quality of embodiment is not represented.
Disclosed above is only several specific embodiments of the present invention, and still, the present invention is not limited to this, and the changes that any person skilled in the art can think of should all fall into protection scope of the present invention.