Method, device and system for advertising processing capabilities of a network device - Patents.com
Patent Information
- Application Number
- JP2023530852
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Priority Date
- 2020-12-31
- Filing Date
- 2021-11-23
- Publication Date
- 2025-03-11
- Estimated Expiration
- 2041-11-23
Smart Images

Figure 0007644234000001 
Figure 0007644234000002 
Figure 0007644234000003
Abstract
Description
[Technical field]
[0001] The present application relates to the field of communication technologies, and in particular to a method, device, and system for advertising the processing capabilities of a network device. do. [Background technology]
[0002] In order to guarantee the continuity and robustness of the transmission of service traffic in the data bearer network, protection policies usually need to be deployed for the key nodes involved in the traffic transmission route, so as to avoid the service interruption directly caused when the key node is failing. A scenario in which a bearer tunnel of VPN service traffic is built by using Segment Routing over IPv6 (SRv6) technology is used as an example. A remote provider edge (PE) device for connecting to a user-side device may be failing when it acts as the primary egress node of the tunnel. To deal with the failure scenario, egress protection needs to be deployed. In the SRv6 technology, a Segment Identifier (SID) list is used to indicate the packet forwarding path. Thus, the SID of the secondary egress node can be added to the to-be-sent traffic packet. In this case, when a previous-hop node directly connected to the primary exit node finds that the primary exit node is down, it can guide the traffic packet forwarded through the secondary exit node by using the SID of the secondary exit node carried in the packet header. SRv6 technology also supports service chain scenarios. During the typical application of service chain, services such as traffic cleaning or anti-virus can be provided for service traffic. To implement the aforementioned services, the service traffic needs to pass through a service device such as a firewall in the forwarding process, and is sent to the user side device along the subsequent forwarding path after the service device provides the corresponding service.However, the firewall device providing the service may also fail. In order to ensure the use security of the transmitted service traffic, a backup device may be alternatively deployed, which may be used to replace the firewall to provide the service, and the backup device may be indicated by a secondary device SID added to the packet of the service traffic.
[0003] In the above application scenario, in the SID list, the secondary SID used to indicate the secondary device is usually placed after the SID used to indicate the primary device. If the primary device fails, the secondary SID can be read according to the general rules specified in SRv6 to process the SID list and forward the traffic packets. However, when the primary device does not fail, the traffic packets are still sent to the primary device for forwarding. In this case, if the processing is still performed according to the general rules, an error may occur, and as a result, the traffic packets are discarded. Summary of the Invention
[0004] This application provides a method, a system, an apparatus, and a network device for advertising the processing capability of a network device. A first network device that needs to advertise the processing capability of the first network device can send an advertisement message carrying indication information. Here, the indication information can indicate whether the first network device has the processing capability to function as a network device on a primary path for forwarding a packet and to ignore the secondary path information included in the packet when receiving a packet including the primary path information and the secondary path information. If it is determined that the first network device has the processing capability, a second network device that receives the advertisement message can send a service packet including the primary path information and the secondary path information to the first network device. This ensures that when the primary path can be used normally, the first network device can ignore the secondary path information that does not need to be used in the service packet, so as to avoid problems such as packet loss or erroneous forwarding caused by improper processing of the secondary path information. The technical solution provided in this application includes at least the following aspects.
[0005] According to a first aspect, a method for advertising processing capabilities of a network device is provided and is executed by a first network device, the method comprising: generating an advertisement message, the advertisement message including first indication information, the first indication information being used to indicate processing capabilities of the first network device, the processing capabilities of the first network device including a processing capability of ignoring secondary path information when the first network device acts as a network device on a primary path for forwarding a packet and receives the packet including primary path information and secondary path information, the secondary path information being used to indicate one or more secondary paths for forwarding the packet when the primary path is unavailable; and transmitting, by the first network device, the advertisement message to a second network device.
[0006] The type of the advertisement message and the manner of carrying the first indication information in the advertisement message may vary based on the network architecture and application scenario used to implement the method. For example, the advertisement message may be a Border Gateway Protocol (BGP) message for advertising a route, a Border Gateway Protocol-Link State (BGP-LS) message, an Interior Gateway Protocol (IGP) message, etc.
[0007] Different message types may be used in different scenarios. For example, in scenario A, the tunnel exit device may advertise the processing capability of the tunnel exit device to the tunnel entrance device by using a BGP message for advertising a route. As a result, when the tunnel exit device determines that it has the processing capability, the tunnel entrance device adds secondary path information for protecting the tunnel exit device to the packet to ensure that the tunnel exit device can perform adaptive processing on the secondary path information included in the received packet when the tunnel exit device is not broken. In another example, in scenario B, any network device on the packet forwarding path may notify the controller of the processing capability of the network device by using a BGP-LS message. As a result, when the corresponding network device determines that it has the processing capability, the controller compiles secondary path information associated with the network device to protect the network device or the service associated with the network device. In this way, the network device may perform adaptive processing on the secondary path information included in the received packet when the primary path on which the network device is located is not broken.
[0008] The adaptive processing performed on the secondary path information is ignoring the secondary path information. The specific case of ignoring processing may be that the first network device ignores the secondary path information and does not use the secondary path information to guide packet forwarding, or the first network device ignores the secondary path information and is allowed to remove the packet header from the packet, for example, when the secondary path information is included, so that the packet can be processed normally. There may be multiple specific operation methods for implementing ignoring, and the specific operation method may be determined with reference to a specific application scenario. For example, the ignoring method may be removing, and the removing may be removing the secondary path information by removing the entire packet header. This method is applicable to scenario A. As a tunnel egress node connected to the user side device, after the primary path information included in the packet header is matched, the first network device can completely remove the packet header from the packet, and complete the subsequent forwarding from the first network device to the user side device by using the private network information carried in the payload part of the packet. For another example, the ignoring manner may be skipping, where skipping may specifically be directly skipping the second path information without reading the secondary path information, or skipping the second path information in a manner that can be ignored even if the secondary path information is read and does not use the secondary path information to guide forwarding. When an associated device that needs to provide secondary route protection is an intermediate network device on a forwarding path, when deciding to use a primary route to forward a packet, the intermediate network device can use the primary path information to perform subsequent forwarding, and since a secondary route is not used, it needs to skip the secondary path information portion carried in the packet to avoid packet forwarding errors.
[0009] Performing ignoring does not mean that the first network device does not explicitly perform any operation on the secondary path information. For example, in some possible application scenarios or design manners, the first network device may first read the secondary path information and then ignore the secondary path information in a skip manner.
[0010] The primary path being unavailable may mean that the primary path is unavailable because a node or link on the primary path has failed, or it may mean that the primary path is unavailable because the quality of service of the primary path cannot meet requirements.
[0011] The secondary path information may be used to indicate one or more secondary paths. For example, the secondary path information is one or more secondary SIDs. One secondary SID may indicate one secondary path, or a secondary SID list including multiple SIDs may indicate one secondary path. If there are multiple available secondary paths, the secondary path information may include multiple secondary SIDs or secondary SID lists corresponding to the multiple secondary paths, respectively. An ordered sequence of multiple secondary SIDs or secondary SID lists in the packet header may be used to determine a sequence of using multiple secondary paths when the primary path is unavailable.
[0012] In this solution, the first network device can send an advertisement message carrying indication information, where the indication information can indicate whether the first network device has a processing capability to ignore the secondary path information included in the packet when the first network device serves as a network device on a primary path for forwarding a packet and receives a packet including the primary path information and the secondary path information. As a result, when determining that the first network device has the processing capability, the network device receiving the advertisement message can send or instruct another network device to send a service packet including the primary path information and the secondary path information to the first network device. Thus, when the primary path can be normally used, the first network device can ignore the secondary path information that does not need to be used in the service packet, ensuring network performance robustness and avoiding the problem of packet loss or inaccurate forwarding caused by improper processing on the secondary path information.
[0013] In a possible implementation, the method further includes a step of receiving a first packet, the first packet including first primary path information and first secondary path information, the first primary path information being used to indicate a first primary route for forwarding the first packet, and the first secondary path information being used to indicate one or more first secondary paths for forwarding the first packet when the first primary route is unavailable, and a step of ignoring the first secondary path information and forwarding the first packet based on the first primary path information.
[0014] After the first network device advertises the processing capability of the first network device to the second network device by using the message, if the second network device determines that the first network device has the processing capability, the second network device may transmit the first packet, or the second network device may instruct another network device to transmit the first packet. For example, if the second network device is a tunnel entrance device, the second network device may transmit the first packet. For another example, if the second network device is a controller having a service orchestration function, the controller may transmit a message including the primary path information and the secondary path information to the tunnel entrance device, and the tunnel entrance device transmits the first packet including the primary path information and the secondary path information. That is, the first packet may be received from the second network device, or may be received from another network device.
[0015] The first network device proactively advertises its processing capability, so that when receiving a first packet including the first primary path information and the first secondary path information, the first network device can ignore the first secondary path information that does not need to be used in the first packet to ensure successful forwarding of the first packet.
[0016] In a possible implementation, the first indication information is carried in a VPN route or a public route included in the BGP message, and the VPN route or the public route is a route for forwarding the service to which the packet belongs. The first network device may include indication information for advertising the processing capability of the first network device in the VPN route or the public route advertised by the first network device for transmission. The VPN route or the public route may include path information. After determining whether the first network device has the processing capability based on the indication information, the second network device receiving the VPN route or the public route may send the path information carried in the route as the primary path information or the secondary path information in the transmitted packet based on the determined specific situation.
[0017] Optionally, the first network device is a service-carrying egress network device, the VPN route is a Virtual Private Network (VPN) route, and the first indication information is carried in a first Virtual Private Network Segment Identifier (VPN SID) label field of the VPN route.
[0018] Optionally, the first indication information is carried in an extended community attribute in the BGP message.
[0019] The indication information is carried in the route. In this way, the first network device can cooperate with the existing mechanism to advertise processing capabilities and advertise path information in a related manner. As a result, the use compatibility and execution efficiency of the solution in this application are improved.
[0020] In a possible implementation, the first network device may not be the device that initially generates the BGP message based on the route that needs to be advertised, but may be a device that receives the BGP message and generates the BGP message by modifying the necessary information in the BGP message.
[0021] Optionally, the step of generating a BGP message includes the steps of receiving an unupdated BGP message, where the unupdated BGP message includes a second VPN SID label field of the VPN route, and replacing the second VPN SID label field with the first VPN SID label field to generate a BGP message through an update.
[0022] Optionally, the second VPN SID label field includes second indication information used to indicate a processing capability of the third network device, the processing capability of the third network device including a processing capability of the third network device acting as a network device on a primary path for forwarding a packet and ignoring secondary path information included in the packet when the third network device receives a packet including primary path information and secondary path information, and the third network device is a network device indicated in next hop information carried in a non-updated BGP message.
[0023] Optionally, the method further includes receiving an unupdated BGP message, where the unupdated BGP message includes a next hop attribute, both the first indication information in the extended community attribute and the next hop attribute include the first next hop information, and the first next hop information is used to indicate a third network device.
[0024] Optionally, the method further includes a step of modifying the first next hop information in the second extended community attribute to second next hop information for generating a BGP message through an update, the second next hop information being used to indicate the first network device.
[0025] Optionally, the step of generating the BGP message via an update further comprises the step of modifying the first next hop information in the extended community attribute to the second next hop information.
[0026] Optionally, using the first indication information to indicate a processing capability of the first network device comprises using the first indication information and the next hop attribute to indicate a processing capability of the first network device.
[0027] In a scenario where the next hop of a route needs to be modified, e.g., in an inter-domain scenario, the indication information updated in the route is used to indicate whether the network device identified by the modified next hop carried in the route (e.g., when the first network device acts as a domain border device) has the processing capability, ensuring that when the primary path is available in a cross-domain scenario, the first network device can ignore the secondary path information, so that the packet can be forwarded or processed normally.
[0028] In a possible implementation, the VPN route or the public route contained in the BGP message carries the SID, and the SID is used in the secondary path information carried in the packet received by the first network device.
[0029] In a possible implementation, the secondary path information includes one or more secondary path labels, and the one or more secondary paths are indicated by one or more secondary path labels. Optionally, the path labels include a SID.
[0030] When the secondary path information includes one or more secondary SIDs, the solutions provided in this application may be applied to an SRv6 network or a Segment Routing-Multiprotocol Label Switching (SR-MPLS) network.
[0031] In a possible implementation, the one or more secondary SIDs are SIDs assigned by one or more network devices having a multihoming relationship with the first network device, and the one or more secondary SIDs may be carried separately in routes advertised by the one or more network devices for advertising.
[0032] In a possible implementation, the first secondary path information includes one or more secondary SIDs, the first primary path information includes a primary SID, and the primary SID is associated with the first network device, and ignoring the first secondary path information and forwarding the first packet based on the first primary path information includes removing the one or more secondary SIDs by matching the primary SID with SIDs stored in the first network device, and forwarding the first packet to a user side network device based on payload information carried in the first packet, or forwarding the first packet based on the added SID after the one or more secondary SIDs are removed.
[0033] In a possible implementation, the first secondary path information includes one or more secondary SIDs, the first primary path information includes a primary SID, and the primary SID is associated with the first network device, and ignoring the first secondary path information and forwarding the first packet based on the first primary path information includes skipping the one or more secondary SIDs by matching the primary SID with SIDs stored in the first network device, and forwarding the first packet based on a SID located after the one or more secondary SIDs.
[0034] In a possible implementation, the first network device is a service-carrying intermediate network device or an egress network device, and the first indication information is carried in an IGP message or a BGP message for advertising a link state. The egress network device may be an egress network device of an end-to-end tunnel or an egress network device of a multi-segmented tunnel.
[0035] In a possible implementation, the second network device is a service-carrying controller or an ingress network device.
[0036] According to a second aspect, a method for advertising a processing capability of a network device is provided and is executed by a second network device, the method including the steps of receiving an advertisement message transmitted by a first network device, the advertisement message including first indication information, the first indication information being used to indicate a processing capability of the first network device, the processing capability of the first network device including a processing capability of the first network device to function as a network device on a primary path for forwarding a packet and to ignore secondary path information included in the packet when the first network device receives the packet including primary path information and secondary path information, the secondary path information being used to indicate one or more secondary paths for forwarding the packet when the primary path is unavailable, and determining, based on the first indication information, that the first network device has the processing capability or determining, based on the first indication information, that the first network device does not have the processing capability.
[0037] In this solution, after receiving the advertisement message carrying the indication information and sent by the first network device, the second network device can determine whether the first network device has processing capability based on the indication information. In some application scenarios, if the first network device determines that it has processing capability and serves as a network device on a primary path for forwarding packets, the second network device sends or instructs another network device (such as a tunnel entrance device) to send a packet including primary path information and secondary path information to the first network device, so that if the primary path can be normally used, the first network device can ignore the secondary path information that does not need to be used in the service packet, so as to ensure network performance robustness and avoid the problem of packet loss or inaccurate forwarding caused by improper processing on the secondary path information.
[0038] In a possible implementation, the method further includes a step of sending a first packet based on the fact that the first network device has the processing capability, the first packet carrying first secondary path information and first primary path information, the first primary path information being used to indicate a first primary path for forwarding the first packet, and the first secondary path information being used to indicate one or more first secondary paths for forwarding the first packet when the first primary path is unavailable, or a step of sending a first message to a third network device based on the fact that the first network device has the processing capability, the first message being used to instruct the third network device to obtain, based on the first message, the first secondary path information and the first primary path information carried in the first packet, and the first packet being a packet sent by the third network device to the first network device.
[0039] In a possible implementation, the step of determining that the first network device has the processing capability based on the first indication information includes the step of determining that the first network device has the processing capability based on the fact that the advertisement message sent by the first network device carries the first indication information. Optionally, the first network device is determined to have the processing capability based on the fact that the first indication information carried in the advertisement message sent by the first network device has a first value.
[0040] In a possible implementation, the advertisement message sent by the first network device is a BGP message or an IGP message.
[0041] In a possible implementation, the first indication information is carried in a VPN route or a public route included in the BGP message, and the VPN route or the public route is a route for forwarding the service to which the packet belongs.
[0042] Optionally, the first indication information is carried in a VPN route in the BGP message, and determining that the first network device has the processing capability based on the first indication information includes determining that the first network device has the processing capability based on the fact that the VPN route includes the first indication information.
[0043] Optionally, the first indication information is carried in an extended community attribute in the BGP message.
[0044] Optionally, the BGP message further includes a next hop attribute, and the next hop attribute carries next hop information used to indicate the first network device, and the step of determining that the first network device has the processing capability based on the first indication information includes the step of determining that the first network device has the processing capability based on the fact that the first indication information is the same as the next hop information carried in the next hop attribute, or the step of determining that the first network device does not have the processing capability based on the first indication information includes the step of determining that the first network device does not have the processing capability based on the fact that the first indication information is different from the next hop information carried in the next hop attribute.
[0045] In a possible implementation, before the step of transmitting the first packet, the method further includes a step of receiving an advertisement message sent by a fourth network device, where the advertisement message sent by the fourth network device includes second indication information, the second indication information is used to indicate a processing capability of the fourth network device, the processing capability of the fourth network device includes a processing capability of ignoring secondary path information included in the packet when the fourth network device functions as a network device on a primary path for forwarding the packet and receives a packet including the primary path information and the secondary path information, and the secondary path information is used to indicate one or more secondary paths for forwarding the packet when the primary path is unavailable.
[0046] In this solution, the second network device can separately receive multiple advertisement messages from multiple network devices for packet forwarding. In this way, the processing capabilities of the multiple network devices can be separately determined based on the multiple advertisement messages, and one network device having processing capabilities in the network devices is determined as a primary device based on the processing capabilities of the multiple network devices, thereby improving the flexibility and reliability of using this solution.
[0047] In a possible implementation, the advertisement message sent by the first network device further includes first path information, and the advertisement message sent by the fourth network device further includes second path information. And before sending the first packet or the first message to the first network device, the method includes: determining that the first network device is a primary device and the fourth network device is a secondary device based on the advertisement message sent by the first network device and the advertisement message sent by the fourth network device; and adding the first path information and the second path information to generate a first packet, where the first path information belongs to the first primary path information and the second path information belongs to the first secondary path information; or sending a first message including the first path information and the second path information to the third network device to instruct the third network device to include the first path information and the second path information in the first packet, where the first path information belongs to the first primary path information and the second path information belongs to the first secondary path information.
[0048] In a possible implementation, the first path information includes a first VPN SID label assigned by the first network device, and the second path information includes a second VPN SID label assigned by the fourth network device.
[0049] In a possible implementation, the method further includes a step of transmitting a second packet based on the fact that the first network device does not have processing capability, where the second packet carries second primary path information but does not carry second secondary path information, the second primary path information is used to indicate a second primary path for forwarding the second packet, and the second secondary path information is used to indicate one or more second secondary paths for forwarding the second packet when the second primary path is unavailable.
[0050] In this solution, if the first network device determines that it does not have the processing capability, the second network device can send or instruct another network device to send packets that do not include secondary path information to at least ensure successful forwarding or processing of the packets in a scenario where the primary path has not failed.
[0051] In a possible implementation, the first network device is an egress network device of a tunnel or an intermediate network device of a tunnel, and the second network device is a controller or an ingress network device of the tunnel.
[0052] In a possible implementation, the first network device is an exit network device of a first tunnel between the first network device and the second network device, the fourth network device is an exit network device of a second tunnel between the fourth network device and the second network device, and the second network device is an entrance network device of the first tunnel and the second tunnel.
[0053] In a possible implementation, the first tunnel and the second tunnel are SRv6 tunnels or SR-MPLS tunnels, respectively.
[0054] According to a third aspect, the present application provides an apparatus for advertising processing capabilities of a network device, the apparatus may include functional units configured to perform a method for advertising processing capabilities of a network device according to the first aspect or any one of the optional manners of the first aspect.
[0055] For example, the apparatus may include a generating unit and a sending unit. The generating unit is configured to generate an advertisement message, where the advertisement message includes first indication information, the first indication information is used to indicate a processing capability of the first network device, the processing capability of the first network device includes a processing capability of ignoring the secondary path information when the first network device acts as a network device on a primary path for forwarding a packet and receives a packet including the primary path information and the secondary path information, and the secondary path information is used to indicate one or more secondary paths for forwarding the packet when the primary path is unavailable. The sending unit is configured to send the advertisement message to the second network device.
[0056] In this solution, the first network device can send an advertisement message carrying indication information, where the indication information can indicate whether the first network device acts as a network device on a primary path for forwarding a packet and has a processing capability to ignore the secondary path information included in the packet when receiving a packet including the primary path information and the secondary path information, so that the network device receiving the advertisement message can send or instruct another network device to send a service packet including the primary path information and the secondary path information to the first network device when it determines that the first network device has the processing capability. Thus, when the primary path can be normally used, the first network device can ignore the secondary path information that does not need to be used in the service packet, so as to ensure network performance robustness and avoid the problem of packet loss or inaccurate forwarding caused by improper processing on the secondary path information.
[0057] In a possible implementation, the apparatus further includes a receiving unit and a forwarding unit. The receiving unit is configured to receive a first packet sent by the second network device, where the first packet includes first primary path information and first secondary path information, the first primary path information is used to indicate a first primary route for forwarding the first packet, and the first secondary path information is used to indicate one or more first secondary routes for forwarding the first packet when the first primary route is unavailable. The forwarding unit is configured to ignore the first secondary path information and forward the first packet based on the first primary path information.
[0058] In a possible implementation, the advertisement message is a Border Gateway Protocol (BGP) message or an Interior Gateway Protocol (IGP) message.
[0059] In a possible implementation, the first indication information is carried in a VPN route or a public route included in the BGP message, and the VPN route or the public route is a route for forwarding the service to which the packet belongs.
[0060] Optionally, the first network device is an egress network device carrying the service, the VPN route is a VPN route, and the first indication information is carried in a first virtual private network segment identifier VPN SID label field of the VPN route.
[0061] Optionally, the receiving unit is further configured to receive an unupdated BGP message, where the unupdated BGP message includes a second VPN SID label field of the VPN route, and replace the second VPN SID label field with the first VPN SID label field to generate a BGP message through updating.
[0062] Optionally, the second VPN SID label field includes second indication information used to indicate a processing capability of the third network device, the processing capability of the third network device including a processing capability of the third network device acting as a network device on a primary path for forwarding a packet, and ignoring secondary path information included in the packet when the third network device receives a packet including primary path information and secondary path information, and the third network device is a network device indicated in next hop information carried in the unupdated BGP message.
[0063] Optionally, the first indication information is carried in an extended community attribute in the BGP message.
[0064] Optionally, before the BGP message is generated, the receiving unit is further configured to receive an unupdated BGP message, where the unupdated BGP message includes a next hop attribute, where both the first indication information in the extended community attribute and the next hop attribute include the first next hop information, and the first next hop information is used to indicate the third network device.
[0065] Optionally, the step of generating the BGP message includes a step of modifying the first next hop information in the next hop attribute to second next hop information, where the second next hop information is used to indicate the first network device, for generating the BGP message through an update.
[0066] Optionally, the step of generating the BGP message through an update further includes the step of modifying the first next hop information in the extended community attribute to the second next hop information.
[0067] Optionally, the first indication information being used to indicate a processing capability of the first network device includes the first indication information and the second extended community attribute being used to indicate a processing capability of the first network device.
[0068] In a possible implementation, the VPN route or the public route contained in the BGP message carries the SID, and the SID is used in the secondary path information carried in the packet received by the first network device.
[0069] In a possible implementation, the secondary path information includes one or more secondary path labels, and the one or more secondary paths are indicated by the one or more secondary path labels. Optionally, the path labels include a SID.
[0070] In a possible implementation, the one or more secondary SIDs are SIDs assigned by one or more network devices that have a multihoming relationship with the first network device.
[0071] In a possible implementation, the first secondary path information includes one or more secondary SIDs, the first primary path information includes a primary SID, and the primary SID is associated with the first network device. The forwarding unit is further configured to remove the one or more secondary SIDs by matching the primary SID with a SID stored in the first network device, and forward the first packet to a user-side network device based on payload information carried in the first packet, or forward the first packet based on an SID added after the one or more secondary SIDs are removed.
[0072] In a possible implementation, the first secondary path information includes one or more secondary SIDs, the first primary path information includes a primary SID, and the primary SID is associated with the first network device. The forwarding unit is further configured to ignore the one or more secondary SIDs by matching the primary SID with a SID stored in the first network device, and forward the first packet based on a SID located after the one or more secondary SIDs.
[0073] In a possible implementation, the first network device is a service-carrying intermediate network device or an egress network device, and the first indication information is carried in an IGP message or a BGP message for advertising a link state.
[0074] In a possible implementation, the second network device is a service-carrying controller or an ingress network device.
[0075] According to a fourth aspect, the application provides an apparatus for advertising processing capabilities of a network device, the apparatus may include functional units configured to perform a method for advertising processing capabilities of a network device according to the second aspect or any one of the optional schemes of the second aspect.
[0076] For example, the apparatus may include a receiving unit and a determining unit. The receiving unit is configured to receive an advertisement message sent by a first network device, where the advertisement message includes first indication information, the first indication information is used to indicate a processing capability of the first network device, the processing capability of the first network device includes a processing capability of the first network device to function as a network device on a primary path for forwarding a packet and to ignore the secondary path information when the first network device receives a packet including the primary path information and the secondary path information, and the secondary path is one or more secondary paths for forwarding the packet when the primary path is unavailable. The determining unit is configured to determine, based on the first indication information, that the first network device has the processing capability, or to determine, based on the first indication information, that the first network device does not have the processing capability.
[0077] In this solution, after receiving the advertisement message carrying the indication information and sent by the first network device, the second network device can determine whether the first network device has processing capability according to the indication information. In some application scenarios, when the first network device determines that it has processing capability and serves as a network device on a primary path for forwarding packets, the second network device sends or instructs another network device (such as a tunnel entrance device) to send packets including primary path information and secondary path information to the first network device, so that when the primary path can be normally used, the first network device can ignore the secondary path information that does not need to be used in the service packet, so as to ensure network performance robustness and avoid problems of packet loss or inaccurate forwarding caused by improper processing on the secondary path information.
[0078] In a possible implementation, the apparatus further includes a sending unit, the sending unit being configured to send a first packet based on the fact that the first network device has a processing capability, where the first packet carries first secondary path information and first primary path information, the first primary path information is used to indicate the first primary path for forwarding the first packet, and the first secondary path information is used to indicate one or more first secondary paths for forwarding the first packet when the first primary path is unavailable, or the sending unit being configured to send a first message to a third network device based on the fact that the first network device has a processing capability, where the first message is used to indicate to the third network device to obtain the first secondary path information and the first primary path information carried in the first packet based on the first message, and the first packet is a packet sent by the third network device to the first network device.
[0079] In a possible implementation, the determining unit is further configured to determine that the first network device has the processing capability based on the fact that the advertisement message sent by the first network device carries first indication information. Optionally, the first network device is determined to have the processing capability based on the fact that the first indication information carried in the advertisement message sent by the first network device has a first value.
[0080] In a possible implementation, the advertisement message sent by the first network device is a BGP message or an IGP message.
[0081] In a possible implementation, the first indication information is carried in a VPN route or a public route included in the BGP message, and the VPN route or the public route is a route for forwarding the service to which the packet belongs.
[0082] Optionally, the first indication information is carried in a VPN route in a BGP message, and the determining unit determining that the first network device has the processing capability based on the first indication information includes determining that the first network device has the processing capability based on the fact that the VPN route includes the first indication information.
[0083] Optionally, the first indication information is carried in an extended community attribute in the BGP message.
[0084] Optionally, the BGP message further includes a next hop attribute, and the next hop attribute carries next hop information used to indicate the first network device. The determining unit's determining that the first network device has the processing capability based on the first indication information includes determining that the first network device has the processing capability based on the fact that the first indication information is the same as the next hop information carried in the next hop attribute. Alternatively, the determining unit's determining that the first network device does not have the processing capability based on the first indication information includes determining that the first network device does not have the processing capability based on the fact that the first indication information is different from the next hop information carried in the next hop attribute.
[0085] In a possible implementation, before the first packet or the first message is transmitted, the receiving unit is further configured to receive an advertisement message transmitted by a fourth network device, where the advertisement message transmitted by the fourth network device includes second indication information, the second indication information is used to indicate a processing capability of the fourth network device, the processing capability of the fourth network device includes a processing capability to ignore secondary path information included in the packet when the fourth network device functions as a network device on a primary path for forwarding the packet, and the secondary path information is used to indicate one or more secondary paths for forwarding the packet when the primary path is unavailable.
[0086] Optionally, the advertisement message sent by the first network device further includes first path information, and the advertisement message sent by the fourth network device further includes second path information, and before the first packet or the first message is sent, the determining unit is further configured to determine that the first network device is a primary device and the fourth network device is a secondary device based on the advertisement message sent by the first network device and the advertisement message sent by the fourth network device. The apparatus further includes a generating unit. The generating unit is configured to add the first path information and the second path information to generate a first packet, where the first path information belongs to the first primary path information, and the second path information belongs to the first secondary path information. Alternatively, the sending unit sends the first message including the first path information and the second path information to the third network device to instruct the third network device to include the first path information and the second path information in the first packet. , where the first path information belongs to the first primary path information, and the second path information belongs to the first secondary path information.
[0087] Optionally, the first path information includes a first virtual private network segment identifier (VPN SID) label assigned by the first network device, and the second path information includes a second VPN SID label assigned by the fourth network device.
[0088] In a possible implementation, after the determining unit determines that the first network device does not have the processing capability based on the first indication information, the sending unit is further configured to send a second packet based on the fact that the first network device does not have the processing capability, where the second packet carries second primary path information but does not carry second secondary path information, the second primary path information is used to indicate a second primary route for forwarding the second packet, and the second secondary path information is used to indicate one or more second secondary routes for forwarding the second packet when the second primary route is unavailable.
[0089] In a possible implementation, the first network device is an egress network device of a tunnel or an intermediate network device of a tunnel, and the second network device is a controller or an ingress network device of the tunnel.
[0090] In a possible implementation, the first network device is an exit network device of a first tunnel between the first network device and the second network device, the fourth network device is an exit network device of a second tunnel between the fourth network device and the second network device, and the second network device is an entrance network device of the first tunnel and the second tunnel.
[0091] In a possible implementation, the first tunnel and the second tunnel are SRv6 tunnels or SR-MPLS tunnels, respectively.
[0092] According to a fifth aspect, a first network device is provided. The network device includes a processor. The processor calls program instructions to enable the network device to perform the operations performed in the method according to the first aspect or any one of the implementations of the first aspect. The network device may further include a memory. The memory is coupled to the processor, and the program instructions called by the processor are stored in the memory. The network device may further include a communication interface. The communication interface is used by the device to communicate with another device. For example, the communication interface may be a transceiver, a circuit, a bus, a module, or another type of communication interface. The program instructions called by the processor may alternatively be pre-stored in an external memory and downloaded from the Internet and then stored locally before being used. The source of the instructions in the memory is not uniquely limited in this application.
[0093] According to a sixth aspect, a second network device is provided. The storage network device includes a processor. The processor calls program instructions to enable the network device to perform the operations performed in the method according to the second aspect or any one of the implementations of the second aspect. The network device may further include a memory. The memory is coupled to the processor, and the program instructions called by the processor are stored in the memory. The network device may further include a communication interface. The communication interface is used by the device to communicate with another device. For example, the communication interface may be a transceiver, a circuit, a bus, a module, or another type of communication interface. The program instructions called by the processor may alternatively be pre-stored in an external memory and downloaded from the Internet and then stored locally before being used. The source of the instructions in the memory is not uniquely limited in this application.
[0094] According to a seventh aspect, there is provided a system for advertising processing capabilities of a network device, the system may include one or more network devices as described in the fifth aspect and one or more network devices as described in the sixth aspect.
[0095] According to an eighth aspect, there is provided a chip system, the chip system including a processor and an interface circuit, the interface circuit configured to receive instructions and transmit instructions to the processor, the processor configured to execute instructions corresponding to the method according to the first aspect or any one of the optional manners of the first aspect, or configured to execute instructions corresponding to the method according to the second aspect or any one of the optional manners of the second aspect.
[0096] According to a ninth aspect, there is provided a computer readable storage medium having stored thereon program code which, when loaded and executed by a processor, enables the computer to perform the operations performed in the method according to the first aspect or any one of the optional manners of the first aspect, or enables the computer to perform the operations performed in the method according to the second aspect or any one of the optional manners of the second aspect.
[0097] According to a tenth aspect, a computer program product or computer program is provided, the computer program product or computer program including a program code, when the computer program product or computer program is executed on a network device, the network device is capable of performing a method according to the first aspect or any one of various optional implementations of the first aspect, or the network device is capable of performing a method according to the second aspect or any one of various optional implementations of the second aspect.
[0098] For the technical effects provided by any of the designs of the third to tenth aspects, please refer to the technical effects provided by the corresponding designs of the first or second aspects. The deegresses will not be described again here. [Brief description of the drawings]
[0099] In order to more clearly describe the technical solutions in the embodiments of this application, the following briefly describes the accompanying drawings required for describing the embodiments. The accompanying drawings in the following description merely illustrate some embodiments of this application, and it is obvious that a person skilled in the art can further derive other drawings from these accompanying drawings without creative efforts. [Figure 1a] FIG. 1a is a schematic diagram of the structure of a network system for implementing service traffic forwarding according to one embodiment of the present application. [Figure 1b] FIG. 1b is a schematic diagram of the structure of another network system for implementing service traffic forwarding according to one embodiment of the present application. [Diagram 2] FIG. 2 is a schematic diagram of the structure of another network system for implementing service traffic forwarding according to one embodiment of the present application. [Figure 3a] FIG. 3a is a schematic diagram of a message format according to one embodiment of the present application. [Figure 3b] FIG. 3b is a schematic diagram of another message format according to one embodiment of the present application. [Figure 4] FIG. 4 is a flow chart of a method for advertising processing capabilities of a network device according to one embodiment of the present application. [Diagram 5] FIG. 5 is a flowchart of another method for advertising processing capabilities of a network device according to an embodiment of the present application. [Figure 6]FIG. 6 is a flowchart of another method for advertising processing capabilities of a network device according to an embodiment of the present application. [Figure 7] FIG. 7 is a schematic diagram of the structure of an apparatus for advertising processing capabilities of a network device according to one embodiment of the present application. [Figure 8] FIG. 8 is a schematic diagram of the structure of another apparatus for advertising processing capabilities of a network device according to one embodiment of the present application. [Figure 9] FIG. 9 is a schematic diagram of the structure of a network device according to one embodiment of the present application. [Figure 10] FIG. 10 is a schematic diagram of the structure of a network device according to one embodiment of the present application. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0100] To make the objectives, technical solutions and advantages of the present application clearer, the following further describes the implementation of the present application with reference to the accompanying drawings.
[0101] In order to ensure normal forwarding of service traffic in a data bearer network, a policy for primary / secondary protection is usually required to be configured for key nodes included in a traffic transmission route, so as to avoid service interruption directly caused when a key node fails. In an SRv6 network, in a feasible way to implement primary / secondary protection of a node, both a primary SID pointing to a primary node and one or more secondary SIDs pointing to one or more secondary nodes may be included in a traffic packet, so that the secondary node forwards the traffic packet in a scenario where the primary node fails. For ease of understanding, some possible application scenarios of implementing primary / secondary protection by using primary / secondary SIDs are first described in an embodiment of the present invention.
[0102] Scenario 1: Egress protection
[0103] In a scenario where SRv6 technology is used to carry VPN services, when an egress node serving as an egress device of an SRv6 tunnel fails, the service traffic cannot be forwarded to a user-side device through the egress node. As a result, the service is interrupted. To ensure the successful forwarding of the service traffic in the aforementioned case, a secondary egress node can be deployed to implement egress protection.
[0104] FIG. 1a illustrates a system 100 for implementing service traffic forwarding in an SRv6 network according to one embodiment of the present invention. The system 100 may include the following devices: customer edge (CE) 11, CE 12, provider edge (PE) 21, PE 24, PE 25, provider (P) (backbone) 31, and P 32. CE 11 is connected to PE 21, and CE 12 is dual-homed to PE 24 and PE 25. CE 11 and CE 12 may be separately connected to multiple user hosts on the user side. CE 11 or CE 12 may be directly connected to multiple user hosts or may be connected to multiple user hosts via another user side network device. For example, CE 11 forwards service packets of the user host connected to CE 11 to CE 12. In a normal forwarding scenario, PE21 can send a service packet to PE24 serving as a remote primary device, so as to forward the service packet to CE12 via PE24. However, in a scenario where PE24 is faulty, when the service packet arrives at P31, P31 as a network device directly connected to PE24 can quickly sense that the route of PE24 is unreachable. In this case, if P31 can forward the service packet to PE25 in a certain manner, PE25 serves as a remote secondary PE forming a dual-homing device with PE24, i.e., can forward the service packet to CE12 when PE24 is faulty. In the above description, the device directly connected to PE24 senses the device failure, and directly adjusts the implementation of the packet forwarding path to solve the problem of packet loss caused when the service packet cannot be forwarded normally in a scenario where PE24 is faulty. Since a device playing a role such as PE24 is usually located at the exit of a packet transmission tunnel, the mechanism described above may also be referred to as an exit protection mechanism.
[0105] In a feasible solution for implementing egress protection in an SRv6 network, an ingress node of a packet transmission tunnel can add an instruction to path information to guide packet forwarding, so that a previous hop node on the route can forward packets to a secondary node based on the instruction when it detects a failure of an egress node. In this scenario, the ingress node may also be called a head node. The system 100 shown in FIG. 1a is still used as an example. PE24 and PE25 separately learn a route that is advertised by CE12 and used to forward packets of VPN service, which is referred to as VPN route for short here. The destination address of the VPN route may be, for example, an address of a user host connected to CE12, or an address of a destination network segment connected to CE12. For example, the destination address of the VPN route is 2.2.2.2. PE24 assigns a VPN segment identifier (SID) B2::1 to identify the VPN service, includes the VPN segment identifier B2::1 in a VPN route, and advertises the VPN route to PE21. Similarly, PE25 assigns a VPN SID B3::1 to identify the VPN service, includes the VPN SID B3::1 in a VPN route, and advertises the VPN route to PE21. PE21 receives a service packet sent from CE11 to destination address 2.2.2.2, and adds packet header information to the service packet. The packet header information is used to guide forwarding of the service packet within the tunnel. The packet header information may include an Internet Protocol version 6 (IPv6) header and a segment routing header (SRH).To implement the egress protection function, PE21 adds both VPN SID B2::1 advertised by PE24 and VPN SID B3::1 advertised by PE25 to the segment list (SL) included in the SRH, where B3::1 is located at the bottom of the stack closer to the SL label stack than B2::1. That is, when the service packet passes through the tunnel, B2::1 in the SL can be read earlier than B3::1. In this way, when the service packet arrives at P31, P31 first displays the SID label A5::1 from the label stack included in the received service packet, because A5::1 matches the node SID locally assigned and advertised by P31. Then, P31 reads the lower-layer label B2::1 of the label stack, where B2::1 is the VPN SID advertised by the primary device PE24. When PE24 is down, P31 can quickly sense that the route of B2::1 is unreachable. In this case, P31 can skip the label, read the lower layer label B3::1, and decide to forward the service packet to PE25 by searching the route of B3::1. When the service packet arrives at PE25, because B3::1 is the stack bottom label of the label stack, PE25 can display the stack bottom label, and determine the corresponding VPN service based on the VPN SID B3::1, and complete the user side forwarding procedure of the service packet in the VPN identified by B3::1.
[0106] FIG. 1b illustrates another system 110 for implementing service traffic forwarding in an SRv6 network according to one embodiment of the present invention. In this system, PE21, PE24, and PE25 are nodes in the same network domain, which may be, for example, the same autonomous (AS) domain. In addition, as domain boundary nodes, PE24 and PE25 are connected to a node PE27 in another AS domain, which is connected to a user-side network node CE12 and communicates with a user host mounted on CE12. Since an inter-domain scenario is included, in a possible implementation, Tunnel A may be established between PE21 and PE24, and Tunnel B may be established between PE24 and PE27 (wherein FIG. 1b does not show one or more intermediate nodes included in Tunnel B). Tunnel A and Tunnel B may form an end-to-end tunnel from the ingress node PE21 to the egress node PE27. Tunnel A and Tunnel B may each be referred to as a multi-segmented tunnel. PE21 may also be referred to as the head node of Tunnel A, and PE24 may be referred to as the exit node of Tunnel A. PE27 uses a BGP message to advertise a VPN route with destination address 2.2.2.2 to PE24. For an inter-domain scenario, in some possible implementations, after receiving the BGP message, PE24 needs to modify the next hop attribute in the BGP message to the device identifier of PE24, for example, the loop back address or an interface Internet Protocol (IP) address of PE24. In some possible implementations, when modifying the next hop information in the BGP message, PE24 further reassigns the corresponding VPN SIDB7::1 to the VPN route carried in the BGP message. After updating the BGP message, PE24 advertises the updated BGP message to PE21.
[0107] In a normal forwarding scenario, PE21 chooses to forward the packet to inter-domain device PE27 via PE24. When PE24 modifies the next hop in the BGP message and reassigns the VPN SID to the VPN route carried in the BGP message, PE24 detects that PE21 is the next hop device bearing the VPN service instead of PE27. Therefore, PE21 adds the VPN SID B7::1 assigned by PE24 to the SL label stack to guide the forwarding. When the packet arrives at PE24, PE24 can look up the SID list corresponding to the VPN SID based on the fact that the SID value carried in the destination address (DA) field included in the packet header matches the value of the VPN SID stored locally at PE24, and add the SID list to the packet header of the packet to guide the subsequent forwarding of the packet in the next network domain. The SID list may include multiple SIDs, and the multiple SIDs are used to indicate the forwarding path from PE24 to PE27.
[0108] In order to avoid service traffic interruption caused when the egress node PE24 fails, a backup device PE25 of PE24 may be configured in the network. In this way, when the primary node PE24 fails, the PE25 acting as a secondary node forwards the service traffic at the user side to PE27, so that egress protection is implemented. To implement the aforementioned function, the PE21 as an ingress may add an instruction to the path information to guide packet forwarding, so that the previous hop node P31 on the path may forward the packet to the secondary node PE25 based on the instruction when it senses the failure of the egress node. The PE21 may add the VPN SID B7::1 allocated and advertised by PE24 and the VPN SID B9::1 allocated and advertised by PE25 to the segment list, where B9::1 is located at the stack bottom closer to the SL label stack than B7::1. That is, when the service packet passes through the tunnel, B7::1 in the SL may be read earlier than B9::1. When PE24 fails, P31 can quickly sense that the route of B7::1 is unreachable. In this case, P31 can decide to forward the service packet to PE25 by skipping the label, reading the lower layer label B9::1, and searching for the route of B9::1. When the service packet arrives at PE25, PE25 can look up the locally stored SID list corresponding to B9::1 based on B9::1, and add the SID list to the path information to guide the packet forwarding to indicate the subsequent forwarding of the packet to PE27.
[0109] Scenario 2: Service protection
[0110] FIG. 2 illustrates a system 120 for implementing a service chain in an SRv6 network according to an embodiment of the present invention. The service orchestrator 41 can acquire various types of SIDs advertised by PE nodes within an administrative domain. For example, the service orchestrator 41 can acquire SIDs of service types including S1::1 and S2::1 from the PE22. Here, S1::1 may be used to instruct the PE22 to send the service packet to the firewall 51 for cleaning to perform attack filtering, and S2::1 is used to instruct the PE22 to send the service packet to the firewall 52 for cleaning. That is, in a traffic cleaning scenario, S1::1 may be used to indicate a primary path for forwarding the packet, and S1::2 may be used to indicate a secondary path for forwarding the packet. In another example, the service orchestrator 41 can alternatively acquire SIDs of node types from the PE23 or the PE26. Here, A5::1 is used to indicate PE23, and A7::1 is used to indicate PE26. In another example, the service orchestrator 41 can alternatively obtain a node type SID (A9::1) or a VPN type SID (B2::1) from the PE28. The service orchestrator 41 can use the corresponding type SID to adjust the path based on the difference between the services that need to be carried by the PE28. In a possible example, A9::1 can be used to guide the forwarding of public network service packets, and B2::1 can be used to guide the forwarding of private network VPN service packets.
[0111] In a normal forwarding scenario, the firewall 51 acting as a primary device provides cleaning services for traffic packets. However, to avoid traffic interruption when the firewall 51 is down, the firewall 52 may also be deployed as a secondary device to provide cleaning services. The service orchestrator 41 may organize path information for forwarding traffic from the PE21 to the PE28, and send the organized path information to the head node to instruct the PE21 to add the path information to the packet and guide the forwarding of the packet. In an SRv6 network, the path information may be an SL including multiple SIDs. To protect a service such as traffic cleaning, the service orchestrator 41 may add both S1::1 and S2::1 to the distributed path information. In this way, when a traffic packet is forwarded to the PE22 and the PE22 finds that the firewall 51 is down, the PE22 may ignore the currently indicated S1::1 in the SL and read the next SID S2::1 in the SL, and guide the traffic packet to be forwarded to the firewall 52 for cleaning based on S2::1. After cleaning is complete, the traffic packet is returned to PE22 and may be forwarded to PE28 via PE23 based on the indication of the subsequent SID in the SL.
[0112] The above scenarios 1 and 2 respectively mainly describe an implementation method in which both a primary SID and a secondary SID are carried in a packet in an SRv6 network, and when the path indicated by the primary SID is broken, the primary SID is skipped, and the packet is forwarded based on the secondary path indicated by the next secondary SID. It will be understood that scenarios 1 and 2 are merely used as one possible example, and similar implementations are also applicable to other possible network architectures and application scenarios. For example, a similar method can be applied to protect intermediate nodes on the forwarding path. The network scenario shown in FIG. 2 is used as one example. When cleaning traffic, if it is considered that the PE22 connected to the firewall 51 capable of providing cleaning services is also broken, the cleaning service cannot be used for the traffic, and the traffic may be blocked. In this case, a secondary PE node may be deployed for the PE22. Here, the secondary PE node is also connected to a firewall that can provide cleaning services, so that when PE21 finds that PE22 acting as a primary node is down, PE21 can directly forward traffic packets to the secondary PE node for cleaning based on the secondary SID of the service type orchestrated by the service orchestrator 41 and assigned by the secondary PE node. In this way, the intermediate node PE22 is protected and the success of traffic cleaning is also guaranteed. For another example, in scenarios 1 and 2, one secondary SID is used as the secondary path information. In another scenario, multiple optional secondary paths can also be provided by using multiple secondary SIDs as the secondary path information. Alternatively, the secondary path information does not necessarily have to be in the form of a SID, but is another type of path label or is directly represented in another format.In another example, both the primary SID used to indicate the primary path and the secondary SID used to indicate the secondary path may be of various types. For example, the SID may be used to indicate a node on the route, to indicate a link on the route, to indicate a service, or to indicate a route that includes multiple hops of nodes. As another example, in addition to being applied to node protection or service protection, the method may also be applied to other service scenarios where primary / secondary protection needs to be implemented. In another example, in addition to being applied to SRv6 networks, a similar implementation method may also be applied to other types of networks. In possible cases, when SR technology is applied to a Multiprotocol Label Switching (MPLS) data plane, a similar implementation scheme may be applied to a Segment Routing-Multiprotocol Label Switching (SR-MPLS) network. In an SRv6 network, the primary SID and the secondary SID may be encapsulated into the SRH of the IPv6 extension header. In an SR-MPLS network, the primary SID and the secondary SID may be encapsulated into the MPLS packet header.
[0113] In the scenarios 1 and 2 described in the above embodiments, the solution is mainly described in which the secondary path is used to implement protection when the primary path is down. However, during practical application, when the primary path is not down, the traffic packets still need to be forwarded through the primary path. In this case, the nodes on the primary path need to know that the secondary path information carried in the packet does not need to be used, and perform corresponding processing, such as removing or skipping, to avoid discarding the packet because the secondary path information cannot be correctly parsed.
[0114] Further, with reference to the scenario described in FIG. 1a, a method of processing the SL label stack by PE24 when the egress node PE24 is not faulty will be described. In the scenario where the egress node is not faulty, PE24 normally receives the service packet forwarded by P31. The SL label stack of the received service packet contains two layers of labels: B3::1 at the bottom of the stack, and B2::1 above B3::1 in the label stack. After receiving the packet, PE24 can determine that the SID B2::1 carried in the DA field of the packet header matches the VPN SID locally assigned by PE24. In this case, PE24 further determines that the SID at the currently indicated position in the SRH is also B2::1. If no secondary SID is added, B2::1 is the stack bottom label of the SRH. In the conventional forwarding solution based on SRv6, since B2::1 is located at the bottom of the stack, PE24 can strip the outer packet header (i.e., the packet header portion including the IPv6 header and the SRH header shown in FIG. 1a) and forward the service packet to the user side based on the destination address 2.2.2.2 of the service packet included in the inner payload information. However, in the implementation solution of egress protection in scenario 1 provided in the embodiment of the present invention, B2::1 is no longer the bottom label of the stack. When B3::1 cannot be correctly processed according to the existing forwarding rules of the SRv6 network, PE24 performs an operation of reporting an error or discarding the service packet. Therefore, in order to ensure the normal forwarding of the service packet in the egress protection solution, PE24 needs to perform special processing on the label stack. That is, when B2::1 matches the local SID forwarding table, B3::1 at the bottom of the stack is allowed to be removed together with B2::1.
[0115] In order to ensure the normal forwarding of service packets in an egress protection scenario, an embodiment of the present invention provides a method 400 for an egress node (e.g., PE24 shown in FIG. 1a) in an SRv6 network to advertise to a head node whether the egress node has the above-mentioned special processing capability. When the head node determines that a node that needs to be used as a primary egress node has special processing capability, the head node can add a service label, for example, a VPN SID used to identify a VPN service, assigned by the primary egress node and the secondary egress node to the service packet to cooperate in executing an egress protection solution of the network system. FIG. 4 shows a method for advertising the processing capability of an egress node. The method can be implemented in the network system shown in FIG. 1a or FIG. 1b. The method may include the following steps.
[0116] S401: An egress node generates an advertisement message, where the advertisement message includes indication information, and the indication information is used to indicate that the egress node can ignore a secondary SID carried in a packet and used to implement egress protection.
[0117] The egress node PE24 may generate indication information. Here, the indication information is used to advertise to the head node PE21 whether the PE24 functioning as an egress node has the aforementioned processing capability of ignoring the secondary SID in the service packet in the egress protection scenario. For ease of explanation, this capability is hereinafter referred to as processing capability for short. The indication information may be carried in an advertisement message and transmitted to the head node PE21. In a possible implementation, the PE24 determines whether the PE24 has processing capability based on different content carried in the indication information. Specifically, if the content included in the indication information is A, it indicates that the PE24 has processing capability, or if the content included in the indication information is B, it indicates that the PE24 does not have processing capability. In another possible implementation, the PE24 advertises processing capability according to whether the indication information is carried. Specifically, if the advertisement message includes indication information, it indicates that the PE24 has processing capability, or if the advertisement message does not include indication information, it indicates that the PE24 does not have processing capability. Regardless of the implementation, if the advertisement message sent by PE24 includes indication information, the indication information may be used independently to indicate the processing capabilities of PE24 or may be used together with other information carried in the advertisement message to indicate the processing capabilities of PE24.
[0118] The egress protection solution in the same AS domain described in Fig. 1a is used as an example. In a possible advertisement manner, the advertisement message may be a Border Gateway Protocol (BGP) message. In an SRv6 network, the PE24 may advertise the VPN SID label of the VPN route by using a BGP message. As shown in Fig. 3a, the information related to the VPN SID may be carried in a segment identifier information type-length-value (SID information TLV) field in the BGP message. This field is a subtype-length-value (TLV) field in the BGP message. To advertise the processing capability of the PE24, a subfield may be added to the SID information TLV field. The subfield may also be a TLV type. Since this subfield belongs to a subfield in the SID information TLV field that is used as a sub-TLV, it may be referred to as a sub sub TLV field. The type field of the sub-sub TLV may be used to identify that the type of the sub-sub TLV is a sub-sub TLV for advertising egress protection capabilities. The value field of the sub-sub TLV includes indication information used to indicate the processing capabilities of the PE 24, where the length of the value field is indicated by the length field of the sub-sub TLV. In a possible implementation, the length of the value field of the sub-sub TLV may be 1 bit. In this case, it may be configured such that when the value field of the sub-sub TLV is 1, it indicates that the PE 24 has the processing capabilities, and when the value field of the sub-sub TLV is 0, it indicates that the PE 24 does not have the processing capabilities.The implementation with a length of 1 bit is used only as an example, and another length may be alternatively set based on requirements to meet necessary format requirements or to advertise more subdivisions. In this implementation, whether PE24 has processing capability or not, PE24 needs to know that its capability status can be advertised by adding a sub-sub TLV. However, in one possible case, PE24 does not have processing capability, so PE24 does not know that it needs to add a sub-sub TLV to advertise that PE24 does not have processing capability. Therefore, in another possible implementation, PE24 may add a sub-sub TLV when PE24 has processing capability, and PE24 skips adding a sub-sub TLV containing indication information of without sense or with sense when PE24 does not have processing capability. Skipping the addition of the meaningful sub-sub-LTV means that PE24 knows that PE24 needs to add the sub-sub-TLV if PE24 has the processing capability, and knows that PE24 does not need to add the sub-sub-TLV if PE24 does not have the processing capability. After receiving the BGP message, PE21 can determine whether PE24 has the processing capability to support the path information in the egress protection scenario according to whether the BGP message carries the sub-sub-TLV or a specific value of the value field in the sub-sub-TLV carried in the BGP message. In this scenario, the egress node PE24 can also be referred to as the egress network device of the tunnel, and the head node PE21 can be referred to as the ingress network device of the tunnel.
[0119] The egress protection solution in the same AS domain described in Fig. 1a is still used as an example. In another possible advertisement method, the advertisement message is still a BGP message, for example, a BGP message sent by PE24 and used to advertise a VPN route. The indication information can be carried in attribute information in the BGP message. For example, the attribute information is an extended community attribute type. As shown in Fig. 3b, an extended community attribute is defined that is used to advertise egress protection capability. The extended community attribute is used to carry the indication information and indicates the processing capability of PE24.
[0120] In the first possible case, after receiving the advertisement message, PE21 may determine that PE24 has processing capability based on the fact that the BGP message carries an extended community attribute, and can determine that PE24 does not have processing capability if the extended community attribute is not carried. In this case, the form and content of the indication information carried in the extended community attribute can be appropriately designed according to need.
[0121] In a second possible case, the extended community attribute is added regardless of whether PE24 has processing capability. After receiving the advertisement message, PE21 can determine whether PE24 has processing capability based on different contents of the indication information carried in the extended community attribute. For example, if PE24 has processing capability, the indication information includes an indication field whose value is A, and if PE24 does not have processing capability, the indication information includes an indication field whose value is B.
[0122] In a third possible case, the extended community attribute in the BGP message used as the advertise message and the indication information carried in another attribute together indicate whether the PE24 has the processing capability. In a possible implementation, when the PE24 has the processing capability, the PE24 adds an extended community attribute to the BGP message. Here, the extended community attribute may include the next hop information of the VPN route, and the next hop information is the indication information carried in the extended community attribute. The next hop information includes the device identifier of the PE24, for example, the loopback address or the interface IP address of the PE24. In a standard implementation of the BGP protocol, the next hop attribute carried in the BGP message also carries the next hop information. In this case, after receiving the advertise message, the PE21 can determine that the PE24 has the processing capability based on the fact that the next hop information carried in the extended community attribute matches the next hop information carried in the next hop attribute. An application scenario in which PE21 determines that PE24 does not have processing capability based on the fact that the next hop information carried in the extended community attribute does not match the next hop information carried in the next hop attribute is further described below with reference to FIG. 1b.
[0123] The above three cases are merely used as one possible example. In another possible implementation, the indication information may alternatively be carried in another possible field in the BGP message, or may be carried in another type of advertisement message for advertisement based on application scenario requirements. In another possible implementation, when the head node establishes a relationship between the indication information and the service route for guiding service packet forwarding in an association method, and can determine whether to include path information that the primary egress node needs to perform special processing in the service packet to be sent based on the relationship, the indication information may be carried independently in the advertisement message, and is not advertised together with the service route.
[0124] Then, to explain another manner in which the egress node PE24 generates the indication information and places the indication information in the advertisement message for advertisement, the inter-domain egress protection solution illustrated in FIG. 1b is used as an example. In this case, the PE24 as the domain border node and egress node of the multi-segmented tunnel A can receive the VPN route whose destination address is 2.2.2.2 and is advertised by the PE27 by using the BGP message. In this scenario, the egress node PE24 can also be referred to as the egress network device of the multi-segmented tunnel A, and the head node PE21 can be referred to as the ingress network device of the multi-segmented tunnel A.
[0125] When the above-mentioned method of carrying indication information in the sub-sub TLV of the VPN SID included in the VPN route is used, in a possible case, when PE24 receives the BGP message advertised by PE27, the first sub-sub TLV used by PE27 to advertise the processing capability of PE27 acting as the exit node of tunnel B for the secondary SID is included, and the first sub-sub TLV is carried in the first VPN SID allocated by PE27. When receiving the BGP message, PE24 needs to modify the next hop and reallocate the second VPN SID for the VPN route with the destination address of 2.2.2.2, and replace the received first VPN SID including the first sub-sub TLV. In this case, PE24 can add a newly generated second sub-sub TLV to the reallocated second VPN SID to indicate whether PE24 acting as the exit node of tunnel A has the processing capability for the secondary SID. It will be understood that the first sub-sub TLV does not need to be carried in the first VPN SID if PE27 does not have the processing capability.
[0126] When the above-mentioned method in which the indication information is carried in the extended community attribute in the BGP message is used, in a possible case, if PE27 has the processing capability, PE27 can add the same next hop information, for example, the loopback address of PE27, to the next hop attribute and the extended community attribute in the BGP message sent to PE24. Upon receiving the BGP message, PE24 as the exit node of tunnel A needs to change the next hop attribute in the BGP message to the loopback address of PE24. In this case, if PE24 has the processing capability, PE24 can also change the next hop information in the extended community attribute to the loopback address of PE24. However, if PE24 knows that the processing capability can be advertised by using the extended community attribute, but does not have the processing capability or does not even know that the processing capability can be advertised by using the extended community attribute, PE24 does not modify the next hop information in the extended community attribute. That is, in this case, the next hop information in the extended community attribute still indicates PE27. Therefore, when receiving an updated BGP message from PE24, PE21 can determine whether PE24 has processing capability according to whether the next hop attribute carried in the BGP message is consistent with the next hop information included in the extended community attribute. If the next hop attribute carried in the BGP message is consistent with the next hop information included in the extended community attribute, it indicates that PE24 has processing capability; or, if the next hop attribute carried in the BGP message is not consistent with the next hop information included in the extended community attribute, it indicates that PE24 does not have processing capability.
[0127] S403: The exit node forwards the advertisement message to the head node.
[0128] The exit node advertises the generated advertisement message, where the advertisement message may be first received by one or more intermediate nodes and then scattered until it is received by the head node PE21. Figure 1a is still used as an example. The advertisement message sent by PE24 is first received by P31, and P31, acting as a backbone node, does not perform any processing on the advertisement message but directly forwards the advertisement message to the next node. For ease of explanation, for example, the next hop of P31 in the figure is the head node PE21. In a real application scenario, one or more intermediate nodes may further be included between P31 and PE21. In one example, for the intra-domain scenario described in Figure 1a, the exit node PE24, as a PE device connected to a user-side device, can generate an advertisement message for the first time. For the inter-domain scenario described in Fig. 1b, the exit node PE24 may function as an exit node of a multi-segmented tunnel, or may be understood as an intermediate node of an end-to-end tunnel including multiple multi-segmented tunnels, and may modify the advertisement message to update the advertisement message after receiving the advertisement message generated and advertised by PE27. In this case, the generation of the advertisement message by the exit node PE24 in S401 may be understood as the PE24 updating the received advertisement message, which is regarded as regeneration.
[0129] S405: The head node sends a service packet according to the indication information in the advertisement message, where the service packet carries a primary VPN SID assigned by the primary egress node and a secondary VPN SID assigned by the secondary egress node.
[0130] After receiving the advertisement message advertised by PE24, the head node PE21 can determine whether PE24 has processing capability, whether the advertisement message carries indication information, or the specific content of the carried indication information based on different possible implementations.
[0131] In a possible case, before receiving the advertisement message advertised by PE24, the head node PE21 may not know or determine in advance that PE24 is a primary exit node. In this case, the head node PE21 may further receive the advertisement message advertised by PE25 from another device PE25 that can function as an exit node, and determine whether PE25 has processing capability based on the indication information carried in the advertisement message advertised by PE25. For a specific manner of advertising the processing capability of PE25 by using the indication information included in the advertisement message, please refer to the related description of advertising the processing capability of PE24 in S201 and S203. Deegresses will not be described again here. After receiving the advertisement messages advertised by PE24 and PE25 separately, PE21 can determine the primary exit node and the secondary exit node according to whether PE24 and PE25 have processing capabilities or further refer to local policies, and can separately use the VPN SID advertised by the primary exit node as the primary SID and the VPN SID advertised by the secondary exit node as the secondary SID based on the role setting.
[0132] In another possible case, the head node PE21 may know the primary and secondary roles of PE24 and PE25 in advance. In this case, the head node PE21 may alternatively receive only the advertisement message advertised by PE24. In addition, before sending the service packet of the VPN, the head node PE21 further acquires the VPN route advertised by the primary egress node PE24 and the route advertised by the secondary egress node PE25 separately. The VPN route advertised by the primary egress node PE24 may be carried in the advertisement message, e.g., BGP message, sent by PE24. The VPN route advertised by PE24 includes the VPN SID B2::1 assigned to the VPN by PE24, and the VPN route advertised by PE25 includes the VPN SID B3::1 assigned to the VPN by PE25.
[0133] Regardless of the particular determination method used, when PE24 determines that it does not have the processing capability, PE21 can select the conventional method, i.e., encapsulate VPN SID B2::1 into the SRH header of the packet of the VPN service as the stack bottom label, and transmit the packet. When PE24 determines that it has the processing capability, PE21 can use B3::1 as the stack bottom label, place B2::1 in the stack label position adjacent to B3::1, encapsulate B2::1 into the SRH header of the packet of the VPN service, and transmit the packet.
[0134] S407: The egress node receives the service packet and ignores the secondary SID carried in the service packet.
[0135] In a possible case, when receiving a service packet carrying a primary SID and a secondary SID, the egress node acting as a primary egress node can decapsulate the packet header of the service packet based on the matching result of the primary SID, even if the packet header further includes a secondary SID at the bottom of the stack, to complete subsequent forwarding based on the user-side routing information carried in the payload portion of the service packet. The SRv6 network shown in FIG. 1a is still used as an example. When the primary egress node PE24 is not faulty, PE24 can receive a packet of a VPN service sent by the head node PE21, and find that the SID information carried in the DA field of the current IPv6 header matches the VPN SID B2::1 assigned by PE24. In this case, the packet header of the service packet can be decapsulated. Since the SRH of the packet header includes the primary SID B2::1 and the secondary SID B3::1, the decapsulation operation removes B2::1 and B3::1 together. That is, in this case, the PE 24 performs ignore processing on the secondary SID carried in the service packet, specifically, ignore without processing through removal. After the packet header is decapsulated, a virtual routing and forwarding (VRF) table can be searched based on the destination address 2.2.2.2 included in the payload portion of the packet to complete the forwarding of the packet to the user side.
[0136] In another possible case, when receiving a service packet carrying a primary SID and a secondary SID, the exit node acting as a primary exit node can search for an SID list corresponding to the primary SID based on the matching result of the primary SID, and add the SID list to the service packet to guide subsequent forwarding. The SRv6 network shown in FIG. 1b is still used as an example. If the primary exit node PE24 of tunnel A is not down, PE24 can receive the packet of the VPN service sent by the head node PE21. In addition, PE24 modifies the next hop and reallocates the VPN SID B2::1 that identifies the VPN service during the advertisement of the VPN route, so that when receiving the packet of the VPN service, PE24 finds that the SID information carried in the DA field of the current IPv6 header matches the VPN SID B2::1 assigned by PE24. In this case, PE24 can locally search for the SID list corresponding to B2::1, where the SID list is used to indicate the forwarding of the service packet from PE24 to PE27. In this case, based on different specific implementations, in a possible case, PE24 can first remove a packet header associated with tunnel A and then add a packet header that includes the SID list and is associated with tunnel B to the packet. This corresponds to PE24 ignoring B3::1 through removal. In another possible case, PE24 can alternatively add the SID list to the packet, skip B3::1, and read the SIDs in the SID list to guide packet forwarding.
[0137] In the method 400, the head node can play the role of path orchestration. Based on the advertisement information advertised by the egress node to the head node, the head node determines whether the egress node has special processing capability for the secondary path information in the packet, and ensures that the egress node is set as a primary egress node when the egress node has the processing capability, and ensures that an action such as removing or skipping can be performed to ignore the secondary path information when the primary egress node is not faulty. This ensures normal packet forwarding when the primary egress node is not faulty. The method 400 may be applied to the egress protection solution described in scenario 1 of this application, or may be applied to another possible scenario in which the head node needs to determine whether the packet carries secondary path information based on the processing capability status advertised by another node on the packet transmission path. In another possible application scenario, for example, scenario 2 described in this application, the controller can also play the role of path orchestration. Thus, the embodiment of this application further provides a method 500. According to the method, the controller can determine the processing capability of the forwarding node based on the advertisement message received from the forwarding node, and based on the advertisement message, determine whether the path organized for packet forwarding can include secondary path information, so as to ensure normal forwarding of the packet when the primary route is not broken. Figure 5 shows a method for advertising the processing capability of an egress node. The method can be implemented in the network system shown in Figure 2. The method can include the following steps.
[0138] S501: A forwarding node generates an advertisement message, where the advertisement message includes indication information, and the indication information is used to indicate that the forwarding node can ignore a secondary SID that is included in a received packet and is used to indicate a secondary path.
[0139] The role of the forwarding node on the forwarding path may be an intermediate node or an exit node of the tunnel. Different from the manner in which the indication information and the route (e.g., VPN route) for the service forwarding are carried in the message for advertisement, in the scenario in which the controller exists, the forwarding node may generate a control type advertisement message, for example, a Border Gateway Protocol-Link State (BGP-LS) message, to advertise the processing capability of the forwarding node. The indication information may be carried in a designated field in the BGP-LS message, and whether the forwarding node has the processing capability may be determined based on different contents included in the indication information. In a possible case, the forwarding node may further advertise the SID allocated by the forwarding node, for example, the SID of the service type in the scenario 2, or the node SID indicating the forwarding node, to the controller. In another possible case, the SID that needs to be matched or used by the forwarding node may alternatively be configured and distributed by the controller.
[0140] S503: The forwarding node forwards the advertisement message to the controller.
[0141] Each forwarding node, including the forwarding node, belonging to the management domain range of the controller can send an advertisement message to the controller. The advertisement message may be actively sent by each forwarding node to the controller, or may be sent as a response after receiving a control command sent by the controller.
[0142] S505: The controller determines a primary SID and a secondary SID based on the indication information in the advertisement message, and sends the primary SID and the secondary SID to the ingress node that forwards the service packet.
[0143] After receiving the advertisement message sent by the forwarding node, the controller determines whether the forwarding node has processing capability based on the indication information carried in the advertisement message. The controller may further determine whether another forwarding node has processing capability based on the indication information carried in the advertisement message sent by another forwarding node. The controller may organize a service forwarding path according to whether each forwarding node has processing capability and with reference to the service requirements and capability status of each node, and determine a primary SID associated with a primary forwarding node and a secondary SID associated with a secondary forwarding node. The primary SID and the secondary SID may be a node type SID or a service type SID, or may be another defined type SID. The different types of SIDs may be used to indicate a node on the forwarding path to perform a corresponding operation when the SIDs match.
[0144] In S505, the controller receives the advertisement message and completes the route orchestration based on the advertisement message is used as an example. In another possible embodiment, a path orchestrator independent of the controller can be executed by the controller and complete the function of orchestrating a path based on the advertisement message and sending the orchestrated path to an ingress node. In a possible implementation, the path orchestrator can alternatively be integrated into the controller as a component of the controller.
[0145] S507: The ingress node adds the primary SID and the secondary SID to the service packet, and then transmits the service packet.
[0146] The manner of receiving the primary SID and the secondary SID from the controller by the ingress node may be to receive end-to-end path orchestration information from the controller for guiding forwarding from the ingress node to the egress node. Here, the end-to-end path orchestration information may include the primary SID and the secondary SID, or may be to receive local path orchestration information from the controller for guiding forwarding on some key path segments. The local path orchestration information includes the primary SID and the secondary SID. After receiving the local path orchestration information, the ingress node continues to acquire other necessary SID information for guiding the service packet forwarding, and generates complete path information for guiding the forwarding by using the local path orchestration information and the other SID information that continues to be acquired. For example, in scenario 2, the controller may orchestrate only the local path related to the firewall cleaning service, i.e., send at least the primary SID and the secondary SID used to implement service protection to the forwarding node. The forwarding node then combines the acquired path information and the local route orchestration information for guiding the forwarding of the service packet to the egress node to determine complete path information that can support service protection.
[0147] The path information sent by the ingress node and including the primary SID and the secondary SID may be carried in the packet header of the service packet. For example, in an SRv6 network, the primary SID and the secondary SID may be encapsulated in the SRH of the IPv6 extension header. In an SR-MPLS network, the primary SID and the secondary SID may be encapsulated in the MPLS packet header.
[0148] S509: The forwarding node receives a service packet, and if it determines that the primary SID matches, it ignores the secondary SID carried in the service packet.
[0149] In a scenario where the primary path where the forwarding node is located is not broken, after receiving the service packet, the forwarding node can find that the primary SID carried in the service packet can match with the SID stored locally, and can perform corresponding operations based on the matching result. The primary path where the forwarding node is located is not broken, for example, may be that the forwarding node serving as the primary node is not broken, or the primary service node connected to the forwarding node and providing a service is not broken. For example, when the type of the primary SID is a VPN SID and the primary SID is applied to the scenario described in FIG. 1b, the forwarding node can obtain a SID list corresponding to the primary SID, and can add the SID list to the packet header to guide the forwarding of the packet in the next domain. For another example, when the type of the primary SID is a service type SID in the scenario described in FIG. 2, the forwarding node can determine a firewall that can provide a service based on the service type SID, and send the service packet to the firewall to complete the cleaning.
[0150] In the above scenario where the primary route has no failure, the secondary SID associated with the secondary node does not need to be used. In order to ensure the subsequent successful forwarding of the service packet, the forwarding node acting as the primary node needs to ignore the secondary SID carried in the service packet. The specific processing method of ignoring the secondary SID may vary according to the scenario. For example, in the scenario shown in FIG. 2, if the PE22 finds that the firewall 51 on the primary path is not faulty, based on SIDS2::1 which is of the service type and associated with the firewall 51, the PE22 can determine the primary path for forwarding the service packet to the firewall 51, and clean the service packet by using the firewall 51. In this case, in order to avoid a packet forwarding error, the PE22 needs to ignore the secondary SID. In this scenario, the PE22 may not be the egress network device forwarding the service packet, but the PE22 as an intermediate network device on the packet forwarding path needs to continue to perform forwarding by using another SID placed after the secondary SID. Therefore, the secondary SID cannot be ignored by removing the packet header, and only the secondary SID in the label stack can be skipped to read another SID required by the subsequent forwarding. That is, in the scenario shown in Figure 2, the PE 22 needs to ignore the secondary SID in a skip manner. Based on different SID transport manners and application scenarios, the skip here may include directly skipping the secondary SID without reading it, or reading the secondary SID but skipping performing any operation by using the secondary SID.
[0151] For example, in FIG. 2, the secondary path information includes one secondary SID. In another possible scenario, the secondary path information may alternatively include multiple secondary SIDs. Multiple secondary SIDs may be used to indicate multiple secondary paths, or multiple secondary SIDs may be used to indicate one secondary path. The forwarding node needs to know when one or more secondary SIDs need to be skipped. In addition, in some cases, for example, when the number of secondary SIDs is not a fixed value, the forwarding node needs to know the number of secondary SIDs that need to be skipped. In a possible implementation, when a primary SID of a particular type matches, the forwarding node skips a predetermined number of secondary SIDs. For example, when it finds that the SID S2::1 of the service type matches, the PE22 in FIG. 2 may skip the next SID in the current SID list carried in the service packet, i.e., the secondary SID S1::1. In another possible implementation, the forwarding node may determine, based on the indication information associated with the primary SID, one or more secondary SIDs that need to be skipped when the primary SID matches and that are located after the primary SID. The indication information may include, for example, a value of the quantity of SIDs that need to be skipped. Similarly, the indication information may alternatively be associated with a secondary SID, e.g., associated with the first secondary SID to indicate the number of SIDs that need to be skipped and including the secondary SID. The above are merely possible examples, and other indication schemes may be designed, so that the forwarding node can determine one or more secondary SIDs that need to be ignored. For ease of explanation, the SIDs that need to be ignored by the forwarding node are referred to as secondary SIDs. However, during practical application, the forwarding node may not actually know that the SIDs that need to be ignored by the forwarding node are SIDs that indicate a secondary path, but only determine that the forwarding node needs to ignore one or more subsequent SIDs according to a locally defined rule or based on the indication information.
[0152] In addition, although an implementation in which the controller sends the primary SID and secondary SID to the ingress node is described in S505, in another possible implementation solution, the controller may alternatively be allowed to determine the primary node and secondary node among the forwarding nodes based only on the advertisement messages received from the forwarding nodes, and send messages to the ingress node used to indicate the primary node and secondary node on the packet forwarding path. The ingress node then locally acquires the primary SID associated with the primary node and the secondary SID associated with the secondary node based on the messages.
[0153] With reference to scenarios 1 and 2, the above describes a solution in which an ingress network device or a controller determines whether a forwarding node has the ability to ignore secondary path information based on the indication information carried in the advertisement message received from the forwarding node, and can add secondary path information to a packet sent to the forwarding node if the forwarding node determines that the forwarding node has the ability. According to the corresponding solution, if the forwarding node configured on the primary path determines that the forwarding node has the corresponding ability, the ingress network device or the controller for organizing the path can add secondary path information to a packet that needs to be forwarded, and ensures that when the primary path is not broken, the forwarding node can ignore the secondary path information in the packet and does not use the secondary path information to determine the secondary path. This ensures normal forwarding of the packet in a scenario in which the primary path is not broken.
[0154] Method 400 and method 500 may be applied to the above-mentioned scenario 1 and scenario 2, respectively. However, the solution similar to method 400 and method 500 and used to determine whether secondary path information is carried in a packet based on the capability status advertised by a forwarding node may be applied to more application scenarios. The following describes a method 600 for advertising processing capabilities of a network device according to one embodiment of the present invention. Method 600 may be applied to different specific application scenarios, including scenario 1 and scenario 2.
[0155] S601: A first network device generates an advertisement message, where the advertisement message includes indication information, the indication information is used to indicate a processing capability of the first network device, the processing capability of the first network device includes a processing capability of the first network device to function as a network device on a primary path for forwarding a packet and to ignore the secondary path information when the first network device receives a packet including the primary path information and the secondary path information, and the secondary path information is used to indicate one or more secondary paths for forwarding the packet when the primary path is unavailable.
[0156] The first network device may be, for example, an egress network device or an intermediate network device of a tunnel on the forwarding path. The advertisement message carrying the indication information may be any possible message type determined with reference to the network architecture and the application scenario. For example, an IGP message, a BGP-LS message, or a BGP message used to advertise a route. If the device receiving the advertisement is an ingress network device of a tunnel, a BGP message for advertising a VPN route may be used to carry the indication information. For example, see S401 in the method 400. If the ingress network device receiving the advertisement and the first network device acting as an egress network device or an intermediate network device are devices belonging to the same network domain, an IGP message may alternatively be used to carry the indication information. If the device receiving the advertisement is a controller or a path orchestrator, a BGP-LS message may be used to carry the indication information. For example, see S501 in the method 500. The BGP message may further be used to advertise a public route. If the device receiving the advertisement is a network device on the public network forwarding path, the public network routing information in the BGP message can be further used to carry the indication information, for example, the indication information is carried in the public segment identifier (public SID) field of the public route.
[0157] In a possible implementation, the first network device may be determined to have processing capability based on the fact that the indication information is carried, or the first network device may be determined to have no processing capability based on the fact that the indication information is not carried. For example, the implementation of the sub-sub TLV described in S401 of the method 400. In another possible implementation, the first network device may be determined to have processing capability based on the fact that the indication information carried is a first value, or the first network device may be determined to have no processing capability based on the fact that the indication information carried is a second value different from the indication information. In some possible cases, both the indication information having the first value or the second value and other information carried in the advertisement message may be used as information for determining whether the first network device has processing capability. For example, the implementation described in S401 of the method 400, in which whether the information carried in the extended community attribute in the BGP message matches the information carried in the next hop attribute is determined through comparison.
[0158] The capability advertised by the first network device by using the advertisement message includes a capability to ignore secondary indication information carried in the service packet received by the first network device. For example, if the primary path is not broken, when receiving the service packet, the first network device can perform matching on the primary path information carried in the service packet, and after the matching is successful, can ignore the secondary path information included in the service packet. The primary path information can be understood as one or more fields that can be used to indicate the primary path and are included in the packet. The scenario shown in FIG. 1a is used as an example. In the SRv6 network, the packet of the VPN service sent by the PE21 may carry a packet header including an IPv6 header and an SRH header. In this case, the primary path information may include all SIDs in the SRH header except for the secondary SID B3::1, and may further include the SID included in the DA field in the IPv6 header. The SID included in the DA field may change dynamically in the forwarding process. In some possible application scenarios, the primary path information can also be regarded as a corresponding primary SID (e.g., B2::1) forming primary / secondary protection with a secondary SID (e.g., B3::1), provided that the primary SID is used as the primary path information and needs to be completed based on the primary path information, and various possible functions described in the embodiments of the present invention can be fully performed.
[0159] It will be understood that the secondary path information is used to indicate one or more secondary paths for forwarding a packet when the primary path is unavailable. If the first network device acting as a primary node fails, e.g., see the description of scenario 1 above, or if a device connected to the first network device and capable of providing a service fails, e.g., see the description of scenario 2 above, the primary path is unavailable. However, if the above two possible failure types or another failure scenario that may cause the unavailability of the primary path do not occur, e.g., the link used to connect to the primary node is failed, when receiving a service packet, the first network device located on the primary path needs to perform special processing on the secondary path information included in the service packet to avoid the secondary path information affecting normal packet forwarding. In a possible implementation, the manner in which the first network device ignores the secondary path information may be removal. The removal may be removal implemented by removing the entire packet header in the SRv6 network scenario shown in FIG. 1a. In this scenario, the first network device acting as an egress node connected to the user side device can remove the entire packet header of the packet of the VPN service after matching the VPN SID B2::1, and complete the subsequent forwarding from the first network device to the user side device by using the VPN information carried in the payload part of the packet. In this stripping method, the primary path information and the secondary path information carried in the packet header are removed together.However, in the SR-MPLS network, since the SID used in the packet header (e.g., matching is completed) is popped out from the SID list, in the SR-MPLS network, regardless of whether the role of the first network device is an intermediate node or an egress node, after the primary path information, e.g., the primary SID associated with the first network device, is matched, the first network device determines that a pop operation needs to be performed on one or more secondary SIDs placed after the primary SID according to a local preset rule or based on the instruction information carried in the packet. Here, the pop operation causes the removal of one or more secondary SIDs. In another possible implementation, the manner in which the first network device ignores the secondary path information may be skipping. Here, skipping may specifically be skipping the second path information directly without reading the secondary path information, or skipping the second path information in an ignorable manner without using the secondary path information to guide forwarding even if the secondary path information is read. For example, in the SRv6 network scenario shown in Fig. 2, after matching the primary SID S2::1 used as the primary path information, the intermediate node PE22 needs to skip the secondary SID S3::1 next to S2::1 in the label stack. That is, to avoid packet forwarding errors, guide the packet forwarding to the secondary firewall 52 without using S3::1. The manner of ignoring the secondary path information may alternatively be designed in another manner based on requirements. For example, by marking the secondary path information and using the mark, it is possible to identify that the secondary path information is not used.
[0160] It can be seen that the specific case of ignoring processing may be that the first network device ignores the secondary path information and does not use the secondary path information to guide packet forwarding, or the first network device ignores the secondary path information and, for example, is enabled to remove the packet header from the packet when the secondary path information is included, and can process the packet normally. There may be multiple specific operation manners for implementing ignoring, and the specific operation manner may be determined with reference to a specific application scenario. In addition, the implementation of ignoring does not mean that the first network device does not explicitly perform any operation on the secondary path information. For example, in some possible application scenarios or design manners, the first network device may read the secondary path information first, and then ignore the secondary path information in a skip manner.
[0161] In each of the schematic diagrams of Figures 1a, 1b, and 2, one secondary SID is used as the secondary path information. However, in another possible application scenario, the secondary path information may alternatively include multiple secondary SIDs, and the multiple secondary SIDs may be used to indicate multiple secondary paths that may be used when the primary path is down, respectively, or some or all of the multiple secondary SIDs may be used to jointly indicate the secondary paths. When multiple secondary SIDs each indicate multiple secondary paths, the sequence in which the multiple secondary paths are used may be determined based on the arrangement sequence of the multiple secondary SIDs in the SID list.
[0162] S603: The first network device sends an advertisement message to the second network device.
[0163] In a possible case, the first network device may directly send the advertisement message to the second network device. For example, the first network device acting as a forwarding node sends the advertisement message to the second network device acting as a controller or path orchestrator by using a BGP-LS message. For example, see the description of S503 in the method 500. In another possible case, the first network device indirectly sends the advertisement message to the second network device. For example, the first network device acting as an egress node distributes and advertises the BGP message hop by hop to the second network device acting as a head node by using a BGP message for advertising the VPN route. For example, see the description of S403 in the method 400. In this case, the second network device acting as a head node may be, for example, the PE21 shown in FIG. 1a or FIG. 1b, or the PE24 shown in FIG. 1b and serving as both the domain border node and the head node of the tunnel B. Specifically, PE24 may act as an exit node of tunnel A to advertise its processing capabilities to the head node PE21 of tunnel A in such a way as to modify the next hop of the VPN route, or may act as a head node of tunnel B to receive the processing capabilities advertised by the exit node PE27 of tunnel B (wherein the secondary node of PE27 is not shown in FIG. 1b). The second network device acting as the head node may alternatively be PE25 shown in FIG. 1b. For example, the exit node PE27 and another PE node forming a dual-homing node with PE27 may also send an advertisement message to PE25. In this way, in a scenario where PE24 is down, the packet is forwarded to the secondary node PE25, and PE25 can implement packet forwarding in an egress protection mode based on the initially received advertisement message.
[0164] S605: The second network device receives the advertisement message, and determines, based on the indication information in the advertisement message, that the first network device has processing capability.
[0165] After receiving the advertisement message, the second network device can determine, based on the indication information in the advertisement message, whether the first network device has the processing capability to ignore the secondary path information included in the packet when the primary path information included in the packet matches. Based on different implementations of the advertisement message or different implementations of the indication information in the advertisement message, the second network device can determine the processing capability of the first network device in different manners. For example, if the advertisement message is a BGP message for advertising a route, see the description of S405 in method 400. As another example, if the advertisement message is a BGP-LS message, see the description of S505 in method 500.
[0166] When the first network device is determined to have the processing capability, the second network device may perform different subsequent operations with reference to different roles played by the second network device. In a possible case, when the second network device is the head node PE21 shown in FIG. 1a or FIG. 1b, the second network device may add the first primary path information and the first secondary path information to the first packet of the service that needs to be transmitted. Alternatively, when the second network device is the domain border node PE24 shown in FIG. 1b, after ignoring the secondary path information associated with the tunnel A in the received first packet, the second network device may add the first primary path information and the first secondary path information associated with the tunnel B before continuing to forward the first packet, guiding the forwarding of the first packet on the tunnel B in the egress protection mode. For example, see the description of S405 in the method 400. In another possible case, when the second network device is the service orchestrator 41 shown in FIG. 2, the second network device can determine the primary SID S2::1 and secondary SID S3::1 associated with the PE22 based on the fact that the PE22 has processing capabilities. The second network device then delivers S2::1 and S3::1 to the head node PE21, which forwards the first packet. The PE21 organizes S2::1 and S3::1 into an SID list used to guide the forwarding of the first packet, generates first primary path information and first secondary path information included in the first packet, and guides the first packet to be forwarded in a manner that can implement service protection. In this case, the service orchestrator 41 may alternatively directly determine the complete primary / secondary path information including S2::1 and S3::1, and send the complete primary / secondary path information to the head node. For example, see the description of S505 and S507 in the method 500.
[0167] The above two cases can also be used together in some scenarios, for example, the head node adds both the primary and secondary SIDs of the service type to implement service protection, and the primary and secondary VPN SIDs to implement egress protection to the first packet.
[0168] S607: The first network device receives a first packet, where the first packet includes the first primary path information and the first secondary path information.
[0169] Based on the description in S606, the first primary path information and the first secondary path information in the first packet received by the first network device may be generated by a second network device to which the first network device advertises its processing capabilities, may be generated by another network device, e.g., a head node, by combining local primary and secondary path information sent by the second network device to which the first network device advertises its processing capabilities, or may be added to the first packet based on the complete primary and secondary path information sent by the second network device to which the first network device advertises its processing capabilities.
[0170] An implementation in an SRv6 network is used as an example. A previous hop node of a first network device can add a SID associated with the first network device to a DA field in an IPv6 header of a first packet, and then forward the first packet to the first network device.
[0171] S609: The first network device ignores the first secondary path information, and forwards the first packet based on the first primary path information.
[0172] The SRv6 network is still used as an example. If the primary path is not broken, the first network device can perform matching on the SID associated with the first network device and included in the primary path information. In this case, the first secondary path information included in the first packet can be ignored. Ignoring can be removal or skipping. For example, see the description of S407 in method 400. Or, see the description of S509 in method 500.
[0173] In addition to ignoring the first secondary path information, the first network device may further forward the first packet based on the first primary path information. For example, in an SRv6 network, the first network device guides subsequent forwarding of the first packet based on an SID that is located after one or more secondary SIDs and belongs to the first primary path information, where the one or more secondary SIDs form the secondary path information.
[0174] In this method, the first network device can send an advertisement message carrying indication information, where the indication information can indicate whether the first network device has a processing capability to ignore the secondary path information included in the packet when the first network device functions as a network device on a primary path for forwarding a packet and receives a packet including the primary path information and the secondary path information, so that if the first network device determines that it has the processing capability, the second network device receiving the advertisement message can send or instruct another network device to send a service packet including the primary path information and the secondary path information to the first network device. Thus, when the primary path can be normally used, the first network device can ignore the secondary path information that does not need to be used in the service packet, ensuring network performance robustness and avoiding the problem of packet loss or inaccurate forwarding caused by improper processing on the secondary path information.
[0175] A method for advertising the processing capability of a network device provided in the embodiments of the present application is provided in the above deegresses with reference to the accompanying drawings. It will be understood that in order to implement the functions described in the above methods, the network device configured to execute the methods must include corresponding hardware and / or software modules for executing the functions. This application may be implemented in the form of hardware, or a combination of hardware and computer software, with reference to the execution process of the methods described in the embodiments disclosed in this specification. Whether the functions are executed by hardware or by hardware driven by computer software depends on the specific application and design constraints of the technical solution. Those skilled in the art may use different schemes to implement the functions described for each specific application with reference to the embodiments, but the implementation should not be considered beyond the scope of this application.
[0176] In this embodiment, the corresponding device may be divided into functional modules according to the above-mentioned method embodiment. For example, the functional modules may be obtained through division based on the corresponding functions, or two or more functions may be integrated into one processing module. The integrated modules may be implemented in the form of hardware. It should be noted that in this embodiment, the division into modules is an example and is merely a possible logical function division. Other division methods may be used during actual implementation.
[0177] When division into functional modules is used, an apparatus for advertising the processing capabilities of a network device provided in an embodiment of this application is described below with reference to Figures 7 and 8.
[0178] Fig. 7 is a block diagram of an apparatus 700 for advertising processing capabilities of a network device according to one embodiment of the present application. The apparatus 700 may be, for example, a PE24 or PE25 in the system shown in Fig. 1a, a PE24, PE25, or PE27 in the system shown in Fig. 1b, an egress node described in the method of Fig. 4, a forwarding node described in the method of Fig. 5, a first network device described in the method of Fig. 6, or a module or component in any of the network devices described above. And may implement the corresponding functions performed in the method 400, 500, or 600 by any of the network devices described above.
[0179] In a possible implementation, as shown in FIG. 7, an apparatus 700 for advertising a processing capability of a network device may include a generating unit 701 and a sending unit 703.
[0180] The generating unit 701 is configured to generate an advertisement message, where the advertisement message includes first indication information, the first indication information is used to indicate a processing capability of the first network device, the processing capability of the first network device includes a processing capability of ignoring secondary path information when the first network device serves as a network device on a primary path for forwarding a packet and receives a packet including the primary path information and the secondary path information, and the secondary path information is used to indicate one or more secondary paths for forwarding the packet when the primary path is unavailable. For functions that may be performed by the generating unit 701, please refer to related descriptions in S401, S501, or S601.
[0181] The sending unit 703 is configured to send the advertisement message to the second network device. For functions that may be performed by the sending unit 703, please refer to the relevant descriptions in S403, S503 or S603.
[0182] In a possible implementation, the apparatus 700 further includes a receiving unit 705 and a forwarding unit 707. The receiving unit 705 is configured to receive a first packet, where the first packet includes first primary path information and first secondary path information, where the first primary path information is used to indicate a first primary route for forwarding the first packet, and the first secondary path information is used to indicate one or more first secondary routes for forwarding the first packet when the first primary route is unavailable. The forwarding unit 707 is configured to ignore the first secondary path information and forward the first packet based on the first primary path information. For functions that may be performed by the receiving unit 705, please refer to the related descriptions in S407, S509, and S607. For functions that may be performed by the forwarding unit 707, please refer to the related descriptions in S609.
[0183] In a possible implementation, the receiving unit 705 is further configured to receive an unupdated BGP message, where the unupdated BGP message includes a second VPN SID label field of a VPN route, and the generating unit 701 is further configured to replace the second VPN SID label field with the first VPN SID label field to generate a BGP message through updating.
[0184] Optionally, the second VPN SID label field includes second indication information used to indicate a processing capability of the third network device, the processing capability of the third network device including a processing capability in which the third network device functions as a network device on a primary path for forwarding a packet and, when receiving a packet including primary path information and secondary path information, ignores secondary path information included in the packet, and the third network device is a network device indicated in next hop information carried in the unupdated BGP message.
[0185] In a possible implementation, the first indication information is carried in an extended community attribute in the BGP message. The receiving unit 705 is further configured to receive an unupdated BGP message, where the unupdated BGP message includes a next hop attribute, where both the first indication information and the next hop attribute in the extended community attribute include the first next hop information, and the first next hop information is used to indicate the third network device. The generating unit 701 is further configured to change the first next hop information in the next hop attribute to second next hop information, where the second next hop information is used to indicate the first network device.
[0186] Optionally, the generating unit 701 is further configured to modify the first next hop information in the extended community attribute to the second next hop information.
[0187] Optionally, using the first indication information to indicate a processing capability of the first network device includes using the first indication information and the next hop attribute to indicate a processing capability of the first network device.
[0188] In a possible implementation, the first secondary path information includes one or more secondary SIDs, the first primary path information includes a primary SID, and the primary SID is associated with the first network device. The forwarding unit 707 is further configured to remove the one or more secondary SIDs by matching the primary SID with a SID stored in the first network device, and forward the first packet to a user-side network device based on payload information carried in the first packet, or forward the first packet based on an SID added after the one or more secondary SIDs are removed.
[0189] In a possible implementation, the first secondary path information includes one or more secondary SIDs, the first primary path information includes a primary SID, and the primary SID is associated with the first network device. The forwarding unit 707 is further configured to skip the one or more secondary SIDs by matching the primary SID with a SID stored in the first network device, and forward the first packet based on a SID located after the one or more secondary SIDs.
[0190] Fig. 8 is a block diagram of another apparatus 800 for advertising processing capabilities of a network device according to one embodiment of the present application. The apparatus 800 may be, for example, the PE21 in the system shown in Fig. 1a, the PE21, PE24, or PE25 in the system shown in Fig. 1b, the head node described in the method of Fig. 4, the controller described in the method of Fig. 5, the second network device described in the method of Fig. 6, or a module or component in any of the network devices described above. And the corresponding functions performed in the method 400, 500, or 600 by any of the network devices described above may be implemented.
[0191] In a possible implementation, as shown in Fig. 8, an apparatus 800 for advertising a processing capability of a network device may include a receiving unit 801 and a determining unit 803. The receiving unit 801 is configured to receive an advertisement message sent by a first network device, where the advertisement message includes first indication information, the first indication information is used to indicate the processing capability of the first network device, the processing capability of the first network device includes a processing capability of the first network device to function as a network device on a primary path for forwarding a packet and to ignore the secondary path information when the first network device receives a packet including the primary path information and the secondary path information, and the secondary path is one or more secondary paths for forwarding a packet when the primary path is unavailable. The determining unit 803 may be configured to determine that the first network device has a processing capability based on the first indication information, or to determine that the first network device does not have a processing capability based on the first indication information.
[0192] In a possible implementation, the apparatus 800 may further include a sending unit 805. The sending unit may include the sending unit 805 configured to send a first packet based on the fact that the first network device has a processing capability, where the first packet carries first secondary path information and first primary path information, the first primary path information is used to indicate the first primary path for forwarding the first packet, and the first secondary path information is used to indicate one or more first secondary paths for forwarding the first packet when the first primary path is unavailable. Or, the sending unit is configured to send a first message to a third network device based on the fact that the first network device has a processing capability, where the first message is used to instruct the third network device to obtain the first secondary path information and the first primary path information carried in the first packet based on the first message, and the first packet is sent by the third network device to the first network device.
[0193] In a possible implementation, the determining unit 803 is configured to determine that the first network device has processing capability based on the fact that the advertisement message sent by the first network device carries first indication information.
[0194] In a possible implementation, it is determined that the first network device has the processing capability based on the fact that first indication information carried in an advertisement message sent by the first network device has a first value.
[0195] Optionally, the first indication information is carried in a VPN route of the BGP message. The determining unit 803 is configured to determine that the first network device has the processing capability based on the fact that the VPN route includes the first indication information.
[0196] Optionally, the first indication information is carried in an extended community attribute in the BGP message.
[0197] Optionally, the BGP message further includes a next hop attribute, and the next hop attribute carries next hop information used to indicate the first network device. The determining unit 803 is configured to determine that the first network device has processing capability based on a fact that the first indication information is the same as the next hop information carried in the next hop attribute, or determining that the first network device does not have processing capability based on the first indication information includes: determining that the first network device does not have processing capability based on a fact that the first indication information is different from the next hop information carried in the next hop attribute.
[0198] In a possible implementation, the receiving unit 801 is further configured to receive an advertisement message sent by a third network device, where the advertisement message sent by the fourth network device includes second indication information, the second indication information is used to indicate a processing capability of the fourth network device, the processing capability of the fourth network device includes a processing capability of the third network device acting as a network device on a primary path for forwarding a packet, and ignoring the secondary path information included in the packet when receiving a packet including the primary path information and the secondary path information, and the secondary path information is used to indicate one or more secondary paths for forwarding the packet when the primary path is unavailable.
[0199] In a possible implementation, the advertisement message sent by the first network device further includes first path information, and the advertisement message sent by the third network device further includes second path information, and before the first packet or the first message is sent to the first network device, the determining unit 803 is configured to determine that the first network device is a primary device and the fourth network device is a secondary device based on the advertisement message sent by the first network device and the advertisement message sent by the fourth network device. The apparatus 800 further includes a generating unit 807, which is configured to add the first path information and the second path information to generate a first packet, where the first path information belongs to the first primary path information, and the second path information belongs to the first secondary path information. Alternatively, the sending unit 805 is configured to send the first message including the first path information and the second path information to the third network device, and instruct the third network device to include the first path information and the second path information in the first packet. Here, the first path information belongs to the first primary path information, and the second path information belongs to the first secondary path information.
[0200] In a possible implementation, the determining unit 803 is further configured to determine that the first network device does not have processing capability based on the first indication information. The sending unit 805 is further configured to send a second packet based on the fact that the first network device does not have processing capability, where the second packet carries second primary path information but does not carry second secondary path information, the second primary path information is used to indicate a second primary route for forwarding the second packet, and the second secondary path information is used to indicate one or more second secondary routes for forwarding the second packet when the second primary route is unavailable.
[0201] The embodiment of this application further provides a network device 900. The network device 900 may be configured to perform different functions and may be the network device described in each of the above method embodiments, such as any PE device in the system 10 shown in Figure 1a, Figure 1b, or Figure 2, the device 700 shown in Figure 7, or the device 800 shown in Figure 8.
[0202] The network device 900 includes various hardware or software modules required to implement the method steps performed by the network device in each of the method embodiments described above. For the degress procedures of the functions that can be performed by the network device 900, please refer to the aforementioned method embodiments. For the sake of brevity, the degresses will not be described again here. The execution processes mentioned in the aforementioned method embodiments can be completed by using hardware integrated logic circuits in the processor of the network device 900 or by using instructions in the form of software. For example, they can be executed and completed directly by a hardware processor, or by using a combination of hardware modules and software modules in the processor. The software modules can be located in a storage medium such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, an electrically erasable programmable memory, or a register. The storage medium is located in the memory, and the processor can read the information in the memory and complete the aforementioned method steps in combination with the hardware of the processor.
[0203] When the network device 900 corresponds to the device 700 shown in Fig. 7 or the device 800 shown in Fig. 8, each functional module in the device 700 or the device 800 may be implemented by using software, hardware, or a combination of software and hardware of the network device 900. In the form of software, the functions performed by the functional modules implemented by the device 700 or the device 800 may be executed by the network device 900 after the processor of the network device 900 reads the program code stored in the memory.
[0204] 9 is a schematic diagram of an example structure of a network device 900 according to an embodiment of the present application. The network device 900 includes at least one processor 901, a communication bus 902, a memory 903, and at least one physical interface 909.
[0205] The processor 901 may be a general purpose central processing unit (CPU), a network processor (NP), or a microprocessor, or may be one or more integrated circuits configured to implement the solutions of this application, such as an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or a combination thereof. The PLD may be a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof.
[0206] The communication bus 902 is configured to transfer information between the aforementioned components. The communication bus 902 can be categorized into an address bus, a data bus, a control bus, etc. For ease of presentation, the bus is shown using only one bold line in the diagram. However, it does not indicate that only one bus or only one type of bus is present.
[0207] The memory 903 may be, but is not limited to, a read-only memory (ROM) or another type of static storage device capable of storing static information and instructions, a random access memory (RAM) or another type of dynamic storage device capable of storing information and instructions, or an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or another optical disk storage, an optical disk storage (including compressed optical disks, laser disks, optical disks, digital versatile disks, Blu-ray disks, etc.), a magnetic disk storage medium or another magnetic storage device, or any other medium that can be configured to carry or store expected program code in the form of instructions or data structures and that can be accessed by a computer. The memory 903 may exist independently and is connected to the processor 901 by using a communication bus 902. The memory 903 may be integrated with the processor 901.
[0208] The physical interface 909 is configured to communicate with another device or a communication network by using any device, such as a transceiver. The physical interface 909 includes a wired communication interface and may further include a wireless communication interface. The wired communication interface may be, for example, an Ethernet interface. The Ethernet interface may be an optical interface, an electrical interface, or a combination thereof. The wireless communication interface may be a wireless local area network (WLAN) interface, a cellular network communication interface, a combination thereof, or the like. The physical interface 909 is also referred to as a physical port. There may be one or more physical interfaces 909.
[0209] During specific implementation, in one embodiment, the processor 901 may include one or more CPUs, for example, CPU0 and CPU1 of FIG.
[0210] During specific implementation, in one embodiment, the network device 900 may include multiple processors, such as processor 901 and processor 905 shown in Figure 9. Each of the processors may be a single-core processor (single-CPU) or a multi-core processor (multi-CPU). A processor herein may be one or more devices, circuits, and / or processing cores configured to process data (e.g., computer program instructions).
[0211] During specific implementation, in one embodiment, the network device 900 may further include an output device 906 and an input device 907. The output device 906 communicates with the processor 901 and can display information in a number of ways. For example, the output device 906 may be a liquid crystal display (LCD), a light emitting diode (LED) display device, a cathode ray tube (CRT) display device, or a projector. The input device 907 communicates with the processor 901 and can receive user input in a number of ways. For example, the input device 907 may be a mouse, a keyboard, a touch screen device, a sensing device, etc.
[0212] In some embodiments, the memory 903 is configured to store a program code 910 for executing the solution of this application, and the processor 901 can execute the program code 910 stored in the memory 903 to implement the corresponding functions. For example, the program stored in the program code 910 may be called to implement the functions of the generating unit 701 in the device 800, or may be called to implement the functions of the determining unit 803 and the generating unit 809 in the device 700. That is, the network device 900 can implement the method procedures provided in the above-mentioned method embodiments in cooperation with the processor 901 and the program code 910 in the memory 903. In this case, for example, the generating unit 701 and the determining unit 803 may correspond to the processor 901 in the network device 900. And the transmitting unit 703 or the receiving unit 705 corresponds to the physical interface 909 in the network device 900.
[0213] FIG. 9 shows a possible example of the configuration structure of the network device. The network device can also use another configuration structure. For example, the network device includes at least a processor, and the memory configured to store the program code may be separate from the network device. For example, the memory may be a storage space on a cloud server or a network hard disk. In addition, there may be one or more memories. When there are multiple memories, the multiple memories may be located in the same place or in different places, and may be used independently or in cooperation.
[0214] Figure 10 is a schematic diagram of the structure of another network device according to one embodiment of the present application. The network device 1000 may be, for example, a network device configured to perform different functions and described in each of the above method embodiments, such as any PE device in the system 10 shown in Figure 1a, Figure 1b, or Figure 2, the device 700 shown in Figure 7, or the device 800 shown in Figure 8.
[0215] The network device 1000 includes a main control board 1010 and an interface board 1030 .
[0216] The main control board 1010 is also referred to as a main processing unit (MPU) or a route processor card. The main control board 1010 performs control and management for the components of the network device 1000, including functions of route calculation, device management, device maintenance, and protocol processing. The main control board 1010 includes a central processing unit 1011 and a memory 1012.
[0217] The interface board 1030 is also referred to as a line processing unit (LPU), a line card, or a service board. The interface board 1030 provides various service interfaces and is configured to forward data packets. The service interfaces include, but are not limited to, an Ethernet interface, a Packet over SONET / SDH (POS) interface, etc. The Ethernet interface is, for example, a Flexible Ethernet Client (FlexEClient). The interface board 1030 includes a central processing unit 1031, a network processor 1032, a forwarding entry memory 1034, and a physical interface card (PIC) 1033.
[0218] A central processing unit 1031 on the interface board 1030 is configured to control and manage the interface board 1030 and to communicate with a central processing unit 1011 on the main control board 1010 .
[0219] The network processor 1032 is configured to forward and process packets. The form of the network processor 1032 may be a forwarding chip. Specifically, the processing for an uplink packet includes processing at a packet ingress interface and searching a forwarding table, and the processing for a downlink packet includes searching a forwarding table, etc.
[0220] The physical interface card 1033 is configured to implement a physical layer interconnect function. Original traffic enters the interface board 1030 from the physical interface card 1033, and processed packets are sent out from the physical interface card 1033. The physical interface card 1033 includes at least one physical interface. A physical interface is also referred to as a physical port. The physical interface card 1033 is also referred to as a subcard, which may be mounted on the interface board 1030, and is responsible for converting optical and electronic signals into packets, performing validation checks on the packets, and forwarding the packets to the network processor 1032 for processing. In some embodiments, the central processing unit 1031 on the interface board 1003 may also perform the functions of the network processor 1032, for example, implementing software forwarding based on a general-purpose CPU, so that the network processor 1032 is not required in the physical interface card 1033.
[0221] Optionally, the network device 1000 includes multiple interface boards. For example, the network device 1000 further includes an interface board 1040, which includes a central processing unit 1041, a network processor 1042, a forwarding entry memory 1044, and a physical interface card 1043.
[0222] Optionally, the network device 1000 further includes a switching board 1020. The switching board 1020 may also be referred to as a switch fabric unit (SFU). When the network device has multiple interface boards 1030, the switching board 1020 is configured to complete data exchange between the interface boards. For example, the interface board 1030 and the interface board 1040 can communicate with each other by using the switching board 1020.
[0223] The main control board 1010 is coupled to the interface board 1030. For example, the main control board 1010, the interface board 1030, the interface board 1040, and the switching board 1020 are connected to a system backplane by using a system bus to implement interworking. In a possible implementation, an inter-process communication (IPC) channel is established between the main control board 1010 and the interface board 1030, and communication is performed between the main control board 1010 and the interface board 1030 through the IPC channel.
[0224] Logically, the network device 1000 includes a control plane and a forwarding plane. The control plane includes a main control board 1010 and a central processing unit 1031. The forwarding plane includes components that perform forwarding, such as a forwarding entry memory 1034, a physical interface card 1033, and a network processor 1032. The control plane performs the following functions: router, generating forwarding tables, processing signaling and protocol packets, configuring and maintaining device status, etc. The control plane distributes the generated forwarding tables to the forwarding plane. In the forwarding plane, the network processor 1032 looks up the forwarding table distributed by the control plane, and forwards packets received by the physical interface card 1033 based on the table. The forwarding table distributed by the control plane may be stored in the forwarding entry memory 1034. In some embodiments, the control plane and the forwarding plane may be completely separate and are not on the same device.
[0225] As the network device 1000 configured to perform the above-mentioned method embodiment, the central processing unit 1011 can be configured to perform operations such as generating an advertisement message or determining the processing capability of the network device that transmits the advertisement message based on the instruction information carried in the advertisement message. The network processor 1032 can trigger the physical interface card 1033 to forward the traffic packet to another network device.
[0226] For example, the device 700 is used as an example. The sending unit 703 or the receiving unit 705 in the device 700 may be equivalent to the physical interface card 1033 or the physical interface card 1043 in the network device 1000. The generating unit 701 in the device 700 may be equivalent to the central processing unit 1011 or the central processing unit 1031 in the network device 1000.
[0227] It should be understood that in this embodiment of the application, the operations on the interface board 1040 are the same as the operations on the interface board 1030. For the sake of brevity, the deegresses will not be described again. The main control board 1010 in the network device 1000 and the interface board 1030 and / or the interface board 1040 may perform the functions and / or steps performed by the network device in the embodiments of the method described above. For the sake of brevity, the deegresses will not be described here.
[0228] It should be understood that there may be one or more main control boards. When there are multiple main control boards, the main control board may include a primary main control board and a secondary main control board. There may be one or more interface boards, and a network device having stronger data processing capabilities provides more interface boards. There may also be one or more physical interface cards on the interface board. There may be no switching board, or there may be one or more switching boards. When there are multiple switching boards, load balancing and redundant backup may be implemented together. In the centralized forwarding architecture, the network device may not need a switching board, and the interface board provides the function of processing service data of the entire system. In the distributed forwarding architecture, the network device may have at least one switching board, and data exchange between multiple interface boards is implemented by using the switching board, providing large-capacity data exchange and processing capabilities. Thus, the data access and processing capabilities of the network device in the distributed architecture are superior to those of the device in the centralized architecture. Optionally, the network device may alternatively be in a form in which only one card is present. Specifically, there is no switching board, and the functions of the interface board and the main control board are integrated on the card. In this case, the central processing unit on the interface board and the central processing unit on the main control board may be combined to form one central processing unit on the card, which performs the functions obtained by combining the two central processing units. Devices of this form (e.g., network devices such as low-end switches or routers) have weak data exchange and processing capabilities. The specific architecture used depends on the specific networking deployment scenario, which is not limited here.
[0229] In some possible embodiments, the network device may be implemented as a virtualized device. For example, the virtualized device may be a virtual machine (VM) on which a program having a packet transmission function is executed, and the virtual machine is deployed on a hardware device (e.g., a physical server). The virtual machine is a fully software-simulated computer system that has a complete hardware system function and runs in a completely isolated environment. The virtual machine may be configured as a network device. For example, the network device may be implemented based on a general-purpose physical server combined with network functions virtualization (NFV) technology. The network device is a virtual host, a virtual router, or a virtual switch. By reading this application, a person skilled in the art can obtain a network device having the above-mentioned functions on a general-purpose physical server through virtualization with reference to NFV technology. Deegresses are not described here.
[0230] It should be understood that the network devices in the above product forms may separately have any of the functions of the network devices in the above method embodiments. Deegresses will not be described here.
[0231] One embodiment of the present application provides a computer program product, which, when executed on a network device, enables the network device to perform a method provided in any one of the aforementioned method embodiments.
[0232] An embodiment of this application further provides a chip system including a processor and an interface circuit. The interface circuit is configured to receive an instruction and send the instruction to the processor. The processor may be configured to execute the instruction to enable the network device to perform the method provided in the embodiment of this application. The processor is coupled to a memory, and the memory is configured to store a program or instruction. When the program or instruction is executed by the processor, the chip system is enabled to perform the method in any one of the embodiments of the method described above.
[0233] Optionally, there may be one or more processors in the chip system. The processor may be implemented by hardware or by software. If the processor is implemented by hardware, the processor may be a logic circuit, an integrated circuit, etc. If the processor is implemented by software, the processor may be a general-purpose processor and is implemented by reading software code stored in a memory.
[0234] Optionally, there may also be one or more memories in the chip system. The memory may be integrated with the processor or may be located remotely from the processor. This is not limited in this application. For example, the memory may be a non-transitory processor, such as a read-only memory, a dedicated memory, ROM. The memory and the processor may be integrated into the same chip, or may be located separately on different chips. The type of memory and the manner in which the memory and the processor are located are not particularly limited in this application.
[0235] For example, the chip system may be a field programmable gate array (FPGA), an application-specific integrated circuit (ASIC), a system on chip (SoC), a CPU, NP, a digital signal processor (DSP), a micro controller unit (MCU), a programmable logic device (PLD), or another integrated chip.
[0236] All of the above technical solutions can be formed, through any combination, into any embodiment of this disclosure. The deegresses will not be described again here.
[0237] Those skilled in the art will understand that all or part of the steps of the foregoing embodiments can be implemented by hardware or a program instructing related hardware. The program can be stored in a computer-readable storage medium. The storage medium can be a read-only memory, a magnetic disk, an optical disk, etc.
[0238] The above description is merely an optional embodiment of this application, but is not intended to limit this application. Nohara Any modification, equivalent replacement or improvement made without departing from the spirit and scope of the present invention should fall within the scope of protection of this application.
Claims
1. 1. A method for advertising processing capabilities of a network device, comprising: The method is performed by a first network device, and includes: generating an advertising message; The advertisement message includes first instruction information; the first indication information is used to indicate a processing capability of the first network device; the processing capability of the first network device includes a processing capability of the first network device, when the first network device functions as a network device on a primary path for forwarding a packet and receives the packet including primary path information and secondary path information, ignoring secondary path information; the secondary path information is used to indicate one or more secondary paths for forwarding the packet when the primary path is unavailable. Steps and sending, by the first network device, the advertisement message to a second network device; A method comprising:
2. The method further comprises: receiving a first packet; the first packet includes first primary path information and first secondary path information; the first primary path information is used to indicate a first primary route for forwarding the first packet; the first secondary path information is used to indicate one or more first secondary paths for forwarding the first packet when the first primary route is unavailable; Steps and ignoring the first secondary path information and forwarding the first packet based on the first primary path information; The method of claim 1 , comprising:
3. The advertisement message is a Border Gateway Protocol (BGP) message or an Interior Gateway Protocol (IGP) message; The method of claim 1.
4. The first indication information is carried in a private route or a public route included in the BGP message; and A Virtual Private Network (VPN) route or the public route is a route for forwarding the service to which the packet belongs, or The first indication information is carried in an extended community attribute in the BGP message. The method according to claim 3.
5. The secondary path information includes one or more secondary SIDs; and the one or more secondary SIDs are SIDs assigned by one or more network devices having a multihoming relationship with the first network device.
5. The method according to any one of claims 1 to 4.
6. The first secondary path information includes one or more secondary SIDs; The first primary path information includes a primary SID, the primary SID is associated with the first network device; the step of ignoring the first secondary path information and forwarding the first packet based on the first primary path information includes: removing the one or more secondary SIDs by matching the primary SID with SIDs stored on the first network device; forwarding the first packet to a user side network device based on payload information carried in the first packet or based on an SID added after the one or more secondary SIDs are removed; The method of claim 2 , comprising:
7. The first secondary path information includes one or more secondary SIDs; The first primary path information includes a primary SID, the primary SID is associated with the first network device; the step of ignoring the first secondary path information and forwarding the first packet based on the first primary path information includes: skipping the one or more secondary SIDs by matching the primary SID with SIDs stored in the first network device, and forwarding the first packet based on a SID located after the one or more secondary SIDs; The method of claim 2 , comprising:
8. the first network device is a service-carrying intermediate network device or an egress network device; The first indication information is carried in the IGP message or the BGP message to advertise a link state. The method according to claim 3.
9. The second network device is a controller or an ingress network device that carries the service.
9. The method according to claim 4 or 8.
10. 1. A method for advertising processing capabilities of a network device, comprising: The method is performed by a second network device, and the method includes: receiving an advertisement message sent by a first network device; The advertisement message includes first instruction information; the first indication information is used to indicate a processing capability of the first network device; The processing capability of the first network device includes a processing capability of the first network device, when the first network device functions as a network device on a primary path for forwarding a packet and receives the packet including primary path information and secondary path information, ignoring secondary path information included in the packet; the secondary path information is used to indicate one or more secondary paths for forwarding the packet when the primary path is unavailable. Steps and determining, based on the first indication information, that the first network device has the processing capability, or determining, based on the first indication information, that the first network device does not have the processing capability; A method comprising:
11. The method further comprises: transmitting a first packet based on the fact that the first network device has the processing capability; the first packet carries first secondary path information and first primary path information; the first primary path information is used to indicate a first primary path for forwarding the first packet; the first secondary path information is used to indicate one or more first secondary paths for forwarding the first packet when the first primary path is unavailable; Step, or sending a first message to a third network device based on the fact that the first network device has the processing capability; The first message is used to instruct the third network device to obtain, based on the first message, first secondary path information and first primary path information carried in a first packet; the first packet is a packet transmitted by the third network device to the first network device; Step, The method of claim 10, comprising:
12. The method further comprises: transmitting a second packet based on the fact that the first network device does not have the processing capability; the second packet carries second primary path information but does not carry second secondary path information; the second primary path information is used to indicate a second primary path for forwarding the second packet; and the second secondary path information is used to indicate one or more second secondary paths for forwarding the second packet when the second primary path is unavailable. Steps, including: The method of claim 10.
13. A network device comprising a processor and a memory, the memory storing program code; The program code is loaded and executed by the processor to enable the network device to perform a method for advertising processing capabilities of a network device according to any one of claims 1 to 9. Network devices.
14. 1. A system for advertising processing capabilities of a network device, comprising: The first network device configured to perform the method according to any one of claims 1 to 9; The second network device configured to perform the method according to any one of claims 10 to 12; A system comprising:
15. a computer readable storage medium having program code stored thereon; When said program code is executed on a computer, said computer is capable of carrying out the method according to any one of claims 1 to 12. A computer-readable storage medium.
Citation Information
Patent Citations
System and method for protection against edge node failure
US9225592B2
Message forwarding path determination method, network node, and system
WO2020181992A1