This application relates to the field of communication technologies, and in particular, to a segment routing policy processing method and apparatus.
A segment routing (SR) policy is a new tunneling and traffic steering technology developed based on an SR technology. The SR policy includes three parts: a headend (e.g., a node that generates the SR policy), a color (e.g., indicating quality of service requirements of different services), and an endpoint (e.g., a destination address of the SR policy). The SR policy path is represented as a segment list of a specified path, which is referred to as an SID list (Segment ID List). Each SID list is an end-to-end path from a source to a destination and indicates a device in a network to follow the specified path. If a data packet is steered into the SR policy, the SID list is added by the headend to the data packet, so that other devices in the network can execute an instruction inserted into the SID list.
Generally, the SR policy contains a plurality of candidate paths. Each candidate path represents a specific mode in which traffic is transmitted from the headend to the endpoint in the corresponding SR policy. Each candidate path has a preference value. A path with a higher preference value is preferred. The headend selects an optimal candidate path as a transmission path of the data packet based on the preference value of each candidate path. In other words, a headend node can determine the transmission path from the plurality of candidate paths based on only the preference values of the candidate paths, and more processing manners cannot be provided. This affects service transmission quality.
Embodiments of this application provide a segment routing policy processing method and apparatus, to provide more processing behaviors for a network device, and improve diversity of the processing behaviors and service transmission performance.
According to a first aspect of this application, a segment routing processing method is provided. The method includes: A first network device obtains a segment routing SR policy, where the segment routing SR policy includes identification information, and the identification information indicates a type of at least one of the SR policy, a candidate path in the SR policy, and a segment list in the candidate path; and the first network device determines, based on the identification information, a processing behavior corresponding to at least one of the SR policy, the candidate path in the SR policy, and the segment list in the candidate path. In other words, the first network device obtains the SR policy. The SR policy includes the identification information, and the identification information indicates the type of at least one of the SR policy, the candidate path in the SR policy, and the segment list in the candidate path. The first network device determines, based on the identification information, a type related to the SR policy, and further determines a processing behavior that matches the type. In other words, the first network device may determine different processing behaviors based on the identification information in the SR policy, to implement service transmission by using the determined processing behavior, without performing service transmission by using a single processing behavior. This improves flexibility and diversity of service processing.
In an optional implementation, the type includes a multi-fed and selective receiving type, the multi-fed and selective receiving type indicates to determine at least two forwarding paths according to the SR policy, and the at least two forwarding paths are used to send a same service packet.
In an optional implementation, that the first network device determines, based on the identification information, a processing behavior corresponding to at least one of the SR policy, the candidate path in the SR policy, and the segment list in the candidate path includes: The first network device determines, based on the identification information, at least two forwarding paths from at least one of the SR policy, the candidate path in the SR policy, and the segment list in the candidate path; the first network device replicates a first service packet to obtain a second service packet; and the first network device sends the first service packet through a first forwarding path in the at least two forwarding paths, and sends the second service packet through a second forwarding path in the at least two forwarding paths. To be specific, when the identification information indicates the multi-fed and selective receiving type, the first network device may use a plurality of candidate paths with a same preference value as forwarding paths based on the identification information, to replicate a plurality of copies of same data, and separately transmit the same data through the plurality of forwarding paths, without selecting, based on another parameter, an optimal path from the plurality of candidate paths with the same preference value as a forwarding path. In this case, a processing manner of the SR policy is added, and service transmission quality is improved.
In an optional implementation, the first network device is an intermediate node on a forwarding path, and that the first network device sends the first service packet through a first forwarding path in the at least two forwarding path, and sends the second service packet through a second forwarding path in the at least two forwarding paths includes: The first network device separately encapsulates path information of the first forwarding path into the first service packet, and encapsulates path information of the second forwarding path into the second service packet; and the first network device sends the encapsulated first service packet through the first forwarding path, and sends the encapsulated second service packet through the second forwarding path. In other words, in this application, service packets are sent in multiple paths by using the path information corresponding to the two packets obtained through replication. This improves service transmission quality.
In an optional implementation, that the first network device encapsulates path information of the first forwarding path into the first service packet, and encapsulates path information of the second forwarding path into the second service packet includes: The first network device encapsulates a first packet header into an outer layer of the first service packet, where the first packet header includes the path information of the first forwarding path; and the first network device encapsulates a second packet header into an outer layer of the second service packet, where the second packet header includes the path information of the second forwarding path; or the first network device inserts the path information of the first forwarding path into a segment routing header (SRH) of the first service packet; and the first network device inserts the path information of the second forwarding path into an SRH of the second service packet. In other words, in this application, the path information of the determined forwarding path may be carried in various encapsulation manners, to implement multi-fed and selective receiving, and ensure service transmission quality.
In an optional implementation, when the identification information indicates that the type of the SR policy is the multi-fed and selective receiving type, the at least two forwarding paths are at least two candidate paths in the SR policy; when the identification information indicates that the type of the candidate path in the SR policy is the multi-fed and selective receiving type and each of at least two candidate paths in the SR policy corresponds to the identification information, the at least two forwarding paths are the at least two candidate paths in the SR policy; when the identification information indicates that the type of the candidate path in the SR policy is the multi-fed and selective receiving type and one candidate path in the SR policy corresponds to the identification information, the at least two forwarding paths are paths corresponding to at least two segment lists in the candidate path in the SR policy; or when the identification information indicates that the type of the segment list in the candidate path in the SR policy is the multi-fed and selective receiving type and each of at least two segment lists in the candidate path corresponds to the identification information, the at least two forwarding paths are paths corresponding to the at least two segment lists.
In an optional implementation, the type includes a composite type, and the composite type indicates that the SR policy includes nested sub-SR policies.
In an optional implementation, that the first network device determines, based on the identification information, a processing behavior corresponding to at least one of the SR policy, the candidate path, and the segment list includes: The first network device determines, based on the identification information, a forwarding path from a sub-SR policy corresponding to at least one of the SR policy, the candidate path in the SR policy, and the segment list in the candidate path; and the first network device sends a service packet based on the forwarding path.
In an optional implementation, when the identification information indicates the type of the candidate path in the SR policy, the identification information is carried in a field corresponding to a binding segment identifier (BSID) of the candidate path.
In an optional implementation, in a segment routing over internet protocol version 6 (SRv6) network, the identification information is carried in a behavior field corresponding to the BSID of the candidate path.
In an optional implementation, in a segment routing-multiprotocol label switching (SR-MPLS) network, a BSID sub-type length value (TLV) includes a newly added BSID behavior field, and the identification information is carried in the behavior field; or the identification information is carried in a newly added BSID behavior sub-TLV.
In an optional implementation, the identification information is carried in a flag field or a reserved field in a BSID sub-TLV.
In an optional implementation, when the identification information indicates the type of the candidate path in the SR policy, the identification information is carried in a flag sub-TLV corresponding to the candidate path.
In an optional implementation, when the identification information indicates the type of the candidate path in the SR policy, the identification information is carried in a newly added indication field sub-TLV in the candidate path.
In an optional implementation, when the identification information indicates the type of the candidate path in the SR policy, the identification information is carried in association information of the SR policy.
In an optional implementation, the identification information is carried in a reserved field of a candidate path identifier sub-TLV corresponding to the association information.
In an optional implementation, the identification information is carried in a newly added association TLV of the association information.
According to a second aspect of this application, a segment routing policy sending method is provided. The method includes: A controller obtains an SR policy, where the SR policy includes identification information, and the identification information indicates a type of at least one of the SR policy, a candidate path in the SR policy, and a segment list in the candidate path; and the controller sends the SR policy to the first network device.
In an optional implementation, the type includes a multi-fed and selective receiving type, the multi-fed and selective receiving type indicates to determine at least two forwarding paths according to the SR policy, and the at least two forwarding paths are used to send a same service packet.
In an optional implementation, the type includes a composite type, and the composite type indicates that the SR policy includes nested sub-SR policies.
According to a third aspect of this application, a segment routing policy processing apparatus is provided. The apparatus includes: an obtaining unit, configured to obtain a segment routing SR policy, where the segment routing SR policy includes identification information, and the identification information indicates a type of at least one of the SR policy, a candidate path in the SR policy, and a segment list in the candidate path; and a determining unit, configured to determine, by a first network device based on the identification information, a processing behavior corresponding to at least one of the SR policy, the candidate path in the SR policy, and the segment list in the candidate path.
In an optional implementation, the type includes a multi-fed and selective receiving type, the multi-fed and selective receiving type indicates to determine at least two forwarding paths according to the SR policy, and the at least two forwarding paths are used to send a same service packet.
In an optional implementation, the determining unit includes a determining subunit, a replicating subunit, and a sending subunit. The determining subunit is configured to determine, based on the identification information, the at least two forwarding path from at least one of the SR policy, the candidate path in the SR policy, and the segment list in the candidate path; the replicating subunit is configured to replicate a first service packet to obtain a second service packet; and the sending subunit is configured to send the first service packet through a first forwarding path in the at least two forwarding paths, and send the second service packet throug a second forwarding path in the at least two forwarding paths.
In an optional implementation, a device on which the apparatus is located is an intermediate node on a forwarding path, and the sending subunit is specifically configured to: separately encapsulate path information of the first forwarding path into the first service packet, and encapsulate path information of the second forwarding path into the second service packet; and send the encapsulated first service packet through the first forwarding path, and send the encapsulated second service packet through the second forwarding path.
In an optional implementation, the sending subunit is specifically configured to: encapsulate a first packet header into an outer layer of the first service packet, where the first packet header includes the path information of the first forwarding path; and encapsulate a second packet header into an outer layer of the second service packet, where the second packet header includes the path information of the second forwarding path; or insert the path information of the first forwarding path into a segment routing header SRH of the first service packet; and insert the path information of the second forwarding path into an SRH of the second service packet.
In an optional implementation, when the identification information indicates that the type of the SR policy is the multi-fed and selective receiving type, the at least two forwarding paths are at least two candidate paths in the SR policy;
when the identification information indicates that the type of the candidate path in the SR policy is the multi-fed and selective receiving type and each of at least two candidate paths in the SR policy corresponds to the identification information, the at least two forwarding paths are the at least two candidate paths in the SR policy;
when the identification information indicates that the type of the candidate path in the SR policy is the multi-fed and selective receiving type and one candidate path in the SR policy corresponds to the identification information, the at least two forwarding paths are paths corresponding to at least two segment lists in the candidate path in the SR policy; or
when the identification information indicates that the type of the segment list in the candidate path in the SR policy is the multi-fed and selective receiving type and each of at least two segment lists in the candidate path corresponds to the identification information, the at least two forwarding paths are paths corresponding to the at least two segment lists.
In an optional implementation, the type includes a composite type, and the composite type indicates that the SR policy includes nested sub-SR policies.
In an optional implementation, the determining unit is specifically configured to: determine, based on the identification information, a forwarding path from a sub-SR policy corresponding to at least one of the SR policy, the candidate path in the SR policy, and the segment list in the candidate path; and send a service packet based on the forwarding path.
In an optional implementation, when the identification information indicates the type of the candidate path in the SR policy, the identification information is carried in a field corresponding to a binding segment identifier BSID of the candidate path.
In an optional implementation, in a segment routing over internet protocol version 6 SRv6 network, the identification information is carried in a behavior field corresponding to the BSID of the candidate path.
In an optional implementation, in a segment routing-multiprotocol label switching SR-MPLS network, a BSID sub-type length value TLV includes a newly added BSID behavior field, and the identification information is carried in the behavior field; or the identification information is carried in a newly added BSID behavior sub-TLV.
In an optional implementation, the identification information is carried in a flag field or a reserved field in a BSID sub-TLV.
In an optional implementation, when the identification information indicates the type of the candidate path in the SR policy, the identification information is carried in a flag sub-TLV corresponding to the candidate path.
In an optional implementation, when the identification information indicates the type of the candidate path in the SR policy, the identification information is carried in a newly added indication field sub-TLV in the candidate path.
In an optional implementation, when the identification information indicates the type of the candidate path in the SR policy, the identification information is carried in association information of the SR policy.
In an optional implementation, the identification information is carried in a reserved field of a candidate path identifier sub-TLV corresponding to the association information.
In an optional implementation, the identification information is carried in a newly added association TLV of the association information.
According to a fourth aspect of this application, an apparatus for sending a segment routing policy is provided. The apparatus includes an obtaining unit and a sending unit. The obtaining unit is configured to obtain an SR policy, the SR policy includes identification information, and the identification information indicates a type of at least one of the SR policy, a candidate path in the SR policy, and a segment list in the candidate path. The sending unit is configured to send the SR policy to a first network device.
In an optional implementation, the type includes a multi-fed and selective receiving type, the multi-fed and selective receiving type indicates to determine at least two forwarding paths according to the SR policy, and the at least two forwarding paths are used to send a same service packet.
In an optional implementation, the type includes a composite type, and the composite type indicates that the SR policy includes nested sub-SR policies.
According to a fifth aspect of this application, a network system for segment routing policy processing is provided. The network system includes a controller and a first network device. The first network device is configured to perform the method in any one of the first aspect or the possible implementations of the first aspect. The controller is configured to perform the method in any one of the second aspect or the possible implementations of the second aspect.
According to a sixth aspect of this application, a network device is provided. The device includes a processor and a memory. The memory is configured to store instructions or a computer program. The processor is configured to execute the instructions or the computer program in the memory, to enable the network device to perform the method according to any one of the first aspect or the possible implementations of the first aspect.
According to a seventh aspect of this application, a computer-readable storage medium is provided, including instructions. When the instructions are runs on a processor, the method according to any one of the first aspect or the possible implementations of the first aspect is implemented.
According to an eighth aspect of this application, a chip is provided, including an interface circuit and a processor. The interface circuit is
connected to the processor, and the processor is configured to enable the chip to perform the method in any one of the first aspect or the possible implementations of the first aspect, or perform the method in any one of the second aspect or the possible implementations of the second aspect.
According to the technical solution provided in this application, a first network device obtains an SR policy. The SR policy includes identification information, and the identification information indicates a type of at least one of the SR policy, a candidate path in the SR policy, and a segment list in the candidate path. The first network device determines, based on the identification information, a type related to the SR policy, and further determines a processing behavior that matches the type. In other words, the first network device may determine different processing behaviors based on the identification information in the SR policy, to implement service transmission by using the determined processing behavior, without performing service transmission by using a single processing behavior. This improves flexibility and diversity of service processing.
To describe the technical solutions in embodiments of this application more clearly, the following briefly describes the accompanying drawings for describing embodiments or the conventional technology. It is clear that, the accompanying drawings in the following descriptions show only some embodiments recorded in this application, and a person of ordinary skill in the art may still derive other drawings from these accompanying drawings without creative efforts.
To make a person skilled in the art understand the technical solutions in this application better, the following clearly describes the technical solutions in embodiments of this application with reference to the accompanying drawings in embodiments of this application. It is clear that the described embodiments are merely some rather than all of embodiments of this application.
Currently, when a forwarding path is determined according to an SR policy, an optimal candidate path is first selected from a plurality of candidate paths as the forwarding path based on a preference value corresponding to each candidate path in the SR policy. If the plurality of candidate paths have a same preference value, an optimal path is selected as the forwarding path based on other parameters. When an ingress node needs to transmit a service flow, the ingress node transmits the service flow through the forwarding path. When a node or a link in the forwarding path is faulty, the ingress node needs to re-determine a forwarding path, and then use the new forwarding path to forward a subsequent service. Because it takes time for the ingress node to re-determine the forwarding path, service forwarding efficiency is affected.
In view of this, an SR redundancy protection policy, which is referred to as an R policy for short, is proposed for the SR policy to implement redundancy protection of segment routes. The redundancy protection policy is used to enable data packet replication between a replication node and a merging node, to guide a same data flow to replicate a plurality of copies of same data, and separately transmit the same data through different forwarding paths in an SR domain. In other words, a new type, namely, a multi-fed and selective receiving type, is defined for the SR policy. Specifically, when the forwarding path is determined by using the SR redundancy protection policy, a plurality of candidate paths with a same preference value may be used as forwarding paths, to replicate a plurality of copies of same data, and separately transmit the same data through the plurality of forwarding paths, without selecting, based on another parameter, an optimal path from the plurality of candidate paths with the same preference value as the forwarding path. In this case, a processing manner of the SR policy is added.
For ease of understanding of a specific implementation of the SR redundancy protection policy, refer to an application scenario diagram shown in
It can be learned from the scenario shown in
In addition, a new type, namely, a composite type, is redefined for the SR policy, to indicate that the SR policy may include nested sub-SR policies. When determining the forwarding path according to the SR policy, a headend may determine the forwarding path according to the sub-SR policy included in the SR policy, and add a processing behavior corresponding to the SR policy. As shown in
However, currently, when the controller delivers the SR policy, policies delivered in the foregoing two scenarios are the same. As a result, the network device cannot obtain a plurality of processing behaviors according to the SR policy, and service transmission is affected.
In view of this, embodiments of this application provides a packet transmission method. Identification information is added to a delivered SR policy, and a related type of the SR policy is indicated by using the identification information, so that a network device can determine, based on the identification information, a processing behavior that matches the type. This improves flexibility of processing a service packet by the network device.
For ease of understanding of the technical solutions provided in embodiments of this application, the following provides descriptions with reference to two application scenarios in
S201. A first network device obtains a segment routing policy, where the segment routing policy includes identification information.
In this embodiment, the SR policy may carry the identification information. The identification information indicates a type of at least one of the SR policy, a candidate path in the SR policy, and a segment list of the candidate path. The first network device may be the node R1 or the node Red in
In this embodiment, the SR policy obtained by the first network device may be delivered by a controller or preconfigured. The SR policy includes information, for example, the identification information, a triplet identifier (headend, color, and endpoint), and a candidate path. For example, in an SR policy shown in
The identification information may be identifiers of different levels. When the identification information is a policy-level identifier, the identification information indicates the type of the SR policy. When the identification information is a path-level identifier, the identification information indicates the type of the candidate path in the SR policy. When the identification information is a segment list-level identifier, the identification information indicates the type of the segment list in the candidate path. The SR policy may include at least one of the policy-level identifier, the path-level identifier, or the segment list-level identifier.
The type may include a multi-fed and selective receiving type and a composite type. The multi-fed and selective receiving type indicates that the first network device may determine at least two forwarding paths according to the SR policy, and the at least two forwarding paths are used to send a same service packet. The composite type indicates that the SR policy includes nested sub-SR policies. The following separately describes the multi-fed and selective receiving type and the composite type.
When the identification information is the policy-level identifier, the at least two forwarding paths are at least two candidate paths in the SR policy. For example, if the SR policy carries identification information R, and a maximum preference value corresponds to a candidate path CP1 and a candidate path CP3, both the candidate path CP1 and the candidate path CP3 are used as forwarding paths to replicate a plurality of copies of same data, and separately transmit the same data.
When the identification information is the path-level identifier and each of at least two candidate paths in the SR policy corresponds to the identification information, the at least two forwarding paths are the at least two candidate paths. For example, as shown in
When the identification information is the path-level identifier, a specific candidate path in the SR policy is of the multi-fed and selective receiving type, and only one candidate path in the SR policy corresponds to the identification information, the at least two forwarding paths are paths corresponding to at least two segment lists in the candidate path. For example, as shown in
When the identification information is the segment list-level identifier and each of at least two segment lists in the candidate path corresponds to the identification information, the at least two forwarding paths are paths corresponding to the at least two segment lists. For example, as shown in
When one SR policy carries identification information of a plurality of levels, operations may be separately performed based on the identifiers of the levels, and the operations do not affect each other.
When the identification information is the policy-level identifier, it indicates that the SR policy includes the nested sub-SR policies. When the identification information is the path-level identifier, it indicates that a candidate path in the SR policy includes the nested sub-SR policies. When the identification information is the segment list-level identifier, it indicates that a segment list in the candidate path includes the nested sub SR policies, as shown in
A manner of including the identification information in the SR policy is described in a subsequent embodiment.
S202. The first network device determines, based on the identification information, a processing behavior corresponding to at least one of the SR policy, the candidate path in the SR policy, and the segment list in the candidate path.
In this embodiment, after obtaining the identification information by parsing the SR policy, the first network device may determine a matching processing behavior based on the identification information. The processing behavior includes a forwarding path selection rule and a service packet sending rule. For example, when the type indicated by the identification information is the multi-fed and selective receiving type, a corresponding selection rule is determining at least two forwarding paths according to the SR policy, and a corresponding sending rule is sending a same service packet through the at least two determined forwarding paths. When the type indicated by the identification information is the composite type, a corresponding selection rule is determining a forwarding path according to the nested sub-SR policy corresponding to the SR policy, and a corresponding sending rule is sending a service packet through the determined forwarding path, so that load balancing is implemented on the determined forwarding path.
In view of this, when the type indicated by the identification information is the multi-fed and selective receiving type, that the first network device determines, based on the identification information, a processing behavior corresponding to at least one of the SR policy, the candidate path in the SR policy, and the segment list in the candidate path includes: The first network device determines, based on the identification information, at least two forwarding paths from at least one of the SR policy, the candidate path in the SR policy, and the segment list in the candidate path; the first network device replicates a first service packet to obtain a second service packet; and the first network device sends the first service packet through a first forwarding path in the at least two forwarding paths, and sends the second service packet through a second forwarding path in the at least two forwarding paths. Because the identification information may be identifiers of different levels, specific forms of the at least two forwarding paths determined based on the identification information are also different. For the specific forms, refer to the foregoing related descriptions.
In this embodiment, because the at least two determined forwarding paths are multi-fed paths, after obtaining the first service packet, the first network device replicates the first service packet to obtain the second service packet. Data payloads corresponding to the first service packet and the second service packet are the same. Then, the first service packet is sent through the first forwarding path in the at least two forwarding paths, and the second service packet is sent through the second forwarding path in the at least two forwarding paths. In other words, the first network device sends a same service packet through two forwarding paths.
When the first network device is a headend in the SR policy, after determining the first forwarding path and the second forwarding path, the first network device replicates a received data packet, encapsulates path information corresponding to the first forwarding path into the first service packet, and encapsulates path information corresponding to the second forwarding path into the second service packet. In an end-to-end multi-fed and selective receiving service scenario shown in
When the first network device is an intermediate node in the routing policy, a service packet obtained by the first network device is sent by a headend in the routing policy, and information that is about a path to an endpoint and that is determined by the headend is encapsulated into the service packet. After determining the at least two forwarding paths by using the identification information, the first network device re-encapsulates the path information of the at least two determined forwarding paths into the received service packet. Specifically, the path information of the first forwarding path is encapsulated into the first service packet, and the path information of the second forwarding path is encapsulated into the second service packet. The encapsulated first service packet is sent through the first forwarding path, and the encapsulated second service packet is sent through the second forwarding path. For example, in an application scenario shown in
The first network device may encapsulate the path information in the following manners. In one manner, the first network device encapsulates a first packet header into an outer layer of the first service packet, where the first packet header includes the path information of the first forwarding path, and the first network device encapsulates a second packet header into an outer layer of the second service packet, where the second packet header includes the path information of the second forwarding path. That is, the first network device may encapsulate a new packet header into the outer layer of the service packet to carry the path information. For example, as shown in
In another manner, the first network device inserts, into a segment routing header (SRH) of the first service packet, a segment list corresponding to the first forwarding path, and inserts, into an SRH of the second service packet, a segment list corresponding to the second forwarding path. That is, the first network device may insert, into the SRH of the service packet, the segment list corresponding to the determined forwarding path.
When the type indicated by the identification information is the composite type, that the first network device determines, based on the identification information, a processing behavior corresponding to at least one of the SR policy, the candidate path in the SR policy, and the segment list in the candidate path includes: The first network device determines, based on the identification information, a forwarding path from a sub-SR policy corresponding to at least one of the SR policy, the candidate path in the SR policy, and the segment list in the candidate path; and the first network device sends a service packet based on the forwarding path. That is, the first network device still selects the forwarding path based on a preference value of the candidate path, but determines the forwarding path from the sub-policy.
It can be learned that the first network device obtains the SR policy. The SR policy includes the identification information, and the identification information indicates the type of at least one of the SR policy, the candidate path in the SR policy, and the segment list in the candidate path. The first network device determines, based on the identification information, a type related to the SR policy, and further determines a processing behavior that matches the type. In other words, the first network device may determine different processing behaviors based on the identification information in the SR policy, to implement service transmission by using the determined processing behavior, without performing service transmission by using a single processing behavior. This improves flexibility of service processing.
It can be learned from the foregoing descriptions that the identification information may be the policy-level identifier, the path-level identifier, or the segment list-level identifier. For different levels of identifiers, manners of including the identification information in the SR policy are different.
In an implementation, when the identification information is the policy-level identifier, modeling may be performed based on yet another next generation (YANG) model of the SR policy, to add the identification information to a YANG model. The YANG model is implemented based on an extensible markup language (XML) and is a file in an XML format. The file may include a triplet identifier and the identification information that are of the SR policy.
In an implementation, when the identification information is the path-level identifier, the identification information may be carried in the routing policy in the following manners.
(1) The identification information is carried by using a field corresponding to a BSID corresponding to the candidate path in the SR policy. Generally, each candidate path in the SR policy has a BSID attribute. Therefore, the identification information may be carried by using the field corresponding to the BSID. Specifically, when delivering the SR policy, the controller forcibly binds the SR policy to a special BSID and a behavior instruction corresponding to the BSID, to indicate that the candidate path may be used as a multi-fed path.
When the controller delivers the SR policy based on BGP, the identification information may be forcibly carried in a BSID attribute sub-type length value (TLV) of the SR policy delivered by the BGP. For example, in a segment routing over internet protocol version 6 network, the BSID attribute corresponds to an endpoint behavior field, and the identification information is carried in the field.
When the SR policy is run in a segment routing-multiprotocol label switching network, the BSID attribute does not have a corresponding endpoint behavior field in the SR-MPLS network. Therefore, a new behavior field is added to the original BSID attribute to carry the identification information by using the newly added behavior field of giant. As shown in
Optionally, the identification information may alternatively be carried in a reserved field of the BSID sub-TLV or a bit of a flag field. A flag field and a reserved field shown in
(2) A flag is added to the candidate path to carry the identification information, to indicate that the candidate path may be used as a multi-fed path. For example, as shown in
Specifically, a flag sub-TLV may be added to a flag field corresponding to the candidate path, and the identification information is carried by using the newly added flag sub-TLV. That is, the flag sub-TLV is extended to carry the identification information, and this extension manner is applicable to both SRv6 and SR MPLS scenarios. As shown in
(3) A type or an attribute is added to the candidate path to carry the identification information, to indicate that the candidate path may be used as a multi-fed path. As shown in
Specifically, an indication field sub-TLV may be added to the candidate path, and the identification information is carried by using the newly added indication field sub-TLV (e.g., a candidate path type sub-TLV or a candidate path attribute sub-TLV). The newly added indication field sub-TLV may include a type or an attribute bit. For example,
When the controller delivers the SR policy based on PCEP, the identification information may be carried in association information corresponding to the SR policy.
(1) The identification information is carried in a reserved field of a candidate path identifier sub-TLV corresponding to the association information.
(2) A new association TLV is added to the association information corresponding to the SR policy, to carry the identification information by using the association TLV. The newly added associated TLV shown in
In an implementation, when the identification information is the segment list-level identifier, an attribute flag may be added to segment list information, and the identification information is carried by using the attribute flag. When processing the segment list information, the first network device determines a corresponding processing behavior based on the identification information carried in the newly added attribute flag. The attribute flag may be a newly added TLV.
In an implementation, when the identification information is the segment list-level identifier, a type flag may be added to segment list information, and the identification information is carried by using the type flag. When processing the segment list information, the first network device determines a corresponding processing behavior based on the identification information carried in the newly added type flag. The type flag may be a newly added TLV.
It can be learned that the identification information in the SR policy may be carried in a plurality of manners. During actual application, the foregoing plurality of carrying manners may be used for identification information of different levels.
S1001. A controller obtains an SR policy.
In this embodiment, the controller may obtain topology information of a network in which a first network device is located, and determine the SR policy based on the topology information and a related path algorithm. The SR policy includes identification information, and the identification information indicates a type of at least one of the SR policy, a candidate path in the SR policy, and a segment list in the candidate path. For a manner of including the identification information in the SR policy, refer to related descriptions in the foregoing method embodiments.
The type may include a multi-fed and selective receiving type and a composite type. The multi-fed and selective receiving type indicates to determine at least two forwarding paths according to the SR policy, and the at least two forwarding paths are used to send a same service packet. The composite type indicates that the SR policy includes nested sub-SR policies.
S1002. The controller sends the SR policy to the first network device.
In this embodiment, after obtaining the SR policy, the controller sends the SR policy to the first network device, so that the first network device determines, based on the identification information in the SR policy, a processing behavior corresponding to at least one of the SR policy, the candidate path in the SR policy, and the segment list in the candidate path.
When sending the SR policy to the first network device, the controller may deliver the SR policy based on BGP, or may deliver the SR policy based on PCEP.
Based on the foregoing method embodiments, embodiments of this application provide segment routing policy processing apparatuses. The following provides descriptions with reference to the accompanying drawings.
The obtaining unit 1101 is configured to obtain a segment routing SR policy. The segment routing SR policy includes identification information, and the identification information indicates a type of at least one of the SR policy, a candidate path in the SR policy, and a segment list in the candidate path. For a specific implementation of the obtaining unit 1101, refer to related descriptions of S201.
The determining unit 1102 is configured to determine, by a first network device based on the identification information, a processing behavior corresponding to at least one of the SR policy, the candidate path in the SR policy, and the segment list in the candidate path. For a specific implementation of the determining unit 1102, refer to related descriptions of S202.
In an optional implementation, the type includes a multi-fed and selective receiving type, the multi-fed and selective receiving type indicates to determine at least two forwarding paths according to the SR policy, and the at least two forwarding paths are used to send a same service packet.
In an optional implementation, the determining unit includes a determining subunit, a replicating subunit, and a sending subunit.
The determining subunit is configured to determine, based on the identification information, the at least two forwarding paths from at least one of the SR policy, the candidate path in the SR policy, and the segment list in the candidate path.
The replicating subunit is configured to replicate a first service packet to obtain a second service packet.
The sending subunit is configured to send the first service packet through a first forwarding path in the at least two forwarding paths, and send the second service packet through a second forwarding path in the at least two forwarding paths.
In an optional implementation, a device on which the apparatus is located is an intermediate node on a forwarding path, and the sending subunit is specifically configured to: separately encapsulate path information of the first forwarding path into the first service packet, and encapsulate path information of the second forwarding path into the second service packet; and send the encapsulated first service packet through the first forwarding path, and send the encapsulated second service packet through the second forwarding path.
In an optional implementation, the sending subunit is specifically configured to: encapsulate a first packet header into an outer layer of the first service packet, where the first packet header includes the path information of the first forwarding path; and encapsulate a second packet header into an outer layer of the second service packet, where the second packet header includes the path information of the second forwarding path; or insert the path information of the first forwarding path into a segment routing header SRH of the first service packet; and insert the path information of the second forwarding path into an SRH of the second service packet.
In an optional implementation, when the identification information indicates that the type of the SR policy is the multi-fed and selective receiving type, the at least two forwarding paths are at least two candidate paths in the SR policy.
When the identification information indicates that the type of the candidate path in the SR policy is the multi-fed and selective receiving type and each of at least two candidate paths in the SR policy corresponds to the identification information, the at least two forwarding paths are the at least two candidate paths in the SR policy.
When the identification information indicates that the type of the candidate path in the SR policy is the multi-fed and selective receiving type and one candidate path in the SR policy corresponds to the identification information, the at least two forwarding paths are paths corresponding to at least two segment lists in the candidate path in the SR policy.
When the identification information indicates that the type of the segment list in the candidate path in the SR policy is the multi-fed and selective receiving type and each of at least two segment lists in the candidate path corresponds to the identification information, the at least two forwarding paths are paths corresponding to the at least two segment lists.
In an optional implementation, the type includes a composite type, and the composite type indicates that the SR policy includes nested sub-SR policies.
In an optional implementation, the determining unit is specifically configured to: determine, based on the identification information, a forwarding path from a sub-SR policy corresponding to at least one of the SR policy, the candidate path in the SR policy, and the segment list in the candidate path; and send a service packet based on the forwarding path.
In an optional implementation, when the identification information indicates the type of the candidate path in the SR policy, the identification information is carried in a field corresponding to a binding segment identifier BSID of the candidate path.
In an optional implementation, in a segment routing over internet protocol version 6 SRv6 network, the identification information is carried in a behavior field corresponding to the BSID of the candidate path.
In an optional implementation, in a segment routing-multiprotocol label switching SR-MPLS network, a BSID sub-type length value TLV includes a newly added BSID behavior field, and the identification information is carried in the behavior field; or the identification information is carried in a newly added BSID behavior sub-TLV.
In an optional implementation, the identification information is carried in a flag field or a reserved field in a BSID sub-TLV.
In an optional implementation, when the identification information indicates the type of the candidate path in the SR policy, the identification information is carried in a flag sub-TLV corresponding to the candidate path.
In an optional implementation, when the identification information indicates the type of the candidate path in the SR policy, the identification information is carried in a newly added indication field sub-TLV in the candidate path.
In an optional implementation, when the identification information indicates the type of the candidate path in the SR policy, the identification information is carried in association information of the SR policy.
In an optional implementation, the identification information is carried in a reserved field of a candidate path identifier sub-TLV corresponding to the association information.
In an optional implementation, the identification information is carried in a newly added association TLV of the association information.
It should be noted that, for implementation of each unit in this embodiment, refer to related descriptions in the method embodiment shown in
The obtaining unit 1201 is configured to obtain an SR policy. The SR policy includes identification information, and the identification information indicates a type of at least one of the SR policy, a candidate path in the SR policy, and a segment list in the candidate path.
The sending unit 1202 is configured to send the SR policy to a first network device.
In an optional implementation, the type includes a multi-fed and selective receiving type, the multi-fed and selective receiving type indicates to determine at least two forwarding paths according to the SR policy, and the at least two forwarding paths are used to send a same service packet.
In an optional implementation, the type includes a composite type, and the composite type indicates that the SR policy includes nested sub-SR policies.
It should be noted that, for implementation of each unit in this embodiment, refer to related descriptions in the method embodiment in
For a specific implementation of each unit in this embodiment, refer to related descriptions in the foregoing method embodiments. In this embodiment of this application, division into the units is an example, and is merely a logical function division. In actual implementation, another division manner may be used. Functional units in embodiments of this application may be integrated into one processing unit, or each of the units may exist alone physically, or two or more units may be integrated into one unit. For example, in the foregoing embodiment, the processing unit and the sending unit may be a same unit, or may be different units. The integrated unit may be implemented in a form of hardware, or may be implemented in a form of a software functional unit.
The communication device 1300 includes a processor 1310, a communication interface 1320, and a memory 1330. There may be one or more processors 1310 in the communication device 1300, and one processor is used as an example in
The processor 1310 may be a CPU, an NP, or a combination of a CPU and an NP. The processor 1310 may further include a hardware chip. The hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or a combination thereof. The PLD may be a complex programmable logic device (CPLD), a field programmable logic gate array (FPGA), a generic array logic (GAL), or any combination thereof.
The memory 1330 may include a volatile memory, for example, a random-access memory (RAM). The memory 1330 may also include a non-volatile memory, for example, a flash memory, a hard disk drive (HDD), or a solid-state drive (SSD). The memory 1330 may also include a combination of memories of the foregoing types. The memory 1330 may store, for example, the segment routing SR policy mentioned above.
Optionally, the memory 1330 stores an operating system and a program, an executable module or a data structure, a subset thereof, or an extended set thereof. The program may include various operation instructions for implementing various operations. The operating system may include various system programs, to implement various basic services and process a hardware-based task. The processor 1310 may read a program in the memory 1330, to implement the segment routing policy processing method provided in this embodiment of this application.
The memory 1330 may be a storage component in the communication device 1300, or may be a storage apparatus independent of the communication device 1300.
The bus system 1340 may be a peripheral component interconnect (PCI) bus, an extended industry standard architecture (EISA) bus, or the like. The bus system 1340 may be classified into an address bus, a data bus, a control bus, and the like. For ease of description, the bus in
The network device 1400 includes a main control board 1410 and an interface board 1430.
The main control board 1410 is also referred to as a main processing unit (MPU) or a route processing card. The main control board 1410 controls and manages each component in the network device 1400, including functions of route calculation, device management, device maintenance, and protocol processing. The main control board 1410 includes a central processing unit 1411, and a memory 1412.
The interface board 1430 is also referred to as a line processing unit (LPU), a line card, or a service board. The interface board 1430 is configured to provide various service interfaces and implement data packet forwarding. The service interface includes but is not limited to an Ethernet interface, a POS (Packet over SONET/SDH) interface, and the like. The Ethernet interface is, for example, a flexible Ethernet service interface (FlexE Client) interface. The interface board 1430 includes a central processing unit 1431, a network processor 1432, a forwarding entry memory 1434, and a physical interface card (PIC) 1433.
The central processing unit 1431 on the interface board 1430 is configured to control and manage the interface board 1430 and communicate with the central processing unit 1411 on the main control board 1410.
The network processor 1432 is configured to implement packet forwarding processing. A form of the network processor 1432 may be a forwarding chip. Specifically, processing on an uplink packet includes: processing an inbound interface of the packet, and searching the forwarding table. Processing of a downlink packet includes: searching the forwarding table, and the like.
The physical interface card 1433 is configured to implement a physical layer interconnection function. Original traffic enters the interface board 1430, and a processed packet is sent out from the physical interface card 1433. The physical interface card 1433 includes at least one physical interface. The physical interface is also referred to as a physical port. The physical interface card 1433, also referred to as a subcard, may be installed on the interface board 1430, and is responsible for converting an optical/electrical signal into a packet, performing validity check on the packet, and forwarding the packet to the network processor 1432 for processing. In some embodiments, the central processing unit 1431 on the interface board 1403 may also perform a function of the network processor 1432, for example, implement software forwarding based on a general-purpose CPU. In this case, the network processor 1432 is not required in the physical interface card 1433.
Optionally, the network device 1400 includes a plurality of interface boards. For example, the network device 1400 further includes an interface board 1440. The interface board 1440 includes a central processing unit 1441, a network processor 1442, a forwarding entry memory 1444, and a physical interface card 1443.
Optionally, the network device 1400 further includes a switching board 1420. The switching board 1420 may also be referred to as a switch fabric unit (SFU). When the network device has a plurality of interface boards 1430, the switching board 1420 is configured to complete data exchange between interface boards. For example, the interface board 1430 and the interface board 1440 may communicate with each other through the switching board 1420.
The main control board 1410 is coupled to the interface board 1430. For example, the main control board 1410, the interface board 1430, the interface board 1440, and the switching board 1420 are connected to a system backplane through a system bus to implement interworking. In a possible implementation, an inter-process communication protocol (IPC) channel is established between the main control board 1410 and the interface board 1430, and the main control board 1410 and the interface board 1430 communicate with each other through the IPC channel.
Logically, the network device 1400 includes a control plane and a forwarding plane. The control plane includes the main control board 1410 and the central processing unit 1431. The forwarding plane includes components used for forwarding, for example, the forwarding entry memory 1434, the physical interface card 1433, and the network processor 1432. The control plane implements functions of a router, generating a forwarding table, processing signaling and protocol packets, and configuring and maintaining a status of a device. The control plane delivers a generated forwarding table to the forwarding plane. On the forwarding plane, the network processor 1432 performs table lookup and forwarding on a packet received by the physical interface card 1433 based on the forwarding table delivered by the control plane. The forwarding table delivered by the control plane may be stored in the forwarding entry memory 1434. In some embodiments, the control plane and the forwarding plane may be completely separated, and are not on a same device.
It should be understood that, in this embodiment of this application, an operation on the interface board 1440 is the same as an operation on the interface board 1430. For brevity, details are not described again. It should be understood that the network device 1400 in this embodiment may correspond to the first network device in the foregoing method embodiments. The main control board 1410, the interface board 1430, and/or the interface board 1440 in the network device 1400 may implement various steps in the foregoing method embodiments. For brevity, details are not described herein again.
It may be understood that, there may be one or more main control boards. When there are a plurality of main control boards, the main control boards may include an active main control board and a standby main control board. There may be one or more interface boards. A network device with a stronger data processing capability provides a larger quantity of interface boards. There may also be one or more physical interface cards on the interface board. There may be no switching board or one or more switching boards. When there are a plurality of switching boards, load balancing and redundancy backup may be implemented together. In a centralized forwarding architecture, a network device may not need a switching board, and an interface board performs a function of processing service data of an entire system. In a distributed forwarding architecture, a network device may have at least one switching board, and implements data exchange between a plurality of interface boards by using the switching board, to provide a large-capacity data exchange and processing capability. Therefore, a data access and processing capability of the network device in the distributed architecture is better than that of the device in the centralized architecture. Optionally, the network device may alternatively be in a form in which there is only one card. To be specific, there is no switching board, and functions of the interface board and the main control board are integrated on the card. In this case, a central processing unit on the interface board and a central processing unit on the main control board may be combined to form one central processing unit on the card, to perform functions obtained after the two central processing units are combined. This form of device (for example, a network device such as a low-end switch or a router) has a weak data exchange and processing capability. A specific architecture that is to be used depends on a specific networking deployment scenario.
In some possible embodiments, the network device may be implemented as a virtualized device. For example, the virtualized device may be a virtual machine (VM) on which a program having a packet sending function is run, and the virtual machine is deployed on a hardware device (for example, a physical server). The virtual machine is a complete software-simulated computer system that has complete hardware system functions and that runs in an entirely isolated environment. The virtual machine may be configured as the network device. For example, the virtual machine may implement a network device based on a general-purpose physical server in combination with a network functions virtualization (NFV) technology. The network device is a virtual host, a virtual router, or a virtual switch. By reading this application, a person skilled in the art may obtain, on the general-purpose physical server through virtualization with reference to the NFV technology, the network device having the foregoing functions. Details are not described herein.
It should be understood that the network devices in the foregoing various product forms have any function of the first network device in the foregoing method embodiments, and details are not described herein.
An embodiment of this application further provides a chip, including a processor and an interface circuit. The interface circuit is configured to receive instructions and transmit the instructions to the processor. The processor may be, for example, a specific implementation form of the segment routing policy processing apparatus 1100 shown in
Optionally, there may be one or more processors in the chip system. The processor may be implemented by using hardware, or may be implemented by using software. When the processor is implemented by using the hardware, the processor may be a logic circuit, an integrated circuit, or the like. When the processor is implemented by using the software, the processor may be a general-purpose processor, and is implemented by reading software code stored in the memory.
Optionally, there may also be one or more memories in the chip system. The memory may be integrated with the processor, or may be disposed separately from the processor. This is not limited in this application. For example, the memory may be a non-transitory processor, for example, a read-only memory ROM. The memory and the processor may be integrated into a same chip, or may be separately disposed on different chips. A type of the memory and a manner of disposing the memory and the processor are not specifically limited in this application.
For example, the chip system may be a field programmable gate array (FPGA), an application-specific integrated chip (ASIC), a system on chip (SoC), a central processing unit (CPU), a network processor (NP), a digital signal processor (DSP), a micro controller unit (MCU), or a programmable controller (PLD) or another integrated chip.
An embodiment of this application further provides a network system. The network system includes a controller and a first network device. The first network device is configured to perform the foregoing SR policy processing method, and the controller is configured to perform the foregoing SR policy sending method.
An embodiment of this application further provides a computer-readable storage medium, including instructions or a computer program. When the instructions or the computer program runs on a computer, the computer is enabled to perform the segment routing policy processing method provided in the foregoing embodiment.
An embodiment of this application further provides a computer program product, including instructions or a computer program. When the instructions or the computer program runs on a computer, the computer is enabled to perform the segment routing policy processing method provided in the foregoing embodiment.
In the specification, claims, and accompanying drawings of this application, the terms “first”, “second”, “third”, “fourth”, and so on (if existent) are intended to distinguish between similar objects but do not necessarily indicate a specific order or sequence. It should be understood that the data termed in such a way are interchangeable in proper circumstances so that embodiments of the present invention described herein can be implemented in other orders than the order illustrated or described herein. In addition, the terms “include” and “have” and any other variants are intended to cover the non-exclusive inclusion. For example, a process, method, system, product, or device that includes a list of steps or units is not necessarily limited to those expressly listed steps or units, but may include other steps or units not expressly listed or inherent to such a process, method, product, or device.
It may be clearly understood by a person skilled in the field that, for the purpose of convenient and brief description, for a detailed working process of the foregoing system, apparatus, and unit, refer to a corresponding process in the foregoing method embodiments, and details are not described herein again.
In the several embodiments provided in this application, it should be understood that the disclosed system, apparatus, and method may be implemented in other manners. For example, the described apparatus embodiments are merely examples. For example, division into the units is merely logical service division. In actual implementation, there may be another division manner. For example, a plurality of units or components may be combined or integrated into another system, or some features may be ignored or not performed. In addition, displayed or discussed mutual couplings or direct couplings or communication connections may be implemented through some interfaces. Indirect couplings or communication connections between the apparatuses or the units may be implemented in electrical, mechanical, or other forms.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, in other words, may be located in one position, or may be distributed on a plurality of network units. Some or all of the units may be selected based on actual requirements to achieve the objectives of the solutions of embodiments.
In addition, service units in embodiments of this application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit. The integrated unit may be implemented in a form of hardware, or may be implemented in a form of a software service unit.
When the integrated unit is implemented in a form of a software service unit and sold or used as an independent product, the integrated unit may be stored in a computer-readable storage medium. Based on such an understanding, the technical solutions of this application essentially, or the part contributing to the conventional technology, or all or some of the technical solutions may be implemented in a form of a software product. The computer software product is stored in a storage medium and includes several instructions for instructing a computer device (which may be a personal computer, a server, or a network device) to perform all or some of the steps of the methods described in embodiments of this application. The storage medium includes any medium that can store program code, for example, a USB flash drive, a removable hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disc.
A person skilled in the art should be aware that in the foregoing one or more examples, the services described in this application may be implemented by hardware, software, firmware, or any combination thereof. When implemented by software, these services may be stored in a computer-readable medium or transmitted as one or more instructions or code on the computer-readable medium. The computer-readable medium includes a computer storage medium and a communication medium, where the communication medium includes any medium that enables a computer program to be transmitted from one place to another. The storage medium may be any available medium accessible to a general-purpose or a dedicated computer.
In the foregoing specific implementations, the objectives, technical solutions, and the benefits of this application are further described in detail. It should be understood that the foregoing descriptions are merely specific implementations of this application.
The foregoing embodiments are merely used to describe the technical solutions of this application, but not to limit the technical solutions. Although this application is described in detail with reference to the foregoing embodiments, a person of ordinary skill in the art should understand that they may still make modifications to the technical solutions described in the foregoing embodiments or make equivalent replacements to some technical features thereof, without departing from the scope of the technical solutions of embodiments of this application.
Number | Date | Country | Kind |
---|---|---|---|
202210576184.0 | May 2022 | CN | national |
This application is a continuation of International Application No. PCT/CN2023/094919 filed on May 18, 2023, which claims priority to Chinese Patent Application No. 202210576184.0, filed on May 25, 2022. The disclosures of the aforementioned applications are hereby incorporated by reference in their entireties.
Number | Date | Country | |
---|---|---|---|
Parent | PCT/CN2023/094919 | May 2023 | WO |
Child | 18957018 | US |