Patent Description:
<NPL> describes three Dynamic Multipoint Virtual Private Network (DMVPN) core topology designs, wherein as the scale increases handling of routing information and Next Hop Resolution Protocol (NHRP) tables is considered. Further, regarding a hierarchical hub DMVPN design, an option using Dead Peer Detection (DPD) on hubs and spokes is applied to increase stability of the design.

<CIT> relates to a method for establishing a route by linking routing information protocol (RIP) with bidirectional forwarding detection (BFD). By adopting the method, the phenomenon that an RIP route cannot be deleted or is oscillated in case of single-pass of a link can be avoided.

An auto discovery virtual private network (auto discovery virtual private network, ADVPN) allows a hub (hub) node as a central node to use a static Internet protocol (Internet Protocol, IP) address, and a router (spoke) node as a branch node may use a dynamic IP address. The hub node establishes a static tunnel with each spoke node by using a multipoint generic routing encapsulation protocol (multipoint generic routing encapsulation, MGRE) interface. Data traffic between spokes may be transmitted by using a dynamic tunnel established between the spokes, and does not need to be forwarded by a hub, thereby reducing overheads of the hub node.

The dynamic tunnels between the spoke nodes may be established by using a next hop resolution protocol (next hop resolution protocol, NHRP). The NHRP protocol is used to resolve a problem of how a source spoke node obtains a dynamic public IP address of a destination spoke node.

An existing solution only resolves a keepalive problem between the spoke node and the hub node. However, in the prior art, there is no effective way to resolve a problem of how to restore the data traffic between the spoke nodes after a link between the spoke nodes is interrupted.

This application provides a communications connection detection method and apparatus, to provide an effective way to restore transmission of data traffic between spoke nodes.

According to a first aspect, an embodiment of the invention provides a communications connection detection method, according to claim <NUM>, including: sending, by a first network node, a detection request packet to a second network node, where the detection request packet is used to detect whether the first network node and the second network node are in a connected mode; and deleting, by the first network node, an NHRP table when the first network node determines that the first network node does not receive a detection response packet sent by the second network node, where the detection response packet is a response packet in response to the detection request packet, and the NHRP table is used to forward data traffic between the first network node and the second network node.

Currently, when a link fault occurs between the two nodes, the NHRP table between the first network node and the second network node does not automatically disappear before the NHRP table ages. Before the NHRP table ages, the first network node still sends the data traffic between the first network node and the second network node based on the NHRP table, so that a transmission resource of the first network node is occupied. According to the manner provided in this embodiment of this application, the first network node serves as a detection initiation device, and after determining that the first network node does not receive the detection response packet sent by the second network node, deletes the NHRP table used to forward the data traffic between the first network node and the second network node. In this way, when a link fault occurs between the two nodes, it can be ensured that the data traffic is no longer sent and the transmission resource is no longer occupied.

In this embodiment of this application, when both the first network node and the second network node are branch nodes, after the first network node deletes the NHRP table between the first network node and the second network node, the NHRP table is no longer queried, and the data traffic transmitted between the first network node and the second network node is forwarded by a central node, where the NHRP table is used by the first network node to forward data traffic to the second network node by using a tunnel established between the first network node and the second network node. In this way, after a fault occurs in the tunnel established between the first network node and the second network node, transmission of the data traffic between the first network node and the second network node is restored. Therein, the first network node and the second network node are spoke nodes and the central node is a hub node.

The foregoing method may be applied without being limited to a multipoint generic routing encapsulation protocol GRE tunnel network. Certainly, other networking modes in which NHRP can be applied are all applicable to this embodiment of this application.

In a possible design, when the first network node does not receive data traffic sent by the second network node, the first network node sends the detection request packet to the second network node. When the first network node can receive the data traffic transmitted by the second network node, it can be determined that the link between the first network node and the second network node is normal. Therefore, when the first network node does not receive the data traffic transmitted by the second network node, that is, when data traffic receiving is stopped, the first network node may send the detection request package to the second network node. In this way, whether the traffic between the two nodes is stopped because of a link fault can be determined in advance, thereby improving reliability of discovering the link fault.

In a possible implementation, when the first network node does not receive, within first preset duration, data traffic sent by the second network node, the first network node sends the detection request packet to the second network node. A reason why the first network node does not receive the data traffic sent by the second network node may be that the data traffic sent by the second network node to the first network node is transmitted completely. Therefore, the first network node may send the detection request packet to the second network node when duration in which the first network node does not receive the data traffic sent by the second network node reaches the first preset duration, that is, when duration in which data traffic receiving is stopped reaches the first preset duration. In this way, whether the traffic between the two nodes is stopped because of a link fault can be determined in advance, thereby improving reliability of discovering the link fault.

In a possible design, when the first network node does not receive data traffic sent by the second network node and stops sending data traffic to the second network node, the first network node sends the detection request packet to the second network node. When the first network node does not receive the data traffic sent by the second network node, the first network node does not trigger sending of the detection request packet if the first network node is sending the data traffic to the second network node, and the first network node sends the detection request packet to the second network node only when the first network node stops sending the data traffic to the second network node. In other words, the first network node sends the detection request packet to the second network node only when the first network node does not send the data traffic to the second network node and does not receive the data traffic sent by the second network node.

In a possible design, when duration in which the first network node does not receive data traffic sent by the second network node and stops sending data traffic to the second network node exceeds second preset duration, the first network node sends the detection request packet to the second network node.

In a possible design, that the first network node determines that the first network node does not receive a detection response packet sent by the second network node includes:
determining, by the first network node, that the detection response packet sent by the second network node is not received within third preset duration; or determining, by the first network node, that the detection response packet sent by the second network node is not received within third preset duration, and that the detection response packet sent by the second network node is not received after the detection request packet is repeatedly sent to the second network node for N times, where N is an integer greater than <NUM>.

The foregoing design provides two simple and effective manners for determining that the first network node does not receive the detection response packet sent by the second network node.

In a possible design, the detection request packet is an NHRP packet, the NHRP packet includes a first field, and the first field is used to indicate that the NHRP packet is a packet used to detect whether the first network node and the second network node are in a connected mode.

In the foregoing design, a protocol packet existing in a multipoint GRE tunnel network, that is, an NHRP protocol packet, is used, without a need to configure another detection packet, such as BFD, for each node in the network, thereby saving resources of the nodes.

In a possible design, the NHRP packet further includes a second field, and the second field is used by the second network node to detect whether the detection request packet is secure. This improves security of the detection request packet, thereby improving link security.

In a possible design, the NHRP packet further includes a third field, the third field is used to indicate a sequence number of the NHRP packet, and the sequence number is used to indicate whether the NHRP packet is a replay packet. This protects, to some extent, the network node from being attacked.

In a possible design, the detection request packet is a dead peer detection DPD packet. An IP security association technology is used in a multipoint GRE tunnel network. Therefore, a DPD packet of the IP security association technology is used, without a need to configure another detection packet, such as BFD, for each node in the network, thereby saving resources of the nodes.

In a possible design, when the first network node determines that the first network node does not receive the detection response packet sent by the second network node, the method further includes: deleting, by the first network node, IP security association information, where the IP security association information is used to encrypt the data traffic transmitted between the first network node and the second network node.

In the foregoing design, when a fault occurs in a transmission link between the first network node and the second network node, the IP security association information is deleted in time, thereby saving storage resources of the nodes.

In a possible design, when the first network node determines that the first network node does not receive the detection response packet sent by the second network node, the first network node deletes the NHRP table between the first network node and the second network node, and the first network node restores an aggregated routing function between the first network node and the central node, where the aggregated routing function is used to forward, by using the central node, the data traffic transmitted between the first network node and the second network node.

According to the foregoing design, after a link fault occurs between the two branch nodes, forwarding by the central node may be restored, thereby restoring transmission of the data traffic between the branch nodes.

In a possible design, when the first network node determines that the first network node does not receive the detection response packet sent by the second network node, the method further includes: sending, by the first network node, an alarm signal, where the alarm signal is used to indicate that a fault occurs in the transmission link between the first network node and the second network node.

According to the foregoing design, when a fault occurs in the transmission link between the first network node and the second network node, a user may be reminded, so that the user can repair the link fault in time.

According to a second aspect, based on a same inventive concept as the foregoing embodiment of the first aspect, an embodiment of the invention provides a communications connection detection apparatus, according to claim <NUM>, where the apparatus is applied to a first network node, and includes:.

In the foregoing manner, the first network node serves as a detection initiation device, and after determining that the second network node does not receive the detection request packet, deletes the NHRP table used to forward the data traffic between the first network node and the second network node. In this way, when a link fault occurs between the two nodes, it can be ensured that the data traffic is no longer sent and a transmission resource is no longer occupied.

In a possible design, the apparatus further includes:.

According to the foregoing design, reliability of discovering the link fault can be improved.

In a possible design, when determining that the first receiving module does not receive the detection response packet sent by the second network node, the processing module is specifically configured to:.

The foregoing design provides two simple and effective manners for determining that the first receiving module does not receive the detection response packet sent by the second network node.

In a possible design, the detection request packet is an NHRP packet, the NHRP packet includes a first field, and the first field is used to indicate that the NHRP packet is a packet used to detect whether the first network node and the second network node are in a connected mode. In the foregoing design, a protocol packet existing in a multipoint GRE tunnel network, that is, an NHRP protocol packet, is used, without a need to configure another detection packet, such as BFD, for each node in the network, thereby saving resources of the nodes.

In a possible design, the NHRP packet further includes a second field, and the second field is used by the network node to detect whether the detection request packet is secure. This improves security of the detection request packet, thereby improving link security.

In a possible design, the processing module is further configured to delete IP security association information when determining that the first receiving module does not receive the detection response packet sent by the second network node, where the IP security association information is used to encrypt the data traffic transmitted between the first network node and the second network node. In the foregoing design, when a fault occurs in a transmission link between the first network node and the second network node, the IP security association information is deleted in time, thereby saving storage resources of the nodes.

In a possible design, the processing module is further configured to restore an aggregated routing function between the first network node and the central node when determining that the first receiving module does not receive the detection response packet sent by the second network node, where the aggregated routing function is used by the processing module to forward, by using the central node, the data traffic transmitted between the first network node and the second network node. According to the foregoing design, after a link fault occurs between the two branch nodes, forwarding by the central node may be restored, thereby restoring transmission of the data traffic between the branch nodes.

In a possible design, the processing module is further configured to send an alarm signal when determining that the first receiving module does not receive the detection response packet sent by the second network node, where the alarm signal is used to indicate that a fault occurs in the transmission link between the first network node and the second network node. According to the foregoing design, when a fault occurs in the transmission link between the first network node and the second network node, a user may be reminded, so that the user can repair the link fault in time.

According to a third aspect, an embodiment of this application provides a communications connection detection network node, including a communications interface, a memory, and a processor, where.

According to a fourth aspect, an embodiment of this application provides a computer storage medium, where the computer readable storage medium stores a computer executable instruction, and the computer executable instruction is used to enable the computer to execute the method according to any design of the first aspect.

According to a fifth aspect, an embodiment of this application provides a chip, where the chip is connected to a memory, and is configured to read and execute a software program stored in the memory, to implement the method according to any design of the first aspect.

Embodiments of the invention propose a communications connection detection method and apparatus. When a tunnel established between a first network node and a second network node is faulty, an NHRP table is deleted, so that when a link fault occurs between the two nodes, it can be ensured that data traffic is no longer sent and a transmission resource is no longer occupied. Further, forwarding, by a central node, of data traffic transmitted between the first network node and the second network node may be triggered, thereby restoring transmission of the data traffic between the first network node and the second network node. The method and the apparatus are based on a same inventive concept. The method and the apparatus have similar problem-resolving principles. Therefore, for implementations of the apparatus and the method, reference may be made to each other. Details are not described repeatedly.

The communications connection detection method and apparatus proposed in the embodiments of this application may be applied without being limited to a multipoint GRE tunnel network, and other networking modes in which an NHRP protocol can be applied are all applicable to this application. In the embodiments of this application, that the communications connection detection method and apparatus are applied to the multipoint GRE tunnel network is used as an example for description. The multipoint GRE tunnel network includes one central node and a plurality of branch nodes. As shown in <FIG>, a multipoint GRE tunnel network includes one central node, for example, a hub node in <FIG>, and further includes two branch nodes, for example, a spoke <NUM> and a spoke <NUM> in <FIG>. A hub-spoke tunnel is established between the hub node and each of the two spoke nodes, and a spoke-spoke tunnel is established between the spoke <NUM> and the spoke <NUM> based on the NHRP protocol. Data traffic between the spoke <NUM> and the spoke <NUM> may be transmitted by using the spoke-spoke tunnel.

A network node mentioned in the embodiments of this application may be a central node or may be a branch node. "A plurality of" mentioned in the embodiments of this application means two or more.

In addition, it should be understood that, in the description of this application, terms such as "first" and "second" are used only for distinguishing between descriptions, but cannot be understood as an indication or implication of relative importance, and cannot be understood as an indication or implication of a sequence.

<FIG> is a schematic flowchart of a communications connection detection method according to an embodiment of this application.

A first network node sends a detection request packet to a second network node, where the detection request packet is used to detect whether the first network node and the second network node are in a connected mode. After the first network node sends the detection request packet to the second network node, when receiving the detection request packet sent by the first network node, the second network node sends a detection response packet to the first network node. The detection response packet is a response packet in response to the detection request packet.

The first network node deletes an NHRP table between the first network node and the second network node when the first network node determines that the first network node does not receive the detection response packet sent by the second network node, where the NHRP table is used to forward data traffic between the first network node and the second network node.

Currently, when a link fault occurs between the two nodes, the NHRP table between the first network node and the second network node does not automatically disappear before the NHRP table ages. Before the NHRP table ages, the first network node still sends the data traffic between the first network node and the second network node based on the NHRP table, so that a transmission resource of the first network node is occupied. According to the manner provided in this embodiment of this application, the first network node serves as a detection initiation device, and after determining that the second network node does not receive the detection request packet, deletes the NHRP table used to forward the data traffic between the first network node and the second network node. In this way, when a link fault occurs between the two nodes, it can be ensured that the data traffic is no longer sent and the transmission resource of the first network node is no longer occupied.

In this embodiment of this application, when both the first network node and the second network node are branch nodes, the NHRP table between the first network node and the second network node is used by the first network node to forward data traffic to the second network node by using a tunnel established between the first network node and the second network node. Based on this, the first network node deletes the NHRP table between the first network node and the second network node. In other words, when the first network node determines that the data traffic needs to be sent to the second network node, the NHRP table between the first network node and the second network node is no longer queried, so that the data traffic transmitted between the first network node and the second network node needs to be directed to a central node. This further ensures that when a fault occurs in the tunnel established between the first network node and the second network node, transmission of the data traffic between the first network node and the second network node is restored.

In this embodiment of this application, when both the first network node and the second network node are branch nodes, when determining that the first network node does not receive the detection response packet sent by the second network node, the first network node deletes the NHRP table used to forward the data traffic between the first network node and the second network node. In a first manner, an aggregated routing function is restored by default after the NHRP table is deleted, where the aggregated routing function is used to forward, by using the central node, the data traffic transmitted between the first network node and the second network node. In a second manner, an aggregated routing function is not restored by default after NHRP is deleted. In the second manner, after the first network node deletes the NHRP table used to forward the data traffic between the first network node and the second network node, an aggregated routing function between the first network node and the central node is restored. In this way, after a link fault occurs between the two branch nodes, forwarding by the central node may be restored, thereby restoring transmission of the data traffic between the branch nodes.

In this embodiment of this application, that the first network node determines that the first network node does not receive the detection response packet sent by the second network node may be implemented in the following manners:.

The first network node determines that the detection response packet sent by the second network node is not received within third preset duration. Specifically, when the detection response packet sent by the second network node is not received within the third preset duration after the first network node sends the detection request packet to the second network node, the NHRP table between the first network node and the second network node is deleted.

The first network node determines that the detection response packet sent by the second network node is not received within third preset duration, and that after the detection request packet is repeatedly sent to the second network node for N times, the detection response packet sent by the second network node is not received. Specifically, if the detection response packet sent by the second network node is not received within the third preset duration after the first network node sends the detection request packet to the second network node, the detection request packet is resent. If the detection response packet sent by the second network node is not received after the detection request packet is repeatedly sent for N times, the first network node deletes the NHRP table between the first network node and the second network node.

Specifically, refer to <FIG>. After S201 in which the first network node sends the detection request packet to the second network node, S301 or S303 may be further included.

The second network node sends the detection response packet to the first network node when receiving the detection request packet.

The first network node receives, within the third preset duration, the detection response packet sent by the second network node, and determines that a link between the first network node and the second network node is normal.

The first network node does not receive, within the third preset duration, the detection response packet sent by the second network node.

The first network node determines that a maximum quantity N of times of retransmission is not reached, and resends the detection request packet to the second network node.

The first network node does not receive, within the third preset duration, the detection response packet sent by the second network node.

The first network node determines that the maximum quantity N of times of retransmission is reached.

The first network node deletes the NHRP table between the first network node and the second network node.

The first network node is a spoke node. The second network node is a spoke node.

For example, as shown in <FIG>, when a multipoint GRE tunnel network is established, two spokes and a hub learn of an NHRP table and a routing table by using an NHRP protocol.

An IP address of a subnet in which the hub is located is <NUM>. <NUM>/<NUM>, a public IP address (GE1/<NUM>/<NUM>) of the hub is <NUM>. <NUM>/<NUM>, and a tunnel interface address (tunnel <NUM>/<NUM>/<NUM>) of the hub is <NUM>. <NUM>/<NUM>. An IP address of a subnet in which a spoke <NUM> is located is <NUM>. <NUM>/<NUM>, a public IP address of the spoke <NUM> is <NUM>. <NUM>/<NUM>, and a tunnel interface address of the spoke <NUM> is <NUM>. <NUM>/<NUM>. An IP address of a subnet in which a spoke <NUM> is located is <NUM>. <NUM>/<NUM>, a public IP address of the spoke <NUM> is <NUM>. <NUM>/<NUM>, and a tunnel interface address of the spoke <NUM> is <NUM>. <NUM>/<NUM>.

A public IP address of each node may be considered as a non-broadcast multiple access network (Non-Broadcast Multiple Access, NBMA) address. Same as an IP address of another physical interface, a tunnel interface address is also used in communication between the nodes (for example, obtaining routing information). An IP address of a node in a subnet is an IP address in a local area network.

The routing table is used to represent a correspondence between public IP addresses and tunnel interface addresses of different nodes. The NHRP table is used to represent an IP address of a next hop corresponding to a destination IP address of data traffic, as shown in blocks in <FIG>. The destination IP address of the data traffic is an IP address of a subnet in which a target node is located, and the IP address of the corresponding next hop is a tunnel interface address of a tunnel established between a source node and the target node on the source node. For example, for data traffic sent from the spoke <NUM> to the spoke <NUM>, a destination IP address of the data traffic is <NUM>. <NUM>, and an IP address of a corresponding next hop is <NUM>. Currently, if a link fault occurs between the spoke <NUM> and the spoke <NUM>, an NHRP table between the spoke <NUM> and the spoke <NUM> does not automatically disappear before the NHRP table ages. Before the NHRP table ages, traffic to be sent from the spoke <NUM> to the spoke <NUM> is still sent after the NHRP table is queried, so that a transmission resource of the spoke <NUM> is occupied.

Therefore, according to the solution provided in this embodiment of this application, the first network node serves as the detection initiation device, and after determining that the detection response packet sent by the second network node is not received, deletes the NHRP table used to forward the data traffic between the first network node and the second network node, so that when a link fault occurs between the two nodes, it can be ensured that the data traffic is no longer sent and the transmission resource is no longer occupied.

In the prior art, keepalive between a spoke node and a hub node is implemented by using a bidirectional forwarding detection (bidirectional forwarding detection, BFD) packet. BFD is a conventional link detection method. The BFD packet may be applied to link detection between spoke nodes. The BFD detection first requires that all spoke nodes in an entire network support and are configured with a BFD protocol. However, in an asynchronous mode of the BFD protocol, a BFD packet is always sent periodically, exerting pressure on the spoke nodes in the entire network and resulting in a waste of resources.

In a possible implementation, when the first network node does not receive data traffic sent by the second network node, the first network node sends the detection request packet to the second network node. The first network node can determine that the link between the first network node and the second network node is normal when the data traffic transmitted by the second network node can be received. Therefore, when the first network node does not receive the data traffic transmitted by the second network node, that is, when data traffic receiving is stopped, the first network node may send the detection request package to the second network node. The first network node may repeatedly send the detection request packet at a preset time interval, and stop sending the detection request packet until the detection response packet sent by the second network node is received or a preset quantity of times (for example, N times) of retransmission is reached. In this way, whether the traffic between the two nodes is stopped because of a link fault can be determined in advance, thereby improving reliability of discovering the link fault. In addition, resources are saved in comparison with the prior art.

In another possible implementation, when the first network node does not receive, within first preset duration, data traffic sent by the second network node, the first network node sends the detection request packet to the second network node. A reason why the first network node does not receive the data traffic sent by the second network node may be that the data traffic sent by the second network node to the first network node is transmitted completely. Therefore, the first network node may send the detection request packet to the second network node when duration in which the first network node does not receive the data traffic sent by the second network node reaches the first preset duration, that is, when duration in which data traffic receiving is stopped reaches the first preset duration. The first network node may repeatedly send the detection request packet at a preset time interval, and stop sending the detection request packet until the detection response packet sent by the second network node is received or a preset quantity of times (for example, N times) of retransmission is reached. In this way, whether the traffic between the two nodes is stopped because of a link fault can be determined in advance, thereby improving reliability of discovering the link fault.

In still another possible implementation, when the first network node does not receive data traffic sent by the second network node and stops sending data traffic to the second network node, the first network node sends the detection request packet to the second network node. When the first network node does not receive the data traffic sent by the second network node, the first network node does not trigger sending of the detection request packet if the first network node is sending the data traffic to the second network node, and the first network node sends the detection request packet to the second network node only when the first network node stops sending the data traffic to the second network node. In other words, the first network node sends the data traffic to the second network node only when the first network node does not send the data traffic to the second network node and does not receive the data traffic sent by the second network node. In comparison with the previous two possible implementations, more processing resources are saved.

In still another possible implementation, when duration in which the first network node does not receive data traffic sent by the second network node and stops sending data traffic to the second network node exceeds second preset duration, the first network node sends the detection request packet to the second network node.

In this embodiment of this application, the detection request packet may be an NHRP packet. Specifically, in this embodiment of this application, on a basis of an NHRP standard packet, a new packet type may be defined and used to detect whether the first network node and the second network node are in a connected mode.

The NHRP packet defined in this embodiment of this application may include a first field, and the first field is used to indicate that the NHRP packet is a packet used to detect whether the first network node and the second network node are in a connected mode. Refer to a field "type=<NUM>" shown in <FIG>. When extension type=<NUM>, it indicates that the packet is a packet for detecting whether the first network node and the second network node are in a connected mode.

The NHRP packet defined in this embodiment of this application may further include a second field, and the second field is used by the second network node to detect whether the detection request packet is secure. The second field may be an authentication field in the NHRP packet. The first network node obtains a configured password, and generates content of the authentication field by using the configured password. Therefore, when receiving the NHRP packet, the second network node determines, based on the configured password, whether the NHRP packet is secure. The authentication field may be located between a packet header and a data field in the NHRP packet.

The NHRP packet defined in this embodiment of this application may further include a third field, the third field is used to indicate a sequence number of the NHRP packet, and the sequence number is used to indicate whether the NHRP packet is a replay packet. Sequence numbers may be sequence numbers that increase from <NUM>, the sequence numbers are not allowed to be duplicate, and each sequence number uniquely identifies one sent data traffic packet. The second network node defends against a replay packet attack based on the sequence number in combination with an anti-replay window and packet verification. For example, if the sequence number of the packet does not fall in the anti-replay window, the packet is considered as a normal packet. If the sequence number of the packet falls in the anti-replay window and falls on a right side of the anti-replay window, it is verified that the packet is a normal packet, and a right border of the anti-replay window is slid to the sequence number. If the sequence number of the packet falls on a left side of the anti-replay window, it is determined that the packet is a replay packet.

<FIG> shows the NHRP packet defined in this embodiment of this application, where a "sequence number" field is the third field. The authentication field may be located behind the "sequence number" field shown in <FIG>.

In <FIG>, "snap" represents that the NHRP packet may use a subnetwork access protocol (subnetwork access protocol, SNAP) to encode transmitted data traffic; "protocol_type" represents a protocol type used by the Ethernet layer; "hop_count" represents a hop count and is used to indicate a maximum quantity of hops allowed for an NHRP data traffic packet; "packet_size" represents a size of the NHRP data traffic packet; "checksum" represents a checksum for correcting an error of an NHRP packet header; a source NBMA address is a public IP address of a source node; a source NBMA subnet address is a subnet address of the source node; a source protocol address is a tunnel interface address of the source node; a destination protocol address is a next hop address, that is, a tunnel interface address of a destination node to be detected; "C" is used to specify a function of the NHRP packet; and "U" is an unused bit.

In this embodiment of this application, an IPsec SA (security association) technology may be further used in a multipoint GRE tunnel network. When the IPsec SA (security association) technology is used in the multipoint GRE tunnel network, the detection request packet may be the foregoing NHRP packet, or a dead peer detection (dead peer detection, DPD) packet in the IPsec SA (security association) technology may be used.

In this embodiment of this application, when the IPsec SA (security association) technology is used in the multipoint GRE tunnel network, in step S202, when the first network node determines that the first network node does not receive the detection response packet sent by the second network node, the first network node may further delete IP security association information, and jointly delete the NHRP table used to forward the data traffic between the first network node and the second network node. The IP security association information is used to encrypt the data traffic transmitted between the first network node and the second network node. When a fault occurs in a transmission link between the first network node and the second network node, the IP security association information is deleted in time, thereby saving storage resources of the network nodes. In addition, the network nodes are prevented from encrypting the data traffic based on the IP security association information, thereby saving processing resources of the network node.

Optionally, when determining that the first network node does not receive the detection response packet sent by the second network node, the first network node deletes the IP security association information and the NHRP table that is used to forward the data traffic between the first network node and the second network node. In a manner, an aggregated routing function is restored by default after the IP security association information and the NHRP table are deleted. In another manner, an aggregated routing function is not restored by default after the IP security association information and the NHRP table are deleted. In this manner, after the first network node deletes the IP security association information and the NHRP table, an aggregated routing function between the first network node and the central node is restored, so that the data traffic transmission between the first network node and the second network node may be forwarded by the central node. After a fault occurs in the link between the two branch nodes, forwarding by the central node may be restored, thereby restoring transmission of the data traffic between the branch nodes.

Optionally, in this embodiment of this application, when determining that the first network node does not receive the detection response packet sent by the second network node, the first network node determines that a fault occurs in the transmission link between the first network node and the second network node, so that the first network node may send an alarm signal to a user, where the alarm signal is used to indicate that a fault occurs in the transmission link between the first network node and the second network node.

In addition, the alarm signal may be a warning sound (for example, a buzzing sound or an alarm) that can be heard by the user, may be a warning (for example, illumination light, flashing light, an image on a display, or prompt text on a display) that can be seen by the user, or may be an alarm (for example, vibration) that can be touched by the user. This is not specifically limited in this application.

In this embodiment of this application, if the first network node receives a detection request packet sent by the second network node, the first network node sends a detection response packet to the second network node, so that the second network node determines that the link between the first network node and the second network node is normal.

Based on the same inventive concept as the foregoing method embodiment, an embodiment of this application provides a communications connection detection apparatus. The apparatus may be applied to a first network node in a multipoint generic routing encapsulation protocol GRE tunnel network, and the apparatus is specifically configured to implement the method performed by the first network node in the embodiments shown in <FIG>. As shown in <FIG>, the apparatus may include:.

Optionally, the apparatus may further include:.

Optionally, the apparatus may further include:
when determining that the first receiving module <NUM> does not receive the detection response packet sent by the second network node, the processing module <NUM> is specifically configured to:.

Optionally, the detection request packet is an NHRP packet, the NHRP packet includes a first field, and the first field is used to indicate that the NHRP packet is a packet used to detect whether the first network node and the second network node are in a connected mode.

Optionally, the NHRP packet further includes a second field, and the second field is used by the second network node to detect whether the detection request packet is secure.

Optionally, the NHRP packet further includes a third field, the third field is used to indicate a sequence number of the NHRP packet, and the sequence number is used to indicate whether the NHRP packet is a replay packet.

Optionally, the detection request packet is a DPD packet.

Optionally, the processing module <NUM> is further configured to delete IP security association information when determining that the first receiving module <NUM> does not receive the detection response packet sent by the second network node, where the IP security association information is used to encrypt the data traffic transmitted between the first network node and the second network node.

Optionally, the processing module <NUM> is further configured to restore an aggregated routing function between the first network node and the central node when determining that the first receiving module <NUM> does not receive the detection response packet sent by the second network node, where the aggregated routing function is used by the processing module <NUM> to forward, by using the central node, the data traffic transmitted between the first network node and the second network node.

Optionally, the processing module <NUM> is further configured to send an alarm signal when determining that the first receiving module <NUM> does not receive the detection response packet sent by the second network node, where the alarm signal is used to indicate that a fault occurs in a transmission link between the first network node and the second network node.

Module division in the embodiments of this application is an example, is merely logical function division, and may be another division in actual implementation. In addition, functional modules in the embodiments of this application may be integrated into one or more processors, or each of the modules may exist alone physically, or two or more modules may be integrated into one module. The integrated module may be implemented in a form of hardware, or may be implemented in a form of a software functional module. Therefore, the method in any of the foregoing embodiments of this application may be implemented by one or more processors in the first network node. The first network node described herein is a branch node. In the embodiments of this application, a structure of the first network node is the same as that of the second network node. For the structure of the second network node, refer to the first network node. Details are not described again.

When implemented by using hardware, the first network node may be implemented by using a structure shown in <FIG>, or may be implemented by using a structure shown in <FIG>.

<FIG> is a schematic structural diagram of a first network node according to an embodiment of this application. The first network node may include a main control board <NUM>, a switching board <NUM>, an interface board <NUM>, and an interface board <NUM>. The main control board <NUM> includes a central processing unit <NUM>. The interface board <NUM> includes a memory <NUM>, a network processor <NUM>, and a physical interface card <NUM>. The interface board <NUM> includes a memory <NUM>, a network processor <NUM>, and a physical interface card <NUM>.

The switching network board <NUM> is mainly configured to forward a data traffic packet between the interface board <NUM> and the interface board <NUM>.

The interface board <NUM> serves as a receiving board, and the interface board <NUM> serves as a sending board.

When detecting, based on a detection interval (first preset duration) configured by an operation manager (operation manager, OM), that data traffic sent by a second network node is not received in the configured time interval, the network processor <NUM> considers that the traffic is abnormal, and sends a detection request message to the central processing unit <NUM>.

After receiving the detection request message, the central processing unit <NUM> constructs a detection request packet, queries a local routing table according to a destination address of the detection request packet to find the interface board <NUM> on which an outbound interface is located, and then delivers the detection request packet to the network processor <NUM>.

The network processor <NUM> sends, based on information such as the outbound interface, the detection request packet by using the physical interface card <NUM> after completing link layer encapsulation, that is, sends the detection request packet to the second network node.

After receiving, from a network, a detection response packet sent by the second network node, the physical interface card <NUM> sends the detection response packet to the network processor <NUM>.

The physical interface card <NUM> receives the detection response packet from the network, and after completing related verification, submits the detection response packet to the network processor <NUM> for processing.

The network processor <NUM> queries, by using a destination address of the detection response packet, an NHRP table stored in the memory <NUM>; determines that the detection response packet is a local packet; and sends the detection response packet to the central processing unit <NUM> for processing.

The central processing unit <NUM> performs matching with the detection request packet based on information such as a detection address and a sequence number carried in the received detection response packet. If the matching succeeds, it is considered that a link state is normal. If the central processing unit <NUM> does not receive, within third preset duration, the detection response packet sent by the second network node, the detection request packet is retransmitted for limited times. If the detection response packet sent by the second network node is not received after the detection request packet is retransmitted for N times, it is determined that a fault occurs in a link between the first network node and the second network node, the link may be set to DOWN, and NHRP tables stored in the memory <NUM> and the memory <NUM> and used to forward data traffic between the first network node and the second network node are deleted.

Optionally, the physical interface card <NUM> receives, from the network, a detection request packet sent by the second network node, and submits the detection request packet to the network processor <NUM> for processing.

The network processor <NUM> queries a local route by using a destination address of the detection request packet, determines that the detection request packet is a local packet, and sends the detection request packet to the central processing unit <NUM> for processing.

After performing verification according to packet characteristic information of the received detection request packet, the central processing unit <NUM> determines that the detection request packet is a packet used to detect whether the first network node and the second network node is in a connected mode, and constructs a detection response packet. The central processing unit <NUM> queries, based on a destination address of the detection response packet, the NHRP table stored in the memory <NUM>, to find the interface board <NUM> on which the outbound interface is located; and then delivers the detection response packet the network processor <NUM>.

The network processor <NUM> sends, based on information such as the outbound interface, the detection response packet by using the physical interface card <NUM> after completing link layer encapsulation, that is, sends the detection response packet to the second network node.

<FIG> is a schematic structural diagram of another first network node according to an embodiment of this application. The first network node includes a communications interface <NUM>, a processor <NUM>, and a memory <NUM>. The processor <NUM> receives and sends data traffic, a detection request packet, and a detection response packet by using the transceiver <NUM>, and is configured to implement the method executed by the first network node in <FIG>. In an implementation process, steps in a processing procedure may be completed by using a hardware integrated logic circuit in the processor <NUM> or an instruction in a form of software. The processor <NUM> includes one or more of a general purpose processor, a network processor, a digital signal processor, an application-specific integrated circuit, a field programmable gate array or another programmable logic device, a discrete gate or a transistor logic device, a discrete hardware component, or the like, and may implement or execute the methods, steps, and logical block diagrams disclosed in the embodiments of this application. The general purpose processor may be a microprocessor or any conventional processor or the like. The steps of the method disclosed with reference to the embodiments of this application may be directly performed by a hardware processor, or may be performed by using a combination of hardware in the processor and a software unit. Program code executed by the processor <NUM> to implement the foregoing method may be stored in the memory <NUM>. The memory <NUM> may be a nonvolatile memory such as a hard disk drive (English: hard disk drive, HDD for short) or a solid state drive (English: solid-state drive, SSD for short), or may be a volatile memory (English: volatile memory) such as a random access memory (English: random-access memory, RAM for short). The memory <NUM> is any other medium that can be configured to carry or store expected program code in a form of an instruction or a data structure and that can be accessed by a computer, without being limited thereto.

In this embodiment of this application, a specific connection medium between the transceiver <NUM>, the processor <NUM>, and the memory <NUM> is not limited. In this embodiment of this application, the memory <NUM>, the processor <NUM>, and the transceiver <NUM> are connected by using a bus <NUM> in <FIG>. The bus is represented by using a bold line in <FIG>. A manner of connection between other components is merely an example for description, and imposes no limitation. The bus may be classified into an address bus, a data bus, a control bus, and the like. For ease of representation, only one bold line is used to represent the bus in <FIG>, but this does not mean that there is only one bus or only one type of bus.

Based on the foregoing embodiments, an embodiment of this application further provides a computer storage medium. The storage medium stores a software program, and when the software program is read and executed by one or more processors, the method provided in the foregoing embodiments may be implemented. The computer storage medium may include: any medium that can store program code, such as a USB flash drive, a removable hard disk, a read-only memory, a random access memory, a magnetic disk, or an optical disc.

Based on the foregoing embodiments, an embodiment of this application further provides a chip system. The chip system includes a processor, configured to support a distributed unit, a centralized unit, and a base station in implementing a function in the foregoing embodiments, for example, generating or processing data and/or information in the foregoing method. Optionally, the chip system further includes a memory, and the memory is configured to store a program instruction and data that are necessary for the distributed unit, the centralized unit, and a network node. The chip system may include a chip, or may include a chip and another discrete device.

This application is described with reference to the flowcharts and/or block diagrams of the method, the device (system), and the computer program product according to this application. It should be understood that computer program instructions may be used to implement each process and/or each block in the flowcharts and/or the block diagrams and a combination of a process and/or a block in the flowcharts and/or the block diagrams. These computer program instructions may be provided for a general-purpose computer, a dedicated computer, an embedded processor, or a processor of any other programmable data processing device to generate a machine, so that the instructions executed by a computer or a processor of any other programmable data processing device generate an apparatus for implementing a specific function in one or more processes in the flowcharts and/or in one or more blocks in the block diagrams.

Claim 1:
A communications connection detection method, comprising:
sending (S201), by a first network node, a detection request packet to a second network node, wherein the detection request packet is used to detect whether the first network node and the second network node are in a connected mode; and
deleting (S202), by the first network node, a next hop resolution protocol, NHRP, table when the first network node determines that the first network node does not receive a detection response packet sent by the second network node, so that data traffic transmitted between the first network node and the second network node is forwarded by a central node, wherein the detection response packet is a response packet in response to the detection request packet, and the NHRP table is used by the first network node to forward data traffic to the second network node by using a tunnel established between the first network node and the second network node,
wherein the first network node and the second network node are spoke nodes and the central node is a hub node.