Route selection method and related device

By sending quality metrics via BGP updates, the method enhances SR route selection to meet user expectations, addressing suboptimal choices in current SR networks.

JP7802942B2Active Publication Date: 2026-01-20HUAWEI TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
JP2024540771
Authority / Receiving Office
JP · JP
Patent Type
Patents
Current Assignee / Owner
Priority Date
2022-03-01
Filing Date
2022-12-21
Publication Date
2026-01-20
Estimated Expiration
2042-12-21

AI Technical Summary

Technical Problem

Current route selection methods in Segment Routing (SR) networks do not provide sufficient quality metrics for route selection, leading to suboptimal choices that fail to meet user expectations.

Method used

A method where a control entity sends metric information representing the quality of SR routes via Border Gateway Protocol (BGP) updates to ingress nodes, enabling informed route selection based on attributes like IGP metric, TE metric, delay, or packet loss rate.

Benefits of technology

Enables appropriate route selection that meets user expectations by providing quality-based decision-making for multiple SR routes, improving network performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 0007802942000001
    Figure 0007802942000001
  • Figure 0007802942000002
    Figure 0007802942000002
  • Figure 0007802942000003
    Figure 0007802942000003
Patent Text Reader

Abstract

The present application discloses a route selection method and related devices. A control entity determines first metric information of a first SR route, generates a first BGP update message including the first metric information, and sends the first BGP update message to an ingress node of the first SR route, where the first metric information represents a quality of the first SR route, and the first metric information is used for route selection on a plurality of routes, each of the plurality of routes having the same IP prefix of a destination node, and the plurality of routes includes the first SR route. According to the method, the control entity can send the metric information representing the quality of the SR route to the ingress node of the SR route by using a BGP update message, so that the route selection node for route selection can perform an appropriate route selection for a plurality of routes including the SR route based on the quality of the SR route. Thus, the route selection can meet a user's expectations for route selection.
Need to check novelty before this filing date? Find Prior Art

Description

[Technical Field]

[0001] This application claims priority to Chinese Patent Application No. 202210005282.9, entitled "SR POLICY INFORMATION PROCESSING METHOD, DEVICE, AND SYSTEM," filed with the State Intellectual Property Office of the People's Republic of China on January 5, 2022, the entire contents of which are incorporated herein by reference.

[0002] This application claims priority to Chinese Patent Application No. 202210197494.1, entitled "ROUTE SELECTION METHOD AND RELATED DEVICE," filed with the State Intellectual Property Office of China on March 1, 2022, which is incorporated herein by reference in its entirety.

[0003] The present application relates to the field of communication technologies, and in particular to a route selection method and related device. [Background technology]

[0004] Currently, a control entity can calculate a segment routing (SR) route and send the route information of the SR route to an ingress node of the SR route. In this way, the ingress node of the SR route can encapsulate the received packet based on the route information and send the packet via the SR route. In a network with an SR route, a route selection node for route selection needs to perform appropriate route selection based on user expectations. Summary of the Invention

[0005] Based on this, the embodiments of the present application provide a route selection method and related devices. A control entity can send metric information representing the quality of an SR route to an ingress node of the SR route by using a Border Gateway Protocol update (BGP update) message, so that the route selection node can perform appropriate route selection based on the metric information of the SR route. [Means for solving the problem]

[0006] According to a first aspect, the present application provides a route selection method. In the method, a control entity determines first metric information for a first SR route, generates a first BGP update message including the first metric information, and sends the first BGP update message to an ingress node (i.e., a first network device) of the first SR route, where the first metric information can represent the quality of the first SR route, and the first metric information is used for route selection over multiple routes, each of which has the same Internet Protocol (IP) prefix of a destination node, and the multiple routes includes the first SR route. In the method, the control entity can send the metric information representing the quality of the SR route to the ingress node of the SR route by using the BGP update message, so that the ingress node of the SR route can know the metric information of the SR route when acquiring route information of the SR route by using the BGP update message. In this way, the route selection node for route selection can perform appropriate route selection for routes that are repeated for multiple routes including SR routes based on the quality of the SR route, so that the route selection can meet the user's expectations for route selection.

[0007] In the present application, metric information is a quality attribute of a route and may be considered to represent the quality of the route or the cost of the route. The metric information may include, but is not limited to, at least one of the following information: an Interior Gateway Protocol (IGP) metric, a Traffic Engineering (TE) metric, a delay, or a packet loss rate. For example, if the metric information is a TE metric, a smaller value of the TE metric indicates a better quality of the route; otherwise, a larger value of the TE metric indicates a worse quality of the route. In another example, if the metric information is a delay, a smaller value of the delay indicates a better quality of the route; otherwise, a larger value of the delay indicates a worse quality of the route. In this embodiment of the present application, the BGP update message is extended to carry metric information of an SR route. It should be noted that in the method provided in this embodiment of the present application, the BGP update message may alternatively carry multiple types of metric information. In this case, a corresponding route selection policy may be configured on the route selection node. For example, priorities of multiple types of metric information may be set. If the metric information with higher priority is the same, the metric information with lower priority is taken into consideration.

[0008] In this embodiment of the present application, route selection refers to a route selection node selecting multiple routes to a destination node corresponding to an IP prefix, and generating a forwarding entry based on the selected route to guide the transmission of a service packet. The multiple routes from the route selection node to the destination node have the same IP prefix, and the next hops may be the same or different. The next hops of the multiple routes from the route selection node to the destination node may be repeated for different routes. Therefore, route selection may be understood as the selection of different routes in which the next hops of the multiple routes are repeated. However, a route corresponding to an IP prefix from the route selection node to the destination node may also be understood as a route corresponding to a route (e.g., an SR policy) from the route selection node to the destination node.

[0009] The SR path may be an SR policy, for example, the SR policy may be a Segment Routing over Internet Protocol version 6 (SRv6) policy or a Segment Routing Multi-Protocol Label Switching (SR MPLS) policy, or the SR path may be a Segment Routing-Traffic Engineering Tunnel (SR-TE Tunnel).

[0010] It should be noted that in the embodiments of the present application, the terms network device and node have the same meaning and can be understood and used interchangeably. A network device may be a communication device having a packet forwarding function, such as a switch, a router, a virtual routing device, or a virtual forwarding device. In some cases, the control entity may be an independently located controller, a network manager, or a route reflector (RR). Alternatively, in other cases, the control entity may be a network device having the function of the control entity in the embodiments of the present application. For ease of understanding and explanation, the following provides an explanation by using an example in which the control entity is a controller.

[0011] In some implementations, in a scenario where the first network device is an ingress node of both the first SR route and the second SR route, the method may further include a step of: a control entity determining second metric information for the second SR route, the second metric information representing a quality of the second SR route; the control entity generating a second BGP update message, the second BGP update message including the second metric information, the second metric information being used for route selection over multiple routes, the multiple routes including the second SR route; and the control entity sending the second BGP update message to the first network device, the first network device being an ingress node of the second SR route.

[0012] As an example, if the exit node of the first SR route may be a second network device and the exit node of the second SR route may be a third network device, corresponding to an IP prefix, the next hop of the route to the destination node may include the second network device and the third network device, and the multiple routes may include a first route and a second route, where the first route includes the first SR route and the second route includes the second SR route.

[0013] As another example, if the exit node of the first SR route and the exit node of the second SR route may both be a second network device, a next hop of a route to the destination node corresponding to the IP prefix may include the second network device, and the multiple routes include a first route and a second route, where the first route includes the first SR route and the second route includes the second SR route.

[0014] In this implementation, in some cases, the first metric information is used by the first network device to perform route selection for multiple paths, where the first path may include only the first SR path and the second path may include only the second SR path.

[0015] In another case, the first network device is connected to a fourth network device, and the first metric information is used by the fourth network device to perform route selection for multiple paths, where the first path may further include a first segment path from the fourth network device to the first network device, and the metric information of the first path includes the first metric information and the third metric information of the first segment path.

[0016] In some other possible implementations, in a scenario where the first network device is an ingress node of a first SR route and the fifth network device is an ingress node of a third SR route, the method may further include a step of: a control entity determining fourth metric information of the third SR route, the fourth metric information representing a quality of the third SR route; the control entity generating a third BGP update message, the third BGP update message including the fourth metric information, the fourth metric information being used for route selection over multiple routes, the multiple routes including the third SR route; and the control entity sending the third BGP update message to the fifth network device, the fifth network device being an ingress node of the third SR route.

[0017] As an example, if the exit node of the first SR route may be the second network device and the exit node of the third SR route may be the third network device, corresponding to the IP prefix, the next hop of the route to the destination node may include the second network device and the third network device, the multiple routes include the first route and the third route, the first route includes the first SR route, and the third route includes the third SR route. In some cases, the first network device and the fifth network device are both connected to a fourth network device, and the first metric information is used by the fourth network device to perform route selection for the multiple routes.

[0018] The first route may further include a first segment route from the fourth network device to the first network device, and the third route may further include a second segment route from the fourth network device to a fifth network device, where the fifth metric information of the first route includes the first metric information and the sixth metric information of the first segment route, the seventh metric information of the third route includes the fourth metric information and the eighth metric information of the second segment route, and the fifth metric information and the seventh metric information are used by the fourth network device to perform route selection for the first route and the third route.

[0019] In some possible implementations, if the type of the first SR route is SR policy, the first BGP update message is a BGP SR policy packet.

[0020] As an example, the first SR path includes at least one candidate path, and the first metric information includes metric information of an operational path in the at least one candidate path. The first metric information may be carried in a Candidate Path Sub-TLV field corresponding to the operational path in the BGP SR policy packet. In this case, for example, determining the first metric information of the first segment routing SR path by the control entity may include the control entity obtaining metric information corresponding to at least one segment list of the operational path in the first SR path. The control entity may determine the first metric information based on metric information corresponding to the at least one segment list, and the first metric information may be a maximum value among metric information corresponding to the at least one segment list.

[0021] As another example, the first SR path includes at least one candidate path, a working path within the at least one candidate path includes at least one segment list, and the first metric information includes metric information corresponding to each of the at least one segment list. The first metric information can be carried in a Segment List Sub-TLV field corresponding to each segment list in the BGP SR policy packet.

[0022] In some other possible implementations, if the type of the first SR path may be SR-TE Tunnel, the BGP update message may be a BGP SR-TE Tunnel packet.

[0023] According to a second aspect, the present application further provides a route selection method. The method is applied to a first network device, and the first network device is an ingress node of a first SR and also a node having a route selection function. For example, the method may include a step in which the first network device acquires a first BGP update message generated by a control entity, the first BGP update message including first metric information of a first SR route, the first metric information representing a quality of the first SR route. Then, the first network device performs route selection for multiple routes to a destination node based on the first metric information, each of the multiple routes having the same Internet Protocol (IP) prefix of the destination node, and the multiple routes including the first SR route. In the method, the ingress node of the SR route (i.e., the first network device) may be found to know the metric information of the SR route when acquiring the route information of the SR route using the BGP update message. In this way, the first network device can perform appropriate route selection for a route that is repeated over multiple routes including the SR route based on the quality of the SR route, so that the route selection can meet the user's expectations for route selection.

[0024] In some possible implementations, when the first network device is still an ingress node of the second SR route, the method may further include the step of the first network device obtaining a second BGP update message generated by the control entity, the second BGP update message including second metric information of the second SR route, the second metric information representing a quality of the second SR route. In this manner, the first network device performing route selection for multiple routes to the destination node based on the first metric information may include the first network device performing route selection for multiple routes to the destination node based on the first metric information and the second metric information, where the multiple routes further include the second SR route.

[0025] As an example, for example, the first network device performing route selection for multiple routes to a destination node based on the first metric information and the second metric information may include the first network device associating a first route corresponding to an IP prefix with a first SR route such that third metric information of the first route includes the first metric information, and the first network device associating a second route corresponding to the IP prefix with a second SR route such that fourth metric information of the second route includes the second metric information. In this way, the first network device selects a first route from the first route and the second route based on the third metric information and the fourth metric information, a forwarding entry corresponding to the first route is used to guide packet forwarding from the first network device to a destination node, the quality of the first route represented by the third metric information is better than the quality of the second route represented by the fourth metric information, the multiple routes include the first route and the second route, the first route includes a first SR route, and the second route includes a second SR route.

[0026] In some possible implementations, if the type of the first SR route is SR policy, the BGP update message is a BGP SR policy packet. If the first SR route includes at least one candidate route, the first metric information includes metric information of an operational route in the at least one candidate route.

[0027] As an example, the first metric information is carried in a Candidate Path Sub-TLV corresponding to the operational route in a BGP SR policy packet.

[0028] As another example, the first SR route includes at least one candidate route, and an operational route within the at least one candidate route includes at least one segment list, and the first metric information includes metric information corresponding to each of the at least one segment list. In this case, the first metric information may be carried in a segment list sub-TLV field corresponding to each segment list in the BGP SR policy packet. In this example, the method provided in the present application may further include a step of: the first network device determining fifth metric information based on the first metric information, wherein the fifth metric information is metric information of an operational route within the first SR route, and the fifth metric information corresponds to the at least one segment list and is a maximum value within the metric information included in the first metric information. In this case, performing route selection for multiple routes to the destination node based on the first metric information by the first network device may include the first network device performing route selection for multiple routes to the destination node based on the fifth metric information.

[0029] In some other possible implementations, if the type of the first SR path may be SR-TE Tunnel, the BGP update message is a BGP SR-TE Tunnel packet.

[0030] The first metric information includes at least one of the following information: an IGP metric, a TE metric, a delay, or a packet loss rate.

[0031] According to a third aspect, the present application further provides a route selection method. The method is applied to a first network device. The first network device may be an ingress node of a first SR route, but the first network device may not be used as a route selection node for route selection. For example, the method includes the steps of: the first network device receiving a first BGP update message generated by a control entity, the first BGP update message including first metric information for the first SR route, the first metric information representing a quality of the first SR route, and the first metric information being used for route selection regarding multiple routes to a destination node, each of the multiple routes having the same Internet Protocol (IP) prefix of the destination node, and the multiple routes including the first SR route. Then, the first network device floods the first metric information. In this method, the ingress node of the SR route learns the metric information of the SR route when acquiring the route information of the SR route by using a BGP update message, and floods the metric information of the SR route within the network, so that the route selection node for route selection can notify the metric information of the SR route. In this way, the route selection node for route selection can perform appropriate route selection for a route repeated over multiple routes including the SR route based on the quality of the SR route, so that the route selection can meet user expectations for route selection.

[0032] As an example, the first network device flooding the first metric information may include the first network device flooding the first metric information according to an IGP.

[0033] In some possible implementations, the first metric information is used by a second network device to perform route selection for multiple paths to a destination node, the second network device being connected to the first network device, where the second network device is a route selection node for the route selection.

[0034] As an example, the multiple routes further include a second SR route, and the ingress node of the second SR route is the first network device. The method may further include the step of: the first network device obtaining a second BGP update message generated by the control entity, the second BGP update message including second metric information of the second SR route, the second metric information representing a quality of the second SR route, and the second metric information being used for route selection on the multiple routes to the destination node. Then, the first network device floods the second metric information.

[0035] In some possible implementations, if the type of the first SR route is SR policy, the BGP update message is a BGP SR policy packet. If the first SR route includes at least one candidate route, the first metric information includes metric information of an operational route in the at least one candidate route.

[0036] As an example, the first metric information may be carried in a Candidate Path Sub-TLV corresponding to the operational route in a BGP SR policy packet.

[0037] As another example, the first SR route includes at least one candidate route, and an operational route within the at least one candidate route includes at least one segment list, and the first metric information includes metric information corresponding to each of the at least one segment list. In this case, the first metric information may be carried in a segment list sub-TLV field corresponding to each segment list in the BGP SR policy packet. In this example, the method may further include a step of: the first network device determining third metric information based on the first metric information, the third metric information being metric information of an operational route within the first SR route, the third metric information corresponding to the at least one segment list, and being a maximum value among the metric information included in the first metric information, and the third metric information being used for route selection.

[0038] In some other possible implementations, if the type of the first SR path is SR-TE Tunnel, the BGP update message is a BGP SR-TE Tunnel packet.

[0039] The first metric information includes at least one of the following information: an IGP metric, a TE metric, a delay, or a packet loss rate.

[0040] According to a fourth aspect, the present application further provides a route selection device. The device may be used in a control entity and may include a first determining unit, a first generating unit, and a first sending unit. The first determining unit is configured to determine first metric information for a first segment routing (SR) route, the first metric information representing a quality of the first SR route. The first generating unit is configured to generate a first Border Gateway Protocol (BGP) update message, the first BGP update message including the first metric information, and the first metric information is used for route selection over multiple routes, each of the multiple routes having the same Internet Protocol (IP) prefix of a destination node, the multiple routes including the first SR route. The first sending unit is configured to send the first BGP update message to a first network device, the first network device being an ingress node of the first SR route.

[0041] In some possible implementations, the apparatus may further include a second determining unit, a second generating unit, and a second sending unit. The second determining unit is configured to determine second metric information of a second SR route, where the second metric information represents a quality of the second SR route. The second generating unit is configured to generate a second BGP update message, where the second BGP update message includes the second metric information, where the second metric information is used for route selection over multiple routes, where the multiple routes include the second SR route. The second sending unit is configured to send the second BGP update message to a first network device, where the first network device is an ingress node of the second SR route.

[0042] As an example, if the exit node of the first SR route is a second network device and the exit node of the second SR route is a third network device, the next hop of the route corresponding to the IP prefix includes the second network device and the third network device, the multiple routes include a first route and a second route, the first route includes the first SR route, and the second route includes the second SR route.

[0043] As another example, if the exit node of the first SR route and the exit node of the second SR route are both a second network device, the next hop of the route corresponding to the IP prefix includes the second network device, the multiple routes include a first route and a second route, the first route includes the first SR route, and the second route includes the second SR route.

[0044] In some cases, the first metric information is used by the first network device to perform route selection for multiple paths.

[0045] In another case, the first network device is connected to a fourth network device, and the first metric information is used by the fourth network device to perform route selection for multiple paths, where if the first path further includes a first segment path from the fourth network device to the first network device, the metric information of the first path includes the first metric information and the third metric information of the first segment path.

[0046] In some possible implementations, the apparatus may further include a third determining unit, a third generating unit, and a third sending unit. The third determining unit is configured to determine fourth metric information of a third SR route, where the fourth metric information represents a quality of the third SR route. The third generating unit is configured to generate a third BGP update message, where the third BGP update message includes the fourth metric information, where the fourth metric information is used for route selection over multiple routes, where the multiple routes include the third SR route. The third sending unit is configured to send the third BGP update message to a fifth network device, where the fifth network device is an ingress node of the third SR route.

[0047] As an example, if the exit node of the first SR route is a second network device and the exit node of the third SR route is a third network device, the next hop of the route corresponding to the IP prefix includes the second network device and the third network device, the multiple routes include a first route and a third route, the first route includes the first SR route, and the third route includes the third SR route.

[0048] As another example, the first network device and the fifth network device are both connected to a fourth network device, and the first metric information is used by the fourth network device to perform route selection for multiple paths. If the first path further includes a first segment path from the fourth network device to the first network device, and the third path further includes a second segment path from the fourth network device to the fifth network device, the fifth metric information of the first path includes the first metric information and the sixth metric information of the first segment path, the seventh metric information of the third path includes the fourth metric information and the eighth metric information of the second segment path, and the fifth metric information and the seventh metric information are used by the fourth network device to perform route selection for the first path and the third path.

[0049] In some possible implementations, if the type of the first SR route is a segment routing policy (SR policy), the first BGP update message is a BGP SR policy packet. If the first SR route includes at least one candidate route, the first metric information includes metric information of an operational route in the at least one candidate route.

[0050] For example, the first metric information is carried in a Candidate Path Sub-TLV corresponding to the operational path in the BGP SR policy packet. In this case, the first determining unit may include an acquiring subunit and a determining subunit. The acquiring subunit is configured to acquire metric information corresponding to at least one segment list of the operational path in the first SR path. The determining subunit is configured to determine the first metric information based on the metric information corresponding to the at least one segment list.

[0051] The first metric information is the maximum value among the metric information corresponding to at least one segment list.

[0052] As another example, the first SR path includes at least one candidate path, and an operational path within the at least one candidate path includes at least one segment list, and the first metric information includes metric information corresponding to each of the at least one segment list, in which case the first metric information is carried in a segment list sub-TLV field corresponding to each segment list in the BGP SR policy packet.

[0053] In some other possible implementations, if the type of the first SR path is SR-TE Tunnel, the BGP update message is a BGP SR-TE Tunnel packet.

[0054] The first metric information includes at least one of the following information: IGP metric, TE metric, bandwidth, delay, or loss rate.

[0055] Please note that for specific implementation forms of the device provided in the present application and the technical effects achieved, please refer to the method provided in the first aspect.

[0056] According to a fifth aspect, the present application provides a route selection apparatus. The apparatus is used in a first network device and may include a first obtaining unit and a route selection unit. The first obtaining unit is configured to obtain a first BGP update message generated by a control entity, the first BGP update message including first metric information of a first segment routing (SR) route, the first metric information representing a quality of the first SR route. The route selection unit is configured to perform route selection for multiple routes to a destination node based on the first metric information, each of the multiple routes having the same Internet Protocol (IP) prefix of the destination node, and the multiple routes including the first SR route.

[0057] In some possible implementation forms, the apparatus may further include a second acquiring unit, which is configured to acquire a second BGP update message generated by the control entity, the second BGP update message including second metric information of a second SR route, and the second metric information representing a quality of the second SR route. In this case, the route selecting unit is specifically configured to perform route selection for a plurality of routes to the destination node based on the first metric information and the second metric information, and the plurality of routes further includes the second SR route.

[0058] As an example, the route selection unit is specifically configured to associate a first route corresponding to an IP prefix with a first SR route such that third metric information of the first route includes first metric information, associate a second route corresponding to the IP prefix with a second SR route such that fourth metric information of the second route includes second metric information, select a first route from the first route and the second route based on the third metric information and the fourth metric information, a forwarding entry corresponding to the first route is used to guide packet forwarding from the first network device to a destination node, a quality of the first route represented by the third metric information is better than a quality of the second route represented by the fourth metric information, and the multiple routes include a first route and a second route, the first route includes the first SR route, and the second route includes the second SR route.

[0059] In some possible implementations, if the type of the first SR route is SR policy, the BGP update message is a BGP SR policy packet.

[0060] In some other possible implementations, if the type of the first SR path is SR-TE Tunnel, the BGP update message is a BGP SR-TE Tunnel packet.

[0061] The first metric information includes at least one of the following information: IGP metric, TE metric, bandwidth, delay, or loss rate.

[0062] Please note that for specific implementation forms of the device provided in the present application and the technical effects achieved, please refer to the method provided in the second aspect.

[0063] According to a sixth aspect, the present application provides a route selection apparatus. The apparatus is used in a first network device and may include a first acquiring unit and a first flooding unit. The first acquiring unit is configured to acquire a first Border Gateway Protocol (BGP) update message generated by a control entity, the first BGP update message including first metric information for a first segment routing (SR) route, the first metric information representing a quality of the first SR route, and the first metric information is used for route selection over multiple routes to a destination node, each of the multiple routes having the same Internet Protocol (IP) prefix of the destination node, and the multiple routes including the first SR route. The first flooding unit is configured to flood the first metric information.

[0064] As an example, the first flooding unit is specifically configured to flood the first metric information according to the IGP.

[0065] As an example, the first metric information is used by a second network device to perform route selection for multiple paths to a destination node, the second network device being connected to the first network device.

[0066] In some possible implementations, the multiple routes further include a second SR route, an ingress node of the second SR route is the first network device, and the apparatus may further include a second acquiring unit and a second flooding unit. The second acquiring unit is configured to acquire a second BGP update message generated by the control entity, the second BGP update message including second metric information of the second SR route, the second metric information representing a quality of the second SR route, and the second metric information being used for route selection regarding the multiple routes to the destination node. The second flooding unit is configured to flood the second metric information.

[0067] In some possible implementations, if the type of the first SR route is SR policy, the BGP update message is a BGP SR policy packet.

[0068] In some other possible implementations, if the type of the first SR path is SR-TE Tunnel, the BGP update message is a BGP SR-TE Tunnel packet.

[0069] The first metric information includes at least one of the following information: IGP metric, TE metric, bandwidth, delay, or loss rate.

[0070] Please note that for specific implementation forms of the device provided in the present application and the technical effects achieved, please refer to the method provided in the third aspect.

[0071] According to a seventh aspect, the present application provides a control entity, the control entity including a processor and a memory, the memory configured to store instructions or program code, and the processor configured to call the instructions or program code from the memory and execute the instructions or program code in order to perform a method according to the first aspect or any one of the possible implementation forms of the first aspect.

[0072] According to an eighth aspect, the present application provides a network device, the network device including a processor and a memory, the memory configured to store instructions or program code, and the processor configured to call the instructions or program code from the memory and execute the instructions or program code to perform a method according to the second aspect or any one of the possible implementation forms of the second aspect.

[0073] According to a ninth aspect, the present application provides a network device, the network device including: a processor and a memory, the memory configured to store instructions or program code, and the processor configured to call the instructions or program code from the memory and execute the instructions or program code to perform a method according to the third aspect or any one of the possible implementation forms of the third aspect.

[0074] According to a tenth aspect, the present application provides a communication system. The communication system may include a first network device and a control entity. The first network device is configured to perform a method according to the second aspect or any one of possible implementation forms of the second aspect. The control entity is configured to perform a method according to the first aspect or any one of possible implementation forms of the first aspect. The first network device may be a route selection device provided in the fifth aspect, and the control entity may be a route selection device provided in the fourth aspect. Alternatively, the first network device is configured to perform a method according to the third aspect or any one of possible implementation forms of the third aspect. The control entity is configured to perform a method according to the first aspect or any one of possible implementation forms of the first aspect. The first network device may be a route selection device provided in the sixth aspect, and the control entity may be a route selection device provided in the fourth aspect.

[0075] According to an eleventh aspect, the present application provides a computer-readable storage medium comprising instructions, a program, or code, which, when executed on a computer, enables the computer to perform a method according to the first aspect or any one of possible implementations of the first aspect, a method according to the second aspect or any one of possible implementations of the second aspect, and a method according to the third aspect or any one of possible implementations of the third aspect.

[0076] According to a twelfth aspect, the present application provides a computer program product, which, when operating on a network device, enables the network device to perform a method according to the first aspect or any one of possible implementations of the first aspect, a method according to the second aspect or any one of possible implementations of the second aspect, and a method according to the third aspect or any one of possible implementations of the third aspect. [Brief explanation of the drawings]

[0077] [Figure 1a] 1 is a schematic diagram of the structure of a network scenario according to the present application; [Figure 1b] 1 is a schematic diagram of the structure of a network scenario according to the present application; [Figure 2] 1 is a schematic flow chart of a route selection method 100 according to the present application. [Figure 3] 1 is a schematic diagram of a Sub-TLV field carrying metric information according to the present application; [Figure 4a] 1 is a schematic diagram of the structure of a network scenario according to the present application; [Figure 4b] FIG. 2 is a schematic diagram of the structure of another network scenario according to the present application; [Figure 4c] FIG. 10 is a schematic diagram of the structure of yet another network scenario according to the present application. [Figure 5] 2 is a schematic flow chart of another route selection method 200 according to the present application. [Figure 6a] 1 is a schematic diagram of the structure of a network scenario according to the present application; [Figure 6b] FIG. 2 is a schematic diagram of the structure of another network scenario according to the present application; [Figure 6c] FIG. 10 is a schematic diagram of the structure of yet another network scenario according to the present application. [Figure 6d] FIG. 10 is a schematic diagram of the structure of yet another network scenario according to the present application. [Figure 7] 1 is a schematic diagram of the structure of a network scenario according to the present application; [Figure 8] 8 is a schematic diagram of the structure of a route selection device 800 according to the present application. [Figure 9] 9 is a schematic diagram of the structure of another route selection device 900 according to the present application. [Figure 10] 10 is a schematic diagram of the structure of another route selection device 1000 according to the present application. [Figure 11] 11 is a schematic diagram of the structure of a control entity 1100 according to the present application. [Figure 12] 12 is a schematic diagram of the structure of a network device 1200 according to the present application. [Figure 13] 13 is a schematic diagram of the structure of another network device 1300 according to the present application. [Figure 14] 14 is a schematic diagram of the architecture of a communication system 1400 according to the present application. DETAILED DESCRIPTION OF THE INVENTION

[0078] An SR route is used to guide the forwarding of packets on an SR route by encapsulating an ordered segment list at the ingress node of the SR route according to a source routing mechanism. Typically, the segment list may be generated after a control entity performs route computation. In some cases, the control entity may be a module with a route computation function in the ingress node of the SR route. In this case, the ingress node of the SR route may obtain the segment list corresponding to the SR route from the control entity. In another case, the control entity may alternatively be an independently deployed controller or network management device. In this case, the controller or network management device may include the segment list in a BGP update message or a Path Computation Element Communication Protocol (PCEP) message and send the segment list to the ingress node of the SR route according to the Border Gateway Protocol (BGP) or PCEP.

[0079] When there are multiple routes from a route selection node to the same destination, the route selection node performs route selection according to a preset policy. Currently, the preset policy includes at least one of the following policies: protocol preferred value of the route, local route priority, preference for the local route, preference for a route with a small IGP metric, or preference for a route advertised by a router with a small router identifier (Router ID). When the preset policy includes multiple policies, the multiple policies have a priority. For example, the preset policy includes the protocol preferred value of the route and the local route priority. If the priority of the protocol preferred value of the route is higher than the priority of the local route priority, the protocol preferred values ​​of the multiple routes are considered first during route selection. If the two priorities are different, route selection is performed based on the protocol preferred value of the route. If the two priorities are the same, the local route priority is considered, and route selection is performed based on the local route priority. In a practical scenario, the IGP metric of the route should be given more consideration during route selection. In other words, if the protocol preferred value, route priority, local route, etc. of the routes in the preset policy are all the same, the route with the smallest IGP metric is selected. If the protocol preferred value, route priority, local route, IGP metric, etc. of the routes in the preset policy are all the same, other route attributes are considered. For example, the route advertised by the network device with the smallest router ID is selected. In this case, the planning requirements of the network device are very high and it is difficult to meet expectations.

[0080] The current route selection process is explained by using the network shown in Figure 1a as an example.

[0081] 1a, the network may include a Customer Edge (CE) device 1, a CE device 2, a Provider Edge (PE) device 1, a PE device 2, a PE device 3, a Provider (P) device 1, a P device 2, a P device 3, a P device 4, and a controller 50. CE device 1 is connected to PE device 1, which is connected to PE device 2 in turn via P device 1 and P device 2, which is further connected to PE device 3 in turn via P device 3 and P device 4, and both PE device 2 and PE device 3 are connected to CE device 2. CE device 1 is connected to PE device 1. The path along which PE device 1 is connected to PE device 2 in turn via P device 1 and P device 2 may be an SR path recorded as SR path 1. The path along which PE device 1 is connected to PE device 3 in turn via P device 3 and P device 4 may be recorded as SR path 2. Assuming that the prefix of the Internet Protocol (IP) address of CE device 2 (hereinafter referred to as IP prefix) is 10.1.1.1 and CE device 2 can advertise a route with the IP prefix 10.1.1.1 within the network via PE device 2 and PE device 3, PE device 1 receives route 1 with the IP prefix 10.1.1.1 advertised by PE device 2 and route 2 with the IP prefix 10.1.1.1 advertised by PE device 3, where the next hop of route 1 is PE device 2 and the next hop of route 2 is PE device 3.

[0082] In the network shown in FIG. 1a, the current route selection scheme may include, for example, that the route from PE device 1 to CE device 2 includes two next hops, namely, PE device 2 and PE device 3. Controller 50 performs route computation and sends BGP update message 1 and BGP update message 2 to PE device 1. BGP update message 1 carries segment list 1 of SR path 1, and BGP update message 2 carries segment list 2 of SR path 2. Segment list 1 includes, in order, the segment identifiers (SIDs) of PE device 1, P device 1, P device 2, and PE device 2, and segment list 2 includes, in order, the SIDs of PE device 1, P device 3, P device 4, and PE device 3. That is, PE device 1 is the ingress node of SR path 1 and SR path 2, the egress node of SR path 1 is PE device 2, and the egress node of SR path 2 is PE device 3. Then, route 1 from PE device 1 to CE device 2 is repeated for SR path 1, and route 2 from PE device 1 to CE device 2 is repeated for SR path 2. Note that the route from PE device 1 to CE device 2 has multiple next hops, and each next hop is repeated for a different SR path. Load sharing may be performed among different SR paths, or route selection may be performed according to a preset policy. Note that this embodiment of the present application relates to performing route selection for a route including different SR paths.PE device 1 may then perform route selection according to a preset policy, such as at least one of a protocol preferred value in the route, a local route priority, a preference for a local route, a preference for a route with a small IGP metric, or a preference for a route advertised by a router with a small router identifier (Router ID), to select route 1 whose next hop is PE device 2 or route 2 whose next hop is PE device 3. Thus, PE device 1 generates a forwarding entry based on the selected route to direct packets received by PE device 1 and having a value in the destination address field that matches 10.1.1.1.

[0083] It can be seen that currently, network devices only obtain route information of SR routes by using BGP update messages, but cannot obtain the quality of the SR routes. That is, BGP update messages do not carry attributes (hereinafter referred to as metric information) that can represent the quality of the SR routes. As a result, the PE device 1 cannot know the quality of the SR routes whose routes are repeated, and cannot select a high-quality route expected by the user.

[0084] Based on this, one embodiment of the present application provides a route selection method so that an ingress node of an SR route can know metric information of the SR route when acquiring route information of the SR route. In this way, a route selection node for route selection can perform route selection of an iterated route for multiple routes including the SR route by referring to the quality of the SR route. In a specific implementation, for example, the method may include a control entity determining first metric information representing the quality of a first SR route, generating a first BGP update message carrying the first metric information, and sending the first BGP update message to an ingress node of the first SR route (i.e., a first network device). In some cases, if the first network device has a route selection function, in other words, if the first network device is a route selection node, the first network device obtains the first metric information of the first SR route from the received first BGP update message and performs route selection for multiple routes to a destination node based on the first metric information, each of the multiple routes having the same IP prefix of the destination node, and the multiple routes including the first SR route. In another case, if the first network device is not a route selection node, the first network device floods first metric information, and the route selection node performs route selection for multiple routes to a destination node based on the received first metric information, each of the multiple routes having the same IP prefix of the destination node, and the multiple routes including the first SR route. According to this method, the control entity can send metric information representing the quality of the SR route to an ingress node of the SR route by using a BGP update message, and the route selection node can perform appropriate route selection for the multiple routes including the SR route based on the metric information of the SR route, so that it can be found that the route selection can meet user expectations for route selection.

[0085] It should be noted that metric information is a quality attribute of a route and may be considered to represent the quality of the route or the cost of the route. The metric information may include, but is not limited to, at least one of the following information: an Interior Gateway Protocol (IGP) metric, a Traffic Engineering (TE) metric, a delay, or a packet loss rate. For example, if the metric information is a TE metric, a smaller value of the TE metric indicates a better quality of the route; otherwise, a larger value of the TE metric indicates a worse quality of the route. In another example, if the metric information is a delay, a smaller value of the delay indicates a better quality of the route; otherwise, a larger value of the delay indicates a worse quality of the route. In this embodiment of the present application, the BGP update message is extended to carry metric information of an SR route. For a specific implementation, please refer to the related description of FIG. 3 in method 100. It should be noted that in the method provided in this embodiment of the present application, the BGP update message may alternatively carry multiple types of metric information. In this case, a corresponding route selection policy can be configured on the route selection node. For example, the priority of multiple types of metric information is set. If the metric information with higher priority is the same, the metric information with lower priority is considered.

[0086] It should be noted that in this embodiment of the present application, route selection refers to the route selection node selecting multiple routes to a destination node corresponding to an IP prefix, and generating a forwarding entry based on the selected route to guide the transmission of a service packet. The multiple routes from the route selection node to the destination node have the same IP prefix, and the next hops may be the same or different. The next hops of the multiple routes from the route selection node to the destination node may be repeated for different routes. Therefore, route selection may be understood as the selection of different routes in which the next hops of the multiple routes are repeated. However, a route corresponding to an IP prefix from the route selection node to the destination node may also be understood as a route corresponding to a path (e.g., an SR policy) from the route selection node to the destination node.

[0087] It should be noted that an SR path may be a segment routing policy (SR policy), where, for example, the SR policy may be a segment routing over Internet Protocol version 6 policy (SRv6 policy) or a segment routing multi-protocol label switching policy (SR MPLS policy), or the SR path may be a segment routing-traffic engineering tunnel (SR-TE Tunnel).

[0088] It should be noted that in the embodiments of the present application, the terms network device and node have the same meaning and can be understood and used interchangeably. A network device may be a communication device having a packet forwarding function, such as a switch, a router, a virtual routing device, or a virtual forwarding device.

[0089] It should be noted that in some cases, the control entity may be an independently deployed controller, a network manager, or a route reflector (RR). Alternatively, in other cases, the control entity may be a network device having the functionality of the control entity in the embodiments of the present application. For ease of understanding and explanation, the following provides an explanation by using an example in which the control entity is a controller.

[0090] The route selection method provided in the embodiment of the present application will be described through the network shown in Figure 1b. It should be noted that the network structures of Figure 1a and Figure 1b are the same, and the difference lies in the content carried in the BGP update message.

[0091] Assuming that CE device 2 has an IP prefix of 10.1.1.1 and CE device 2 can advertise a route with the IP prefix of 10.1.1.1 in the network via PE device 2 and PE device 3, PE device 1 receives route 1 with the IP prefix of 10.1.1.1 advertised by PE device 2 and route 2 with the IP prefix of 10.1.1.1 advertised by PE device 3, where the next hop of route 1 is PE device 2 and the next hop of route 2 is PE device 3. That is, the route from PE device 1 to the destination node, i.e., CE device 2, includes two next hops, i.e., PE device 2 and PE device 3. Controller 50 performs route computation to determine SR route 1 and SR route 2, where the ingress nodes of SR route 1 and SR route 2 are both PE device 1, the egress node of SR route 1 is PE device 2, and the egress node of SR route 2 is PE device 3. Thus, controller 50 sends BGP update message 1 and BGP update message 2 to PE device 1, where BGP update message 1 carries segment list 1 and metric information 1 of SR route 1, and BGP update message 2 carries segment list 2 and metric information 2 of SR route 2, where metric information 1 represents the quality of SR route 1, and metric information 2 represents the quality of SR route 2. Next, PE device 1 iterates route 1 to CE device 2 for SR route 1, so that route 1 inherits metric information 1 of SR route 1, and PE device 1 iterates route 2 to CE device 2 for SR route 2, so that route 2 inherits metric information 2 of SR route 2. Thus, PE device 1 selects route 1 and route 2 to CE device 2 based on metric information 1 of route 1 and metric information 2 of route 2, determines the route with better route quality, and generates a forwarding entry based on the selected route. For example, the quality of SR route 1 indicated by metric information 1 is better than the quality of SR route 2 indicated by metric information 2.In this case, when PE device 1 performs route selection, it selects route 1 and generates forwarding entry 1 based on route 1. In this way, when PE device 1 receives a packet whose destination address matches the IP prefix 10.1.1.1, it encapsulates segment list 1 of SR route 1 into the packet based on the instruction of forwarding entry 1 and forwards the encapsulated packet via SR route 1. In another example, the quality of SR route 2 indicated by metric information 2 is better than the quality of SR route 1 indicated by metric information 1. In this case, when PE device 1 performs route selection, it selects route 2 and generates forwarding entry 2 based on route 2. In this way, when PE device 1 receives a packet whose destination address matches the IP prefix 10.1.1.1, it encapsulates segment list 2 of SR route 2 into the packet based on the instruction of forwarding entry 2 and forwards the encapsulated packet via SR route 2.

[0092] In this way, when performing route selection for multiple routes to a destination node (each of the multiple routes having the same IP prefix of the destination node), the route selection node can select a route with better quality (e.g., a route with lower delay, lower packet loss rate, smaller IGP metric, or smaller TE metric) based on the user's expectations. In addition, in this method, when a user has an expectation of a route selection result, the user can configure better metric information for the expected route selection result on the controller 50, so that after the controller 50 transmits the metric information to the route selection node, the route selection node can select a route that meets the user's expectations during route selection. For example, if the user expects the route selection result to be repeated on SR route 1, metric information (e.g., TE metric) smaller than the metric information of another route may be configured for SR route 1, so that the controller 50 forwards the metric information to the route selection node, and the route selection node selects route 1 to be repeated on SR route 1 based on the smaller metric information.

[0093] The above describes the embodiments of the present application in the form of scenario embodiments. Hereinafter, specific implementation forms of the embodiments of the present application will be described in detail with reference to Figures 2 and 5. In the method 100 shown in Figure 2, the first network device is an ingress node of a first SR route and is also a route selection node having a route selection function in the network. In the method 200 shown in Figure 5, the first network device is an ingress node of a first SR route but is not a route selection node having a route selection function in the network.

[0094] 2 is a schematic flowchart of a route selection method 100 according to an embodiment of the present application. To more clearly explain the method provided in the embodiment of the present application, the method 100 will be described in the form of an interaction between a control entity in a network and a first network device. The first network device is an ingress node of a first SR path and a route selection node of the network. Correspondingly, in the network shown in FIG. 1a or 1b, the first network device may be PE device 1, and the first SR path corresponds to SR path 1 or SR path 2. The control entity may be a controller 50 in the network shown in FIG. 2.

[0095] As shown in FIG. 2, the method 100 may include, for example, the following steps S101 to S105.

[0096] S101: A control entity determines first metric information of a first SR path, where the first metric information represents a quality of the first SR path.

[0097] As an example, the control entity may collect network topology and obtain a parameter value that can represent the quality of the first SR route through statistics collection, analysis, measurement, calculation, etc. and that is recorded as first metric information. For example, the type of the first metric information may be an IGP metric, a TE metric, a delay, or a packet loss rate. The difference between the IGP metric and the TE metric is that the IGP metric is an actual route cost obtained by performing route calculation based on the shortest route priority, while the TE metric may be set to a different value based on a user's expectation.

[0098] S102: A control entity generates a first BGP update message, the first BGP update message includes first metric information, the first metric information is used for route selection over multiple routes, each of the multiple routes having the same IP prefix of a destination node, and the multiple routes include a first SR route.

[0099] Based on the type of SR path, the control entity can generate different types of BGP update messages. As an example, if the type of the first SR path is a segment routing policy (SR policy), the first BGP update message is a BGP SR policy packet. As another example, if the type of the first SR path is an SR-TE tunnel, the first BGP update message is an SR-TE tunnel packet. Note that in a BGP update message, whether the BGP update message is a BGP SR policy packet or an SR-TE tunnel packet can be indicated by using a Subsequent Address Family Identifier (SAFI) field. For example, if SAFI=73 in the first BGP update message, it indicates that the first BGP update message is a BGP SR policy packet.

[0100] The control entity may extend the first BGP update message to carry the first metric information of the first SR route.

[0101] The first metric information and the manner of carrying the first metric information will be described using an example in which the first BGP update message is a first BGP SR policy packet.

[0102] The first SR path may include at least one candidate path, and at least one candidate path has only one working path. The candidate path may be associated with at least one segment list, and the multiple segment lists implement load balancing by using weight attributes corresponding to the segment lists.

[0103] As an example, the first metric information in the first BGP SR policy packet may include metric information of an operational path in at least one Candidate Path. In this case, before S102, method 100 further includes: the control entity acquires metric information corresponding to at least one segment list of the operational path in the first SR path. Then, the control entity determines the first metric information based on the acquired metric information corresponding to the at least one segment list. For example, the control entity records the maximum value in the acquired metric information corresponding to the at least one segment list as the first metric information. Suppose the operating path in the first SR path is Candidate Path 1, Candidate Path 1 includes segment list 1, segment list 2, and segment list 3, and metric information 1 of segment list 1 is 10, metric information 2 of segment list 2 is 20, and metric information 3 of segment list 3 is 5, then metric information 4 of Candidate Path 1 can be max{10,20,5}=20. The weights of segment list 1, segment list 2, and segment list 3 are Weight 1, Weight 2, and Weight 3, respectively.

[0104] For example, the first metric information may be carried in a Candidate Path Sub-TLV field corresponding to the operational route in the first BGP SR policy packet. The first metric information of the first SR route carried in the first BGP SR policy packet is placed in a Tunnel Encaps Attribute of the SR policy Network Layer Reachability Information (NLRI). For example, the associated content of the first SR route in the first BGP SR policy packet may be as follows: Candidate Path 1 Candidate Path 1 metric information 4=20 Segment list 1 Weight 1 Segment list 2 Weight 2 Segment list 3 Weight 3

[0105] For the format of the Candidate Path Sub-TLV field, see Figure 3. The Candidate Path Sub-TLV field may include a Type field, a Length field, a Metric Type field, a Flags field, and a Metric Value field. The value of the Type field indicates that the type of the Sub-TLV is Candidate Path Sub-TLV, and the Type field is used to carry metric information of the Candidate Path. The value of the Length field indicates the length of the Candidate Path Sub-TLV field. If the metric information corresponds to a different type, the Length field may have a different value. For example, for metric information of IGP metric or TE metric, the value of the Length field may indicate that the length of the Candidate Path Sub-TLV field is 6 bytes. The value of the Metric Type field indicates the type of metric information carried in the Candidate Path Sub-TLV field, and may indicate that the metric information of the Candidate Path can be IGP metric, TE metric, delay, or packet loss rate. The Flags field is not currently defined. The Metric Value field value is the value of the metric information of the Candidate Path. For example, Metric Type = IGP metric or TE metric, and Metric Value = 20. Another example is Metric Type = Delay, and Metric Value = 10 milliseconds. Another example is Metric Type = Packet Loss Rate, and Metric Value = 5%.

[0106] As another example, a working path within at least one candidate path included in the first SR path may include at least one segment list, and the first metric information in the first BGP SR policy packet may include metric information corresponding to each segment list in the at least one segment list. The first metric information may include metric information of the working path within the at least one Candidate Path. In this case, the first metric information may be carried in a Segment List Sub-TLV field of each segment list corresponding to the working path in the first BGP SR policy packet. The first metric information of the first SR path carried in the first BGP SR policy packet is placed in the Tunnel Encaps Attribute of the SR policy NLRI. For example, the relevant content of the first SR path in the first BGP SR policy packet may be as follows: Candidate Path 1 Segment list 1 Weight 1 Metric information 1=10 for segment list 1 Segment list 2 Weight 2 Metric information 2 of segment list 2=20 Segment list 3 Weight 3 Metric information 3=5 for segment list 3

[0107] The format of the Segment List Sub-TLV field is the same as the format of the Candidate Path Sub-TLV field shown in Figure 3, with the difference being that the value of the Type field in the Segment List Sub-TLV field indicates that the type of the Sub-TLV field is Segment List Sub-TLV, and the Type field may be used to carry metric information of the segment list.

[0108] It should be noted that in this example, the first metric information carried in the first BGP SR policy packet may be a set of metric information of at least one segment list. In this case, after obtaining the first metric information, the ingress node or route selection node of the first SR route may determine a value used to measure the quality of the first SR route based on the first metric information, and the value is used as a parameter that directly reflects the quality of the first SR route.

[0109] As yet another example, the first metric information in the first BGP SR policy packet may include metric information corresponding to each segment list in at least one segment list and metric information of the operational route, so that a node that acquires the metric information of the first SR route can know both the quality of the operational route and the quality of each segment list. For example, the relevant content of the first SR route in the first BGP SR policy packet may be as follows: Candidate Path 1 Candidate Path 1 metric information 4=20 Segment list 1 Weight 1 Metric information 1=10 for segment list 1 Segment list 2 Weight 2 Metric information 2 of segment list 2=20 Segment list 3 Weight 3 Metric information 3=5 for segment list 3

[0110] In this way, the control entity extends the BGP update message so that the BGP update message carries the first metric information of the first SR route, which provides a data base for the route selection node to later perform route selection expected by the user from multiple routes including the first SR route.

[0111] S103: The control entity sends a first BGP update message to a first network device, where the first network device is an ingress node of a first SR route.

[0112] S104: The first network device obtains a first BGP update message generated by a control entity.

[0113] S105. The first network device performs route selection for multiple routes to the destination node based on the first metric information, each of the multiple routes having the same IP prefix of the destination node, and the multiple routes including the first SR route.

[0114] It should be noted that before S105, the method 100 may further include a process in which the first network device obtains multiple routes corresponding to the IP prefix to the destination node. The process of obtaining the routes may be performed simultaneously with S101 to S104, or the process of obtaining the routes may be performed first and S101 to S104 may be performed next, or S101 to S104 may be performed first and the process of obtaining the routes may be performed next.

[0115] 1b is used as an example. The process by which PE device 1 obtains a route to CE device 2 may include: CE device 2 advertises an IP prefix 10.1.1.1 in the network via PE device 2 and PE device 3; PE device 1 receives route 1, whose IP prefix is ​​10.1.1.1 and is advertised by PE device 2, with the next hop of route 1 being PE device 2; PE device 1 further receives route 2, whose IP prefix is ​​10.1.1.1 and is advertised by PE device 3, with the next hop of route 2 being PE device 3. In this way, PE device 1 has multiple routes to CE device 2. Before generating a forwarding entry, PE device 1 may perform route selection for the route to CE device 2, and then generate a corresponding forwarding entry based on the route selection result.

[0116] To explain the route selection process of the first network device in S105 more clearly, an explanation is provided by using an example in which there are two paths to a destination node.

[0117] In some implementations, the method 100 may further include the following steps: S106: The control entity determines second metric information of the second SR route, where the second metric information represents a quality of the second SR route. S107: The control entity generates a second BGP update message, where the second BGP update message includes the second metric information, where the second metric information is used for route selection over multiple routes, where the multiple routes include the second SR route. S108: The control entity sends the second BGP update message to the first network device, where the first network device is an ingress node of the second SR route.

[0118] As an example, the multiple routes participating in the route selection include two routes, i.e., a first SR route and a second SR route, and both the ingress nodes of the first SR route and the second SR route are the first network device. When routes corresponding to the IP prefix of the destination node and received by the first network device include the first route and the second route. For example, S105 may be as follows: The first network device iterates the first route corresponding to the IP prefix of the destination node for the first SR route based on the next hop, so that the first route inherits the first metric information of the first SR route, and iterates the second route corresponding to the IP prefix of the destination node for the second SR route based on the next hop, so that the second route inherits the second metric information of the second SR route. Then, the first network device selects a route with better quality based on the first metric information of the first route and the second metric information of the second route. For example, if the quality represented by the first metric information is better than the quality represented by the second metric information, the route selection result in S105 is the first route. Therefore, the first network device can generate a first forwarding entry based on the first route, and the first forwarding entry guides the encapsulation and forwarding of packets whose destination addresses match the IP prefix of the destination node. In another example, if the quality represented by the second metric information is better than the quality represented by the first metric information, the route selection result in S105 is the second route. Therefore, the first network device can generate a second forwarding entry based on the second route, and the second forwarding entry guides the encapsulation and forwarding of packets whose destination addresses match the IP prefix of the destination node.

[0119] In some cases, the egress nodes of the first SR route and the second SR route are both the second network device. For example, see the network shown in FIG. 4a. P Device 1 is a route selection node and an ingress node of multiple SR routes and corresponds to the first network device in method 100. SR route 1 is from P Device 1 to PE Device 2 via P Device 2 and P Device 3. SR route 2 is from P Device 1 to PE Device 2 via P Device 4. BGP update message 1 sent by controller 50 to P Device 1 carries segment list 1 and metric information 1 for SR route 1. BGP update message 2 sent by controller 50 to P Device 1 carries segment list 2 and metric information 2 for SR route 2. In this way, P device 1 may repeat route 1 and route 2 to the same destination node (e.g., PE device 2 or another device connected to PE device 2) as SR route 1 and SR route 2, respectively, so that route 1 inherits metric information 1 of SR route 1, and route 2 inherits metric information 2 of SR route 2. Therefore, P device 1 can select a route with better quality from route 1 and route 2 based on metric information 1 and metric information 2. Assuming that the metric information is the TE metric, metric information 1=20, and metric information 2=100, the route selection result of P device 1 is route 1, and therefore, forwarding entry 1 is generated based on route 1. In this way, when P device 1 receives a packet whose destination address matches the IP prefix of the destination node, it encapsulates the packet based on forwarding entry 1 and forwards the packet along SR route 1.

[0120] In another case, the egress node of the first SR route is a second network device, and the egress node of the second SR route is a third network device. For example, see the network shown in FIG. 1b. PE device 1 is a route selection node and an ingress node of multiple SR routes and corresponds to the first network device in method 100. SR route 1 is from PE device 1 to PE device 2 via P device 1 and P device 2, and SR route 2 is from PE device 1 to PE device 3 via P device 3 and P device 4. BGP update message 1 sent by controller 50 to PE device 1 carries segment list 1 and metric information 1 for SR route 1, and BGP update message 2 sent by controller 50 to PE device 1 carries segment list 2 and metric information 2 for SR route 2. In this way, PE device 1 can repeat route 1 and route 2 to the same destination node (e.g., CE device 2) for SR route 1 and SR route 2, respectively, so that route 1 inherits metric information 1 of SR route 1, and route 2 inherits metric information 2 of SR route 2. Therefore, P device 1 can select a route with better quality from route 1 and route 2 based on metric information 1 and metric information 2.

[0121] As another example, the multiple routes participating in the route selection include two routes, a first route and a second route. The first route includes a first SR route, and the second route includes a second SR route. For example, the first route may further include a first segment route in addition to the first SR route, and the second route may further include a second segment route in addition to the second SR route. The route corresponding to the IP prefix of the destination node and received by the first network device includes the first route and the second route. In this case, for example, S105 may be as follows: The first network device iterates a first route corresponding to an IP prefix of a destination node for the first route based on the next hop, such that the third metric information of the first route includes the first metric information of the first SR route, and iterates a second route corresponding to an IP prefix of a destination node for the second SR route based on the next hop, such that the fourth metric information of the second route includes the second metric information of the second SR route. The first network device then selects a route with better quality based on the third metric information of the first route and the fourth metric information of the second route. If the first route includes the first SR route and the first segment route, the third metric information is the sum of the first metric information and the fifth metric information of the first segment route. If the first route includes only the first SR route, the third metric information is the same as the first metric information. If the second route includes the second SR route and the second segment route, the fourth metric information is the sum of the second metric information and the sixth metric information of the second segment route. If the second route includes only the second SR route, the fourth metric information is the same as the second metric information.

[0122] In some cases, the first route includes a first SR route and a first segment route, and the second route includes a second SR route and a second segment route. For example, see the network shown in FIG. 4b. PE device 1 is a route selection node and an ingress node of multiple routes and corresponds to the first network device in method 100. SR route 1 is from PE device 1 to P device 2 via P device 1. SR route 2 is from PE device 1 to P device 4 via P device 3. Segment route 1 is from P device 2 to PE device 2. Metric information for segment route 1 is metric information 3. Segment route 2 is from P device 4 to PE device 3. Metric information for segment route 2 is metric information 4. BGP update message 1 sent by controller 50 to PE device 1 carries segment list 1 and metric information 1 for SR route 1. BGP update message 2 sent by controller 50 to PE device 1 carries segment list 2 and metric information 2 for SR route 2. In this way, PE device 1 may repeat Route 1 and Route 2 to the same destination node (e.g., CE device 2) as SR Route 1 and SR Route 2, respectively, so that metric information 5 of Route 1 may be the sum of metric information 1 of SR Route 1 and metric information 3 of segment Route 1, and metric information 6 of Route 2 may be the sum of metric information 2 of SR Route 2 and metric information 4 of segment Route 2. Thus, PE device 1 can select a better quality route from Route 1 and Route 2 based on metric information 5 and metric information 6. Assume that the metric information is the TE metric, metric information 1=20, metric information 2=100, metric information 3=30, and metric information 4=10, metric information 5 corresponding to Route 1=(20+30)=50, metric information 6 corresponding to Route 2=(100+10)=110, and the route selection result of PE device 1 is Route 1. As a result, forwarding entry 1 is generated based on Route 1.Thus, when P device 1 receives a packet whose destination address matches the IP prefix of the destination node, it encapsulates the packet based on forwarding entry 1 and forwards the packet along SR route 1 of segment route 1.

[0123] In another case, the first route includes a first SR route and a first segment route, and the second route includes only a second SR route. For example, see the network shown in FIG. 4c. P Device 1 is a route selection node and an ingress node of multiple routes and corresponds to the first network device in method 100. SR route 1 is from P Device 1 via P Device 2 to P Device 3. SR route 2 is from P Device 1 via P Device 4 to PE Device 2. Segment route 1 is from P Device 3 to PE Device 2. Metric information for segment route 1 is metric information 3. BGP update message 1 sent by controller 50 to P Device 1 carries segment list 1 and metric information 1 for SR route 1. BGP update message 2 sent by controller 50 to P Device 1 carries segment list 2 and metric information 2 for SR route 2. In this way, P device 1 can repeat Route 1 and Route 2 to the same destination node (e.g., PE device 2 or another device connected to PE device 2) for SR route 1 and SR route 2, respectively. As a result, metric information 4 of Route 1 can be the sum of metric information 1 of SR route 1 and metric information 3 of segment route 1, and Route 2 inherits metric information 2 of SR route 2. Therefore, P device 1 can select a route with better quality from Route 1 and Route 2 based on metric information 4 and metric information 2. Assuming that the metric information is the TE metric, and metric information 1=20, metric information 2=100, and metric information 3=30, metric information 4 corresponding to Route 1=(20+30)=50, and metric information 2 corresponding to Route 2=100, and the route selection result of P device 1 is Route 1.

[0124] In this way, according to method 100, the control entity can send metric information representing the quality of the SR route to the ingress node of the SR route by using a BGP update message. When the route selection node is the ingress node of the SR route, the route selection node can perform appropriate route selection for multiple routes including the SR route based on the metric information of the SR route, so that the route selection can meet user expectations for route selection, thereby overcoming the problem that route selection cannot be performed based on user expectations because the metric information of the SR route is not taken into account in the current route selection.

[0125] 5 is a schematic flowchart of a route selection method 200 according to an embodiment of the present application. To more clearly explain the method provided in the embodiment of the present application, the method 200 will be described in the form of an interaction between a control entity in a network and a first network device. The first network device is an ingress node of a first SR path but is not a route selection node in the network.

[0126] As shown in FIG. 5, the method 200 may include, for example, the following steps S201 to S205.

[0127] S201: A control entity determines first metric information of a first SR path, where the first metric information represents a quality of the first SR path.

[0128] S202: A control entity generates a first BGP update message, the first BGP update message includes first metric information, the first metric information is used for route selection over multiple routes, each of the multiple routes having the same IP prefix of a destination node, and the multiple routes include a first SR route.

[0129] S203: The control entity sends a first BGP update message to a first network device, where the first network device is an ingress node of a first SR route.

[0130] S204: The first network device obtains a first BGP update message generated by a control entity, where the first BGP update message includes first metric information of the first SR route.

[0131] S205: The first network device floods the first metric information.

[0132] It should be noted that for the specific implementation forms and achieved effects of S201 to S204, please refer to the relevant descriptions of S101 to S104 in the method 100.

[0133] As an example, S205 may include: a first network device flooding first metric information in the network according to an IGP, so that a route selection node can detect the quality of the first SR route, and the quality of the first SR route is used as a criterion for the route selection node to perform route selection, thereby implementing a route selection that meets user expectations.

[0134] After S205, the method 200 further includes a process in which the route selection node performs route selection. For ease of explanation, an explanation is provided by using an example in which two paths to a destination node are included.

[0135] In some implementations, the method 200 may further include the following steps: S206: The control entity determines second metric information of the second SR route, where the second metric information represents a quality of the second SR route. S207: The control entity generates a second BGP update message, where the second BGP update message includes the second metric information, where the second metric information is used for route selection over multiple routes, where the multiple routes include the second SR route. S208: The control entity sends the second BGP update message to the first network device, where the first network device is an ingress node of the second SR route.

[0136] As an example, the multiple routes participating in the route selection include two routes: a first route and a second route. The first route includes a first segment route and a first SR route. The second route includes a first segment route and a second SR route. The first segment route is a route between a fourth network device and the first network device. The fourth network device is a route selection node. In this case, method 200 further includes the fourth network device performing route selection for the multiple routes to the destination node based on the first metric information and the second metric information, or the fourth network device performing route selection for the multiple routes to the destination node based on the fourth metric information and fifth metric information, where the fourth metric information is a sum of the first metric information and the third metric information of the first segment route, and the fifth metric information is a sum of the second metric information and the third metric information of the first segment route.

[0137] In some cases, the egress nodes of the first SR route and the second SR route are the second network device and the third network device, respectively. For example, see the network shown in FIG. 6a. PE device 1 is an ingress node of the multiple SR routes and corresponds to the first network device in method 200. PE device 4 is a route selection node and corresponds to the fourth network device in method 200. SR route 1 is from PE device 1 to PE device 2 via P device 1 and P device 2. SR route 2 is from PE device 1 to PE device 3 via P device 3 and P device 4. BGP update message 1 sent by controller 50 to PE device 1 carries segment list 1 and metric information 1 for SR route 1. BGP update message 2 sent by controller 50 to PE device 1 carries segment list 2 and metric information 2 for SR route 2. Then, PE device 1 can flood metric information 1 of SR route 1 and metric information 2 of SR route 2, so that a route selection node, i.e., PE device 4, obtains metric information 1 of SR route 1 and metric information 2 of SR route 2. In this way, PE device 4 can make route 1 to the same destination node (e.g., CE device 2) correspond to SR route 1 and segment route 3, and make route 2 correspond to SR route 2 and segment route 3. Therefore, PE device 4 can select a route having better quality from route 1 and route 2 based on metric information 1 and metric information 2, or PE device 4 can select a route having better quality from route 1 and route 2 based on metric information 4 and metric information 5, where metric information 4 is the sum of metric information 1 and metric information 3, and metric information 5 is the sum of metric information 2 and metric information 3.

[0138] In another case, the egress nodes of the first SR route and the second SR route are both the second network device. For example, see the network shown in FIG. 6b. P Device 1 is an ingress node of multiple SR routes and corresponds to the first network device in method 200, PE Device 1 is a route selection node and corresponds to the fourth network device in method 200, SR route 1 is from P Device 1 to PE Device 2 via P Device 2 and P Device 3, SR route 2 is from P Device 1 to PE Device 2 via P Device 4, BGP update message 1 sent by controller 50 to P Device 1 carries segment list 1 and metric information 1 of SR route 1, and BGP update message 2 sent by controller 50 to P Device 1 carries segment list 2 and metric information 2 of SR route 2. Next, P device 1 may flood metric information 1 of SR route 1 and metric information 2 of SR route 2, so that the route selection node, i.e., PE device 1, obtains metric information 1 of SR route 1 and metric information 2 of SR route 2. In this manner, PE device 1 may make route 1 to the same destination node (e.g., PE device 2 or another device connected to PE device 2) correspond to SR route 1 and segment route 1, and make route 2 correspond to SR route 2 and segment route 1. Therefore, PE device 1 may select a route having better quality from route 1 and route 2 based on metric information 1 and metric information 2, or PE device 1 may select a route having better quality from route 1 and route 2 based on metric information 4 and metric information 5, where metric information 4 is the sum of metric information 1 and metric information 3, and metric information 5 is the sum of metric information 2 and metric information 3.

[0139] As another example, the multiple routes participating in the route selection include two routes: a first route and a second route. The first route includes a first segment route, a first SR route, and a second segment route. The second route includes the first segment route, a second SR route, and a third segment route. The first segment route is a route between a fourth network device and the first network device. The fourth network device is a route selection node. In this case, method 200 further includes: the fourth network device performs route selection for the multiple routes to the destination node based on the first metric information and the second metric information. For example, the fourth network device performs route selection for multiple routes to the destination node based on sixth metric information and seventh metric information, where the sixth metric information is the sum of the first metric information, the third metric information of the first segment route, and the fourth metric information of the second segment route, and the seventh metric information is the sum of the second metric information, the third metric information of the first segment route, and the fifth metric information of the third segment route.

[0140] 6c, where PE device 1 is an ingress node of multiple SR routes and corresponds to the first network device in method 200, PE device 4 is a route selection node and corresponds to the fourth network device in method 200, SR route 1 is from PE device 1 via P device 1 to P device 2, SR route 2 is from PE device 1 via P device 3 to P device 4, segment route 1 is from P device 2 to PE device 2, segment route 2 is from P device 4 to PE device 3, and segment route 3 is from PE device 4 to PE device 1. In this case, BGP update message 1 sent by controller 50 to PE device 1 carries segment list 1 and metric information 1 of SR route 1, and BGP update message 2 sent by controller 50 to PE device 1 carries segment list 2 and metric information 2 of SR route 2. Then, PE device 1 can flood metric information 1 of SR route 1 and metric information 2 of SR route 2, so that a route selection node, i.e., PE device 4, obtains metric information 1 of SR route 1 and metric information 2 of SR route 2. In this way, PE device 4 can make route 1 to the same destination node (e.g., CE device 2) correspond to SR route 1, segment route 3, and segment route 1, and make route 2 correspond to SR route 2, segment route 3, and segment route 2. Therefore, PE device 4 can select a route having better quality from route 1 and route 2 based on metric information 6 and metric information 7, where metric information 6 is the sum of metric information 1 and metric information 3, and metric information 7 is the sum of metric information 2 and metric information 4, or metric information 6 is the sum of metric information 1, metric information 5, and metric information 3, and metric information 7 is the sum of metric information 2, metric information 5, and metric information 4.

[0141] In another case, see, for example, the network shown in Figure 6d, where P Device 1 is an ingress node of multiple SR routes and corresponds to the first network device in method 200, PE Device 1 is a route selection node and corresponds to the fourth network device in method 200, SR route 1 is from P Device 1 via P Device 2 to P Device 3, SR route 2 is from P Device 1 via P Device 4 to PE Device 2, segment route 1 is from PE Device 1 to P Device 1, and segment route 2 is from P Device 3 to PE Device 2. In this case, BGP update message 1 sent by controller 50 to P Device 1 carries segment list 1 and metric information 1 of SR route 1, and BGP update message 2 sent by controller 50 to P Device 1 carries segment list 2 and metric information 2 of SR route 2. Next, P device 1 may flood metric information 1 of SR route 1 and metric information 2 of SR route 2, so that the route selection node, i.e., PE device 1, obtains metric information 1 of SR route 1 and metric information 2 of SR route 2. In this manner, PE device 1 may make route 1 to the same destination node (e.g., PE device 2 or another device connected to PE device 2) correspond to SR route 1, segment route 2, and segment route 1, and make route 2 correspond to SR route 2 and segment route 1. Therefore, PE device 1 may select a route having better quality from route 1 and route 2 based on metric information 5 and metric information 2, where metric information 5 is the sum of metric information 1 and metric information 4 of segment route 2, or PE device 1 may select a route having better quality from route 1 and route 2 based on metric information 6 and metric information 7, where metric information 6 is the sum of metric information 1, metric information 4, and metric information 3, and metric information 7 is the sum of metric information 2 and metric information 3.

[0142] In this manner, according to method 200, the control entity can transmit metric information representing the quality of the SR route to the ingress node of the SR route by using a BGP update message. When the route selection node and the ingress node of the SR route are not the same network device, the ingress node of the SR route can flood the metric information of the SR route within the network. In this manner, the route selection node can detect the metric information of the SR route and perform appropriate route selection for multiple routes including the SR route based on the metric information of the SR route. As a result, the route selection can satisfy user expectations for route selection, thereby overcoming the problem that route selection cannot be performed based on user expectations because the metric information of the SR route is not taken into account in the current route selection.

[0143] In some possible implementations, when the network structure is complex, multi-layer route selection may further be included. In this case, the method provided in the embodiment of the present application may be used for route selection performed by each route selection node. In order to enhance the method provided in the embodiment of the present application, the method provided in the embodiment of the present application is described by using the network shown in Figure 7 as an example.

[0144] 7 , the network includes a controller 50, a PE device 1, a PE device 2, a PE device 3, a P device 1, a P device 2, a P device 3, a P device 4, and a CE device 2. SR path 1 is from P device 1 to PE device 2 via P device 2, SR path 2 is from P device 1 to PE device 2 via P device 4, SR path 3 is from P device 3 to PE device 3 via P device 4, segment path 1 is from PE device 1 to P device 1, and segment path 2 is from PE device 1 to P device 3. Metric information for SR path 1, SR path 2, SR path 3, segment path 1, and segment path 2 are metric information 1, metric information 2, metric information 3, metric information 4, and metric information 5, respectively. PE device 1 is a route selection node to CE device 2 whose IP prefix is ​​10.1.1.1. For example, the route selection process may include the following steps:

[0145] S301: PE device 2 advertises Route 1 to CE device 2 to PE device 1, where the IP prefix of Route 1 is 10.1.1.1 and the next hop is PE device 2. Optionally, the extended community attribute of Route 1 may further include color 1.

[0146] S302: PE device 3 advertises Route 2 to CE device 2 to PE device 1, where the IP prefix of Route 2 is 10.1.1.1 and the next hop is PE device 3. Optionally, the extended community attribute of Route 2 may further include color 1.

[0147] S303: Controller 50 sends BGP update message 1 and BGP update message 2 to P device 1, where BGP update message 1 indicates SR route 1 and metric information 1 of SR route 1 = 100, and BGP update message 2 indicates SR route 2 and metric information 2 of SR route 2 = 30.

[0148] S304: Route 1 of P device 1 uses SR route 2 as the outbound interface to CE device 2, and the metric information is the smaller value 30 of metric information 1 and metric information 2. That is, P device 1 selects Route 1 and iterates over SR route 2.

[0149] S305: The controller 50 sends a BGP update message 3 to the P device 3, and the BGP update message 3 indicates an SR route 3 and metric information 3 of the SR route 3=20.

[0150] S306: Route 2 of P device 3 uses SR route 3 as the outbound interface to CE device 2, and the metric information of SR route 3 is metric information 3=20. That is, P device 3 selects route 2 to repeat for SR route 3.

[0151] S307: P Device 1 floods metric information 2 for SR route 2, and P Device 3 floods metric information 3 for SR route 3.

[0152] S308: The next hop of Route 1, whose IP prefix is ​​10.1.1.1 on PE device 1, is PE device 2, Route 1 corresponds to segment route 1 and SR route 2, and metric information 6 of Route 1 = metric information 4 of segment route 1 + metric information 2 = (10 + 30) = 40. The next hop of Route 2, whose IP prefix is ​​10.1.1.1 on PE device 1, is PE device 3, Route 2 corresponds to segment route 2 and SR route 3, and metric information 7 of Route 2 = metric information 5 of segment route 2 + metric information 3 = (10 + 20) = 30.

[0153] S309: When route selection is performed for multiple paths from PE device 1 to CE 1, select the next hop, i.e., PE device 3 with smaller metric information, and send the service packet via segment path 2 and SR path 3.

[0154] It can be seen that in complex network scenarios, the method provided in the embodiments of the present application can still satisfy user expectations for route selection, and overcomes the problem that route selection cannot be performed based on user expectations because the metric information of SR routes is not taken into account in the current route selection.

[0155] It should be noted that the route selection method provided in the embodiment of the present application may alternatively include other preset route selection policies, such as a protocol preferred value in the route, a local route priority, a preference for a local route, a preference for a route with a small IGP metric, or a preference for a route advertised by a router with a small router ID. Specifically, the route selection policy may be configured on the route selection node based on actual requirements. For example, if route selection needs to be performed based on the metric information provided in this embodiment of the present application, a higher priority may be set for the metric information in route selection. Alternatively, the parameters in other route selection policies may be set to be the same, so that route selection is performed based on the metric information in an actual scenario.

[0156] It should be noted that the examples of network scenarios in the embodiments of the present application are only some applicable scenarios proposed to help readers easily understand the technical solutions provided in the embodiments of the present application, and are not intended to limit the scope of protection of the present application. The embodiments of the present application are also applicable to other route selection scenarios that cannot be listed one by one in the embodiments of the present application.

[0157] It should be noted that in the example network scenario in the embodiment of the present application, the P device may be a PE device or may be another suitable type of network device. The PE device may alternatively be a P device or may be another suitable type of network device. The suitable type of network device means that the corresponding position in the example network scenario can be located and the solution provided in the embodiment of the present application can be implemented.

[0158] It should be noted that in the example network scenarios in the embodiments of the present application, not all nodes between network devices are shown, and the network devices may be directly connected as shown in the accompanying drawings, or may be connected via some intermediate devices, as long as the implementation of the embodiments of the present application is not affected.

[0159] Correspondingly, an embodiment of the present application further provides a route selection apparatus 800. The apparatus 800 is used in a control entity, as shown in Figure 8. The apparatus 800 may include a first determining unit 801, a first generating unit 802, and a first sending unit 803.

[0160] The first determining unit 801 is configured to determine first metric information of a first segment routing SR path, where the first metric information represents a quality of the first SR path. The first determining unit 801 may perform S101 shown in FIG. 2, or may perform S201 shown in FIG. 5.

[0161] The first generating unit 802 is configured to generate a first Border Gateway Protocol Update (BGP) message, the first BGP message including first metric information, the first metric information being used for route selection over a plurality of routes, each of the plurality of routes having the same Internet Protocol (IP) prefix of a destination node, the plurality of routes including a first SR route. The first generating unit 802 may perform S102 shown in FIG. 2, or the first generating unit 802 may perform S202 shown in FIG. 5.

[0162] The first sending unit 803 is configured to send a first BGP update message to a first network device, where the first network device is an ingress node of a first SR route. The first sending unit 803 may perform S103 shown in FIG. 2, or may perform S203 shown in FIG. 5.

[0163] In some possible implementations, the apparatus 800 may further include a second determining unit, a second generating unit, and a second sending unit. The second determining unit is configured to determine second metric information of a second SR route, where the second metric information represents a quality of the second SR route. The second generating unit is configured to generate a second BGP update message, where the second BGP update message includes the second metric information, where the second metric information is used for route selection on multiple routes, where the multiple routes include the second SR route. The second sending unit is configured to send the second BGP update message to a first network device, where the first network device is an ingress node of the second SR route.

[0164] As an example, if the exit node of the first SR route is a second network device and the exit node of the second SR route is a third network device, the next hop of the route corresponding to the IP prefix includes the second network device and the third network device, the multiple routes include a first route and a second route, the first route includes the first SR route, and the second route includes the second SR route.

[0165] As another example, if the exit node of the first SR route and the exit node of the second SR route are both a second network device, the next hop of the route corresponding to the IP prefix includes the second network device, the multiple routes include a first route and a second route, the first route includes the first SR route, and the second route includes the second SR route.

[0166] In some cases, the first metric information is used by the first network device to perform route selection for multiple paths.

[0167] In another case, the first network device is connected to a fourth network device, and the first metric information is used by the fourth network device to perform route selection for multiple paths, where if the first path further includes a first segment path from the fourth network device to the first network device, the metric information of the first path includes the first metric information and the third metric information of the first segment path.

[0168] In some possible implementations, the apparatus 800 may further include a third determining unit, a third generating unit, and a third sending unit. The third determining unit is configured to determine fourth metric information of a third SR route, where the fourth metric information represents a quality of the third SR route. The third generating unit is configured to generate a third BGP update message, where the third BGP update message includes the fourth metric information, where the fourth metric information is used for route selection on multiple routes, where the multiple routes include the third SR route. The third sending unit is configured to send the third BGP update message to a fifth network device, where the fifth network device is an ingress node of the third SR route.

[0169] As an example, if the exit node of the first SR route is a second network device and the exit node of the third SR route is a third network device, the next hop of the route corresponding to the IP prefix includes the second network device and the third network device, the multiple routes include a first route and a third route, the first route includes the first SR route, and the third route includes the third SR route.

[0170] As another example, the first network device and the fifth network device are both connected to a fourth network device, and the first metric information is used by the fourth network device to perform route selection for multiple paths. If the first path further includes a first segment path from the fourth network device to the first network device, and the third path further includes a second segment path from the fourth network device to the fifth network device, the fifth metric information of the first path includes the first metric information and the sixth metric information of the first segment path, the seventh metric information of the third path includes the fourth metric information and the eighth metric information of the second segment path, and the fifth metric information and the seventh metric information are used by the fourth network device to perform route selection for the first path and the third path.

[0171] In some possible implementations, if the type of the first SR route is a segment routing policy (SR policy), the first BGP update message is a BGP SR policy packet. If the first SR route includes at least one candidate route, the first metric information includes metric information of an operational route in the at least one candidate route.

[0172] For example, the first metric information is carried in a Candidate Path Sub-TLV corresponding to the operational path in the BGP SR policy packet. In this case, the first determining unit 801 may include an acquiring subunit and a determining subunit. The acquiring subunit is configured to acquire metric information corresponding to at least one segment list of the operational path in the first SR path. The determining subunit is configured to determine the first metric information based on the metric information corresponding to the at least one segment list.

[0173] The first metric information is the maximum value among the metric information corresponding to at least one segment list.

[0174] As another example, the first SR path includes at least one candidate path, and an operational path within the at least one candidate path includes at least one segment list, and the first metric information includes metric information corresponding to each of the at least one segment list, in which case the first metric information is carried in a segment list sub-TLV field corresponding to each segment list in the BGP SR policy packet.

[0175] In some other possible implementations, if the type of the first SR path is SR-TE Tunnel, the BGP update message is a BGP SR-TE Tunnel packet.

[0176] The first metric information includes at least one of the following information: IGP metric, TE metric, bandwidth, delay, or loss rate.

[0177] Please note that for the specific implementation form and technical effects achieved of the apparatus 800 provided in the embodiments of the present application, please refer to the method 100 provided in FIG. 2 or the method 200 provided in FIG. 5.

[0178] Correspondingly, an embodiment of the present application further provides a route selection apparatus 900. The apparatus 900 is used in a first network device, as shown in Figure 9. The apparatus 900 may include a first obtaining unit 901 and a route selecting unit 902.

[0179] The first obtaining unit 901 is configured to obtain a first BGP update message generated by a control entity, the first BGP update message including first metric information of a first segment routing SR route, and the first metric information represents a quality of the first SR route. The first obtaining unit 901 can perform S104 shown in FIG. 2.

[0180] The route selection unit 902 is configured to perform route selection for a plurality of routes to a destination node based on the first metric information, each of the plurality of routes having the same Internet Protocol (IP) prefix of the destination node, and the plurality of routes including the first SR route. The route selection unit 902 may perform S105 shown in FIG.

[0181] In some possible implementations, the apparatus 900 may further include a second acquiring unit. The second acquiring unit is configured to acquire a second BGP update message generated by the control entity, where the second BGP update message includes second metric information of a second SR route, and the second metric information represents a quality of the second SR route. In this case, the route selecting unit 902 is specifically configured to perform route selection for multiple routes to the destination node based on the first metric information and the second metric information, where the multiple routes further include the second SR route.

[0182] As an example, the route selection unit 902 is specifically configured to: associate a first route corresponding to an IP prefix with a first SR route such that the third metric information of the first route includes the first metric information; associate a second route corresponding to the IP prefix with a second SR route such that the fourth metric information of the second route includes the second metric information; select a first route from the first route and the second route based on the third metric information and the fourth metric information; a forwarding entry corresponding to the first route is used to guide packet forwarding from the first network device to a destination node; a quality of the first route represented by the third metric information is better than a quality of the second route represented by the fourth metric information; and the multiple routes include a first route and a second route, the first route including the first SR route, and the second route including the second SR route.

[0183] In some possible implementations, if the type of the first SR route is SR policy, the BGP update message is a BGP SR policy packet.

[0184] In some other possible implementations, if the type of the first SR path is SR-TE Tunnel, the BGP update message is a BGP SR-TE Tunnel packet.

[0185] The first metric information includes at least one of the following information: IGP metric, TE metric, bandwidth, delay, or loss rate.

[0186] It should be noted that for the specific implementation form and technical effects achieved of the apparatus 900 provided in the embodiments of the present application, please refer to the method 100 provided in FIG.

[0187] Correspondingly, an embodiment of the present application further provides a route selection apparatus 1000. The apparatus 1000 is used in a first network device, as shown in Figure 10. The apparatus 1000 may include a first obtaining unit 1001 and a first flooding unit 1002.

[0188] The first obtaining unit 1001 is configured to obtain a first Border Gateway Protocol (BGP) update message generated by the control entity, the first BGP update message including first metric information of a first segment routing (SR) route, the first metric information representing a quality of the first SR route, the first metric information being used for route selection over multiple routes to a destination node, each of the multiple routes having the same Internet Protocol (IP) prefix of the destination node, and the multiple routes including the first SR route. The first obtaining unit 1001 can perform S204 shown in FIG. 5.

[0189] The first flooding unit 1002 is configured to flood the first metric information, and may perform S205 shown in FIG.

[0190] As an example, the first flooding unit 1002 is specifically configured to flood the first metric information according to the IGP.

[0191] As an example, the first metric information is used by a second network device to perform route selection for multiple paths to a destination node, the second network device being connected to the first network device.

[0192] In some possible implementations, the multiple routes further include a second SR route, and an ingress node of the second SR route is the first network device. The apparatus 1000 may further include a second acquiring unit and a second flooding unit. The second acquiring unit is configured to acquire a second BGP update message generated by the control entity, the second BGP update message including second metric information of the second SR route, the second metric information representing a quality of the second SR route, and the second metric information being used for route selection regarding the multiple routes to the destination node. The second flooding unit is configured to flood the second metric information.

[0193] In some possible implementations, if the type of the first SR route is SR policy, the BGP update message is a BGP SR policy packet.

[0194] In some other possible implementations, if the type of the first SR path is SR-TE Tunnel, the BGP update message is a BGP SR-TE Tunnel packet.

[0195] The first metric information includes at least one of the following information: IGP metric, TE metric, bandwidth, delay, or loss rate.

[0196] It should be noted that for the specific implementation form and technical effects achieved of the apparatus 1000 provided in the embodiments of the present application, please refer to the method 200 provided in FIG.

[0197] Referring to FIG. 11 , one embodiment of the present application provides a control entity 1100. The control entity 1100 may be the control entity or controller in any one of the aforementioned embodiments, for example, the controller 50 in FIG. 1a, FIG. 1b, FIG. 4a, FIG. 4b, FIG. 4c, FIG. 6a, FIG. 6b, FIG. 6c, FIG. 6d, or FIG. 7, or in another example, the control entity in method 100 or method 200. The control entity 1100 may implement the functions of various control entities or controllers in the aforementioned embodiments. The control entity 1100 includes at least one processor 1101, a bus system 1102, a memory 1103, and at least one communication interface 1104.

[0198] The control entity 1100 is a hardware-structured device and may be configured to implement the functional modules in the route selection device 800 shown in Figure 8. For example, those skilled in the art may understand that the first determining unit 801, the first generating unit 802, and the first sending unit 803 in the route selection device 800 shown in Figure 8 may be implemented by at least one processor 1101 by calling codes in the memory 1103.

[0199] Optionally, the control entity 1100 may be further configured to implement the functionality of the control entity in any one of the aforementioned embodiments.

[0200] Optionally, the processor 1101 may be a general-purpose central processing unit (CPU), a network processor (NP), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to control program execution of the solutions of the present application.

[0201] The bus system 1102 may include paths for transmitting information between the aforementioned components.

[0202] The communication interface 1104 is configured to communicate with another device or a communication network.

[0203] The memory 1103 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 other optical disk storage, optical disk storage (including compact discs, laser discs, optical discs, digital versatile discs, Blu-ray discs, etc.), a magnetic storage medium or other 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 may exist independently or be connected to the processor via a bus. Alternatively, the memory may be integrated with the processor.

[0204] The memory 1103 is configured to store application program code used to execute the solution of the present application, and the processor 1101 controls the execution. The processor 1101 is configured to execute the application program code stored in the memory 1103 to implement the functions of the method of the present application.

[0205] Among specific implementations, in one embodiment, the processor 1101 may include one or more CPUs, for example, CPU 0 and CPU 1 in FIG.

[0206] Among specific implementations, in one embodiment, control entity 1100 may include multiple processors, such as processor 1101 and processor 1107 of FIG. 11. Each of the processors may be a single-core (single-CPU) processor or a multi-core (multi-CPU) processor. A processor herein may be one or more devices, circuits, and / or processing cores configured to process data (e.g., computer program instructions).

[0207] Referring to FIG. 12, one embodiment of the present application provides a network device 1200 (which may also be referred to as a communication device 1200). The network device 1200 may be the network device in any one of the above-mentioned embodiments, for example, a node having a route selection function or an ingress node of an SR route in FIG. 1a, FIG. 1b, FIG. 4a, FIG. 4b, FIG. 4c, FIG. 6a, FIG. 6b, FIG. 6c, FIG. 6d, or FIG. 7, or in another example, may be the first network device in method 100 or method 200. The network device 1200 may implement the functions of various network devices in the above-mentioned embodiments. The network device 1200 includes at least one processor 1201, a bus system 1202, a memory 1203, and at least one communication interface 1204.

[0208] The network device 1200 is a hardware-structured device and may be configured to implement the functional modules in the route selection device 900 shown in FIG. 9. For example, those skilled in the art may understand that the first obtaining unit 901 and the route selection unit 902 in the route selection device 900 shown in FIG. 9 may be implemented by at least one processor 1201 by calling codes in the memory 1203. Alternatively, the network device 1200 is a hardware-structured device and may be configured to implement the functional modules in the route selection device 1000 shown in FIG. 10. For example, those skilled in the art may understand that the first obtaining unit 1001 and the first flooding unit 1002 in the route selection device 1000 shown in FIG. 10 may be implemented by at least one processor 1201 by calling codes in the memory 1203.

[0209] Optionally, the network device 1200 may be further configured to implement the functionality of the network device in any one of the preceding embodiments.

[0210] Optionally, the processor 1201 may be a general-purpose central processing unit (CPU), a network processor (NP), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to control program execution of the solutions of the present application.

[0211] The bus system 1202 may include paths for transmitting information between the aforementioned components.

[0212] The communication interface 1204 is configured to communicate with another device or a communication network.

[0213] The memory 1203 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 other optical disk storage, optical disk storage (including compact discs, laser discs, optical discs, digital versatile discs, Blu-ray discs, etc.), a magnetic storage medium or other 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 may exist independently or be connected to the processor via a bus. Alternatively, the memory may be integrated with the processor.

[0214] The memory 1203 is configured to store application program code used to implement the solution of the present application, and the processor 1201 controls the execution. The processor 1201 is configured to execute the application program code stored in the memory 1203 to implement the functions of the method of the present application.

[0215] Among specific implementations, in one embodiment, the processor 1201 may include one or more CPUs, for example, CPU 0 and CPU 1 in FIG.

[0216] While specific implementations may be considered, in one embodiment, network device 1200 may include multiple processors, such as processor 1201 and processor 1207 in FIG. 12. Each of the processors may be a single-core (single-CPU) processor or a multi-core (multi-CPU) processor. A processor herein may be one or more devices, circuits, and / or processing cores configured to process data (e.g., computer program instructions).

[0217] 13 is a schematic diagram of the structure of another network device 1300 (which may also be referred to as a communication device 1300) according to an embodiment of the present application. The network device 1300 may be the first network device or the control entity in any one of the aforementioned embodiments, or may be the controller 50 in FIG. 1a, FIG. 1b, FIG. 4a, FIG. 4b, FIG. 4c, FIG. 6a, FIG. 6b, FIG. 6c, FIG. 6d, or FIG. 7, or, in another example, may be the control entity in method 100 or method 200. In another example, the network device 1300 may be a node having a route selection function or an ingress node of an SR path in FIG. 1a, FIG. 1b, FIG. 4a, FIG. 4b, FIG. 4c, FIG. 6a, FIG. 6b, FIG. 6c, FIG. 6d, or FIG. 7, or, in another example, may be the first network device in method 100 or method 200. The network device 1300 may implement the functions of various network devices in the aforementioned embodiments.

[0218] The network device 1300 includes a main control board 1310 and an interface board 1330 .

[0219] The main control board 1310 is also referred to as a main processing unit (MPU) or a route processor card. The main control board 1310 controls and manages the components within the network device 1300, including functions such as route calculation, device management, device maintenance, and protocol processing. The main control board 1310 includes a central processing unit 1311 and a memory 1312.

[0220] The interface board 1330 is also referred to as a line processing unit (LPU), line card, or service board. The interface board 1330 is configured to provide various service interfaces and transfer data packets. The service interfaces include, but are not limited to, an Ethernet interface, a Packet over SONET / SDH (POS) interface, etc. An example of an Ethernet interface is a flexible Ethernet service interface (Flexible Ethernet Clients, FlexE Clients). The interface board 1330 includes a central processing unit 1331, a network processor 1332, a forwarding entry memory 1334, and a physical interface card (PIC) 1333.

[0221] A central processing unit 1331 on the interface board 1330 is configured to control and manage the interface board 1330 and to communicate with the central processing unit 1311 on the main control board 1310 .

[0222] The network processor 1332 is configured to forward packets. The network processor 1332 may take the form of a forwarding chip. Specifically, processing for uplink packets includes processing at a packet ingress interface and forwarding table lookup, and processing for downlink packets includes forwarding table lookup, etc.

[0223] The physical interface card 1333 is configured to implement physical layer connection functions. Original traffic enters the interface board 1330 from the physical interface board, and processed packets are transmitted from the physical interface card 1333. The physical interface card 1333 includes at least one physical interface, which is also referred to as a physical port. The physical interface card 1333 corresponds to a FlexE physical interface in the system architecture. The physical interface card 1333, also referred to as a subcard, may be installed on the interface board 1330 and is responsible for converting optical / electrical signals into packets, performing validity checks on the packets, and then forwarding the packets to the network processor 1332 for processing. In some embodiments, the central processing unit 1331 on the interface board 1330 may also perform the functions of the network processor 1332, for example, implementing software forwarding based on a general-purpose CPU, so that the network processor 1332 is not required in the physical interface card 1333.

[0224] Optionally, network device 1300 includes multiple interface boards. For example, network device 1300 further includes interface board 1340. Interface board 1340 includes a central processing unit 1341, a network processor 1342, a forwarding entry memory 1344, and a physical interface card 1343.

[0225] Optionally, the network device 1300 further includes a switching board 1320. The switching board 1320 may also be referred to as a switch fabric unit (SFU). When the network device has multiple interface boards 1330, the switching board 1320 is configured to complete data exchange between the interface boards. For example, the interface board 1330 and the interface board 1340 may communicate via the switching board 1320.

[0226] The main control board 1310 is coupled to the interface board 1330. For example, the main control board 1310, the interface board 1330, the interface board 1340, and the switching board 1320 are connected to a system backboard via an interworking system bus. In a possible implementation, an inter-process communication (IPC) protocol channel is established between the main control board 1310 and the interface board 1330, and the main control board 1310 and the interface board 1330 communicate with each other via the IPC channel.

[0227] Logically, network device 1300 includes a control plane and a forwarding plane. The control plane includes main control board 1310 and central processing unit 1331. The forwarding plane includes components that perform forwarding, such as forwarding entry memory 1334, physical interface cards 1333, and network processors 1332. The control plane performs functions such as router functions, generating forwarding tables, processing signaling and protocol packets, and configuring and maintaining device status. The control plane communicates the generated forwarding tables to the forwarding plane. In the forwarding plane, network processors 1332 look up the forwarding tables distributed by the control plane to forward packets received by physical interface cards 1333. The forwarding tables distributed by the control plane may be stored in forwarding entry memory 1334. In some embodiments, the control plane and forwarding plane may be completely separate and not on the same device.

[0228] When the network device 1300 is configured as a control entity, the central processing unit 1311 may determine first metric information for the first SR route and generate a first BGP update message. The network processor 1332 may trigger the physical interface card 1333 to send the first BGP update message to the first network device.

[0229] It should be understood that the first sending unit 803 in the route selection apparatus 800 and the communication interface 1104 in the control entity 1100 may be equivalent to the physical interface card 1333 or the physical interface card 1343 in the network device 1300. The first determining unit 801, the first generating unit 802 in the route selection apparatus 800 and the processor 1101 in the control entity 1100 may be equivalent to the central processing unit 1311 or the central processing unit 1331 in the network device 1300.

[0230] It should be understood that the operations on the interface board 1340 are consistent with the operations on the interface board 1330 in this embodiment of the present application. For the sake of brevity, the details will not be described again. It should be understood that the network device 1300 in this embodiment may correspond to the route selection device 800 or the control entity 1100 in the aforementioned method embodiments. The main control board 1310, the interface board 1330, and / or the interface board 1340 in the network device 1300 may implement the functions and / or various steps implemented in the route selection device 800 or the control entity 1100 in the aforementioned method embodiments. For the sake of brevity, the details will not be described again herein.

[0231] When the network device 1300 is configured as a first network device, the network processor 1332 may trigger the physical interface card 1333 to receive a first BGP update message generated by the control entity, the first BGP update message including first metric information for the first SR route. The central processing unit 1311 may perform route selection of multiple routes to the destination node based on the first metric information.

[0232] It should be understood that the first acquiring unit 901 in the route selection device 900, the first acquiring unit 1001 in the route selection device 1000, and the communication interface 1204 in the network device 1300 may be equivalent to the physical interface card 1333 or the physical interface card 1343 in the network device 1200. The route selection unit 902 in the route selection device 900, the first flooding unit 1002 in the route selection device 1000, and the processor 1201 in the network device 1300 may be equivalent to the central processing unit 1311 or the central processing unit 1331 in the network device 1200.

[0233] It should be understood that the operations on the interface board 1340 are consistent with the operations on the interface board 1330 in this embodiment of the present application. For the sake of brevity, the details will not be described again. It should be understood that the network device 1300 in this embodiment may correspond to the route selection device 800 or the control entity 1100 in the aforementioned method embodiments. The main control board 1310, the interface board 1330, and / or the interface board 1340 in the network device 1300 may implement the functions and / or various steps implemented in the route selection device 900, the route selection device 1000, or the network device 1200 in the aforementioned method embodiments. For the sake of brevity, the details will not be described again herein.

[0234] It may be understood that there may be one or more main control boards. If there are multiple main control boards, the main control board may include an active main control board and a standby main control board. One or more interface boards may be present, and a network device with stronger data processing capabilities provides more interface boards. One or more physical interface cards may also be present on the interface board. There may be no switching board, or there may be one or more switching boards. If there are multiple switching boards, load balancing and redundant backup may be implemented together. In a centralized forwarding architecture, the network device may not require a switching board, and the interface board implements service data processing functions throughout the system. In a distributed forwarding architecture, the network device has at least one switching board and can exchange data between multiple interface boards through the switching board to provide large-capacity data exchange and processing capabilities. Therefore, the data access and processing capabilities of a network device in a distributed architecture are better than those of a device in a centralized architecture. Optionally, the network device may alternatively have only one card. 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 processor on the interface board and the central processor on the main control board may be combined into a single central processor on the card to perform the functions that would have been achieved by combining the two central processors. Devices of this type (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.

[0235] In some possible embodiments, the aforementioned network devices or communicationThe device may be implemented as a virtualized device. For example, the virtualized device may be a virtual machine (VM) on which a program with packet transmission capabilities runs, and the virtual machine is located on a hardware device (e.g., a physical server). The virtual machine is a complete software-simulated computer system that has the full functionality of a hardware system and runs in a completely isolated environment. The virtual machine may be configured as each network device in FIG. 1a or FIG. 1b. For example, the network device or communication The device may be implemented based on a general-purpose physical server combined with Network Functions Virtualization (NFV) technology. communication The device may be a virtual host, a virtual router, or a virtual switch. After reading this application, based on the NFV technology, a person skilled in the art can easily realize that a network device or a device having the aforementioned functions can be implemented on a general-purpose physical server. communication Devices can be virtualized, details of which will not be repeated here.

[0236] It should be understood that the network device in the aforementioned product form may separately have any function of the network device or communication device in the aforementioned method embodiments, and the details will not be described again herein.

[0237] An embodiment of the present application further provides a chip including a processor and an interface circuit, the interface circuit being configured to receive instructions and send instructions to the processor. The processor may, for example, Route Selection The present invention may be a specific implementation of an apparatus, configured to execute the above-described route selection method. The processor is coupled to a memory. 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 implement the method in any one of the above-described method embodiments.

[0238] Optionally, there may be one or more processors in the chip system. The processor may be implemented using hardware or software. When the processor is implemented using hardware, the processor may be a logic circuit, an integrated circuit, etc. When the processor is implemented using software, the processor may be a general-purpose processor and is implemented by reading software code stored in a memory.

[0239] Optionally, there may be one or more memories in the chip system. The memory may be integrated with the processor or may be located separately 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 (ROM). The memory and the processor may be integrated on 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 specifically limited in this application.

[0240] 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 central processor unit (CPU), a network processor (NP), a digital signal processor (DSP), a microcontroller unit (MCU), a programmable logic device (PLD), or another integrated chip.

[0241] Additionally, an embodiment of the present application further provides a communication system 1400. See Fig. 14. The communication system 1400 may include a first network device 1401 and a control entity 1402. The first network device 1401 is configured to perform corresponding steps performed by the first network device in any one of the aforementioned possible implementation forms of method 100 or method 200. The control entity 1402 is configured to perform corresponding steps performed by the control entity in any one of the aforementioned possible implementation forms of method 100 or method 200.

[0242] In addition, an embodiment of the present application further provides a computer-readable storage medium, which stores program instructions, and when the program codes or instructions run on a computer, the computer is enabled to execute the method in any one of the implementation forms in the aforementioned embodiments shown in FIG.

[0243] Additionally, an embodiment of the present application further provides a computer program product, which, when run on a computer, enables the computer to perform the method in any one of the implementations of method 100 or method 200.

[0244] It should be understood that "determining B based on A" referred to in the embodiments of the present application does not mean that B is determined based only on A, and that B may alternatively be determined based on A and / or other information.

[0245] The "first" referred to in this application Metric Information "First" in a name such as "" is simply used as a name identifier and does not represent the first in a sequence. This rule is also applicable to "second" and so on.

[0246] From the above description of the implementation forms, those skilled in the art can clearly understand that some or all of the steps of the methods in the embodiments can be implemented by software in addition to a general-purpose hardware platform. Based on this understanding, the technical solutions of the present application can be implemented in the form of a software product. The computer software product may be stored in a storage medium, such as a read-only memory (ROM / RAM), a magnetic disk, or an optical disk, and includes some instructions for instructing a computer device (which may be a personal computer, a server, or a network communication device such as a router) to perform the methods described in the embodiments or some parts of the embodiments of the present application.

[0247] The embodiments in this specification are all described progressively, and the same or similar parts in the embodiments will be referred to in these embodiments, with each embodiment focusing on the differences from other embodiments. In particular, the system and device embodiments are basically similar to the method embodiments and will therefore be described briefly. For relevant parts, please refer to the partial description of the method embodiments. The described device and system embodiments are merely examples. Modules described as separate components may or may not be physically separate, and components displayed as modules may or may not be physical modules, and may be located in one location or distributed across multiple network units. Some or all of the modules may be selected based on actual requirements to achieve the goals of the solutions of the embodiments. Those skilled in the art can understand and implement the embodiments of the present application without creative efforts.

[0248] The foregoing description is based on the present application fruit It is only an embodiment and is not intended to limit the scope of protection of the present application. It should be noted that those skilled in the art may make some improvements and modifications without departing from the present application, and the improvements and modifications shall fall within the scope of protection of the present application. [Explanation of symbols]

[0249] 50 Controllers 100 Route Selection Method 200 Route Selection Method 800 Route Selection Device 801 First Decision Unit 802 First Generating Unit 803 First transmitting unit 900 Route Selection Device 901 First Acquisition Unit 902 Route Selection Unit 1000 Route Selection Device 1001 First Acquisition Unit 1002 First Flooding Unit 1100 Control Entity 1101 processor 1102 Bus System 1103 Memory 1104 Communication Interface 1107 processor 1200 Network Devices 1201 processor 1202 Bus System 1203 memory 1204 Communication Interface 1207 processor 1300 Network devices, communication devices 1310 Main Control Board 1311 Central Processing Unit 1312 memory 1320 Switching Board 1330 Interface Board 1331 Central Processing Unit 1332 Network Processor 1333 Physical Interface Card 1334 forwarding entry memory 1340 Interface Board 1341 Central Processing Unit 1342 Network Processor 1343 Physical Interface Card 1344 forwarding entry memory 1400 Communication Systems 1401 First Network Device 1402 Control Entity

Claims

1. 1. A route selection method, the method comprising: determining, by a control entity, first metric information of a first segment routing (SR) path, the first metric information representing a quality of the first SR path; generating, by the control entity, a first Border Gateway Protocol (BGP) update message, the first BGP update message including the first metric information, the first metric information being used for route selection over a plurality of routes, each of the plurality of routes having the same Internet Protocol (IP) prefix of a destination node, the plurality of routes including the first SR route; sending, by the control entity, the first BGP update message to a first network device, the first network device being an ingress node of the first SR route; A method comprising:

2. The method comprises: determining, by the control entity, second metric information of a second SR path, the second metric information representing a quality of the second SR path; generating, by the control entity, a second BGP update message, the second BGP update message including the second metric information, the second metric information being used for route selection on the plurality of routes, the plurality of routes including the second SR route; sending, by the control entity, the second BGP update message to the first network device, the first network device being an ingress node of the second SR route; The method of claim 1 further comprising:

3. 3. The method of claim 2, wherein, when an exit node of the first SR route is a second network device and an exit node of the second SR route is a third network device, next hops of a route corresponding to the IP prefix include the second network device and the third network device, the multiple routes include a first route and a second route, the first route includes the first SR route, and the second route includes the second SR route.

4. 3. The method of claim 2, wherein if an exit node of the first SR route and an exit node of the second SR route are both a second network device, a next hop of a route corresponding to the IP prefix includes the second network device, the multiple routes include a first route and a second route, the first route includes the first SR route, and the second route includes the second SR route.

5. The method of claim 2 , wherein the first metric information is used by the first network device to perform route selection for the plurality of paths.

6. 3. The method of claim 2, wherein the first network device is connected to a fourth network device, and the first metric information is used by the fourth network device to perform route selection for the plurality of paths.

7. The method described in claim 6, wherein the multiple routes include a first route, the first route includes the first SR route, and if the first route further includes a first segment route from the fourth network device to the first network device, the metric information of the first route includes the first metric information and third metric information of the first segment route.

8. The method comprises: determining, by the control entity, fourth metric information of a third SR path, wherein the fourth metric information represents a quality of the third SR path; generating, by the control entity, a third BGP update message, the third BGP update message including the fourth metric information, the fourth metric information being used for route selection on the plurality of routes, the plurality of routes including the third SR route; sending, by the control entity, the third BGP update message to a fifth network device, the fifth network device being an ingress node of the third SR route; The method of claim 1 further comprising:

9. 9. The method of claim 8, wherein, when an exit node of the first SR route is a second network device and an exit node of the third SR route is a third network device, a next hop of a route corresponding to the IP prefix includes the second network device and the third network device, the multiple routes include a first route and a third route, the first route includes the first SR route, and the third route includes the third SR route.

10. 9. The method of claim 8, wherein the first network device and the fifth network device are both connected to a fourth network device, and the first metric information is used by the fourth network device to perform route selection for the plurality of paths.

11. The method described in claim 10, wherein the multiple routes include a first route and a third route, the first route includes the first SR route, the third route includes the third SR route, the first route further includes a first segment route from the fourth network device to the first network device, and the third route further includes a second segment route from the fourth network device to the fifth network device, wherein fifth metric information of the first route includes the first metric information and sixth metric information of the first segment route, seventh metric information of the third route includes the fourth metric information and eighth metric information of the second segment route, and the fifth metric information and the seventh metric information are used by the fourth network device to perform route selection on the first route and the third route.

12. 2. The method of claim 1, wherein if a type of the first SR path is a segment routing policy (SR policy), the first BGP update message is a BGP SR policy packet.

13. The method of claim 12 , wherein if the first SR path includes at least one candidate path, the first metric information includes metric information of an operational path within the at least one candidate path.

14. 14. The method of claim 13, wherein the first metric information is carried in a candidate route subtype-length-value (Sub-TLV) field corresponding to the operational route in the BGP SR policy packet.

15. The step of determining, by a control entity, first metric information for a first segment routing (SR) path includes: obtaining, by the control entity, metric information corresponding to at least one segment list of an operational path within the first SR path; determining, by the control entity, the first metric information based on the metric information corresponding to the at least one segment list; 13. The method of claim 12, comprising:

16. The method of claim 15 , wherein the first metric information is a maximum value in the metric information corresponding to the at least one segment list.

17. 13. The method of claim 12, wherein the first SR route includes at least one candidate route, an operational route in the at least one candidate route includes at least one segment list, and the first metric information includes metric information corresponding to each of the at least one segment list.

18. The method of claim 17, wherein the first metric information is carried in a Segment List Sub-TLV field corresponding to each segment list in the BGP SR policy packet.

19. 2. The method of claim 1, wherein if the type of the first SR path is a segment routing - traffic engineering tunnel (SR-TE Tunnel), the BGP update message is a BGP SR-TE Tunnel packet.

20. The method of claim 1 , wherein the first metric information includes at least one of the following information: an Interior Gateway Protocol (IGP) metric, a Traffic Engineering (TE) metric, a bandwidth, a delay, or a packet loss rate.

21. 1. A route selection method, the method comprising: obtaining, by a first network device, a first Border Gateway Protocol (BGP) update message generated by a control entity, the first BGP update message including first metric information of a first segment routing (SR) route, the first metric information representing a quality of the first SR route; performing, by the first network device, route selection for a plurality of routes to a destination node based on the first metric information, each of the plurality of routes having the same Internet Protocol (IP) prefix of the destination node, the plurality of routes including the first SR route; A method comprising:

22. The method comprises: obtaining, by the first network device, a second BGP update message generated by the control entity, the second BGP update message including second metric information of a second SR route, the second metric information representing a quality of the second SR route; Further comprising: The step of performing, by the first network device, route selection for a plurality of paths to a destination node based on the first metric information includes: performing, by the first network device, route selection for the plurality of routes to the destination node based on the first metric information and the second metric information, the plurality of routes further including the second SR route; Including, 22. The method of claim 21.

23. The step of performing, by the first network device, route selection for the plurality of paths to the destination node based on the first metric information and the second metric information includes: associating, by the first network device, the first route corresponding to the IP prefix with the first SR path such that third metric information of the first route includes the first metric information; associating, by the first network device, the second route corresponding to the IP prefix with the second SR path such that fourth metric information of the second route includes the second metric information; selecting, by the first network device, the first route from the first route and the second route based on the third metric information and the fourth metric information, a forwarding entry corresponding to the first route being used to guide packet forwarding from the first network device to the destination node, a quality of the first route represented by the third metric information being better than a quality of the second route represented by the fourth metric information, the multiple routes including the first route and the second route, the first route including the first SR route, and the second route including the second SR route; 23. The method of claim 22, comprising:

24. 22. The method of claim 21, wherein if the type of the first SR path is a segment routing policy (SR policy), the BGP update message is a BGP SR policy packet.

25. 22. The method of claim 21, wherein if the type of the first SR path is a segment routing - traffic engineering tunnel (SR-TE Tunnel), the BGP update message is a BGP SR-TE Tunnel packet.

26. 22. The method of claim 21, wherein the first metric information includes at least one of the following information: an Interior Gateway Protocol (IGP) metric, a Traffic Engineering (TE) metric, a delay, or a packet loss rate.

27. 1. A route selection method, the method comprising: obtaining, by a first network device, a first Border Gateway Protocol (BGP) update message generated by a control entity, the first BGP update message including first metric information for a first segment routing (SR) route, the first metric information representing a quality of the first (SR) route, the first metric information being used for route selection for multiple routes to a destination node, each of the multiple routes having the same Internet Protocol (IP) prefix of the destination node, the multiple routes including the first SR route; flooding the first metric information by the first network device; A method comprising:

28. The step of flooding the first metric information by the first network device includes: flooding, by the first network device, the first metric information according to an Interior Gateway Protocol (IGP).

28. The method of claim 27, comprising:

29. 28. The method of claim 27, wherein the first metric information is used by a second network device to perform route selection for the multiple paths to the destination node, the second network device being connected to the first network device.

30. The plurality of routes further includes a second SR route, and an ingress node of the second SR route is the first network device, and the method includes: obtaining, by the first network device, a second BGP update message generated by the control entity, the second BGP update message including second metric information of the second SR route, the second metric information representing a quality of the second SR route, and the second metric information being used for route selection regarding the multiple routes to the destination node; flooding the second metric information by the first network device; 30. The method of claim 29, further comprising:

31. 28. The method of claim 27, wherein if the type of the first SR path is a segment routing policy (SR policy), the BGP update message is a BGP SR policy packet.

32. 28. The method of claim 27, wherein if the type of the first SR path is a segment routing - traffic engineering tunnel (SR-TE Tunnel), the BGP update message is a BGP SR-TE Tunnel packet.

33. 28. The method of claim 27, wherein the first metric information includes at least one of the following information: an Interior Gateway Protocol (IGP) metric, a Traffic Engineering (TE) metric, a delay, or a packet loss rate.

34. a control entity, the control entity comprising a memory and a processor; the memory configured to store instructions; The processor is configured to execute the instructions in the memory to perform the method of any one of claims 1 to 20. Control entity.

35. A network device, the network device comprising: a memory and a processor; the memory configured to store instructions; The processor is configured to execute the instructions in the memory to perform the method of any one of claims 21 to 26, or the processor is configured to execute the instructions in the memory to perform the method of any one of claims 27 to 33. Network devices.

36. A communication system comprising a control entity and a first network device; The control entity is configured to carry out the method according to any one of claims 1 to 20, The first network device is configured to perform the method of any one of claims 21 to 26, or the first network device is configured to perform the method of any one of claims 27 to 33. Communication system.

37. 34. A computer readable storage medium containing instructions which, when run on a computer, enable the computer to carry out the method of any one of claims 1 to 33.

Citation Information

Patent Citations

  • Forwarding path determination method and device

    CN113542123A

  • Quality guarantee service information notification method, communication apparatus, and inter-domain information transmission device

    JP2007251792A

  • Scalable distributed end-to-end performance delay measurement for segment routing policies

    US10230605B1

  • Traffic Engineering for Border Gateway Protocol

    US20200162365A1