SERVICE EXECUTION METHOD AND APPARATUS, SYSTEM, AND STORAGE MEDIUM
20230024980 · 2023-01-26
Inventors
Cpc classification
H04L45/50
ELECTRICITY
International classification
Abstract
A service execution method and apparatus, a system, and a storage medium related to the communications field are provided. The method includes: a first network device generates a first packet, where the first packet includes a segment routing header (SRH), the SRH includes a service identifier, and the service identifier is related to first service information and second service information. The first network device sends the first packet to a second network device, wherein the service identifier indicates the second network device to execute at least one service based on the first service information, the second service information, and the first packet. According to this application, a problem that a network service cannot be provided for an actual service packet in an SRv6 network can be resolved.
Claims
1. A method comprising: generating, by a first network device, a first packet, wherein the first packet comprises a segment routing header (SRH), the SRH comprises a service identifier, and the service identifier is related to first service information and second service information; and sending, by the first network device, the first packet to a second network device, wherein the service identifier indicates the second network device to execute at least one service based on the first service information, the second service information, and the first packet.
2. The method according to claim 1, wherein the first service information comprises a first service, the second service information comprises a second service, and the at least one service comprises the first service and the second service; or the first service information comprises a first feature identifier, the second service information comprises a second feature identifier, wherein a feature identifier comprises a traffic identifier or a network identifier, and further comprises the first feature identifier and/or the second feature identifier; or the first service information comprises the first service, the second service information comprises the first feature identifier, the first feature identifier comprises the traffic identifier or the network identifier, and the at least one service comprises the first service.
3. The method according to claim 2, wherein based on the first service information comprising the first feature identifier required for executing the at least one service, and the second service information comprising the second feature identifier required for executing the at least one service, the service identifier comprises a feature indication, wherein the feature indication indicates that the service identifier comprises the first feature identifier and the second feature identifier.
4. The method according to claim 2, wherein based on the first service information comprising the first service, and the second service information comprising the first feature identifier required for executing the at least one service, the service identifier comprises a service indication and a feature indication, wherein the service indication indicates the first service information, and the feature indication indicates that the service identifier comprises the first feature identifier; or the service identifier comprises a feature service indication, wherein the feature service indication indicates the first service and indicates that the service identifier comprises the first feature identifier.
5. The method according to claim 4, wherein the service identifier further comprises a service parameter part, and the service parameter part is related to the first service.
6. The method according to claim 1, wherein a segment identifier list or a first type-length-value (TLV) in the SRH of the first packet comprises the service identifier.
7. The method according to claim 1, wherein a length of the service identifier is 128 bits.
8. The method according to claim 1, wherein the at least one service comprises one or more of internet protocol flow performance measurement (IPFPM), light in-band operation, administration, and maintenance (light IOAM), security encryption, a service used to add a timestamp, a service function chain (SFC), or a forwarding and access control list (ACL).
9. A method comprising: receiving, by a second network device, a first packet sent by a first network device, wherein the first packet comprises a segment routing header (SRH), the SRH comprises a service identifier, and the service identifier is related to first service information and second service information; and executing, by the second network device, at least one service based on the first service information, the second service information, and the first packet.
10. The method according to claim 9, wherein the first service information comprises a first service, the second service information comprises a second service, and the at least one service comprises the first service and the second service; or the first service information comprises a first feature identifier, the second service information comprises a second feature identifier, wherein a feature identifier comprises a traffic identifier or a network identifier, and further comprises the first feature identifier and/or the second feature identifier; or the first service information comprises the first service, the second service information comprises the first feature identifier, and the first feature identifier comprises the traffic identifier or the network identifier.
11. The method according to claim 10, wherein based on the first service information comprising the first feature identifier required for executing the at least one service, and the second service information comprising the second feature identifier required for executing the at least one service, the service identifier comprises a feature indication, wherein the feature indication indicates that the service identifier comprises the first feature identifier and the second feature identifier; and wherein the executing, by the second network device, the at least one service based on the first service information, the second service information, and the first packet comprises: obtaining, by the second network device, the first feature identifier and the second feature identifier based on the feature indication.
12. The method according to claim 10, wherein based on the first service information comprising the first service, and the second service information comprising the first feature identifier required for executing the at least one service, the service identifier comprises a service indication and a feature indication, wherein the service indication indicates the first service, and the feature indication indicates that the service identifier comprises the first feature identifier; and wherein the executing, by the second network device, the at least one service based on the first service information, the second service information, and the first packet comprises: determining, by the second network device, the first service based on the service indication; determining, by the second network device, the first feature identifier based on the feature indication; and executing, by the second network device, the at least one service based on the first packet and the first feature identifier, wherein the at least one service comprises the first service.
13. The method according to claim 10, wherein based on the first service information comprising the first service, and the second service information comprising the first feature identifier required for executing the at least one service, the service identifier comprises a feature service indication, wherein the feature service indication indicates the first service and indicates that the service identifier comprises the first feature identifier; and wherein the executing, by the second network device, the at least one service based on the first service information, the second service information, and the first packet comprises: determining, by the second network device, the first service and the first feature identifier based on the feature service indication; and executing, by the second network device, the at least one service based on the first packet and the first feature identifier, wherein the at least one service comprises the first service.
14. The method according to claim 9, wherein a segment identifier list or a first type-length-value (TLV) in the SRH of the first packet comprises the service identifier.
15. An apparatus comprising: at least one processor; at least one non-transitory computer-readable storage medium storing a program including processor-executable instructions, wherein the processor-executable instructions are executed by the at least one processor to cause the apparatus to perform the following: generating, a first packet, wherein the first packet comprises a segment routing header (SRH), the SRH comprises a service identifier, and the service identifier is related to first service information and second service information; and sending, the first packet to a second network device, wherein the service identifier indicates the second network device to execute at least one service based on the first service information, the second service information, and the first packet.
16. The apparatus according to claim 15, wherein the first service information comprises a first service, the second service information comprises a second service, and the at least one service comprises the first service and the second service; or the first service information comprises a first feature identifier, the second service information comprises a second feature identifier, wherein a feature identifier comprises a traffic identifier or a network identifier, and further comprises the first feature identifier and/or the second feature identifier; or the first service information comprises the first service, the second service information comprises the first feature identifier, the first feature identifier comprises the traffic identifier or the network identifier, and the at least one service comprises the first service.
17. The apparatus according to claim 9, wherein based on the first service information comprising the first service, and the second service information comprising the first feature identifier required for executing the at least one service, the service identifier comprises a service indication and a feature indication, wherein the service indication indicates the first service information, and the feature indication indicates that the service identifier comprises the first feature identifier; or the service identifier comprises a feature service indication, wherein the feature service indication indicates the first service and indicates that the service identifier comprises the first feature identifier.
18. An apparatus comprising: at least one processor; at least one non-transitory computer-readable storage medium storing a program including processor-executable instructions, wherein the processor-executable instructions are executed by the at least one processor to cause the apparatus to perform the following: receiving, a first packet sent by a first network device, wherein the first packet comprises a segment routing header (SRH), the SRH comprises a service identifier, and the service identifier is related to first service information and second service information; and executing, at least one service based on the first service information, the second service information, and the first packet.
19. The apparatus according to claim 18, wherein the first service information comprises a first service, the second service information comprises a second service, and the at least one service comprises the first service and the second service; or the first service information comprises a first feature identifier, the second service information comprises a second feature identifier, a feature identifier comprises a traffic identifier or a network identifier, and further comprises the first feature identifier and/or the second feature identifier; or the first service information comprises the first service, the second service information comprises the first feature identifier, and the first feature identifier comprises the traffic identifier or the network identifier.
20. A network system comprising: a first network device and a second network device, wherein the first network device comprises at least one processor and at least one non-transitory computer-readable storage medium storing a program including processor-executable instructions, wherein the processor-executable instructions are executed by the at least one processor to cause the first network device to perform the following: generating, a first packet, wherein the first packet comprises a segment routing header (SRH), the SRH comprises a service identifier, and the service identifier is related to first service information and second service information; and sending, the first packet to the second network device, wherein the service identifier indicates the second network device to execute at least one service based on the first service information, the second service information, and the first packet; wherein the second network device comprises at least one processor and at least one non-transitory computer-readable storage medium storing a program including processor-executable instructions, wherein the processor-executable instructions are executed by the at least one processor to cause the second network device to perform the following: receiving, the first packet sent by the first network device, wherein the first packet comprises the segment routing header (SRH), the SRH comprises the service identifier; and executing, the at least one service based on the first service information, the second service information, and the first packet.
Description
BRIEF DESCRIPTION OF DRAWINGS
[0057]
[0058]
[0059]
[0060]
[0061]
[0062]
[0063]
[0064]
[0065]
[0066]
[0067]
[0068]
[0069]
[0070]
DESCRIPTION OF EMBODIMENTS
[0071] To make the objectives, technical solutions, and advantages of this application clearer, the following further describes the implementations of this application in detail with reference to the accompanying drawings.
[0072] In this application, terms such as “first” and “second” are used to distinguish between same items or similar items that have basically same functions. It should be understood that there is no logical or time sequence dependency between “first”, “second”, and “n.sup.th”, and an execution sequence is not limited. It should be further understood that although the terms such as “first” and “second” are used in the following descriptions to describe various elements, these elements should not be limited by the terms. These terms are merely used to distinguish one element from another element. For example, without departing from the scope of the various examples, first service information may be referred to as second service information, and similarly, second service information may be referred to as first service information.
[0073] Terms in this application are explained below.
[0074] SRH: An internet protocol version 6 (IPv6) packet includes an IPv6 standard header, an IPv6 extension header (0, . . . , and n), and a payload. To implement SRv6 based on an IPv6 forwarding plane, an IPv6 extension header, referred to as an SRH extension header, is newly added. The extension header specifies an IPv6 path and stores a plurality of IPv6 SIDs. The plurality of SIDs may form a segment identifier list (Segment List). A head node adds one or more SRH extension headers to a packet, so that an intermediate node can forward the IPv6 packet based on path information included in the SRH extension header.
[0075] Service identifier: The service identifier is an identifier added by a head node in a segment routing network to a transmitted packet, indicates some or all services that need to be executed, based on the packet, by a network device that transmits the packet and information related to some or all services that need to be executed, and may include a feature identifier, a service parameter, or other information required for executing a service.
[0076] Feature identifier: The feature identifier includes a traffic identifier or a network identifier.
[0077] Traffic identifier: The traffic identifier is an identifier of a traffic feature of a transmitted packet. The traffic identifier includes any identifier, such as a flow identifier (Flow ID), an application identifier (App ID), or a 5-tuple, that can identify the traffic feature of the packet.
[0078] Network identifier: The network identifier is an identifier of a network feature related to packet transmission. The network identifier includes any identifier, such as a path identifier (Path ID) or a slice identifier, that can identify a network feature used to transmit a packet.
[0079] Feature indication: A service identifier may include a feature indication. When the feature indication is included, the feature indication indicates one or more pieces of feature identifier information carried in the service identifier, and may further indicate one or more feature types of the one or more feature identifiers.
[0080] Service indication: A service identifier may include a service indication. When the service indication is included, the service indication indicates one or more services, and these services may be referred to as service types. When the service types further need to carry parameter information, the service identifier may further include at least one service parameter corresponding to one or more service types.
[0081] Feature service indication: A service identifier may include a feature service indication, and the feature service indication includes both a function of the foregoing service indication and a function of the foregoing feature indication. To be specific, when the service identifier includes the feature service indication, the feature service indication indicates one or more services and indicates one or more pieces of feature identifier information carried in the service identifier, and may further indicate one or more feature types of the one or more feature identifiers. When these service types further need to carry parameter information, the service identifier may further include at least one service parameter corresponding to one or more service types.
[0082] Service information: The service information may be information such as a service type, a parameter required by a service, or a feature identifier required by a service.
[0083] The following describes an example of an application scenario of this application.
[0084] The SRv6 network includes a head node and a tail node, and at least one path may be established between the head node and the tail node.
[0085] For any path between the head node and the tail node, the path further includes at least one other node between the head node and the tail node. For ease of description, the another node between the head node and the tail node is referred to as an intermediate node.
[0086] For example, a first path and a second path shown in
[0087] In a related technology, the SRv6 network not only transmits a packet, but also provides a corresponding service for the packet or a service corresponding to the packet, for example, determines network performance of a forwarding path for transmitting the packet. The head node may forward the packet based on the first path or the second path. When an administrator of the SRv6 network needs to determine network performance of the first path or the second path for forwarding the packet, the administrator may generate a simulation packet, and use the simulation packet to carry a service requirement related to the service and various related parameters. The information is used to measure performance of the network forwarding path. However, in this solution, actual performance of actual service traffic cannot be measured when network performance is measured by using the simulation packet. Further, in a related technology, when a same service requires a plurality of pieces of information, or when a plurality of services need to be provided for a same packet, related content may be carried in a plurality of TLVs of an SRH. However, in this solution, a plurality of pieces of related information need to be carried in the plurality of TLVs. As a result, a device in a network needs to traverse the TLVs to obtain related information, and processing efficiency is low. The plurality of pieces of information include at least two pieces of information.
[0088] An embodiment of this application provides a solution to the foregoing problem. In a manner of using an SRH of a service packet to carry an indication service and service-related information, network performance measurement based on an actual service packet is implemented.
[0089] In addition, the technical solutions provided in embodiments of this application may be further applied to an application scenario in which an SRv6 provides another service or a plurality of other application scenarios, for example, known or future-oriented application scenarios such as security encryption, internet protocol flow performance measurement (IPFPM), light in-band operation, administration, and maintenance (Light IOAM), a service used to add a timestamp, a service function chain (SFC), and a forwarding or access control list (ACL).
[0090] In this embodiment of this application, the head node is referred to as a first network device. To enable the tail node and/or the intermediate node to execute at least one service based on a packet sent by the first network device, the first network device generates a first packet, where the first packet includes an SRH, the SRH includes a service identifier, and the service identifier includes first service information and second service information.
[0091] The first network device sends the first packet to a second network device (a tail node or an intermediate node on one of the at least one path) through the path. The second network device receives the first packet, and executes the at least one service based on the first service information, the second service information, and the first packet.
[0092] Optionally, the at least one service includes one service, two services, or more services, the first service information includes a first feature identifier, and the second service information includes a second feature identifier. The first feature identifier and the second feature identifier may be used to execute a same service, or may be used to execute different services.
[0093] Optionally, the at least one service includes at least a first service, the first service information may be used to indicate the first service, and the second service information includes the first feature identifier. The first feature identifier may be an identifier required for executing the first service, or may be an identifier required for executing a second service. The second service may be a second service determined by the intermediate node or the tail node after the intermediate node or the tail node receives the service identifier.
[0094] The feature identifier includes a traffic identifier or a network identifier. For explanations of the traffic identifier or the network identifier, refer to the foregoing descriptions. Details are not described herein again.
[0095] A detailed implementation process in which the first network device generates the first packet and a detailed implementation process in which the second network device processes the first packet are described in detail in the following embodiment shown in
[0096] Optionally, refer to
[0097] Optionally, the controller or the network management device may configure packets of network traffic for which a head node, a tail node, and/or an intermediate node in the SR network provide/provides a service.
[0098] Optionally, the head node is responsible for generating a service identifier.
[0099] In an example, the controller or the network management device may send a first configuration policy to the head node, where the first configuration policy includes a traffic identifier, and a service type set and/or a feature type set. The first configuration policy is used to indicate the head node to generate the service identifier based on information in the service type set and/or the feature type set after receiving a packet that conforms to the traffic identifier in the configuration policy. The service type set and/or the feature type set included in the first configuration policy are/is a set of to-be-executed or to-be-processed information of the packet corresponding to the traffic identifier. A first packet is generated based on the service identifier and the packet. Usually, the received packet is used as a payload part of the first packet. A detailed process in which the head node generates the first packet is described in detail in the following embodiment shown in
[0100] Optionally, the head node does not generate the service identifier, but obtains a service identifier delivered by the controller or the network device. In other words, the service identifier may be generated by the controller or the network device.
[0101] Optionally, after being generated by the intermediate node or the tail node in the network, the service identifier may be released to the controller or the network device in a form of an advertisement, a path computation element communication protocol (PCEP), or the like, and then released to the head node; or released by the intermediate node/tail node to the head node.
[0102] Optionally, before the head node generates the service identifier, the head node further obtains a second configuration policy, where the second configuration policy includes a corresponding rule for generating the service identifier based on the service type set and/or the feature type set. The head node may generate the service identifier according to the rule in the second configuration policy.
[0103] Optionally, the head node receives the second configuration policy sent by the controller or the network management device, or receives the second configuration policy sent by the intermediate node or the tail node, or generates the second configuration policy.
[0104] Optionally, when generating the second configuration policy, the head node further sends the second configuration policy to the tail node.
[0105] Optionally, when generating the second configuration policy, the head node further sends the second configuration policy to the intermediate node.
[0106] Optionally, the head node does not need to obtain the second configuration policy, but has the corresponding rule information by default. For example, the head node is configured to have the corresponding rule information before delivery.
[0107] Optionally, other related devices in the SR network, for example, the intermediate node and/or the tail node, may also obtain the second configuration policy, so that when receiving a packet including the service identifier, these related devices may parse the service identifier according to the corresponding rule, to perform a function such as a service indicated by the service identifier. A detailed process in which the intermediate node or the tail node processes the packet based on the service identifier is described in detail in the following embodiment shown in
[0108] Optionally, the tail node receives the second configuration policy sent by the controller or the network management device, or receives the second configuration policy sent by the intermediate node or the head node, or generates the second configuration policy.
[0109] Optionally, when generating the second configuration policy, the tail node further sends the second configuration policy to the head node.
[0110] Optionally, when generating the second configuration policy, the tail node further sends the second configuration policy to the intermediate node.
[0111] Optionally, the intermediate node receives the second configuration policy sent by the controller or the network management device, or receives the second configuration policy sent by the head node or the tail node, or generates the second configuration policy.
[0112] Optionally, when generating the second configuration policy, the intermediate node further sends the second configuration policy to the head node and the tail node.
[0113] Optionally, the intermediate node or the tail node in the SR network does not need to obtain the second configuration policy, but has the corresponding rule information by default. For example, the intermediate node or the tail node is configured to have the corresponding rule information before delivery.
[0114] Optionally, the first configuration policy further includes parameter information of each of x processing services, at least one processing service includes the x processing services, and x is an integer greater than 0.
[0115] Optionally, the controller or the network management device further sends a start command to the tail node, where the start command includes the service type set. The start command is used to configure the tail node to be capable of starting a processing service corresponding to each service type in the service type set, so that when receiving the first packet, the tail node can process the first packet based on the started processing service.
[0116] Optionally, the controller or the network management device further sends the start command to the intermediate node, where the start command is further used to configure the intermediate node to be capable of starting a processing service corresponding to each service type in the service type set, so that when receiving the first packet, the intermediate node can process the first packet based on the started processing service.
[0117] Optionally, the traffic identifier is 4-tuple information, 5-tuple information, or the like of a packet. The 4-tuple information of the packet includes a source address, a destination address, a source port number, and a destination port number of the packet. The 5-tuple information of the packet includes a protocol type, a source address, a destination address, a source port number, and a destination port number of the packet.
[0118] Optionally, any one of the at least one processing service includes one processing operation or an operation sequence including a plurality of processing operations.
[0119] Optionally, a service type in the service type set includes one or more of IPFPM, light IOAM, security encryption, a service used to add a timestamp, an SFC, and a forwarding and access control list (ACL). For example, the service type set is a set including IPFPM, or the service type set is a set including IPFPM+light IOAM, or the service type set is a set including IPFPM+security encryption, or the service type set is a set including IPFPM+light IOAM+SFC. Details are not listed one by one herein.
[0120] Optionally, at least one feature identifier includes a traffic feature identifier and/or a network feature identifier, a feature type of the traffic feature identifier includes one or more of a flow identifier (Flow ID) and an application identifier (App ID), and a feature type of the network feature identifier includes one or more of a path identifier (Path ID), a slice identifier, and the like.
[0121] Optionally, when the feature type of the traffic feature identifier includes Flow ID, the feature type of the traffic feature identifier further includes a sequence number (Seq Num).
[0122] The following uses an example to describe the first configuration policy. Refer to
[0123] For an example of the second configuration policy, refer to Table 1, Table 2, Table 3, or Table 4 in
[0124] Refer to
[0125] S201: A first network device generates a first packet, where the first packet includes an SRH, and the SRH includes a service identifier.
[0126] The service identifier is related to first service information and second service information.
[0127] Optionally, the first service information includes a first service, the second service information includes a second service, and the foregoing at least one service includes the first service and the second service. The first service information and the second service information herein may indicate the first service and the second service by using a service indication included in the service identifier.
[0128] Optionally, the first service information includes a first feature identifier, and the second service information includes a second feature identifier. The first service information and the second service information herein are carried in the service identifier. In addition, the service identifier further includes a feature indication, and the feature indication part indicates the first feature identifier and the second feature identifier.
[0129] Optionally, the first service information includes the first service, and the second service information includes the first feature identifier. The first service information herein is indicated by using a service indication included in the service identifier, and the service indication part may further indicate more services. The service identifier further includes a feature indication indicating the first feature identifier, and the feature indication may also indicate more feature identifiers.
[0130] Optionally, the first service information includes the first service, and the second service information includes the first feature identifier. The service identifier includes a feature service indication, and the feature service indication may indicate both the first service and the first feature identifier. To be specific, in this case, the first service information includes the first service, and the second service information includes the first feature identifier required for executing the at least one service.
[0131] That is, when the first service information and the second service information include a service (or a service type), the service identifier includes a service indication part or a feature service indication part, where the service indication indicates at least one to-be-executed service, for example, the first service or the second service described above, and the feature service indication indicates at least one service to be executed based on the first packet, for example, the first service described above.
[0132] When the first service information and the second service information include a feature identifier, the service identifier includes a feature indication part or a feature service indication part, where the feature indication part indicates that the service identifier includes the feature identifier, for example, the first feature identifier and/or the second feature identifier.
[0133] The feature identifier includes a traffic identifier or a network identifier. For explanations of the traffic identifier or the network identifier, refer to the foregoing descriptions. Details are not described herein again.
[0134] Optionally, in this step, the first network device generates the first packet in the following operations 2011 to 2013. The operations 2011 to 2013 are respectively as follows:
[0135] S2011: The first network device receives a second packet, and obtains a first configuration policy corresponding to network traffic to which the second packet belongs.
[0136] The first configuration policy includes a traffic identifier of the network traffic to which the second packet belongs. The traffic identifier is 4-tuple information or 5-tuple information in the second packet. In S2011, the first network device receives the second packet, obtains, from the second packet, the traffic identifier of the network traffic to which the second packet belongs, and queries, from a stored first policy configuration, whether the first configuration policy including the traffic identifier exists. If the first configuration policy including the traffic identifier exists, the first network device obtains the first configuration policy including the traffic identifier, to obtain the first configuration policy corresponding to the network traffic to which the second packet belongs.
[0137] S2012: The first network device obtains the service identifier based on a service type set and/or a feature type set included in the first configuration policy.
[0138] In this operation, the first network device generates the service identifier based on the service type set and/or the feature type set included in the first configuration policy.
[0139] The generated service identifier has the following four possible cases: Case 1: The service identifier includes a service indication. Case 2: The service identifier includes a feature indication and a feature identifier. Case 3: The service identifier includes a feature indication, a feature identifier, and a service indication. Case 4: The service identifier includes a feature service indication and a feature identifier. When the first configuration policy includes the service type set, the obtained service identifier includes the service indication, that is, the service identifier in Case 1 is obtained. When the first configuration policy includes the feature type set, the obtained indication information includes the feature indication, that is, the service identifier in Case 2 is obtained. When the first configuration policy includes the service type set and the feature type set, the obtained service identifier includes the service indication, the feature indication, and the feature identifier, or the obtained service identifier includes the feature service indication, that is, the service identifier in Case 3 or Case 4 is obtained.
[0140] Manners of generating the service identifier in the four cases are respectively described one by one.
[0141] Case 1: The Service Identifier Includes the Service Indication.
[0142] The first configuration policy includes a service type set. The first network device obtains a corresponding service indication from the first correspondence based on the service type set included in the first configuration policy, that is, the service indication corresponds to the service type set. The service indication may indicate one or more service types, that is, a type corresponding to the first service or the second service. The first correspondence is used to store a correspondence between a service type set, parameter information, and a generation rule of content in a corresponding service indication. That is, the second configuration policy may include the first correspondence herein. The service indication may be represented in a bitmap form or a numeric form.
[0143] Any record in the first correspondence includes a service type set and a generation rule of content in a service indication corresponding to the service type set.
[0144] For example, for details, refer to a first correspondence shown in Table 1.
[0145] The first correspondence is an example of a rule correspondence for generating a service indication based on a bitmap. As shown in Table 1, a first record in the correspondence indicates that when a zero.sup.th bit in the service indication is set to a special value, for example, 1, it indicates that an IPFPM service needs to be provided, and the service further includes a service parameter, that is, color bit information, where the color bit information includes at least one of a packet loss rate and a delay. A second record in the first correspondence indicates that when a first bit in the service indication is set to a special value, for example, 1, it indicates that a light IOAM service needs to be provided, and a processing service corresponding to a service type “light IOAM” does not need to carry parameter information. Meanings of other records in the first correspondence shown in Table 1 are not described one by one. In the foregoing descriptions, when the service indication is represented in a bitmap manner, the bitmap may include four or more bits. This is not specifically limited in this application. In an example, a value of the service indication may be 0101. It is understood based on a high-order bit on the left and a low-order bit (a zero.sup.th bit) on the right that the service indication indicates two services, and service types indicated by the two services include IPFPM and security encryption services. In this case, the service identifier further needs to carry a service parameter, and the service parameter is color bit information corresponding to IPFPM. To be specific, the foregoing parameter information is optional. In another example, a value of the service indication may be 1001. It is understood based on a high-order bit on the left and a low-order bit (a zero.sup.th bit) on the right that the service indication indicates that a service type corresponding to the service indication includes IPFPM and an SFC. To be specific, the service identifier includes indication information, the indication information indicates first service information and second service information, the first service information includes a first service, and the second service information includes a second service. Optionally, in this case, the service identifier further needs to carry a service parameter. The service parameter includes color bit information corresponding to IPFPM and metadata required by an SFC service.
[0146] When the service identifier needs to carry a plurality of pieces of parameter information, the first device carries a plurality of parameters in a manner corresponding to a location sequence of the service indication. For details, refer to
TABLE-US-00001 TABLE 1 Service Service indication rule type set Parameter information Zero.sup.th bit IPFPM Color bit information (packet loss rate and/or delay) First bit Light IOAM Null Second bit Security Null encryption Third bit SFC Metadata . . . . . . . . .
[0147] In another example, the first correspondence is an example of a rule correspondence for generating a service indication based on a value. When a form of the service indication is a numeric form, the service indication is a value. For example, for details, refer to a first correspondence shown in Table 2. A difference between the first correspondence shown in Table 2 and the first correspondence shown in Table 1 lies in that a service indication in each record in the first correspondence shown in Table 2 is a value. For example, in a first record in Table 2, when a value of the service indication is 1, the service indication indicates an IPFPM service and indicates that the service indication further needs to carry color bit information. In this case, the first service information and the second service information are the IPFPM service indicated in the service indication and the color bit information carried in the service indication. When a value of the service indication is 5, the service indication indicates IPFPM and light IOAM services, and indicates that a service parameter that needs to be carried includes color bit information. In this case, the first service information and the second service information that are related to the service identifier are the IPFPM and light IOAM services indicated in the service indication, and the service identifier further carries service parameter information. When a value of the service indication is 9, the service indication indicates IPFPM, security encryption, and SFC services. Correspondingly, parameter information further needs to be carried in the service identifier, and includes color bit information and metadata. In this case, the first service information and the second service information that are related to the service identifier are any two of the IPFPM service, the security encryption service, and the SFC service that are indicated in the service indication.
TABLE-US-00002 TABLE 2 Service Parameter indication rule Service type set information 1 IPFPM Color bit information 2 Light IOAM Null 3 Security encryption Null 4 SFC Null 5 IPFPM + light IOAM Color bit information 6 IPFPM + Color bit information security encryption 7 IPFPM + SFC Color bit information 8 IPFPM + light IOAM + Color bit information SFC and metadata 9 IPFPM + security Color bit information encryption + SFC and metadata 10 Light IOAM + SFC Null 11 Security encryption + Null SFC
[0148] In the foregoing descriptions, in addition to the service indication, the service identifier generated by the first network device may further include parameter information of N processing services, where N is an integer greater than 0, and at least one processing service indicated by the service indication includes the N processing services.
[0149] Optionally, in this step, the first network device further obtains the parameter information of the N processing services. When the first configuration policy includes the parameter information of the N processing services, the first network device obtains the parameter information of the N processing services that is included in the first configuration policy. When the first configuration policy does not include the parameter information of the processing service, for the service type set included in the first configuration policy, if a record that is in the first correspondence and that includes the service type set further stores the parameter information of the N processing services, the first network device further obtains the parameter information of the N processing services from the record.
[0150] Optionally, for the service indication and the parameter information of the processing services in the service identifier, a sequence of the parameter information of the processing services in the service identifier corresponds to the service indication, that is, the service indication further indicates the sequence of the parameter information of the processing services.
[0151] Refer to
[0152] In an example, when the service indication in the first part is 1001 in a bitmap form, the second part in the service identifier includes packet loss rate and/or delay information corresponding to IPFPM, and metadata required by an SFC service. A plurality of pieces of parameter information in the second part may be carried in a same sequence indicated by the service indication. For example, the service indication is 1001, where a high-order bit is on the left, and a low-order bit (a zero.sup.th bit) is on the right. In this case, in a manner from right (low-order bit) to left (high-order bit) or from left (high-order bit) to right (low-order bit), the first network device may use the second part shown in
[0153] Optionally, the first network device further determines a quantity of bits occupied by each parameter in the service identifier. For example, the metadata is 32 bits, and the packet loss rate and/or delay information are/is a color bit and occupy/occupies 2 bits. Information about the quantity of bits occupied by each parameter in the service identifier may be included in the second configuration policy, or may be a default rule, a rule obtained by the first network device before delivery, or the like.
[0154] Case 2: The Service Identifier Includes the Feature Indication.
[0155] Optionally, the first network device determines the at least two feature identifiers based on the feature type set included in the first configuration policy, where the at least two feature identifiers include a first feature identifier and a second feature identifier. The service identifier generated by the first network device includes the first feature identifier, the second feature identifier, and the feature indication that are obtained by the first network device. That is, when the service identifier includes the feature identifier, the service identifier includes the feature indication, and the feature indication indicates one or more feature types corresponding to one or more feature identifiers.
[0156] Optionally, the service identifier may not include the feature indication, but a specific type of the feature identifier is determined according to another rule.
[0157] In an example, the first configuration policy includes the feature type set. The first network device obtains a corresponding feature indication from a second correspondence based on the feature type set included in the first configuration policy, where the second correspondence is used to store a correspondence between the feature indication and a generation rule of the feature type set. That is, the second configuration policy may include the second correspondence herein. The feature indication may be represented in a bitmap form or a numeric form.
[0158] Any record in the second correspondence includes a feature type set and a generation rule of content in a feature indication corresponding to the feature type set.
[0159] For example, for details, refer to a second correspondence shown in Table 3. The second correspondence is an example of a rule correspondence for generating a feature indication based on a bitmap. As shown in Table 3, a first record in the second correspondence indicates that when a zero.sup.th bit of the feature indication is set to a special value, for example, 1, it indicates that a feature type needs to be carried in a first packet and includes Path ID. A second record in the second correspondence indicates that when a first bit of the feature indication is set to a special value, for example, 1, it indicates that a feature type needs to be carried in a first packet and includes Flow ID and Seq num. Meanings of other records in the second correspondence shown in Table 3 are not described one by one. In the foregoing descriptions, when the feature indication is represented in a bitmap manner, the bitmap may include three or more bits. This is not specifically limited in this application. In an example, a value of the feature indication may be 011. It is understood based on a high-order bit on the left and a low-order bit (a zero.sup.th bit) on the right that the feature indication indicates two features, and feature identifiers corresponding to the two features include Path ID and Flow ID+Seq num. When the service identifier carries the feature indication, the service identifier further needs to carry at least one feature identifier corresponding to the feature indication. That is, when a value of the feature indication is 011, the service identifier further includes Path ID and Flow ID+Seq num.
TABLE-US-00003 TABLE 3 Feature indication Feature type set Zero.sup.th bit Path ID First bit Flow ID + Seq num Second bit App ID . . . . . .
[0160] In another example, when a form of the feature indication is a numeric form, the feature indication is a value. For example, for details, refer to a second correspondence shown in Table 4. A difference between the second correspondence shown in Table 4 and the second correspondence shown in Table 3 lies in that a feature indication in each record in the second correspondence shown in Table 4 is a value. For example, when a feature indication in a first record in Table 4 is a value 1, the feature indication indicates a feature identifier Path ID; when a feature indication in a second record is a value 2, the feature indication indicates a feature identifier Flow ID+Seq num; and when the feature indication is a value 4, the feature indication indicates a feature identifier Path ID+App ID.
TABLE-US-00004 TABLE 4 Feature indication Feature type set 1 Path ID 2 Flow ID + Seq num 3 App ID 4 Path ID + App ID . . . . . .
[0161] Optionally, when the feature type set includes a feature type “Path ID”, if the first network device has selected a path when receiving a second packet, the first network device obtains a path identifier of the selected path. If the first network device does not select a path when receiving the second packet, the first network device selects one path from at least one path between the first network device and the tail node, and obtains a path identifier of the selected path, where the at least one feature identifier includes the path identifier of the selected path.
[0162] When the feature type set includes a feature type “App ID”, the first network device obtains, based on the second packet, an application identifier corresponding to the second packet, where the at least one feature identifier includes the application identifier. When the feature type set includes a feature type Flow ID, the first network device obtains, from the second packet, a traffic identifier of network traffic to which the second packet belongs, where the traffic identifier is 5-tuple information or 4-tuple information of the second packet, and the at least one feature identifier includes the traffic identifier. When the feature type set includes a feature type “Seq num”, the first network device obtains a sequence number of the second packet based on the second packet, where the at least one feature identifier includes the sequence number.
[0163] A sequence of the feature identifiers in the service identifier corresponds to the feature indication, that is, the feature indication indicates the sequence of the feature identifiers.
[0164] Refer to
[0165] In an example, when the feature indication in the first part is 011 in the foregoing bitmap form, the second part in the service identifier includes two feature identifiers: Path ID and Flow ID+Seq num. These feature identifiers may be carried in a same sequence indicated by the feature indication. For example, the service indication is 011, where a high-order bit is on the left, and a low-order bit (a zero.sup.th bit) is on the right. In this case, in a manner from right (low-order bit) to left (high-order bit) or from left (high-order bit) to right (low-order bit), the first network device may use the second part shown in
[0166] Optionally, the first network device further determines a quantity of bits occupied by each feature identifier in the service identifier. For example, Path ID is 20 bits, and Flow ID+Seq num occupies 48 bits. Information about the quantity of bits occupied by each feature identifier in the service identifier may be included in the second configuration policy, or may be a default rule, a rule obtained by the first network device before delivery, or the like.
[0167] In the following descriptions, a case in which the first service information is used to indicate the first service, and the second service information includes the first feature identifier required for executing the at least one service includes Case 3 or Case 4.
[0168] Case 3: The Service Identifier Includes the Service Indication and the Feature Indication.
[0169] The first configuration policy includes a service type set and a feature type set. The first network device determines the service identifier based on the service type set and the feature type set that are included in the first configuration policy, where the service identifier includes the service indication and the feature indication.
[0170] Optionally, the first network device may obtain parameter information of all of N processing services. In addition to the service indication and the feature indication, the service identifier generated by the first network device may further include parameter information of the N processing services, where at least one processing service indicated by the service indication includes the N processing services.
[0171] Optionally, in this step, the first network device further obtains the parameter information of the N processing services. When the first configuration policy includes the parameter information of the N processing services, the first network device obtains the parameter information of the N processing services that is included in the first configuration policy. When the first configuration policy does not include the parameter information of the processing service, for the service type set and the feature type set that are included in the first configuration policy, if a record that is in the second correspondence and that includes the service type set and the feature type set further stores the parameter information of the N processing services, the first network device further obtains the parameter information of the N processing services from the record.
[0172] Optionally, for a process of obtaining the parameter information of the processing service, refer to related content in Case 1. Details are not described herein again.
[0173] Optionally, the first network device determines at least one feature identifier based on the feature type set included in the first configuration policy. In addition to the service indication and the feature indication, the service identifier generated by the first network device further includes the at least one feature identifier.
[0174] For details about obtaining the service indication and the feature indication by the first network device, and detailed information about the related service parameter and the feature identifier, refer to the descriptions in Case 1 and Case 2. Details are not described herein again.
[0175] The following focuses on how the service identifier carries the service indication and the feature indication. Optionally, the service identifier further carries the service parameter and the feature identifier. Refer to
[0176] In the service identifier, the first sub-part may be a service indication, and the second sub-part may be a feature indication. In the service identifier, the fifth sub-part may carry parameter information of all of the N processing services, for example, the service 1 and the service 2, and the third sub-part may carry one or more feature identifiers, for example, the ID 1 and the ID 2. Optionally, the service identifier further includes the fourth sub-part, and the fourth sub-part is a reserved part.
[0177] In an example, the feature identifier corresponds to a location of the feature indication, and the service parameter information corresponds to a location of the service indication. To be specific, when the feature indication occupies a low-order bit (corresponding to the second sub-part in
[0178] Case 4: The Service Identifier Includes the Feature Service Indication.
[0179] The first configuration policy includes a service type set and a feature type set. The first network device obtains a corresponding feature service indication from a third correspondence based on the service type set and the feature type set that are included in the first configuration policy, where the third correspondence is used to store a correspondence between the feature service indication, the service type set, the feature type set, and a generation rule of parameter information.
[0180] Any record in the third correspondence includes a correspondence between a service type set, a feature type set, and a generation rule of a feature service indication. The service type set includes a service type of each of at least one processing service, and the feature type set includes a feature type of each of at least one feature identifier. The feature service indication indicates the at least one processing service and the at least one feature identifier.
[0181] Optionally, if a processing service in the at least one processing service has parameter information, parameter information included in the record is the parameter information of the processing service. When each of the at least one processing service has no parameter information, the parameter information included in the record may indicate null.
[0182] For example, for details, refer to a third correspondence shown in Table 5. The third correspondence is an example of a rule correspondence for generating a feature service indication based on a bitmap. A first record in the third correspondence indicates that when a zero.sup.th bit in the feature service indication is set to a special value, for example, 1, it indicates that the SR network needs to provide an IPFPM service for the first packet, and needs to use the first packet to carry a feature identifier Path ID, which may be denoted as an ID 1, and service parameter information, that is, color bit information (for example, a packet loss rate and/or a delay), which may be denoted as a service 1. A second record in the third correspondence indicates that when a first bit in the feature service indication is set to a special value, for example, 1, it indicates that the SR network needs to provide a light IOAM service for the first packet, and needs to use the first packet to carry a feature identifier Flow ID+Seq num, where the service does not need to carry parameter information. Meanings of other records in the third correspondence shown in Table 5 are not described one by one.
[0183] In an example, a value of the feature service indication determined by the first network device is 0011. It is understood based on a high-order bit on the left and a low-order bit (a zero.sup.th bit) on the right that the feature service indication indicates two services, and service types indicated by the two services include IPFPM and security encryption services. In this case, the service identifier further needs to carry a service parameter, and the service parameter is color bit information (for example, packet loss rate and/or delay information) corresponding to IPFPM. In addition, the service identifier further needs to carry Path ID and Flow ID+Seq num.
TABLE-US-00005 TABLE 5 Feature service Parameter indication Service type set Feature type set information Zero.sup.th bit IPFPM Path ID Color bit information Feature service Service type set Feature type set Parameter indication information First bit Light IOAM Flow ID + Seq num Null Second bit Security encryption App ID Null . . . . . . . . . . . .
[0184] When a form of the feature service indication is a numeric form, the feature service indication is a value. For example, for details, refer to a third correspondence shown in Table 6. A difference between the third correspondence shown in Table 6 and the third correspondence shown in Table 5 lies in that a feature service indication in each record in the third correspondence shown in Table 6 is a value. For example, when a feature service indication in a first record in Table 6 is a value 1, it indicates that the SR network needs to provide an IPFPM service for the first packet, and needs to use the first packet to carry a feature identifier Path ID, which may be denoted as an ID 1, and service parameter information, that is, color bit information (for example, a packet loss rate and/or a delay), which may be denoted as a service 1.
TABLE-US-00006 TABLE 6 Feature service Parameter indication Service type set Feature type set information 1 IPFPM Path ID Color bit information 2 Light IOAM Flow ID + Seq num Null 3 Security encryption App ID Null 4 SFC Path ID + App ID Null . . . . . . . . . . . .
[0185] Optionally, in the service identifier, a sequence of the parameter information of the processing services corresponds to the feature service indication, that is, the feature service indication further indicates the sequence of the parameter information of the processing services; and a sequence of the feature types in the feature type set corresponds to the feature service indication, that is, the feature service indication further indicates the sequence of the feature types.
[0186] The first network device selects the first path from the first path and the second path between the first network device and the tail node based on Path ID in the feature type set included in the first configuration policy, and obtains a path identifier Path 1 of the first path. The first network device generates a service identifier, where the service identifier includes a feature service indication “0011”, the path identifier Path 1 of the first path, and parameter information “packet loss rate and/or delay”.
[0187] Optionally, refer to
[0188] The first part in the service identifier is the feature service indication. In the service identifier, the fifth sub-part carries the parameter information (for example, a packet loss rate and/or a delay) of all of the N processing services, and the third sub-part carries the at least one feature identifier (for example, Path 1). Optionally, the service identifier further includes the fourth sub-part, and the fourth sub-part is a reserved part.
[0189] Optionally, in this step, the first network device further obtains the parameter information of the N processing services. When the first configuration policy includes the parameter information of the N processing services, the first network device obtains the parameter information of the N processing services that is included in the first configuration policy. When the first configuration policy does not include the parameter information of the processing service, for the service type set included in the first configuration policy, if a record that is in the third correspondence and that includes the service type set further stores the parameter information of the N processing services, the first network device further obtains the parameter information of the N processing services from the record.
[0190] In an example, the feature identifier and the service parameter information occupy locations in the service identifier according to a default rule. For example, the feature identifier occupies a high-order bit (corresponding to the third sub-part in
[0191] In an example, the service identifier is a path segment identifier.
[0192] Optionally, a length of the service identifier is 128 bits.
[0193] In a specific example, the service indication part and the feature indication part may occupy a total of 16 bits in the 128 bits, and the 16 bits occupy high-order bits or low-order bits in the 128 bits. That is, a length of the first part is 16 bits, a length of the second part is 112 bits, and the first part is located in a high-order bit or a low-order bit in the service identifier.
[0194] The foregoing describes an example of a structure and composition of the service identifier. When the service identifier carries a parameter or a feature identifier, the parameter or the feature identifier may be applied to one service, or may be applied to a plurality of services. This is not limited in this application.
[0195] S2103: The first network device generates the first packet, where the first packet includes the SRH, and the SRH includes the service identifier.
[0196] The first network device may add an SRH to the second packet, where the SRH includes the service identifier.
[0197] Refer to an SRH shown in
[0198] Optionally, the segment identifier list includes a service identifier. Because the service identifier includes at least two pieces of information related to one or more services, different TLVs do not need to be set in the SRH to carry information about all service types in the service type set, and different TLVs do not need to carry feature identifiers corresponding to all feature types in the feature type set. In this way, a length of the first packet is reduced. After the first network device sends the first packet, the second network device that receives the first packet does not need to spend a lot of time parsing a TLV in the first packet, to increase efficiency of parsing the first packet and executing a service.
[0199] Optionally, refer to
[0200] Alternatively, optionally, refer to
[0201] Alternatively, optionally, refer to
[0202] Optionally, the SRH includes at least one TLV, and the service identifier may not be located in the segment identifier list in the SRH, but may be located in one TLV in the SRH. The TLV includes a type field, a length field, and a value field. The type field includes a TLV type used to carry the service identifier, and the value field includes the service identifier.
[0203] Because the service identifier includes indication information indicating the service type set and the feature type set, only one TLV needs to include the service identifier. In this way, other different TLVs do not need to be set in the SRH to carry all service types in the service type set, and other different TLVs do not need to carry feature identifiers corresponding to all feature types in the feature type set. In this way, a length of the first packet is reduced. Especially when information about at least two services needs to be carried in the first packet, after the first network device sends the first packet, the second network device that receives the first packet does not need to spend a lot of time parsing a TLV in the first packet, to increase efficiency of parsing the first packet.
[0204] Optionally, when the first network device generates the first packet, the SRH further carries a flag. When a value of the flag is set to a special value, for example, 1, it indicates that the first packet carries the service identifier.
[0205] Optionally, the flag is further used to indicate a location of the service identifier in the SRH.
[0206] S202: The first network device sends the first packet.
[0207] If the first network device has selected a path in the operation S201, the first network device sends the first packet through the selected path. For example, in the example shown in
[0208] If the first network device does not select a path in the operation S201, the first network device selects a path from paths between the first network device and the tail node, and sends the first packet through the selected path.
[0209] S203: The second network device receives the first packet, and processes the first packet based on the service identifier in the first packet.
[0210] The second network device is a node on the selected path, and includes a tail node or an intermediate node.
[0211] For the intermediate node, if the controller configures the intermediate node to process a packet, or a service needs to be processed by the intermediate node, the intermediate node receives the first packet, processes the first packet based on an operation in this step, and sends the first packet to the tail node after processing the first packet. If the controller does not configure the intermediate node to process a packet, or no service needs to be processed by the intermediate node, the intermediate node receives the first packet, and may forward the first packet to the tail node. The tail node receives the first packet, and processes the first packet based on an operation in this step.
[0212] Optionally, after receiving the packet, the second network device may obtain the service identifier at a determined location.
[0213] Optionally, after receiving the first packet, the second network device obtains the service identifier based on a flag of the first packet. In an implementation, the second network device determines, based on the flag of the first packet, whether the first packet includes the service identifier, and obtains the service identifier from the first packet when determining that the first packet includes the service identifier.
[0214] When the service identifier is in the segment identifier list of the first packet, the second network device obtains the service identifier from the segment identifier list. For example, the second network device obtains the service identifier from a field located at the beginning of the segment identifier list, or obtains the service identifier from a field located at the end of the segment identifier list, or determines a field that is located before the end of the segment identifier list and that is adjacent to the end of the segment identifier list, and obtains the service identifier from the field.
[0215] When the service identifier is located in the TLV in the first packet, the TLV used to carry the service identifier is parsed from the first packet, and the service identifier is obtained from the value field in the TLV.
[0216] In the foregoing descriptions, the second network device may determine the location of the service identifier by using the flag information, or the service identifier may be carried in the default location.
[0217] Information included in the service identifier in the first packet includes the foregoing four cases, and the four cases are Case 1, Case 2, Case 3, and Case 4 described in S201.
[0218] Optionally, in Case 1, when the service identifier includes the service indication, in this step, the second network device determines at least two services based on the service indication, and executes the determined at least two services based on the first packet.
[0219] Optionally, when the service identifier includes the parameter information of all of the N processing services, the second network device further sequentially obtains the parameter information of all of the N processing services from the service identifier based on the service indication, and processes the first packet based on the at least one processing service and the parameter information of all of the N processing services.
[0220] The second network device stores the first correspondence. A detailed implementation in which the second network device obtains the first correspondence is the same as a detailed implementation in which the first network device obtains the first correspondence. Details are not described herein again.
[0221] The second network device obtains the service type set from the first correspondence based on the service indication, where the service type set includes a service type of each of the at least one service; and determines each service based on the service type of each service.
[0222] Optionally, for the parameter information of all of the N processing services, a sequence of the parameter information of the processing services in the service identifier is the same as a sequence of service types of the processing services in the service type set. Therefore, the parameter information of the processing services is obtained from the service identifier based on the sequence of the service types of the processing services in the service type set.
[0223] In some cases, the second network device does not require at least one feature identifier when processing the first packet. For example, it is assumed that a processing service performed by the second network device on the first packet is a processing service corresponding to IPFPM, and there is one path between the head node and the tail node. In this case, the second network device may not require a path identifier, and the second network device processes the first packet based on the processing service corresponding to IPFPM, to obtain a packet loss rate and/or a delay of the first packet, and then sends a path identifier of the path and the packet loss rate and/or the delay of the first packet to the controller or the network management device. Therefore, when the first network device generates the first packet, the service identifier in the first packet may include only the service indication.
[0224] For example, it is assumed that there is only one path between the head node and the tail node. Refer to the example shown in
[0225] Optionally, in Case 2, when the service identifier includes the feature indication, the service identifier includes at least two feature identifiers. In this step, the second network device sequentially obtains the at least two feature identifiers from the service identifier based on the feature indication, and executes at least one service based on the at least two feature identifiers and the first packet.
[0226] Optionally, an operation that the second network device obtains the at least two feature identifiers may be as follows: The second network device obtains a feature type set based on the feature indication, and sequentially obtains the at least two feature identifiers from the service identifier based on feature types that are of the at least two feature identifiers and that are included in the feature type set.
[0227] Optionally, the second network device stores the second correspondence. A manner in which the second network device obtains the second correspondence is the same as a manner in which the first network device obtains the second correspondence. Details are not described herein again.
[0228] Optionally, the second network device obtains the feature type set from the second correspondence based on the feature indication.
[0229] Because a sequence of all of the at least two feature identifiers in the service identifier is the same as a sequence of feature types of the feature identifiers in the feature type set, the feature identifiers are identified and obtained from the service identifier based on the sequence of the feature types of the feature identifiers.
[0230] Optionally, before performing this step, the controller configures, on the second network device, the feature identifier and one or more processing services corresponding to the feature identifier. In an implementation, the controller sends a fourth correspondence to the second network device. For any record in the fourth correspondence, the any record in the correspondence includes a feature identifier and a service type of each of at least one processing service corresponding to the feature identifier, some processing services included in the at least one processing service has parameter information, and the record further includes the parameter information of the some processing services. The second network device receives and stores the fourth correspondence.
[0231] Optionally, an operation that the second network device processes the first packet based on the at least one feature identifier may be as follows: The second network device obtains a corresponding service type from the fourth correspondence based on each of the at least one feature identifier, determines a processing service corresponding to the obtained service type, and performs the determined processing service on the first packet based on the at least one feature identifier.
[0232] Optionally, if the second network device further obtains parameter information of the corresponding processing service from the fourth correspondence based on each feature identifier, the second network device performs the determined processing service on the first packet based on the at least one feature identifier and the obtained parameter information of the processing service.
[0233] For example, refer to the example shown in
[0234] In an example, if a service type obtained from the fourth correspondence based on the traffic identifier of the second packet is security encryption, the second network device processes the first packet based on the traffic identifier and the sequence number of the second packet, and performs security encryption processing on the first packet.
[0235] Optionally, in Case 3, when the service identifier includes the service indication and the feature indication, the service identifier includes at least one feature identifier, and the service identifier may further include parameter information of all of the N processing services.
[0236] In this step, the second network device determines at least one processing service based on the service indication, sequentially obtains the at least one feature identifier from the service identifier based on the feature indication, and processes the first packet based on the at least one processing service and the at least one feature identifier.
[0237] For a detailed implementation process in which the second network device determines the at least one processing service and obtains the at least one feature identifier, refer to related content in Case 1 and Case 2. Details are not described herein again.
[0238] Optionally, when the service identifier includes the parameter information of all of the N processing services, the second network device further sequentially obtains the parameter information of all of the N processing services from the service identifier based on the service indication, and processes the first packet based on the at least one feature identifier, the at least one processing service, and the parameter information of all of the N processing services.
[0239] For a detailed implementation process in which the second network device obtains the parameter information of all of the N processing services, refer to related content in Case 1. Details are not described herein again.
[0240] For example, refer to the example shown in
[0241] Alternatively, when the service indication and the feature indication are in a numeric form, the second network device obtains a service indication “value 1” and a feature indication “value 1” that are included in the service identifier of the first packet; obtains, based on the service indication “value 1”, a corresponding service type set from the first correspondence shown in Table 2, where the service type set includes IPFPM, determines a processing service corresponding to IPFPM, and obtains parameter information, that is, color bit information, from the service identifier, where the color bit information includes a packet loss rate and/or a delay; and obtains, based on the feature indication “value 1”, a corresponding feature type set from the second correspondence shown in Table 4, where the feature type set includes Path ID, and obtains a path identifier Path 1 of the first path from the service identifier based on Path ID.
[0242] The second network device processes the first packet based on the processing service corresponding to IPFPM, the path identifier Path 1 of the first path, and the service parameter “packet loss rate and/or delay”, to obtain a packet loss rate and/or a delay of the first packet, sends the packet loss rate and/or the delay of the first packet, and sends the path identifier Path 1 of the first path. Optionally, the second network device sends, to the controller or the network management device, the packet loss rate and/or the delay of the first packet and the path identifier Path 1 of the first path.
[0243] Optionally, in Case 4, when the service identifier includes the feature service indication, the service identifier further includes at least one feature identifier, and the service identifier may further include parameter information of all of the N processing services.
[0244] In this step, the second network device determines at least one processing service based on the feature service indication, sequentially obtains the at least one feature identifier from the service identifier, and processes the first packet based on the at least one processing service and the at least one feature identifier.
[0245] The second network device stores the third correspondence. A detailed implementation in which the second network device obtains the third correspondence is the same as a detailed implementation in which the first network device obtains the third correspondence. Details are not described herein again.
[0246] The second network device obtains a corresponding service type set and a corresponding feature type set from the third correspondence based on the feature service indication, where the service type set includes a service type of each of the at least one processing service, and the feature type set includes a feature type of each of the at least one feature identifier; and determines each processing service based on the service type of each processing service, and sequentially obtains feature identifiers from the service identifier based on the feature type of each feature identifier.
[0247] Because a sequence of all of the at least one feature identifier in the service identifier is the same as a sequence of feature types of the feature identifiers in the feature type set, the feature identifiers are identified and obtained from the service identifier based on the sequence of the feature types of the feature identifiers.
[0248] Optionally, when the service identifier includes the parameter information of all of the N processing services, the second network device further sequentially obtains the parameter information of all of the N processing services from the service identifier based on the service indication, and processes the first packet based on the at least one feature identifier, the at least one processing service, and the parameter information of all of the N processing services.
[0249] For a detailed implementation process in which the second network device obtains the parameter information of all of the N processing services, refer to related content in Case 1. Details are not described herein again.
[0250] For example, refer to the example shown in
[0251] Alternatively, when the feature service indication is in a numeric form, the second network device obtains a feature service indication “value 1” included in the service identifier of the first packet; and obtains, based on the feature service indication “value 1”, a corresponding service type set and a corresponding feature type set from the third correspondence shown in Table 6, where the service type set includes IPFPM, determines a processing service corresponding to IPFPM, obtains parameter information, that is, color bit information, from the service identifier, where the color bit information includes a packet loss rate and/or a delay, and the feature type set includes Path ID, and obtains a path identifier Path 1 of the first path from the service identifier based on Path ID.
[0252] The second network device processes the first packet based on the processing service corresponding to IPFPM, the path identifier Path 1 of the first path, and the service parameter “packet loss rate and/or delay”, to obtain a packet loss rate and/or a delay of the first packet, sends the packet loss rate and/or the delay of the first packet, and sends the path identifier Path 1 of the first path. Optionally, the second network device sends, to the controller or the network management device, the packet loss rate and/or the delay of the first packet and the path identifier Path 1 of the first path.
[0253] In embodiments of this application, the first network device generates the first packet, where the SRH of the first packet includes the service identifier, and the service identifier includes the service indication, the feature indication, and the feature service indication, or the service identifier includes the service indication and the feature indication. When the service identifier includes the feature indication, the service identifier further includes the feature identifier. Because the service indication indicates the at least one service, the feature indication indicates the at least one feature identifier, and the feature service indication indicates the at least one processing service and the at least one feature identifier, the indication information can indicate the at least one processing service and/or the at least one feature identifier, and the indication information is located in the service identifier. In this way, the first packet does not need to include a TLV corresponding to each processing service and a TLV corresponding to each feature identifier, to reduce a quantity of TLVs in the first packet. When receiving the first packet, the second network device reduces a quantity of to-be-parsed TLVs in the first packet or does not need to parse the TLV in the first packet, to increase forwarding efficiency, reduce a length of the first packet, and save network resources.
[0254] Refer to
[0255] a processing unit 1001, configured to generate a first packet, where the first packet includes an SRH, the SRH includes a service identifier, and the service identifier is related to first service information and second service information; and
[0256] a sending unit 1002, configured to send a first packet to a second network device, where the service identifier indicates the second network device to execute at least one service based on the first service information, the second service information, and the first packet.
[0257] Optionally, for a detailed implementation process in which the processing unit 1001 generates the first packet, refer to related content in S201 in the embodiment shown in
[0258] Optionally, the first service information includes a first service, the second service information includes a second service, and the at least one service includes the first service and the second service.
[0259] Optionally, the first service information includes a first feature identifier, and the second service information includes a second feature identifier. The first service information and the second service information herein are carried in the service identifier. In addition, the service identifier further includes a feature indication part, and the feature indication part indicates that the service identifier includes the first feature identifier and the second feature identifier.
[0260] Optionally, the first service information includes the first service, and the second service information includes the first feature identifier. The service identifier includes a service indication indicating the first service, and the service indication may further indicate more services. The service identifier further carries a feature indication indicating the first feature identifier, and the feature indication may further indicate more feature identifiers. Alternatively, the service identifier includes a feature service indication, and the feature service indication may indicate both the first service and the first feature identifier.
[0261] Optionally, the service identifier is located in a segment identifier list in the SRH or located in a type-length-value TLV in the SRH.
[0262] Optionally, a length of the service identifier is 128 bits.
[0263] In this embodiment of this application, the first packet generated by the processing unit includes the service identifier, and the service identifier is related to the first service information and the second service information, that is, the service identifier indicates at least one service and/or at least one feature identifier that are/is to be executed based on the first packet. Therefore, after the sending unit sends the first packet, the second network device executes the at least one service based on the first service information, the second service information, and the first packet. The first packet is an actual service packet, to provide a network service for an actual service. In addition, because the service identifier indicates at least one processing service and/or at least one feature identifier that are/is to be executed based on the first packet, a length of the first packet is reduced, and time required by the second network device to parse the first packet is reduced.
[0264] The modules in the apparatus 1000 and the foregoing other operations and/or functions are respectively used to implement the various steps and methods implemented by the first network device in the method embodiments. The foregoing descriptions are merely examples of some functions. For specific details, refer to the foregoing method embodiments. For brevity, details are not described herein again.
[0265] Refer to
[0266] In this embodiment of this application, the receiving unit receives the first packet. Because the first packet includes the service identifier, and the service identifier includes the first service information and the second service information, the processing unit may execute the at least one service based on the first service information, the second service information, and the first packet. The first packet is an actual service packet, and the at least one service is executed based on the service identifier and the first packet, to provide a network service for an actual service. In addition, because the service identifier includes at least two pieces of service information, the first packet needs to include only the service identifier. Therefore, a length of the first packet is reduced, and time required by the second network device to parse the first packet is reduced.
[0267] The modules in the apparatus 1100 and the foregoing other operations and/or functions are respectively used to implement the various steps and methods implemented by the second network device in the method embodiments. The foregoing descriptions are merely examples of some functions. For specific details, refer to the foregoing method embodiments. For brevity, details are not described herein again.
[0268]
[0269] The apparatus 1200 is an apparatus of a hardware structure, and may be configured to implement the functional modules in the apparatus 1000 in
[0270] 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 this application.
[0271] The bus system 1202 may include a path for transmitting information between the foregoing components.
[0272] The transceiver 1204 is configured to communicate with another device or a communications network.
[0273] The memory 1203 may be a read-only memory (ROM) or another type of static storage device that can store static information and instructions, or a random access memory (RAM) or another type of dynamic storage device that can store information and instructions. The memory 1203 may alternatively be an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or another compact disc storage, an optical disc storage (including a compact disc, a laser disc, an optical disc, a digital versatile disk, a Blue-ray disc, or the like), a magnetic disk storage medium or another magnetic storage device, or any other medium that can be used to carry or store expected program code in a form of instructions or a data structure and that can be accessed by a computer. However, the memory 1203 is not limited thereto. The memory may exist independently, and is connected to the processor through the bus. The memory may alternatively be integrated with the processor.
[0274] The memory 1203 is configured to store application program code for executing the solutions of this 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 a function in the method in the patent.
[0275] In a specific implementation, in an embodiment, the processor 1201 may include one or more CPUs, for example, a CPU 0 and a CPU 1 in
[0276] In a specific implementation, in an embodiment, the apparatus 1200 may include a plurality of processors, for example, the processor 1201 and a processor 1207 in
[0277]
[0278] The apparatus 1300 is an apparatus of a hardware structure, and may be configured to implement the functional modules in the apparatus 1100 in
[0279] Optionally, the processor 1301 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 this application.
[0280] The bus system 1302 may include a path for transmitting information between the foregoing components.
[0281] The transceiver 1304 is configured to communicate with another device or a communications network.
[0282] The memory 1303 may be a read-only memory (ROM) or another type of static storage device that can store static information and instructions, or a random access memory (RAM) or another type of dynamic storage device that can store information and instructions. The memory 1303 may alternatively be an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or another compact disc storage, an optical disc storage (including a compact disc, a laser disc, an optical disc, a digital versatile disc, a Blu-ray disc, or the like), a magnetic disk storage medium or another magnetic storage device, or any other medium that can be used to carry or store expected program code in a form of instructions or a data structure and that can be accessed by a computer. However, the memory 1303 is not limited thereto. The memory may exist independently, and is connected to the processor through the bus. The memory may alternatively be integrated with the processor.
[0283] The memory 1303 is configured to store application program code for executing the solutions in this application, and the processor 1301 controls the execution. The processor 1301 is configured to execute the application program code stored in the memory 1303, to implement a function in the method in the patent.
[0284] In a specific implementation, in an embodiment, the processor 1301 may include one or more CPUs, for example, a CPU 0 and a CPU 1 in
[0285] In a specific implementation, in an embodiment, the apparatus 1300 may include a plurality of processors, for example, the processor 1301 and a processor 1307 in
[0286] In some possible embodiments, the service execution apparatus (for example, the first network device or the second network device) may be implemented as a virtualized device.
[0287] 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 a completely isolated environment. For example, the first device may be implemented based on a general-purpose physical server by using a network functions virtualization (NFV) technology. The first device is a virtual host, a virtual router, or a virtual switch. After reading this application, a person skilled in the art may virtualize, on the general-purpose physical server by using the NFV technology, the first devices having the foregoing functions. Details are not described herein.
[0288] For example, the virtualized device may be a container, and the container is an entity configured to provide an isolated virtualized environment. For example, the container may be a docker container. The container may be configured as the first device. For example, the first device may be created by using a corresponding image. For example, two container instances, that is, a container instance proxy-container 1 and a container instance proxy-container 2, may be created for a proxy-container (a container that provides a proxy service) by using an image of the proxy-container. The container instance proxy-container 1 is provided as the first device or a first computing device, and the container instance proxy-container 2 is provided as the second device or a second computing device. When a container technology is used for implementation, the first device or the second device may run by using a kernel of a physical machine, and a plurality of first devices or a plurality of second devices may share an operating system of the physical machine. Different first devices or second devices may be isolated by using the container technology. A containerized first device or a containerized second device may run in a virtualized environment, for example, may run in a virtual machine, or the containerized first device or the containerized second device may directly run in a physical machine.
[0289] For example, the virtualized device may be a pod. The pod is a basic unit of Kubernetes (Kubernetes is an open-source container orchestration engine of Google, and is briefly referred to as K8s in English) for deploying, managing, and orchestrating a containerized application. The pod may include one or more containers. All containers in a same pod are usually deployed on a same host. Therefore, all the containers in the same pod may communicate with each other through the host, and may share storage resources and network resources of the host. The pod may be configured as the first device. For example, specifically, a container as a service (CaaS for short, which is a container-based PaaS) may be indicated to create the pod, and the pod is provided as the first device.
[0290] Certainly, the service execution apparatus may alternatively be another virtualized device. Details are not described herein.
[0291] In some possible embodiments, the service execution apparatus may alternatively be implemented by a general-purpose processor. For example, the general-purpose processor may be in a form of a chip. Specifically, the general-purpose processor implementing the service execution apparatus includes a processing circuit, and an input interface and an output interface that are internally connected to and communicate with the processing circuit. The processing circuit is configured to perform, through the input interface, the steps in the foregoing method embodiments. Optionally, the general-purpose processor may further include a storage medium. The processing circuit is configured to perform the storage step in the foregoing method embodiments through the storage medium. The storage medium may store instructions executed by the processing circuit. The processing circuit is configured to execute the instructions stored in the storage medium, to perform the foregoing method embodiments.
[0292] The apparatuses in the product forms have any function of the service execution apparatus in the foregoing method embodiments. Details are not described herein again.
[0293]
[0294] Optionally, the apparatus 1000 shown in
[0295] A person of ordinary skill in the art may understand that all or some of the steps of the embodiments may be implemented by hardware or a program instructing related hardware. The program may be stored in a computer-readable storage medium. The storage medium may be a read-only memory, a magnetic disk, an optical disc, or the like.
[0296] The foregoing descriptions are merely optional embodiments of this application, but are not intended to limit this application. Any modification, equivalent replacement, or improvement made without departing from the principle of this application should fall within the protection scope of this application.