Patent Description:
In a data communication network, an in-situ flow detection technology may be used for performance detection of the data communication network, for example, delay and packet loss detection of the data communication network. The in-situ flow detection technology may be, for example, an in-situ flow information telemetry (in-situ flow information telemetry, iFIT) technology or an in-band operation administration and maintenance (in-band operation administration and maintenance, iOAM) technology.

In a network, a detection domain may be specified to determine a network range in which in-situ flow detection needs to be performed. A node in the detection domain needs to transmit in-situ flow detection information for in-situ flow detection. Currently, if a plurality of bearer protocols are deployed in the detection domain, the in-situ flow detection technology cannot be used for performance detection of the detection domain. Therefore, a solution is required to resolve the foregoing problem.

<CIT> discloses systems and methods are disclosed for providing differentiated quality of service (QoS) to packets of different type.

Embodiments of this application provide an in-situ flow detection-based packet processing method and an apparatus, so that an in-situ flow detection technology can still be used for performance detection in the case of a plurality of bearer protocols deployed in a detection domain.

According to a first aspect, an embodiment of this application provides an in-situ flow detection-based packet processing method. Currently, for a detection domain in which a plurality of bearer protocols are deployed, an in-situ flow detection technology cannot be used for performance detection. This is because different bearer protocols correspond to different packet encapsulation formats. When a packet carrying in-situ flow detection information is transmitted in the detection domain in which the plurality of bearer protocols are deployed, once the packet needs to be re-encapsulated, the in-situ flow detection information carried in the packet is removed. Therefore, the in-situ flow detection information cannot be transmitted across the entire detection domain. As a result, the in-situ flow detection technology cannot be used for performance detection of the detection domain. In this embodiment of this application, after receiving a first packet from a second node, a first node in a detection domain may obtain a second packet based on the first packet. A first packet header of the first packet includes first in-situ flow detection information, and the first packet is a packet encapsulated by using a first bearer protocol. The first node may re-encapsulate the first packet by using a second bearer protocol. When re-encapsulating the first packet, the first node does not remove the first in-situ flow detection information, but adds the first in-situ flow detection information to the packet encapsulated by using the second bearer protocol, to obtain the second packet including the first in-situ flow detection information. After obtaining the second packet, the first node may forward the second packet to a third node, so that the second packet including the first in-situ flow detection information continues to be transmitted in the detection domain. It can be learned that in the solution in this embodiment of this application, even if the first bearer protocol and the second bearer protocol are deployed in the detection domain, the first in-situ flow detection information is not removed due to re-encapsulation of the packet, and may be transmitted across the entire detection domain. Therefore, even if the first bearer protocol and the second bearer protocol are deployed in the detection domain, an in-situ flow detection technology can still be used for performance detection of the detection domain.

In an implementation, the first bearer protocol is the IPv4 protocol, the IPv6 protocol, the MPLS protocol, the VLAN protocol, the GRE protocol, the NSH protocol, or the segment routing over internet protocol version <NUM> SRv6 protocol. The second bearer protocol is the IPv4 protocol, the IPv6 protocol, the MPLS protocol, the VLAN protocol, the GRE protocol, the NSH protocol, or the SRv6 protocol. The first bearer protocol is different from the second bearer protocol.

In an implementation, the first in-situ flow detection information indicates a performance parameter for detecting the detection domain, the detection domain includes a first domain and a second domain, the second node belongs to the first domain, the third node belongs to the second domain, and the first node is a node that crosses the first domain and the second domain. It can be learned that, in this embodiment of this application, when the first packet carrying the first in-situ flow detection information is transmitted across the first domain and the second domain, the first node serving as the node that crosses the first domain and the second domain may not remove the first in-situ flow detection information, so that the first in-situ flow detection information can be transmitted across the entire detection domain.

In an implementation, the first node is a service function proxy SF proxy, and the third node is a service function SF device.

In an implementation, when the first node is the SF proxy and the third node is the SF device, the first node may further receive a third packet returned by the third node, where the third packet includes the first in-situ flow detection information, and the third packet is a packet encapsulated by using the second bearer protocol. The first node generates a fourth packet based on the third packet, where the fourth packet includes the first in-situ flow detection information, and the fourth packet is a packet encapsulated by using the first bearer protocol. The first node sends the first packet to a next-hop node. In this scenario, the first packet may pass through the SF device in a transmission process, but the first in-situ flow detection information is not lost, so that the first in-situ flow detection information can continue to be transmitted to the next-hop node.

In an implementation, an SRv6 network is deployed in the first domain, an IPv4 network is deployed in the second domain, the first packet is an SRv6 packet carrying service function chain SFC information, and the second packet is an IPv4 packet carrying the SFC information. In this case, when the SRv6 network and the IPv4 network are deployed in the detection domain, the in-situ flow detection technology can still be used for performance detection of the detection domain.

In an implementation, an IPv4 network is deployed in the first domain, an SRv6 network is deployed in the second domain, the first packet is an IPv4 packet carrying SFC information, and the second packet is an SRv6 packet carrying the SFC information. In this case, when the SRv6 network and the IPv4 network are deployed in the detection domain, the in-situ flow detection technology can still be used for performance detection of the detection domain.

In an implementation, an MPLS network is deployed in the first domain, an IPv4 network is deployed in the second domain, the first packet is an MPLS packet, and the second packet is an IPv4 packet. In this case, when the MPLS network and the IPv4 network are deployed in the detection domain, the in-situ flow detection technology can still be used for performance detection of the detection domain.

In an implementation, a layer <NUM> virtual private network L3VPN is deployed in the first domain.

In an implementation, the detection domain further includes a third domain, the MPLS network is deployed in the third domain, and the third node is a node that crosses the second domain and the third domain. In this case, when the MPLS network and the IPv4 network are deployed in the detection domain, the in-situ flow detection technology can still be used for performance detection of the detection domain.

In an implementation, the L3VPN is deployed in the third domain.

In an implementation, the first domain is a first autonomous system AS, and the first node is an autonomous system boundary router ASBR of the first AS. The third domain is a second AS, and the third node is an ASBR of the second AS.

In an implementation, an IPv4 network is deployed in the first domain, an MPLS network is deployed in the second domain, the first packet is an IPv4 packet, and the second packet is an MPLS packet. In this case, when the MPLS network and the IPv4 network are deployed in the detection domain, the in-situ flow detection technology can still be used for performance detection of the detection domain.

In an implementation, an L3VPN is deployed in the second domain.

In an implementation, the first in-situ flow detection information includes iFIT in-situ flow detection information or iOAM in-situ flow detection information.

According to a second aspect, an embodiment of this application provides a first node. The first node includes a communication interface and a processor connected to the communication interface. The first node is configured to perform the method according to any one of the implementations of the first aspect through the communication interface and the processor.

According to a third aspect, an embodiment of this application provides a first node. The first node includes a memory and a processor. The memory is configured to store program code, and the processor is configured to run instructions in the program code, to enable the first node to perform the method according to any one of the implementations of the first aspect.

According to a fourth aspect, an embodiment of this application provides a computer-readable storage medium. The computer-readable storage medium stores instructions. When the instructions are run on a computer, the computer is enabled to perform the method according to any one of the implementations of the first aspect.

To describe technical solutions in embodiments of this application or a conventional technology more clearly, the following briefly describes the accompanying drawings for describing embodiments or the conventional technology. It is clear that the accompanying drawings in the following descriptions show some embodiments of this application, and a person of ordinary skill in the art may still derive other drawings from these accompanying drawings without creative efforts.

Embodiments of this application provide an in-situ flow detection-based packet processing method, so that an in-situ flow detection technology can still be used for performance detection in the case of a plurality of bearer protocols deployed in a detection domain.

For ease of understanding, the in-situ flow detection technology is briefly described first.

The in-situ flow detection technology may perform feature marking on a service flow in a network by using in-situ flow detection information carried in a packet, where feature marking may also be referred to as coloring. A node through which the service flow passes reports, to a control management device, collected data such as a timestamp and a quantity of packets, so that the control management device further calculates a network delay and a packet loss status based on the reported data.

In a network, a detection domain may be specified to determine a network range in which in-situ flow detection needs to be performed. Generally, a node in the detection domain needs to transmit in-situ flow detection information for in-situ flow detection, and sends, to the control management device, corresponding information obtained through the in-situ flow detection. A detection range of the detection domain may be determined in a plurality of manners, for example, based on network scenarios or service types. For example, a core network part in the network is specified as the detection domain, or detection domains of different ranges are specified for video services and voice services. The detection domain includes three types of nodes: a head node (English: head node), a tail node (English: end node), and a hop-by-hop path node (English: path node). The hop-by-hop path node may also be referred to as a transit node. The head node, the tail node, and the path node may be, for example, corresponding network nodes in the network. For a service flow, the <NUM>st network node that transmits the service flow within the specified detection range in the detection domain may be used as a head node that transmits the service flow. The last network node that transmits the service flow within the specified detection range in the detection domain may be used as a tail node that transmits the service flow. Each node that transmits the service flow between the head node and the tail node is a hop-by-hop path node. The in-situ flow detection information may be added by the head node and removed at the tail node.

Next, a possible network architecture of in-situ flow detection is described. <FIG> is a schematic diagram of a network architecture according to an embodiment of this application. A network <NUM> includes a control management device and a plurality of network nodes. The plurality of network nodes are connected to each other through communication links, for transmission of service flows. As shown in <FIG>, a head node, a transit node <NUM>, a transit node <NUM>, and a tail node in a detection domain are connected through communication links. In addition to the nodes shown in the figure, the detection domain may further include other nodes that are not shown. The tail node may be further connected to an external node through a communication link. The head node may receive a service flow from another device, and the service flow may reach the external node through the head node, the transit node <NUM>, the transit node <NUM>, and the tail node. The control management device may be, for example, a centralized controller, a network management system, or a traffic analysis device for traffic analysis. The control management device may be one device, or may be a set of a plurality of devices. The control management device may be a functional module integrated into a specific physical device, or may be a physical device configured to implement a function implemented by the control management device in this application.

In this application, the detection domain may be determined by the control management device, and the detection domain is a detection range determined by the control management device. Alternatively, the detection domain may be separately configured on each forwarding device in the detection domain, to form one detection domain. On a transmission path in the detection domain, network nodes located between the head node and the tail node in the detection domain are transit nodes, for example, the transit node <NUM> and the transit node <NUM> in <FIG>.

Currently, the control management device may deploy an in-situ flow detection technology on each node in the detection domain, to detect a transmission delay and a packet loss in the detection domain.

The transmission delay in the detection domain may include an end-to-end transmission delay between the head node and the tail node. Each node in the detection domain may periodically perform a delay detection operation. Specifically, in one in-situ flow detection period, the head node may select a packet from received packets for coloring. The head node may add, to the packet, in-situ flow detection information indicating to detect the transmission delay, and report, to the control management device, a timestamp T1 indicating a time point at which the head node receives the packet. After receiving the packet, the tail node in the detection domain may forward the packet to the external node, and report, to the control management device, a timestamp T2 indicating a time point at which the tail node forwards the packet to the external node. The control management device may learn, through calculation based on the timestamp T1 reported by the head node and the timestamp T2 reported by the tail node, that the end-to-end transmission delay in the detection domain in the in-situ flow detection period is T2-T1. When selecting a packet for coloring, the head node may color the packet based on a feature of the packet, for example, color a packet including specified quintuple information. The quintuple information may include a source internet protocol (Internet Protocol, IP) address, a destination IP address, a protocol type, a source port number, and a destination port number.

During specific implementation of packet loss measurement in the detection domain, in one in-situ flow detection period, the head node may alternately color packets in a service flow according to a specific rule, and report information about the colored packets to the control management device. The tail node calculates information about a colored packet received in the in-situ flow detection period, and reports the information to the control management device. The control management device determines a packet loss status of a packet flow in the detection domain based on the information reported by the head node and the tail node. For example, the head node colors ten packets in one in-situ flow detection period, and reports a quantity (namely, <NUM>) of colored packets to the control management device. The tail node receives only nine colored packets in the in-situ flow detection period, and the tail node reports a quantity (namely, <NUM>) of received colored packets to the control management device. The control management device may determine, based on the quantities reported by the head node and the tail node, that a packet loss occurs in a process of transmitting the service flow in the detection domain.

Currently, the in-situ flow detection technology has some limitations. Specifically, only one bearer protocol can be deployed in the detection domain. If a plurality of bearer protocols are deployed in the detection domain, the in-situ flow detection technology cannot be used for performance detection, for example, the in-situ flow detection technology cannot be used for end-to-end performance detection. This is because different bearer protocols correspond to different packet encapsulation formats. When a packet carrying the in-situ flow detection information is transmitted in a detection domain in which a plurality of bearer protocols are deployed, the in-situ flow detection information carried in the packet is removed once the packet needs to be re-encapsulated. That is, the in-situ flow detection information cannot be transmitted across the entire detection domain. Correspondingly, a node that does not receive the in-situ flow detection information does not perform a corresponding in-situ flow detection operation.

Deploying a bearer protocol in the detection domain may also be considered as deploying a network that supports the bearer protocol in the detection domain. For example, that the segment routing over internet protocol version <NUM> (Segment Routing over Internet Protocol Version <NUM>, SRv6) protocol is deployed in the detection domain indicates that an SRv6 network is deployed in the detection domain.

For ease of understanding, the following describes the limitations of the foregoing in-situ flow detection technology with reference to specific application scenarios. The limitations of the in-situ flow detection technology are not limited to the following two application scenarios. Correspondingly, the method provided in embodiments of this application is not limited to the following two application scenarios.

<FIG> is a schematic diagram of an example application scenario according to an embodiment of this application. <FIG> shows a service function chain (service function chain, SFC) scenario of the SRv6 protocol.

In the scenario shown in <FIG>, an SRv6 network is deployed between an ingress (ingress) provider edge (provider edge, PE) device ingress PE and an egress (egress) PE device egress PE, and an internet protocol version <NUM> (Internet Protocol Version <NUM>, IPv4) network is deployed between a service function forwarder (Service Function Forwarder, SFF) device SFF and a service function (service function, SF) device SF. A customer edge (customer edge, CE) device CE <NUM> sends an IPv4 packet to a customer edge device CE <NUM>, and the packet passes through the SF device in a forwarding process.

In some scenarios, a network between the ingress PE and the egress PE may be specified as a detection domain, and an in-situ flow detection technology is used for performance detection of the detection domain. Next, limitations of the in-situ flow detection technology are described for a process of transmitting a packet in the detection domain.

Step <NUM>: After receiving the IPv4 packet from the CE <NUM>, the ingress PE re-encapsulates the IPv4 packet into an SRv6 packet, and encapsulates in-situ flow detection information into the SRv6 packet, to indicate a node that receives the in-situ flow detection information to perform an in-situ flow detection operation.

In this embodiment of this application, the SRv6 packet may carry related information of a service function chain, for example, a service function path (service function path, SFP) or data of the service function chain. Specifically, the related information of the SFC may be carried in an SFC header. For the SRv6 packet, the SFC header may be carried in a segment routing header (segment routing header, SRH).

In this embodiment of this application, the SRH of the SRv6 may include a SID-<NUM>. The SID-<NUM> is a segment identifier (segment identifier, SID) of the service function device SF, that is, indicates that the SRv6 packet passes through the SF in a forwarding process. In the service function chain scenario, the SRv6 packet may be forwarded to the SF through the SFF. The SID-<NUM> may further identify a service chain type. Specifically, the SID-<NUM> may identify a dynamic service chain or a static service chain.

In some embodiments, if all service flows forwarded through the SF are forwarded through a same tunnel, the SID-<NUM> identifies the static service chain. If not all service flows are forwarded through a same tunnel, for example, different service flows are forwarded through different tunnels, the SID-<NUM> identifies the dynamic service chain.

Step <NUM>: The ingress PE sends the encapsulated SRv6 packet to the SFF.

Step <NUM>: The SFF re-encapsulates the received SRv6 packet to obtain the IPv4 packet, and sends the IPv4 packet to the SF.

When re-encapsulating the SRv6 packet, the SFF removes the in-situ flow detection information from the SRv6 packet. In other words, the IPv4 packet sent by the SFF to the SF does not include the in-situ flow detection information.

After receiving the SRv6 packet, the SFF may remove the SFC header from the SRv6 packet, re-encapsulate the SRv6 packet into the IPv4 packet, and send the IPv4 packet to the SF.

In this embodiment of this application, if the SID-<NUM> identifies the dynamic service chain, the SFF may further locally buffer the SFC header, because different service flows may correspond to different SFC headers. If the SID-<NUM> identifies the static service chain, the SFF does not need to buffer the SFC, because in this case, all service flows correspond to the same SFC header, and the SFC header may be configured in the SFF through static configuration.

Step <NUM>: The SF performs corresponding processing based on the received IPv4 packet, and returns the IPv4 packet to the SFF after the processing.

The SF processes the IPv4 packet, for example, may perform security detection on the IPv4 packet, to determine whether the IPv4 packet is an attack packet.

Step <NUM>: The SFF re-encapsulates the received IPv4 packet into the SRv6 packet, and sends the SRv6 packet to the egress PE, where the SRv6 packet sent by the SFF to the egress PE does not include the in-situ flow detection information.

When re-encapsulating the IPv4 packet into the SRv6 packet, the SFF needs to encapsulate the SFC header into the SRv6 packet. Therefore, the SFF can obtain the corresponding SFC header. Specifically, if the SID-<NUM> identifies the dynamic service chain, the SFF buffers an SFC header corresponding to the IPv4 packet when performing step <NUM>. Therefore, the SFF can obtain the SFC header buffered in step <NUM>, and re-encapsulate the IPv4 packet into the SRv6 packet based on the SFC header. If the SID-<NUM> identifies the static service chain, it indicates that all service packets use the same SFC header. In this case, the SFF may obtain the SFC header statically configured on the SFF, and re-encapsulate the IPv4 packet into the SRv6 packet based on the obtained SFC header.

Step <NUM>: The egress PE re-encapsulates the received SRv6 packet into the IPv4 packet and sends the IPv4 packet to the CE <NUM>.

In this embodiment of this application, the SRH of the SRv6 packet sent by the SFF to the egress PE may include an End. DT4 SID identifies a layer <NUM> virtual private network (layer <NUM> virtual private network, L3VPN). After receiving the SRv6 packet, the egress PE searches for a local VPN route based on the End. DT4 SID, to continue to forward the packet.

It can be learned from the foregoing descriptions that the in-situ flow detection information is not transmitted across the entire detection domain. This is because in step <NUM>, when the SFF re-encapsulates the received SRv6 packet, the in-situ flow detection information is removed from the SRv6 packet. In other words, none of the nodes between the SFF and the egress PE receives the in-situ flow detection information. Therefore, a corresponding detection operation cannot be performed based on the in-situ flow detection information.

In the scenario shown in <FIG>, an SF proxy (proxy) runs on the SFF, and the foregoing steps performed by the SFF may be specifically performed by the SF proxy.

It should be noted that <FIG> is merely shown for ease of understanding, and does not constitute a limitation on embodiments of this application. In some embodiments, alternatively, an IPv6 network, a virtual local area network (virtual local area network, VLAN), a multi-protocol label switching (Multi-protocol Label Switching, MPLS) network, a generic routing encapsulation (generic routing encapsulation, GRE) network, or a network service header (network service header, NSH) network may be deployed between the SFF and the SF. This is not specifically limited in embodiments of this application.

If the IPv6 network is deployed between the SFF and SF, in step <NUM>, the SFF needs to re-encapsulate the SRv6 packet to obtain an IPv6 packet; in step <NUM>, the packet received by the SFF is also the IPv6 packet; in step <NUM>, the SFF re-encapsulates the received IPv6 packet into the SRv6 packet and sends the SRv6 packet to the egress PE.

If the VLAN is deployed between the SFF and SF, in step <NUM>, the SFF needs to re-encapsulate the SRv6 packet to obtain a VLAN-encapsulated packet; in step <NUM>, the packet received by the SFF is also the VLAN-encapsulated packet; in step <NUM>, the SFF re-encapsulates the received VLAN-encapsulated packet into the SRv6 packet, and sends the SRv6 packet to the egress PE.

If the MPLS network is deployed between the SFF and SF, in step <NUM>, the SFF needs to re-encapsulate the SRv6 packet to obtain an MPLS packet; in step <NUM>, the packet received by the SFF is also the MPLS packet; in step <NUM>, the SFF re-encapsulates the received MPLS packet into the SRv6 packet and sends the SRv6 packet to the egress PE.

If the GRE network is deployed between the SFF and SF, in step <NUM>, the SFF needs to re-encapsulate the SRv6 packet to obtain a GRE packet; in step <NUM>, the packet received by the SFF is also the GRE packet; in step <NUM>, the SFF re-encapsulates the received GRE packet into the SRv6 packet and sends the SRv6 packet to the egress PE.

If the NSH network is deployed between the SFF and SF, in step <NUM>, the SFF needs to re-encapsulate the SRv6 packet to obtain an NSH packet; in step <NUM>, the packet received by the SFF is also the NSH packet; in step <NUM>, the SFF re-encapsulates the received NSH packet into the SRv6 packet and sends the SRv6 packet to the egress PE.

<FIG> is a schematic diagram of another example application scenario according to an embodiment of this application. <FIG> is a schematic diagram of an inter-AS VPN scenario.

In the scenario shown in <FIG>, when data is exchanged between a CE <NUM> and a CE <NUM>, a VPN needs to be used. A PE <NUM> and an autonomous system boundary router (autonomous system boundary router, ASBR) ASBR <NUM> belong to an autonomous domain <NUM> (AS <NUM>). The ASBR <NUM> is also a PE device in the AS <NUM>. An L3VPN is deployed in the AS <NUM>, and an MPLS network or an SR-MPLS network is deployed in the AS <NUM>. A PE <NUM> and an ASBR <NUM> belong to an AS <NUM>. The ASBR <NUM> is also a PE device in the AS <NUM>. The L3VPN is deployed in the AS <NUM>, and the MPLS network or the SR-MPLS network is deployed in the AS <NUM>.

No MPLS network is deployed between the ASBR <NUM> and the ASBR <NUM>, and an IPv4 network is deployed between the ASBR <NUM> and the ASBR <NUM>. The ASBR <NUM> considers the ASBR <NUM> as a CE device connected to the ASBR <NUM>, and the ASBR <NUM> also considers the ASBR <NUM> as a CE device connected to the ASBR <NUM>. After creating a VPN instance, the ASBR <NUM> advertises IPv4 routes to the ASBR <NUM> via the external border gateway protocol (External Border Gateway Protocol, EBGP). Similarly, after creating the VPN instance, the ASBR <NUM> advertises the IPv4 routes to the ASBR <NUM> via the EBGP.

In some scenarios, a network between the PE <NUM> and the PE <NUM> may be specified as a detection domain, and an in-situ flow detection technology is used for performance detection of the detection domain. Next, limitations of the in-situ flow detection technology are described for a process of transmitting a packet in the detection domain.

Step <NUM>: The CE <NUM> sends an IPv4 packet to the PE <NUM>.

Step <NUM>: After receiving the IPv4 packet from the PE <NUM>, the PE <NUM> encapsulates the IPv4 packet into an MPLS packet, and encapsulates in-situ flow detection information into the MPLS packet, to indicate a node that receives the in-situ flow detection information to perform an in-situ flow detection operation.

In this embodiment of this application, the MPLS packet further carries a public network label and a private network label of the L3VPN.

Step <NUM>: The PE <NUM> sends the MPLS packet to the ASBR <NUM>.

Step <NUM>: The ASBR <NUM> re-encapsulates the received MPLS packet into the IPv4 packet and sends the IPv4 packet to the ASBR <NUM>.

When re-encapsulating the MPLS packet, the ASBR <NUM> removes the in-situ flow detection information from the MPLS packet. In other words, the IPv4 packet sent by the ASBR <NUM> to the ASBR <NUM> does not include the in-situ flow detection information.

Step <NUM>: The ASBR <NUM> receives the IPv4 packet sent by the ASBR <NUM>, and re-encapsulates the IPv4 packet to obtain the MPLS packet including the private network label and the public network label.

Step <NUM>: The ASBR <NUM> sends the re-encapsulated MPLS packet to the PE <NUM>, where the MPLS packet sent by the ASBR <NUM> to the PE <NUM> does not include the in-situ flow detection information.

Step <NUM>: The PE <NUM> re-encapsulates the MPLS packet into the IPv4 packet and sends the IPv4 packet to the CE <NUM>.

It can be learned from the foregoing descriptions that the in-situ flow detection information is not transmitted across the entire detection domain. This is because in step <NUM>, when the ASBR <NUM> re-encapsulates the received MPLS packet, the in-situ flow detection information is removed from the MPLS packet. In other words, none of the nodes in the AS <NUM> receives the in-situ flow detection information. Therefore, a corresponding detection operation cannot be performed based on the in-situ flow detection information.

Based on the foregoing descriptions, it can be learned that, in actual application, there is a requirement of using the in-situ flow detection technology to detect performance of a detection domain in which a plurality of bearer protocols are deployed. However, the current in-situ flow detection technology cannot meet the requirement. In view of this, embodiments of this application provide an in-situ flow detection-based packet processing method, so that an in-situ flow detection technology can still be used for performance detection in the case of a plurality of bearer protocols deployed in a detection domain.

The following separately describes the packet processing method provided in embodiments of this application with reference to the application scenarios shown in <FIG>.

The packet processing method provided in embodiments of this application is first described with reference to the application scenario shown in <FIG>.

<FIG> is a signaling interworking diagram of an in-situ flow detection-based packet processing method according to an embodiment of this application. The method <NUM> shown in <FIG> may be, for example, implemented through the following S101 to S108.

S101: An ingress PE receives a packet <NUM> from a CE <NUM>, where the packet <NUM> is an IPv4 packet.

In this embodiment of this application, the packet <NUM> is the IPv4 packet. In other words, the packet <NUM> is a packet encapsulated by using the IPv4 protocol.

S102: The ingress PE re-encapsulates the packet <NUM> to obtain a packet <NUM>, where the packet <NUM> is an SRv6 packet, and the packet <NUM> includes in-situ flow detection information <NUM>.

In this embodiment of this application, when re-encapsulating the packet <NUM>, the ingress PE serving as a head node of a detection domain adds the in-situ flow detection information <NUM> to a packet header, to obtain the packet <NUM>. The in-situ flow detection information <NUM> indicates a performance parameter for detecting the detection domain. The detection domain includes a network between the ingress PE and an egress PE. In this embodiment of this application, the in-situ flow detection information <NUM> may be iFIT in-situ flow detection information or iOAM in-situ flow detection information.

For a structure of the packet <NUM>, refer to the following descriptions of <FIG>.

S103: The ingress PE sends the packet <NUM> to an SFF.

S104: The SFF re-encapsulates the received packet <NUM> to obtain a packet <NUM>, where the packet <NUM> is an IPv4 packet, and the packet <NUM> includes the in-situ flow detection information <NUM>.

The packet <NUM> is a packet encapsulated by using the IPv4 protocol. When re-encapsulating the packet <NUM> to obtain the packet <NUM>, the SFF does not simply remove the in-situ flow detection information <NUM> from the packet <NUM>, but encapsulates the in-situ flow detection information <NUM> obtained from the packet <NUM> into the packet <NUM>. Specifically, when re-encapsulating the packet <NUM>, the SFF may add the in-situ flow detection information <NUM> to a packet header, to obtain the packet <NUM> including the in-situ flow detection information <NUM>.

S105: The SFF sends the packet <NUM> to an SF.

S106: The SF sends, to the SFF, a packet <NUM> obtained based on the packet <NUM>, where the packet <NUM> includes the in-situ flow detection information <NUM>.

After receiving the packet <NUM>, the SF performs corresponding processing on the packet <NUM>. Then, the SF obtains the packet <NUM> based on the packet <NUM>, and sends the packet <NUM> to the SFF. Specifically, during specific implementation of obtaining the packet <NUM> based on the packet <NUM> by the SF, for example, the SF may modify fields such as a source media access control (media access control, MAC) address or a destination MAC address in the packet <NUM>, to obtain the packet <NUM>. In this embodiment of this application, the packet <NUM> is an IPv4 packet, and the packet <NUM> includes the in-situ flow detection information <NUM>.

S107: The SFF obtains a packet <NUM> based on the packet <NUM>.

After receiving the packet <NUM>, the SFF re-encapsulates the packet <NUM> by using the SRv6 protocol. When re-encapsulating the packet <NUM>, the SFF adds the in-situ flow detection information <NUM> in the packet <NUM> to a packet re-encapsulated by using the SRv6 protocol, to obtain the packet <NUM>. Specifically, the SFF adds the in-situ flow detection information <NUM> to a packet header re-encapsulated by using the SRv6 protocol, to obtain the packet <NUM>.

S108: The SFF sends the packet <NUM> to the egress PE.

Because the packet <NUM> includes the in-situ flow detection information <NUM>, both the egress PE and a node between the egress PE and the SFF can receive the packet <NUM> including the in-situ flow detection information <NUM>.

It can be learned from the foregoing descriptions that the in-situ flow detection information <NUM> may be transmitted across the entire detection domain. Therefore, all nodes that receive the in-situ flow detection information <NUM> can perform an in-situ flow detection operation, so that an in-situ flow detection technology can still be used for performance detection of the detection domain in the case of two bearer protocols, namely, the SRv6 protocol and the IPv4 protocol, deployed in the detection domain.

For the method <NUM>, in some embodiments, the detection domain shown in <FIG> may include a domain A and a domain B. A bearer protocol deployed in the domain A is the SRv6 protocol, and a bearer protocol deployed in the domain B is the IPv4 protocol. The domain A includes the ingress PE and the SFF, or the domain A includes the egress PE and the SFF, and the domain B includes the SFF and the SF.

<FIG> is a schematic diagram of a structure of a possible SRv6 packet.

The SRv6 packet shown in <FIG> includes the following fields: ETH, IPv6 basic header, SRH, and payload.

Details are as follows:
The ETH field carries a layer <NUM> Ethernet header. The ETH may carry a source MAC address, a destination MAC address, and a protocol type.

The IPv6 basic header is an IPv6 basic header. Fields specifically included in the IPv6 basic header are not described in detail herein.

The SRH field includes an SRH basic header, a segment list, and an option type length value (type length value, TLV). Specifically, the SRH basic header is an SRH basic extension header. Fields specifically included in the SRH basic header are not described in detail herein. The segment list carries a list of segment identifiers indicating a packet forwarding path. The option TLV may be used as an extended field. In this embodiment of this application, the in-situ flow detection information <NUM> may be carried in the option TLV.

<FIG> shows a structure of an SRv6 packet in the case of the in-situ flow detection information <NUM> being iFIT in-situ flow detection information.

In <FIG>, a flow instruction indicator (flow instruction indicator, FII) field, a flow instruction header (flow instruction header, FIH) field, and a flow instruction extension header (flow instruction extension header, FIEH) field form the iFIT information. The following briefly describes the FII field, the FIH field, and the FIEH field.

<FIG> shows a structure of an SRv6 packet in the case of the in-situ flow detection information <NUM> being iOAM in-situ flow detection information.

As shown in <FIG>, the iOAM in-situ flow detection information includes an SRH-TLV-type field, an iOAM-type field, an iOAM HDR LEN field, an iOAM option and data space field, and a RESERVED field.

Details are as follows:
The SRH-TLV-type field is for identifying iOAM encapsulation, that is, identifying that data of several bytes following the field is the iOAM information.

The iOAM-type field indicates an iOAM type.

The iOAM HDR LEN field is for identifying a length of an iOAM header.

The iOAM option and data space field is an iOAM option and data field, and carries indication information indicating a node to perform a corresponding in-situ flow detection operation.

<FIG> is a schematic diagram of a structure of a possible IPv4 packet.

In <FIG>, the IPv4 packet includes the following fields: ETH, IPv4 header, and payload. The in-situ flow detection information <NUM> may be located in the IPv4 header. In an example, the in-situ flow detection information <NUM> may be located in an options (options) field of the IPv4 header. Details are as follows:
The ETH field carries a layer <NUM> Ethernet header. The ETH may carry a source media access control (media access control, MAC) address, a destination MAC address, and a protocol type.

Fields in the IPv4 header are not described in detail herein.

In this embodiment of this application, the in-situ flow detection information <NUM> shown in <FIG> may be iFIT in-situ flow detection information or iOAM in-situ flow detection information.

For the iFIT in-situ flow detection information, refer to the descriptions of the iFIT in-situ flow detection information in <FIG>.

When the in-situ flow detection information <NUM> is the iOAM in-situ flow detection information, refer to <FIG> for understanding. <FIG> shows a structure of an IPv4 packet in the case of the in-situ flow detection information <NUM> being iOAM in-situ flow detection information.

As shown in <FIG>, the iOAM in-situ flow detection information may be located in an options field of an IPv4 header. Specifically, the iOAM in-situ flow detection information includes an option type field, an option length field, a RESERVED field, an iOAM-type field, and an option data field. Details are as follows:
The option type field indicates an option header of an iOAM encapsulation type.

The option length field indicates a length of an entire iOAM header.

The option data field is an iOAM option and data field, and carries indication information indicating a node to perform a corresponding in-situ flow detection operation.

<FIG> is a schematic diagram of a structure of still another possible IPv4 packet.

In <FIG>, the IPv4 packet includes the following fields: ETH, IPv4 header, transmission control protocol (Transmission Control Protocol, TCP)/user datagram protocol (User Datagram Protocol, UDP), probe mark (probe mark), in-situ flow detection header, and payload.

The ETH, the IPv4 header, and the TCP/UDP are not described in detail herein.

The probe mark field indicates that data of following several bytes is in-situ flow detection data, and the probe mark field may include, for example, eight bytes.

When the in-situ flow detection information <NUM> is iFIT in-situ flow detection information, the probe mark field may correspond, for example, to the FII field shown in <FIG>, and the in-situ flow detection header may include, for example, the FIH field and the FIEH field shown in <FIG>. For the FII field, the FIH field, and the FIEH field, refer to the foregoing descriptions of <FIG>.

When the in-situ flow detection information <NUM> is iOAM in-situ flow detection information, specific encapsulation forms of the probe mark field and the in-situ flow detection header are not specifically limited in this embodiment of this application. In an example, the probe mark field may correspond, for example, to the SRH-TLV-type field shown in <FIG>, and the in-situ flow detection header may include, for example, the iOAM-type field, the iOAM HDR LEN field, the iOAM option and data space field, and the RESERVED field shown in <FIG>.

The following describes the packet processing method provided in embodiments of this application with reference to the application scenario shown in <FIG>.

<FIG> is a signaling interworking diagram of an in-situ flow detection-based packet processing method according to an embodiment of this application. The method <NUM> shown in <FIG> may be, for example, implemented through the following S201 to S207.

S201: A PE <NUM> receives a packet <NUM> from a CE <NUM>, where the packet <NUM> is an IPv4 packet.

S202: The PE <NUM> re-encapsulates the packet <NUM> into a packet <NUM>, where the packet <NUM> is an MPLS packet, and the packet <NUM> includes in-situ flow detection information <NUM>.

In this embodiment of this application, the packet <NUM> includes a public network label and a private network label of an L3VPN.

In this embodiment of this application, a detection domain includes a network between the PE <NUM> and a PE <NUM>. When re-encapsulating the packet <NUM>, the PE <NUM> serving as a head node of the detection domain adds the in-situ flow detection information <NUM> to a packet header, to obtain the packet <NUM>. The in-situ flow detection information <NUM> may be iFIT in-situ flow detection information or iOAM in-situ flow detection information.

For a structure of the packet <NUM>, refer to the following descriptions of <FIG> and <FIG>.

S203: The PE <NUM> sends the packet <NUM> to an ASBR <NUM>.

S204: The ASBR <NUM> re-encapsulates the received packet <NUM> to obtain a packet <NUM>, where the packet <NUM> is an IPv4 packet, and the packet <NUM> includes the in-situ flow detection information <NUM>.

The packet <NUM> is a packet encapsulated by using the IPv4 protocol. When re-encapsulating the packet <NUM> to obtain the packet <NUM>, the ASBR <NUM> does not simply remove the in-situ flow detection information <NUM> from the packet <NUM>, but encapsulates the in-situ flow detection information <NUM> obtained from the packet <NUM> into the packet <NUM>. Specifically, when re-encapsulating the packet <NUM>, the ASBR <NUM> may add the in-situ flow detection information <NUM> to a packet header, to obtain the packet <NUM> including the in-situ flow detection information <NUM>.

For a structure of the packet <NUM>, refer to the foregoing descriptions of <FIG>.

S205: The ASBR <NUM> sends the packet <NUM> to an ASBR <NUM>.

S206: The ASBR <NUM> re-encapsulates the received packet <NUM> to obtain a packet <NUM>, where the packet <NUM> is an MPLS packet, and the packet <NUM> includes the in-situ flow detection information <NUM>.

The packet <NUM> is a packet encapsulated by using the MPLS protocol. When re-encapsulating the packet <NUM> to obtain the packet <NUM>, the ASBR <NUM> does not simply remove the in-situ flow detection information <NUM> from the packet <NUM>, but encapsulates the in-situ flow detection information <NUM> obtained from the packet <NUM> into the packet <NUM>. Specifically, when re-encapsulating the packet <NUM>, the ASBR <NUM> may add the in-situ flow detection information <NUM> to a packet header, to obtain the packet <NUM> including the in-situ flow detection information <NUM>.

A structure of the packet <NUM> is the same as the structure of the packet <NUM>. For details, refer to the following descriptions of <FIG> and <FIG>.

S207: The ASBR <NUM> sends the packet <NUM> to the PE <NUM>.

Because the packet <NUM>, the packet <NUM>, and the packet <NUM> all carry the in-situ flow detection information <NUM>, the in-situ flow detection information <NUM> may be transmitted across the entire detection domain. Therefore, all nodes that receive the in-situ flow detection information <NUM> can perform an in-situ flow detection operation, so that an in-situ flow detection technology can still be used for performance detection of the detection domain in the case of two bearer protocols, namely, the MPLS protocol and the IPv4 protocol, deployed in the detection domain.

It should be noted that, in the application scenario shown in <FIG>,
for the method <NUM>, in some embodiments, the network domain shown in <FIG> may include a domain C, a domain D, and a domain E. A bearer protocol deployed in the domain C is the MPLS protocol, a bearer protocol deployed in the domain D is the IPv4 protocol, and a bearer protocol deployed in the domain E is the MPLS protocol. The domain C includes the PE <NUM> and the ASBR <NUM>, the domain D includes the ASBR <NUM> and the ASBR <NUM>, and the domain E includes the ASBR <NUM> and the PE <NUM>.

<FIG> is a schematic diagram of a structure of a possible MPLS packet.

The MPLS packet shown in <FIG> includes the following fields: ETH, SR label, VPN label, in-situ flow detection header, and payload. Details are as follows:.

The ETH field carries a layer <NUM> Ethernet header. The ETH may carry a source MAC address, a destination MAC address, and a protocol type.

The SR label carries a public network label.

The VPN label carries a private network label.

The in-situ flow detection header may carry iFIT in-situ flow detection information shown in <FIG> or iOAM in-situ flow detection information shown in <FIG>.

The iFIT in-situ flow detection information shown in <FIG> includes an FII field, an FIH field, and an FIEH field.

Details are as follows:
The FII field is mainly for identifying that data of several bytes following the field is the iFIT information. For example, the FII field may include the following field information:.

For the FIH field and the FIEH field, refer to the foregoing descriptions of <FIG>.

The iOAM in-situ flow detection information shown in <FIG> includes an iOAM indicator label (Indicator Label) field, an iOAM-type field, an iOAM HDR LEN field, an iOAM option and data space field, and a RESERVED field. Details are as follows:
The iOAM indicator label field is for identifying iOAM encapsulation, that is, identifying that data of several bytes following the field is the iOAM information.

An embodiment of this application further provides an in-situ flow detection-based packet processing method <NUM>. <FIG> is a schematic flowchart of an in-situ flow detection-based packet processing method according to an embodiment of this application. The following describes the method with reference to <FIG>. The method <NUM> shown in <FIG> may be, for example, implemented through the following S301 and S302.

S301: A first node receives a first packet from a second node, where a first packet header of the first packet includes first in-situ flow detection information, and the first packet is a packet encapsulated by using a first bearer protocol.

S302: The first node obtains a second packet based on the first packet, where a second packet header of the second packet includes the first in-situ flow detection information, the second packet is a packet encapsulated by using a second bearer protocol, and the first bearer protocol and the second bearer protocol are different bearer protocols.

S303: The first node forwards the second packet to a third node.

The method <NUM> may be used to implement the steps performed by the SFF in the method <NUM> mentioned in the foregoing embodiments, and the method <NUM> may be alternatively used to perform the steps performed by the ASBR <NUM> or the ASBR <NUM> in the method <NUM> mentioned in the foregoing embodiments.

In some embodiments, when the method <NUM> may be used to implement the steps performed by the SFF in the method <NUM> mentioned in the foregoing embodiments, the first node corresponds to the SFF shown in <FIG>, the second node corresponds to the ingress PE shown in <FIG>, the first packet corresponds to the packet <NUM> in the method <NUM>, the first bearer protocol is the SRv6 protocol, and the first in-situ flow detection information is the in-situ flow detection information <NUM> in the method <NUM>. The second packet corresponds to the packet <NUM> in the method <NUM>, and the second bearer protocol is the IPv4 protocol. The third node is the SF in the method <NUM>.

In some embodiments, when the method <NUM> may be used to implement the steps performed by the SFF in the method <NUM> mentioned in the foregoing embodiments, the first node corresponds to the SFF shown in <FIG>, the second node corresponds to the SF shown in <FIG>, the first packet corresponds to the packet <NUM> in the method <NUM>, the first bearer protocol is the IPv4 protocol, and the first in-situ flow detection information is the in-situ flow detection information <NUM> in the method <NUM>. The second packet corresponds to the packet <NUM> in the method <NUM>, the second bearer protocol is the SRv6 protocol, and the third node corresponds to the egress PE shown in <FIG>.

When the method <NUM> is used to implement the steps performed by the ASBR <NUM> in the method <NUM> mentioned in the foregoing embodiments, the first node corresponds to the ASBR <NUM> shown in <FIG>, the second node corresponds to the PE <NUM> shown in <FIG>, the first packet corresponds to the packet <NUM> in the method <NUM>, the first bearer protocol is the MPLS protocol, and the first in-situ flow detection information is the in-situ flow detection information <NUM> in the method <NUM>. The second packet corresponds to the packet <NUM> in the method <NUM>, and the second bearer protocol is the IPv4 protocol. The third node is the ASBR <NUM> in the method <NUM>.

When the method <NUM> is used to implement the steps performed by the ASBR <NUM> in the method <NUM> mentioned in the foregoing embodiments, the first node corresponds to the ASBR <NUM> shown in <FIG>, the second node corresponds to the ASBR <NUM> shown in <FIG>, the first packet corresponds to the packet <NUM> in the method <NUM>, the first bearer protocol is the IPv4 protocol, and the first in-situ flow detection information is the in-situ flow detection information <NUM> in the method <NUM>. The second packet corresponds to the packet <NUM> in the method <NUM>, and the second bearer protocol is the MPLS protocol. The third node is the PE <NUM> in the method <NUM>.

In an implementation, the first bearer protocol is the IPv4 protocol, the IPv6 protocol, the MPLS protocol, the VLAN protocol, the GRE protocol, the NSH protocol, or the SRv6 protocol. The second bearer protocol is the IPv4 protocol, the IPv6 protocol, the MPLS protocol, the VLAN protocol, the GRE protocol, the NSH protocol, or the SRv6 protocol.

In an implementation, the first in-situ flow detection information indicates a performance parameter for detecting a detection domain, the detection domain includes a first domain and a second domain, the second node belongs to the first domain, the third node belongs to the second domain, and the first node is a node that crosses the first domain and the second domain.

When the method <NUM> may be used to implement the steps performed by the SFF in the method <NUM> mentioned in the foregoing embodiments, the detection domain is the detection domain shown in <FIG>, the first domain may include the ingress PE and the SFF, that is, correspond to the domain A mentioned above, and the second domain may include the SFF and the SF, that is, correspond to the domain B mentioned above. The first node corresponds to the SFF shown in <FIG>, the second node corresponds to the ingress PE shown in <FIG>, and the third node corresponds to the SF shown in <FIG>. In this case, in some embodiments, the first node may be further configured to receive a third packet returned by the third node, where the third packet includes the first in-situ flow detection information, and the third packet is a packet encapsulated by using the second bearer protocol. The first node generates a fourth packet based on the third packet, where the fourth packet includes the first in-situ flow detection information, and the fourth packet is a packet encapsulated by using the first bearer protocol. The first node sends the first packet to a next-hop node. The third packet mentioned herein corresponds to the packet <NUM> in the method <NUM>, the first in-situ flow detection information corresponds to the in-situ flow detection information <NUM> in the method <NUM>, and the fourth packet corresponds to the packet <NUM> in the method <NUM>. The first bearer protocol is the IPv4 protocol, and the second bearer protocol is the SRv6 protocol.

In an implementation, an SRv6 network is deployed in the first domain, an IPv4 network is deployed in the second domain, the first packet is an SRv6 packet carrying SFC information, and the second packet is an IPv4 packet carrying the SFC information. The first domain includes the ingress PE and the SFF shown in <FIG>, that is, the first domain corresponds to the domain A mentioned above. The second domain includes the SFF and the SF shown in <FIG>, that is, the second domain corresponds to the domain B mentioned above.

In an implementation, an IPv4 network is deployed in the first domain, an SRv6 network is deployed in the second domain, the first packet is an IPv4 packet carrying SFC information, and the second packet is an SRv6 packet carrying the SFC information. The first domain includes the SFF and the SF shown in <FIG>, that is, the first domain corresponds to the domain B mentioned above. The second domain includes the SFF and the egress PE shown in <FIG>, that is, the second domain corresponds to the domain A mentioned above.

In an implementation, when the method <NUM> may be used to implement the steps performed by the ASBR <NUM> in the method <NUM> mentioned in the foregoing embodiments, the detection domain is the detection domain shown in <FIG>. An MPLS network is deployed in the first domain, an IPv4 network is deployed in the second domain, the first packet is an MPLS packet, and the second packet is an IPv4 packet. The first domain may include the PE <NUM> and the ASBR <NUM> shown in <FIG>, that is, the first domain may correspond to the domain C mentioned above. The second domain may include the ASBR <NUM> and the ASBR <NUM> shown in <FIG>, that is, the second domain may include the domain D mentioned above. In this case, the first packet may correspond to the packet <NUM> in the method <NUM>, and the second packet may correspond to the packet <NUM> in the method <NUM>.

In an implementation, the detection domain further includes a third domain, the MPLS network is deployed in the third domain, and the third node is a node that crosses the second domain and the third domain. The third domain may include the ASBR <NUM> and the PE <NUM> shown in <FIG>, that is, the third domain may correspond to the domain E mentioned above. In this case, the third node is the ASBR <NUM>.

In an implementation, the first domain is a first autonomous system, and the first node is an ASBR of the first autonomous system. The third domain is a second autonomous system, and the third node is an ASBR of the second autonomous system. That is, both the domain C and the domain D mentioned above are autonomous systems, the first node corresponds to the ASBR <NUM> shown in <FIG>, and the third node corresponds to the ASBR <NUM> shown in <FIG>.

In an implementation, when the method <NUM> may be used to implement the steps performed by the ASBR <NUM> in the method <NUM> mentioned in the foregoing embodiments, an IPv4 network is deployed in the first domain, an MPLS network is deployed in the second domain, the first packet is an IPv4 packet, and the second packet is an MPLS packet. In this case, the first domain may include the ASBR <NUM> and the ASBR <NUM> shown in <FIG>, that is, the first domain corresponds to the domain D mentioned above. The second domain may include the ASBR <NUM> and the PE <NUM> shown in <FIG>, that is, the second domain may correspond to the domain E mentioned above. In this case, the first node may correspond to the ASBR <NUM> in the method <NUM>, the first packet may correspond to the packet <NUM> in the method <NUM>, and the second packet may correspond to the packet <NUM> in the method <NUM>.

In an implementation, the first in-situ flow detection information includes: iFIT in-situ flow detection information or iOAM in-situ flow detection information.

For specific implementation of the method <NUM>, refer to related descriptions of the method <NUM> and the method <NUM> in the foregoing embodiments.

In addition, an embodiment of this application further provides a first node <NUM>. <FIG> is a schematic diagram of a structure of a first node according to an embodiment of this application. The first node <NUM> includes a transceiver unit <NUM> and a processing unit <NUM>. The transceiver unit <NUM> is configured to perform sending and receiving operations performed by the SFF in the embodiment corresponding to the method <NUM>. The processing unit <NUM> is configured to perform an operation other than the sending and receiving operations performed by the SFF in the embodiment corresponding to the method <NUM>. Alternatively, the transceiver unit <NUM> is configured to perform sending and receiving operations performed by the ASBR <NUM> in the embodiment corresponding to the method <NUM>. The processing unit <NUM> is configured to perform an operation other than the sending and receiving operations performed by the ASBR <NUM> in the embodiment corresponding to the method <NUM>. Alternatively, the transceiver unit <NUM> is configured to perform sending and receiving operations performed by the ASBR <NUM> in the embodiment corresponding to the method <NUM>. The processing unit <NUM> is configured to perform an operation other than the sending and receiving operations performed by the ASBR <NUM> in the embodiment corresponding to the method <NUM>. For example, if the first node <NUM> is the SFF in the method <NUM>, the transceiver unit <NUM> is configured to perform the step of receiving the packet <NUM> from the ingress PE and the step of sending the packet <NUM> to the SF, and the processing unit <NUM> is configured to perform the step of obtaining the packet <NUM> based on the packet <NUM>.

In addition, an embodiment of this application further provides a first node <NUM>. <FIG> is a schematic diagram of a structure of a first node according to an embodiment of this application. The first node <NUM> includes a communication interface <NUM> and a processor <NUM> connected to the communication interface <NUM>. The communication interface <NUM> is configured to perform sending and receiving operations performed by the SFF in the embodiment corresponding to the method <NUM>. The processor <NUM> is configured to perform an operation other than the sending and receiving operations performed by the SFF in the embodiment corresponding to the method <NUM>. Alternatively, the communication interface <NUM> is configured to perform sending and receiving operations performed by the ASBR <NUM> in the embodiment corresponding to the method <NUM>. The processor <NUM> is configured to perform an operation other than the sending and receiving operations performed by the ASBR <NUM> in the embodiment corresponding to the method <NUM>. Alternatively, the communication interface <NUM> is configured to perform sending and receiving operations performed by the ASBR <NUM> in the embodiment corresponding to the method <NUM>. The processor <NUM> is configured to perform an operation other than the sending and receiving operations performed by the ASBR <NUM> in the embodiment corresponding to the method <NUM>. For example, if the first node <NUM> is the SFF in the method <NUM>, the communication interface <NUM> is configured to perform the step of receiving the packet <NUM> from the ingress PE and the step of sending the packet <NUM> to the SF, and the processor <NUM> is configured to perform the step of obtaining the packet <NUM> based on the packet <NUM>.

In addition, an embodiment of this application further provides a first node <NUM>. <FIG> is a schematic diagram of a structure of a first node according to an embodiment of this application. The first node <NUM> includes a memory <NUM> and a processor <NUM>. The memory <NUM> is configured to store program code, and the processor <NUM> is configured to run instructions in the program code, to enable the first node <NUM> to perform the steps performed by the SFF in the embodiment corresponding to the method <NUM>, enable the first node <NUM> to perform the steps performed by the ASBR <NUM> in the embodiment corresponding to the method <NUM>, or enable the first node <NUM> to perform the steps performed by the ASBR <NUM> in the embodiment corresponding to the method <NUM>.

In addition, an embodiment of this application further provides a computer-readable storage medium. The computer-readable storage medium stores instructions. When the instructions are run on a computer, the computer is enabled to perform the steps performed by the SFF in the embodiment corresponding to the method <NUM>, perform the steps performed by the ASBR <NUM> in the embodiment corresponding to the method <NUM>, or perform the steps performed by the ASBR <NUM> in the embodiment corresponding to the method <NUM>.

In the specification, claims, and accompanying drawings of this application, the terms "first", "second", "third", "fourth", and so on (if existent) are intended to distinguish between similar objects but do not necessarily indicate a specific order or sequence. It should be understood that the data termed in such a way is interchangeable in appropriate circumstances, so that embodiments described herein can be implemented in other orders than the content illustrated or described herein. In addition, the terms "include" and "have" and any other variants are intended to cover the non-exclusive inclusion. For example, a process, method, system, product, or device that includes a list of steps or units is not necessarily limited to those expressly listed steps or units, but may include other steps or units not expressly listed or inherent to such a process, method, product, or device.

For example, the described apparatus embodiments are merely examples. For example, division into the units is merely logical function division. During actual implementation, there may be another division manner. In addition, the displayed or discussed mutual couplings or direct couplings or communication connections may be implemented through some interfaces.

The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, in other words, may be located in one position, or may be distributed on a plurality of network units.

In addition, functional units in embodiments of this application may be integrated into one processing unit, or each of the units may exist alone physically, or two or more units may be integrated into one unit. The integrated unit may be implemented in a form of hardware, or may be implemented in a form of a software service unit.

When the integrated unit is implemented in the form of the software service unit and sold or used as an independent product, the integrated unit may be stored in a computer-readable storage medium. Based on such an understanding, the technical solutions of this application essentially, or the part contributing to the prior art, or some of the technical solutions may be implemented in a form of a software product. The computer software product is stored in a storage medium, and includes several instructions for instructing a computer device (which may be a personal computer, a server, a network device, or the like) to perform all or some of the steps of the methods in embodiments of this application. The storage medium includes various media that can store program code, such as a USB flash drive, a removable hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a magnetic disk, or an optical disc.

A person skilled in the art should be aware that in the foregoing one or more examples, services described in the present invention may be implemented by hardware, software, firmware, or any combination thereof. When the services are implemented by software, the services may be stored in a computer-readable medium or transmitted as one or more instructions or code in the computer-readable medium. The computer-readable medium includes a computer storage medium and a communication medium. The communication medium includes any medium that facilitates transmission of a computer program from one place to another. The storage medium may be any available medium accessible to a general-purpose or dedicated computer.

Claim 1:
An in-situ flow detection-based packet processing method, comprising:
receiving (S301), by a first node, a first packet from a second node, wherein a first packet header of the first packet comprises first in-situ flow detection information, and the first packet is a packet encapsulated by using a first bearer protocol;
obtaining (S302), by the first node, a second packet by re-encapsulating the first packet, wherein a second packet header of the second packet comprises the first in-situ flow detection information, the second packet is a packet encapsulated by using a second bearer protocol, and the first bearer protocol and the second bearer protocol are different bearer protocols; and
forwarding (S303), by the first node, the second packet to a third node.