In a network environment, a packet needs to be forwarded from a source node to a destination node along a forwarding path, so that a data packet is forwarded, and data is transmitted. The source node is also referred to as an ingress node (Ingress Node), and the destination node is also referred to as an egress node (Egress Node). For a network environment that supports multiprotocol label switching (MPLS), different mechanisms may be selected to forward packets, such as an Internet Protocol (IP) routing mechanism, an MPLS mechanism, and a segment routing (SR) mechanism. In packet forwarding mechanisms such as the MPLS mechanism and the segment routing mechanism, the forwarding path is also referred to as a label switched path (LSP).
In a process of forwarding a packet in a network, some service processing needs to be performed on the packet sometimes. For example, when a forwarding node on a forwarding path of the packet has multiple links for selection, to implement load balance on the forwarding node, the forwarding node needs to select, according to a load status of each link, a link to forward the packet.
In the prior art, for a forwarding equivalence class (FEC), to perform service processing on a packet corresponding to the FEC in a forwarding process of the packet, some forwarding nodes on a forwarding path of the FEC need to be statically configured, so that these forwarding nodes can process, in a statically configured service processing manner, the packet corresponding to the FEC. However, because there are a large quantity of FECs in the network environment, and a service processing manner of each FEC needs to be configured for different forwarding nodes, a large quantity of forwarding nodes in the network need to be statically configured. Consequently, work of configuring and maintaining service processing for the network environment is extremely complex, and it is difficult to flexibly implement various service processing in the network environment.