CN107547672B - Router switching method and device - Google Patents

Router switching method and device Download PDF

Info

Publication number
CN107547672B
CN107547672B CN201710324121.5A CN201710324121A CN107547672B CN 107547672 B CN107547672 B CN 107547672B CN 201710324121 A CN201710324121 A CN 201710324121A CN 107547672 B CN107547672 B CN 107547672B
Authority
CN
China
Prior art keywords
aftr
message
afrr
host
information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201710324121.5A
Other languages
Chinese (zh)
Other versions
CN107547672A (en
Inventor
郭威
王伟
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou H3C Technologies Co Ltd
Original Assignee
Hangzhou H3C Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hangzhou H3C Technologies Co Ltd filed Critical Hangzhou H3C Technologies Co Ltd
Priority to CN201710324121.5A priority Critical patent/CN107547672B/en
Publication of CN107547672A publication Critical patent/CN107547672A/en
Application granted granted Critical
Publication of CN107547672B publication Critical patent/CN107547672B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The disclosure relates to a router switching method and a device, which are applied to an AFTR (address translation router). The method comprises the following steps: the first AFTR receives a first message from the second AFTR, the second AFTR and the first AFTR belong to the same broadcast domain, the first message comprises conversion address information allocated by the second AFTR and first host information hung under the second AFTR, and the first AFTR processes the received second message according to the conversion address information carried in the first message and the first host information under the condition that the second AFTR is judged to be invalid. According to the router switching method and device, when the first AFTR replaces the second AFTR to perform routing and NAT conversion, new conversion address information does not need to be allocated to the first AFTR, and the conversion address information allocated by the second AFTR is directly used, so that connection interruption and protocol reestablishment are not needed between the user side and the public network side, time for connection interruption and protocol reestablishment can be saved, and user experience is improved.

Description

Router switching method and device
Technical Field
The present disclosure relates to the field of network technologies, and in particular, to a method and an apparatus for switching a router.
Background
The DS-Lite (Dual Stack Lite, lightweight Dual Stack) technology combines the IPv4over IPv6 tunneling technology and the NAT (Network Address Translation) technology. The method is characterized in that a tunnel technology is utilized to realize the connection of an isolated IPv4(Internet Protocol Version 4, 4 th edition) network through an IPv6(Internet Protocol Version 6, 6 th edition) network, and NAT technology is utilized to realize that different user networks share the same IPv4 address space and slow down the exhaustion speed of IPv4 addresses. Fig. 1 shows a schematic diagram of a DS-Lite networking map in the related art. As shown in fig. 1, the DS-Lite networking may include a DS-Lite tunnel, B4(Basic Bridging Broad Band) devices, and an afrr (Address Family translation Router). The DS-Lite tunnel is an IPv4over IPv6 tunnel between the B4 device and the AFTR, and is used for realizing the transmission of the IPv4 message across the IPv6 network.
The B4 device is a device located on the user network side for connecting to the ISP (Internet Service Provider) network side, and is typically a gateway device on the user network side. Some hosts on the user network side may also be connected directly to the ISP network side as B4 devices, such hosts being called DS-Lite hosts. The B4 device is used as an end point of the DS-Lite tunnel and is responsible for encapsulating the IPv4 message of the user network side into an IPv6 message and then sending the IPv6 message to the other end AFTR of the DS-Lite tunnel, and meanwhile, decapsulating the IPv6 message returned by the AFTR received from the DS-Lite tunnel into an IPv4 message and sending the IPv4 message to the user network side.
The AFTR is a device on the ISP network side, and can be used as the other end point of the DS-Lite tunnel and a NAT gateway device. After receiving the IPv6 message sent by the B4 device from the DS-Lite Tunnel, the AFTR allocates a Tunnel ID (Tunnel identifier) to the B4 device, and records a correspondence between an IPv6 address (source IPv6 address in the message) of the B4 device and the Tunnel ID. AFTR decapsulates the IPv6 message, converts the decapsulated source IPv4 address (private network address) of the user network side into a corresponding public network address, and sends the converted message to the destination IPv4 host. And when AFTR performs NAT conversion, simultaneously recording the NAT mapping relation and the Tunnel ID so as to realize that the source IPv4 addresses of the user network sides connected with different B4 devices can be overlapped. After receiving the response message returned by the destination IPv4 host, the afrr converts the destination IPv4 address (public network address) of the response message into a corresponding private network address, and acquires the IPv6 address of the corresponding B4 device according to the recorded Tunnel ID, as the destination address of the encapsulated IPv6 message. And the AFTR encapsulates the message converted by the NAT into an IPv6 message and then sends the IPv6 message to the B4 equipment through the DS-Lite tunnel.
Fig. 2 is a flowchart showing a message forwarding process in a DS-Lite networking diagram in the related art. The key steps of the message forwarding process comprise: the B4 equipment and AFTR carry out package and decapsulation on the message, and AFTR carries out NAT conversion on the IPv4 message. As shown in fig. 2, in the case that the user network side adopts an independent gateway device as the B4 device, the message forwarding process is as follows: the B4 equipment encapsulates an IPv4 message { IPv4 dst:30.1.1.1, IPv4 src:10.0.0.1, TCP dst:80, TCP src:10000} of a user network side into an IPv6 message { IPv6 dst:2: 1, IPv6 src:1, IPv4 dst:30.1.1.1, IPv4 src:10.0.0.1, TCP dst:80, TCP src:10000} and sends the message to AFTR through a DS-Lite tunnel. AFTR decapsulates IPv6 messages { IPv6 dst:2: 1, IPv6 src:1, IPv4 dst:30.1.1.1, IPv4 src:10.0.0.1, TCP dst:80 and TCP src:10000} and then carries out NAT conversion to obtain IPv4 messages { IPv4 dst:30.1.1.1, IPv4 src:20.1.1.1, TCP dst:80 and TCP src:5000}, and sends IPv4 messages { IPv4 dst:30.1.1.1, IPv4 src:20.1.1.1, TCP dst:80 and TCP src:5000} to a target IPv4 host. AFTR receives IPv4 messages { IPv4 dst:20.1.1.1, IPv4 src:30.1.1.1, TCP dst:5000 and TCP src:80} returned by a target IPv4 host, performs NAT conversion, encapsulates the IPv4 messages { IPv6 dst:1, IPv6 src:2: 1, IPv4 dst:10.0.0.1, IPv4 src:30.1.1.1, TCP dst:10000 and TCP src:80} into IPv6 messages, and sends the IPv 8532 messages to B4 equipment through a DS-Lite tunnel. The B4 equipment decapsulates an IPv6 message { IPv6 dst:1, IPv6 src:2: 1, IPv4 dst:10.0.0.1, IPv4 src:30.1.1.1, TCP dst:10000, TCP src:80} to obtain an IPv4 message { IPv4 dst:10.0.0.1, IPv4 src:30.1.1.1, TCP dst:10000, TCP src:80}, and sends an IPv4 message { IPv4 dst:10.0.0.1, IPv4 src:30.1.1.1, TCP dst:10000, TCP src:80} to a host on the user network side.
Fig. 3 shows another flowchart of a message forwarding process in a DS-Lite networking diagram in the related art. For convenience of description, the flow from left to right will be referred to as forward flow and the flow from right to left will be referred to as reverse flow. As shown in fig. 3, during the forward flow, a mapping table is formed on the afrr, and the mapping table can reflect the correspondence between the B4 device and the afrr. For example, in the case that AFTR is AFTR1, the address 1::1 representing the B4 device (B4-2) and the Tunnel ID (e.g., Tunnel 0) corresponding to address 2::2 representing AFTR1 are grouped into a set of mappings. In the Public network direction (Public network), AFTR1 performs NAT translation. The source address { src add:1.1.1.1} and the source port number { src port:1024} in the source IPv4 address of the user network side are converted into { src add:3.3.3.1} and { src port:2000} through NAT translation of AFTR 1. AFTR1 sends the message to the destination IPv4 host (IPv 4 host2 in FIG. 3), and the destination address of the data returned by the destination IPv4 host is { dst add:3.3.3.1} and the destination port number is { dst port:2000 }. After receiving the message, AFTR1 finds a packet for Tunnel 0 in the mapping table according to destination address { dstadd: 3.3.3.1} and destination port number { dstport: 2000}, and then forwards the packet to B4 device after adding IPV6 header, and the B4 device forwards the packet to the host on the user network side (IPV 4 host1 in fig. 3).
In the related art, when the destination IPv4 host on the public network side migrates to other AFTRs, the destination IPv4 host on the public network side accesses the B4 side device and needs to use the newly allocated port number and address. These newly allocated port numbers and addresses may be difficult to Control to be the same as the original port numbers and addresses due to the limitation of DS-Lite networking or other reasons, which may cause the interruption of the established TCP (Transmission Control Protocol) connection. As shown in fig. 3, if the destination IPv4 host migrates to afrr 2 during the access process, the B4 device reassigns the afrr of the destination IPv4 host to afrr 2. AFTR2 needs to do NAT translation again, so that the translated port number changes, which may not be src port:2000, but src port:2001, used before. The destination IPv4 host needs to re-establish a TCP connection with port number src port:2001, e.g., establish a TCP connection between src port:53 and dst port: 2001. In addition, the destination address may be changed due to the limitation of the network, for example, the destination address is changed from { dstadd: 3.3.3.1} to { dstadd: 4.4.4.1 }.
Disclosure of Invention
In view of this, the present disclosure provides a method and an apparatus for switching a router, so as to solve the problem of how to determine the converted address information of a new AFTR when the AFTR is replaced.
According to a first aspect of the present disclosure, there is provided a method for switching a router, the method being applied to a first network address translation router, afrr, the method including:
a first AFTR receives a first message from a second AFTR, wherein the second AFTR and the first AFTR belong to the same broadcast domain, and the first message comprises the conversion address information allocated by the second AFTR and the first host information hung down by the second AFTR;
and under the condition that the first AFTR judges that the second AFTR is invalid, processing the received second message according to the conversion address information carried in the first message and the first host information.
According to a second aspect of the present disclosure, there is provided a switching apparatus of a router, the apparatus being applied to a first network address translation router, afrr, the apparatus including:
a receiving module, configured to receive, by a first afrr, a first message from a second afrr, where the second afrr and the first afrr belong to a same broadcast domain, and the first message includes information of a switch address allocated by the second afrr and information of a first host suspended by the second afrr;
and the processing module is used for processing the received second message according to the conversion address information carried in the first message and the first host information under the condition that the first AFTR judges that the second AFTR is invalid.
The router switching method and device are applied to an AFTR (address translation Router). The first AFTR receives a first message from the second AFTR through the first AFTR, and the first AFTR processes the received second message according to the conversion address information allocated to the second AFTR carried in the first message and the first host information hung under the second AFTR under the condition of judging that the second AFTR is invalid, so that when the first AFTR replaces the second AFTR for routing and NAT conversion, new conversion address information does not need to be allocated to the first AFTR, and the conversion address information allocated to the second AFTR is directly used, so that the connection between a user side and a public network side does not need to be interrupted and the protocol is reestablished, the time for interrupting the connection and reestablishing the protocol can be saved, and the use experience of the user is improved.
Other features and aspects of the present disclosure will become apparent from the following detailed description of exemplary embodiments, which proceeds with reference to the accompanying drawings.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate exemplary embodiments, features, and aspects of the disclosure and, together with the description, serve to explain the principles of the disclosure.
Fig. 1 shows a schematic diagram of a DS-Lite networking map in the related art.
Fig. 2 is a flowchart showing a message forwarding process in a DS-Lite networking diagram in the related art.
Fig. 3 shows another flowchart of a message forwarding process in a DS-Lite networking diagram in the related art.
Fig. 4 is a flow chart illustrating a method of switching a router according to an example embodiment.
Fig. 5 is a schematic diagram illustrating a DS-Lite networking map in accordance with an example embodiment.
Fig. 6 is a flow chart illustrating a method of switching a router according to an example embodiment.
Fig. 7 is a flowchart illustrating a method of switching a router according to an example embodiment.
Fig. 8 is a flowchart illustrating a method of switching a router according to an example embodiment.
Fig. 9 is a block diagram illustrating a switching device of a router according to an example embodiment.
Fig. 10 is a block diagram illustrating a switching device of a router according to an example embodiment.
Detailed Description
Various exemplary embodiments, features and aspects of the present disclosure will be described in detail below with reference to the accompanying drawings. In the drawings, like reference numbers can indicate functionally identical or similar elements. While the various aspects of the embodiments are presented in drawings, the drawings are not necessarily drawn to scale unless specifically indicated.
The word "exemplary" is used exclusively herein to mean "serving as an example, embodiment, or illustration. Any embodiment described herein as "exemplary" is not necessarily to be construed as preferred or advantageous over other embodiments.
Furthermore, in the following detailed description, numerous specific details are set forth in order to provide a better understanding of the present disclosure. It will be understood by those skilled in the art that the present disclosure may be practiced without some of these specific details. In some instances, methods, means, elements and circuits that are well known to those skilled in the art have not been described in detail so as not to obscure the present disclosure.
Example 1
Fig. 4 is a flow chart illustrating a method of switching a router according to an example embodiment. The method is applied to the network address translation router, and the embodiment does not limit this. As shown in fig. 4, the method for switching the router includes the following steps.
In step S401, the first afrr receives a first message from a second afrr, where the second afrr and the first afrr belong to the same broadcast domain, and the first message includes the information of the translation address allocated by the second afrr and the information of the first host hung by the second afrr.
As an application scenario of this embodiment, the first host may be a host on a public network side, and the second host may be a host on a user side. In the process of message transmission between the first host and the second host, the second afrr may be used for routing and NAT conversion, and the first afrr is used as a backup of the second afrr. And the first AFTR replaces the second AFTR to perform routing and NAT conversion under the condition that the second AFTR is judged to be invalid. Wherein the first AFTR and the second AFTR belong to the same broadcast domain.
It should be noted that the present embodiment is not limited to the state of the first AFTR, as would be understood by one skilled in the art. For example, a first AFTR can be an idle AFTR with routing and NAT translation in place of a second AFTR. For another example, the first afrr may also be an afrr in a working state, and performs routing and NAT conversion in the process of message transmission between the host on the other user side and the host on the public network side.
In one possible implementation, the first and second afrrs may be connected to the same switch, respectively, to enable the first and second afrrs to belong to the same broadcast domain.
It should be noted that the number of the AFTRs belonging to the same broadcast domain is not limited in this embodiment, and may be two or more, for example. In the case that the number of the AFTRs belonging to the same broadcast domain is greater than two, the first and second AFTRs generally refer to two different ones of the AFTRs belonging to the same broadcast domain, which is not limited in this embodiment.
In a possible implementation manner, the assigned translation address information may include the assigned translation address, or include the assigned translation port number, or include the assigned translation address and the assigned translation port number, which is not limited in this embodiment.
Fig. 5 is a schematic diagram illustrating a DS-Lite networking map in accordance with an example embodiment. As shown in fig. 5, B4 device owns the routing of the addresses of both afr 1 and afr 2 tunnels, and IPv4 host2 has a host routing of 3.3.3.3 in afrr 1 before afrr 1. In one possible implementation, a network administrator can specify binding relationships on AFTR1 and AFTR2 in advance. For example, address 2 on migrator AFTR2 specifies migrator AFTR 1: :2, the address 2::1 on the migrating AFTR2 designating the migrating AFTR 2.
As shown in fig. 5, afrr 2 is the first afrr and afrr 1 is the second afrr. IPv4 host1 is the host on the user side, and IPv4 host2 is the host on the public network side. In the process of message transmission between IPv4 host1 and IPv4 host2, AFTR1 is used for routing and NAT conversion, and AFTR2 is used as backup of AFTR 1. Wherein, afr 1 and afr 2 may be connected to the same switch respectively to realize that afr 1 and afr 2 belong to the same broadcast domain. The assigned translation address information of AFTR1 may include the assigned translation address 3.3.3.3 of AFTR1 and the assigned translation port number 2000 of AFTR 1.
In a possible implementation manner, in the process of message transmission between the first host and the second host, the second afrr may send the first message to the first afrr when performing routing and NAT translation for the first time.
As an example of the implementation manner, as shown in fig. 5, in the process of message transmission between IPv4 host1 and IPv4 host2, AFTR1 may send a first message to AFTR2 when routing and NAT conversion are performed for the first time, and AFTR2 receives and stores the first message from AFTR 1. The first message includes the translation address 3.3.3.3 assigned by afrr 1 and the translation port number 2000 assigned by afrr 1.
In a possible implementation manner, in the process of message transmission between the first host and the second host, the second afrr may send the first message to the first afrr every time routing and NAT translation is performed.
As an example of this implementation, as shown in fig. 5, in the process of performing message transmission between IPv4 host1 and IPv4 host2, AFTR1 may send a first message to AFTR2 every time routing and NAT conversion is performed, and AFTR2 receives the first message from AFTR1 and covers the last received first message from AFTR 1. The first message includes the translation address 3.3.3.3 assigned by afrr 1 and the translation port number 2000 assigned by afrr 1.
It should be noted that, as those skilled in the art can understand, the format of the first message is not limited in the embodiment. For example, the first packet may be an IPv4 packet or an IPv6 packet, etc. The embodiment also does not limit the generation manner of the first packet.
In a possible implementation manner, the first message may be generated according to a message obtained by performing NAT conversion on a received message from the B4 device by the afrr 1.
As an example of the implementation manner, as shown in fig. 5, the AFTR1 performs NAT conversion on a received message from a B4 device to obtain { dstadd: 3.3.3.3, src add:3.3.3.1, src port:2000, dstport: 53}, so that the first message may be an IPv4 message { dstadd: 3.3.3.3, src add:3.3.3.1, src port:2000, dst port:53}, and the first message may also be an IPv6 message { IPv6 dst:2: 1, IPv6 src:2, dst add:3.3.3, src add:3.3.3.1, src port:2000, dst port:53 }.
In one possible implementation, the first packet may be generated according to a packet received by afrr 1 from IPv4 host 2.
As an example of the implementation manner, as shown in FIG. 5, the messages received by AFTR1 from IPv4 host2 are { dstadd: 3.3.3.1, src add:3.3.3.3, dstport: 2000, src port:53}, the first message may be IPv4 message { dstadd: 3.3.3.1, src add:3.3.3, dstport: 2000, src port:53}, and the first message may also be IPv6 message { IPv6 dst:2::1, IPv6 src:2::2, dst add:3.3.3.1, src add:3.3.3, dst: 2000, src port:53 }.
In step S402, the first afrr processes the received second packet according to the translation address information carried in the first packet and the first host information when determining that the second afrr is invalid.
The second afrr failure may mean that the second afrr cannot perform routing and NAT conversion during the process of message transmission between the first host and the second host. It should be noted that, as will be understood by those skilled in the art, there are various situations in the related art that may cause the second afrr to fail, such as aging or failure of the second afrr, and the present embodiment is not limited thereto.
In a possible implementation manner, the second message may be a message from the user side. For example, in the case that the DS-Lite networking employs a B4 device, the second message may be a message from a B4 device. For another example, in the case that the DS-Lite networking employs a DS-Lite host, the second message may be a message from the DS-Lite host.
As an example of this implementation, as shown in fig. 5, afrr 2 is a first afrr and afrr 1 is a second afrr. And under the condition that AFTR2 judges that AFTR1 is invalid, processing the received second message according to the converted address information carried in the first message and the first host information. In other words, AFTR2 processes the received message from the B4 device according to AFTR1 assigned switch address 3.3.3.3 and AFTR1 assigned switch port number 2000. For example, AFTR2 receives messages { IPv6 dst:2::1, IPv6 src:1::1, dst add:3.3.3, src add:1.1.1.1, src port:1024, dst port:53} from B4 device, and when NAT conversion is performed, using the conversion address information allocated by AFTR1, the messages { dst add:3.3.3.3, src add:3.3.3.1, src port:2000, dst port:53} can be obtained. Therefore, when IPv4 host2 accesses IPv4 host1, it still uses the translation address information allocated by AFTR1, and does not need to interrupt the connection and reestablish the protocol due to switching port numbers or IP addresses.
According to the router switching method, when the first AFTR replaces the second AFTR for routing and NAT conversion, new conversion address information does not need to be allocated to the first AFTR, and the conversion address information allocated by the second AFTR is directly used, so that connection interruption and protocol reestablishment are not needed between the user side and the public network side, for a scene capable of fast migration, the time for connection interruption and protocol reestablishment can be greatly shortened, and the use experience of a user is improved.
In one possible implementation, the method further includes: and the first AFTR sends a third message to the second AFTR, wherein the third message carries the conversion address information allocated by the first AFTR and the information of a third host hung under the first AFTR.
It should be noted that, in the case where the first and second AFTRs operate simultaneously, it is necessary to assign different translation addresses and translation port numbers to the first and second AFTRs, respectively, so that no conflict occurs between the first and second AFTRs.
Further, in case the first afrr fails, the second afrr may replace the first afrr for routing and NAT translation. For example, the second afrr performs mapping conversion by using the conversion address and the conversion port number allocated by the first afrr, so that the connection between the user side and the public network side does not need to be interrupted and the protocol is reestablished, the time for interrupting the connection and reestablishing the protocol can be saved, and the use experience of the user is improved.
In the method for switching the router of this embodiment, the first and second AFTRs are mutually standby, so that the second AFTR replaces the first AFTR to perform routing and NAT conversion when the first AFTR fails, and the first AFTR replaces the second AFTR to perform routing and NAT conversion when the second AFTR fails, thereby improving the stability of a network environment and improving the user experience.
Fig. 6 is a flow chart illustrating a method of switching a router according to an example embodiment. As shown in fig. 6, the method for switching a router includes the following steps.
In step S601, the first afrr receives a first message from a second afrr, where the second afrr and the first afrr belong to the same broadcast domain, and the first message includes the information of the translation address allocated by the second afrr and the information of the first host hung by the second afrr.
The description of this step can be found in step S401.
In step S602, the first afrr determines that the second afrr is invalid when the first afrr does not receive the first message from the second afrr for the first duration.
As an example of this embodiment, in the process of message transmission between the first host and the second host, the second afrr may send the first message to the first afrr every second time interval. And if the first AFTR does not receive the first message sent by the second AFTR for the first time, judging that the second AFTR is invalid. And the time length of the first time length is greater than that of the second time length. For example, in the case where the second period of time is 3s, the first period of time may be 5 s.
As an example of this embodiment, in the process of message transmission between the first host and the second host, the first message may be sent to the first afrr each time the second afrr is used for routing and NAT conversion. And if the first AFTR does not receive the first message sent by the second AFTR for the first time, judging that the second AFTR is invalid. The first duration may be a preset value. For example, the time length of the first duration may be longer than the time length of two adjacent times of routing and NAT translation using the second afrr.
In step S603, the first afrr processes the received second packet according to the translation address information carried in the first packet and the first host information when determining that the second afrr is invalid.
The description of this step can be found in step S402.
Fig. 7 is a flowchart illustrating a method of switching a router according to an example embodiment. As shown in fig. 7, the method for switching a router includes the following steps.
In step S701, the first afrr receives a first message from a second afrr, where the second afrr and the first afrr belong to the same broadcast domain, and the first message includes the information of the translation address allocated by the second afrr and the information of the first host hung by the second afrr.
The description of this step can be found in step S401.
In step S702, the first afrr determines that the second afrr is invalid when the first afrr does not receive the test message from the second afrr for the first duration.
As an example of this embodiment, in the process of message transmission between the first host and the second host, the second afrr may send a test message to the first afrr every second time interval. And if the first AFTR does not receive the test message sent by the second AFTR for the first time, judging that the second AFTR is invalid. And the time length of the first time length is greater than that of the second time length. For example, in the case where the second period of time is 3s, the first period of time may be 5 s.
The test message may refer to a message for testing whether the second afrr is invalid. It should be noted that, as those skilled in the art should understand, there are messages with various formats in the related art as the test message, for example, an Address Resolution Protocol (ARP) message, and the embodiment does not limit this.
In step S703, the first afrr processes the received second packet according to the translation address information carried in the first packet and the first host information when determining that the second afrr is invalid.
The description of this step can be found in step S402.
Fig. 8 is a flowchart illustrating a method of switching a router according to an example embodiment. As shown in fig. 8, the method for switching a router includes the following steps.
In step S801, the first afrr receives a first message from a second afrr, where the second afrr and the first afrr belong to the same broadcast domain, and the first message includes the information of the translation address allocated by the second afrr and the information of the first host hung by the second afrr.
The description of this step can be found in step S401.
In step S802, it is determined whether the destination host information carried in the received second message matches the first host information, and if so, the second message is processed according to the converted address information.
As an example of this embodiment, as shown in fig. 5, afrr 2 is a first afrr and afrr 1 is a second afrr. And under the condition that AFTR2 judges that AFTR1 is invalid, processing the received second message according to the converted address information carried in the first message and the first host information. In other words, AFTR2 processes the received message from the B4 device according to AFTR1 assigned switch address 3.3.3.3 and AFTR1 assigned switch port number 2000. Wherein, the first host information is {3.3.3.3 }. If AFTR2 receives the message from the B4 device, and the second message is { IPv6 dst:2::1, IPv6 src:1::1, dst add:3.3.3, src add:1.1.1.1, src port:1024, dst port:53}, then destination host information { dst add:3.3.3.3} carried in the second message is obtained, and the destination host information { dst add:3.3.3 } is found to be matched with the first host information {3.3.3.3}, then the second message is processed according to the conversion address information.
Example 2
Fig. 9 is a block diagram illustrating a switching device of a router according to an example embodiment. As shown in fig. 9, the switching device of the router includes: a receiving module 11 and a processing module 12.
The receiving module 11 is configured to receive, by a first afrr, a first message from a second afrr, where the second afrr and the first afrr belong to the same broadcast domain, and the first message includes information of a switch address allocated by the second afrr and information of a first host hung under the second afrr; and a processing module 12, configured to process, when the first afrr determines that the second afrr is invalid, the received second message according to the translation address information carried in the first message and the first host information.
Fig. 10 is a block diagram illustrating a switching device of a router according to an example embodiment. As shown in fig. 10:
in one possible implementation, the apparatus further includes: a first determining module 13, configured to determine that the second afrr is invalid when the first afrr does not receive the first message sent by the second afrr for a first duration.
In one possible implementation, the apparatus further includes: a second determining module 14, configured to determine that the second afrr is invalid when the first afrr does not receive the test packet sent by the second afrr for the first duration.
In one possible implementation, the apparatus further includes: a sending module 15, configured to send a third message to the second afrr by the first afrr, where the third message carries the switch address information allocated by the first afrr and third host information hung down by the first afrr.
In one possible implementation, the processing module 12 is configured to: and judging whether the target host information carried in the received second message is matched with the first host information, and if so, processing the second message according to the conversion address information.
The switching device of the router of the embodiment does not need to allocate new conversion address information to the first AFTR when the first AFTR replaces the second AFTR for routing and NAT conversion, and directly uses the conversion address information allocated by the second AFTR, so that the connection between the user side and the public network side does not need to be interrupted and the protocol is reestablished, the time for interrupting the connection and reestablishing the protocol can be saved, and the use experience of the user is improved.
The present disclosure may be systems, methods, and/or computer program products. The computer program product may include a computer-readable storage medium having computer-readable program instructions embodied thereon for causing a processor to implement various aspects of the present disclosure.
The computer readable storage medium may be a tangible device that can hold and store the instructions for use by the instruction execution device. The computer readable storage medium may be, for example, but not limited to, an electronic memory device, a magnetic memory device, an optical memory device, an electromagnetic memory device, a semiconductor memory device, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a Static Random Access Memory (SRAM), a portable compact disc read-only memory (CD-ROM), a Digital Versatile Disc (DVD), a memory stick, a floppy disk, a mechanical coding device, such as punch cards or in-groove projection structures having instructions stored thereon, and any suitable combination of the foregoing. Computer-readable storage media as used herein is not to be construed as transitory signals per se, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through a waveguide or other transmission medium (e.g., optical pulses through a fiber optic cable), or electrical signals transmitted through electrical wires.
The computer-readable program instructions described herein may be downloaded from a computer-readable storage medium to a respective computing/processing device, or to an external computer or external storage device via a network, such as the internet, a local area network, a wide area network, and/or a wireless network. The network may include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers and/or edge servers. The network adapter card or network interface in each computing/processing device receives computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in a computer-readable storage medium in the respective computing/processing device.
The computer program instructions for carrying out operations of the present disclosure may be assembler instructions, Instruction Set Architecture (ISA) instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source or object code written in any combination of one or more programming languages, including an object oriented programming language such as Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The computer-readable program instructions may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider). In some embodiments, the electronic circuitry that can execute the computer-readable program instructions implements aspects of the present disclosure by utilizing the state information of the computer-readable program instructions to personalize the electronic circuitry, such as a programmable logic circuit, a Field Programmable Gate Array (FPGA), or a Programmable Logic Array (PLA).
Various aspects of the present disclosure are described herein with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the disclosure. It will be understood that each block of the flowchart illustrations and/or block diagrams, and combinations of blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer-readable program instructions.
These computer-readable program instructions may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions/acts specified in the flowchart and/or block diagram block or blocks. These computer-readable program instructions may also be stored in a computer-readable storage medium that can direct a computer, programmable data processing apparatus, and/or other devices to function in a particular manner, such that the computer-readable medium storing the instructions comprises an article of manufacture including instructions which implement the function/act specified in the flowchart and/or block diagram block or blocks.
The computer readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other devices to cause a series of operational steps to be performed on the computer, other programmable apparatus or other devices to produce a computer implemented process such that the instructions which execute on the computer, other programmable apparatus or other devices implement the functions/acts specified in the flowchart and/or block diagram block or blocks.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of instructions, which comprises one or more executable instructions for implementing the specified logical function(s). In some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
Having described embodiments of the present disclosure, the foregoing description is intended to be exemplary, not exhaustive, and not limited to the disclosed embodiments. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The terms used herein were chosen in order to best explain the principles of the embodiments, the practical application, or technical improvements to the techniques in the marketplace, or to enable others of ordinary skill in the art to understand the embodiments disclosed herein.

Claims (6)

1. A method for switching a router, the method being applied to a first network address translation router, afrr, the method comprising:
a first AFTR receives a first message from a second AFTR, wherein the second AFTR and the first AFTR belong to the same broadcast domain, and the first message comprises the conversion address information allocated by the second AFTR and the first host information hung down by the second AFTR;
the first AFTR processes a received second message according to the conversion address information carried in the first message and the first host information under the condition that the second AFTR is judged to be invalid;
the processing a received second packet according to the translation address information carried in the first packet and the first host information includes:
judging whether the target host information carried in the received second message is matched with the first host information, and if so, processing the second message according to the conversion address information;
the method further comprises the following steps: and the first AFTR sends a third message to the second AFTR, wherein the third message carries the conversion address information allocated by the first AFTR and the information of a third host hung under the first AFTR.
2. The method of claim 1, further comprising:
and under the condition that the first AFTR does not receive the first message sent by the second AFTR for the first time, judging that the second AFTR is invalid.
3. The method of claim 1, further comprising:
and under the condition that the first AFTR does not receive the test message sent by the second AFTR for the first time, judging that the second AFTR is invalid.
4. A switching device of a router, the device being applied to a first network address translation router, afrr, the device comprising:
a receiving module, configured to receive, by a first afrr, a first message from a second afrr, where the second afrr and the first afrr belong to a same broadcast domain, and the first message includes information of a switch address allocated by the second afrr and information of a first host suspended by the second afrr;
a processing module, configured to process, by the first afrr, a received second packet according to the translation address information carried in the first packet and the first host information when the second afrr is determined to be invalid;
the processing module is further configured to: judging whether the target host information carried in the received second message is matched with the first host information, and if so, processing the second message according to the conversion address information;
the device further comprises: and the sending module is used for sending a third message to the second AFTR by the first AFTR, wherein the third message carries the conversion address information allocated by the first AFTR and the information of a third host hung under the first AFTR.
5. The apparatus of claim 4, further comprising:
and the first judging module is used for judging that the second AFTR is invalid under the condition that the first AFTR does not receive the first message sent by the second AFTR for the first time.
6. The apparatus of claim 4, further comprising:
and the second judgment module is used for judging that the second AFTR is invalid under the condition that the first AFTR does not receive the test message sent by the second AFTR for the first time.
CN201710324121.5A 2017-05-10 2017-05-10 Router switching method and device Active CN107547672B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710324121.5A CN107547672B (en) 2017-05-10 2017-05-10 Router switching method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710324121.5A CN107547672B (en) 2017-05-10 2017-05-10 Router switching method and device

Publications (2)

Publication Number Publication Date
CN107547672A CN107547672A (en) 2018-01-05
CN107547672B true CN107547672B (en) 2021-03-26

Family

ID=60966881

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710324121.5A Active CN107547672B (en) 2017-05-10 2017-05-10 Router switching method and device

Country Status (1)

Country Link
CN (1) CN107547672B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110035134B (en) * 2019-03-22 2022-04-08 新华三技术有限公司 Network address translation method, device and access equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101247317A (en) * 2007-02-15 2008-08-20 华为技术有限公司 Routing switching method and system
CN102170395A (en) * 2011-04-21 2011-08-31 中兴通讯股份有限公司 Data transmission method and network equipment
CN102685263A (en) * 2012-04-26 2012-09-19 中兴通讯股份有限公司 Method for restoring dynamic mapping of address family transition router (AFTR), AFTR and B4
US9258272B1 (en) * 2011-10-21 2016-02-09 Juniper Networks, Inc. Stateless deterministic network address translation

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9331923B2 (en) * 2012-03-02 2016-05-03 Futurewei Technologies, Inc. DS-Lite with BFD support

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101247317A (en) * 2007-02-15 2008-08-20 华为技术有限公司 Routing switching method and system
CN102170395A (en) * 2011-04-21 2011-08-31 中兴通讯股份有限公司 Data transmission method and network equipment
US9258272B1 (en) * 2011-10-21 2016-02-09 Juniper Networks, Inc. Stateless deterministic network address translation
CN102685263A (en) * 2012-04-26 2012-09-19 中兴通讯股份有限公司 Method for restoring dynamic mapping of address family transition router (AFTR), AFTR and B4

Also Published As

Publication number Publication date
CN107547672A (en) 2018-01-05

Similar Documents

Publication Publication Date Title
US10862732B2 (en) Enhanced network virtualization using metadata in encapsulation header
US10972341B2 (en) Subnet stretching via layer three communications
US10541836B2 (en) Virtual gateways and implicit routing in distributed overlay virtual environments
US10158502B2 (en) Network device that relays communication
US7388829B2 (en) Method and apparatus for detecting and recovering from faults associated with transport protocol connections across network address translators
JP5871063B2 (en) Multi-tenant system, switch, controller, and packet transfer method
US9106257B1 (en) Checksumming encapsulated network packets
JP6905551B2 (en) Network equipment
US11444808B1 (en) Scaling network address translation (NAT) and firewall functionality to support public cloud networks
CN112671938B (en) Business service providing method and system and remote acceleration gateway
CN112671628A (en) Business service providing method and system
Albkerat et al. Analysis of IPv6 transition technologies
US7882169B1 (en) Method and apparatus for configuring relay processes used for dynamically configuring hosts in network communications
US11895085B2 (en) Identifier locator addressing for IPV6-based software defined fabric
CN107547672B (en) Router switching method and device
JP2008545310A (en) Data routing in computer equipment
WO2013071825A1 (en) Device and method for realizing identity and locator separation network
CN113890824A (en) Network acceleration method, network acceleration device, gateway equipment and computer readable storage medium
CN107547376B (en) Route detection method and device
WO2016078235A1 (en) Network translation realization method and apparatus for transiting to ipv6 on the basis of pant
Khan et al. Necessity to migrate to IPv6
US11956145B1 (en) Method and apparatus to recover flow using an error message in a tunnel-less SDWAN
JP5703848B2 (en) Communication method, communication system, router and server
US20230015347A1 (en) System and method for forwarding packets in a hierarchical network architecture using variable length addresses
KR102097999B1 (en) The IP in IP communication system using virtual router

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant