CN107547376B - Route detection method and device - Google Patents

Route detection method and device Download PDF

Info

Publication number
CN107547376B
CN107547376B CN201710599002.0A CN201710599002A CN107547376B CN 107547376 B CN107547376 B CN 107547376B CN 201710599002 A CN201710599002 A CN 201710599002A CN 107547376 B CN107547376 B CN 107547376B
Authority
CN
China
Prior art keywords
host
tunnel
icmp
aftr
detection
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
CN201710599002.0A
Other languages
Chinese (zh)
Other versions
CN107547376A (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.)
New H3C Information 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 CN201710599002.0A priority Critical patent/CN107547376B/en
Publication of CN107547376A publication Critical patent/CN107547376A/en
Application granted granted Critical
Publication of CN107547376B publication Critical patent/CN107547376B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The present disclosure relates to a route probing method and apparatus. The method is applied to a B4 device in a lightweight dual-stack network, and comprises the following steps: sending a route detection instruction to a first AFTR, wherein the route detection instruction is used for enabling the first AFTR to carry out ICMP detection on a second host; and if the ICMP unreachable information of the second host from the first AFTR is received, switching a message forwarding path from the first host to the second host from the first tunnel to the second tunnel. The method and the device utilize the B4 equipment to send the route detection indication to the AFTR so that the AFTR carries out ICMP detection on the host, if the B4 equipment receives ICMP unreachable information of the host returned by the AFTR, the situation that the AFTR is not communicated with the host route can be known, the switching of the main AFTR and the standby AFTR can be automatically carried out, the normal operation of communication is ensured, and the waste of system resources is reduced.

Description

Route detection method and device
Technical Field
The present disclosure relates to the field of communications technologies, and in particular, to a method and an apparatus for route probing.
Background
The DS-Lite (Dual Stack Lite, lightweight Dual Stack) technology combines the IPv4over IPv6(IPv4 crosses IPv6) tunneling technology and the NAT (Network Address Translation) technology. The DS-Lite technology realizes 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 by using a tunnel technology, realizes the sharing of the same IPv4 address space by different user networks by using an NAT technology, and slows down the exhaustion speed of an IPv4 address.
Fig. 1 shows a schematic diagram of a DS-Lite networking map in the related art. As shown in fig. 1, the DS-Lite network mainly includes a DS-Lite tunnel, B4(Basic Bridging BroadBand) 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 an ISP (Internet Service Provider) network, and is typically a gateway of the user network. 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 into an IPv6 message and sending the IPv6 message to the other end point of the tunnel, and meanwhile, decapsulating the IPv6 message received from the tunnel into an IPv4 message and sending the IPv4 message to the user network. Some of the user networks' hosts may also be connected directly to the ISP network as B4 devices, such hosts being called DS-Lite hosts.
AFTR is a device in an ISP network. AFTR is used as both DS-Lite tunnel endpoint and 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 the IPv6 address of the B4 device (source IPv6 address in the message) and the tunnel ID. AFTR decapsulates the IPv6 message, converts the source IPv4 address (private network address) of the decapsulated user network message into a 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 network addresses of users 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) 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 after the NAT conversion into an IPv6 message and sends the IPv6 message to the B4 equipment through a tunnel. Generally, DS-Lite only supports IPv4 host in user network to actively access IPv4 host on public network; IPv4 hosts on the public network cannot actively access IPv4 hosts within the user's network.
Disclosure of Invention
In view of this, the present disclosure provides a route probing method and apparatus.
According to an aspect of the present disclosure, a route probing method is provided, where the method is applied to a B4 device in a lightweight dual-protocol stack network, where the lightweight dual-protocol stack network further includes a first host, a second host, a first afrr, and a second afrr, where a packet forwarding path from the first host to the second host includes a first tunnel and a second tunnel, the first tunnel is between the B4 device and the first afrr, and the second tunnel is between the B4 device and the second afrr;
the method comprises the following steps:
sending a route detection instruction to the first AFTR, wherein the route detection instruction is used for enabling the first AFTR to carry out ICMP detection on a second host;
and if the ICMP unreachable information of the second host from the first AFTR is received, switching a message forwarding path from the first host to the second host from the first tunnel to the second tunnel.
According to another aspect of the present disclosure, a route probing method is provided, which is applied to a first AFTR in a lightweight dual-protocol stack network, the lightweight dual-protocol stack network further including a first host, a second host, a B4 device, and a second AFTR, wherein a packet forwarding path from the first host to the second host includes a first tunnel and a second tunnel, the first tunnel is a tunnel between the B4 device and the first AFTR, and the second tunnel is a tunnel between the B4 device and the second AFTR;
the method comprises the following steps:
according to the received route detection indication from the B4 device, carrying out ICMP detection on the second host;
if the second host is detected to be unreachable, sending ICMP unreachable information of the second host to the B4 device; the ICMP unreachable information is used to notify the B4 device of the route from the first afrr to the second host being not through, so that the B4 device switches the packet forwarding path from the first host to the second host from the first tunnel to the second tunnel.
According to another aspect of the present disclosure, there is provided a route probing apparatus, which is applied to a B4 device in a lightweight dual-protocol stack network, the lightweight dual-protocol stack network further including a first host, a second host, a first afrr, and a second afrr, wherein a packet forwarding path from the first host to the second host includes a first tunnel and a second tunnel, the first tunnel is between the B4 device and the first afrr, and the second tunnel is between the B4 device and the second afrr;
the device comprises:
a first sending module, configured to send a route detection instruction to the first afrr, where the route detection instruction is used to enable the first afrr to perform ICMP detection on a second host;
a first receiving module, configured to switch a packet forwarding path from the first host to the second host from the first tunnel to the second tunnel if receiving the ICMP unreachable information of the second host from the first AFTR.
According to another aspect of the present disclosure, there is provided a routing probe apparatus, which is applied to a first AFTR in a lightweight dual-protocol stack network, the lightweight dual-protocol stack network further including a first host, a second host, a B4 device, and a second AFTR, wherein a packet forwarding path from the first host to the second host includes a first tunnel and a second tunnel, the first tunnel is a tunnel between the B4 device and the first AFTR, and the second tunnel is a tunnel between the B4 device and the second AFTR;
the device comprises:
a third receiving module, configured to perform ICMP detection on the second host according to the received route detection instruction from the B4 device;
a third sending module, configured to send an ICMP unreachable message of the second host to the B4 device if it is detected that the second host is unreachable; the ICMP unreachable information is used to notify the B4 device of the route from the first afrr to the second host being not through, so that the B4 device switches the packet forwarding path from the first host to the second host from the first tunnel to the second tunnel.
According to another aspect of the present disclosure, an implementation apparatus of a route probing method is provided, including: a processor and a machine-readable storage medium storing machine-executable instructions executable by the processor to implement a route probing method according to any one of the embodiments of the present disclosure.
According to another aspect of the present disclosure, there is provided a machine-readable storage medium having stored thereon machine-executable instructions that, when invoked and executed by a processor, cause the processor to implement a route probing method as described in any one of the embodiments of the present disclosure.
The route detection indication is sent to the AFTR by the B4 equipment, so that the AFTR carries out ICMP detection on the host, if the B4 equipment receives ICMP unreachable information of the host returned by the AFTR, the situation that the AFTR is not communicated with the host route can be known, and the main and standby AFTR can be automatically switched, so that the backup AFTR can play a role when the main AFTR is not communicated with the remote host route, the normal operation of communication is ensured, and the waste of system resources is reduced.
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 shows a flow chart of a message forwarding process in the DS-Lite networking diagram.
Fig. 3 shows another flow chart of the message forwarding process in the DS-Lite networking map.
Fig. 4 shows a flow diagram of a route probing method according to an embodiment of the present disclosure.
Fig. 5 shows another flow diagram of a route probing method according to an embodiment of the present disclosure.
Fig. 6 shows a flow diagram of a route probing method according to another embodiment of the present disclosure.
Fig. 7 shows another flow diagram of a route probing method according to another embodiment of the present disclosure.
Fig. 8 is a schematic diagram illustrating an application scenario of a route probing method according to an embodiment of the present disclosure.
Fig. 9 shows a schematic diagram of a first route probing method according to an embodiment of the present disclosure.
Fig. 10 shows a schematic diagram of a second route probing method according to an embodiment of the present disclosure.
Fig. 11 is a flowchart illustrating a packet forwarding process in a DS-Lite networking diagram according to an embodiment of the present disclosure.
Fig. 12 is a flowchart illustrating a packet forwarding process in a DS-Lite networking diagram according to an embodiment of the present disclosure.
Fig. 13 shows a block diagram of a route probing device according to an embodiment of the present disclosure.
Fig. 14 shows another block diagram of a route probing device according to an embodiment of the present disclosure.
Fig. 15 shows a block diagram of a route probing apparatus according to another embodiment of the present disclosure.
Fig. 16 shows another block diagram of a route probing apparatus according to another embodiment of the present disclosure.
Fig. 17 is a block diagram of an apparatus for implementing a route probing method according to an embodiment of the present disclosure.
FIG. 18 shows a block diagram of a machine-readable storage medium according to an embodiment of the present disclosure.
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.
Fig. 2 shows a flow chart of a message forwarding process in the DS-Lite networking diagram. As shown in fig. 2, when an independent gateway device is used as the B4 device, the source and destination IP addresses, and the source and destination port numbers change during the DS-Lite message forwarding process. The key steps of the DS-Lite 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 the IPv4 message { IPv4dst:30.1.1.1, IPv4src:10.0.0.1, TCP dst:80, TCP src:10000} of the user network side into IPv6 messages { IPv6dst:2: 1, IPv6src:1, IPv4dst:30.1.1.1, IPv4src:10.0.0.1, TCP dst:80, TCP src:10000} and sends the IPv6 messages to AFTR through a DS-Lite tunnel. AFTR decapsulates IPv6 messages { IPv6dst:2: 1, IPv6src:1, IPv4dst:30.1.1.1, IPv4src:10.0.0.1, TCP dst:80 and TCP src:10000} and carries out NAT conversion to obtain IPv4 messages { IPv4dst:30.1.1.1, IPv4src:20.1.1.1, TCP dst:80 and TCP src:5000}, and sends IPv4 messages { IPv4dst:30.1.1.1, IPv4src:20.1.1.1, TCP dst:80 and TCP src:5000} to a target IPv4 host. AFTR receives IPv4 messages { IPv4dst:20.1.1.1, IPv4src:30.1.1.1, TCP dst:5000 and TCP src:80} returned by a target IPv4 host, performs NAT conversion, encapsulates the IPv4 messages { IPv6dst:1, IPv6src:2: 1, IPv4dst: 10.0.1, IPv4src:30.1.1.1, TCP dst:10000 and TCP src:80} into IPv6 messages, and sends the IPv6 messages to B4 equipment through a DS-Lite tunnel. The B4 equipment unpacks an IPv6 message { IPv6dst:1, IPv6src:2: 1, IPv4dst:10.0.0.1, IPv4src:30.1.1.1, TCP dst:10000, TCP src:80} to obtain an IPv4 message { IPv4dst:10.0.0.1, IPv4src:30.1.1.1, TCP dst:10000, TCP src:80}, and sends an IPv4 message { IPv4dst:10.0.0.1, IPv4src:30.1.1.1, TCP dst:10000, TCP src:80} to a host on the user network side.
Fig. 3 shows another flow chart of the message forwarding process in the DS-Lite networking map. As shown in fig. 3, if host addresses are IPv4 addresses, when host1 (host 1) accesses host2 (host 2), the packet with an added layer of IPv6 encapsulation header is forwarded to AFTR through encapsulation of B4 device. AFTR decapsulates the translated address and sends an IPv4 message to host 2. In the above practical use of networking, if AFTR1 is the primary AFTR and AFTR2 is the backup AFTR, then the B4 device will have two tunnels, and the destination addresses of the tunnels respectively point to the IPv6 addresses of the two AFTRs. The B4 device then reconfigures the static IPv4 route to host2, with tunnel1 being the main next hop AFTR1 and tunnel2 being the backup next hop AFTR 2. When forwarding, the requirement of the data message to each router is as follows: (1) the data message arrives at the B4 device: b4 needs to have an IPv6 route to AFTR (i.e., the static route we configured before). (2) When the data message reaches AFTR equipment: the AFTR needs to know the route to host 2. These two routing relationships are independent, and when a data packet arrives at the corresponding role device (e.g., B4), the corresponding role device does not forward because the other device has no route (e.g., the AFTR does not know the route to host 2).
Due to the independence of the above routing and forwarding relationships, it can be seen that: when the path failure of AFTR to host2 cannot be forwarded, the learning and encapsulation forwarding of IPv6 route of B4 device is not affected. The B4 device still forwards the packet to the AFTR with the path failure, resulting in the packet being unreachable for a long time. Unless the main next hop of the static route is modified to be prior to another backup AFTR, the path is modified back after being restored. Such a modification is inconvenient, and especially when the number of affected hosts is large, time and labor are wasted.
Fig. 4 shows a flow diagram of a route probing method according to an embodiment of the present disclosure. As shown in fig. 4, the route probing method is applied to a B4 device in a lightweight dual-protocol stack network, where the lightweight dual-protocol stack network further includes a first host, a second host, a first afrr, and a second afrr, where a packet forwarding path from the first host to the second host includes a first tunnel and a second tunnel, the first tunnel is a tunnel between the B4 device and the first afrr, and the second tunnel is a tunnel between the B4 device and the second afrr.
In one embodiment, the method comprises:
step 101, sending a route detection instruction to a first AFTR, wherein the route detection instruction is used for enabling the first AFTR to perform ICMP detection on a second host.
Step 102, if receiving the ICMP unreachable information of the second host from the first afr, switching the packet forwarding path from the first host to the second host from the first tunnel to the second tunnel.
In an implementation manner, after receiving a data packet in an IPv4 format from a first host, and under the condition of normal forwarding, a B4 device performs IPv6 encapsulation on the data packet in the IPv4 format to obtain a first data packet, and sends the first data packet to a first AFTR through a first tunnel.
In order to perform ICMP probing on the second host, in step 101, a route probing indication is sent to the first afrr, which may be any of the following manners:
the first method is to send a route detection indication by using a constructed detection message.
The B4 device constructs a probe message according to a first data message sent by the B4 device to a first afrr at intervals of a first set period, where the probe message includes an IPv4 header and an IPv6 header in the first data message, and the probe message further includes an ICMP header, and the ICMP header is the routing probe indication. Then, the B4 device sends the probe packet to the first afrr. The first set period may be a set time period, for example, a probe message is sent at intervals of 300 ms, 400 ms, or 600 ms. The set period may also be a set number of messages, for example, one probe message may be sent at intervals of 10, 20, and 40 data messages. The time period and the message number period are merely examples, and are not limited to the set period, and in an actual application scenario, other manners such as flow, specific event, and the like may also be selected to determine the specific period.
After the B4 device sends the route detection indication to the first afrr in a manner, the first afrr obtains the ICMP header from the detection message to know that the ICMP detection needs to be performed on the second host. And the first AFTR acquires the IPv4 header and the ICMP header from the detection message to construct an ICMP message. The first AFTR sends the constructed ICMP message to the second host (the ICMP message may not be sent when the first AFTR does not have the route of the second host).
And the second mode is that the data message is adopted to send the route detection indication.
B4, adding an ICMP probe identifier into a first data packet sent by the B4 device to the first afrr at intervals of a second set period, where the ICMP probe identifier is the route probe indication; the ICMP detection identifier is used for enabling the first AFTR to send a second data message to the second host so as to carry out ICMP detection on the second host; and sending the first data message comprising the ICMP detection identifier to the first AFTR. The second set period may be a set time period, a set number of messages, or other manners such as flow rate and specific event. There are various ways of adding the ICMP probe identifier to the first data packet. An existing field in the first data packet may be used to carry the ICMP probe id, for example, the protocol number field in the first data packet is modified to a field for indicating the ICMP probe id. An ICMP probe id may also be carried in a newly added field in the first data packet. In this embodiment, a specific mode of an ICMP detection identifier added to the first data packet is not limited.
After the B4 device sends the route probing indication to the first afrr in the manner, the first afrr obtains the ICMP probe identifier from the first data packet to know that the ICMP probe needs to be performed on the second host. And the first AFTR copies an IPv4 header from the first data message, adds an ICMP identifier and constructs an ICMP message. After the first AFTR constructs and obtains the ICMP message, the first AFTR sends the constructed ICMP message to the second host (when the first AFTR does not have the route of the second host, the ICMP message may not be sent).
For the first or second mode, if the second host does not respond, or the first afr does not have a route of the second host, it indicates that the ICMP from the first afrr to the second host is unreachable, i.e., the route between the first afrr and the second host is not through. The first AFTR sends a response message to the B4 device. The response message includes ICMP unreachable information and IPv4 header and IPv6 header opposite to the first data message route.
The B4 device can know the route failure between the first afrr and the second host according to the ICMP unreachable information and the IPv4 header in the echo message. At this time, in step 102, the B4 device modifies the static IPv4 route from the first host to the second host, and switches the packet forwarding path from the first host to the second host from the first tunnel to the second tunnel. For example, as shown in fig. 8, the static route configured on the B4 device is modified, and the next hop with the IPv4 destination address of 3.3.3.3 of host2 is modified to tunnel 2.
In one implementation, as shown in fig. 5, the method further includes:
step 103, if the source address of the received data packet to be forwarded is the first host and the destination address is the second host, the B4 device sends the data packet to be forwarded to the second host through the second afrr in the second tunnel according to the mapping relationship between the second host and the second afrr.
In one implementation, the B4 device generates a temporary mapping table, and stores the mapping relationship between the second host and the second AFTR in the temporary mapping table. Subsequently, when the B4 device receives the data packet to be forwarded, if it is determined that the destination address of the data packet to be forwarded is the second host through matching in the temporary mapping table, the data packet to be forwarded is sent to the second host through the second afrr in the second tunnel. And for other hosts with the destination addresses which are not the second host, forwarding according to the original flow.
As shown in fig. 5, after knowing that the route between the first afrr and the second host is not passed, the B4 device uses the second tunnel as a packet forwarding path, and may further instruct the first afrr to continue probing so as to enable smooth handoff. In one implementation, the method further comprises:
and 104, under the condition that the second tunnel is used as a message forwarding path from the first host to the second host, if the ICMP reachable information of the second host from the first AFTR is received, switching back the message forwarding path from the first host to the second host from the second tunnel to the first tunnel. Wherein the ICMP reachability information indicates that routing between the first AFTR and the second host is normal.
Before step 104, if the second tunnel is used as a packet forwarding path from the first host to the second host, the B4 device may send a route probe indication to the first afrr. The route detection indication may also be implemented in the form of a detection packet. After using the second tunnel as the message forwarding path, the B4 device does not send the data message to the first AFTR, but if the B4 device receives the data message with the source address of the first host and the destination address of the second host, the B4 message may further encapsulate an IPv6 header with the source address of the B4 device and the destination address of the first AFTR according to the IPv4 header of the data message, and add an ICMP header to construct a probe message. Then, the B4 device sends the probe packet including the route probe indication to the first afrr at intervals of a third set period. The third setting period may be the same as or different from the first setting period and the second setting period. After receiving the route probing indication from the B4 device, the first afrr performs step 104 to continue ICMP probing the second host. And under the condition that the routing between the first AFTR and the second host is detected to be recovered to be normal, the first AFTR sends ICMP reachable information of the second host to the B4 device, and the B4 device performs the back-cut.
In addition, it may also be directly set on the first afrr that ICMP probing is periodically performed on the second host if the first afrr knows that the route between itself and the second host is not available. Thus, after the B4 device knows that the route between the first afrr and the second host is not through, it is not necessary to send the route probe indication to the first afrr.
In this embodiment, the B4 device is used to send a route detection indication to the afrr, so that the afrr performs ICMP detection on the host, and if the B4 device receives ICMP unreachable information of the host returned by the afrr, it can know that the AFTR is not connected to the host route, and can automatically perform switching between the main and standby AFTRs, so that the backup AFTR can play a role when the main AFTR is not connected to the remote host route, thereby ensuring normal communication and reducing waste of system resources. Furthermore, after the route is recovered to be normal, the B4 equipment can be automatically switched back, the switching process is convenient, and time and labor are saved. And a temporary mapping relation is established on the B4 equipment, so that IPv6 routing encapsulation change can be carried out aiming at the message forwarding path fault of a specific host, and the message forwarding paths of other fault-free hosts are not influenced.
Fig. 6 shows a flow diagram of a route probing method according to another embodiment of the present disclosure. As shown in fig. 6, the route probing method is applied to a first afrr in a lightweight dual-protocol stack network, where the lightweight dual-protocol stack network further includes a first host, a second host, a B4 device, and a second afrr, where a packet forwarding path from the first host to the second host includes a first tunnel and a second tunnel, the first tunnel is a tunnel between the B4 device and the first afrr, and the second tunnel is a tunnel between the B4 device and the second afrr.
In one embodiment, the method comprises:
step 301, performing ICMP probing on the second host according to the received route probing instruction from the B4 device.
Step 302, if it is detected that the second host is not reachable, sending ICMP unreachable information of the second host to the B4 device. The ICMP unreachable information is used to notify the B4 device of the route from the first afrr to the second host being not through, so that the B4 device switches the packet forwarding path from the first host to the second host from the first tunnel to the second tunnel.
After the B4 device receives the data packet in IPv4 format from the first host, under the condition of normal forwarding, the B4 device performs IPv6 encapsulation on the data packet in IPv4 format to obtain a first data packet, and sends the first data packet to the first AFTR through the first tunnel.
For ICMP probing of the second host, the B4 device sends a route probing indication to the first afrr, as described above with respect to step 101 of the embodiment.
In step 301, according to the received route probing indication from the B4 device, performing ICMP probing on the second host, which may be any of the following manners:
in the first mode, ICMP detection is carried out after a route detection instruction in a detection message is received.
If the first AFTR receives a detection message including a route detection indication from the B4 device, constructing an IPv4 header and an ICMP header in the detection message to obtain an ICMP message, and sending the ICMP message to the second host to perform ICMP detection on the second host.
The probe packet is constructed by the B4 device according to a first data packet sent by the B4 device to a first afrr at a first set interval (e.g., a first time interval or a first number of packets interval). The detection message comprises an IPv4 header and an IPv6 header which are the same as the first data message route, and the detection message also comprises an ICMP header which is the route detection indication.
And in the second mode, ICMP detection is carried out after the route detection indication in the data message is received.
In the B4 device, adding an ICMP probe identifier in a first data packet sent by the B4 device to the first afrr at a second set period (for example, at a second time interval or at a second number of packets), where the ICMP probe identifier is the route probe indication. If the first AFTR receives a first data message which comprises a routing detection indication and is from the B4 equipment, sending a second data message to the second host, copying an IPv4 header from the first data message, adding an ICMP identification structure to obtain an ICMP message, and sending the ICMP message to the second host to perform ICMP detection on the second host.
There are various ways of adding the ICMP probe identifier to the first data packet. An existing field in the first data packet may be used to carry the ICMP probe id, for example, the protocol number field in the first data packet is modified to a field for indicating the ICMP probe id. An ICMP probe id may also be carried in a newly added field in the first data packet. In this embodiment, a specific mode of an ICMP detection identifier added to the first data packet is not limited.
After step 301, if the first afrr obtains the ICMP header from the probe message or obtains the ICMP probe identifier from the first data message, it can know that the ICMP probe needs to be performed on the second host. After the first afr constructs the ICMP message by the first mode or the second mode, the first afrr sends the constructed ICMP message to the second host (if the first afr does not have the route of the second host, the ICMP message may not be sent). If the second host does not respond or the first AFTR does not have a route to the second host, it indicates that ICMP from the first AFTR to the second host is unreachable, i.e., the route between the first AFTR and the second host is not through.
In one implementation, in step 302, if it is detected that the second host is not reachable, sending ICMP unreachable information of the second host to the B4 device includes:
if the second host is detected to be unreachable, namely the route from the first AFTR to the second host is not passed, the first AFTR sends an echo message to the B4 device, wherein the echo message comprises an IPv6 header, an IPv4 header and the ICMP unreachable information, which are opposite to the route of the first data message (or the detection message).
After receiving the response message, the B4 device switches the message forwarding path from the first host to the second host from the first tunnel to the second tunnel, as described in the above embodiment with reference to step 102. Furthermore, the B4 device may further generate a temporary mapping table to store the mapping relationship between the second host and the second afrr, as described in the foregoing description of step 103 of the embodiment. And if the source address of the received data message to be forwarded is the first host and the destination address is the second host, the B4 equipment sends the data message to be forwarded to the second host through the second AFTR in the second tunnel according to the mapping relation between the second host and the second AFTR. For example, if the destination address of the data packet to be forwarded is determined to be the second host by matching in the temporary mapping table after the B4 device receives the data packet to be forwarded, the data packet to be forwarded is sent to the second host through the second afrr in the second tunnel. And for other hosts with the destination addresses which are not the second host, forwarding according to the original flow.
As shown in fig. 7, after the first afr informs the B4 that the route between the first afr and the second host is not through, the first afr may further perform ICMP detection on the second host, so as to enable smooth switching back. In one implementation, the method further comprises:
step 303, under the condition that the B4 device uses the second tunnel as the packet forwarding path from the first host to the second host, if it is detected that the route between the first afrr and the second host is normal after performing ICMP detection on the second host, sending ICMP reachable information of the second host to the B4 device, so that the B4 device switches the packet forwarding path from the first host to the second host from the second tunnel back to the first tunnel.
If the B4 device uses the second tunnel as a packet forwarding path from the first host to the second host, the B4 device may send a route probing indication to the first AFTR. The route detection indication may also be implemented in the form of a detection packet. After using the second tunnel as the message forwarding path, the B4 device does not send the data message to the first AFTR, but if the B4 device receives the data message with the source address of the first host and the destination address of the second host, the B4 message may further encapsulate an IPv6 header with the source address of the B4 device and the destination address of the first AFTR according to the IPv4 header of the data message, and add an ICMP header to construct a probe message. Then, the B4 device sends the probe message including the route probe indication to the first afrr. After receiving the route probing indication from the B4 device, the first afrr performs step 303 to continue ICMP probing the second host. And under the condition that the routing between the first AFTR and the second host is detected to be recovered to be normal, the first AFTR sends ICMP reachable information of the second host to the B4 device, and the B4 device performs the back-cut.
In addition, it may also be directly set on the first afrr that ICMP probing is periodically performed on the second host if the first afrr knows that the route between itself and the second host is not available. Thus, after the B4 device knows that the route between the first afrr and the second host is not through, it is not necessary to send the route probe indication to the first afrr.
By adopting the route detection method of the embodiment of the disclosure, the B4 device can sense the route failure (or called link failure) from the AFTR to the host, so that the device can be automatically switched to the backup path for subsequent data forwarding, and the limitation that the main and standby AFTRs can only take effect when the AFTR fails is overcome. And a temporary mapping relation is established on the B4 equipment, IPv6 routing encapsulation change is carried out aiming at the message forwarding path fault of a specific host, and the message forwarding paths of other fault-free hosts are not influenced. Meanwhile, the backup AFTR (second AFTR) can also function when the route from the main AFTR (first AFTR) to the remote host is not through.
In this embodiment, after receiving the route probing instruction from the B4 device, the AFTR performs ICMP probing on the host, and sends a probing result to the B4 device. If the B4 device receives the ICMP unreachable information of the host from the afr, it can know that the route from the afr to the host is not through, and can automatically switch the main and standby afrrs, so that the backup afrr can play a role when the route from the main afrr to the remote host is not through, ensure the normal operation of communication, and reduce the waste of system resources. Furthermore, after AFTR informs the B4 that the device route is recovered to be normal, the B4 device can also automatically switch back, the switching process is convenient, and time and labor are saved.
Fig. 8 is a schematic diagram illustrating an application scenario of a route probing method according to an embodiment of the present disclosure. As shown in fig. 8, the B4 device has two tunnels of IPv 6. the IPv6 destination address of tunnel1 is 2::1 (standing for AFTR1) and the IPv6 destination address of tunnel2 is 2::2 (standing for AFTR 2). Static routing is configured on the B4 device, the destination address of IPv4 is 3.3.3.3 (representing host 2), the primary next hop is tunnel1, and the backup next hop is tunnel 2. With the current implementation, this configuration can only be applied when AFTR fails, the primary tunnel1 routes 2::1 becomes unreachable, will down, and then performs route switching. When the path from AFTR to host2 fails (or called link failure, routing failure, etc.), the IPv6 destination route of tunnel is still reachable, and the route is not switched. The traffic (data message) continues to be forwarded according to the route configuration of the IPv 6. Two route probing methods are described below to achieve automatic route switching in the event of a path failure.
As shown in fig. 9, the first route probing method mainly includes: in the process of sending data packets (or called data traffic), the B4 device sends probe packets to the afrr at a certain time interval or a certain number of data packets per interval, where the probe packets are generated by the B4 device according to the received data packets. As shown in fig. 9, an example of the probing process includes the steps of:
in step 501, when host1 (host 1) accesses host2 (host 2), in a data message (pkt1) sent from a B4 device to AFTR1, an IPv6 header (or an IPv6 encapsulation header, an IPv6 message header, etc.) includes an IPv6 source address 1::1 and an IPv6 destination address 2::1, and an IPv4 header (or an IPv4 encapsulation header, an IPv4 message header, etc.) includes an IPv4 source address 1.1.1 and an IPv4 destination address 3.3.3.3. pkt1 also carries other information such as port numbers as needed. Normally, the B4 device would forward the pkt1 to host2 through AFTR1, following a process similar to that shown in fig. 2.
Step 502, in the process of sending the data message, every certain time interval or every certain data message quantity, the B4 device constructs a detection message to the afrr 1. The probe Message includes an IPv6 header and an IPv4 header of pkt1, and carries an ICMP (Internet Control Message Protocol) header (or ICMP encapsulation header and ICMP header). For example, as shown in fig. 8, the probe message includes: IPv4 has a source address of 1.1.1.1, IPv4 has a destination address of 3.3.3.3, IPv6 has a source address of 1::1, IPv6 has a destination address of 2::1, and a layer of ping ICMP header (e.g., echo (ping) request of Type (Type) 8).
Step 503, the B4 device sends the probe message to the afrr 1.
After receiving the detection message, AFTR1 removes the IPv6 encapsulation of the detection message, and performs ICMP detection on the bottom layer destination IPv4 message to detect whether the IPv4 message can reach the remote host 2. For example, AFTR1 receives the probe message, finds that the probe message includes an IPv6 header, an IPv4 header, and an ICMP header, and indicates that ICMP detection needs to be performed on the host2 with an IPv4 destination address of 3.3.3.3. AFTR1 removes the IPv6 header in the probe message, and sends an ICMP message including an IPv4 header and an ICMP header to the host 2. For example, the ICMP message includes IPv4 having a source address of 1.1.1.1, IPv4 having a destination address of 3.3.3.3, and echo (ping).
Step 505, if there is no reply from host2 or AFTR1 does not directly have a route for host2, then AFTR1 considers the route from AFTR1 to host2 to be dead. If the IPv4 message can reach the host2, the current forwarding is not influenced, and no additional processing is performed.
Step 506, AFTR1 responds to the B4 device with the IPv4 header and the ICMP header encapsulating the IPv6 header. For example, AFTR1 constructs a response message based on pkt 1. The IPv4 header and IPv6 header in the echo message are the reverse of those of pkt1, and add a layer of ICMP unreachable information at the bottom. For example, as mentioned above, the response message includes: IPv6 source address 2::1, IPv6 destination address 1::1, IPv4 source address 3.3.3.3, IPv4 destination address 1.1.1.1 and ICMP unreachable information (e.g., type 3 and code 1, indicating no 32-bit routing). The implementation manner of the ICMP unreachable information includes multiple, and the specific implementation manner is not limited in this embodiment.
Step 507, after the B4 device receives the response message, if the ICMP unreachable information is obtained, the response message is analyzed to obtain the response host address (i.e. IPv4 source address 3.3.3.3) of the IPv4 layer, for example, the host that the ICMP unreachable is found to be host 2. At this time, the B4 device controls the route corresponding to the host address to switch to the backup path. For example, a B4 device automatically switches locally to a static route of host 2. As shown in fig. 8, the static route configured on the B4 device is modified, and the next hop with the IPv4 destination address of 3.3.3.3 of host2 is modified to tunnel 2.
The data message subsequently received by the B4 device goes through the backup path, i.e. tunnel2, and is forwarded. In order not to affect the forwarding of other non-failure host, the temporary mapping table is formed in the disclosure, and only the traffic reaching host2 is specified to be forwarded by using the backup path.
Step 508, as in the example of fig. 8, when ICMP unreachable occurs, the B4 device establishes a temporary mapping table, forming a mapping of 3.3.3- >2:: 2. The mapping represents that when the host traffic with the IPv4 destination address of 3.3.3.3 appears on the B4 device (that is, the B4 device receives the data packet forwarded to the destination host, which is the host 2), the next hop points to the tunnel2, and the data packet is forwarded to the host2 through the afrr 2. When the B4 device receives a data packet that needs to be forwarded to another destination host, the data packet is forwarded according to the original flow because the data packet does not match with the mapping included in the temporary mapping table.
The above is an example of the handover procedure of the first detection method. An example of the back-cut process of the first detection method is described below.
In step 509, after the route is not passed, the B4 device still sends a probe message to the afrr 1 at a certain time interval (the time interval is not necessarily the same as the probe time interval in step 502). The method for constructing the probe packet refers to the above description.
Step 510, the detection process is similar to step 504, and if it is detected that the subsequent AFTR is recovered to be reachable by the host link, an ICMP reachable message is echoed. For example, after AFTR1 resumes routing to host2 in the previous example, AFTR1 reverts to B4 to reply with an ICMP reachable message. If ICMP probing is automatically performed on host2 periodically when set to no route on afrr 1, then there is no step 509.
After receiving the ICMP reachable information, the B4 device parses the response message to obtain the IPv4 address of the remote host (e.g., host 2), and performs a switch back if the address is found to be switched (i.e., the static route is modified in step 507). For example, the B4 device restores the temporarily switched routing table entry and deletes the temporary mapping table to perform the switch back. When the subsequent B4 device receives the data packet forwarded to the destination host as host2 again, the next hop points to tunnel1, and forwards the data packet to host2 through afrr 1.
As shown in fig. 10, the second route probing method includes the following steps:
step 601, in the process (also called the environment of incoming traffic) that the host1 sends the data packet (pkt1) to the host2, modifying the IPv4 protocol number field in the IPv4 header of the next data packet that passes through at intervals of a certain duration on the B4 device. For example, a protocol number is newly created as an ICMP probe identifier (an example of a route probe indication), and a protocol number field is modified to identify a protocol number XXXX, for example.
Step 602, after receiving the data packet carrying the corresponding identification protocol number XXXX, AFTR1 matches the IPv6 header and the IPv4 header of the data packet. Comparing the received previous message with the data message having the same IPv6 header and IPv4 header, and modifying the protocol number field of the data message into the protocol number field of the previous message.
Step 603, then AFTR1 continues to send the modified data message to host2 (processed according to a similar flow as in fig. 2). The protocol number of the data packet sent by the afrr 1 to the host2 is changed back to be the same as the IPv4 protocol number field of pkt1 before modification.
In step 604, since AFTR1 receives the identification protocol number XXXX, AFTR1 constructs an ICMP message walking detection process and sends the ICMP message walking detection process to the remote host 2. The ICMP message constructed by AFTR1 copies the IPv4 header of pkt1 message and adds ICMP mark.
The steps 605 to 611 of the second detection method are similar to the steps 505 to 511 of the first detection method, and are not repeated here. In step 609, a probe packet may also be constructed and sent for probing in a manner similar to step 509. If ICMP probing is automatically performed on host2 periodically when set to no route on AFTR1, then there is no step 609.
The two detection methods are easier to realize for the network. The second method only adds message for ICMP detection between AFTR and host2 link, and if route without host2 directly appears on AFTR, no more detection message is added, so the second method has less detection messages between B4 and AFTR, and less bandwidth occupation.
The method and the device utilize the B4 device to send the route detection indication to the AFTR so that the AFTR performs ICMP detection on the host, and the B4 device can learn that the route from the AFTR to the host is not passed if the ICMP unreachable information of the host returned by the AFTR is received. Therefore, when the route from the AFTR to the host is not communicated, the B4 equipment can also perform backup path switching, the limitation that the main AFTR and the backup AFTR can only take effect when the AFTR fails is overcome, the backup AFTR can play a role when the main AFTR fails to reach the remote host, the normal operation of communication is ensured, and the waste of system resources is reduced.
Fig. 11 is a flowchart illustrating a packet forwarding process in a DS-Lite networking diagram according to an embodiment of the present disclosure. Compared with fig. 2, as shown in fig. 11, the process of performing detection by the first method (constructing a detection message) includes:
after the B4 equipment receives an IPv4 message { IPv4dst:30.1.1.1, IPv4src:10.0.0.1, TCP dst:80 and TCP src:10000} of a host1 at a user network side, the IPv6 message { IPv6dst:2: 1, IPv6src:1, IPv4dst:30.1.1.1, IPv4src:10.0.0.1, TCP dst:80 and TCP src:10000} obtained by encapsulation is pkt1, and a detection message { IPv6dst:2: 1, IPv6src:1, IPv4dst:30.1.1.1, IPv4src: 10.0.0.0.1 and Type:8(echo ping) request } is obtained according to the pkt1 structure. And then sends the detection message to AFTR1 through the DS-Lite tunnel.
After receiving the detection message in the IPv6 format, AFTR1 performs ICMP detection on host 2. AFTR1 decapsulates the detection message { IPv6dst:2: 1, IPv6src:1, IPv4dst:30.1.1.1, IPv4src: 10.0.1, Type:8(echo (ping) request) } in IPv6 format, then performs NAT conversion to obtain ICMP message { IPv4dst:30.1.1.1, IPv4src:20.1.1.1, Type:8(echo (ping) request) }inIPv 4 format, and sends the ICMP message ICMP in IPv4 format to host 2.
If AFTR1 does not receive a response from host2, it indicates that host2 was detected as unreachable. For example, AFTR1 encapsulates the data to obtain a response message in IPv6 format { IPv6dst:1, IPv6src:2: 1, IPv4dst:10.0.0.1, IPv4src:30.1.1.1, Type:3, Code:1}, and then sends the response message to B4 equipment through a DS-Lite tunnel.
After receiving the response message indicating that the ICMP is unreachable, the B4 device modifies the static route and switches the message forwarding path from the first tunnel to the second tunnel.
Fig. 12 is a flowchart illustrating a packet forwarding process in a DS-Lite networking diagram according to an embodiment of the present disclosure. Compared with fig. 2, the process of performing probing by using the second method (modifying data packet) as shown in fig. 12 includes:
after the B4 device receives the IPv4 message { IPv4dst:30.1.1.1, IPv4src:10.0.0.1, TCP dst:80, TCP src:10000, Protocol: TCP Protocol number } of the host1 on the user network side, the Protocol number in the IPv4 message is modified to XXXX for example, and is encapsulated to obtain IPv6 message { IPv6dst:2: 1, IPv6src:1, IPv4dst:30.1.1.1, IPv4src:10.0.0.1, Protocol: XXXXXX, Type:8 (echo) (ping) request) }. And then sending the IPv6 message to AFTR1 through a DS-Lite tunnel.
After receiving the IPv6 message, AFTR1 performs ICMP detection on the destination IPv4 host 2. In this case, AFTR1 would send two messages to host 2. And one is a data message, and AFTR1 decapsulates the IPv6 message, then changes the Protocol number back to the original Protocol number, and performs NAT (network Address translation) conversion to obtain the data message { IPv4dst:30.1.1.1, IPv4src:20.1.1.1, TCP dst:80, TCP src:5000, Protocol: TCP Protocol number } in the IPv4 format. And the other is a message for ICMP detection, AFTR1 decapsulates the IPv6 message, performs NAT conversion, and constructs ICMP messages { IPv4dst:30.1.1.1, IPv4src:20.1.1.1, Type:8(echo (ping) request) }. And transmits the ICMP message to the host 2.
If AFTR1 does not receive a response from host2, it indicates that host2 was detected as unreachable. For example, AFTR1 does not receive the message returned by the host2, and then encapsulates the message to obtain a response message in IPv6 format { IPv6dst:1, IPv6src:2: 1, IPv4dst:10.0.0.1, IPv4src:30.1.1.1, Type:3, Code:1}, and sends the response message to the B4 device through a DS-Lite tunnel.
After receiving the response message indicating that the ICMP is unreachable, the B4 device modifies the static route and switches the message forwarding path from the first tunnel to the second tunnel.
Fig. 13 shows a block diagram of a route probing device according to an embodiment of the present disclosure. The routing detection device is applied to B4 equipment in a lightweight dual-protocol stack network, wherein the lightweight dual-protocol stack network further comprises a first host, a second host, a first AFTR and a second AFTR, a message forwarding path from the first host to the second host comprises a first tunnel and a second tunnel, the first tunnel is a tunnel between the B4 equipment and the first AFTR, and the second tunnel is a tunnel between the B4 equipment and the second AFTR.
As shown in fig. 13, in one embodiment, the route probing apparatus includes: a first sending module 71, configured to send a route detection instruction to a first afrr, where the route detection instruction is used to enable the first afrr to perform ICMP detection on a second host; a first receiving module 73, configured to switch a packet forwarding path from the first host to the second host from the first tunnel to the second tunnel if the ICMP unreachable information of the second host from the first AFTR is received.
In an implementation manner, referring to the first manner in the embodiment of the method, the first sending module 71 is further configured to:
constructing a detection message according to a first data message sent by the B4 device to a first AFTR at intervals of a first set period, wherein the detection message comprises an IPv4 header and an IPv6 header in the first data message, and the detection message further comprises an ICMP header, and the ICMP header is the routing detection indication;
and sending the detection message to the first AFTR.
In one implementation manner, referring to the second implementation manner in the method embodiment, the first sending module 71 is further configured to:
adding an ICMP probe identifier into a first data packet sent by the B4 device to the first afrr at an interval of a second set period, where the ICMP probe identifier is the route probe indication; the ICMP detection identifier is used for enabling the first AFTR to send a second data message to the second host so as to carry out ICMP detection on the second host;
and sending the first data message comprising the ICMP detection identifier to the first AFTR.
As shown in fig. 14, in one implementation, the apparatus further includes:
a mapping module 75, configured to generate a mapping relationship between the second host and a second afrr; and if the source address of the received data message to be forwarded is the first host and the destination address is the second host, sending the data message to be forwarded to the second host through a second AFTR in the second tunnel according to the mapping relation between the second host and the second AFTR.
As shown in fig. 14, in one implementation, the apparatus further includes:
a switching back module 79, configured to, when the second tunnel is used as the packet forwarding path from the first host to the second host, switch back the packet forwarding path from the first host to the second host from the second tunnel to the first tunnel if ICMP reachability information of the second host from the first AFTR is received, where the ICMP reachability information indicates that the route between the first AFTR and the second host is normal.
For example, if the B4 device uses the second tunnel as a packet forwarding path from the first host to the second host, the first AFTR periodically and automatically performs ICMP detection on the second host, and if it is detected that the second host is reachable, the first AFTR returns ICMP reachable information to the B4 device. After the B4 device receives the ICMP reachable information, the cutback module 79 performs a cutback procedure.
Further, in one implementation, the apparatus further comprises: a second sending module 77, configured to send a route detection indication to the first afrr if the second tunnel is used as a packet forwarding path from the first host to the second host.
In an implementation manner, if the B4 device uses the second tunnel as a packet forwarding path from the first host to the second host, the B4 device first sends a routing detection indication to the first afrr through the second sending module 77, the first afrr performs ICMP detection on the second host after receiving the routing detection indication, and if it is detected that the second host is reachable, the first AFTR returns ICMP reachable information to the B4 device. After the B4 device receives the ICMP reachable information, the cutback module 79 performs a cutback procedure.
The route detection device of this embodiment sets up on B4 equipment, through sending route detection instruction to AFTR to make AFTR carry out ICMP to the host computer and survey, if the unreachable information of ICMP of this host computer that receives AFTR returns, can learn AFTR to this host computer route is not passed through, and can carry out the switching of activestandby AFTR automatically, make backup AFTR play a role when main AFTR is not passed through to far-end host computer route, guarantee the normal clear of communication, reduce the waste to system's resource. Furthermore, after the route is recovered to be normal, the route detection device can also automatically switch back, the switching process is convenient, and time and labor are saved. And a temporary mapping relation is established on the routing detection device, IPv6 routing encapsulation change is carried out aiming at the message forwarding path fault of a specific host, and the message forwarding paths of other fault-free hosts are not influenced.
Fig. 15 shows a block diagram of a route probing apparatus according to another embodiment of the present disclosure. As shown in fig. 15, the route probing apparatus is applied to the first AFTR in the lightweight dual-protocol stack network. The lightweight dual-protocol stack network further comprises a first host, a second host, a B4 device and a second AFTR, wherein a message forwarding path from the first host to the second host comprises a first tunnel and a second tunnel, the first tunnel is a tunnel between the B4 device and the first AFTR, and the second tunnel is a tunnel between the B4 device and the second AFTR.
As shown in fig. 15, in one embodiment, the route probing apparatus includes: a third receiving module 91, configured to perform ICMP detection on the second host according to the received route detection instruction from the B4 device; a third sending module 93, configured to send ICMP unreachable information of the second host to the B4 device if it is detected that the second host is unreachable; the ICMP unreachable information is used to notify the B4 device of the route from the first afrr to the second host being not through, so that the B4 device switches the packet forwarding path from the first host to the second host from the first tunnel to the second tunnel.
In an implementation manner, referring to the first manner in the method embodiment, the third receiving module 91 is further configured to: if a detection message including a route detection indication from a B4 device is received, constructing an IPv4 header and an ICMP header in the detection message to obtain an ICMP message, and sending the ICMP message to the second host to perform ICMP detection on the second host.
The probe packet is constructed by the B4 device at intervals of a first set period (for example, at intervals of a first time or at intervals of a first number of packets, etc.), according to a first data packet sent by the B4 device to a first afrr, and includes an IPv4 header and an IPv6 header that are the same as the first data packet route, and further includes an ICMP header, where the ICMP header is the route probe indication.
In an implementation manner, referring to the second manner in the method embodiment, the third receiving module 91 is further configured to: if a first data message including a route detection indication from a B4 device is received, sending a second data message to the second host, copying an IPv4 header from the first data message, adding an ICMP identifier structure to obtain an ICMP message, and sending the ICMP message to the second host to perform ICMP detection on the second host.
Wherein, an ICMP probe identifier is added to the first data packet sent to the first AFTR at a second set period (for example, at a second time interval or at a second number of messages) and the like in the B4 device, and the ICMP probe identifier is the route probe indication.
In one implementation manner, the third sending module 93 is further configured to: and sending an echo message to the B4 equipment according to a first data message sent by the B4 equipment to the first AFTR, wherein the echo message comprises an IPv6 header, an IPv4 header and the ICMP unreachable information, which are opposite to the routing of the first data message.
As shown in fig. 16, in one implementation, the apparatus further includes:
a fourth sending module 97, configured to, when the B4 device uses the second tunnel as a packet forwarding path from the first host to the second host, send ICMP reachable information of the second host to the B4 device if it is detected that a route between the first afrr and the second host is normal after performing ICMP detection on the second host, so that the B4 device switches the packet forwarding path from the first host to the second host from the second tunnel to the first tunnel.
For example, if the B4 device uses the second tunnel as a packet forwarding path from the first host to the second host, the first afrr periodically and automatically performs ICMP probing on the second host. If the routing between the first afrr and the second host is detected to be normal, the second host is reachable, and the first afrr returns ICMP reachable information to the B4 device through the fourth sending module 97. After receiving the ICMP reachable information, the B4 device performs a handoff procedure.
Further, in one implementation, the apparatus further comprises:
a fourth receiving module 95, configured to receive the route probing indication sent by the B4 device when the route between the first afrr and the second host is unavailable.
For example, if the second tunnel is used as the message forwarding path, the B4 device first sends a routing detection indication to the first afrr periodically, the fourth receiving module 95 of the first afrr performs ICMP detection on the second host after receiving the routing detection indication, and if it is detected that the second host is reachable, the first afrr returns ICMP reachable information to the B4 device through the fourth sending module 97. After receiving the ICMP reachable information, the B4 device performs a handoff procedure.
The route detection device of this embodiment is disposed on the afrr, and performs ICMP detection on the host and sends the detection result to the B4 device after receiving a route detection instruction from the B4 device. If the B4 device receives the ICMP unreachable information of the host from the afr, it can know that the route from the afr to the host is not through, and can automatically switch the main and standby afrrs, so that the backup afrr can play a role when the route from the main afrr to the remote host is not through, ensure the normal operation of communication, and reduce the waste of system resources. Furthermore, after AFTR informs the B4 that the device route is recovered to be normal, the B4 device can also automatically switch back, the switching process is convenient, and time and labor are saved.
Fig. 17 is a block diagram of an apparatus for implementing a route probing method according to another embodiment of the present disclosure. Referring to fig. 17, an apparatus 900 for implementing the route probing method may include a processor 901 and a machine-readable storage medium 902 storing machine-executable instructions. The processor 901 and the machine-readable storage medium 902 may communicate via a system bus 903. The machine-readable storage medium 902 stores machine-executable instructions that are executable by the processor 901. Also, the processor 901 implements the route probing method described in any of the above embodiments by executing machine executable instructions in the machine readable storage medium 902 corresponding to the route probing method.
FIG. 18 shows a block diagram of a machine-readable storage medium according to an embodiment of the present disclosure. As shown in fig. 18, the machine-readable storage medium 902 stores machine-executable instructions that, when invoked and executed by the processor 901, cause the processor 901 to implement the route probing method described above.
The machine-readable storage medium 902 referred to herein may be any electronic, magnetic, optical, or other physical storage device that can contain or store information such as executable instructions, data, and the like. For example, the machine-readable storage medium may be: a RAM (random Access Memory), a volatile Memory, a non-volatile Memory, a flash Memory, a storage drive (e.g., a hard drive), a solid state drive, any type of storage disk (e.g., an optical disk, a dvd, etc.), or similar storage medium, or a combination thereof.
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 (10)

1. A route detection method is applied to a basic bridge broadband B4 device in a lightweight dual-protocol stack network, wherein the lightweight dual-protocol stack network further comprises a first host, a second host, a first network address translation router (AFTR) and a second AFTR, wherein a message forwarding path from the first host to the second host comprises a first tunnel and a second tunnel, the first tunnel is between the B4 device and the first AFTR, and the second tunnel is between the B4 device and the second AFTR;
the method comprises the following steps:
sending a route detection instruction to the first AFTR, wherein the route detection instruction is used for enabling the first AFTR to perform Internet control message protocol ICMP detection on a second host;
if ICMP unreachable information of the second host from the first AFTR is received, switching a message forwarding path from the first host to the second host from the first tunnel to the second tunnel;
under the condition that the second tunnel is used as a message forwarding path from the first host to the second host, if the ICMP reachable information of the second host from the first afrr is received, switching back the message forwarding path from the first host to the second host from the second tunnel to the first tunnel, wherein the ICMP reachable information indicates that the route between the first afrr and the second host is normal.
2. The method according to claim 1, wherein sending a route probe indication to the first AFTR comprises:
constructing a detection message according to a first data message sent by the B4 device to the first afrr at an interval of a first set period, where the detection message includes an IPv4 header and an IPv6 header in the first data message, and the detection message further includes an ICMP header, and the ICMP header is the routing detection indication;
and sending the detection message to the first AFTR.
3. The method according to claim 1, wherein sending a route probe indication to the first AFTR comprises:
adding an ICMP probe identifier into a first data packet sent by the B4 device to the first afrr at an interval of a second set period, where the ICMP probe identifier is the route probe indication; the ICMP detection identifier is used for enabling the first AFTR to send a second data message to the second host so as to carry out ICMP detection on the second host;
and sending the first data message comprising the ICMP detection identifier to the first AFTR.
4. A route detection method is applied to a first network address translation router (AFTR) in a lightweight dual-protocol stack network, wherein the lightweight dual-protocol stack network further comprises a first host, a second host, a basic bridging broadband B4 device and a second AFTR, wherein a message forwarding path from the first host to the second host comprises a first tunnel and a second tunnel, the first tunnel is a tunnel between the B4 device and the first AFTR, and the second tunnel is a tunnel between the B4 device and the second AFTR;
the method comprises the following steps:
performing Internet Control Message Protocol (ICMP) detection on a second host according to the received routing detection indication from the B4 equipment;
if the second host is detected to be unreachable, sending ICMP unreachable information of the second host to the B4 device; the ICMP unreachable information is used to notify the B4 device of a route failure from the first afrr to the second host, so that the B4 device switches a packet forwarding path from the first host to the second host from the first tunnel to the second tunnel;
under the condition that the B4 device uses the second tunnel as the packet forwarding path from the first host to the second host, if the routing between the first AFTR and the second host is detected to be normal after ICMP detection is performed on the second host, sending ICMP reachable information of the second host to the B4 device, so that the B4 device switches the packet forwarding path from the first host to the second host from the second tunnel back to the first tunnel.
5. A routing detection apparatus, applied to a basic bridge broadband B4 device in a lightweight dual-protocol stack network, where the lightweight dual-protocol stack network further includes a first host, a second host, a first network address translation router (afrr), and a second afrr, where a packet forwarding path from the first host to the second host includes a first tunnel and a second tunnel, the first tunnel is between the B4 device and the first afrr, and the second tunnel is between the B4 device and the second afrr;
the device comprises:
a first sending module, configured to send a route detection instruction to the first afrr, where the route detection instruction is used to enable the first afrr to perform internet control message protocol ICMP detection on a second host;
a first receiving module, configured to switch a packet forwarding path from the first host to the second host from the first tunnel to the second tunnel if receiving ICMP unreachable information of the second host from the first AFTR;
the device further comprises:
a switching back module, configured to, when the second tunnel is used as a packet forwarding path from the first host to the second host, switch back the packet forwarding path from the first host to the second host from the second tunnel to the first tunnel if ICMP reachability information of the second host from the first AFTR is received, where the ICMP reachability information indicates that a route between the first AFTR and the second host is normal.
6. The apparatus of claim 5, wherein the first sending module is further configured to:
constructing a detection message according to a first data message sent by the B4 device to the first afrr at an interval of a first set period, where the detection message includes an IPv4 header and an IPv6 header in the first data message, and the detection message further includes an ICMP header, and the ICMP header is the routing detection indication;
and sending the detection message to the first AFTR.
7. The apparatus of claim 5, wherein the first sending module is further configured to:
adding an ICMP probe identifier into a first data packet sent by the B4 device to the first afrr at an interval of a second set period, where the ICMP probe identifier is the route probe indication; the ICMP detection identifier is used for enabling the first AFTR to send a second data message to the second host so as to carry out ICMP detection on the second host;
and sending the first data message comprising the ICMP detection identifier to the first AFTR.
8. A routing detection apparatus, which is applied to a first network address translation router (AFTR) in a lightweight dual-protocol stack network, where the lightweight dual-protocol stack network further includes a first host, a second host, a basic bridging broadband B4 device, and a second AFTR, where a packet forwarding path from the first host to the second host includes a first tunnel and a second tunnel, the first tunnel is a tunnel between the B4 device and the first AFTR, and the second tunnel is a tunnel between the B4 device and the second AFTR;
the device comprises:
a third receiving module, configured to perform internet control message protocol ICMP detection on the second host according to the received route detection instruction from the B4 device;
a third sending module, configured to send an ICMP unreachable message of the second host to the B4 device if it is detected that the second host is unreachable; the ICMP unreachable information is used to notify the B4 device of a route failure from the first afrr to the second host, so that the B4 device switches a packet forwarding path from the first host to the second host from the first tunnel to the second tunnel;
the device further comprises:
a fourth sending module, configured to, when the B4 device uses the second tunnel as a packet forwarding path from the first host to the second host, send ICMP reachable information of the second host to the B4 device if it is detected that a route between the first afrr and the second host is normal after performing ICMP detection on the second host, so that the B4 device switches the packet forwarding path from the first host to the second host from the second tunnel to the first tunnel.
9. An implementation apparatus of a route probing method is characterized by comprising: a processor and a machine-readable storage medium storing machine-executable instructions executable by the processor to implement the route probing method of any one of claims 1 to 4.
10. A machine-readable storage medium having stored thereon machine-executable instructions which, when invoked and executed by a processor, cause the processor to implement the route probing method of any one of claims 1 to 4.
CN201710599002.0A 2017-07-21 2017-07-21 Route detection method and device Active CN107547376B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710599002.0A CN107547376B (en) 2017-07-21 2017-07-21 Route detection method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710599002.0A CN107547376B (en) 2017-07-21 2017-07-21 Route detection method and device

Publications (2)

Publication Number Publication Date
CN107547376A CN107547376A (en) 2018-01-05
CN107547376B true CN107547376B (en) 2020-07-07

Family

ID=60971062

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710599002.0A Active CN107547376B (en) 2017-07-21 2017-07-21 Route detection method and device

Country Status (1)

Country Link
CN (1) CN107547376B (en)

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1716954A (en) * 2005-05-27 2006-01-04 清华大学 Method for intercommunication between IP V6 network and IPV4 network based on transit mechanism
CN101207546A (en) * 2006-12-18 2008-06-25 华为技术有限公司 Method for dynamically establishing tunnel, tunnel server and system thereof
CN102170395A (en) * 2011-04-21 2011-08-31 中兴通讯股份有限公司 Data transmission method and network equipment
CN102377628A (en) * 2010-08-12 2012-03-14 杭州华三通信技术有限公司 Method for establishing DS-Lite tunnel and DS-Lite CGN
CN102523312A (en) * 2011-12-02 2012-06-27 清华大学 Method for optimal tunnel selection in 4over6 scene
CN102780567A (en) * 2011-05-09 2012-11-14 中兴通讯股份有限公司 Multicast service bearing method and system for DS-lite network architecture as well as network node
CN102932255A (en) * 2012-09-06 2013-02-13 华为技术有限公司 Method and device for selecting tunnel path
CN103118145A (en) * 2013-01-18 2013-05-22 清华大学 IPv4-over-IPv6 multi-tunnel automatic establishment method based on DNS (domain name system)
CN103227787A (en) * 2013-04-09 2013-07-31 清华大学 Automatic 4over6 tunnel establishment method based on ARP proxy

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101447900A (en) * 2008-12-15 2009-06-03 华为技术有限公司 Method, system and device for building bidirectional forwarding detection
CN103490951A (en) * 2013-09-09 2014-01-01 神州数码网络(北京)有限公司 Bidirectional forwarding detection method in multi-hop link on basis of BFD
CN104270298B (en) * 2014-09-30 2018-10-09 新华三技术有限公司 Message forwarding method and device in a kind of VXLAN networks

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1716954A (en) * 2005-05-27 2006-01-04 清华大学 Method for intercommunication between IP V6 network and IPV4 network based on transit mechanism
CN101207546A (en) * 2006-12-18 2008-06-25 华为技术有限公司 Method for dynamically establishing tunnel, tunnel server and system thereof
CN102377628A (en) * 2010-08-12 2012-03-14 杭州华三通信技术有限公司 Method for establishing DS-Lite tunnel and DS-Lite CGN
CN102170395A (en) * 2011-04-21 2011-08-31 中兴通讯股份有限公司 Data transmission method and network equipment
CN102780567A (en) * 2011-05-09 2012-11-14 中兴通讯股份有限公司 Multicast service bearing method and system for DS-lite network architecture as well as network node
CN102523312A (en) * 2011-12-02 2012-06-27 清华大学 Method for optimal tunnel selection in 4over6 scene
CN102932255A (en) * 2012-09-06 2013-02-13 华为技术有限公司 Method and device for selecting tunnel path
CN103118145A (en) * 2013-01-18 2013-05-22 清华大学 IPv4-over-IPv6 multi-tunnel automatic establishment method based on DNS (domain name system)
CN103227787A (en) * 2013-04-09 2013-07-31 清华大学 Automatic 4over6 tunnel establishment method based on ARP proxy

Also Published As

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

Similar Documents

Publication Publication Date Title
US7486670B2 (en) Method for packet communication and computer program stored on computer readable medium
US7657642B2 (en) IP network node and middleware for establishing connectivity to both the IPv4 and IPv6 networks
KR101785760B1 (en) Method and network element for enhancing ds-lite with private ipv4 reachability
US8824480B2 (en) Method and apparatus for end-host based mobility, multi-homing and multipath protocols
US7388829B2 (en) Method and apparatus for detecting and recovering from faults associated with transport protocol connections across network address translators
WO2015180559A1 (en) Fault detection method and apparatus for service chain
US6996084B2 (en) Publishing node information
CN112671628B (en) Business service providing method and system
CN110535768B (en) Multicast data transmission method and related equipment
US8891551B2 (en) IPv6 over IPv4 transition method and apparatus for improving performance of control server
CN105591907B (en) A kind of route obtaining method and device
US20020078238A1 (en) Routing messages between nodes at a foreign sub-network
CN112671938B (en) Business service providing method and system and remote acceleration gateway
US20230208757A1 (en) Packet Transmission Method, Apparatus, and System
US20020075866A1 (en) Delivering messages to a node at a foreign network
US7028099B2 (en) Network communication between hosts
CN105813055A (en) Roaming method based on IP and roaming device
Ishiyama et al. An analysis of mobility handling in LIN6
WO2013071825A1 (en) Device and method for realizing identity and locator separation network
JP4282648B2 (en) Communication apparatus and access method
CN107547376B (en) Route detection method and device
TW202249464A (en) Method for routing of cellular data packets using ip networks
TW202249466A (en) System and method for performing pfcp session load balancer
CN107547672B (en) Router switching method and device
CN108540343B (en) Path detection method and device

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
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20230627

Address after: 310052 11th Floor, 466 Changhe Road, Binjiang District, Hangzhou City, Zhejiang Province

Patentee after: H3C INFORMATION TECHNOLOGY Co.,Ltd.

Address before: No. 466, Changhe Road, Binjiang District, Hangzhou, Zhejiang 310052

Patentee before: NEW H3C TECHNOLOGIES Co.,Ltd.