Abstract:
A packet processing method, including receiving a first packet from a first switch, where the first packet belongs to a service flow that flows from a first device to a second device, determining a service chain through which the service flow passes, determining a forwarding path of the service flow according to the service chain through which the service flow passes, modifying the first packet to obtain a second packet, where the second packet belongs to the service flow, and a valid payload of the second packet includes a valid payload of the first packet and forwarding path indication information, generating a first flow table according to the forwarding path of the service flow, controlling a communications interface to send the first flow table to the first switch, and sending the second packet to the first switch.
Abstract:
A method and an apparatus for processing a data packet based on parallel protocol stack instances, where lower-layer protocol processing is performed, using a first protocol stack instance. An associated second protocol stack instance is determined using a target socket after the target socket that is needed to perform upper-layer protocol processing on the data packet is determined, and the upper-layer protocol processing is performed, using the target socket and the second protocol stack instance. The second protocol stack instance that performs the upper-layer protocol processing is determined using the target socket, and hence, a technical problem that protocol processing cannot be performed on a data packet because a protocol stack instance specified by an application (APP) conflicts with a protocol stack instance specified by a network adapter is resolved.
Abstract:
A packet processing method, including receiving a first packet from a first switch, where the first packet belongs to a service flow that flows from a first device to a second device, determining a service chain through which the service flow passes, determining a forwarding path of the service flow according to the service chain through which the service flow passes, modifying the first packet to obtain a second packet, where the second packet belongs to the service flow, and a valid payload of the second packet includes a valid payload of the first packet and forwarding path indication information, generating a first flow table according to the forwarding path of the service flow, controlling a communications interface to send the first flow table to the first switch, and sending the second packet to the first switch.
Abstract:
A method and an apparatus for processing a data packet based on parallel protocol stack instances, where lower-layer protocol processing is performed, using a first protocol stack instance. An associated second protocol stack instance is determined using a target socket after the target socket that is needed to perform upper-layer protocol processing on the data packet is determined, and the upper-layer protocol processing is performed, using the target socket and the second protocol stack instance. The second protocol stack instance that performs the upper-layer protocol processing is determined using the target socket, and hence, a technical problem that protocol processing cannot be performed on a data packet because a protocol stack instance specified by an application (APP) conflicts with a protocol stack instance specified by a network adapter is resolved.