A GRE tunnel encapsulation message forwarding path updating method, device, equipment and medium

CN123035154APending Publication Date: 2026-11-03SHEN ZHOU SHU MA WANG LUO BEI JING YOU XIAN GONG SI +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611197865.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-07
Publication Date
2026-11-03

AI Technical Summary

Technical Problem

Existing GRE tunneling technology cannot accurately detect changes in the underlying public network ECMP routing, resulting in inaccurate packet forwarding paths, causing packet loss and wasted link resources.

Method used

Create a dedicated ECMP group G2 for the tunnel, and make its lifecycle follow the underlying public network ECMP route. Detect next-hop member changes to generate an updated member list and send it to the hardware forwarding table to ensure that the encapsulated packet forwarding path of the GRE tunnel is consistent with the actual state of the underlying public network ECMP route.

Benefits of technology

It ensures the accuracy of GRE tunnel encapsulated packet forwarding paths, avoiding packet loss and link resource waste caused by the inability to detect next-hop failure or recovery.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123035154A_ABST
    Figure CN123035154A_ABST
Patent Text Reader

Abstract

The application discloses a GRE tunnel encapsulation message forwarding path updating method and device, equipment and medium, and relates to the technical field of communication. The method comprises the following steps: acquiring a generation event of an underlay public network equal-cost multi-path (ECMP) route; creating a tunnel-specific ECMP group G2 corresponding to the underlay public network ECMP route according to the generation event, so that the life cycle of the G2 follows the underlay public network ECMP route, and the G2 is used for managing the forwarding of encapsulation messages of a GRE tunnel; detecting whether a next-hop member of the underlay public network ECMP route is changed within the life cycle of the G2; when it is detected that the next-hop member is changed, generating an updated member link list of the G2 according to an effective next-hop set of the underlay public network ECMP route after the change; and issuing the updated member link list to a hardware forwarding table, so as to update the forwarding path of the encapsulation messages of the GRE tunnel. The method can accurately perceive the change of the underlay public network ECMP route.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of communication technology, and in particular to a method, apparatus, device and medium for updating the forwarding path of GRE tunnel encapsulated messages. Background Technology

[0002] GRE (Generic Routing Encapsulation) tunneling technology is widely used in scenarios such as switch, data center interconnection, and cloud branch VPN networking. It achieves Layer 2 / Layer interoperability across public networks by encapsulating public IP headers outside private network packets. With the increasing demand for enterprise branch cloud migration and multi-active data center interconnection, GRE tunnels typically run on multiple equal-cost public network links, with ECMP (Equal-Cost Multipath) routing providing load balancing and link redundancy at the Underlay layer. However, the forwarding planes of the tunnel layer (Overlay) and the bearer layer (Underlay) are isolated. The GRE tunnel itself cannot detect changes in the underlying public network path. When the underlying ECMP next hop fails or recovers, the tunnel continues to forward encapsulated packets along the old path, leading to continuous packet loss and service interruptions, severely restricting network reliability and link utilization.

[0003] Existing solutions typically employ a single-link polling detection mechanism, periodically probing the reachability of the next hop to detect link failures. In GRE tunnel scenarios, existing solutions treat the tunnel as a regular routing prefix, sharing the same ECMP group object with the underlying public network routes, and its management logic still follows the ECMP update mechanism of the aforementioned single-layer IP routing. Based on this, some existing technologies configure static ECMP groups on the tunnel interface or copy ECMP member information from the underlying public network routes during tunnel creation, enabling the GRE tunnel to obtain an initial load-sharing path list, thus possessing basic tunnel traffic distribution capabilities.

[0004] However, the existing GRE tunnel solution cannot accurately detect changes in the underlying public network ECMP routing, resulting in inaccurate forwarding paths for GRE tunnel encapsulated packets, causing packet loss and wasted link resources. Summary of the Invention

[0005] This application provides a method, apparatus, device, and medium for updating the forwarding path of GRE tunnel encapsulated packets, which can accurately detect changes in the underlying public network ECMP routing, improve the accuracy of the forwarding path of GRE tunnel encapsulated packets, and avoid packet loss and waste of link resources.

[0006] To achieve the above objectives, this application adopts the following technical solution: Firstly, this application provides a method for updating the forwarding path of GRE tunnel encapsulated packets, including: Obtain the generation events of the underlying public network equal-cost multipath (ECMP) routes; Based on the generated event, a tunnel-specific ECMP group G2 corresponding to the underlying public network ECMP route is created, so that the lifecycle of G2 follows the underlying public network ECMP route. G2 is used to manage the forwarding of encapsulated packets of GRE tunnel. During the lifecycle of G2, detect whether the next-hop member of the underlying public network ECMP route has changed; When a change in the next-hop member is detected, the updated member list of G2 is generated based on the valid next-hop set of the underlying public network ECMP route after the change. The updated member list is sent to the hardware forwarding table to update the forwarding path of the encapsulated packets in the GRE tunnel.

[0007] Optionally, after creating the tunnel-specific ECMP group G2 corresponding to the underlying public network ECMP route, the method further includes: Copy the current set of valid next hops of the underlying public network ECMP routes to generate the initial member linked list of G2; The initial member list is synchronized to the hardware forwarding table to generate the initial forwarding path for the encapsulated packets of the GRE tunnel.

[0008] Optionally, detecting whether the next-hop member of the underlying public network ECMP route has changed includes: Based on the listening events of the next-hop members of the underlying public network ECMP route, identify the next-hop change scenario type to which the listening events belong; When the next-hop change scenario type is identified as either a next-hop leave scenario or a next-hop join scenario, it is determined that the next-hop member of the underlying public network ECMP route has changed; among them, the monitoring events include ARP aging events, hardware port interruption events, configuration change events, and network segment status events.

[0009] Optionally, the method further includes: When a deletion event of the underlying public network ECMP route is obtained, the corresponding G2 is destroyed according to the association between G2 and the underlying public network ECMP route.

[0010] Optionally, the method further includes: Get the number of valid next hops in the updated member list of G2; The hash value is obtained by hashing the header of the encapsulated message of the GRE tunnel based on the number of valid next hops. The hash value is moduloed by the number of valid next hops to obtain the modulo result; The encapsulated message is assigned to the corresponding valid next hop based on the modulus result.

[0011] Optionally, the method further includes: Monitor the forwarding quality parameters of each next hop in the valid next hop set of the underlying public network ECMP routes; Next hops whose forwarding quality parameters are greater than the abnormal threshold are removed from the set of valid next hops.

[0012] Optionally, generating the updated member list of G2 based on the valid next-hop set of the modified underlying public network ECMP routes includes: While keeping the instance identifier, tunnel binding relationship and route reference relationship of G2 unchanged, the updated member list of G2 is generated according to the effective next-hop set of the underlying public network ECMP routes after the change, and the initial member list of G2 is released.

[0013] Secondly, this application provides a GRE tunneling encapsulation message forwarding path update apparatus, comprising: The acquisition module is used to acquire the generation events of underlying public network equal-cost multipath (ECMP) routes; The processing module is configured to create a tunnel-specific ECMP group G2 corresponding to the underlying public network ECMP route based on the generated event, such that the lifecycle of G2 follows the underlying public network ECMP route. G2 is used to manage the forwarding of encapsulated packets in the GRE tunnel. During the lifecycle of G2, it detects whether the next-hop member of the underlying public network ECMP route has changed. When a change in the next-hop member is detected, it generates an updated member list for G2 based on the valid next-hop set of the changed underlying public network ECMP route. The forwarding module is used to send the updated member list to the hardware forwarding table to update the forwarding path of the encapsulated packets of the GRE tunnel.

[0014] Thirdly, this application provides a computing device, including a memory and a processor; The memory stores one or more computer programs, the one or more computer programs including instructions; when the instructions are executed by the processor, the computing device performs the method as described in any one of the first aspects.

[0015] Fourthly, this application provides a computer-readable storage medium for storing a computer program for performing the method as described in any one of the first aspects.

[0016] As can be seen from the above technical solution, this application has at least the following beneficial effects: This application obtains the generation event of the underlying public network ECMP route, creates a tunnel-specific ECMP group G2 corresponding to the underlying public network ECMP route, and associates G2 with the underlying public network ECMP route. This ensures that the lifecycle of G2 follows the underlying public network ECMP route. G2 is used to manage the forwarding of encapsulated packets in the GRE tunnel, achieving lifecycle linkage between G2 and the underlying public network ECMP route. G2 is automatically created when the underlying public network ECMP route is generated and automatically destroyed when the underlying public network ECMP route is deleted. The forwarding path of the encapsulated packets in the GRE tunnel remains consistent with the actual state of the underlying public network ECMP route, solving the problem in existing technologies where the GRE tunnel cannot detect the generation and deletion of underlying routes, leading to inaccurate forwarding paths for encapsulated packets.

[0017] This application detects changes in the next-hop members of the underlying public network ECMP routes during the lifecycle of G2. When a change is detected, an updated member list of G2 is generated based on the valid next-hop set of the changed underlying public network ECMP routes and sent to the hardware forwarding table to update the forwarding path of the encapsulated packets of the GRE tunnel. This ensures that the member list inside G2 is updated synchronously with changes in the next-hop members of the underlying public network ECMP routes, and the hardware forwarding table always contains the currently valid next-hop members. The tunnel always forwards encapsulated packets according to the currently valid next hop, avoiding packet loss and link resource waste caused by forwarding to the wrong path due to the inability to detect next-hop failure or recovery.

[0018] It should be understood that the descriptions of technical features, technical solutions, beneficial effects, or similar language in this application do not imply that all features and advantages can be achieved in any single embodiment. Rather, it is understood that the description of a feature or beneficial effect means that a specific technical feature, technical solution, or beneficial effect is included in at least one embodiment. Therefore, the descriptions of technical features, technical solutions, or beneficial effects in this specification do not necessarily refer to the same embodiment. Furthermore, the technical features, technical solutions, and beneficial effects described in this embodiment can be combined in any suitable manner. Those skilled in the art will understand that embodiments can be implemented without one or more specific technical features, technical solutions, or beneficial effects of a particular embodiment. In other embodiments, additional technical features and beneficial effects may be identified in specific embodiments that do not embody all embodiments. Attached Figure Description

[0019] Figure 1 A schematic diagram illustrating an application scenario provided in an embodiment of this application; Figure 2 A flowchart illustrating a GRE tunnel encapsulation message forwarding path update method provided in this application embodiment; Figure 3 A schematic diagram illustrating a five-type next-hop event-driven G2 member list replacement process provided in an embodiment of this application; Figure 4 A schematic diagram illustrating the principle of a G2 instance with a fixed lifespan and only member list replacement, provided in an embodiment of this application; Figure 5 A schematic diagram illustrating the interaction between a software control plane and a hardware layered forwarding table, provided as an embodiment of this application; Figure 6 A schematic diagram of a GRE tunnel encapsulation message forwarding path update device provided in this application embodiment; Figure 7 This is a schematic diagram of a computing device provided in an embodiment of this application. Detailed Implementation

[0020] The terms "first," "second," and "third," etc., used in this application specification and accompanying drawings are used to distinguish different objects, not to limit a specific order.

[0021] In the embodiments of this application, the terms "exemplary" or "for example" are used to indicate that something is an example, illustration, or description. Any embodiment or design that is described as "exemplary" or "for example" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or design. Specifically, the use of the terms "exemplary" or "for example" is intended to present the relevant concepts in a specific manner.

[0022] In existing GRE tunneling technology, the forwarding planes of the tunnel layer and the bearer layer are isolated from each other, and the GRE tunnel itself cannot perceive changes in the underlying public network ECMP routes. When the next-hop member of the underlying public network ECMP route fails, is added, restored, or the entire route is deleted, the tunnel cannot obtain the above change information and still forwards the encapsulated packets according to the original member linked list, resulting in the forwarding path of the encapsulated packets being inconsistent with the actual state of the underlying public network ECMP routes.

[0023] The root cause of the above problems lies in the fact that, in the existing solution, there is no lifecycle association between the GRE tunnel and the underlying public network ECMP routes. The tunnel's dedicated ECMP group cannot be automatically created when the underlying public network ECMP routes are generated, nor can it be automatically destroyed when the underlying public network ECMP routes are deleted. Furthermore, the tunnel lacks the ability to detect changes in the next-hop members of the underlying public network ECMP routes; its member list cannot be updated synchronously with the failure, addition, or recovery of next-hop members. This results in the hardware forwarding table retaining expired next-hop members or lacking newly added valid next-hop members. Therefore, the GRE tunnel in the existing solution cannot obtain the correct encapsulated packet forwarding path after changes in the underlying public network ECMP routes.

[0024] In view of this, embodiments of this application provide a method for updating the forwarding path of GRE tunnel encapsulated packets, which can be executed by a switch.

[0025] To address the issue that existing GRE tunnels lack a lifecycle association with the underlying public network ECMP routes, resulting in the tunnel's inability to detect changes in these routes and inaccurate packet forwarding paths, this application, in the software control plane, responds to the generation event of the underlying public network ECMP routes by creating a tunnel-specific ECMP group G2 associated with the GRE tunnel. G2's lifecycle follows the underlying public network ECMP routes, and G2 manages the forwarding of encapsulated packets within the GRE tunnel. Furthermore, throughout G2's lifecycle, it continuously monitors whether the next-hop members of the underlying public network ECMP routes have changed. Once a change is detected, an updated member list for G2 is generated based on the changed set of valid next hops, and this updated member list is sent to the hardware forwarding table, ensuring that the forwarding path of the encapsulated packets in the GRE tunnel remains consistent with the actual state of the underlying public network ECMP routes.

[0026] To make the technical solution of this application clearer and easier to understand, the application scenarios of the technical solution of this application are described below with reference to the accompanying drawings. Figure 1 As shown in the figure, this figure is a schematic diagram of an application scenario provided by an embodiment of this application.

[0027] In this application scenario, the switch is deployed in a network environment for data center interconnection or enterprise branch cloud migration. The switch is configured with GRE tunnels to encapsulate private network packets and transmit them to the peer network via the public network. There are multiple equivalent-cost links on the public network side, each corresponding to a different physical outgoing interface and next-hop device. These equivalent-cost links are managed by the underlying public network ECMP routing, providing load balancing and link redundancy for the encapsulated packets of the GRE tunnel at the Underlay layer.

[0028] like Figure 1 As shown, for ordinary Layer 3 IP routing, routing table entries are directly bound to a single-layer ECMP group, and the ECMP group is bound to the physical outgoing interface. Therefore, the route can directly perceive changes in the state of the next hop. In the GRE tunnel layered forwarding scenario, the Underlay public network ECMP route is located at the bottom layer, and the GRE tunnel is located at the Overlay layer. The outer source IP address, outer destination IP address, and tunnel interface of the tunnel are all fixed. There is no direct perception channel between the tunnel and the underlying public network ECMP route. Therefore, when the next hop of the underlying public network ECMP route fails, is added, or recovers, the GRE tunnel cannot autonomously perceive these changes and continues to forward encapsulated packets according to the original path. This results in the forwarding path of the encapsulated packets being inconsistent with the actual state of the underlying public network ECMP route.

[0029] To address the aforementioned issues, this application provides a method for updating the forwarding path of GRE tunnel encapsulated packets. This method involves acquiring the generation event of the underlying public network ECMP route, creating a tunnel-specific ECMP group G2 corresponding to the underlying public network ECMP route, and ensuring that the lifecycle of G2 follows the underlying public network ECMP route. G2 manages the forwarding of encapsulated packets in the GRE tunnel. Within the lifecycle of G2, the method detects whether the next-hop members of the underlying public network ECMP route have changed. When a change is detected, an updated member list is generated based on the changed set of valid next hops and distributed to the hardware forwarding table, thereby updating the forwarding path of encapsulated packets in the GRE tunnel.

[0030] To make the technical solution of this application clearer and easier to understand, the following describes a GRE tunnel encapsulation message forwarding path update method provided by an embodiment of this application, in conjunction with the above application scenarios. For example... Figure 2 As shown, this figure is a flowchart of a GRE tunnel encapsulation packet forwarding path update method provided in an embodiment of this application. In this embodiment, the method includes: S201, the switch obtains the generation event of the underlying public network equal-cost multipath ECMP route.

[0031] A low-level public network equal-cost multipath (ECMP) route is a Layer 3 route on a switch leading to a peer's public IP address. This route has multiple next hops (i.e., multiple physical outgoing interfaces and corresponding next-hop devices), and these next hops have the same routing priority and metric. The switch distributes traffic evenly across these next hops. In this application, this route carries the public network transmission of encapsulated packets for GRE tunnels, hence the name low-level public network ECMP route.

[0032] A generation event is a notification signal triggered when a new underlying public ECMP route is generated in the switch control plane. This generation event carries routing information such as the route's prefix and next-hop set.

[0033] The switch receives a notification signal triggered when a new underlying public network ECMP route is generated from the control plane; this notification signal is the generation event. Specifically, the switch's control plane runs routing protocol processes (such as OSPF and BGP) and configuration management processes. When a new underlying public network ECMP route is written to the routing table, these processes proactively send a notification signal to the switch's internal tunnel management module. The tunnel management module receives this notification signal, obtains the generation event, and parses the routing information carried in the signal to obtain the route's prefix address, next-hop member list, and the physical outgoing interface corresponding to each next hop. Through this parsing result, the tunnel management module learns that a set of available transmission paths currently exist on the underlying public network. Each next-hop member in this set of transmission paths represents a physically available public network link, and GRE tunnel encapsulated packets can be sent to the peer network via any of these links.

[0034] S202. Based on the generated event, the switch creates a tunnel-specific ECMP group G2 corresponding to the underlying public network ECMP route, so that the lifecycle of G2 follows the underlying public network ECMP route. G2 is used to manage the forwarding of encapsulated packets in the GRE tunnel.

[0035] The tunnel-specific ECMP group G2 is a dedicated ECMP group object created solely for the GRE tunnel in the switch's control plane. This object contains a member list, where each member corresponds to a next hop and its physical outgoing interface. This ECMP group serves only one GRE tunnel and is not shared with other tunnels or routes. The lifecycle of the tunnel-specific ECMP group G2 is the complete process from creation to destruction. After creation, G2 exists in the control plane, managing the forwarding of encapsulated packets for the GRE tunnel; after destruction, G2 is removed from the control plane and no longer manages any forwarding. A GRE tunnel is a virtual point-to-point logical channel configured on the switch. By encapsulating a public IP header on a private network packet, it enables the private network packet to be transmitted to the peer network via the public network. The encapsulated packet is a new packet formed by encapsulating the original private network packet with GRE. This packet contains an outer public IP header and can be transmitted via a public network link.

[0036] After creating the tunnel-specific ECMP group G2 corresponding to the underlying public network ECMP route, the method also includes: The switch replicates the current set of valid next-hops from the underlying public network ECMP routes to generate the initial member list of G2; it then synchronizes the initial member list to the hardware forwarding table to generate the initial forwarding path for the encapsulated packets of the GRE tunnel.

[0037] Specifically, after the switch's tunnel management module receives the generation event, it searches the control plane for the GRE tunnel that needs to use the underlying public network ECMP route to forward encapsulated packets, and creates a new ECMP group object G2 under the configuration of the found GRE tunnel. Simultaneously, the tunnel management module parses the next-hop member list of the underlying public network ECMP route from the generation event and uses this list as the initial member list of G2. The tunnel management module associates G2 with the underlying public network ECMP route, establishing a correspondence between G2 and the route, ensuring that the creation of G2 follows the generation of the underlying public network ECMP route and the destruction of G2 follows the deletion of the underlying public network ECMP route. The tunnel management module then sends this initial member list to the hardware forwarding table. After receiving the initial member list, the hardware chip saves it as the initial forwarding path for the encapsulated packets of the GRE tunnel. The tunnel management module obtains a tunnel-specific ECMP group G2 corresponding to the underlying public network ECMP route through the above processing. G2 contains an initial member linked list, where each member corresponds to a physical outgoing interface. Simultaneously, the hardware chip stores the initial forwarding path corresponding to this initial member linked list. The creation and existence of G2 signifies that the GRE tunnel has the ability to manage the underlying public network transmission path. Each next-hop member in the initial member linked list of G2 corresponds to a physically available public network link. The initial forwarding path stored in the hardware chip allows the encapsulated packets of the GRE tunnel to be sent to the peer network via any of these links.

[0038] In this embodiment, the underlying public network ECMP route corresponds to a public network ECMP group G1 in the control plane. G1 is bound to a VLAN Layer 3 physical interface and is used to manage the forwarding of outer-layer IP packets in the underlying public network. G1 and G2 are two completely independent ECMP group objects, bound to different types of outgoing interfaces: G1 is bound to a physical VLAN interface, and G2 is bound to a Tunnel virtual interface. The two types of outgoing interfaces belong to different forwarding layers, and G1 and G2 are prohibited from being reused, thereby avoiding hardware entry conflicts caused by confusion in outgoing interface types. The lifecycle of G2 completely follows that of G1: when the underlying public network ECMP route is generated, G1 is created first, and G2 is automatically created accordingly; when the underlying public network ECMP route is deleted, G1 is destroyed, and G2 is also automatically destroyed. Through the above lifecycle linkage, G2 always maintains a consistent existence state with G1.

[0039] S203. During the lifecycle of G2, the switch detects whether the next-hop member of the underlying public network ECMP route has changed.

[0040] The next-hop member of the underlying public network ECMP route is each specific next-hop entry contained in the underlying public network ECMP route. Each next-hop member corresponds to a physical outgoing interface and a next-hop IP address.

[0041] In some embodiments, the switch identifies the type of next-hop change scenario to which the listening event belongs based on the listening events of the next-hop members of the underlying public network ECMP route; when the next-hop change scenario type is identified as a next-hop leave scenario or a next-hop join scenario, it determines that the next-hop member of the underlying public network ECMP route has changed; wherein, the listening events include ARP aging events, hardware port interruption events, configuration change events and network segment status events.

[0042] The next-hop departure scenario occurs when a next-hop member in the underlying public network ECMP routing changes from an available state to an unavailable state. This includes ARP aging failure (the ARP entry for the next-hop IP address becomes old and cannot resolve its MAC address), physical port downtime (a physical link interruption causes the outgoing interface to become unavailable), and configuration deletion (the administrator manually deletes the configuration of the next-hop member). The next-hop addition scenario occurs when a new available next-hop member is added to the underlying public network ECMP routing. This includes configuring a new next-hop (the administrator manually adds a new next-hop member) and a network segment switching from DOWN to UP (the network segment to which the previously failed next-hop belonged becomes available again, and the next-hop is re-added to the routing). An ARP aging event is triggered when a switch periodically sends ARP probe packets. If it fails to receive an ARP response from the next-hop device multiple times consecutively, it determines that the next-hop is unavailable. A hardware port interruption event is an interrupt signal triggered by the hardware chip to the control plane when the physical port state of a switch changes from UP to DOWN, indicating that the link corresponding to that port has been disconnected. Configuration change events are triggered when an administrator adds or deletes a next-hop member of an underlying public ECMP route via command line or network management system. Network segment status events are triggered when the status of the network segment to which the next-hop member of the underlying public ECMP route belongs changes from DOWN to UP, indicating that the next hop has become available again.

[0043] While G2 is present in the switch's control plane, the switch continuously monitors the next-hop members of the underlying public network ECMP routes to determine if these members have changed. The switch listens to the status events of these next-hop members to identify whether the event belongs to a next-hop leave or next-hop join scenario. When either scenario is detected, the switch determines that the next-hop member of the underlying public network ECMP route has changed. These status events include ARP aging events, hardware port interruption events, configuration change events, and network segment status events.

[0044] Specifically, multiple event monitoring processes run in the switch's control plane. The ARP monitoring process sends ARP probe packets to each next-hop member of the underlying public network ECMP route at a preset period, determining next-hop reachability based on whether an acknowledgment is received. An ARP aging event is generated when no acknowledgment is received consecutively. The hardware interrupt handling process receives physical port status change signals reported by the hardware chip; a hardware port interrupt event is generated when a physical port changes from UP to DOWN. The configuration management process monitors administrator configuration operations on next-hop members, generating configuration change events when a next-hop member is added or deleted. The network segment status management process monitors the status of the network segment to which the next-hop member of the underlying public network ECMP route belongs; a network segment status event is generated when a network segment changes from DOWN to UP. These events are sent to the tunnel management module. Upon receiving these events, the tunnel management module determines whether the event belongs to a next-hop departure scenario (ARP aging event, hardware port interrupt event, configuration deletion event) or a next-hop joining scenario (configuration addition event, network segment status UP event), and determines whether the next-hop member has changed based on the scenario type, thus obtaining a result indicating whether the next-hop member of the underlying public network ECMP route has changed. This determination result indicates whether the current valid next-hop set of the underlying public network ECMP routes has changed compared to the original next-hop set. If it is determined to be a change, it means that the availability status of at least one link in the underlying public network has changed. At this time, the current encapsulated packet forwarding path of the GRE tunnel is inconsistent with the actual status of the underlying public network and needs to be updated.

[0045] In this embodiment, the tunnel management module also establishes a bidirectional binding mapping relationship between the GRE tunnel and the underlying public network ECMP routes: on the one hand, the GRE tunnel records the underlying public network ECMP routes it depends on; on the other hand, the underlying public network ECMP routes are associated with their corresponding G2. This bidirectional binding mapping relationship allows the next-hop state change of the underlying public network ECMP routes to be transmitted to the tunnel management module in real time through the bidirectional binding link, thereby synchronously updating the G2 member list. All public network ECMP group member change signals are pushed to the G2 update module through this bidirectional binding mapping relationship.

[0046] like Figure 3 As shown in the figure, this diagram illustrates a five-category next-hop event-driven G2 member list replacement process provided in an embodiment of this application. Figure 3In the diagram, the left side represents next-hop departure scenarios, including ARP aging (next hop unreachable), physical port downtime (link interruption), and configuration deletion (administrator manually removes the next hop). The right side represents next-hop addition scenarios, including adding a new next hop to a network segment in an UP state, and the next hop becoming available again after an existing failed network segment switches from DOWN to UP. After an event occurs on either the left or right side, the multi-event status monitoring module in the middle receives the event signal. Through the pre-established bidirectional binding relationship between tunnels and routes, it transmits the next-hop change of the underlying public ECMP route G1 to the tunnel-specific ECMP group G2. Upon receiving the change notification, G2 keeps its instance unchanged, generates a new member list based only on G1's latest valid next hop, releases the old member list, and synchronizes the new list to the hardware tunnel encapsulation forwarding table. Since the G2 instance itself remains unchanged, the reference relationships of all GRE tunnels referencing G2 do not need to be modified, thus eliminating the need to traverse and refresh these tunnel route prefixes.

[0047] S204. When a change in the next-hop member is detected, an updated member list for G2 is generated based on the set of valid next-hops of the underlying public ECMP routes after the change.

[0048] The valid next-hop set is the collection of all currently available next-hop members in the underlying public ECMP route. Each valid next hop corresponds to an available physical outgoing interface and a next-hop IP address. The updated member list is a new member list generated by G2 based on the changed valid next-hop set after detecting a change in the next-hop members of the underlying public ECMP route.

[0049] In some embodiments, while keeping the instance identifier, tunnel binding relationship and route reference relationship of G2 unchanged, the switch generates the updated member list of G2 based on the effective next-hop set of the changed underlying public network ECMP routes and releases the initial member list of G2.

[0050] The instance identifier is a unique identifier for a G2 object in the control plane, used to distinguish different ECMP group objects. The tunnel binding relationship is the correspondence between G2 and GRE tunnels, that is, which GRE tunnel's encapsulated packets are forwarded by G2. The route reference relationship is the reference from a GRE tunnel to G2, that is, the GRE tunnel obtains the list of outgoing interfaces for encapsulated packets from G2. The initial member list is the first member list generated when G2 is created, based on the currently valid next-hop set of the underlying public network ECMP routes.

[0051] Specifically, after the switch's tunnel management module obtains the determination result that the next-hop member of the underlying public network ECMP route has changed, it obtains the current valid next-hop set of the route. Without modifying the instance identifier, tunnel binding relationship, or route reference relationship of G2, and without changing the G2 object itself, the tunnel management module generates a completely new member list based on this valid next-hop set, which serves as the updated member list of G2. The tunnel management module releases the control plane memory resources occupied by the initial member list of G2 and sets the updated member list as the current member list of G2. Through the above processing, the tunnel management module obtains the updated member list of G2, where all members are valid next hops of the changed underlying public network ECMP route. This updated member list indicates that the forwarding path of the encapsulated packets of the GRE tunnel has been updated according to the latest state of the underlying public network ECMP route. Each hop in the updated forwarding path is a currently valid physical outgoing interface, no longer containing expired next hops, and includes newly added available next hops. The fact that the instance identifier of G2 remains unchanged indicates that the ECMP group is still the same object, and the reference of GRE tunnel to G2 does not need to be modified; the fact that the tunnel binding relationship remains unchanged indicates that G2 still serves the same GRE tunnel; the fact that the routing reference relationship remains unchanged indicates that the forwarding path of the encapsulated packets of all GRE tunnels that reference G2 does not need to be modified.

[0052] like Figure 4 As shown in the figure, this is a schematic diagram illustrating the principle of a G2 instance with a fixed lifespan and only member list replacement provided in an embodiment of this application. Figure 4 In the middle, the left side represents the G2 instance itself, containing three fixed attributes: the instance ID remains unchanged throughout its lifetime, uniquely identifying the ECMP group; the tunnel binding relationship is fixed, meaning G2 always serves the same GRE tunnel; and the route reference relationship is fixed, meaning all GRE tunnels referencing G2 maintain the same pointer to G2. The middle section represents the linked list pointer replacement operation, where the G2 instance itself only stores one pointer to the member linked list. During updates, this pointer is switched from pointing to the old linked list to pointing to the new linked list, without any modification to the G2 instance itself. The upper right section represents the old member linked list to be released and destroyed, containing next hop 1, next hop 2, and next hop 3. These next hops may contain expired members (such as next hop 2), which need to be released to reclaim memory resources. The lower right section represents the new member linked list generated based on the latest valid next hop from G1, containing next hop 1, next hop 3, and next hop 4 (next hop 2 is removed due to expiration, and next hop 4 is a newly added valid next hop). After the new linked list is generated, the linked list pointers inside the G2 instance switch from the old linked list to the new linked list, and the old linked list is released and destroyed. The G2 instance itself is not modified. Since the G2 instance itself remains unchanged, all tunnel route prefixes referencing G2 do not need to be traversed and refreshed; only the member linked list is replaced, thus achieving lightweight updates.

[0053] The method also includes: The switch obtains the number of valid next hops in the updated member list of G2; performs a hash calculation on the header of the encapsulated packet of the GRE tunnel based on the number of valid next hops to obtain a hash value; takes the modulo of the hash value with the number of valid next hops to obtain the modulo result; and allocates the encapsulated packet to the corresponding valid next hop based on the modulo result.

[0054] The number of valid next hops, denoted as N, is the total number of valid next hops contained in the updated member list of G2. Each valid next hop corresponds to an available physical outgoing interface. Hash calculation is a mathematical operation performed by the switch hardware chip on specific fields in the packet header (such as the source IP address, destination IP address, protocol number, etc. in the outer IP header) to generate a fixed-length value. For the same packet stream (packets with the same header characteristics), the hash calculation result is the same; for different packet streams, the hash calculation result is different. Modulo is a mathematical operation where the hash value is divided by the number of valid next hops N, and the remainder is the modulo result. The modulo result ranges from 0 to N-1, corresponding one-to-one with the range of valid next hop numbers. The modulo result, the remainder after taking the hash value modulo the number of valid next hops N, is used to determine which valid next hop the encapsulated packet should be assigned to.

[0055] Specifically, the switch's hardware chip reads the total number of valid next hops, denoted as N, from the G2's updated member list. When an encapsulated packet needs to be forwarded, the hardware chip extracts specific fields from the packet header (such as the source IP address, destination IP address, and protocol number in the outer IP header), performs a hash calculation on these fields, and obtains a fixed-length value as the hash value. The hardware chip divides this hash value by N and takes the remainder as the modulo result. Based on this modulo result, the hardware chip searches for the corresponding valid next hop in the updated member list and sends the encapsulated packet out from the physical outgoing interface corresponding to that valid next hop. For each subsequent encapsulated packet, the hardware chip repeats the above hash calculation, modulo, and allocation process. Through the above processing, the hardware chip obtains the allocation result of which valid next hop the encapsulated packet is assigned to. The allocation result indicates that the encapsulated message is assigned to a valid next hop in the updated member linked list according to the load sharing rules. After a large number of encapsulated messages have undergone the above processing, since the hash values ​​of different messages are different, the modulo result is evenly distributed between 0 and N-1, and a large number of encapsulated messages are evenly distributed to N valid next hops.

[0056] The method also includes: Monitor the forwarding quality parameters of each next hop in the effective next hop set of the underlying public network ECMP routes; remove next hops with forwarding quality parameters greater than the abnormal threshold from the effective next hop set.

[0057] Forwarding quality parameters are quantitative metrics used to measure the performance of next-hop forwarding, including latency (the time interval between sending and receiving an acknowledgment of a packet) and packet loss rate (the ratio of the number of packets that do not receive an acknowledgment per unit time to the total number of packets sent). An anomaly threshold is a pre-set threshold value for the forwarding quality parameters, used to determine whether the forwarding quality of a next hop has deteriorated to the point where it is unsuitable for continuing to carry traffic. When the forwarding quality parameters exceed this threshold, the next hop is considered an anomaly.

[0058] Specifically, the switch's control plane sends probe packets to each next hop in the effective next hop set of the underlying public network ECMP routes according to a preset period, and records the sending time of each probe packet; the control plane receives probe response packets returned by the next hop device, records the receiving time of the probe response packets, and calculates the difference between the sending time and the receiving time as the delay of that next hop; the control plane counts the total number of probe packets sent to that next hop within a preset time period and the number of packets that did not receive a response, and calculates the ratio of the number of packets that did not receive a response to the total number of packets sent as the packet loss rate of that next hop; the control plane compares the calculated delay with a preset delay threshold, and compares the calculated packet loss rate with a preset packet loss rate threshold; when the delay is greater than the delay threshold, or the packet loss rate is greater than the packet loss rate threshold, the control plane marks that next hop as abnormal and removes the marked abnormal next hop from the effective next hop set. The control plane obtains a set of valid next hops after removing abnormal next hops through the above processing. This set represents the set of all next hops in the underlying public network ECMP routes that are currently both available and have qualified forwarding quality. All next hops in this set can carry the forwarding of encapsulated packets of GRE tunnels.

[0059] S205. The switch will update the member list and send it to the hardware forwarding table to update the forwarding path of the encapsulated packets of the GRE tunnel.

[0060] The hardware forwarding table is a forwarding entry table stored in the switch's hardware chip, used to determine which physical outgoing interface the encapsulated packet should be sent from. In this application, this table is the tunnel encapsulation forwarding table corresponding to G2, formed after synchronizing G2's current member list to the hardware chip. Updating the forwarding path of the encapsulated packet in the GRE tunnel involves writing the valid next-hop member from G2's updated member list into the hardware chip, replacing the old member list in the hardware forwarding table, so that subsequently arriving encapsulated packets are sent according to the new member list, selecting the physical outgoing interface.

[0061] Specifically, the switch's control plane sends the updated member list of G2 to the driver module of the hardware chip. Upon receiving the updated member list, the hardware driver module writes each valid next-hop member and its corresponding physical outgoing interface into the hardware chip's forwarding table, replacing the old member list of G2 in the hardware forwarding table. After completing the write operation, the hardware chip returns a successful write confirmation signal to the control plane. Upon receiving the confirmation signal, the control plane releases the memory resources occupied by the old member list of G2 in the control plane. Through this process, the control plane and hardware chip update the forwarding entry for G2 in the hardware chip's forwarding table to the new member list. The hardware chip then forwards encapsulated packets from the GRE tunnel according to the new member list. The updated member list in the hardware forwarding table indicates that the forwarding path of the encapsulated packets from the GRE tunnel is now consistent with the latest state of the underlying public network ECMP routing. In subsequent forwarding, the hardware chip only uses valid next hops from the updated member list and no longer uses old next hops that have been removed or expired. Encapsulated packets will not be sent to currently unavailable links.

[0062] In this embodiment, the linked list updates of G1 and G2 are independently synchronized to the hardware chip without interference. The linked list update of public network ECMP group G1 is synchronized to the VLAN underlying public network forwarding table of the hardware chip for handling outer IP forwarding; the linked list update of G2 is independently synchronized to the GRE tunnel encapsulation forwarding table of the hardware chip for handling load balancing of GRE encapsulated packets. The hardware chip distinguishes between physical VLAN interfaces and tunnel virtual interfaces, natively supporting high-speed hardware forwarding of GRE packets. The above update process does not require restarting the hardware forwarding process, the synchronization delay is controlled within 10 milliseconds, and tunnel traffic will not experience large-scale interruptions or hash redistribution oscillations.

[0063] like Figure 5 As shown in the figure, this is a schematic diagram of the interaction between a software control plane and a hardware layered forwarding table provided in an embodiment of this application. Figure 5 In the software control plane, the hierarchical ECMP lifecycle binding module is responsible for managing the lifecycle linkage of G1 and G2, including automatically creating G2 when G1 is created, synchronously destroying G2 when G1 is deleted, and establishing the association between G1 and G2; the multi-event next-hop monitoring module is responsible for receiving next-hop change events of the underlying public network ECMP routes (including five scenarios: ARP aging, port downtime, configuration deletion, adding a next hop, and network segment switching from DOWN to UP), and passing the change signal to the ECMP linked list update module; the ECMP linked list update module generates a new member linked list of G2 based on the latest valid next hop of G1, and releases the old linked list; the software and hardware hierarchical synchronization module is responsible for distributing the updated linked list in the control plane to two independent forwarding tables of the hardware forwarding chip, and the synchronization of the two tables does not interfere with each other.

[0064] The hardware forwarding chip contains two independent forwarding tables. The VLAN underlying public network forwarding table, G1, stores physical VLAN outgoing interface information and is used for forwarding external IP packets. The GRE tunnel encapsulation forwarding table, G2, stores tunnel virtual outgoing interface information and is used for load balancing of GRE-encapsulated packets. The two forwarding tables, G1 and G2, are managed independently, and their synchronization processes do not interfere with each other. The hardware chip does not need to restart the forwarding process when performing the above synchronization operations, so service traffic will not be interrupted due to forwarding table updates.

[0065] The method also includes: When a deletion event of an underlying public network ECMP route is obtained, the corresponding G2 is destroyed according to the association between G2 and the underlying public network ECMP route.

[0066] Specifically, when a underlying public network ECMP route is deleted from the routing table, the routing protocol process or configuration management process in the switch's control plane sends a deletion notification signal to the tunnel management module. The tunnel management module receives this signal to detect the deletion event of the underlying public network ECMP route. Based on the association between G2 and the route, the tunnel management module searches for the corresponding G2 in the control plane. After finding the corresponding G2, the tunnel management module removes the G2 object from the control plane, releasing the control plane memory resources occupied by the G2. The tunnel management module sends a deletion command to the hardware chip, which then deletes the forwarding entry corresponding to the G2 from its forwarding table, releasing the hardware table entry resources. Through this process, the tunnel management module and the hardware chip remove the G2 from the control plane, and the corresponding hardware forwarding table entry is deleted. The destruction of the G2 indicates that the forwarding path management object of the encapsulated packets of this GRE tunnel has been removed along with the deletion of the underlying public network ECMP route, and the GRE tunnel no longer has a usable underlying public network transmission path management object.

[0067] Based on the above description, this application has the following beneficial effects: This application obtains the generation event of the underlying public network ECMP route, creates a tunnel-specific ECMP group G2 corresponding to the underlying public network ECMP route, and associates G2 with the underlying public network ECMP route. This ensures that the lifecycle of G2 follows the underlying public network ECMP route. G2 is used to manage the forwarding of encapsulated packets in the GRE tunnel, achieving lifecycle linkage between G2 and the underlying public network ECMP route. G2 is automatically created when the underlying public network ECMP route is generated and automatically destroyed when the underlying public network ECMP route is deleted. The forwarding path of the encapsulated packets in the GRE tunnel remains consistent with the actual state of the underlying public network ECMP route, solving the problem in existing technologies where the GRE tunnel cannot detect the generation and deletion of underlying routes, leading to inaccurate forwarding paths for encapsulated packets.

[0068] This application detects changes in the next-hop members of the underlying public network ECMP routes during the lifecycle of G2. When a change is detected, an updated member list of G2 is generated based on the valid next-hop set of the changed underlying public network ECMP routes and sent to the hardware forwarding table to update the forwarding path of the encapsulated packets of the GRE tunnel. This ensures that the member list inside G2 is updated synchronously with changes in the next-hop members of the underlying public network ECMP routes, and the hardware forwarding table always contains the currently valid next-hop members. The tunnel always forwards encapsulated packets according to the currently valid next hop, avoiding packet loss and link resource waste caused by forwarding to the wrong path due to the inability to detect next-hop failure or recovery.

[0069] The above text combined Figure 2 The method for updating the GRE tunnel encapsulated message forwarding path provided in the embodiments of this application has been described in detail. The apparatus and equipment provided in the embodiments of this application will be described below with reference to the accompanying drawings.

[0070] like Figure 6 As shown in the figure, this is a schematic diagram of a GRE tunnel encapsulation packet forwarding path update device provided in an embodiment of this application. The device includes: The acquisition module 301 is used to acquire the generation events of the underlying public network equal-cost multipath (ECMP) routes; The processing module 302 is configured to create a tunnel-specific ECMP group G2 corresponding to the underlying public network ECMP route based on the generation event, such that the lifecycle of G2 follows the underlying public network ECMP route, wherein G2 is used to manage the forwarding of encapsulated packets of the GRE tunnel; during the lifecycle of G2, it detects whether the next-hop member of the underlying public network ECMP route has changed; when the next-hop member is detected to have changed, it generates an updated member linked list of G2 based on the valid next-hop set of the changed underlying public network ECMP route. The forwarding module 303 is used to send the updated member list to the hardware forwarding table to update the forwarding path of the encapsulated packets of the GRE tunnel.

[0071] Optionally, the processing module 302 is further configured to copy the current valid next-hop set of the underlying public network ECMP routes, generate the initial member list of the G2, and synchronize the initial member list to the hardware forwarding table to generate the initial forwarding path of the encapsulated packets of the GRE tunnel.

[0072] Optionally, the processing module 302 is specifically used to identify the next-hop change scenario type to which the listening event belongs based on the listening event of the next-hop member of the underlying public network ECMP route; When the next-hop change scenario type is identified as either a next-hop leave scenario or a next-hop join scenario, it is determined that the next-hop member of the underlying public network ECMP route has changed; among them, the monitoring events include ARP aging events, hardware port interruption events, configuration change events, and network segment status events.

[0073] Optionally, the processing module 302 is further configured to destroy the corresponding G2 according to the association between G2 and the underlying public network ECMP route when the deletion event of the underlying public network ECMP route is obtained.

[0074] Optionally, the processing module 302 is also used to obtain the number of valid next hops in the updated member list of G2; The hash value is obtained by hashing the header of the encapsulated message of the GRE tunnel based on the number of valid next hops. The hash value is moduloed by the number of valid next hops to obtain the modulo result; The encapsulated message is assigned to the corresponding valid next hop based on the modulus result.

[0075] Optionally, the processing module 302 is also used to monitor the forwarding quality parameters of each next hop in the valid next hop set of the underlying public network ECMP routes; Next hops whose forwarding quality parameters are greater than the abnormal threshold are removed from the set of valid next hops.

[0076] Optionally, the processing module 302 is specifically used to generate the updated member list of G2 and release the initial member list of G2 based on the changed set of valid next-hops of the underlying public network ECMP routes, while keeping the instance identifier, tunnel binding relationship and route reference relationship of G2 unchanged.

[0077] The GRE tunneling encapsulation packet forwarding path update apparatus according to the embodiments of this application can correspondingly execute the method described in the embodiments of this application, and the other operations and / or functions of each module / unit of the GRE tunneling encapsulation packet forwarding path update apparatus are respectively for implementing Figure 2 For the sake of brevity, the corresponding processes of each method in the illustrated embodiments will not be described in detail here.

[0078] This application also provides a computing device. For example... Figure 7 As shown in the figure, this is a schematic diagram of a computing device provided in an embodiment of this application. The computing device 400 includes a bus 401, a processor 402, a communication interface 403, and a memory 404. The processor 402, the memory 404, and the communication interface 403 communicate with each other via the bus 401.

[0079] Bus 401 can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of representation, Figure 7 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.

[0080] Processor 402 can be any one or more of the following processors: central processing unit (CPU), graphics processing unit (GPU), microprocessor (MP), or digital signal processor (DSP).

[0081] Communication interface 403 is used for communication with external devices.

[0082] Memory 404 may include volatile memory, such as random access memory (RAM). Memory 404 may also include non-volatile memory, such as read-only memory (ROM), flash memory, hard disk drive (HDD), or solid state drive (SSD).

[0083] The memory 404 stores executable code, and the processor 402 executes the executable code to perform the aforementioned GRE tunnel encapsulation message forwarding path update method.

[0084] Specifically, in achieving Figure 6 In the case of the illustrated embodiment, and Figure 6 When the modules or units of the GRE tunnel encapsulation packet forwarding path update device described in the embodiment are implemented in software, the execution... Figure 6 The software or program code required for the functions of each module / unit can be partially or wholly stored in memory 404. Processor 402 executes the program code corresponding to each unit stored in memory 404 and executes the aforementioned GRE tunnel encapsulation message forwarding path update method.

[0085] This application also provides a computer-readable storage medium. The computer-readable storage medium can be any available medium that a computing device can store, or a data storage device such as a data center containing one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid-state drive). The computer-readable storage medium includes instructions that instruct the computing device to execute the above-described GRE tunneling encapsulated message forwarding path update method.

[0086] This application also provides a computer program product comprising one or more computer instructions. When the computer instructions are loaded and executed on a computing device, all or part of the processes or functions described in this application are generated.

[0087] The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions may be transmitted from one website, computer, or data center to another website, computer, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) means.

[0088] When the computer program product is executed by a computer, the computer executes any of the methods described in the aforementioned GRE tunneling encapsulation packet forwarding path update method. The computer program product can be a software installation package; when any of the aforementioned GRE tunneling encapsulation packet forwarding path update methods needs to be used, the computer program product can be downloaded and executed on the computer.

[0089] The descriptions of the processes or structures corresponding to the above figures each have their own emphasis. For parts of a process or structure that are not described in detail, please refer to the relevant descriptions of other processes or structures.

[0090] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions within the technical scope disclosed in this application should be covered within the scope of protection of this application.

Claims

1. A method for updating the forwarding path of GRE tunnel encapsulated packets, characterized in that, The method includes: Obtain the generation events of the underlying public network equal-cost multipath (ECMP) routes; Based on the generated event, a tunnel-specific ECMP group G2 corresponding to the underlying public network ECMP route is created, so that the lifecycle of G2 follows the underlying public network ECMP route. G2 is used to manage the forwarding of encapsulated packets of GRE tunnel. During the lifecycle of G2, detect whether the next-hop member of the underlying public network ECMP route has changed; When a change in the next-hop member is detected, the updated member list of G2 is generated based on the valid next-hop set of the underlying public network ECMP route after the change. The updated member list is sent to the hardware forwarding table to update the forwarding path of the encapsulated packets in the GRE tunnel.

2. The method according to claim 1, characterized in that, After creating the tunnel-specific ECMP group G2 corresponding to the underlying public network ECMP route, the method further includes: Copy the current set of valid next hops of the underlying public network ECMP routes to generate the initial member linked list of G2; The initial member list is synchronized to the hardware forwarding table to generate the initial forwarding path for the encapsulated packets of the GRE tunnel.

3. The method according to claim 1, characterized in that, The detection of whether the next-hop member of the underlying public network ECMP route has changed includes: Based on the listening events of the next-hop members of the underlying public network ECMP route, identify the next-hop change scenario type to which the listening events belong; When the next-hop change scenario type is identified as either a next-hop leave scenario or a next-hop join scenario, it is determined that the next-hop member of the underlying public network ECMP route has changed; among them, the monitoring events include ARP aging events, hardware port interruption events, configuration change events, and network segment status events.

4. The method according to claim 1, characterized in that, The method further includes: When a deletion event of the underlying public network ECMP route is obtained, the corresponding G2 is destroyed according to the association between G2 and the underlying public network ECMP route.

5. The method according to claim 1, characterized in that, The method further includes: Get the number of valid next hops in the updated member list of G2; The hash value is obtained by hashing the header of the encapsulated message of the GRE tunnel based on the number of valid next hops. The hash value is moduloed by the number of valid next hops to obtain the modulo result; The encapsulated message is assigned to the corresponding valid next hop based on the modulus result.

6. The method according to claim 1, characterized in that, The method further includes: Monitor the forwarding quality parameters of each next hop in the valid next hop set of the underlying public network ECMP routes; Next hops whose forwarding quality parameters are greater than the abnormal threshold are removed from the set of valid next hops.

7. The method according to claim 1, characterized in that, The step of generating the updated member list of G2 based on the valid next-hop set of the modified underlying public network ECMP routes includes: While keeping the instance identifier, tunnel binding relationship and route reference relationship of G2 unchanged, the updated member list of G2 is generated according to the effective next-hop set of the underlying public network ECMP routes after the change, and the initial member list of G2 is released.

8. A GRE tunnel encapsulation message forwarding path update device, characterized in that, The device includes: The acquisition module is used to acquire the generation events of underlying public network equal-cost multipath (ECMP) routes; The processing module is configured to create a tunnel-specific ECMP group G2 corresponding to the underlying public network ECMP route based on the generated event, such that the lifecycle of G2 follows the underlying public network ECMP route. G2 is used to manage the forwarding of encapsulated packets in the GRE tunnel. During the lifecycle of G2, it detects whether the next-hop member of the underlying public network ECMP route has changed. When a change in the next-hop member is detected, it generates an updated member list for G2 based on the valid next-hop set of the changed underlying public network ECMP route. The forwarding module is used to send the updated member list to the hardware forwarding table to update the forwarding path of the encapsulated packets of the GRE tunnel.

9. A computing device, characterized in that, Including memory and processor; The memory stores one or more computer programs, the one or more computer programs including instructions; when the instructions are executed by the processor, the computing device performs the method as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium is used to store a computer program for performing the method as described in any one of claims 1 to 7.