Path switching method and apparatus, network device, and computer-readable storage medium

CN117478587BActive Publication Date: 2026-09-29MAIPU COMM TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311595987.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-11-24
Publication Date
2026-09-29
Estimated Expiration
2043-11-24

AI Technical Summary

Technical Problem

现有技术中当链路出现故障时,路径切换过程较慢

Benefits of technology

[0033]相对于现有技术,本发明实施例提供的路径切换方法、装置、网络设备和计算机可读存储介质,Spoke设备通过和Hub设备之间的SRv6 TE路径发送原始报文时、Hub设备在向内部网络发送原始报文时检测到转发出接口是等价链路的接口时生成ICMPv6重定向报文,并将其发送至Spoke设备,Spoke设备接收ICMPv6重定向报文后,将路由表中命中原始报文的目的IP地址的路由表项的转发标志设置为无效,以使Spoke设备在进行报文转发、且命中的路由表项的转发标志为无效时及时切换转发路径并基于切换后的转发路径转发报文,通过ICMPv6重定向报文能够及时通知Spoke设备链路异常并设置转发标志,并使Spoke根据设置的转发标志实现路径的快速切换。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117478587B_ABST
    Figure CN117478587B_ABST
Patent Text Reader

Abstract

The application relates to the technical field of network communication, and provides a path switching method and device, network equipment and a computer readable storage medium, the method applied to a Spoke device comprises the following steps: receiving an ICMPv6 redirect message sent by a Hub device, the redirect message is generated when the Hub device detects that the outgoing interface is an interface of an equivalent link when sending an original message to an internal network, the original message is sent by the Spoke device through an SRv6TE path between the Spoke device and the Hub device, and the redirect message carries a destination IP address of the original message; and setting a forwarding flag of a routing table entry that hits the destination IP address in the routing table as invalid. The application can improve path switching efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of network communication technology, and more specifically, to a path switching method, apparatus, network device, and computer-readable storage medium. Background Technology

[0002] SRv6, short for SR (Segment Routing) + IPv6, is a next-generation IP transport protocol. It adopts existing IPv6 forwarding technology and uses the flexible IPv6 extension header SRH (Segment Identifier Header, IPv6 SR header) to program multiple segments in an orderly manner. It can intelligently select the best path and adjust it in real time according to service intent, network status, etc.

[0003] SRv6 is based on IPv6 forwarding. SRv6 achieves this by extending the packet header, without changing the IPv6 encapsulation structure. SRv6 packets are still IPv6 packets, achieving unified transport in both the control and data planes. This greatly simplifies network protocols, reduces operational complexity, and allows cloud, network, and endpoint systems to achieve end-to-end manageability and control based on the same standard protocol. This enables flexible multi-cloud deployment and agile service provisioning. Being based on IPv6, it allows access to data center networks and even user terminal equipment, promoting cloud-network convergence.

[0004] SRv6 TE (Segment Routing IPv6 Traffic Engineering) is a path selection strategy based on SRv6, providing users with functions such as path selection, path switching, and backup protection during traffic forwarding. It can also be seen as a new TE tunneling technology developed on top of SRv6. SRv6 TE offers flexible forwarding path selection methods to meet different user forwarding needs. When multiple paths exist between the source and destination nodes in a segment routing network, rationally utilizing SRv6 TE to select forwarding paths not only facilitates network management and planning for administrators but also effectively reduces the forwarding pressure on network devices. In existing technologies, the path switching process is slow when a link fails. Summary of the Invention

[0005] The purpose of this invention is to provide a path switching method, apparatus, network device, and computer-readable storage medium that can improve the efficiency of path switching.

[0006] The embodiments of the present invention can be implemented as follows:

[0007] In a first aspect, the present invention provides a path switching method applied to a Spoke device, wherein the Spoke device is communicatively connected to a Hub device, the Spoke device locally stores a routing table, and each routing table entry has a forwarding flag indicating whether the SRv6 TE path of the routing table entry is valid, the method comprising:

[0008] The device receives an ICMPv6 redirect message sent by the Hub device. The ICMPv6 redirect message is generated by the Hub device when it detects that the forwarding interface is an interface of an equal-cost link when sending the original message to the internal network. The original message is sent by the Spoke device through the SRv6 TE path between the Spoke device and the Hub device. The ICMPv6 redirect message carries the destination IP address of the original message.

[0009] Set the forwarding flag of the routing table entry that matches the destination IP address to invalid.

[0010] In an optional implementation, the Spoke device is also communicatively connected to a terminal device, and the method further includes:

[0011] Receive service messages sent by the terminal device;

[0012] If the forwarding flag of the routing table entry matched by the service packet is invalid, the current forwarding path will be switched to another available path and the service packet will be forwarded through the switched path.

[0013] In an optional implementation, the Spoke device is also communicatively connected to a controller, and after the step of receiving the ICMPv6 redirect message sent by the Hub device, the method further includes:

[0014] Send a routing update message carrying the switched path to the controller so that the controller displays the switched path as the actual forwarding path of the packet.

[0015] In an optional implementation, the Spoke device is also communicatively connected to a controller, and the method further includes:

[0016] Receive the new SRv6 TE path sent by the controller;

[0017] Based on the new SRv6 TE path, the forwarding flag of each corresponding routing table entry in the routing table is set to valid.

[0018] Secondly, the present invention provides a path switching method applied to a hub device communicatively connected to a Spoke device, wherein the Spoke device locally stores a routing table, and each routing table entry has a forwarding flag indicating whether the IPv6 traffic engineering (SRv6 TE) path of that routing table entry is valid; the method includes:

[0019] Receive the raw message sent by the Spoke device through the SRv6 TE path between the Spoke device and the Hub device;

[0020] When it is detected that the forwarding interface is an interface of an equi-cost link, an ICMPv6 redirect message is generated, which carries the destination IP address of the original message;

[0021] The ICMPv6 redirect message is sent to the Spoke device so that the Spoke device sets the forwarding flag of the routing table entry that matches the destination IP address to invalid.

[0022] In an optional implementation, the hub device is also communicatively connected to a controller, and the method further includes:

[0023] If a routing table change event and a redirection event are detected simultaneously, a link anomaly message is sent to the controller to notify that there is an anomaly in the link between the Hub device and the internal network. This causes the controller to recalculate a new SRv6 TE path based on the link anomaly message and send the new SRv6 TE path to the Spoke device. Consequently, the Spoke device sets the forwarding flag of each corresponding routing table entry in its routing table to valid based on the new SRv6 TE path. The routing table change event is triggered by a change in the Hub device's routing table, and the redirection event is triggered by the Hub device generating the ICMPv6 redirection message.

[0024] Thirdly, the present invention provides a path switching device applied to a Spoke device, wherein the Spoke device is communicatively connected to a Hub device, the Spoke device locally stores a routing table, and each routing table entry has a forwarding flag indicating whether the SRv6 TE path of the routing table entry is valid; the device includes:

[0025] The redirect message receiving module is used to receive ICMPv6 redirect messages sent by the Hub device. The ICMPv6 redirect message is generated by the Hub device when it detects that the forwarding interface is an interface of an equal-cost link when sending the original message to the internal network. The original message is sent by the Spoke device through the SRv6 TE path between the Spoke device and the Hub device. The ICMPv6 redirect message carries the destination IP address of the original message.

[0026] The configuration module is used to set the forwarding flag of the routing table entry that matches the destination IP address to invalid.

[0027] Fourthly, the present invention provides a path switching device applied to a hub device communicatively connected to a Spoke device, wherein the Spoke device locally stores a routing table, and each routing table entry has a forwarding flag indicating whether the IPv6 traffic engineering SRv6 TE path of the routing table entry is valid. The device includes:

[0028] The raw message receiving module is used to receive raw messages sent by the Spoke device through the SRv6 TE path between the Spoke device and the Hub device.

[0029] The generation module is used to generate an ICMPv6 redirect message when it is detected that the forwarding interface is an interface of an equi-cost link. The ICMPv6 redirect message carries the destination IP address of the original message.

[0030] The sending module is used to send the ICMPv6 redirect message to the Spoke device, so that the Spoke device sets the forwarding flag of the routing table entry that matches the destination IP address to invalid.

[0031] Fifthly, the present invention provides a network device including a processor and a memory, the memory being used to store a program, and the processor being used to implement, when executing the program, the path switching method applied to a Spoke device as described in any of the foregoing embodiments, or the path switching method applied to a Hub device as described in any of the foregoing embodiments.

[0032] In a sixth aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the path switching method for a Spoke device as described in any of the foregoing embodiments, or implements the path switching method for a Hub device as described in any of the foregoing embodiments.

[0033] Compared to existing technologies, the path switching method, apparatus, network device, and computer-readable storage medium provided in this invention involve the Spoke device sending an original packet via an SRv6 TE path with a Hub device, and the Hub device generating an ICMPv6 redirect message when it detects that the forwarding interface is an interface of an equi-cost link while sending an original packet to the internal network. The Hub device then sends this ICMPv6 redirect message to the Spoke device. Upon receiving the ICMPv6 redirect message, the Spoke device invalidates the forwarding flag of the routing table entry that matches the destination IP address of the original packet. This allows the Spoke device to promptly switch forwarding paths and forward packets based on the switched path when forwarding packets and the forwarding flag of the matched routing table entry is invalid. The ICMPv6 redirect message promptly notifies the Spoke device of link anomalies and sets forwarding flags, enabling the Spoke device to quickly switch paths based on the set forwarding flags. Attached Figure Description

[0034] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present invention and should not be regarded as a limitation on the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0035] Figure 1 This is an example diagram illustrating an application scenario provided in this embodiment.

[0036] Figure 2 This is a flowchart illustrating the path switching method applied to a Spoke device provided in this embodiment.

[0037] Figure 3 This is a flowchart illustrating the path switching method applied to a Hub device provided in this embodiment.

[0038] Figure 4 This is an example diagram illustrating the interaction between the Spoke device, Hub device, and controller provided in this embodiment.

[0039] Figure 5 This is a block diagram illustrating a path switching device applied to a Spoke device as provided in this embodiment.

[0040] Figure 6 This is a block diagram illustrating a path switching device applied to a Hub device as provided in this embodiment.

[0041] Figure 7 This is a block diagram of a network device provided in this embodiment.

[0042] Icons: 10-Terminal device; 20-Network device; 21-Processor; 22-Memory; 23-Bus; 24-Communication interface; 100-Path switching device for Spoke device; 110-Redirect message receiving module; 120-Setting module; 130-Switching module; 200-Path switching device for Hub device; 210-Original message receiving module; 220-Generation module; 230-Sending module. Detailed Implementation

[0043] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. The components of the embodiments of the present invention described and shown in the accompanying drawings can generally be arranged and designed in various different configurations.

[0044] Therefore, the following detailed description of the embodiments of the invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely to illustrate selected embodiments of the invention. All other embodiments obtained by those skilled in the art based on the embodiments of the invention without inventive effort are within the scope of protection of the invention.

[0045] It should be noted that similar labels and letters in the following figures indicate similar items. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures.

[0046] In the description of this invention, it should be noted that if terms such as "upper," "lower," "inner," or "outer" are used to indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings, or the orientation or positional relationship in which the product of this invention is usually placed, they are only for the convenience of describing this invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of this invention.

[0047] Furthermore, the terms "first" and "second" are used only to distinguish descriptions and should not be interpreted as indicating or implying relative importance.

[0048] It should be noted that, where there is no conflict, the features in the embodiments of the present invention can be combined with each other.

[0049] Using a Hub & Spoke networking solution allows you to set up a central access control device within a VPN (Virtual Private Network). All communication between other users is handled through this central access control device. The central device monitors and filters communication between other devices. The site where the central access control device is located is called the Hub site, and the devices on the Hub site are called Hub devices. Other branch sites are called Spoke sites, and the devices on the Spoke sites are called Spoke devices.

[0050] Please refer to Figure 1 , Figure 1 This is an example diagram illustrating an application scenario provided in this embodiment. Figure 1 In this configuration, Spoke devices (Spoke1 and Spoke2) and terminal device 10 are connected via an aggregation switch. Spoke devices at the Spoke site are connected to Hub devices (Hub1 and Hub2) at the Hub site via the backbone network. Hub devices are connected to other devices in the internal network. Spoke devices are network devices located at the Spoke site that can forward packets; they can be routers, etc. Hub devices are network devices located at the Hub site that can forward packets; they can be routers, etc. Terminal device 10 is the device that needs to send packets; it can be a host, mobile phone, laptop, server, etc.

[0051] The controller resides on an internal network, typically used for communication between computers within a unit or enterprise. The controller forwards computational paths to the Spoke device via a hub and a backbone network. The backbone network is a high-speed network used to connect multiple regions or areas. Each backbone network has at least one interconnection point with other backbone networks. Different network providers have their own backbone networks to connect their networks located in different regions.

[0052] Under normal circumstances, the Spoke device receives the raw packets sent by terminal device 10, encapsulates them, and sends them to the Hub device via the SRv6 TE (Segment Routing IPv6 Traffic Engineering) path. The Hub device decapsulates the received packets and then sends them to the internal network. Figure 1 Path 1 is shown in the diagram.

[0053] When a hub device detects that the forwarding interface is an interface on an equi-cost link, the packet is routed to an equi-cost link with other hub devices for forwarding. Figure 1 Path 2 is shown in the diagram.

[0054] One current implementation involves the Hub device periodically notifying the Spoke device of link anomalies via a routing protocol, enabling the Spoke device to switch routes. This switching process is relatively slow, and before switching paths, packets are forwarded via path 2, increasing the processing burden on the Hub device and the burden on the equivalent-cost link.

[0055] In view of this, this embodiment provides a path switching method, apparatus, network device, and computer-readable storage medium, which can achieve fast path switching, enabling packets to switch to the new path as quickly as possible when Hub1 and the internal network experience anomalies. Figure 1 The path 3 in the code will be forwarded, and it will be described in detail below.

[0056] In this embodiment, Figure 1 The Hub device can learn multiple routes to the internal network, one through the direct uplink and the other through the equivalent-cost link within the Hub site. By default, packets are forwarded through the direct uplink. Figure 1 The Spoke device can learn Hub1 and Hub2 routes, and each route is marked with a TE validity flag (TVF), which defaults to True, indicating that the SRv6 TE path using that route is valid. Multiple backup paths can exist between the Spoke site and the Hub site for communication. Within the SRv6 domain, SRv6 TE encapsulation and forwarding follow the existing normal process. Based on the above configuration, this embodiment of the invention provides a path switching method applied to Spoke devices. Please refer to... Figure 2 , Figure 2 This is a flowchart illustrating a path switching method applied to a Spoke device provided in this embodiment. The method includes the following steps:

[0057] Step S101: Receive the ICMPv6 redirect message sent by the Hub device. The ICMPv6 redirect message is generated by the Hub device when it detects that the forwarding interface is an interface of an equal-cost link when sending the original message to the internal network. The original message is sent by the Spoke device through the SRv6TE path between the Spoke device and the Hub device. The ICMPv6 redirect message carries the destination IP address of the original message.

[0058] In this embodiment, the ICMPv6 (Internet Control Message Protocol version 6) redirect message is a message type used for routing optimization in IPv6 networks. It is used to notify the source host to use another router as the next hop when sending data packets, thereby achieving a better routing selection. The ICMPv6 redirect message is a data plane message rather than a control plane message, therefore it can notify of link anomalies more promptly, thus quickly triggering a path switch.

[0059] In this embodiment, the original packet is a service packet received by the Spoke device from the terminal device 10. The original packet is sent from the Spoke device to the Hub device via the SRv6 TE path, and then from the Hub device to the internal network. After receiving the original packet, the Spoke device encapsulates it with SRv6 TE and then sends the encapsulated packet to the Hub device via the SRv6 TE path. When the Hub device detects that the forwarding interface is an interface of an equi-cost link, it generates an ICMPv6 redirection packet and sends the ICMPv6 redirection packet to the Spoke device so that the Spoke device can detect the link anomaly in a timely manner.

[0060] Step S102: Set the forwarding flag of the routing table entry that matches the destination IP address to invalid.

[0061] In this embodiment, the Spoke device locally stores a routing table to store network routing information. The routing table includes at least one routing entry, each recording the range of the destination network address, the value of the destination subnet mask (or prefix length), the next-hop address, and the output port. When a data packet arrives at the Spoke device, the Spoke device looks up its own routing table, matches the destination address of the data packet, and determines which interface and the next router to forward the packet. In this embodiment, each routing entry also has a forwarding flag indicating whether the SRv6 TE path for that routing entry is valid. After receiving an ICMPv6 redirect message, the Spoke device sets the forwarding flag of the routing entry that matches the destination IP address carried in the ICMPv6 redirect message to invalid. An invalid forwarding flag means that the packet cannot be forwarded through the SRv6 TE path according to that routing entry, allowing the Spoke device to perform a timely path switch and forward the packet through the switched path.

[0062] The method described in this embodiment can promptly notify the Spoke device of link anomalies and set forwarding flags through ICMPv6 redirection messages, enabling Spoke to quickly switch paths based on the set forwarding flags.

[0063] In an optional implementation, the Spoke device needs to forward packets based on a forwarding flag. One implementation method is as follows:

[0064] Receive service messages sent by terminal devices;

[0065] In this embodiment, after receiving a service packet, the forwarding flag of the Spoke device may be valid or invalid. If valid, it can be forwarded according to the normal SRv6 TE path; if invalid, a path switch needs to be performed in a timely manner. The specific implementation method is as follows:

[0066] If the forwarding flag of the routing table entry that the service packet hits is invalid, the current forwarding path will be switched to another available path and the service packet will be forwarded through the switched path.

[0067] If the forwarding flag of the routing table entry that the service packet matches is valid, it will be forwarded according to the normal procedure, that is, the service packet will be encapsulated in SRv6 TE and forwarded to the Hub device through the SRv6 TE path.

[0068] In an optional implementation, to promptly display the actual forwarding path after a path switch, the Spoke device, upon receiving an ICMPv6 redirect message from the Hub device, also notifies the controller to display the actual forwarding path.

[0069] Send a routing update message carrying the switched path to the controller so that the controller displays the switched path as the actual forwarding path of the packet.

[0070] In this embodiment, after invalidating the forwarding flag of the routing table entry that matches the destination IP address, in order to ensure that the Spoke device can forward normally according to the new forwarding path in a timely manner, the controller, in addition to displaying the forwarding path, will also remove abnormal links based on the current network topology, recalculate the new path, and send the recalculated path to the Spoke device. The implementation method is as follows:

[0071] Receive the new SRv6 TE path sent by the controller;

[0072] Based on the new SRv6 TE path, the forwarding flag of each corresponding routing table entry in the routing table is set to valid.

[0073] In this embodiment, the forwarding path sent by the controller is a forwarding path recalculated by the controller according to the latest network topology. The controller forwards the forwarding path through the internal network, the Hub device, and the backbone network to the Spoke device. Since the forwarding paths received by the Spoke device are generated according to the current normal link network topology, the currently calculated forwarding paths are all optimal paths. At this time, the forwarding flag of each routing table entry should be set to valid. As one implementation method, True can be used to indicate that the forwarding flag is valid, and False can be used to indicate that the forwarding flag is invalid.

[0074] In this embodiment, to facilitate the path switching method for the Spoke device, a path switching method for the Hub device is also provided. Please refer to [link / reference]. Figure 3 , Figure 3 This is a flowchart illustrating the path switching method applied to a Hub device provided in this embodiment. The method includes the following steps:

[0075] Step S201: Receive the original message sent by the Spoke device through the SRv6 TE path between the Spoke device and the Hub device;

[0076] Step S202: When it is detected that the forwarding interface is an interface of an equi-cost link, an ICMPv6 redirect message is generated. The ICMPv6 redirect message carries the destination IP address of the original message.

[0077] Step S203: Send an ICMPv6 redirect message to the Spoke device so that the Spoke device sets the forwarding flag of the routing table entry that matches the destination IP address to invalid.

[0078] The method described in this embodiment can promptly notify the Spoke device of link anomalies and set forwarding flags through ICMPv6 redirection messages, enabling Spoke to quickly switch paths based on the set forwarding flags.

[0079] In an optional implementation, to enable the Hub device to promptly report link anomalies to the controller, allowing the controller to generate the latest path based on the latest network topology, this embodiment also provides a method for notifying the controller:

[0080] If both a routing table change event and a redirection event are detected simultaneously, a link anomaly message is sent to the controller to notify that there is an anomaly in the link between the Hub device and the internal network. This causes the controller to recalculate a new SRv6 TE path based on the link anomaly message and send the new SRv6 TE path to the Spoke device. The Spoke device then sets the forwarding flag of each corresponding routing table entry in its routing table to valid based on the new SRv6 TE path. The routing table change event is triggered by a change in the Hub device's routing table, and the redirection event is triggered by the Hub device generating an ICMPv6 redirection message.

[0081] In this embodiment, in order to accurately notify the controller that there is an anomaly in the link between the Hub device and the internal network, the Hub device determines whether to send a link anomaly message to the controller by detecting routing table change events and redirection events of its own device.

[0082] In this embodiment, as one implementation, the detection of routing table change events and redirection events by the Hub device is handled within the control flow. This control flow is independent of the Hub device's packet forwarding process; the two are independent, ensuring that detection is unaffected by packet forwarding, allowing for more timely detection and consequently, more timely notification to the controller. When any entry in the Hub device's routing table is deleted, a change in the device's routing table is determined, triggering a routing table change event. When an ICMPv6 redirection packet is generated, a redirection event is triggered. When both the routing table change event and the redirection event occur simultaneously, a link anomaly message is sent to the controller. The controller recalculates the forwarding path based on the link anomaly message and sends the recalculated forwarding path to the Spoke device.

[0083] In this embodiment, to more clearly illustrate the interaction process between the Spoke device, the Hub device, and the controller, an example diagram of their interaction is also provided. Please refer to the provided diagram. Figure 4 , Figure 4 This is an example diagram illustrating the interaction between the Spoke device, Hub device, and controller provided in this embodiment. Figure 4 The interaction steps among the three are as follows:

[0084] S1: Spoke device sends raw message to Hub device 1;

[0085] S2: Hub device 1 generates an ICMPv6 redirect message when it detects that the forwarding interface is an interface of an equivalent link;

[0086] S3: Hub device 1 sends an ICMPv6 redirect message to Spoke device;

[0087] S4: Hub device 1 sends the original message to Hub device 2 via an equal-cost link;

[0088] S5: The Spoke device sets the forwarding flag of the routing table entry that hits the destination IP address to invalid;

[0089] S6: The Spoke device performs a path switch and sends the switched path to the controller;

[0090] S7: The controller displays the forwarding path after the switch;

[0091] S8: Hub device 1 detected a redirection event and a routing table change event;

[0092] S9: Hub device 1 sends a link failure message to the controller;

[0093] S10: The controller recalculates the latest forwarding path;

[0094] S11: The controller sends the latest forwarding path to the Spoke device through Hub device 2. The diagram shows that sending the latest forwarding path to the Spoke device through Hub device 2 is just an example. In fact, the latest forwarding path can also be sent to the Spoke device through Hub device 1.

[0095] S12: The Spoke device sets the forwarding flag to valid.

[0096] It should be noted that, Figure 4 The interaction process of the Spoke device forwarding the service message according to the forwarding flag after receiving it is not shown. Based on the foregoing description of this embodiment, those skilled in the art can understand this interaction process without creative effort.

[0097] To perform the corresponding steps in the above embodiments and various possible implementations, an implementation of a path switching device 100 applied to a Spoke device is given below. Please refer to... Figure 5 , Figure 5 This is a block diagram illustrating a path switching device applied to a Spoke device according to this embodiment. It should be noted that the basic principle and technical effects of the path switching device 100 applied to a Spoke device provided in this embodiment are the same as those in the above embodiments; however, for the sake of brevity, some details are not mentioned in this embodiment.

[0098] The path switching device 100 applied to the Spoke device includes a redirection message receiving module 110, a setting module 120, and a switching module 130.

[0099] The redirect message receiving module 110 is used to receive CMPv6 redirect messages sent by the Hub device. The ICMPv6 redirect message is generated by the Hub device when it detects that the forwarding interface is an interface of an equal-cost link when sending the original message to the internal network. The original message is sent by the Spoke device through the SRv6 TE path between the Spoke device and the Hub device. The ICMPv6 redirect message carries the destination IP address of the original message.

[0100] The configuration module 120 is used to set the forwarding flag of the routing table entry that matches the destination IP address to invalid.

[0101] The switching module 130 is used to: receive service packets sent by the terminal device; if the forwarding flag of the routing table entry hit by the service packet is invalid, switch the current forwarding path to another available path and forward the service packet through the switched path.

[0102] In an optional implementation, the Spoke device is also communicatively connected to the controller, and the switching module 130 is further configured to: send a routing update message carrying the switched path to the controller, so that the controller displays the switched path as the actual forwarding path of the packet.

[0103] In an optional implementation, the setting module 120 is further configured to: receive a new SRv6 TE path sent by the controller; and set the forwarding flag of each corresponding routing table entry in the routing table to valid based on the new SRv6 TE path.

[0104] To perform the corresponding steps in the above embodiments and various possible implementations, an implementation of a path switching device 200 applied to a Hub device is given below. Please refer to... Figure 6 , Figure 6 This is a block diagram illustrating a path switching device applied to a Hub device as provided in this embodiment. It should be noted that the basic principle and technical effects of the path switching device 200 applied to a Hub device provided in this embodiment are the same as those in the above embodiments; however, for the sake of brevity, some details are not mentioned in this embodiment.

[0105] The path switching device 200 applied to the Hub device includes a raw message receiving module 210, a generation module 220, and a sending module 230.

[0106] The raw message receiving module 210 is used to receive raw messages sent by the Spoke device through the SRv6TE path between the Spoke device and the Hub device;

[0107] The generation module 220 is used to generate an ICMPv6 redirect message when it is detected that the forwarding interface is an interface of an equi-cost link. The ICMPv6 redirect message carries the destination IP address of the original message.

[0108] The sending module 230 is used to send ICMPv6 redirect messages to the Spoke device so that the Spoke device sets the forwarding flag of the routing table entry that matches the destination IP address to invalid.

[0109] In an optional implementation, the Hub device is also communicatively connected to the controller, and the sending module 230 is further configured to: if a routing table change event and a redirection event are detected simultaneously, send a link error message to the controller to notify that there is an error in the link between the Hub device and the internal network, so that the controller recalculates a new SRv6 TE path based on the link error message and sends the new SRv6 TE path to the Spoke device, so that the Spoke device sets the forwarding flag of each corresponding routing table entry in the Spoke device's routing table to valid based on the new SRv6 TE path. The routing table change event is triggered by a change in the Hub device's routing table, and the redirection event is triggered by the Hub device generating an ICMPv6 redirection message.

[0110] Please refer to Figure 7 , Figure 7 This is a block diagram of the network device 20 provided in this embodiment. Figure 2 Network device 20 in the middle can be Figure 1 The Spoke device in the middle can also be Figure 1 The Hub device in the network device 20 includes a processor 21, a memory 22, a bus 23, and a communication interface 24. The processor 21, memory 22, and communication interface 24 are connected through the bus 23.

[0111] Processor 21 can be an integrated circuit chip with signal processing capabilities. During implementation, each step of the path switching method can be completed through integrated logic circuits in the hardware or software instructions within processor 21. Processor 21 can be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.

[0112] The memory 22 is used to store programs, such as the path switching device applied to the Spoke device or the path switching device applied to the Hub device in the above embodiments. The path switching device applied to the Spoke device or the path switching device applied to the Hub device includes at least one software function module that can be stored in the memory 22 in the form of software or firmware or embedded in the operating system (OS) of the network device 20. After receiving the execution instruction, the processor 21 executes the program to implement the path switching method for the Spoke device or the path switching method for the Hub device disclosed in the above embodiments.

[0113] Network device 20 communicates with other devices through communication interface 24.

[0114] This invention provides a computer-readable storage medium storing a computer program thereon. When the computer program is executed by a processor, it implements the path switching method applied to a Spoke device in the foregoing embodiments, or the path switching method applied to a Hub device in the foregoing embodiments.

[0115] In summary, embodiments of the present invention provide a path switching method, apparatus, network device, and computer-readable storage medium. A Spoke device is communicatively connected to a Hub device. The Spoke device locally stores a routing table, and each entry in the routing table has a forwarding flag indicating whether the SRv6 TE path for that entry is valid. The method applied to the Spoke device includes: receiving an ICMPv6 redirect message sent by the Hub device. The ICMPv6 redirect message is generated by the Hub device when it detects that the forwarding interface is an interface of an equi-cost link while sending the original message to the internal network. The original message was sent by the Spoke device through the SRv6 TE path between it and the Hub device. The ICMPv6 redirect message carries the destination IP address of the original message. The forwarding flag of the routing table entry that matches the destination IP address is set to invalid. Compared with the prior art, the embodiments of the present invention have at least the following advantages: (1) By using ICMPv6 redirection messages from the data plane rather than the control plane, the Spoke device can be notified of link anomalies and a forwarding flag can be set in a timely manner, enabling the Spoke to quickly switch paths according to the set forwarding flag; (2) After the path is switched, the controller is notified in a timely manner to display the latest forwarding path; (3) When forwarding messages, the Spoke device can switch paths in a timely manner through the forwarding flag, avoiding the pressure on device performance and unnecessary bandwidth loss caused by the long convergence time of the controller due to the traffic detouring for a period of time.

[0116] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.

Claims

1. A path switching method, characterized in that, The method, applied to a Spoke device communicatively connected to a Hub device, wherein the Spoke device locally stores a routing table, and each routing table entry has a forwarding flag indicating whether the SRv6 TE path of that routing table entry is valid, includes: The device receives an ICMPv6 redirect message sent by the Hub device. The ICMPv6 redirect message is generated by the Hub device when it detects that the forwarding interface is an interface of an equal-cost link when sending the original message to the internal network. The original message is sent by the Spoke device through the SRv6 TE path between the Spoke device and the Hub device. The ICMPv6 redirect message carries the destination IP address of the original message. The forwarding flag of the routing table entry that matches the destination IP address is set to invalid, so that the Spoke device can switch paths in a timely manner and forward packets through the switched path.

2. The path switching method as described in claim 1, characterized in that, The Spoke device is also communicatively connected to a terminal device, and the method further includes: Receive service messages sent by the terminal device; If the forwarding flag of the routing table entry matched by the service packet is invalid, the current forwarding path will be switched to another available path and the service packet will be forwarded through the switched path.

3. The path switching method as described in claim 1, characterized in that, The Spoke device is also communicatively connected to the controller, and after the step of receiving the ICMPv6 redirect message sent by the Hub device, the method further includes: Send a routing update message carrying the switched path to the controller so that the controller displays the switched path as the actual forwarding path of the packet.

4. The path switching method as described in claim 1, characterized in that, The Spoke device is also communicatively connected to a controller, and the method further includes: Receive the new SRv6 TE path sent by the controller; Based on the new SRv6 TE path, the forwarding flag of each corresponding routing table entry in the routing table is set to valid.

5. A path switching method, characterized in that, A method applicable to a hub device communicating with a Spoke device, the Spoke device locally storing a routing table, each routing table entry having a forwarding flag indicating whether the SRv6 TE path of that routing table entry is valid, the method comprising: Receive the raw message sent by the Spoke device through the SRv6 TE path between the Spoke device and the Hub device; When it is detected that the forwarding interface is an interface of an equi-cost link, an ICMPv6 redirect message is generated, which carries the destination IP address of the original message; The ICMPv6 redirect message is sent to the Spoke device, so that the Spoke device sets the forwarding flag of the routing table entry that matches the destination IP address to invalid, so that the Spoke device can switch paths in time and forward the message through the switched path.

6. The path switching method as described in claim 5, characterized in that, The hub device is also communicatively connected to the controller, and the method further includes: If a routing table change event and a redirection event are detected simultaneously, a link anomaly message is sent to the controller to notify that there is an anomaly in the link between the Hub device and the internal network. This causes the controller to recalculate a new SRv6 TE path based on the link anomaly message and send the new SRv6 TE path to the Spoke device. The Spoke device then sets the forwarding flag of each corresponding routing table entry in its routing table to valid based on the new SRv6 TE path. The routing table change event is triggered by a change in the Hub device's routing table, and the redirection event is triggered by the Hub device generating the ICMPv6 redirection message.

7. A path switching device, characterized in that, An apparatus for use with a Spoke device, the Spoke device being communicatively connected to a Hub device, the Spoke device locally storing a routing table, each routing table entry having a forwarding flag indicating whether the SRv6 TE path of that routing table entry is valid, the apparatus comprising: The redirect message receiving module is used to receive ICMPv6 redirect messages sent by the Hub device. The ICMPv6 redirect message is generated by the Hub device when it detects that the forwarding interface is an interface of an equal-cost link when sending the original message to the internal network. The original message is sent by the Spoke device through the SRv6 TE path between the Spoke device and the Hub device. The ICMPv6 redirect message carries the destination IP address of the original message. The setting module is used to set the forwarding flag of the routing table entry that matches the destination IP address to invalid, so that the Spoke device can switch paths in a timely manner and forward packets through the switched path.

8. A path switching device, characterized in that, A hub device used in communication with a Spoke device, the Spoke device locally storing a routing table, each entry in the routing table having a forwarding flag indicating whether the SRv6 TE path of that entry is valid, the device comprising: The raw message receiving module is used to receive raw messages sent by the Spoke device through the SRv6TE path between the Spoke device and the Hub device. The generation module is used to generate an ICMPv6 redirect message when it is detected that the forwarding interface is an interface of an equi-cost link. The ICMPv6 redirect message carries the destination IP address of the original message. The sending module is used to send the ICMPv6 redirect message to the Spoke device, so that the Spoke device sets the forwarding flag of the routing table entry that matches the destination IP address to invalid, so that the Spoke device can perform path switching in a timely manner and forward the message through the switched path.

9. A network device, characterized in that, It includes a processor and a memory, the memory being used to store a program, and the processor being used to implement the path switching method of any one of claims 1-4, or the path switching method of any one of claims 5-6, when executing the program.

10. A computer-readable storage medium, characterized in that, It stores a computer program that, when executed by a processor, implements the path switching method of any one of claims 1-4, or the path switching method of any one of claims 5-6.

Citation Information

Patent Citations

  • Using consistent hashing for ECMP routing

    CN109391549A

  • Equivalent load sharing method and device, network equipment and storage medium

    CN116032819A