Method for generating forwarding table entry, method for sending packet, network device and system
Patent Information
- Application Number
- CN202010711897.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2020-04-15
- Filing Date
- 2020-07-22
- Publication Date
- 2026-09-25
- Estimated Expiration
- 2040-07-22
Smart Images

Figure CN113300954B_ABST
Abstract
Description
[0001] This application claims priority to Chinese Patent Application No. 202010106211.9, filed with the State Intellectual Property Office of China on February 21, 2020, entitled "A Method, Network Node, and System for Generating Table Entries," and to Chinese Patent Application No. 202010295809.7, filed with the State Intellectual Property Office of China on April 15, 2020, entitled "A Method, Network Node, and System for Forwarding Messages," the entire contents of which are incorporated herein by reference. Technical Field
[0002] This application relates to the field of communications, and in particular to a method for generating forwarding entries, a method for sending messages, and network devices and systems. Background Technology
[0003] To improve network transmission reliability, network devices in some network scenarios forward packets using a primary forwarding path and a backup forwarding path. If the primary forwarding path is functioning correctly, it is used; if the primary forwarding path fails, the backup forwarding path is used. However, in some scenarios, forwarding packets through the backup forwarding path can lead to wasted network resources or network congestion. For example, in some network scenarios, using the backup forwarding path may cause packet forwarding loops, resulting in network congestion or wasted bandwidth resources.
[0004] For example, see Figure 1 The primary forwarding path between network device 101 and network device 102 is a direct link between them. The backup forwarding path between them passes through network device 103, i.e., the backup forwarding path is network device 101 -> network device 103 -> network device 102. When the primary forwarding path from network device 101 to network device 102 fails, a loop problem may occur when network device 101 forwards packets to network device 102 via network device 103 on the backup forwarding path. A loop problem occurs when network device 103, after receiving a packet from network device 101, returns the packet to network device 101 for some reason instead of sending it to network device 102. Network devices in special positions within the network are more prone to loop problems when using backup forwarding paths, such as network devices connecting access networks and backbone networks.
[0005] Therefore, how to avoid network resource waste or network congestion caused by loop problems is a technical problem that needs to be solved. Summary of the Invention
[0006] This application provides a method for generating forwarding table entries, a method for sending packets, a network device, and a system. The method generates forwarding table entries corresponding to the aggregation route. The forwarding table entries contain the segment identifier of the specified network device. When forwarding packets, the packets are forwarded to the specified network device according to the segment identifier of the specified network device in the forwarding table entries, thereby avoiding the problem of loops in the process of forwarding packets to the specified network device to a certain extent.
[0007] Firstly, a method for generating forwarding table entries is provided. This method can be applied to a first network device and specifically includes the following steps: The first network device obtains routing information published by a second network device. When it is confirmed that the routing information published by the second network device matches the aggregation route stored in the first network device, the first network device generates a forwarding table entry corresponding to the aggregation route based on the segment identifier of the second network device. The forwarding table entry includes the segment identifier of the second network device, and the forwarding path corresponding to the forwarding table entry passes through the second network device. When the first network device receives a first packet, it matches the aggregation route based on the destination address of the first packet, and carries the segment identifier of the second network device from the forwarding table entry in the first packet to obtain a second packet. The first network device then forwards the second packet to the second network device, enabling the second packet to be forwarded to the second network device, which then forwards the second packet to the destination device. Because the second packet carries the segment identifier of the second network device, the second packet can reach the second network device, and the second network device can forward the second packet to the destination device, avoiding loop problems before the second packet is sent to the second network device, thereby saving network resources or reducing the possibility of network congestion.
[0008] In one possible design, before the first network device generates a forwarding table entry corresponding to the aggregation route based on the segment identifier of the second network device, the method further includes: the first network device receiving a first advertisement message, the first advertisement message including the segment identifier of the second network device. The first advertisement message may be, for example, an Open Shortest Path First (OSPF) message or an Intermediate System to Intermediate System (ISIS) message. After receiving the first advertisement message, the first network device can obtain the segment identifier of the second network device from the first advertisement message to add the segment identifier of the second network device to the aforementioned forwarding table entry, thereby achieving the purpose of saving network resources or reducing the possibility of network congestion.
[0009] In one possible design, the first announcement message further includes first indication information. Accordingly, the first network device can match the routing information published by the second network device with the aggregation routes stored in the first network device based on the first indication information. Upon confirming a match between the routing information published by the second network device and the aggregation routes stored in the first network device, the first network device generates a forwarding table entry corresponding to the aggregation route based on the segment identifier of the second network device. Including the first indication information in the first announcement message can save system resources for the first network device to some extent.
[0010] In one possible design, in addition to the segment identifier of the second network device, the first announcement message also includes routing information published by the second network device. Therefore, the first network device can obtain the routing information published by the second network device from the first announcement message and perform the aforementioned action of matching the routing information sent by the second network device with the aggregation routes stored in the first network device.
[0011] In one possible design, when the first advertisement message includes the segment identifier of the second network device but not the routing information published by the second network device, the first advertisement message also includes the device identifier of the second network device. The device identifier of the second network device is, for example, a router identifier (router ID) or a system identifier (system ID). The first network device obtains the routing information published by the second network device based on the device identifier of the second network device and a corresponding relationship, wherein the corresponding relationship is the mapping between the device identifier of the second network device and the routing information published by the second network device. After obtaining the routing information published by the second network device, the first network device can perform the aforementioned action of matching the routing information sent by the second network device with the aggregated routes stored in the first network device.
[0012] In one possible design, the correspondence between the device identifier of the second network device and the routing information published by the second network device can be obtained through the following steps: The first network device receives a second announcement message, which includes the device identifier of the second network device and the routing information published by the second network device. The first network device generates the correspondence based on the device identifier of the second network device and the routing information published by the second network device.
[0013] In one possible design, the first notification message includes a type length value (TLV) for the segment routing (SR) endpoint segment identifier (End SID) of Internet Protocol version 6 (IPv6), and the first indication information is carried in the Flags field, EndpointBehavior field, or reserved field of the SRv6 END SID TLV.
[0014] In one possible design, the first notification message includes a NoBypass SID TLV, the Type field of which carries the first indication information; or, the Type field of the NoBypass SID TLV carries second indication information and the Endpoint Behavior field of the NoBypass SID TLV carries the first indication information, the second indication information being used to indicate that the Endpoint Behavior field carries the first indication information.
[0015] In one possible design, the forwarding entry is a backup forwarding entry corresponding to the aggregation route, and the primary forwarding entry corresponding to the aggregation route does not pass through the second network device. The method further includes: the first network device sets the primary forwarding entry to an unavailable state so that the first network device can use the backup forwarding entry to forward packets, avoiding the phenomenon of loops caused by using the primary forwarding entry to forward packets, saving network resources, and reducing the possibility of network congestion.
[0016] In one possible design, the forwarding entry is a backup forwarding entry corresponding to the aggregation route, and the primary forwarding entry is a forwarding entry corresponding to the detailed route of the destination device. When the primary forwarding path corresponding to the primary forwarding entry fails, the first network device can use the backup forwarding entry to forward packets to the destination device.
[0017] In one possible design, the first network device confirming that the routing information published by the second network device matches the aggregation route stored by the first network device includes: the first network device confirming that the prefix in the routing information published by the second network device is the same as the prefix of the aggregation route, and the mask in the routing information published by the second network device is the same as the mask of the aggregation route. That is, when the prefix and mask of the routing information published by the second network device and the aggregation route stored by the first network device are both the same, the first network device confirms that they match.
[0018] In one possible design, the method further includes: the first network device forwarding a packet according to the forwarding table entry, the packet including third indication information, the third indication information being used to instruct the second network device to avoid using the alternative forwarding path from the second network device to the destination device to forward the packet, thereby further avoiding loop problems that may occur when the second network device forwards the packet through the alternative forwarding path.
[0019] Secondly, a method for sending messages is provided, the method comprising the following steps: a second network device generates a first announcement message, the first announcement message including a segment identifier of the second network device. The second network device sends the first announcement message to a first network device, the first announcement message being used to instruct the first network device to generate a forwarding table entry corresponding to the aggregation route when confirming that the routing information published by the second network device matches the aggregation route stored by the first network device, the forwarding table entry including the segment identifier of the second network device, and the forwarding path corresponding to the forwarding table entry passing through the second network device. Since the forwarding table entry corresponding to the aggregation route includes the segment identifier of the second network device, the first network device can forward messages to the second network device by carrying the segment identifier of the second network device in the message, avoiding the problem of message loops before being sent to the second network device, thereby saving network resources or reducing the possibility of network congestion.
[0020] In one possible design, the first announcement message further includes first indication information, which instructs the first network device to generate the forwarding table entry based on the segment identifier of the second network device when the first network device confirms that the routing information published by the second network device matches the aggregation route stored in the first network device. Including the first indication information in the first announcement message can save system resources of the first network device to some extent.
[0021] In one possible design, the first notification message includes an SRv6 END SID TLV, and the first indication information is carried in the Flags field, Endpoint Behavior field, or Reserved field of the SRv6 END SID TLV.
[0022] In one possible design, the first notification message includes a NoBypass SID TLV, wherein the Type field of the NoBypass SID TLV carries the first indication information, or the Type field of the NoBypass SID TLV carries second indication information and the Endpoint Behavior field of the NoBypass SID TLV carries the first indication information, wherein the second indication information is used to indicate that the Endpoint Behavior field carries the first indication information.
[0023] In one possible design, the method further includes: the second network device sending a second announcement message to the first network device, the second announcement message including routing information published by the second network device.
[0024] In one possible design, the first announcement message and the second announcement message also include the device identifier of the second network device.
[0025] In one possible design, the device identifier of the second network device is either the router ID or the system ID.
[0026] In one possible design, the first announcement message may also include routing information published by the second network device.
[0027] In one possible design, the first announcement message is an OSPF message or an ISIS message.
[0028] Thirdly, a method for sending a message is provided, comprising the following steps: a second network device receives a message from a first network device, the message including first indication information, the first indication information being used to instruct the second network device to avoid sending the message to a destination device using an alternative forwarding path, the alternative forwarding path being a path from the second network device to the destination device. The second network device determines that the primary forwarding path from the second network device to the destination device is unreachable, and in response to determining that the primary forwarding path is unreachable, the second network device avoids sending the first message to the destination device using the alternative forwarding path according to the indication of the second indication information, thereby avoiding network congestion or wasted system resources caused by loops when forwarding messages through the alternative forwarding path.
[0029] In one possible design, the backup forwarding path passes through the first network device. That is, this avoids loops between the second network device and the first network device.
[0030] In one possible design, the segment identifier of the second network device is NoBypass SID.
[0031] Fourthly, a network device is provided, applied to a network system including multiple network devices, the multiple network devices including a first network device and a second network device, wherein the network device is the first network device, the network device including: an acquisition unit, configured to acquire routing information published by the second network device; and a processing unit, configured to confirm that the routing information published by the second network device matches an aggregation route stored in the first network device, and generate a forwarding table entry corresponding to the aggregation route according to the segment identifier of the second network device, wherein the forwarding table entry includes the segment identifier of the second network device, and the forwarding path corresponding to the forwarding table entry passes through the second network device.
[0032] In one possible design, the network device further includes a receiving unit, configured to receive a first announcement message, the first announcement message including the segment identifier of the second network device, before generating a forwarding table entry corresponding to the aggregation route based on the segment identifier of the second network device.
[0033] In one possible design, the first notification message further includes first indication information. The processing unit is configured to match the routing information published by the second network device with the aggregation routes stored by the first network device based on the first indication information, and, upon confirming that the routing information published by the second network device matches the aggregation routes stored by the first network device, generate a forwarding table entry corresponding to the aggregation route based on the segment identifier of the second network device.
[0034] In one possible design, the first notification message includes routing information published by the second network device. The acquisition unit is configured to acquire the routing information published by the second network device from the first notification message.
[0035] In one possible design, the first notification message further includes the device identifier of the second network device. The acquisition unit is configured to acquire the routing information published by the second network device based on the device identifier of the second network device and a corresponding relationship, wherein the corresponding relationship is the correspondence between the device identifier of the second network device and the routing information published by the second network device.
[0036] In one possible design, the receiving unit is further configured to receive a second notification message, the second notification message including the device identifier of the second network device and routing information published by the second network device, and generate the correspondence based on the device identifier of the second network device and the routing information published by the second network device.
[0037] In one possible design, the first notification message includes an SRv6 END SID TLV, and the first indication information is carried in the Flags field, Endpoint Behavior field, or Reserved field of the SRv6 END SID TLV.
[0038] In one possible design, the first notification message includes a NoBypassSID TLV (Non-Bypass Segment Identifier Type Length Value), wherein the Type field of the NoBypass SID TLV carries the first indication information; or, the Type field of the NoBypass SID TLV carries second indication information and the Endpoint Behavior field of the NoBypass SID TLV carries the first indication information, wherein the second indication information is used to indicate that the Endpoint Behavior field carries the first indication information.
[0039] In one possible design, the first announcement message is an Open Shortest Path First (OSPF) message or an Intermediate System to Intermediate System (ISIS) message.
[0040] In one possible design, the device identifier of the second network device is either the router ID or the system ID.
[0041] In one possible design, the forwarding entry is a backup forwarding entry corresponding to the aggregation route, and the primary forwarding entry corresponding to the aggregation route does not pass through the second network device. The processing unit is further configured to set the primary forwarding entry to an unavailable state.
[0042] In one possible design, the processing unit confirming that the routing information published by the second network device matches the aggregation route stored by the first network device includes: the processing unit confirming that the prefix in the routing information published by the second network device is the same as the prefix of the aggregation route, and the mask in the routing information published by the second network device is the same as the mask of the aggregation route.
[0043] In one possible design, the network device further includes: a sending unit for forwarding a message according to the forwarding table entry, the message including second indication information, the second indication information being used to instruct the second network device to avoid using an alternative forwarding path from the second network device to the destination device to forward the message.
[0044] Fifthly, a network device is provided, applied to a network system including multiple network devices, the multiple network devices including a first network device and a second network device, wherein the network device is the second network device, the network device comprising: a processing unit, configured to generate a first announcement message, the first announcement message including a segment identifier of the second network device; and a sending unit, configured to send the first announcement message to the first network device, the first announcement message being configured to instruct the first network device to generate a forwarding table entry corresponding to the aggregation route when confirming that the routing information published by the second network device matches the aggregation route stored in the first network device, the forwarding table entry including the segment identifier of the second network device, and the forwarding path corresponding to the forwarding table entry passing through the second network device.
[0045] In one possible design, the first notification message further includes first indication information, which is used to instruct the first network device to generate a forwarding table entry corresponding to the aggregation route when the first network device confirms that the routing information published by the second network device matches the aggregation route stored by the first network device.
[0046] In one possible design, the first notification message includes an SRv6 END SID TLV, and the first indication information is carried in the Flags field, Endpoint Behavior field, or Reserved field of the SRv6 END SID TLV.
[0047] In one possible design, the first notification message includes a NoBypassSID TLV (Non-Bypass Segment Identifier Type Length Value), wherein the Type field of the NoBypassSID TLV carries the first indication information, or the Type field of the NoBypassSID TLV carries second indication information and the Endpoint Behavior field of the NoBypassSID TLV carries the first indication information, wherein the second indication information is used to indicate that the Endpoint Behavior field carries the first indication information.
[0048] In one possible design, the sending unit is further configured to send a second announcement message to the first network device, the second announcement message including routing information published by the second network device.
[0049] In one possible design, the first announcement message and the second announcement message also include the device identifier of the second network device.
[0050] In one possible design, the device identifier of the second network device is either the router ID or the system ID.
[0051] In one possible design, the first announcement message may also include routing information published by the second network device.
[0052] In one possible design, the first announcement message is an Open Shortest Path First (OSPF) message or an Intermediate System to Intermediate System (ISIS) message.
[0053] In a sixth aspect, a network device is provided, applied to a network system including multiple network devices, the multiple network devices including a first network device and a second network device, wherein the network device is the second network device, the network device comprising: a receiving unit, configured to receive a packet from the first network device, the packet including first indication information, the first indication information being configured to instruct the second network device to avoid using an alternative forwarding path to send the packet to a destination device of the packet, the alternative forwarding path being a path from the second network device to the destination device; and a processing unit, configured to determine that a primary forwarding path from the second network device to the destination device is unreachable, and in response to determining that the primary forwarding path is unreachable, to avoid using an alternative forwarding path to send the first packet to the destination device according to the indication of the second indication information.
[0054] In one possible design, the alternative forwarding path passes through the first network device.
[0055] In one possible design, the segment identifier of the second network device is NoBypass SID.
[0056] In a seventh aspect, a message processing system is provided, the system including the first network device and the second network device provided in the foregoing aspects.
[0057] Eighthly, a computer-readable storage medium is provided, including instructions, programs, or code that, when executed on a computer, cause the computer to perform the methods described in the preceding aspects.
[0058] Ninthly, a computer program product including computer instructions is provided, which, when run on a network device, causes the network device to perform the method provided by the first aspect, the second aspect, the third aspect, and any possible implementation of the above three aspects.
[0059] In a tenth aspect, a chip is provided, including a memory and a processor. The memory is used to store instructions or program code. The processor is used to call and execute the instructions or program code from the memory to perform the methods described in the first aspect or any possible design of the first aspect; or, the processor performs the methods described in the second aspect or any possible design of the second aspect; or, the processor performs the methods described in the third aspect or any possible design of the third aspect.
[0060] In one possible design, the chip includes only a processor for reading and executing instructions or program code stored in memory. When the instructions or program code are executed, the processor executes the method of the first aspect or any possible design of the first aspect; or, the processor executes the method of the second aspect or any possible design of the second aspect; or, the processor executes the method of the third aspect or any possible design of the third aspect. Attached Figure Description
[0061] Figure 1 This is a schematic diagram of network architecture in traditional technologies;
[0062] Figure 2 This is a schematic diagram of a network architecture applied to an SRv6 scenario, provided in an embodiment of this application.
[0063] Figure 3 This application provides a schematic diagram of the structure of a network architecture 300 according to an embodiment of the present application.
[0064] Figure 4 A flowchart illustrating the method for generating forwarding entries provided in this application embodiment;
[0065] Figure 5A schematic diagram illustrating the format of the End SID TLV field in an ISIS message provided in this application embodiment;
[0066] Figure 6 A schematic diagram illustrating the format of the End SID TLV field in an OSPF message provided in an embodiment of this application;
[0067] Figure 7 A schematic diagram of the SRH format of an SRv6 message provided in an embodiment of this application;
[0068] Figure 8 A schematic diagram illustrating the format of the NoBypass SID provided in this application embodiment;
[0069] Figure 9 A schematic diagram illustrating another NoBypass SID format provided for an embodiment of this application;
[0070] Figure 10 A flowchart illustrating a method for generating forwarding entries and sending messages under the network architecture shown in Figures 11(a) and 11(b) provided in this application embodiment;
[0071] Figure 11(a) is a schematic diagram of the network architecture of Scenario 1 provided in the embodiment of this application;
[0072] Figure 11(b) is another schematic diagram of the network architecture of Scenario 1 provided in the embodiments of this application;
[0073] Figure 12 A flowchart illustrating another method for generating forwarding entries and sending messages under the network architecture shown in Figures 11(a) and 11(b) provided for embodiments of this application;
[0074] Figure 13 This is a schematic diagram of a cross-domain network architecture provided in an embodiment of this application;
[0075] Figure 14 Provided for the embodiments of this application Figure 13 A flowchart illustrating the methods for generating forwarding entries and sending messages within a network architecture;
[0076] Figure 15 This is a schematic diagram of the structure of the network device 1500 provided in an embodiment of this application;
[0077] Figure 16 This is a schematic diagram of the structure of the network device 1600 provided in an embodiment of this application;
[0078] Figure 17 A schematic diagram of the structure of the system 1700 for sending messages provided in the embodiments of this application;
[0079] Figure 18This is a schematic diagram of the structure of the device 1800 provided in the embodiments of this application;
[0080] Figure 19 This is a schematic diagram of the structure of the device 1900 provided in the embodiments of this application. Detailed Implementation
[0081] Before introducing the specific technical solutions, let's first introduce the key terms involved in the embodiments of this application.
[0082] Detailed routes: Routes that identify the IP address of a network device or the address of the network segment to which the network device belongs. Specifically, it is the IP address of the network device plus a mask, or the address of the network segment to which the IP address belongs plus a mask. For example, if the IP address of a network device is A2:2::2 / 128, the detailed route corresponding to this IP address could be a route corresponding to A2:2::2 / 128 or a route corresponding to A2:2:: / 96, where address A2:2:: / 96 is an address of the network segment to which address A2:2::2 / 128 belongs.
[0083] Summary Route: A summary route is a route obtained by aggregating multiple detailed routes that can be combined. For example, a network device stores detailed routes A1:8:: / 96 corresponding to destination address A1:8:: / 96, and also stores detailed routes A1:9:: / 96 corresponding to destination address A1:9:: / 96. The network device can aggregate these two routes to obtain a summary route corresponding to A1:: / 16 (for simplicity, the summary route A1:: / 16 will be referred to as the summary route below). The network device can then advertise the summary route to other network devices, thereby saving storage resources on other network devices.
[0084] The embodiments of this application will now be described with reference to the accompanying drawings.
[0085] Traditional methods of packet forwarding can lead to network resource waste or network congestion. The following section details this problem using the example of a loop in packet forwarding causing network resource waste or congestion.
[0086] In medium to large-scale networks, network devices require significant memory resources to store large routing tables, and transmitting and processing massive amounts of routing information also consumes substantial network resources. To address this issue, the Interior Gateway Protocol (IGP) and Border Gateway Protocol (BGP) provide route aggregation functionality.
[0087] Route aggregation, also known as route convergence, refers to a network device combining routes from multiple different subnets within the same network segment into a single converged route. The network device then advertises this converged route to its neighboring network devices, instead of advertising individual routes from the different subnets corresponding to that converged route. This reduces the number of forwarding entries in the routing tables of the neighboring network devices, thus minimizing the consumption of system resources. Furthermore, if routes from a subnet within the aggregated network segment are frequently deleted and added, the network device does not need to notify its neighboring network devices of these routes, as the subnet routes are advertised as converged routes. This avoids route oscillations within the network and improves network stability to some extent.
[0088] While using aggregation routing can reduce the number of forwarding table entries stored by network devices, it can also create loop problems in some link failure scenarios.
[0089] See Figure 2 The diagram shows a network architecture using SRv6 technology.
[0090] exist Figure 2 In this network architecture, access devices, aggregation devices, and regional core devices are included. Access devices can be access nodes (ACC), aggregation devices can be aggregation nodes (AGG), and regional core devices can be regional core nodes (RC).
[0091] The system includes access devices ACC 201, ACC 202, and ACC 203; aggregation devices AGG 204 and AGG 205; and regional core devices RC 206 and RC 207. Their connections are as follows: ACC 201 is connected to both ACC 202 and AGG 204; ACC 202 is also connected to AGG 205; ACC 203 is connected to AGG 205; AGG 204 is connected to RC 206; AGG 205 is connected to RC 207; and RC 206 is also connected to RC 207.
[0092] The addresses of the devices mentioned above in the network architecture can be IPv6 addresses. Figure 2 In the network architecture, the IP address (i.e., IPv6 address) of ACC 201 is A1:8:: / 96, the IP address of ACC 202 is A1:9:: / 96, and the IP address of ACC 203 is A1:A:: / 96.
[0093] Among them, ACC 201, ACC 202, AGG 204 and AGG 205 belong to access ring 1 in the access network, ACC 203, AGG 204 and AGG 205 belong to access ring 2 in the access network, and AGG 204, AGG 205, RC 206 and RC 207 belong to aggregation ring in the backbone network.
[0094] AGG 204 aggregates the detailed routes A1:8:: / 96 of ACC 201 and A1:9:: / 96 of ACC 202 in access ring 1 into a converged route A1:: / 16, and advertises this converged route to the network devices in the converged ring. At the same time, AGG 204 generates a detailed route corresponding to the IP address A1:8:: / 96 of ACC 201, and generates a detailed route corresponding to the IP address A1:9:: / 96 of ACC 202.
[0095] The AGG 205 will also aggregate the detailed routes A1:8:: / 96 of ACC 201 and A1:9:: / 96 of ACC 202 in ring 1 into a converged route A1:: / 16, and advertise this converged route to the network devices in the convergence ring. The AGG 205 generates a detailed route corresponding to the IP address A1:8:: / 96 of ACC 201, and a detailed route corresponding to the IP address A1:9:: / 96 of ACC 202.
[0096] AGG 204 generates a forwarding table, which includes forwarding table entry 1 and forwarding table entry 2 as shown in Table 1. Forwarding table entry 1 is the detailed route corresponding to IP address A1:8:: / 96, and forwarding table entry 2 is the detailed route corresponding to IP address A1:9:: / 96. Forwarding table entry 1 includes the IP address A1:8:: / 96 of ACC 201 and its outgoing interface (specifically, the identifier of this interface, as will be used below). This outgoing interface is the interface of AGG 204 on the forwarding path from AGG 204 to ACC 201. Forwarding table entry 2 includes the IP address A1:9:: / 96 of ACC 202 and its outgoing interface, which is also the interface of AGG 204 on the forwarding path from AGG 204 to ACC 202. Specifically, the outgoing interface of forwarding entry 1 is the outgoing interface corresponding to the shortest path from AGG 204 to ACC 201, and the outgoing interface of forwarding entry 2 is the outgoing interface corresponding to the shortest path from AGG 204 to ACC 202. This outgoing interface can be the interface corresponding to the direct link between AGG 204 and ACC 201.
[0097] Table 1
[0098] 1 A1:8:: / 96 Outgoing interface of the direct connection link with ACC 201 2 A1:9:: / 96 Outgoing interface of the direct connection link with ACC 201
[0099] In addition, AGG 204 receives the aggregation route A1:: / 16 from RC 206 advertised by AGG 205 and generates the corresponding forwarding table entry 3. Referring to Table 2, forwarding table entry 3 includes the aggregation route A1:: / 16 and the outgoing interface, which is the outgoing interface of the direct link between AGG 204 and RC 206. The forwarding path AGG 204-RC 206-RC 207-AGG 205 can serve as a Topology-Independent Loop-free Alternate (TI-LFA) path.
[0100] Table 2
[0101] 3 A1:: / 16 Outgoing interface of direct connection with RC 206
[0102] Refer to Table 3, which contains forwarding entries generated by AGG 205. Table 3 includes forwarding entries 4 and 5. Forwarding entry 4 includes the IP address A1:9:: / 96 of ACC 202 and its outgoing interface, which is the interface of the direct link between AGG 205 and ACC 202. Forwarding entry 5 includes the IP address A1:A:: / 96 of ACC 203 and its outgoing interface, which is also the interface of the direct link between AGG 205 and ACC 203.
[0103] Table 3
[0104] 4 A1:9:: / 96 Outgoing interface of the direct connection link with ACC 202 5 A1:A:: / 96 Outgoing interface of direct connection to ACC 203
[0105] In addition, AGG 205 receives the aggregation route A1:: / 16 from RC 207 published by AGG 204 and generates the corresponding forwarding table entry 6. Referring to Table 4, forwarding table entry 6 includes the aggregation route A1:: / 16, whose outgoing interface is the outgoing interface of the direct link between AGG 205 and RC 207.
[0106] Table 4
[0107] 6 A1:: / 16 Outgoing interface of direct connection to RC 207
[0108] When the link between AGG 204, ACC 201, and ACC 202 is normal, when a message sent by RC 206 to ACC 202 arrives at AGG 204, AGG 204 looks up table 1 and finds entry 2 of the detailed route corresponding to the IP address A1:9:: / 96 of ACC 202. Then, it sends the message to ACC 201 through the outgoing interface of the direct link with ACC 201 determined according to entry 2 of the routing table, and ACC 201 forwards the message to ACC 202.
[0109] When the direct link between AGG 204 and ACC 201 fails, AGG 204 can delete the detailed routes to ACC 201 and ACC 202, i.e., AGG 204 deletes forwarding table entries 1 and 2. Then, when AGG 204 receives a packet from RC 206, based on the packet's destination address (ACC 202's IP address), it cannot find a matching detailed route to ACC 202 corresponding to forwarding table entry 2. Instead, it matches forwarding table entry 3 corresponding to the aggregation route A1:: / 16. Therefore, AGG 204 can send the packet to RC 206 based on the outgoing interface of the direct link to RC 206 determined by forwarding table entry 3. However, because RC 206 matches the destination address of the message to the aggregation route A1:: / 16, and the next-hop network device of the aggregation route is still AGG204 (determined by the shortest path), RC 206 returns the message to AGG 204. Therefore, the message forms a loop between AGG 204 and RC206, resulting in wasted resources and even network congestion.
[0110] Similarly, when there is a direct link between AGG 204 and AGG 205, if the link between AGG 204 and ACC 201 fails and the direct link between AGG 204 and AGG 205 also fails, the message will form a loop between AGG 204 and RC 206, causing a waste of resources.
[0111] To overcome this technical problem, embodiments of this application provide a method for generating forwarding table entries, thereby reducing resource waste or network congestion during network communication. Before introducing the method for generating forwarding table entries, the network architecture to which this method can be applied will first be described.
[0112] See Figure 3 The figure is a schematic diagram of a network architecture 300 provided in an embodiment of this application.
[0113] exist Figure 3 In this network architecture 300, network device 301, network device 302, network device 303, network device 304, and network device 305 are included. Network device 301 is connected to network devices 302, 303, and 305. Network device 304 is connected to network devices 302, 303, and 305.
[0114] In the embodiments of this application, network devices 301, 302, 303, 304 and 305 can be routers, switches, etc., and the embodiments of this application do not make specific limitations.
[0115] The following is combined Figure 3 The method for generating forwarding table entries provided in this application embodiment will be described. In this method, network device 304 publishes its routing information to network devices 302 and 305. After receiving the routing information from network device 304, both network devices 302 and 305 send the routing information from network device 304 to network device 301.
[0116] After receiving the routing information from network device 304, network device 301 determines whether the routing information from network device 304 matches the aggregation route stored in network device 301. If they match, it obtains the segment identifier (SID) of network device 304 and calculates the forwarding path passing through network device 304 based on the SID. This forwarding path can include network devices 301, 302, and 304, or it can include network devices 301, 305, and 304, depending on which link has a lower cost: network device 301->network device 302->network device 304 or network device 301->network device 305->network device 304. Furthermore, network device 304 generates a forwarding table entry corresponding to the aggregation route based on the link with the lower cost value. This forwarding table entry includes the segment identifier of network device 304 and the outgoing interface, which is the outgoing interface corresponding to the lower cost value. For example, if the cost value of the link from network device 301 to network device 302 to network device 304 is smaller, then the outgoing interface is the outgoing interface of network device 301 connected to network device 302.
[0117] When network device 301 receives a first packet destined for network device 303, it matches the segment identifier of network device 303 in the first packet with a forwarding table entry that includes the aggregation route, thus obtaining the segment identifier and outgoing interface of network device 304. Network device 301 then includes the segment identifier of network device 304 in the first packet to obtain a second packet, and forwards the second packet to network device 304 through the outgoing interface. When network device 302 receives the second packet, it forwards it to network device 304 based on the segment identifier of network device 304, avoiding loop problems between network devices 301 and 302, thereby saving network resources and reducing network congestion.
[0118] See Figure 4 The figure is a flowchart of a method for generating forwarding entries provided in an embodiment of this application. The method for generating forwarding entries includes the following steps:
[0119] S401: The second network device publishes the routing information of the second network device to the first network device.
[0120] In this embodiment of the application, the first network device may be Figure 3 In the network device 301, the second network device can be Figure 3 Network device 304.
[0121] In this embodiment, the routing information published by the second network device may include the aggregation route of the second network device. The aggregation route of the second network device can be obtained through configuration or through other means such as being issued by the controller. This embodiment does not impose any specific limitations.
[0122] In addition to the aggregated routes from the second network device, the routing information published by the second network device may also include detailed routes from the third network device. The aggregated routes from the second network device are routes obtained by aggregating the detailed routes from the third network device or other network devices. In other words, the second network device communicates with the third network device and has the ability to forward packets to the third network device. Figure 3 In this context, the third network device can be network device 303.
[0123] In this embodiment, the second network device and the first network device can be directly connected or indirectly connected. If the latter, the routing information published by the second network device can be forwarded to the first network device via other network devices. For example, in... Figure 3 In this context, the routing information of network device 304 can be forwarded to network device 301 via network device 304 or network device 305.
[0124] S402: The first network device receives routing information published by the second network device.
[0125] S403: The first network device confirms that the routing information published by the second network device matches the aggregation route stored in the first network device.
[0126] In this embodiment, the aggregation route stored by the first network device can be regarded as a local aggregation route, which can be obtained through configuration or by being issued by the controller. This embodiment does not make any specific limitations.
[0127] The first network device confirms whether the routing information published by the second network device matches the aggregation route stored in the first network device. Specifically, it determines whether the prefix of the aggregation route of the second network device is the same as the prefix of the aggregation route stored in the first network device, and whether the mask of the aggregation route of the second network device is the same as the mask of the aggregation route stored in the first network device. If the results of both determinations are yes, then it can be considered that the routing information of the second network device matches the aggregation route stored in the first network device. In other words, the routing information of the second network device is the aggregation route.
[0128] When the routing information published by the second network device also includes detailed routes for the third network device, the first network device can further determine whether it stores detailed routes for the third network device. If so, it indicates that the first network device can also communicate with the third network device; that is, both the first and second network devices can forward packets to the third network device. When the communication link between the first and third network devices (which does not pass through the second network device) fails, the first network device can forward packets destined for the third network device to the second network device, which then forwards the packets to the third network device, thus ensuring network reliability. For example, when the direct link between network devices 301 and 303 fails, network device 301 can forward packets to network device 304, which then forwards the packets to network device 303. Here, network device 303 can be considered the destination device.
[0129] S404: The first network device generates a forwarding table entry corresponding to the aggregation route based on the segment identifier of the second network device, and the forwarding path corresponding to this forwarding table entry passes through the second network device.
[0130] In this embodiment, when the first network device confirms that the routing information published by the second network device matches the aggregation route stored in the first network device, the first network device can obtain the segment identifier of the second network device. This segment identifier can be carried in a first announcement message sent by the second network device to the first network device. Furthermore, the first network device can obtain the first forwarding path of the second network device based on its segment identifier and generate a forwarding table entry corresponding to the aggregation route based on this first forwarding path. This forwarding table entry is used by the first network device to forward packets to the second network device. The forwarding table entry may include the segment identifier of the second network device and an outgoing interface, wherein the outgoing interface is the interface of the first forwarding path corresponding to the forwarding table entry.
[0131] For example, network device 301 can obtain a first forwarding path through network device 304, the destination device of which is network device 303. This first forwarding path is network device 301->network device 302->network device 304->network device 303. Therefore, the forwarding table entry corresponding to this first forwarding path includes the segment identifier of network device 304 and the outgoing interface, which is the interface connecting network device 301 and network device 302.
[0132] As one possible implementation, the first forwarding path from the first network device to the second network device can be a tunnel, i.e., a tunnel leading to the second network device. The outgoing interface in the forwarding table entry is the interface corresponding to this tunnel.
[0133] It should be noted that the specific implementation of including the segment identifier of the second network device in the forwarding table entry can be as follows: the segment identifier of the second network device can be directly stored in the forwarding table entry, or an identifier can be directly stored in the forwarding table entry, indicating the storage location of the segment identifier of the second network device, such as in a routing table entry. The first network device can obtain the segment identifier of the second network device through this identifier.
[0134] In some scenarios, such as when there are many network devices communicating with the first network device, the first network device may receive a large number of announcement messages carrying routing information. However, not every announcement message carrying routing information may carry the segment identifier of the corresponding network device. That is, not every network device communicating with the first network device needs to generate a corresponding first forwarding path and forwarding table entry like the second network device. Therefore, to save network resources, in this embodiment, the first announcement message may also include first indication information. This first indication information is used to instruct the first network device to confirm that the routing information published by the second network device matches the aggregation route stored by the first network device, and to generate a forwarding table entry corresponding to the aggregation route based on the segment identifier of the second network device. When the first network device receives the first announcement message from the second network device, the first network device can match the routing information published by the second network device with the aggregation route stored by the first network device according to the first indication information, and when it confirms that the routing information published by the second network device matches the aggregation route stored by the first network device, it generates a forwarding table entry corresponding to the aggregation route based on the segment identifier of the second network device. In other words, the first network device only needs to generate the corresponding forwarding table entry according to the above steps for announcement messages that carry the first instruction information. For announcement messages that do not carry the first instruction information, the first network device does not need to generate the corresponding forwarding table entry, thereby saving the network resources stored by the first network device.
[0135] In some embodiments, if the first notification message carries first indication information, the second network device can generate a correspondence between the segment identifier of the second network device and third indication information. The third indication information instructs the second network device to avoid using the alternative forwarding path from the second network device to the destination device to forward the second message. Referring to Table 5, the header of Table 5 includes a local segment identifier and an action. The local segment identifier is the segment identifier of the second network device, and the action is to copy the SID of the next-hop network device of the message to the destination address of the message (i.e., the second message below) and avoid using the alternative forwarding path from the second network device to the destination device to forward the message. The segment identifier of the second network device can also be called the noBypass SID.
[0136] Table 5
[0137] Segment identifier of the second network device Third instruction information
[0138] In the embodiments of this application, the first notification message may be an Intermediate System to Intermediate System (ISIS) message or an Open Shortest Path First (OSPF) message, etc.
[0139] When the first notification message carries the first indication information, the specific location of the first indication information in the first notification message can be implemented in the following two ways: reusing an existing field in the first notification message to carry the first indication information, or adding a new TLV field in the first notification message to carry the first indication information.
[0140] If the first implementation method is adopted, that is, reusing the existing fields of the first announcement message, then the first indication information can be carried in the SRv6 Endpoint segment identifier (EndSID) type length value (TLV) field that is already present in the first announcement message.
[0141] See Figure 5 The diagram illustrates the format of the End SID TLV field in an ISIS message. In this diagram, the End SID TLV field includes the Type field, Length field, Flags field, EndpointBehavior field, SID field, Sub-sub-tlv-len field, and sub-sub-TLVs field.
[0142] The Type field identifies the type of the End SID TLV field. The Length field represents the length of the End SID TLV. The Flags field occupies 8 bits. The End SID TLV field can include one or more SID fields, each 128 bits long. One of the SID fields may include the SID of a second network device, which is its IPv6 address. The Sub-sub-tlv-len field represents the length of the corresponding Sub-sub-tlv field. The Sub-sub-tlv field is optional.
[0143] The first indication information can be carried in the Flags field or the Endpoint Behavior field of the ISIS message.
[0144] See Figure 6 The diagram illustrates the format of the End SID TLV field in an OSPF message. In this diagram, the End SID TLV field includes the Type field, Length field, Flags field, Reserved field, Endpoint Behavior field, SID field, and sub-TLVs field.
[0145] The Type field indicates the type of the End SID TLV. The Length field represents the length of the End SID TLV. The Flags field occupies 8 bits. The Endpoint Behavior field value is determined based on specific circumstances and will not be elaborated here. The End SID TLV field may include one or more SID fields, each 128 bits long. One of the SID fields may include the SID of the second network device. The value of this SID field is the IP address of the second network device. The sub-TLVs field is optional.
[0146] The first indication information can be carried in the Flags field, Reserved field, or Endpoint Behavior field of the ISIS message.
[0147] If the second implementation method is adopted, that is, a new TLV field carrying the first indication information is added to the first notification message, then in this embodiment of the application, the newly added TLV field can be called the NoBypass SID TLV field, and the specific format of this field can be the same as... Figure 5 or Figure 6 The End SID TLV field is the same.
[0148] The first indication information can be carried in the Type field of the NoBypass SID TLV. Alternatively, the Type field of the NoBypass SID TLV includes second indication information, and the Endpoint Behavior field of the NoBypass SID TLV includes the first indication information. The second indication information is used to indicate that the Endpoint Behavior field includes the first indication information. That is, the first network device can look up the value of the Endpoint Behavior field according to the indication of the second indication information in the Type field of the NoBypass SID TLV, and then execute the above-described S403 and S404 according to the indication of the first indication information in the Endpoint Behavior field.
[0149] In addition, the SID field in the NoBypass SID TLV can carry the SID of a second network device.
[0150] In this embodiment of the application, depending on whether the first notification message also includes routing information published by the second network device and whether it also includes first indication information, the above S401-S404 can have the following four specific implementation methods:
[0151] Scenario 1: The first announcement message includes routing information published by the second network device and the segment identifier of the second network device, but does not include the first indication information. The above S401-S404 can be specifically implemented as follows:
[0152] S501: The second network device sends a first announcement message to the first network device.
[0153] In this embodiment of the application, before sending the first announcement message to the first network device, the second network device may obtain the segment identifier and routing information of the second network device in advance. The segment identifier and routing information of the second network device can be obtained through configuration or by being issued by the controller.
[0154] S502: The first network device receives the first announcement message and obtains the routing information published by the second network device and the segment identifier of the second network device from the first announcement message.
[0155] S503: The first network device confirms that the routing information published by the second network device matches the aggregation route stored in the first network device.
[0156] S504: The first network device generates a forwarding table entry corresponding to the aggregation route based on the segment identifier of the second network device, and the first forwarding path corresponding to the forwarding table entry passes through the second network device.
[0157] Since the routing information published by the second network device and the segment identifier of the second network device are carried in the same advertisement message, the first network device can assume that the routing information and the segment identifier in the first advertisement message come from the same network device, namely the second network device. Therefore, after confirming that the routing information in the first advertisement message matches the aggregation route stored in the first network device, the first network device can generate a forwarding table entry corresponding to the aggregation route based on the segment identifier in the first advertisement message.
[0158] Scenario 2: The first notification message includes the segment identifier of the second network device, but does not include the routing information and first indication information published by the second network device. The above S401-S404 can be specifically implemented as follows:
[0159] S601: The second network device sends a second announcement message to the first network device, the second announcement message including routing information published by the second network device.
[0160] In this embodiment, the second announcement message can be an ISIS message or an OSPF message. As mentioned above, the routing information published by the second network device can be pre-configured in the second network device or issued by the controller.
[0161] S602: The first network device receives the second announcement message and obtains the routing information published by the second network device from the second announcement message.
[0162] S603: The first network device confirms that the routing information published by the second network device matches the aggregation route stored in the first network device.
[0163] S604: The first network device sends a request message to the second network device, which is used to obtain the segment identifier of the second network device.
[0164] S605: The second network device sends a first announcement message to the first network device, the first announcement message including the segment identifier of the second network device.
[0165] In this embodiment of the application, before sending the first announcement message to the first network device, the second network device may obtain the segment identifier of the second network device in advance. The segment identifier of the second network device can be obtained through configuration or by being issued by the controller.
[0166] S606: The first network device receives the first announcement message and obtains the segment identifier of the second network device from the first announcement message.
[0167] S607: The first network device generates a forwarding table entry corresponding to the aggregation route based on the segment identifier of the second network device, and the first forwarding path corresponding to the forwarding table entry passes through the second network device.
[0168] Since the routing information published by the second network device and the segment identifier of the second network device are not carried in the same advertisement message, when the first network device obtains the second advertisement message first and confirms that it matches the aggregation route stored in the first network device based on the routing information published by the second network device, it sends a request message to the second network device to obtain the segment identifier of the second network device and generates a forwarding table entry based on the segment identifier of the second network device.
[0169] Scenario 3: The first announcement message includes routing information published by the second network device, the segment identifier of the second network device, and first indication information. The above S401-S404 can be specifically implemented as follows:
[0170] S701: The second network device sends a first announcement message to the first network device.
[0171] S702: The first network device receives the first announcement message and obtains the routing information, the first indication information, and the segment identifier of the second network device published by the second network device from the first announcement message.
[0172] In this embodiment of the application, before sending the first announcement message to the first network device, the second network device may obtain the segment identifier and routing information of the second network device in advance. The segment identifier and routing information of the second network device can be obtained through configuration or by being issued by the controller.
[0173] S703: The first network device confirms, based on the first instruction information, that the routing information published by the second network device matches the aggregation route stored by the first network device.
[0174] S704: The first network device generates a forwarding table entry corresponding to the aggregation route based on the segment identifier of the second network device, and the first forwarding path corresponding to the forwarding table entry passes through the second network device.
[0175] Since the first notification message includes the first instruction information, it can reduce the network resources stored by the first network device compared to scenario one.
[0176] Scenario 4: The first announcement message includes the segment identifier and first indication information of the second network device, but does not include the routing information published by the second network device. The above S401-S404 can be specifically implemented as follows:
[0177] S801: The second network device sends a second announcement message to the first network device. The second announcement message includes routing information published by the second network device and the device identifier of the second network device.
[0178] In this embodiment, the device identifier of the second network device is used to uniquely identify the second network device. When the second advertisement message is an ISIS message, the device identifier of the second network device can be a router identifier (router ID). When the second advertisement message is an OSPF message, the device identifier of the second network device can be a system identifier (system ID).
[0179] In this embodiment of the application, before sending the first announcement message to the first network device, the second network device may obtain routing information in advance. This routing information can be obtained through configuration or by being issued by the controller.
[0180] S802: The first network device receives the second announcement message, obtains the routing information published by the second network device and the device identifier of the second network device from the second announcement message, and generates a correspondence between the routing information published by the second network device and the device identifier of the second network device.
[0181] S803: The second network device sends a first announcement message to the first network device. The first announcement message includes the device identifier of the second network device, the segment identifier of the second network device, and first indication information.
[0182] In this embodiment of the application, before sending the first announcement message to the first network device, the second network device may obtain the segment identifier of the second network device in advance. The segment identifier of the second network device can be obtained through configuration or by being issued by the controller.
[0183] S804: The first network device receives the first announcement message and obtains the device identifier of the second network device, the first indication information, and the segment identifier of the second network device from the first announcement message.
[0184] S805: The first network device executes an action based on the first instruction information to obtain the routing information published by the second network device according to the device identifier and correspondence of the second network device.
[0185] S806: The first network device confirms that the routing information published by the second network device matches the aggregated routes stored in the first network device.
[0186] S807: The first network device generates a forwarding table entry corresponding to the aggregation route based on the segment identifier of the second network device, and the first forwarding path corresponding to the forwarding table entry passes through the second network device.
[0187] Since the first notification message includes the first instruction information, it can reduce the network resources of the first network device compared to the scenario in case two.
[0188] It should be noted that for scenarios two and four above, the second network device can send the second announcement message to the first network device first, and then send the first announcement message, or vice versa, that is, send the first announcement message first, and then send the second announcement message. The relevant steps are similar and will not be repeated here.
[0189] After the first network device generates forwarding table entries, the following packet forwarding method can be executed:
[0190] S901: The first network device receives the first message.
[0191] In this embodiment, the first message can be a data message, i.e., a message carrying service data. The first message includes the identifier of the destination device, indicating that the first message needs to reach the destination device. The destination device can be a router, switch, terminal device, or server, etc., and this embodiment does not specifically limit it. Figure 3 In this context, the destination device can be a network device (303). The identifier of the destination device can be its Internet Protocol (IP) address.
[0192] The first message may originate from a fourth network device, which may be, for example, a fourth network device. Figure 3 Network device 302 in the illustrated embodiment.
[0193] In some embodiments, the fourth network device belongs to the first network domain, and the destination device belongs to the second network domain. Therefore, the first network device and the second network device can belong to both the first and second network domains, and both can be area border router (ABR) nodes.
[0194] For example, the first network domain is the area of the backbone network, the second network domain is the area of the access network, the first network device is the network device connecting the access network and the backbone network, and the first forwarding path is the forwarding path in the backbone network.
[0195] For example, both the first and second network domains are IGP domains, but they have different IGP domain numbers. The first network device is the network device that connects these two IGP domains.
[0196] For example, both the first and second network domains are BGP domains, but they have different BGP domain numbers. The first network device is the network device that connects these two BGP domains.
[0197] S902: The first network device matches the forwarding table entry including the aggregation route according to the identifier of the destination device, and obtains the segment identifier of the second network device.
[0198] In this embodiment of the application, the first forwarding path obtained by the first network device through the second network device can be either a primary forwarding path or a backup forwarding path to the destination device. Accordingly, if it is a primary forwarding path, then the forwarding table entry generated by S404 is a primary forwarding table entry; if it is a backup forwarding path, then the forwarding table entry generated by S404 is a backup forwarding table entry.
[0199] When a forwarding entry generated by S404 is used as a primary forwarding entry and matches the identifier of the destination device, there are two possible implementations. One implementation is that the first network device generates only one forwarding entry to the destination device, i.e., the primary forwarding entry. In this case, the first network device can naturally match the first packet to this unique forwarding entry reaching the destination device. Another implementation is that the first network device generates a primary forwarding entry to the destination device and a backup forwarding entry to the destination device. The primary forwarding entry includes the detailed route and outgoing interface of the destination device, and the backup forwarding entry is the forwarding entry generated by S404. When the second forwarding path corresponding to the primary forwarding entry containing the detailed route of the destination device is normal, the first network device can forward the first packet according to the outgoing interface of the primary forwarding entry. Normally, this second forwarding path does not pass through the second network device. When the second forwarding path fails, the first network device deletes the primary forwarding entry or sets it to an unavailable state. Then, the backup forwarding entry, which includes the segment identifier of the second network device, becomes the primary forwarding entry. The first network device can then match the first packet to the aggregation route and forward the first packet according to the forwarding table entry corresponding to the aggregation route.
[0200] When the forwarding table entry generated by S404 matches the identifier of the destination device as a backup forwarding table entry, it indicates that the first network device may have a primary forwarding table entry corresponding to the aggregation route. However, this primary forwarding table entry does not include the segment identifier of the second network device, and the corresponding second forwarding path does not pass through the second network device. This primary forwarding table entry can be, for example, forwarding table entry 3 in Table 2 above. If this primary forwarding table entry exists, the first network device can set it to an unavailable state so that the first network device can forward the first packet based on the backup forwarding table entry, avoiding loop problems.
[0201] Regardless of whether the forwarding table entry generated by S404 is used as a primary or backup forwarding table entry, when the first network device matches the first packet to the forwarding table entry corresponding to the aggregation route, it can obtain the segment identifier and outgoing interface of the second network device from the forwarding table entry to proceed with subsequent steps.
[0202] S903: The first network device adds the segment identifier of the second network device to the first message to obtain the second message.
[0203] In this embodiment of the application, the purpose of adding the segment identifier of the second network device to the first message is to enable the obtained second message to be forwarded to the second network device so that the second network device can continue to send the second message to the destination device.
[0204] Optionally, if the second network device does not store the correspondence between the segment identifier of the second network device and the third indication information, then in this embodiment, in addition to the segment identifier of the second network device, the first network device may also add third indication information to the first message. As mentioned above, the third indication information is used to instruct the second network device to avoid using the alternative forwarding path from the second network device to the destination device to forward the second message.
[0205] In this embodiment of the application, the third indication information may be carried in the segment router header (SRH) of the second message.
[0206] As a first possible implementation, the third indication information can be carried in the Flags field of the second message SRH.
[0207] For example, see Figure 7 The diagram illustrates the format of the SRH (Short Message Header) for an SRv6 packet. In this diagram, the SRH for an SRv6 packet includes the following fields: next header, Hdr Ext Len, Routing Type, Segments Left, Last Entry, Flags, Tag, Segment List, and optional TLV (Type Length Value Objects).
[0208] In this application, the value of the next header field is 43, indicating that the next packet header is a routing extension header. The value of the Hdr Ext Len field is the length of the SRH. The value of the Routing Type field is 4, indicating that it carries an SRH. The value of the Segments Left field is the number of the next SID, initially set to n-1, where n is the number of SIDs. The value of the Last Entry field is the number of the last SID in the packet forwarding path. The value of the Tag field is used to mark a group of packets with the same characteristics. The value of the Segment List field is a list of SIDs. In this embodiment, one or more bits in the Flags field are used to carry third indication information. For example, the 8th bit of the Flags field is set to 1 to identify the third indication information. When the second network device receives the second packet and determines that the 8th bit of the Flags field is set to 1, it determines that the second network device should avoid sending the second packet to the destination device using the alternative path. In this embodiment, the bit in the Flags field that carries the third indication information can be called the NoBypass Flag, and this bit can be marked as B, which is short for NoBypass Flags.
[0209] As a second possible implementation, the third indication information can be carried in the SID list field of the second SRH message. In this case, the SID list includes the SID of the second network device, which includes the third indication information. This SID of the second network device including the third indication information can also be called the NoBypass SID.
[0210] In the SRv6 scenario, the SID of the second network device includes a locator part and a function part, and the SID of the second network device includes the IP address of the second network device. In this scenario, there are two possible implementation methods:
[0211] Implementation method a) See Figure 8 The NoBypass SID can be a special IPv6 address, which can identify the second network device itself or serve as an indication of third-party information. The value of the Function part can be End.X, indicating that after receiving the second packet, the network device receiving the packet decrements the value of Segments Left by 1, replaces the value of the destination address field in the IPv6 packet header with the SID value in the SID list indicated by the decrement, and forwards the second packet to the next-hop network device.
[0212] Implementation method b), see Figure 9The function part of the NoBypass SID includes third indication information.
[0213] As a third possible implementation, see Figure 10 The third indication information can be carried in the newly added TLV field of the second message SRH. The newly added TLV field includes a Type field, a Length field, and a Value field. The Type field is the type of the newly added TLV field, the Length field is the length of the TLV field, and the Value field is the third indication information.
[0214] The above possible implementations do not constitute a limitation on the technical solution of this application, and those skilled in the art can design their own solutions according to the actual situation.
[0215] The above-described possible implementations do not constitute a limitation on the technical solution of this application, and those skilled in the art can design their own solutions according to actual conditions. Furthermore, in SRv6 scenarios, in some embodiments, the second packet may not include the segment identifier of the second network device. Alternatively, in SRv6 scenarios, in some embodiments, the SID list of the second packet may also include the SID of the upstream network device of the second network device on the first forwarding path. The function part of this SID includes End.X, where End.X is an operation defined in SRv6 Programming, meaning that the upstream network device forwards packet M3 to the Layer 3 (L3) outgoing interface corresponding to this SID.
[0216] S904: The first network device sends the second message to the second network device.
[0217] In this embodiment of the application, the first network device sends a second message to the second network device through a first forwarding path.
[0218] If the network device on the first forwarding path includes the fifth network device, for example, the fifth network device is... Figure 3 Network device 305, that is Figure 3 In this embodiment, network device 305 and network device 302 are two independent network devices. However, in other embodiments, the fifth network device and the aforementioned fourth network device can be the same network device. When the destination device belongs to the second network domain, the fifth network device can belong to the first network domain, meaning the first forwarding path does not pass through the second network domain. This is intended to conserve network resources in the second network domain and is applicable when the network resources of network devices in the first network domain are greater than those of network devices in the second network domain.
[0219] S905: The second network device receives the second message and confirms that the primary forwarding path from the second network device to the destination device is unreachable.
[0220] S906: In response to determining that the primary forwarding path is unreachable, the second network device avoids using the backup forwarding path to send the second message to the destination device according to the indication of the third indication information.
[0221] Specifically, when the second network device can store the correspondence between the segment identifier of the second network device and the third indication information, such as in Table 5 above, the second network device can obtain the third indication information based on the segment identifier of the second network device in the second message and the correspondence, and avoid sending the second message to the destination device using the alternative forwarding path according to the indication of the third indication information.
[0222] When the second network device does not store the correspondence between the segment identifier of the second network device and the third indication information, the second network device can avoid sending the second message to the destination device using the alternative forwarding path based on the indication of the third indication information carried in the second message.
[0223] In this embodiment of the application, there are three possible scenarios for the primary forwarding path and the backup forwarding path from the second network device to the destination device. S905 and S906 will be described in detail below in conjunction with these three possible scenarios.
[0224] Scenario 1: The primary forwarding path from the second network device to the destination device is the forwarding path corresponding to the detailed route to the destination device, and the backup forwarding path from the second network device to the destination device is the forwarding path corresponding to the aggregation route to the destination device. Therefore, if the second network device does not find a corresponding detailed route based on the destination device's IP address, it means that the primary forwarding path from the second network device to the destination device is unreachable. So, even if an aggregation route corresponding to the destination device's IP address exists, the second packet will not be sent through the backup forwarding path corresponding to that aggregation route. Alternatively, although the second network device finds a detailed route based on the destination device's IP address, if the forwarding path corresponding to that detailed route is unreachable, then even if an aggregation route corresponding to the destination device's IP address exists, according to the third indication information, the second network device will not send the second packet through the backup forwarding path corresponding to that aggregation route.
[0225] Scenario 2: The primary forwarding path from the second network device to the destination device is the primary forwarding path of the aggregation route to the destination device, and the backup forwarding path is the backup forwarding path of the aggregation route to the destination device. When the second network device matches the aggregation route based on the destination device's IP address and determines that the primary forwarding path of the aggregation route is unreachable, the second network device, according to the instruction of the third indication information, will not send the second packet to the destination device through the backup forwarding path of the aggregation route.
[0226] Scenario 3: The primary forwarding path from the second network device to the destination device is the primary forwarding path of the detailed route to the destination device, and the backup forwarding path is the backup forwarding path of the detailed route to the destination device. When the second network device matches the detailed route based on the IP address of the destination device, but the primary forwarding path of the detailed route is unreachable, the second network device will not send the second packet through the backup forwarding path of the detailed route according to the instruction of the third indication information.
[0227] In this embodiment, when the second network device forwards a second packet to the destination device, it will not use the backup forwarding path to forward the packet if the primary forwarding path is unreachable. This avoids packet forwarding loops caused by using backup forwarding paths, thus preventing resource waste or network congestion. When the backup forwarding path passes through the first network device, this method can prevent loop problems between the second and first network devices. After the second network device avoids using the backup forwarding path to send the second packet to the destination device, it can discard the second packet.
[0228] The following examples illustrate in detail the methods for generating forwarding entries and sending messages provided in this application.
[0229] Scene 1:
[0230] See Figure 10 Figures 11(a) and 11(b) Figure 10 The flowcharts are for the methods of generating forwarding entries and sending messages under the network architectures shown in Figures 11(a) and 11(b). The network architectures shown in Figures 11(a) and 11(b) are similar to those in Figures 11(a) and 11(b). Figure 2 The network architecture shown is the same.
[0231] The method for generating forwarding entries and sending messages includes the following steps:
[0232] S1001: AGG 204 generates forwarding table entry 7 for the detailed route corresponding to IP address A1:8:: / 96 of ACC 201, and generates forwarding table entry 8 for the detailed route corresponding to IP address A1:9:: / 96 of ACC 202. AGG 204 aggregates the detailed routes A1:8:: / 96 of ACC 201 and A1:9:: / 96 of ACC 202 in access ring 1 into an aggregation route A1:: / 16, and advertises this aggregation route A1:: / 16 to network devices in the aggregation ring.
[0233] In this embodiment, AGG 204 can be considered as the first network device mentioned above. Referring to Table 6, this table includes forwarding table entries generated by AGG 204, including forwarding table entries 7 and 8. Forwarding table entry 7 includes the IP address A1:8:: / 96 of ACC 201 and its outgoing interface (specifically, the identifier of this interface, as will be used below), where the outgoing interface is the interface of AGG 204 on the forwarding path from AGG 204 to ACC 201. Forwarding table entry 8 includes the IP address A1:9:: / 96 of ACC 202 and its outgoing interface, which is also the interface of AGG 204 on the forwarding path from AGG 204 to ACC 202. The outgoing interfaces in both forwarding table entries 7 and 8 are the interfaces of the shortest path between AGG 204 and ACC 201, and these shortest path interfaces can be the outgoing interfaces of the direct link between AGG 204 and ACC 201.
[0234] Table 6
[0235] 7 A1:8:: / 96 Outgoing interface of the direct connection link with ACC 201 8 A1:9:: / 96 Outgoing interface of the direct connection link with ACC 201
[0236] S1002: AGG 205 generates forwarding table entry 9 for the detailed route corresponding to IP address A1:9:: / 96 of ACC 202 and forwarding table entry 10 for the detailed route corresponding to IP address A1:A:: / 96 of ACC 203. AGG 205 aggregates the detailed route A1:9:: / 96 of ACC 202 in access ring 1 and the detailed route A1:A:: / 96 of ACC 203 in access ring 2 into a convergence route A1:: / 16, and advertises this convergence route A1:: / 16 to the convergence ring.
[0237] In this embodiment of the application, AGG 205 can be regarded as the second network device mentioned above.
[0238] Refer to Table 7, which shows forwarding entries 9 and 10 generated by AGG 205. Forwarding entry 9 includes the IP address A1:9:: / 96 of ACC 202 and its outgoing interface, which is the outgoing interface of the direct link between AGG 205 and ACC 202. Forwarding entry 10 includes the IP address A1:A:: / 96 of ACC 203 and its outgoing interface, which is the outgoing interface of the direct link between AGG 205 and ACC 203.
[0239] Table 7
[0240] 9 A1:9:: / 96 Outgoing interface of the direct connection link with ACC 202 10 A1:A:: / 96 Outgoing interface of direct connection to ACC 203
[0241] S1003: AGG 204 receives an advertisement message from AGG 205, which includes the aggregation route A1:: / 16 and the SID A2:2::2 / 128 of AGG 205.
[0242] S1004: If the aggregation route A1:: / 16 in the AGG 204 acknowledgment message matches the aggregation route A1:: / 16 stored locally by AGG 204, then a tunnel to AGG 205 is generated based on the SID A2:2::2 / 128 of AGG 205.
[0243] In this embodiment of the application, the tunnel to AGG 205 passes through AGG 204-RC 206-RC 207-AGG 205, which can be regarded as the first forwarding path mentioned above.
[0244] S1005:AGG 204 generates forwarding entry 11 based on this tunnel.
[0245] Referring to Table 8, the destination address of forwarding entry 11 is A1:: / 16, which also includes forwarding information and the tunnel's outgoing interface. The forwarding information includes a repair list, which includes the SID of AGG 205. Optionally, this repair list may also include the SIDs of other network devices on the tunnel besides the SID of AGG 205, such as SID A2:2::4 / 128 of RC206 and SID A2:2::3 / 128 of RC 207.
[0246] Table 8
[0247]
[0248] S1006: AGG 205 receives the aggregation route A1:: / 16 from AGG 204 and generates the corresponding forwarding table entry 12.
[0249] Referring to Table 9, forwarding table entry 9 corresponding to the aggregation route A1:: / 16 includes the outgoing interface, which is the outgoing interface of the direct link between AGG 205 and RC 207.
[0250] Table 9
[0251] 12 A1:: / 16 Outgoing interface of direct connection to RC 207
[0252] S1007: AGG 204 confirmed that the primary forwarding path to ACC 202 is unreachable, and AGG 204 deleted forwarding table entry 8.
[0253] The primary forwarding path from AGG 204 to ACC 202 is AGG 204-ACC 201-ACC 202, which can be considered as the second forwarding path mentioned above. When this primary forwarding path fails, AGG 204 can delete forwarding table entry 8.
[0254] S1008: AGG 204 receives the first message from RC 206, which includes the IP address A1:9:: / 96 of ACC 202.
[0255] In the embodiments of this application, ACC 202 can be regarded as the target device mentioned above.
[0256] Specifically, the first message includes an IPv6 header and a payload. The IPv6 header includes the destination address, which is the IP address A1:9:: / 96 of ACC 202.
[0257] S1009: Because forwarding table entry 8 was deleted, AGG 204 did not match the detailed route based on the IP address A1:9:: / 96 of ACC 202, but it can match the aggregation route A1:: / 16, which means it can match forwarding table entry 11.
[0258] S1010: AGG 204 adds SID A1:9:: / 96 of ACC 202, SID A2:2::2 / 128 of AGG 205, SID A2:2::3 / 128 of RC 207, and SID A2:2::4 / 128 of RC 206 to the SID list in the SRH of the first packet. It also adds third indication information to the Flags field of the SRH of the first packet and modifies the value of the destination address field of the IPv6 header of the first packet to SID A2:2::4 / 128 of RC 206, thus obtaining the second packet.
[0259] As shown in Figure 11(a), the SID of ACC 202 in the second message is stored in the Segment List[0] position in the SRH header, the SID of AGG 205 is stored in the Segment List[1] position in the SRH header, the SID of RC 207 is stored in the Segment List[2] position in the SRH header, the SID of RC 206 is stored in the Segment List[3] position in the SRH header, and the Segments Left is set to 3.
[0260] For details on the implementation of carrying the third instruction information in the second message, please refer to the above text, which will not be repeated here.
[0261] S1011: AGG 204 sends a second message to RC 206 based on the interface corresponding to the tunnel.
[0262] S1012: RC 206 receives the second message, confirms that the destination address is the address of RC 206, decrements the value in Segments Left by 1, modifies the value of the destination address field in the IPv6 message header to the SID A2:2::3 / 128 of RC 207 corresponding to Segment List[2], and then queries the forwarding table entry 13 pre-generated by RC 206 according to the SID A2:2::3 / 128 of RC 207 to obtain the outgoing interface, and forwards the modified second message through the outgoing interface.
[0263] In this embodiment of the application, RC 206 pre-generates a forwarding table entry 13 for reaching RC 207 according to the shortest path method. Referring to Table 10, the forwarding table entry includes a destination address and an outgoing interface. The destination address is the SID A2:2::3 / 128 of RC 207, and the outgoing interface is the outgoing interface of the direct link to RC 207.
[0264] Table 10
[0265] 13 A2:2::3 / 128 Outgoing interface of direct connection to RC 207
[0266] S1013: RC 207 receives the second message from RC 206, confirms that the destination address is the address of RC 207, decrements the value in Segments Left by 1, modifies the value of the destination address field in the IPv6 message header to the SID A2:2::2 / 128 of AGG 205 corresponding to Segment List[1], and then queries the forwarding table entry 14 pre-generated by RC 207 according to the SID A2:2::2 / 128 of AGG 205 to obtain the outgoing interface, and forwards the modified second message through the outgoing interface.
[0267] In this embodiment of the application, RC 206 pre-generates a forwarding table entry 14 for reaching AGG 205 according to the shortest path method. Referring to Table 11, the forwarding table entry includes a destination address and an outgoing interface. The destination address is the SID A2:2::2 / 128 of AGG 205, and the outgoing interface is the outgoing interface of the direct link to AGG 205.
[0268] Table 11
[0269] 14 A2:2::2 / 128 Outgoing interface of direct connection to AGG 205
[0270] S1014: AGG 205 receives the second message from RC 207, confirms that the destination address is the address of AGG 205, decrements the value in Segments Left by 1, modifies the value of the destination address field in the IPv6 header to the IP address A1:9:: / 96 of ACC 202 corresponding to Segment List[0], and then confirms whether the primary forwarding path to ACC 202 is reachable based on the IP address A1:9:: / 96 of ACC 202 in the second message. If so, the second message is sent to ACC 202 through the primary forwarding path; if not, the second message is forwarded without using the backup path according to the third instruction information.
[0271] Specifically, AGG 205 checks if a forwarding table entry 9 matches the IP address A1:9:: / 96 of ACC 202 in the destination address. If a match is found, the primary forwarding path to ACC 202 is considered reachable, and a second packet is sent to ACC 202 through the outgoing interface of the direct link to ACC 202. Furthermore, because ACC 202's SID is a PSP type EndSID, the SRH header of the second packet is popped before sending it. The destination address in the IPv6 header is modified to the IP address of ACC 202 before forwarding. If no match is found, or if a match is found but the direct link to ACC 202 is confirmed to be unreachable, AGG 205 will match forwarding table entry 12 based on the IP address of ACC 202. However, AGG 205 will not use entry 12 to forward the packet, but will directly discard the second packet, thereby preventing RC 207 from returning the second packet to AGG 204 through RC 206, thus avoiding the formation of a loop.
[0272] In some embodiments, when the SID of AGG 205 is of the Ultimate Segment Pop of the SRH (UPS) type, AGG 205 does not need to pop the SRH before sending the second message.
[0273] Because the second message carries the third instruction information, AGG 205 is able to avoid returning the second message to AGG 204 when the primary forwarding path to ACC 202 is unreachable, thus avoiding the problem of wasted resources or network congestion.
[0274] In some embodiments, the situation where there is a direct link between AGG 204 and AGG 205 but the direct link fails is similar to the situation described above where there is no direct link failure between AGG 204 and AGG 205, and will not be repeated here. In some embodiments, as shown in FIG11(b), the SID of AGG 205, the SID of RC 206, and the SID of RC 207 may not be included in the second message, thereby reducing the length of the SRH and reducing the occupation of network resources during message forwarding.
[0275] Scene 2:
[0276] See Figure 12 , Figure 12 The flowcharts are for the methods of generating forwarding entries and sending messages under the network architectures shown in Figures 11(a) and 11(b). The network architectures shown in Figures 11(a) and 11(b) are similar to those in Figure 11(b). Figure 2 The network architecture shown is the same.
[0277] The method for generating forwarding entries and sending messages includes the following steps:
[0278] S1201-S1202 are the same as S1001-S1002, and will not be described again here.
[0279] S1203: AGG 205 generates the correspondence between AGG 205's SID A2:2::2 / 128 and the third indication information, and sends an announcement message to AGG 204. The announcement message includes the aggregation route A1:: / 16, AGG 205's SID A2:2::2 / 128 and the third indication information.
[0280] The third instruction information is used to instruct AGG 205 to avoid forwarding messages through the backup forwarding path.
[0281] S1204: AGG 204 receives an advertisement message from AGG 205, which includes the aggregation route A1:: / 16, the SID of AGG 205 A2:2::2 / 128, and first indication information.
[0282] The first instruction message is used to instruct AGG 204 to perform S1205- and S1206 below.
[0283] S1205: AGG 204 confirms that the aggregation route A1:: / 16 in the notification message matches the aggregation route A1:: / 16 stored locally by AGG 204, and then generates a tunnel to AGG 205 based on the SID A2:2::2 / 128 of AGG 205.
[0284] For a description of tunnel generation, please refer to Scenario 1; it will not be repeated here.
[0285] S1206-S1210 and S1005-S1009 are the same, and will not be described again here.
[0286] S1211: AGG 204 adds SID A1:9:: / 96 of ACC 202 and SID A2:2::2 / 128 of AGG 205 to the SID list in the SRH of the first packet, and modifies the value of the destination address field in the IPv6 header of the first packet to the IP address of AGG205, thus obtaining the second packet.
[0287] In this embodiment, the second message may not carry the third indication information.
[0288] S1212: AGG 204 sends a second message to RC 206 based on the interface corresponding to the tunnel.
[0289] S1213-S1214 and S1012-S1013 are the same, so they will not be described again here.
[0290] S1215: AGG 205 receives the second message from RC 207, confirms that the destination address is the address of AGG 205, decrements the value in Segments Left by 1, modifies the value of the destination address field in the IPv6 header to the IP address A1:9:: / 96 of ACC 202 corresponding to Segment List[0], and then confirms whether the primary forwarding path to ACC 202 is reachable based on the IP address A1:9:: / 96 of ACC 202 in the second message. If so, the second message is sent to ACC 202 through the primary forwarding path; if not, the third indication information is obtained based on the correspondence between AGG 205's SID A2:2::2 / 128 and AGG 205's stored information, and the second message is forwarded without using the backup forwarding path based on the indication of the third indication information.
[0291] The correspondence stored in AGG 205 refers to the correspondence between AGG 205's SID A2:2::2 / 128 and the third indication information mentioned above.
[0292] Since AGG 205 can find the third indication information based on AGG 205's SID A2:2::2 / 128 in the second message, AGG 205 can forward the second message without using the backup forwarding path. This avoids the waste of resources or network congestion caused by AGG 205 returning the second message to AGG 204 through RC 207 and RC 206.
[0293] Scene 3:
[0294] See Figure 13 This diagram illustrates a cross-domain network architecture. The network architecture includes ACC401, ACC 402, AGG 403, AGG 404, RC 405, and RC 406 in the IGP domain, and Autonomous System Boundary Router (ASBR) 407, ASBR 408, Provider (P) equipment 409, P equipment 410, ASBR 411, and ASBR 412 in the External Border Gateway Protocol (EBGP) domain.
[0295] Among them, ACC 401, ACC 402, AGG 403 and AGG 404 belong to IGP domain 1, AGG 403, AGG 404, RC405 and RC 406 belong to IGP domain 2, ASBR 407, ASBR 408, P device 409 and P device 410 belong to EBGP domain 1, and P device 409, P device 410, ASBR 411 and ASBR 412 belong to EBGP domain 2.
[0296] AGG 403 is connected to RC 405 and RC 406 respectively. RC 406 is connected to ASBR 407. RC 406 is also connected to ASBR 408. ASBR 408 is also connected to ASBR 407.
[0297] RC 405 receives routing information from ASBR 407 regarding ASBR 411, determines that the next-hop network device for the primary forwarding path from RC 405 to ASBR 411 is ASBR 407, and the outgoing interface is the interface of the direct link to ASBR 407. Additionally, RC 405 can also receive routing information from RC 406 regarding ASBR 411, determining that the next-hop network device for the alternative forwarding path from RC 405 to ASBR 411 is AGG 403, and the outgoing interface is the outgoing interface of the direct link to AGG 403.
[0298] When RC 405 receives a message from AGG 403 destined for ASBR 411, if the primary forwarding path to ASBR 411 fails, or if ASBR 407 fails, RC 405 can send the message to AGG 403, which will then forward it to RC 406. RC 406 can then forward the message to the destination device ASBR 411 via ASBR 408.
[0299] However, in the traditional case of a failure between RC 406 and ASBR 408, RC 406 will return the message to RC 405 via AGG 403, thus forming a loop, resulting in wasted resources and network congestion.
[0300] by Figure 13 For example, see the network architecture shown below. Figure 14 The diagram is a flowchart of the method for generating forwarding entries and sending messages under this network architecture.
[0301] The method for generating forwarding entries and sending messages includes the following steps:
[0302] S1401: RC 405 obtains the IP address A3:: / 48 of ASBR 411 and generates a forwarding table entry 15 for the primary forwarding path to ASBR 411 based on the IP address A3:: / 48 of ASBR 411.
[0303] In this embodiment of the application, RC 405 can be regarded as the first network device mentioned above.
[0304] The next-hop network device on the primary forwarding path from RC 405 to ASBR 411 is ASBR 407. Referring to Table 12, forwarding table entry 15 includes the IP address A3:: / 48 of ASBR 411 and the outgoing interface, which is the outgoing interface of the direct link to ASBR 407.
[0305] Table 12
[0306] 15 A3:: / 48 Outgoing interface of direct connection to ASBR 407
[0307] S1402: RC 406 obtains the IP address A3:: / 48 of ASBR 411 and generates a forwarding table entry 16 for the primary forwarding path to ASBR 411 based on the IP address A3:: / 48 of ASBR 411.
[0308] In this embodiment of the application, RC 406 can be regarded as the second network device mentioned above.
[0309] The next-hop network device on the primary forwarding path from RC 406 to ASBR 411 is ASBR 408. Referring to Table 13, forwarding table entry 16 includes the IP address A3:: / 48 of ASBR 411 and the outgoing interface, which is the outgoing interface of the direct link to ASBR 408.
[0310] Table 13
[0311] 16 A3:: / 48 Outgoing interface of direct connection to ASBR 408
[0312] S1403: RC 406 sends an advertisement message to RC 405 via AGG 403. The advertisement message includes the routing information of RC 406 and the SID of RC 406. The SID can be the IP address A1::1002:0:999.
[0313] S1404: RC 405 receives the notification message, generates a tunnel to RC 406 based on the SID of RC 406, and obtains the outgoing interface of the tunnel.
[0314] The network device through which this tunnel passes can be RC 405-AGG 403-RC 406, and this tunnel can be regarded as the first forwarding path mentioned above.
[0315] S1405: RC 405 generates forwarding table entry 17.
[0316] Referring to Table 14, forwarding entry 17 includes the IP address of ASBR 411, the IP address of RC 406, and the outgoing interface. Optionally, the repair list may also include the IP address of ASBR 411, A3:: / 48, and the IP address of AGG 403, A1::1001:0:888.
[0317] Table 14
[0318]
[0319]
[0320] S1406: RC 405 receives the first message from AGG 403, which includes the IP address A3:: / 48 of ASBR 411.
[0321] In this embodiment of the application, ASBR 411 can be regarded as the target device mentioned above.
[0322] S1407: RC 405 confirms that the primary forwarding path to ASBR 411 (i.e., the outgoing interface of the direct link to ASBR 407) is faulty (e.g., forwarding table entry 15 cannot be matched) based on the IP address of ASBR 411. Then, RC 405 matches forwarding table entry 17 based on the IP address of ASBR 411, and obtains the SID A1::1001:0:888 of AGG 403, the SID A1::1002:0:999 of RC 406, and the outgoing interface of the tunnel.
[0323] If there is no fault in the primary forwarding path to ASBR 411, then RC 405 can send the first message to ASBR 407, so that ASBR 407 can send the first message to ASBR 411 through P device 409.
[0324] S1408: RC 405 adds a SID list to the SRH of the first message. This SID list includes the IP address A3:: / 48 of ASBR 411, the SID A1::1001:0:888 of AGG 403, the SID A1::1002:0:999 of RC 406, and third indication information. The destination address of the first message is modified to the IP address A1::1001:0:888 of AGG 403, and the second message is obtained.
[0325] In this embodiment, the third instruction information is used to instruct RC 406 to avoid sending the second message to ASBR411 using the alternative forwarding path. In the second message, the IP address A3:: / 48 of ASBR 411 is the SID corresponding to Segment List[0] in the SID list, the SID A1::1002:0:999 of RC 406 is the SID corresponding to Segment List[1] in the SID list, and the SID A1::1001:0:888 of AGG403 is the SID corresponding to Segment List[2] in the SID list. The value of SegmentLeft in the second message is 2.
[0326] S1409: RC 405 sends a second message to AGG 403.
[0327] S1410: AGG 403 receives the second message from RC 405, confirms that the destination address is the IP address of AGG 403, replaces the value of the destination address in the second message with the SID A1::1002:0:999 of RC 406 corresponding to Segment List[1], and searches for the pre-generated forwarding table entry 18 according to the SID A1::1002:0:999 of RC 406 to obtain the outgoing interface, and sends the modified second message to RC 406 according to the outgoing interface.
[0328] In this embodiment of the application, AGG 403 can generate a forwarding table entry 18 to reach RC 406 in advance according to the shortest path method. Referring to Table 15, the forwarding table entry 18 includes a destination address and an outgoing interface, wherein the destination address is the IP address A1::1002:0:999 of RC 406, and the outgoing interface is the outgoing interface for communicating with RC 406.
[0329] Table 15
[0330] 18 A1::1002:0:999 Outgoing interface of direct connection to RC 406
[0331] S1411: RC 406 receives the second message from AGG 403, confirms that the destination address is the IP address A1::1002:0:999 of RC 406, replaces the destination address in the header of the second message with the IP address A3:: / 48 of ASBR411 corresponding to the Segment List[1], and matches forwarding table entry 15 according to the IP address A3:: / 48 of ASBR 411. Forwarding table entry 15 corresponds to the primary forwarding path to ASBR 411. If a match is found, the second message is sent through the primary forwarding path; if no match is found, the second message is discarded even if RC 406 has an alternative forwarding path to ASBR 411.
[0332] The primary forwarding path from RC 406 to ASBR 411 is RC 406-ASBR 408-ASBR 410-P device 409-ASBR 411. An alternative forwarding path from RC 406 to ASBR 411 could be, for example, RC 406-AGG 403-RC 405-ASBR 407-P device 409-ASBR 411.
[0333] Since AGG 403 can send the second message from RC 405 to RC 406 instead of returning it to RC 405, and RC 406 can return the second message to RC 405 without using the backup forwarding path in the event of a failure of the primary forwarding path to ASBR 411, the resource waste caused by the second message looping between RC 406 and AGG 403 is avoided.
[0334] Furthermore, the method for generating forwarding table entries and sending messages when there is a direct link between RC 405 and RC 406 but a failure occurs is different from that in... Figure 13 The method is similar when there is no direct link between RC 405 and RC 406, and will not be repeated here.
[0335] Figure 15 This diagram illustrates a possible structure of the network device involved in the above embodiments. The network device 1500 can implement... Figure 4 The function of the first network device in the example shown, or the function that network device 1500 can perform. Figure 10 or Figure 12 The function of AGG 204 in the illustrated embodiment or Figure 13 The function of RC 405 in the illustrated embodiment. See also... Figure 15 The network device 1500 includes an acquisition unit 1501 and a processing unit 1502. These units can perform the corresponding functions of the first network device in the above method example. The acquisition unit 1501 is used to support the network device 1500 in performing... Figure 4 S402; Processing unit 1502, used to support network device 1500 in performing... Figure 4 S403-S404 in the above method embodiments; and / or other processes performed by the first network device in the technology described herein. For example, the acquisition unit 1501 is used to perform various acquisition operations performed by the first network device in the above method embodiments; the processing unit 1502 is used to perform various processing operations of the first network device in the above method embodiments. For example, the acquisition unit 1501 is used to acquire routing information published by the second network device; the processing unit 1502 is used to confirm that the routing information published by the second network device matches the aggregation route stored by the first network device, and generate a forwarding table entry corresponding to the aggregation route according to the segment identifier of the second network device. For specific execution processes, please refer to the above. Figure 4 or Figure 10 or Figure 12 or Figure 13 The detailed descriptions of the corresponding steps in the illustrated embodiments will not be repeated here.
[0336] It should be noted that the division of units in this embodiment is illustrative and represents only one logical functional division; in actual implementation, other division methods may be used. The functional units in this embodiment can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. For example, in the above embodiment, the acquisition unit and the processing unit can be the same unit or different units. The integrated unit can be implemented in hardware or as a software functional unit.
[0337] Figure 16 This diagram illustrates a possible structure of the network device involved in the above embodiments. The network device 1600 can implement... Figure 4 The function of the second network device in the example shown, or the function that network device 1600 can perform. Figure 10 or Figure 12 The function of AGG 205 in the illustrated embodiment or Figure 13 The function of RC 406 in the illustrated embodiment. See also... Figure 16 The network device 1600 includes a processing unit 1601 and a sending unit 1602. These units can perform the corresponding functions of the second network device in the above method example. For example, the processing unit 1601 is used to generate a first announcement message, which includes the segment identifier of the second network device; the sending unit 1602 is used to send the first announcement message to the first network device. For the specific execution process, please refer to the above. Figure 4 or Figure 10 or Figure 12 or Figure 13 The detailed descriptions of the corresponding steps in the illustrated embodiments will not be repeated here.
[0338] See Figure 17 As shown, an embodiment of the invention provides a message processing system 1700, which implements the methods for generating forwarding table entries and sending messages as described in the aforementioned method embodiments. The system 1700 includes a network device 1701 and a network device 1702. Network device 1701 can implement... Figure 4 The first network device or in the illustrated embodiment Figure 15 The functions of network device 1500 and network device 1702 can be achieved. Figure 4 The second network device or in the embodiment shown Figure 16 The functions of network device 1600 are described. Network device 1701 can also perform... Figure 10 or Figure 12 The function of AGG 204 in the illustrated embodiment or Figure 13 The network device 1701 can also implement the functions of RC 405 in the illustrated embodiment. Figure 10 or Figure 12 The function of AGG 205 in the illustrated embodiment or Figure 13 The illustrated embodiment demonstrates the function of RC 406. For the specific execution process, please refer to the above. Figure 4 or Figure 10 or Figure 12 or Figure 13 The detailed descriptions of the corresponding steps in the illustrated embodiments will not be repeated here.
[0339] Figure 18 This is a schematic diagram of the structure of a device 1800 provided in an embodiment of this application. Figure 15 Network equipment 1500 and Figure 16 The network device 1600 can be accessed via Figure 18 This is achieved using the device shown. See also Figure 18 The device 1800 includes at least one processor 1801, a communication bus 1802, and at least one network interface 1804. Optionally, the device 1800 may also include a memory 1803.
[0340] The processor 1801 can be a general-purpose central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits (ICs) used to control the execution of the program in this application. The processor can be used to process messages to implement the message sending method provided in the embodiments of this application.
[0341] For example, when Figure 4 The first network device in the middle passes through Figure 18 When implemented using the device shown, the processor can be used to obtain routing information published by the second network device. When it is confirmed that the routing information published by the second network device matches the aggregation route stored by the first network device, the first network device generates a forwarding table entry corresponding to the aggregation route based on the segment identifier of the second network device. For specific functional implementation, please refer to the processing part corresponding to the first network device in the method embodiment. For example, when... Figure 4 The second network device in the middle passes through Figure 18When implemented using the device shown, the processor can be used to generate a first announcement message, which includes the segment identifier of the second network device. The second network device sends the first announcement message to the first network device. This first announcement message instructs the first network device to generate a forwarding table entry corresponding to the aggregation route when it confirms that the routing information published by the second network device matches the aggregation route stored in the first network device. The forwarding table entry includes the segment identifier of the second network device, and the forwarding path corresponding to the forwarding table entry passes through the second network device. For specific functional implementation, please refer to the processing section of the second network device in the method embodiment.
[0342] The communication bus 1802 is used to transfer information between the processor 1801, the network interface 1804, and the memory 1803.
[0343] The memory 1803 may be a read-only memory (ROM) or other type of static storage device capable of storing static information and instructions. The memory 1803 may also be random access memory (RAM) or other type of dynamic storage device capable of storing information and instructions. It may also be a compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical discs, laser discs, optical discs, digital versatile optical discs, Blu-ray discs, etc.), magnetic disk storage media, or other magnetic storage devices, or any other medium capable of carrying or storing desired program code in the form of instructions or data structures and accessible by a computer, but is not limited thereto. The memory 1803 may exist independently and be connected to the processor 1801 via the communication bus 1802. The memory 1803 may also be integrated with the processor 1801.
[0344] Optionally, the memory 1803 stores program code or instructions for executing the present application's solution, and the processor 1801 controls the execution of these instructions. The processor 1801 executes the program code or instructions stored in the memory 1803. The program code may include one or more software modules. Optionally, the processor 1801 may also store program code or instructions for executing the present application's solution, in which case the processor 1801 does not need to read the program code or instructions from the memory 1803.
[0345] Network interface 1804 can be a transceiver or similar device used to communicate with other devices or communication networks, such as Ethernet, Radio Access Network (RAN), or Wireless Local Area Network (WLAN). In this embodiment, network interface 1804 can be used to receive messages sent by other nodes in the segmented routing network, and can also send messages to other nodes in the segmented routing network. Network interface 1804 can be an Ethernet interface, a Fast Ethernet (FE) interface, or a Gigabit Ethernet (GE) interface, etc.
[0346] In a specific implementation, as one example, device 1800 may include multiple processors, for example... Figure 18 The processors 1801 and 405 are shown. Each of these processors can be a single-core (single-CPU) processor or a multi-core (multi-CPU) processor. A processor here can refer to one or more devices, circuits, and / or processing cores used to process data (e.g., computer program instructions).
[0347] Figure 19 This is a schematic diagram of the structure of a device 1900 provided in an embodiment of this application. Figure 4 The first and second network devices in the system can be connected through the network. Figure 19 This is achieved using the device shown. See also Figure 19The illustrated device structure diagram shows that device 1900 includes a main control board and one or more interface boards. The main control board is communicatively connected to the interface boards. The main control board, also called a main processing unit (MPU) or route processor card, includes a CPU and memory. It is responsible for controlling and managing the various components in device 1900, including routing calculations, device management, and maintenance functions. The interface boards, also called line processing units (LPUs) or line cards, are used to receive and send messages. In some embodiments, the main control board and interface boards, or interface boards themselves, communicate via a bus. In some embodiments, the interface boards communicate via a switch fabric unit (SFU). In this case, device 1900 also includes a switch fabric unit, which is communicatively connected to the main control board and interface boards. The switch fabric unit is used to forward data between the interface boards and can also be called a switch fabric unit (SFU). Each interface board includes a CPU, memory, a forwarding engine, and an interface card (IC), where the interface card may include one or more network interfaces. The network interface can be an Ethernet interface, FE interface, or GE interface, etc. The CPU communicates with the memory, forwarding engine, and interface card respectively. The memory stores the forwarding table. The forwarding engine forwards received packets based on the forwarding table stored in the memory. If the destination address of the received packet is the IP address of device 1900, the packet is sent to the CPU of the main control board or interface board for processing; if the destination address of the received packet is not the IP address of device 1900, the forwarding table is consulted based on the destination. If the next hop and outgoing interface corresponding to the destination address are found in the forwarding table, the packet is forwarded to the outgoing interface corresponding to the destination address. The forwarding engine can be a network processor (NP). The interface card, also called a daughter card, can be installed on the interface board and is responsible for converting photoelectric signals into data frames, performing validity checks on the data frames, and forwarding them to the forwarding engine for processing or the interface board CPU. In some embodiments, the CPU can also perform the functions of the forwarding engine, such as implementing soft forwarding based on a general-purpose CPU, thus eliminating the need for a forwarding engine on the interface board. In some embodiments, the forwarding engine can be implemented using an ASIC or a field-programmable gate array (FPGA). In some embodiments, the memory storing the forwarding table can also be integrated into the forwarding engine as part of the forwarding engine.
[0348] This application also provides a chip system, including: a processor coupled to a memory, the memory being used to store programs or instructions, wherein when the program or instructions are executed by the processor, the chip system performs the aforementioned functions. Figure 4 The method of the first network device or the second network device in the illustrated embodiment.
[0349] Optionally, the chip system may include one or more processors. These processors can be implemented in hardware or software. When implemented in hardware, the processor can be a logic circuit, integrated circuit, etc. When implemented in software, the processor can be a general-purpose processor that reads software code stored in memory. Optionally, the chip system may also include one or more memories. These memories can be integrated with the processor or separated from it; this application does not limit this. For example, the memory can be a non-transient processor, such as a read-only memory (ROM), which can be integrated with the processor on the same chip or disposed on different chips. This application does not specifically limit the type of memory or the arrangement of the memory and processor.
[0350] For example, the chip system can be an FPGA, an ASIC, a system on-chip (SoC), a CPU, an NP, a digital signal processor (DSP), a micro controller unit (MCU), a programmable logic device (PLD), or other integrated chips.
[0351] It should be understood that each step in the above method embodiments can be completed by integrated logic circuits in the processor hardware or by instructions in software form. The method steps disclosed in the embodiments of this application can be directly manifested as being executed by a hardware processor, or being executed by a combination of hardware and software modules in the processor.
[0352] This application also provides a computer-readable storage medium including instructions that, when run on a computer, cause the computer to perform the methods described in the foregoing embodiments.
[0353] The terms "first," "second," "third," "fourth," etc., used in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments described herein can be implemented in a sequence other than that illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that includes a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0354] In this application, "at least one" means one or more, and "more than one" means two or more. "At least one of the following" or similar expressions refer to any combination of these items, including any combination of single or multiple items. For example, at least one of a, b, or c can represent: a, b, c, ab, ac, bc, or abc, where a, b, and c can be single or multiple. In this application, "A and / or B" is considered to include a single A, a single B, and A+B.
[0355] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0356] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical module division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection between apparatuses or units through some interfaces, and may be electrical, mechanical, or other forms.
[0357] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be obtained according to actual needs to achieve the purpose of this embodiment.
[0358] Furthermore, the module units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software module unit.
[0359] If the integrated unit is implemented as a software module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0360] Those skilled in the art will recognize that, in one or more of the examples above, the functions described in this invention can be implemented using hardware, software, firmware, or any combination thereof. When implemented in software, these functions can be stored in a computer-readable medium or transmitted as one or more instructions or code on a computer-readable medium. Computer-readable media include computer storage media and communication media, wherein communication media include any medium that facilitates the transfer of a computer program from one place to another. Storage media can be any available medium accessible to a general-purpose or special-purpose computer.
[0361] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above description is only a specific embodiment of the present invention.
[0362] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit it. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.
Claims
1. A method for generating forwarding entries, characterized in that, The method includes: The first network device obtains routing information published by the second network device; The first network device confirms that the routing information published by the second network device matches the aggregation route stored in the first network device, and generates a forwarding table entry corresponding to the aggregation route based on the segment identifier of the second network device. The forwarding table entry includes the segment identifier of the second network device, and the forwarding path corresponding to the forwarding table entry passes through the second network device. The aggregation route is a route obtained by aggregating multiple detailed routes that can be aggregated together. The first network device receives a first message, the destination address of which matches a forwarding table entry including the aggregation route; The first network device obtains the segment identifier of the second network device from the forwarding table entry, and adds the segment identifier of the second network device to the header of the first message to obtain the second message; The first network device sends the second message to the second network device according to the segment identifier of the second network device.
2. The method according to claim 1, characterized in that, Before the first network device generates a forwarding table entry corresponding to the aggregation route based on the segment identifier of the second network device, the method further includes: The first network device receives a first notification message, which includes the segment identifier of the second network device.
3. The method according to claim 2, characterized in that, The first notification message also includes first indication information, wherein the first network device confirms that the routing information published by the second network device matches the aggregation route stored in the first network device, and generates a forwarding table entry corresponding to the aggregation route based on the segment identifier of the second network device, including: The first network device matches the routing information published by the second network device with the aggregation route stored in the first network device according to the first indication information, and when it confirms that the routing information published by the second network device matches the aggregation route stored in the first network device, it generates a forwarding table entry corresponding to the aggregation route according to the segment identifier of the second network device.
4. The method according to claim 2 or 3, characterized in that, The first notification message includes routing information published by the second network device; The first network device obtains the routing information published by the second network device, including: The first network device obtains the routing information published by the second network device from the first announcement message.
5. The method according to claim 2 or 3, characterized in that, The first notification message also includes the device identifier of the second network device; The first network device obtains the routing information published by the second network device, including: The first network device obtains the routing information published by the second network device based on the device identifier of the second network device and the corresponding relationship, wherein the corresponding relationship is the correspondence between the device identifier of the second network device and the routing information published by the second network device.
6. The method according to claim 5, characterized in that, The method further includes: The first network device receives a second notification message, the second notification message including the device identifier of the second network device and the routing information published by the second network device; The first network device generates the correspondence based on the device identifier of the second network device and the routing information published by the second network device.
7. The method according to claim 3, characterized in that, The first notification message includes a segment identifier (END SID) type length value (TLV) of Internet Protocol version 6 (IP6) segment routing. The first indication information is carried in the Flags field, Endpoint Behavior field, or reserved field of the SRv6 END SID TLV.
8. The method according to claim 3, characterized in that, The first notification message includes a NoBypass SID TLV (NonBypass Segment Identifier Type Length Value). The Type field of the NoBypass SID TLV carries the first indication information. Alternatively, the Type field of the NoBypass SID TLV carries the second indication information and the Endpoint Behavior field of the NoBypass SID TLV carries the first indication information. The second indication information is used to indicate that the Endpoint Behavior field carries the first indication information.
9. The method according to any one of claims 2, 7 or 8, characterized in that, The first notification message is an Open Shortest Path First (OSPF) message or an Intermediate System to Intermediate System (ISIS) message.
10. The method according to any one of claims 1-9, characterized in that, The forwarding table entry is a backup forwarding table entry corresponding to the aggregation route, and the primary forwarding table entry corresponding to the aggregation route does not pass through the second network device. The method further includes: The first network device sets the primary forwarding table entry to an unavailable state.
11. The method according to any one of claims 1-10, characterized in that, The first network device confirms that the routing information published by the second network device matches the aggregated routes stored in the first network device, including: The first network device confirms that the prefix in the routing information published by the second network device is the same as the prefix of the aggregation route, and that the mask in the routing information published by the second network device is the same as the mask of the aggregation route.
12. The method according to any one of claims 1-11, characterized in that, The second message includes third indication information, which instructs the second network device to avoid using the alternative forwarding path from the second network device to the destination device to forward the second message.
13. A method for sending a message, characterized in that, The method includes: The second network device generates a first announcement message, the first announcement message including the segment identifier of the second network device; The second network device sends the first announcement message to the first network device. The first announcement message is used to instruct the first network device to generate a forwarding table entry corresponding to the converged route when it confirms that the routing information published by the second network device matches the converged route stored by the first network device. The forwarding table entry includes the segment identifier of the second network device. The forwarding path corresponding to the forwarding table entry passes through the second network device. The converged route is a route obtained by aggregating multiple detailed routes that can be aggregated together. The second network device receives a second message, which is a message obtained by the first network device from the forwarding table entry including the aggregation route when the first network device determines that the destination address in the received first message matches the forwarding table entry. The second network device then adds the segment identifier of the second network device to the first message and sends it to the second network device.
14. The method according to claim 13, characterized in that, The first notification message also includes first indication information, which instructs the first network device to generate a forwarding table entry corresponding to the aggregation route when it confirms that the routing information published by the second network device matches the aggregation route stored by the first network device.
15. The method according to claim 14, characterized in that, The first notification message includes a Length Value (TLV) of the SRv6 Endpoint Segment Identifier (END SID) of Internet Protocol Version 6 (IP6). The first indication information is carried in the Flags field, Endpoint Behavior field, or Reserved field of the SRv6 END SID TLV.
16. The method according to claim 14, characterized in that, The first notification message includes a NoBypass SID TLV (Non-Bypass Segment Identifier Type Length Value). The Type field of the NoBypass SID TLV carries the first indication information, or the Type field of the NoBypass SID TLV carries the second indication information and the Endpoint Behavior field of the NoBypass SID TLV carries the first indication information. The second indication information is used to indicate that the Endpoint Behavior field carries the first indication information.
17. The method according to any one of claims 13-16, characterized in that, The method further includes: The second network device sends a second announcement message to the first network device, the second announcement message including routing information published by the second network device.
18. The method according to claim 17, characterized in that, The first and second notification messages also include the device identifier of the second network device.
19. The method according to any one of claims 14-16, characterized in that, The method further includes: The second network device generates a correspondence between the identifier of the second network device and the third indication information, wherein the third indication information is used to instruct the second network device to avoid using the alternative forwarding path from the second network device to the destination device to forward packets.
20. The method according to any one of claims 13-16, characterized in that, The first notification message also includes routing information published by the second network device.
21. The method according to any one of claims 13-20, characterized in that, The first notification message is an Open Shortest Path First (OSPF) message or an Intermediate System to Intermediate System (ISIS) message.
22. A network device, characterized in that, An application to a network system comprising multiple network devices, wherein the multiple network devices include a first network device and a second network device, wherein the network device is the first network device, and the network device includes: The acquisition unit is used to acquire routing information published by the second network device; The processing unit is configured to confirm that the routing information published by the second network device matches the aggregation route stored by the first network device, and generate a forwarding table entry corresponding to the aggregation route based on the segment identifier of the second network device. The forwarding table entry includes the segment identifier of the second network device, and the forwarding path corresponding to the forwarding table entry passes through the second network device. The aggregation route is a route obtained by aggregating multiple detailed routes that can be aggregated together. A receiving unit is configured to receive a first message, wherein the destination address of the first message matches a forwarding table entry including the aggregation route; The processing unit is further configured to obtain the segment identifier of the second network device from the forwarding table entry, and add the segment identifier of the second network device to the header of the first message to obtain the second message; The sending unit is configured to send the second message to the second network device according to the segment identifier of the second network device.
23. The network device according to claim 22, characterized in that, The receiving unit is further configured to receive a first announcement message before generating a forwarding table entry corresponding to the aggregation route based on the segment identifier of the second network device, the first announcement message including the segment identifier of the second network device.
24. The network device according to claim 23, characterized in that, The first notification message also includes first instruction information; The processing unit is configured to match the routing information published by the second network device with the aggregation route stored by the first network device according to the first indication information, and when it is confirmed that the routing information published by the second network device matches the aggregation route stored by the first network device, generate a forwarding table entry corresponding to the aggregation route according to the segment identifier of the second network device.
25. The network device according to claim 23 or 24, characterized in that, The first notification message includes routing information published by the second network device; The acquisition unit is used to acquire routing information published by the second network device from the first announcement message.
26. The network device according to claim 23 or 24, characterized in that, The first notification message also includes the device identifier of the second network device; The acquisition unit is used to acquire routing information published by the second network device according to the device identifier and the corresponding relationship of the second network device, wherein the corresponding relationship is the correspondence between the device identifier of the second network device and the routing information published by the second network device.
27. The network device according to claim 26, characterized in that, The receiving unit is further configured to receive a second notification message, the second notification message including the device identifier of the second network device and the routing information published by the second network device, and generate the correspondence relationship based on the device identifier of the second network device and the routing information published by the second network device.
28. The network device according to claim 24, characterized in that, The first notification message includes a segment identifier (END SID) type length value (TLV) of Internet Protocol version 6 (IP6) segment routing, and the first indication information is carried in the Flags field, Endpoint Behavior field, or reserved field of the SRv6 END SID TLV.
29. The network device according to claim 24, characterized in that, The first notification message includes a NoBypass SID TLV (Non-Bypass Segment Identifier Type Length Value). The Type field of the NoBypass SID TLV carries the first indication information. Alternatively, the Type field of the NoBypass SID TLV carries the second indication information and the Endpoint Behavior field of the NoBypass SID TLV carries the first indication information. The second indication information is used to indicate that the Endpoint Behavior field carries the first indication information.
30. The network device according to any one of claims 23, 28 or 29, characterized in that, The first notification message is an Open Shortest Path First (OSPF) message or an Intermediate System to Intermediate System (ISIS) message.
31. The network device according to any one of claims 22-30, characterized in that, The forwarding entry is a backup forwarding entry corresponding to the aggregation route, and the primary forwarding entry corresponding to the aggregation route does not pass through the second network device; The processing unit is also configured to set the primary forwarding table entry to an unavailable state.
32. The network device according to any one of claims 22-31, characterized in that, The processing unit confirms that the routing information published by the second network device matches the aggregated routes stored by the first network device, including: The processing unit confirms that the prefix in the routing information published by the second network device is the same as the prefix of the aggregation route, and that the mask in the routing information published by the second network device is the same as the mask of the aggregation route.
33. The network device according to any one of claims 22-32, characterized in that, The second message includes second indication information, which instructs the second network device to avoid forwarding the second message using an alternative forwarding path from the second network device to the destination device.
34. A network device, characterized in that, An application to a network system comprising multiple network devices, wherein the multiple network devices include a first network device and a second network device, the second network device being the first network device, and the network device includes: The processing unit is configured to generate a first notification message, wherein the first notification message includes the segment identifier of the second network device; The sending unit is configured to send the first announcement message to the first network device. The first announcement message is configured to instruct the first network device to generate a forwarding table entry corresponding to the converged route when it confirms that the routing information published by the second network device matches the converged route stored by the first network device. The forwarding table entry includes the segment identifier of the second network device. The forwarding path corresponding to the forwarding table entry passes through the second network device. The converged route is a route obtained by aggregating multiple detailed routes that can be aggregated together. The receiving unit is configured to receive a second message, wherein the second message is a message obtained by the first network device from the forwarding table entry including the aggregation route when the first network device determines that the destination address in the received first message matches the forwarding table entry, and adds the segment identifier of the second network device to the message obtained in the first message and sends it to the second network device.
35. The network device according to claim 34, characterized in that, The first notification message also includes first indication information, which instructs the first network device to generate a forwarding table entry corresponding to the aggregation route when it confirms that the routing information published by the second network device matches the aggregation route stored by the first network device.
36. The network device according to claim 35, characterized in that, The first notification message includes an SRv6 ENDSID TLV, and the first indication information is carried in the Flags field, Endpoint Behavior field, or Reserved field of the SRv6 END SID TLV.
37. The network device according to claim 35, characterized in that, The first notification message includes a NoBypass SID TLV (Non-Bypass Segment Identifier Type Length Value). The Type field of the NoBypass SID TLV carries the first indication information, or the Type field of the NoBypass SID TLV carries the second indication information and the Endpoint Behavior field of the NoBypass SID TLV carries the first indication information. The second indication information is used to indicate that the Endpoint Behavior field carries the first indication information.
38. The network device according to any one of claims 34-37, characterized in that, The sending unit is further configured to send a second announcement message to the first network device, the second announcement message including routing information published by the second network device.
39. The network device according to claim 38, characterized in that, The first and second notification messages also include the device identifier of the second network device.
40. The network device according to claim 36 or 37, characterized in that, The processing unit is further configured to generate a correspondence between the identifier of the second network device and the third indication information, wherein the third indication information is used to instruct the second network device to avoid using the alternative forwarding path from the second network device to the destination device to forward packets.
41. The network device according to any one of claims 34-37, characterized in that, The first notification message also includes routing information published by the second network device.
42. A network system, characterized in that, The network system includes a first network device as described in any one of claims 22-33 and a second network device as described in any one of claims 34-41.
43. A computer-readable storage medium, characterized in that, Includes instructions, programs, or code that, when executed on a computer, cause the computer to perform the method as claimed in any one of claims 1 to 21.
44. A chip, characterized in that, It includes a memory and a processor, the memory being used to store instructions or program code, and the processor being used to retrieve and execute the instructions or program code from the memory to perform the method as claimed in any one of claims 1 to 21.
Citation Information
Patent Citations
Forwarding path establishing method and device, network equipment and system of forwarding path
CN110572326A