摘要 |
The present invention provides a method and an apparatus for processing a data packet based on parallel protocol stack instances. The method includes: determining a distribution policy of a data packet according to distribution policy information of a network adapter; and determining a first protocol stack instance according to the distribution policy of the data packet, and creating a target socket (socket) in the first protocol stack instance, so that when the data packet is distributed to the first protocol stack instance, the first protocol stack instance performs protocol processing on the data packet by using the target socket. In this way, a case in which a protocol stack instance that is specified for the target socket by an application (APP) conflicts with a protocol stack instance specified by a network adapter is avoided, and a technical problem that protocol processing cannot be performed on the data packet is resolved. |