A communication method and apparatus
By controlling the overhead value of routing information, packets are ensured to be directly forwarded to the primary device in a multi-machine backup network, which solves the problems of bandwidth waste and low forwarding efficiency in EVPN VPLS over SRv6 BE and achieves efficient packet forwarding.
Patent Information
- Application Number
- CN202411742386.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-29
- Publication Date
- 2025-10-28
- Estimated Expiration
- 2044-11-29
AI Technical Summary
In multi-machine backup networking of EVPN VPLS over SRv6 BE, when multiple network devices act as equivalent next hops, packets are routed to backup devices, resulting in bandwidth waste and low forwarding efficiency.
The first network device obtains the current operating status and sends or does not send routing information to control the cost value, so that the second network device selects the SRv6 PW tunnel with the minimum cost value for packet forwarding, ensuring that the packet is sent directly to the primary device.
It solves the problem of packet detours in multi-machine backup networking, reduces bandwidth waste, and improves packet forwarding efficiency.
Smart Images

Figure CN119583423B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of communication technology, and in particular to a communication method and apparatus. Background Art
[0002] In a multi-machine backup network using EVPN VPLS over SRv6 BE, multiple network devices join the same backup group, such as a Virtual Router Redundancy Protocol (VRRP) backup group, which includes one primary device and one or more backup devices. These network devices are connected to a remote network device (i.e., the headend device) via a Segment Routing Over Internet Protocol Version 6 Best Effort (SRv6 BE) tunnel based on the IPv6 forwarding plane. These network devices advertise routing information with identical Locator network segments and cost values via IGP, and the remote network device (i.e., the headend device) is unaware of the primary / backup status of these multiple network devices. When the headend device calculates routes based on the received routing information, it adds these multiple network devices as equivalent next hops to its routing table and distributes the forwarding table.
[0003] Correspondingly, when forwarding packets through the SRv6 BE tunnel, the headend device distributes the packet load across these multiple network devices according to the equal-cost route. However, packets sent to the backup device require the backup device to re-look up its table and reroute the packet back to the primary device. This results in wasted bandwidth and affects packet forwarding efficiency. Summary of the Invention
[0004] The purpose of this application is to provide a communication method and apparatus to solve the problems of bandwidth waste and low packet forwarding efficiency caused by packet detours in multi-machine backup networking. The specific technical solution is as follows:
[0005] In a first aspect, embodiments of this application provide a communication method applied to a first network device, the first network device being in a multi-machine backup group, wherein each network device in the multi-machine backup group establishes an SRv6 PW tunnel with a second network device, and multiple SRv6 PW tunnels form an equivalent path, the method comprising:
[0006] Obtain the current operating status of the first network device;
[0007] Based on the current operating state, the routing information to the first network device is sent or not sent. The routing information includes a cost value, so that the second network device, which receives at least one routing information, selects the SRv6 PW tunnel with the lowest cost value as the path for forwarding the target packet. The SRv6 PW tunnel with the lowest cost value is the SRv6 PW tunnel between the second network device and the primary device in the multi-machine backup group.
[0008] In some embodiments, the first network device stores tracking items;
[0009] The step of sending or not sending routing information to the first network device based on the current working state specifically includes:
[0010] Set the value of the tracking item according to the current working status;
[0011] Based on the value of the tracking item, send or do not send routing information to the first network device.
[0012] In some embodiments, setting the value of the tracking item according to the current working state includes:
[0013] If the current working state is a first preset state, then the tracking item in the first network device is set to a first preset value, and the first preset state indicates that the first network device is the primary device;
[0014] If the current working state is a second preset state or a third preset state, then the tracking item is set to a second preset value. The second preset state indicates that the first network device is a standby device, and the third preset state indicates that the first network device is in the initialization phase.
[0015] If the current working state is the fourth preset state, then the tracking item is set to the third preset value. The fourth preset state indicates that the first network device is abnormal or that the multi-machine backup group does not exist.
[0016] In some embodiments, before sending or not sending routing information to the first network device, the method further includes:
[0017] If the value of the tracking item is the first preset value or the third preset value, or if the tracking item does not exist, then the cost value in the routing information to the first network device is set to the original cost value.
[0018] If the value of the tracking item is the second preset value, then the cost value in the routing information leading to the first network device is set to the target cost value, which is greater than the original cost value;
[0019] The step of sending or not sending routing information to the first network device based on the value of the tracking item specifically includes:
[0020] If the tracking item is the first preset value, then the routing information is sent to the second network device, and the cost value included in the routing information is the original cost value;
[0021] If the tracking item is the second preset value, then the routing information is sent to the second network device, and the cost value included in the routing information is the target cost value;
[0022] If the tracking item is the third preset value, then the routing information is sent to the second network device, and the cost value included in the routing information is the original cost value.
[0023] In some embodiments, setting the cost value in the routing information leading to the first network device to a target cost value specifically includes:
[0024] The original cost value is increased by a preset offset value; if the increased cost value is less than the maximum cost value, the increased cost value is used as the target cost value; if the increased cost value is greater than or equal to the maximum cost value, the maximum cost value is used as the target cost value; the cost value in the routing information leading to the first network device is set as the target cost value; or,
[0025] Use a preset cost value as the target cost value; set the cost value in the routing information leading to the first network device as the target cost value.
[0026] In some embodiments, the step of sending or not sending routing information to the first network device based on the value of the tracking item specifically includes:
[0027] If the value of the tracking item is the first preset value or the third preset value, then the routing information to the first network device is sent to the second network device;
[0028] If the value of the tracking item is the second preset value, then the transmission of routing information to the first network device is suppressed.
[0029] Secondly, embodiments of this application provide a communication device applied to a first network device, the first network device being in a multi-machine backup group, wherein each network device in the multi-machine backup group establishes an SRv6 PW tunnel with a second network device, and multiple SRv6 PW tunnels form an equivalent path, the device comprising:
[0030] The acquisition module is used to acquire the current working status of the first network device;
[0031] The processing module is configured to send or not send routing information to the first network device according to the current working state. The routing information includes a cost value, so that the second network device that receives at least one routing information selects the SRv6 PW tunnel with the smallest cost value as the path for forwarding the target packet. The SRv6 PW tunnel with the smallest cost value is the SRv6 PW tunnel between the second network device and the primary device in the multi-machine backup group.
[0032] In some embodiments, the first network device stores tracking items;
[0033] The processing module includes:
[0034] The tracking submodule is used to set the value of the tracking item according to the current working state;
[0035] The application submodule is used to send or not send routing information to the first network device based on the value of the tracking item.
[0036] In some embodiments, the tracking submodule is specifically used for:
[0037] If the current working state is a first preset state, then the tracking item is set to a first preset value, and the first preset state indicates that the first network device is the primary device;
[0038] If the current working state is a second preset state or a third preset state, then the tracking item is set to a second preset value. The second preset state indicates that the first network device is a standby device, and the third preset state indicates that the first network device is in the initialization phase.
[0039] If the current working state is the fourth preset state, then the tracking item is set to the third preset value. The fourth preset state indicates that the first network device is abnormal or that the multi-machine backup group does not exist.
[0040] In some embodiments, the application submodule is further configured to: before sending or not sending routing information to the first network device, if the value of the tracking item is the first preset value or the third preset value, set the cost value in the routing information to the first network device to the original cost value; if the value of the tracking item is the second preset value, set the cost value in the routing information to the first network device to the target cost value, wherein the target cost value is greater than the original cost value.
[0041] The application submodule is specifically configured to: if the tracking item is the first preset value, send the routing information to the second network device, wherein the cost value included in the routing information is the original cost value; if the tracking item is the second preset value, send the routing information to the second network device, wherein the cost value included in the routing information is the target cost value; if the tracking item is the third preset value, send the routing information to the second network device, wherein the cost value included in the routing information is the original cost value.
[0042] In some embodiments, the application submodule is specifically used for:
[0043] The original cost value is increased by a preset offset value; if the increased cost value is less than the maximum cost value, the increased cost value is used as the target cost value; if the increased cost value is greater than or equal to the maximum cost value, the maximum cost value is used as the target cost value; the cost value in the routing information leading to the first network device is set as the target cost value; or,
[0044] Use a preset cost value as the target cost value; set the cost value in the routing information leading to the first network device as the target cost value.
[0045] In some embodiments, the application submodule is specifically used for:
[0046] If the value of the tracking item is the first preset value or the third preset value, then the routing information to the first network device is sent to the second network device;
[0047] If the value of the tracking item is the second preset value, then the transmission of routing information to the first network device is suppressed.
[0048] Thirdly, embodiments of this application provide a network device including a processor and a machine-readable storage medium storing machine-executable instructions that can be executed by the processor, the processor being prompted by the machine-executable instructions to perform any of the steps of the method described above.
[0049] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program, which, when executed by a processor, implements any of the steps described above.
[0050] Fifthly, embodiments of this application also provide a computer program product containing instructions that, when run on a computer, cause the computer to perform any of the methods described above.
[0051] Beneficial effects of the embodiments in this application:
[0052] In the technical solution provided in this application embodiment, the first network device included in the multi-machine backup group and the second network device outside the multi-machine backup group are located in the multi-machine backup network. The first network device obtains its current working status and, using its current working status, sends or does not send routing information destined for itself. The routing information includes a cost value, and the SRv6 PW tunnel with the lowest cost value is the SRv6 PW tunnel between the second network device and the primary device in the multi-machine backup group. In this way, the second network device can distinguish between the primary and backup devices included in the multi-machine backup group through the cost value in the routing information, ensuring that packets sent by the second network device to the multi-machine backup group are sent to the primary devices included in the multi-machine backup group, and not to the backup devices. This solves the problem of packet detours in the multi-machine backup network, thereby reducing bandwidth waste and improving packet forwarding efficiency.
[0053] Of course, implementing any product or method of this application does not necessarily require achieving all of the advantages described above at the same time. Attached Figure Description
[0054] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other embodiments can be obtained based on these drawings.
[0055] Figure 1 A schematic diagram of an EVPN VPLS over SRv6 network;
[0056] Figure 2 A schematic diagram of the SRv6 PW setup process;
[0057] Figure 3 A diagram illustrating the process of learning MAC address table entries;
[0058] Figure 4 A schematic diagram of a multi-homed network;
[0059] Figure 5 A schematic diagram of a multi-machine backup network;
[0060] Figure 6 A flowchart illustrating a communication method provided in an embodiment of this application;
[0061] Figure 7 A schematic diagram of a multi-machine backup network provided in an embodiment of this application;
[0062] Figure 8This is a schematic diagram of a first structure of a communication device provided in an embodiment of this application;
[0063] Figure 9 This is a second structural schematic diagram of the communication device provided in the embodiments of this application;
[0064] Figure 10 This is a schematic diagram of the structure of a network device provided in an embodiment of this application. Detailed Implementation
[0065] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art based on this application are within the scope of protection of this application.
[0066] The following is an explanation of the terms used in the embodiments of this application.
[0067] EVPN: A Layer 2 Virtual Private Network (VPN) technology based on overlay networks. The control plane uses Extended Border Gateway Protocol (BGP) to advertise routing information, while the data plane uses Virtual eXtensible Local Area Network (VXLAN) or Multi-Protocol Label Switching (MPLS) encapsulation to forward packets. When user sites are located in different locations, EVPN can provide Layer 2 interconnection between different user sites based on existing service provider or enterprise networks. When using VXLAN encapsulation, EVPN can also achieve Layer 3 interconnection between different user sites. EVPN is widely used in data center networks, campus access networks, and wide area networks (WANs).
[0068] The control plane of an EVPN (Virtual Private LAN Service) VPLS network uses Multi-Protocol Border Gateway Protocol (MP-BGP) to advertise routing information, while the data plane uses MPLS encapsulation to forward packets. In an EVPN VPLS network, Provider Edge (PE) devices forward packets by looking up the Media Access Control (MAC) address table, providing point-to-multipoint Layer 2 services to users.
[0069] An EVPN VPLS network can include the following components:
[0070] Attachment Circuit (AC): The connection between Customer Edge (CE) devices and PE devices.
[0071] EVPN Pseudo Wire (PW): A virtual bidirectional connection between two PE devices.
[0072] Public network tunnel: A tunnel that traverses the Internet Protocol (IP) or MPLS backbone network to carry PW (Public Message Transport), such as Layered Service Provider (LSP) tunnels and MPLS Traffic Engineering (TE) tunnels. The public network tunnel label ensures that packets are forwarded from one PE (Personal Equipment) device to another within the backbone network.
[0073] Virtual Switch Instance (VSI): A virtual instance on a PE device that provides Layer 2 services. It can be understood as a virtual switch device on the PE device. Each VSI provides Layer 2 services for an EVPN VPLS network.
[0074] SRv6: A protocol designed based on source routing principles for forwarding IPv6 packets over a network. In SRv6, the first node inserts a Segment Routing Header (SRH) into the IPv6 packet and pushes an explicit IPv6 address stack onto the SRH; intermediate nodes continuously update the destination address and offset address stacks to complete hop-by-hop forwarding.
[0075] SRv6 BE packets contain an SRH representing path constraints. The packet format of SRv6 BE packets is consistent with that of ordinary IPv6 packets, and their forwarding behavior is also consistent with that of ordinary IPv6 packets. This means that ordinary IPv6 nodes can also process SRv6 BE packets, making SRv6 compatible with ordinary IPv6 devices. The difference between SRv6 BE packets and ordinary IPv6 packets is that the destination address of an ordinary IPv6 packet is a host's IP address or network segment, while the destination address of an SRv6 BE packet is a service SID. The service SID guides the packet to be forwarded along the shortest path to the node that generated that SID, and that node executes the instructions of the service SID. SRv6 BE packets are packets forwarded via SRv6 BE tunnels.
[0076] EVPN VPLS over SRv6 networking, such as Figure 1 As shown, EVPN VPLS over SRv6 carries EVPN VPLS services through an SRv6 PW. PE1 and PE2 devices advertise SIDs via EVPN routes, such as End.DT2M SID, End.DT2US ID, and End.DT2UL SID, to establish an SRv6 tunnel (such as the SRv6 BE tunnel mentioned above). This SRv6 tunnel acts as a PW (such as the EVPN PW mentioned above), encapsulating and forwarding Layer 2 packets between sites CE1 and CE2, enabling sites to traverse the IPv6 network to establish point-to-multipoint connections. On the backbone network, the provider (P) device forwards the packets encapsulated by the SRv6 tunnel according to the optimal path calculated by the Interior Gateway Protocol (IGP), thereby achieving transparent transmission of Layer 2 packets through the backbone network. CE1 and CE2 are connected to PE1 and PE2 devices respectively via ACs.
[0077] SRv6 PW establishment process: PE devices exchange SIDs through Inclusive Multicast Ethernet Tag Route (IMET), Auto-Discovery per Ethernet Virtual Interconnect (AD per EVI), and MAC / IP advertising routes to establish an SRv6 PW. For example... Figure 2 The SRv6 PW setup process shown:
[0078] 1) PE1 and PE2 devices mutually advertise IMET routes, carrying the End.DT2M SID assigned to the VSI by the local device in the IMET route, such as... Figure 2 The PE1 device A1 and the PE2 device B1 are shown.
[0079] 2) After receiving the IMET route, PE1 and PE2 devices establish a single-hop SRv6 tunnel from their local end to the remote end (such as the SRv6 BE tunnel mentioned above). The SID of this SRv6 tunnel is the End.DT2M SID in the IMET route. These two SRv6 tunnels form an SRv6 PW, which is used to carry user Layer 2 packets.
[0080] like Figure 2In this setup, PE1 establishes a single-hop SRv6 tunnel from its local end (PE1 device) to the remote end (PE2 device), with SID B1. PE2 establishes a similar single-hop SRv6 tunnel from its local end (PE2 device) to the remote end (PE1 device), with SID A1. These two SRv6 tunnels form an SRv6 PW1, used to carry Layer 2 packets between user CE1 on the PE1 device side and user CE2 on the PE2 device side. CE1 is connected to PE1 via AC1, and CE1 is connected to PE2 via AC2.
[0081] Figure 2 In this configuration, PE3 assigns End.DT2M SID C1 to VSI. Using the same method, PE1 and PE3 mutually advertise IMET routes and establish SRv6 PW2 to carry Layer 2 packets between user CE1 on PE1 and user CE3 on PE3; PE2 and PE3 also mutually advertise IMET routes and establish SRv6 PW3 to carry Layer 2 packets between user CE2 on PE2 and user CE3 on PE3. CE3 connects to PE3 via AC3.
[0082] In an EVPN VPLS over SRv6 network, PE devices forward Layer 2 packets based on the learned MAC address entries. Figure 2 The SRv6 PW setup process shown below illustrates the process by which the PE device learns MAC address entries. Figure 3 As shown, it is divided into two parts:
[0083] 1) Local MAC address table learning: After the PE device receives a message sent by the local CE device, it determines the VSI to which the message belongs and adds the source MAC address (the MAC address of the local CE device) in the message to the MAC address table of that VSI. The outgoing interface of this MAC address is the AC that received the message.
[0084] 2) Remote MAC Address Table Learning: The PE device advertises the locally learned MAC addresses to the remote PE device via MAC / IP route advertising. After receiving the MAC address, the remote PE device adds the MAC address to the MAC address table of the corresponding VSI. The outgoing interface of this MAC address is the SRv6 PW between the two PE devices.
[0085] CE1 to CE3 belong to the same VSI 0. The MAC address tables learned by PE1 to PE3 devices are as follows: Figure 3 As shown.
[0086] EVPN VPLS over SRv6 supports SRv6 BE packet forwarding. The EVPN VPLS over SRv6 BE tunnel establishment process includes:
[0087] 1) Configure basic SRv6 functions to enable Intermediate System to Intermediate System (IS-IS) SRv6 capability and establish SRv6 BE forwarding paths via the IS-IS protocol. In the event of a network failure, the switching speed of the packet forwarding path depends on the route convergence speed, resulting in high reliability.
[0088] 2) Configure BGP EVPN peering relationships between PE devices to enable EVPN routing interoperability.
[0089] 3) Configure EVPN routes to carry SID attributes, and configure EVPN routes to iterate the SRv6 BE tunnel according to the carried SID, and send EVPN routes carrying SRv6 encapsulation attributes to neighboring devices.
[0090] When a PE device forwards packets using the SRv6 BE method, it performs load balancing packet forwarding based on the Locator route.
[0091] As users place increasingly higher demands on network reliability, ensuring uninterrupted network transmission has become a critical issue. Multi-machine backup provides a device-level network reliability solution through the Virtual Service Redundancy Protocol (VSRP). In scenarios where primary / backup protocols (such as VRRP, Smart-Trunk, or S-Trunk) are deployed, VSRP backs up user service data from the primary device to the backup device. When the primary device or the link to the primary device fails, user services are quickly switched to the backup device; when the primary device or the link to the primary device recovers, user services are switched back from the backup device to the primary device, ensuring uninterrupted user service.
[0092] In practical applications, the most common multi-machine backup network configuration is 1+1 device-level redundancy backup, also known as dual-machine hot standby. This involves deploying two identical devices with the same model and hardware / software configuration at critical network nodes to improve network reliability. One device acts as the primary device, handling service requests, forwarding service packets, and backing up service module data. The other device acts as the backup device. When the primary device is functioning normally, the backup device does not forward service packets but only backs up service module data. When the primary device fails, the backup device takes over, ensuring uninterrupted service.
[0093] In multi-machine backup networking, two problems need to be solved: one is determining which device handles the packets, and the other is how to back up business data. In dual-machine backup networking:
[0094] 1) Use VRRP or S-Trunk to determine which device is the primary device and which is the backup device in a dual-machine backup, and forward packets through the primary device.
[0095] 2) VSRP acts as a bridge module, connecting VRRP, S-Trunk, and service modules, and establishing a unified backup platform for redundant backup of various user services between primary and backup devices.
[0096] 3) The service module implements service data backup so that when traffic is switched to another device, the other device has the corresponding service data to process service packets, ensuring uninterrupted service. Currently, service modules that support multi-machine backup include Address Resolution Protocol (ARP), Point-to-Point Protocol over Ethernet (PPPoE), etc.
[0097] Taking VRRP as an example of a backup protocol, VRRP groups a set of routers (such as two routers) within a local area network to form a VRRP backup group. Functionally, a VRRP backup group is equivalent to a virtual router. The VRRP backup group assigns two roles to physical devices: the master router (i.e., the primary device) and the backup router (i.e., the standby device). VRRP backup groups support two operating modes: standard protocol mode and load balancing mode.
[0098] In the standard protocol mode, the primary router forwards packets, and hosts (or sites) within the local area network communicate with the outside world through the primary router; the backup router is in listening mode and cannot forward packets.
[0099] In load balancing mode, both the primary router and the backup router can forward packets.
[0100] Regardless of whether it's the standard protocol mode or the load balancing mode, in a multi-machine backup network, after linking VSRP and VRRP, the primary and backup roles of the two devices in the VSRP instance are determined by the roles of the devices in the VRRP backup group. The primary router in the VRRP backup group acts as the primary device in the multi-machine backup group, and the backup router in the VRRP backup group acts as the backup device in the multi-machine backup group.
[0101] VRRP master-slave networking refers to a VRRP backup group operating in standard protocol mode, where only the primary router forwards packets, and the backup router does not forward packets. Its implementation principle is as follows:
[0102] (1) The administrator designates the gateway as the VRRP backup group on the host (or site), that is, the administrator designates the IP address of the gateway as the virtual IP address of the VRRP backup group.
[0103] (2) The host (or site) sends an ARP / Neighbor Discovery (ND) request to the gateway to request the gateway's MAC address.
[0104] (3) The primary router uses its own virtual MAC address to respond to the host (or site)'s ARP / ND request, while the backup router does not respond to the host (or site)'s ARP / ND request.
[0105] (4) The host (or site) maintains the mapping between the virtual MAC address of the primary router and the IP address of the gateway in the ARP table and sends the packet to the primary router for processing.
[0106] To avoid single points of failure causing interruption in message forwarding, such as Figure 4 The network topology shown involves multiple VXLAN Tunnel Endpoints (VTEPs) or PE network devices forming a backup group, such as a VRRP backup group. Sites simultaneously access the EVPN through multiple network devices within the backup group, creating redundancy. This type of network topology can be called a multi-homed site network; a site connecting multiple network devices is called a multi-homed site. Packets from a multi-homed site can form a primary / backup backup among the multiple network devices, meaning only one network device forwards packets; or load balancing can be performed among the multiple network devices, meaning all network devices forward packets.
[0107] A locator provides location functionality and is unique within a Segment Routing (SR) domain. After a node configures a locator, it generates a locator route and propagates it within the SR domain using IGP. Other nodes in the network can locate this node through the locator route; that is, any packet sent by another node using any SID advertised by this node can reach this node through this locator route.
[0108] However, in anycast scenarios or other special scenarios, multiple network devices may be configured with the same Locator and publish the same SID.
[0109] Nodes supporting SRv6 (i.e., SRv6 nodes) use IGP to advertise routing information such as topology information, prefix information, Locator information, and SID information. Taking the IS-IS protocol as an example: the Locator must be advertised through the SRv6 Locator TLV. After receiving the TLV, other network devices supporting SRv6 send the corresponding Locator route to their local forwarding table.
[0110] by Figure 5 Taking the multi-machine backup network as an example, the Serving Gateway (SGW) represents the network element in the communication network. The Layer 2 Virtual Ethernet (L2VE) interface is used to terminate the Layer 2 (L2) VPN, and the Layer 3 Virtual Ethernet (L3VE) interface is used to access the L2VPN.
[0111] In a multi-machine backup network of EVPN VPLS over SRv6 BE, two SGWs (SGW1 and SGW2) form a multi-machine backup group. SGW1 and SGW2 advertise the same anycast SID to achieve traffic load balancing. The deployment scheme is described as follows:
[0112] 1) Establish VRRP and VSRP connections between L3VE ports of SGW to synchronize PPPOE user information, such as anycast SID.
[0113] SGW1 and SGW2 create the same VRRP backup group and assign different priorities to each. VRRP preferentially selects the higher-priority SGW as the primary router, and the others as backup routers. The VSRP primary / backup roles are the same as the VRRP backup group selection result, realizing multi-machine backup protection. Taking SGW1 as the primary router and SGW2 as the backup router as an example...
[0114] 2) SGWs synchronize the MAC addresses of the gateways themselves learned by the L2VE interface through EVPN VPLS.
[0115] 3) SGWs achieve load sharing among themselves by publishing the same anycast SID.
[0116] SGW1 and SGW2 are each configured with SRv6 functionality and enable anycast Locator. They publish the same Locator routing information via IGP, meaning that the network segments and cost values of the Locator routing information are the same.
[0117] 4) After receiving the same network segment and cost value Locator routing information published by SGW1 and SGW2, the Customer-Premises Equipment (CPE) uses IGP to calculate the route and generates two equivalent-cost Locator routes as SRv6 BE tunnels. The next hop of the SRv6 BE tunnel on the CPE corresponds to the equivalent-cost Locator routes of SGW1 and SGW2, respectively.
[0118] 5) The CPE utilizes the equal-cost Locator route to send packets to SGW1 and SGW2 via the SRv6 BE tunnel of the Leaf device, employing load balancing. Figure 5 As shown by the dashed line in the diagram. If the packet load from the CPE is distributed to SGW2, SGW2 will redirect the packet to SGW1 by looking up the MAC table, and SGW1 will forward it. For example, SGW1 may forward the packet to its local CE.
[0119] After completing the SRv6 BE tunnel (i.e., PW) establishment, as shown above. Figure 5 As shown, the forwarding process of unicast packets in a multi-machine backup network of EVPN VPLS over SRv6 BE is illustrated below:
[0120] 1) After receiving a Layer 2 packet from the connected AC, the CPE looks up the MAC address table in the VSI associated with the AC, finds the corresponding outgoing interface as SRv6 PW, and obtains the SID of the tunnel, that is, the SID assigned by the SGW1 using the anycast Locator, such as End.DT2U SID A1 or End.DX2 SID B1.
[0121] 2) The CPE encapsulates the packet with an outer IPv6 header, the destination IPv6 address is the SID, and the source IPv6 address is the source address of the configured EVPN VPLS over SRv6 encapsulated IPv6 header.
[0122] 3) The CPE looks up the IPv6 routing table based on the SID of the destination IPv6 address and forwards the packet out through the optimal Locator route. At this time, the Locator route is an equal-cost route, and the next hops are SGW1 and SGW2 respectively.
[0123] 4) After receiving the message, SGW2 looks up the MAC address table again and sends the message to SGW1.
[0124] 5) After receiving the packet, SGW1 looks up the local SID table based on the SID of the destination IPv6 address and performs the forwarding action corresponding to that SID.
[0125] The forwarding action corresponding to End.DT2U SID is as follows: decapsulate the packet, remove the IPv6 packet header, look up the MAC address table in the VSI to which End.DT2USID belongs, and forward the packet to the user-side device according to the table lookup result.
[0126] The forwarding action corresponding to End.DX2 SID is to decapsulate the packet, remove the IPv6 header, and forward the packet to the AC associated with End.DX2 SID.
[0127] In a multi-machine backup network, when two Service Gateways (SGWs) join a VRRP backup group and advertise the same Locator route via IGP, the remote network device (i.e., the headend device) is unaware of the primary / backup status of these two SGWs, and the sent Locator route network segments and cost values are identical. During Locator route calculation, the headend device uses these two SGWs as equivalent next hops, adds them to its routing table, and distributes them to its forwarding table. During packet forwarding, the headend device distributes the packet load across these two SGWs. However, packets sent to the backup SGW require the backup SGW to look up its table again and reroute the packet back to the primary SGW. This results in wasted bandwidth and impacts packet forwarding efficiency.
[0128] To address the above problems, embodiments of this application provide a communication method, such as... Figure 6 As shown, this method is applied to a first network device, which is part of a multi-machine backup group. Each network device in the multi-machine backup group establishes an SRv6 PW tunnel with a second network device, and the multiple SRv6 PW tunnels form an equivalent path. The method includes the following steps:
[0129] Step S61: Obtain the current working status of the first network device;
[0130] Step S62: Based on the current working state, send or not send routing information to the first network device. The routing information includes a cost value, so that the second network device that receives at least one routing information selects the SRv6 PW tunnel with the smallest cost value as the path for forwarding the target packet. The SRv6 PW tunnel with the smallest cost value is the SRv6 PW tunnel between the second network device and the primary device in the multi-machine backup group.
[0131] In the technical solution provided in this application embodiment, the multi-machine backup group includes a first network device and a second network device outside the multi-machine backup group, which are located in an SRv6 BE multi-machine backup network. The first network device obtains its current operating status and, based on this status, sends or does not send routing information destined for it. This routing information includes a cost value, and the SRv6 PW tunnel with the lowest cost value is the SRv6 PW tunnel between the second network device and the primary device in the multi-machine backup group. Thus, the second network device can distinguish between the primary and backup devices in the multi-machine backup group based on the cost value in the routing information. This ensures that packets sent by the second network device to the multi-machine backup group are sent to the primary devices and not to the backup devices. This solves the problem of packet detours in the multi-machine backup network, thereby reducing bandwidth waste and improving packet forwarding efficiency.
[0132] In this embodiment, the multi-machine backup group can be a VRRP backup group or an S-Trunk backup group, and the multi-machine backup group can use VSRP to implement the multi-machine backup function. The multi-machine backup group includes at least two network devices, such as... Figure 5 In this network, SGW1 and SGW2 must have at least the same SID. The first network device is any network device included in the multi-machine backup group, and it can be either the primary or backup device. The second network device is the remote network device, i.e., the headend device. The first and second network devices are located in the EVPN VPLS over SRv6 BE multi-machine backup network. Each network device in the multi-machine backup group establishes an SRv6 PW tunnel with the second network device, such as an SRv6 BE tunnel. There are multiple SRv6 PW tunnels in total. When the routing cost is the same, these multiple SRv6 PW tunnels form an equivalent path.
[0133] In step S61 above, the operating state of the network device can be recorded using a state machine within the network device. The operating state of the network device can include master state, backup state, initialize state, and inactive state, etc.
[0134] In this embodiment of the application, after the first network device is powered on, it can obtain its own working status in real time and obtain the current working status.
[0135] In step S62, the routing information to the network device may include Locator routing information, SID information, etc., specifically including the Locator routing network segment and routing cost value. The SID corresponding to the multi-machine backup group indicates that each network device included in the multi-machine backup group has that SID, such as anycast SID.
[0136] After obtaining the current operating status of the first network device, the first network device can send or not send routing information destined for itself to the second network device based on the current operating status, so that the routing information received by the second network device matches the current operating status. Among them, the SRv6 PW tunnel with the lowest cost value is the SRv6 PW tunnel between the second network device and the primary device in the multi-machine backup group.
[0137] The second network device can perceive the primary / standby status of network devices through routing information (such as cost values in the routing information), and then use IGP to calculate routes with different priorities and distribute them to the forwarding table. The priority of the route corresponding to the primary device is higher than the priority of the route corresponding to the standby device.
[0138] The second network device utilizes routing with different priorities, preferentially selecting the route (i.e., path) corresponding to the primary device within the multi-machine backup group. This ensures that packets destined for the multi-machine backup group are sent to the primary device, rather than the backup devices. This solves the problem of packet detours in multi-machine backup networking, thereby reducing bandwidth waste and improving packet forwarding efficiency.
[0139] In this embodiment of the application, the first network device may implement step S62 in any of the following ways.
[0140] Method 1: Adjust the routing information directly using the obtained current working status.
[0141] In this embodiment of the application, the state machine of the first network device may include four working states, namely a first preset state (such as the Master state), a second preset state (such as the Backup state), a third preset state (such as the Initialize state), and a fourth preset state; wherein, the first preset state indicates that the first network device is the primary device, the second preset state indicates that the first network device is the backup device, the third preset state indicates that the first network device is in the initialization phase, and the fourth preset state (such as the Inactive state) indicates that the first network device is abnormal or that the VRRP backup group does not exist.
[0142] In the first method, the first network device can adjust routing information in the following two ways:
[0143] Method a: Increase the cost value. For example, before sending or not sending routing information to the first network device, if the current operating state is a first preset state or a fourth preset state, the first network device sets the cost value in the routing information to the first network device to the original cost value; if the current operating state is a second preset state or a third preset state, the cost value in the routing information to the first network device is set to the target cost value, which is greater than the original cost value. The first network sends the set routing information to the second network device, specifically: if the current operating state is a first preset state or a fourth preset state, the routing information is sent to the second network device, and the cost value included in the routing information is the original cost value; if the current operating state is a second preset state or a third preset state, the routing information is sent to the second network device, and the cost value included in the routing information is the target cost value.
[0144] The first network device can be implemented in the following two ways, setting the cost value in the routing information leading to the first network device to the target cost value:
[0145] Implementation method a1: The original cost value is increased by a configured cost value (i.e., a preset offset value): The first network device increases the original cost value by the preset offset value; if the increased cost value is less than the maximum cost value, the increased cost value is used as the target cost value; if the increased cost value is greater than or equal to the maximum cost value, the maximum cost value is used as the target cost value; the cost value in the routing information leading to the first network device is set as the target cost value.
[0146] Implementation method a2, the cost value is adjusted to the configured absolute value (i.e., the preset cost value): The first network device uses the preset cost value as the target cost value; the cost value in the routing information leading to the first network device is set as the target cost value. The preset cost value is greater than the original cost value.
[0147] Method b: Lower the cost value. For example, before sending or not sending routing information to the first network device, if the current operating state is a first preset state or a fourth preset state, the first network device sets the cost value in the routing information to the first network device to the target cost value; if the current operating state is a second preset state or a third preset state, the cost value in the routing information to the first network device is set to the original cost value, and the target cost value is less than the original cost value. The first network sends the set routing information to the second network device, specifically: if the current operating state is a first preset state or a fourth preset state, the routing information is sent to the second network device, and the cost value included in the routing information is the target cost value; if the current operating state is a second preset state or a third preset state, the routing information is sent to the second network device, and the cost value included in the routing information is the original cost value.
[0148] The first network device can be implemented in the following two ways, setting the cost value in the routing information leading to the first network device to the target cost value:
[0149] In implementation method b1, the original cost value is reduced by a configured cost value (i.e., a preset offset value): the first network device reduces the original cost value by the preset offset value; if the reduced cost value is greater than the minimum cost value, the reduced cost value is used as the target cost value; if the reduced cost value is less than or equal to the minimum cost value, the minimum cost value is used as the target cost value; the cost value in the routing information leading to the first network device is set as the target cost value.
[0150] Implementation method b2, the cost value is adjusted to the configured absolute value (i.e., the preset cost value): The first network device uses the preset cost value as the target cost value; the cost value in the routing information leading to the first network device is set as the target cost value. The preset cost value is greater than the original cost value.
[0151] In both methods a and b, the first network device directly adjusts the routing information using the obtained current operating status, thereby improving the efficiency of routing information adjustment.
[0152] In this embodiment, the first network device can quickly adjust the cost value in its Locator routing information to match its operating status using IGP. After receiving the routing information published by the first network device, the second network device calculates the route for the SRv6 PW tunnel using IGP, determining the corresponding priority route based on the cost value and issuing it to the forwarding table. Here, since the cost value in the primary device's routing information is lower than that in the backup device's routing information, the primary device's route priority is higher than the backup device's route priority, thus forming a primary-backup route (i.e., a primary-backup path) in the second network device. Therefore, when the second network device sends a packet (such as a target packet) to the multi-machine backup group, it prioritizes the primary device's route (i.e., the primary route) based on the target IPv6 address of the packet (i.e., the SID corresponding to the multi-machine backup group) when querying the routing table, avoiding detours.
[0153] Method c: Suppress route publishing. For example, if the current operating state is the first preset state or the fourth preset state, the first network device can normally send routing information to the second network device to reach the first network device; if the current operating state is the second preset state or the third preset state, the first network device can suppress the sending of routing information to the second network device to reach the first network device.
[0154] In this embodiment, the second network device receives routing information from the primary device but not from the backup device. That is, the second network device only has the primary route when calculating the route of the SRv6 PW tunnel (such as the SRv6 BE tunnel) using IGP. Therefore, when the second network device sends a packet (such as a target packet) to the multi-machine backup group, it can only find the route of the primary device (i.e., the primary route) when querying the routing table based on the target IPv6 address of the packet (i.e., the SID corresponding to the multi-machine backup group). The primary route is then used to send the packet to the primary device, avoiding detours.
[0155] Method 2 involves using tracking items to associate working status and routing information, i.e., adjusting routing information using tracking items. A tracking item is a table entry used to carry preset values associated with the working status.
[0156] In this embodiment, the first network device can configure a track item associated with its operating status and routing information. The first network device sets the value of the track item according to its current operating status. Specifically, if the current operating status is a first preset status, the first network device can set the track item to a first preset value, indicating that the first network device is the primary device; if the current operating status is a second or third preset status, the track item is set to a second preset value, indicating that the first network device is a backup device, and the third preset status indicates that the first network device is in the initialization phase; if the current operating status is a fourth preset status, the track item is set to a third preset value, indicating that the first network device is abnormal, or that the multi-machine backup group does not exist.
[0157] After setting the value of the tracking item, the first network device may or may not send routing information destined for it, based on the value of the tracking item. The first, second, and third preset values can be set according to actual needs. For example, the first preset value can be Positive, the second preset value can be Negative, and the third preset value can be NotReady.
[0158] In scenarios where a multi-machine backup group is used as the user gateway, the path of uplink packets depends on the primary / backup status of the devices, while the path of downlink packets is generally determined by a dynamic routing protocol (such as IGP) through routing selection. Therefore, inconsistencies in the forwarding paths of uplink and downlink packets may occur. These inconsistencies increase unnecessary complexity and cost. In this embodiment, by configuring a tracking item associated with the multi-machine backup group and associating the routes from each network device in the multi-machine backup group to the downlink device with this tracking item, the cost values of the routes set by each network device in the multi-machine backup group according to its primary / backup status are determined. This allows the primary / backup status to influence the routing results of the dynamic routing protocol, thereby solving the aforementioned problem.
[0159] In method two, the first network device can process routing information through either method a or method b, as detailed below:
[0160] Method a: Increase the cost value. For example, before sending or not sending routing information to the first network device, if the value of the tracking item is a first preset value or a third preset value, or if the tracking item does not exist, the first network device sets the cost value in the routing information to the first network device to the original cost value; if the value of the tracking item is a second preset value, the cost value in the routing information to the first network device is set to the target cost value, which is greater than the original cost value. The first network sends the set routing information to the second network device, specifically as follows: if the tracking item is a first preset value, routing information is sent to the second network device, and the cost value included in the routing information is the original cost value; if the tracking item is a second preset value, routing information is sent to the second network device, and the cost value included in the routing information is the target cost value; if the tracking item is a third preset value, routing information is sent to the second network device, and the cost value included in the routing information is the original cost value.
[0161] The first network device can be implemented in the following two ways, setting the cost value in the routing information leading to the first network device to the target cost value:
[0162] Implementation method a1: The original cost value is increased by a configured cost value (i.e., a preset offset value): The first network device increases the original cost value by the preset offset value; if the increased cost value is less than the maximum cost value, the increased cost value is used as the target cost value; if the increased cost value is greater than or equal to the maximum cost value, the maximum cost value is used as the target cost value; the cost value in the routing information leading to the first network device is set as the target cost value.
[0163] Implementation method a2, the cost value is adjusted to the configured absolute value (i.e., the preset cost value): the first network device uses the preset cost value as the target cost value; the cost value in the routing information leading to the first network device is set as the target cost value.
[0164] Method b: lower the cost value. For example, before sending or not sending the routing information to the first network device, if the value of the tracking item is the first preset value or the third preset value, or the tracking item does not exist, the first network device sets the cost value in the routing information to the first network device as the target cost value; if the value of the tracking item is the second preset value, the cost value in the routing information to the first network device is set as the original cost value, and the target cost value is less than the original cost value. The first network sends the set routing information to the second network device. Specifically, if the tracking item is the first preset value, the routing information is sent to the second network device, and the cost value included in the routing information is the target cost value; if the tracking item is the second preset value, the routing information is sent to the second network device, and the cost value included in the routing information is the original cost value; if the tracking item is the third preset value, the routing information is sent to the second network device, and the cost value included in the routing information is the target cost value.
[0165] Among them, the first network device can adopt the following two implementation methods to set the cost value in the routing information to the first network device as the target cost value:
[0166] Implementation method b1: The original cost value is relatively reduced by a configured cost value (i.e., the preset offset value): The first network device reduces the original cost value by the preset offset value; if the reduced cost value is greater than the minimum cost value, the reduced cost value is used as the target cost value; if the reduced cost value is less than or equal to the minimum cost value, the minimum cost value is used as the target cost value; the cost value in the routing information to the first network device is set as the target cost value.
[0167] Implementation method b2: The cost value is adjusted to the configured absolute value (i.e., the preset cost value): The first network device uses the preset cost value as the target cost value; the cost value in the routing information to the first network device is set as the target cost value.
[0168] In the embodiment of this application, the first network device associates the working state with the routing information by using the tracking item, realizing the联动 cooperation between these information. By using the tracking item, the differences between different state machines are shielded, and the monitoring results of the working state are notified to the application module in a unified form, thereby simplifying the processing of the routing information by the application module.
[0169] In this embodiment, the first network device can quickly adjust the cost value in its Locator routing information to match its working state using IGP. After receiving the routing information published by the first network device, the second network device calculates the route for the SRv6 PW tunnel using IGP, determines the corresponding priority route based on the cost value, and distributes it to the forwarding table. Here, since the cost value in the primary device's routing information is lower than that in the backup device's routing information, the primary device's route priority is higher than the backup device's route priority. Therefore, when the second network device sends a packet (such as a target packet) to the multi-machine backup group, it prioritizes the primary device's route with higher priority and sends the packet to the primary device when querying the routing table based on the target IPv6 address of the packet (i.e., the SID corresponding to the multi-machine backup group), thus avoiding detours.
[0170] In this embodiment of the application, if the multi-machine backup group uses VSRP to implement the multi-machine backup function, it can quickly switch to the standby device to continue forwarding packets after the primary device fails, and switch back to the primary device to forward packets after the primary device recovers, thus meeting the high reliability requirements of the network.
[0171] Method c, suppress route publication. For example, if the value of the tracking item is a first preset value or a third preset value, the first network device can send routing information to the second network device that leads to the first network device; if the value of the tracking item is a second preset value, the first network device can suppress the sending of routing information to the second network device that leads to the first network device.
[0172] In this embodiment, the second network device receives routing information from the primary device but not from the backup device. That is, the second network device only has the primary route when calculating the SRv6 PW tunnel using IGP. Therefore, when the second network device sends a packet (such as a target packet) to the multi-machine backup group, it can only find the route of the primary device (i.e., the primary route) when querying the routing table based on the target IPv6 address of the packet (i.e., the SID corresponding to the multi-machine backup group). The primary route is then used to send the packet to the primary device, avoiding detours.
[0173] The following is combined Figure 5 The network topology shown illustrates the communication method provided in this application embodiment. SGW1 and SGW2 are added to a multi-machine backup group.
[0174] 1) Establish VRRP and VSRP connections between L3VE ports of SGWs to synchronize PPPoE user information, such as anycast SID, etc. Figure 7As shown. This anycast SID is the SID corresponding to the multi-machine backup group. SGW1 and SGW2 create the same VRRP backup group and assign different priorities to them. VRRP preferentially selects the SGW with the higher priority as the primary router, and the others as backup routers. The primary and backup roles of VSRP are the same as the VRRP backup group selection result, realizing the multi-machine backup protection function. Taking SGW1 as the primary router and SGW2 as the backup router as an example.
[0175] 2) SGWs synchronize the MAC addresses of the gateways themselves, learned by the L2VE interface, via EVPN VPLS, such as... Figure 7 As shown.
[0176] 3) By associating the primary and backup status of devices in the VRRP backup group, the SGW publishes Locator routing information with the same anycast SID but different cost values, thus realizing the primary and backup protection relationship between SGWs. Figure 7 As shown.
[0177] SGW1 and SGW2 are configured with SRv6 functionality and enable anycast Locator routing information to associate the primary and backup status of devices in the VRRP backup group. They also publish routing information with the same Locator network segment but different cost values via the IGP protocol.
[0178] 4) After receiving Locator routing information with the same network segment but different cost values published by SGW1 and SGW2, the CPE generates primary and backup routes (two Locator routes) based on the cost values of the Locator routing information when calculating routes using IGP, and then distributes them to the forwarding table. On the CPE, the SRv6 BE tunnel corresponds to two Locator routes, that is, the next hop is the primary route of SGW1, and the next hop is the backup route of SGW2, forming a backup protection relationship between the SGWs.
[0179] 5) When the CPE uses the primary / backup route to send packets to the VRRP backup group via the SRv6 BE tunnel of the Leaf device, the CPE looks up the routing table to obtain the primary route and then sends the packet to SGW1, such as... Figure 7 The solid line representing the single arrow indicates that SGW1 is the master device of the VRRP backup group; therefore, SGW1 forwards the packet normally, and the packet does not need to be routed.
[0180] 6) After SGW1 fails, the Locator routes converge to SGW2, such as... Figure 7 The dashed single arrow indicates that after SGW1 recovers, the Locator route is recalculated and switched back to the primary SGW1.
[0181] In this embodiment, SGW1 can use VSRP to back up service data to SGW2. After SGW1 fails, the CPE deletes the primary route. When sending packets, the CPE looks up the routing table to obtain the backup route and then sends the packets to SGW2. After SGW1 recovers, it can republish the Locator routing information, and the CPE recalculates and generates the primary route. When sending packets, the CPE looks up the routing table to obtain the primary route and then sends the packets to SGW1.
[0182] In this embodiment of the application, after the SRv6 BE tunnel (i.e., PW) is established, the forwarding process of unicast packets in the EVPN VPLS over SRv6 BE network is described as an example:
[0183] 1) After receiving a Layer 2 packet from the connected AC, the CPE looks up the MAC address table in the VSI associated with the AC, finds the corresponding outgoing interface as SRv6 PW, and obtains the SID of the tunnel, that is, the SID assigned by the SGW1 using the anycast Locator, such as End.DT2U SID A1 or End.DX2 SID B1.
[0184] 2) The CPE encapsulates the packet with an outer IPv6 header, the destination IPv6 address is the SID, and the source IPv6 address is the source address of the configured EVPN VPLS over SRv6 encapsulated IPv6 header.
[0185] 3) The CPE looks up the IPv6 routing table based on the SID of the destination IPv6 address and forwards the packet through the optimal Locator route. At this time, the Locator route is the primary and backup route. The next hop of the primary route is SGW1, and the next hop of the backup route is SGW2. The packet is sent to SGW1.
[0186] 4) After receiving the packet, SGW1 looks up the local SID table based on the SID of the destination IPv6 address and performs the forwarding action corresponding to that SID.
[0187] The forwarding action corresponding to End.DT2U SID is as follows: decapsulate the packet, remove the IPv6 packet header, look up the MAC address table in the VSI to which End.DT2USID belongs, and forward the packet to the user-side device according to the table lookup result.
[0188] The forwarding action corresponding to End.DX2 SID is to decapsulate the packet, remove the IPv6 header, and forward the packet to the AC associated with End.DX2 SID.
[0189] When SGW1 fails, the packets will switch to SGW2; when SGW1 recovers, the packets will switch back to SGW1, thus achieving primary and backup path protection.
[0190] Corresponding to the above communication method, embodiments of this application also provide a communication device, such as... Figure 8 As shown, the device is applied to a first network device, which is located in a multi-machine backup group. Each network device in the multi-machine backup group establishes an SRv6 PW tunnel with a second network device, and multiple SRv6 PW tunnels form an equivalent path. The device includes:
[0191] The acquisition module 81 is used to acquire the current working status of the first network device;
[0192] The processing module 82 is used to send or not send routing information to the first network device according to the current working state. The routing information includes a cost value, so that the second network device that receives at least one routing information selects the SRv6 PW tunnel with the smallest cost value as the path for forwarding the target packet. The SRv6 PW tunnel with the smallest cost value is the SRv6 PW tunnel between the second network device and the primary device in the multi-machine backup group.
[0193] In some embodiments, such as Figure 9 As shown, the processing module 82 may include:
[0194] The tracking submodule 821 is used to set the value of the tracking item according to the current working state;
[0195] The application submodule is used to send or not send routing information to the first network device based on the value of the tracking item.
[0196] In some embodiments, the tracking submodule 821 may be specifically used for:
[0197] If the current working state is the first preset state, then the tracking item in the first network device is set to the first preset value, and the first preset state indicates that the first network device is the master device;
[0198] If the current working state is the second preset state or the third preset state, the tracking item will be set to the second preset value. The second preset state indicates that the first network device is a standby device, and the third preset state indicates that the first network device is in the initialization phase.
[0199] If the current working status is the fourth preset status, then the tracking item will be set to the third preset value. The fourth preset status indicates that the first network device is abnormal or that the multi-machine backup group does not exist.
[0200] In some embodiments, the application submodule 822 can also be used to: before sending or not sending routing information to the first network device, if the value of the tracking item is a first preset value or a third preset value, set the cost value in the routing information to the first network device to the original cost value; if the value of the tracking item is a second preset value, set the cost value in the routing information to the first network device to the target cost value, the target cost value being greater than the original cost value.
[0201] Application submodule 822 can be used to: send routing information to the second network device if the tracking item is a first preset value, the routing information including the original cost value; send routing information to the second network device if the tracking item is a second preset value, the routing information including the target cost value; and send routing information to the second network device if the tracking item is a third preset value, the routing information including the original cost value.
[0202] In some embodiments, application submodule 822 may be specifically used for:
[0203] The original cost value is increased by a preset offset value; if the increased cost value is less than the maximum cost value, the increased cost value is used as the target cost value; if the increased cost value is greater than or equal to the maximum cost value, the maximum cost value is used as the target cost value; the cost value in the routing information to the first network device is set as the target cost value; or,
[0204] Set the preset cost value as the target cost value; set the cost value in the routing information to the first network device as the target cost value.
[0205] In some embodiments, application submodule 822 may be specifically used for:
[0206] If the value of the tracked item is a first preset value or a third preset value, then the routing information to the first network device is sent to the second network device.
[0207] If the value of the tracking item is the second preset value, then the sending of routing information to the first network device to the second network device is suppressed.
[0208] In this embodiment, when the multi-machine backup group is a VRRP backup group, the acquisition module 81 can be a VRRP module, and the application submodule 822 can be an IGP module. The tracking submodule 821 is used to associate the acquisition module 81 and the application submodule 822 to realize joint actions between these modules. The linkage function adds a tracking submodule 821 between the application submodule 822 and the acquisition module 81. By shielding the differences between different acquisition modules 81 through the tracking submodule 821, the monitoring results of the working status are notified to the application submodule 822 in a unified form, thereby simplifying the processing of the application submodule 822.
[0209] The linkage between the acquisition module 81 and the tracking submodule 821 can be described in the following description:
[0210] The tracking submodule 821 associates with the monitoring items in the acquisition module 81. Each monitoring item is a table entry used to record the operating status of the device. The acquisition module 81 notifies the tracking submodule 821 of the value of the monitoring item, i.e., the monitoring result.
[0211] When the acquisition module 81 detects that the device is in Master state (first preset state), the tracking submodule 821 sets the corresponding tracking item to Positive state (first preset value).
[0212] When the acquisition module 81 detects that the device is in Backup state (second preset state) or Initialize state (third preset state), the tracking submodule 821 sets the corresponding tracking item to Negative state (second preset value).
[0213] When the acquisition module 81 detects that the device is in an Inactive state or that the VRRP backup group does not exist at all, the tracking submodule 821 sets the corresponding tracking item to the NotReady state (third preset value).
[0214] The linkage between the tracking submodule 821 and the application submodule 822 can be seen in the following description:
[0215] Application submodule 822 associates the tracking items in tracking submodule 821, and tracking submodule 821 notifies application submodule 822 of the values of the tracking items.
[0216] When the tracking item does not exist, there is no need to adjust the cost value of the routing information;
[0217] When the tracking item is in a Positive state, there is no need to adjust the cost value of the routing information;
[0218] When the tracking item is in the NotReady state, there is no need to adjust the cost value of the routing information;
[0219] When a tracking item is in a Negative state, it indicates that the device is in a backup state. The overhead value of the routing information is adjusted according to the user configuration, or the related TLVs for generating routing information are suppressed, thereby suppressing the sending of routing information.
[0220] In the technical solution provided in this application embodiment, the multi-machine backup group includes a first network device and a second network device outside the multi-machine backup group, which are located in an SRv6 BE multi-machine backup network. The first network device obtains its current operating status and, based on this status, sends or does not send routing information destined for it. This routing information includes a cost value, and the SRv6 PW tunnel with the lowest cost value is the SRv6 PW tunnel between the second network device and the primary device in the multi-machine backup group. Thus, the second network device can distinguish between the primary and backup devices in the multi-machine backup group based on the cost value in the routing information. This ensures that packets sent by the second network device to the multi-machine backup group are sent to the primary devices and not to the backup devices. This solves the problem of packet detours in the multi-machine backup network, thereby reducing bandwidth waste and improving packet forwarding efficiency.
[0221] This application also provides a network device, such as... Figure 10 As shown, it includes a processor 101 and a machine-readable storage medium 102, the machine-readable storage medium 102 storing machine-executable instructions that can be executed by the processor 101, the processor 101 being prompted by the machine-executable instructions to implement any of the communication methods described above.
[0222] Machine-readable storage media may include random access memory (RAM) or non-volatile memory (NVM), such as at least one disk storage device. Optionally, the machine-readable storage medium may also be at least one storage device located remotely from the aforementioned processor.
[0223] The processor 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.
[0224] In another embodiment provided in this application, a computer-readable storage medium is also provided, which stores a computer program that, when executed by a processor, implements any of the communication methods described above.
[0225] In another embodiment provided in this application, a computer program product containing instructions is also provided, which, when run on a computer, causes the computer to perform any of the communication methods described in the above embodiments.
[0226] In the above embodiments, implementation can be achieved entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially as a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates 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 disk (SSD)).
[0227] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0228] The various embodiments in this specification are described in a related manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the embodiments for apparatus, network devices, storage media, and program products are basically similar to the method embodiments, so the descriptions are relatively simple; relevant parts can be referred to the descriptions of the method embodiments.
[0229] The above description is merely a preferred embodiment of this application and is not intended to limit the scope of protection of this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application are included within the scope of protection of this application.
Claims
1. A communication method, characterized in that, The method is applied to a first network device, which is located in a multi-machine backup group. Each first network device in the multi-machine backup group establishes an SRv6 PW tunnel with a second network device, and multiple SRv6 PW tunnels form an equivalent path. The method includes: Obtain the current operating status of the first network device; Based on the current operating state, the routing information to the first network device is sent or not sent. The routing information includes a cost value, so that the second network device, which receives at least one routing information, selects the SRv6 PW tunnel with the lowest cost value as the path for forwarding the target packet. The SRv6 PW tunnel with the lowest cost value is the SRv6 PW tunnel between the second network device and the primary device in the multi-machine backup group.
2. The method according to claim 1, characterized in that, The first network device stores tracking entries; The step of sending or not sending routing information to the first network device based on the current working state specifically includes: Set the value of the tracking item according to the current working status; Based on the value of the tracking item, send or do not send routing information to the first network device.
3. The method according to claim 2, characterized in that, Setting the value of the tracking item based on the current working state includes: If the current working state is a first preset state, then the tracking item in the first network device is set to a first preset value, and the first preset state indicates that the first network device is the primary device; If the current working state is a second preset state or a third preset state, then the tracking item is set to a second preset value. The second preset state indicates that the first network device is a standby device, and the third preset state indicates that the first network device is in the initialization phase. If the current working state is the fourth preset state, then the tracking item is set to the third preset value. The fourth preset state indicates that the first network device is abnormal or that the multi-machine backup group does not exist.
4. The method according to claim 3, characterized in that, Before sending or not sending routing information to the first network device, the method further includes: If the value of the tracking item is the first preset value or the third preset value, or if the tracking item does not exist, then the cost value in the routing information to the first network device is set to the original cost value. If the value of the tracking item is the second preset value, then the cost value in the routing information leading to the first network device is set to the target cost value, which is greater than the original cost value; The step of sending or not sending routing information to the first network device based on the value of the tracking item includes: If the tracking item is the first preset value, then the routing information is sent to the second network device, and the cost value included in the routing information is the original cost value; If the tracking item is the second preset value, then the routing information is sent to the second network device, and the cost value included in the routing information is the target cost value; If the tracking item is the third preset value, then the routing information is sent to the second network device, and the cost value included in the routing information is the original cost value.
5. The method according to claim 4, characterized in that, Setting the cost value in the routing information leading to the first network device to the target cost value specifically includes: The original cost value is increased by a preset offset value; if the increased cost value is less than the maximum cost value, the increased cost value is used as the target cost value; if the increased cost value is greater than or equal to the maximum cost value, the maximum cost value is used as the target cost value; the cost value in the routing information leading to the first network device is set as the target cost value; or, Use a preset cost value as the target cost value; set the cost value in the routing information leading to the first network device as the target cost value.
6. The method according to claim 2, characterized in that, The step of sending or not sending routing information to the first network device based on the value of the tracking item specifically includes: If the value of the tracking item is the first preset value or the third preset value, then the routing information to the first network device is sent to the second network device; If the value of the tracking item is the second preset value, then the transmission of routing information to the first network device is suppressed.
7. A communication device, characterized in that, An apparatus is applied to a first network device, which is located in a multi-machine backup group. Each first network device in the multi-machine backup group establishes an SRv6 PW tunnel with a second network device, and multiple SRv6 PW tunnels form an equivalent path. The apparatus includes: The acquisition module is used to acquire the current working status of the first network device; The processing module is configured to send or not send routing information to the first network device according to the current working state. The routing information includes a cost value, so that the second network device that receives at least one routing information selects the SRv6 PW tunnel with the smallest cost value as the path for forwarding the target packet. The SRv6 PW tunnel with the smallest cost value is the SRv6 PW tunnel between the second network device and the primary device in the multi-machine backup group.
8. The apparatus according to claim 7, characterized in that, The first network device stores tracking entries; The processing module includes: The tracking submodule is used to set the value of the tracking item according to the current working state; The application submodule is used to send or not send routing information to the first network device based on the value of the tracking item.
9. The apparatus according to claim 8, characterized in that, The tracking submodule is specifically used for: If the current working state is a first preset state, then the tracking item is set to a first preset value, and the first preset state indicates that the first network device is the primary device; If the current working state is a second preset state or a third preset state, then the tracking item is set to a second preset value. The second preset state indicates that the first network device is a standby device, and the third preset state indicates that the first network device is in the initialization phase. If the current working state is the fourth preset state, then the tracking item is set to the third preset value. The fourth preset state indicates that the first network device is abnormal or that the multi-machine backup group does not exist.
10. The apparatus according to claim 9, characterized in that, The application submodule is further configured to: before sending or not sending routing information to the first network device, if the value of the tracking item is the first preset value or the third preset value, set the cost value in the routing information to the first network device to the original cost value. If the value of the tracking item is the second preset value, then the cost value in the routing information leading to the first network device is set to the target cost value, which is greater than the original cost value; The application submodule is specifically configured to: if the tracking item is the first preset value, send the routing information to the second network device, wherein the cost value included in the routing information is the original cost value; if the tracking item is the second preset value, send the routing information to the second network device, wherein the cost value included in the routing information is the target cost value; if the tracking item is the third preset value, send the routing information to the second network device, wherein the cost value included in the routing information is the original cost value.
11. The apparatus according to claim 10, characterized in that, The application submodule is specifically used for: The original cost value is increased by a preset offset value; if the increased cost value is less than the maximum cost value, the increased cost value is used as the target cost value; if the increased cost value is greater than or equal to the maximum cost value, the maximum cost value is used as the target cost value; the cost value in the routing information leading to the first network device is set as the target cost value. or, Use a preset cost value as the target cost value; set the cost value in the routing information leading to the first network device as the target cost value.
12. The apparatus according to claim 8, characterized in that, The application submodule is specifically used for: If the value of the tracking item is the first preset value or the third preset value, then routing information to the first network device is sent to the second network device; if the value of the tracking item is the second preset value, then sending routing information to the first network device to the second network device is suppressed.
Citation Information
Patent Citations
Method and device for determining backup path and nonvolatile storage medium
CN117857437A
Message forwarding method, routing information publishing method, apparatus and system
WO2021169258A1