WO2015113437A1 - 基于并行协议栈实例的数据包处理方法和装置 - Google Patents

基于并行协议栈实例的数据包处理方法和装置 Download PDF

Info

Publication number
WO2015113437A1
WO2015113437A1 PCT/CN2014/091727 CN2014091727W WO2015113437A1 WO 2015113437 A1 WO2015113437 A1 WO 2015113437A1 CN 2014091727 W CN2014091727 W CN 2014091727W WO 2015113437 A1 WO2015113437 A1 WO 2015113437A1
Authority
WO
WIPO (PCT)
Prior art keywords
protocol stack
data packet
stack instance
socket
target socket
Prior art date
Application number
PCT/CN2014/091727
Other languages
English (en)
French (fr)
Inventor
古强
文刘飞
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Priority to EP14880886.8A priority Critical patent/EP3091707A4/en
Priority to KR1020167023319A priority patent/KR20160113671A/ko
Publication of WO2015113437A1 publication Critical patent/WO2015113437A1/zh
Priority to US15/222,741 priority patent/US10218820B2/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/16Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP]
    • H04L69/161Implementation details of TCP/IP or UDP/IP stack architecture; Specification of modified or new header fields
    • H04L69/162Implementation details of TCP/IP or UDP/IP stack architecture; Specification of modified or new header fields involving adaptations of sockets based mechanisms
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/03Protocol definition or specification 

Definitions

  • the method further includes: identifying a manner in which the APP indicates to create the target socket; if the manner of using the binding is a bind binding mode and/or a listening listen mode, in the parallel protocol stack instance
  • the target socket is created on each of the included protocol stack instances; the first protocol stack instance is determined according to the traffic offloading policy of the data packet, and the target socket is created on the first protocol stack instance, including: Determining, by the splitting policy of the data packet, the first protocol stack instance, according to the offloading policy of the data packet, to the indication that the TCP connection sent by one of the protocol stack instances of the target socket is successfully established.
  • the target socket is created on the first protocol stack instance.
  • the method further includes: if the TCP type data packet is received and the TCP connection establishment success indication is not monitored, the protocol stack instance of the TCP type data packet is received by the protocol stack instance. TCP type packets are processed by the protocol.
  • a second aspect is to provide a packet processing apparatus based on a parallel protocol stack instance, comprising: an obtaining module, configured to obtain a traffic offloading policy information of the network card; and a determining module, configured to determine a traffic offloading policy according to the traffic splitting policy information; a first creating module, configured to: when the application APP creates an indication of the target socket socket, determine, according to the offloading policy of the data packet, the first protocol stack instance, and create the target on the first protocol stack instance Socket, so that the first protocol stack instance performs protocol processing on the data packet by using the target socket.
  • the offloading policy information includes a traffic offloading policy of the network card.
  • the device further includes: a second processing module, configured to be included in the parallel protocol stack instance After the target socket is created on each protocol stack instance, if a UDP type data packet is received, the UDP type data packet is protocol processed by the protocol stack instance that receives the UDP type data packet.
  • a second processing module configured to be included in the parallel protocol stack instance After the target socket is created on each protocol stack instance, if a UDP type data packet is received, the UDP type data packet is protocol processed by the protocol stack instance that receives the UDP type data packet.
  • the data packet processing method and device based on the parallel protocol stack instance determines the traffic splitting policy according to the traffic splitting policy information of the network card, determines the first protocol stack instance according to the traffic splitting policy, and further determines A target socket is created on the first protocol stack instance, so that when the data packet is offloaded to the first protocol stack instance, the first protocol stack instance uses the target socket to perform protocol processing on the data packet, so as to avoid the protocol stack specified by the APP for the target socket.
  • the case where the instance conflicts with the protocol stack instance specified by the NIC solves the technical problem that the protocol cannot be processed by the protocol.
  • FIG. 1 is a schematic diagram of a data packet processing method based on a parallel protocol stack example according to an embodiment of the present invention. Schematic diagram of the process;
  • FIG. 5 is a schematic structural diagram of a data packet processing apparatus based on an example of a parallel protocol stack according to another embodiment of the present invention.
  • FIG. 1 is a schematic flowchart of a data packet processing method based on an example of a parallel protocol stack according to an embodiment of the present invention. As shown in FIG. 1 , this embodiment may include:
  • the offloading policy information includes a traffic offloading policy of the network card.
  • the offload policy information may further include hardware configuration information and/or software configuration information.
  • the target socket is a socket required for protocol processing of the data packet.
  • the manner in which the APP indicates the creation of the target socket may be further identified. If the method used is a connect mode, the APP is determined. Currently in the client mode, according to the offloading policy of the data packet, determining to offload the data packet to the first protocol stack instance, creating the target socket on the first protocol stack instance, to When the data packet is offloaded to the first protocol stack instance, the first protocol stack instance uses the target socket to perform protocol processing on the data packet.
  • the manner in which the APP indicates the creation of the target socket may be further identified, if the manner adopted is a bind mode and/or Or the listen mode determines that the APP is currently in the server-side mode, and the target socket is created on each protocol stack instance included in the parallel protocol stack instance.
  • the indication of successful establishment of the TCP connection sent by the second protocol stack instance in each protocol stack instance in which the target socket is created is detected, according to the offloading policy of the data packet, it is determined that the data packet is offloaded to The first protocol stack instance creates the target socket on the first protocol stack instance.
  • the splitting policy of the data packet is determined according to the traffic splitting policy information of the network card, and the first protocol stack instance is determined according to the traffic splitting policy of the data packet, and then the target socket is created on the first protocol stack instance, so that the data packet is used.
  • the first protocol stack instance uses the target socket to perform protocol processing on the data packet to avoid conflicts between the protocol stack instance specified by the APP and the protocol stack instance specified by the network card, and the solution is solved.
  • Technical problem that the protocol cannot be processed by the packet.
  • the APP calling API indicates that the socket X is created
  • the APP instructs the specified protocol stack in the parallel protocol stack to create the socket X
  • it may determine whether the socket X can be created according to the network running condition of the parallel protocol stack, for example: Whether the total number of sockets created in the specified protocol stack reaches a preset limit, and/or whether the logical port X bound to the created socket is occupied by the APP, if the total number does not reach the preset limit, and the logical port is not Occupancy returns the pseudo result of the created socket to the APP. Returning a false result means that the socket is not actually created on the protocol stack instance, but a false result is returned to the application to inform it whether it was created successfully.
  • the steps to create a socket if the APP instructs the specified protocol stack in the parallel protocol stack to create the socket X, it may determine whether the socket X can be created according to the network running condition of the parallel protocol stack, for example: Whether the total number of sockets created in the specified
  • the method used is to invoke the connect mode, according to the offloading policy of the data packet, it is determined that the data packet is offloaded to the protocol stack instance A, and the socket X is created on the protocol stack instance A.
  • the offloading policy of the data packet is determined according to the traffic offloading policy information of the network card, and the traffic offloading policy is written into the network card, so that the network card is based on the traffic offloading policy of the data packet.
  • the packet is offloaded to the protocol stack instance A.
  • the traffic offloading policy of the data packet is used to indicate the protocol stack instance to which each data packet is branched.
  • the data packet is split according to the quintuple information in the data packet.
  • the offloading policy information includes a traffic offloading policy of the network card, and the traffic splitting policy information further includes at least one of the following information: hardware configuration information and software configuration information.
  • the socket X is determined to be a server-side mode, and the quintuple information of the data packet that needs to be processed by using the socket X has the same destination port. And the same destination IP, but the destination port and destination IP are not necessarily the same. Therefore, in general, the network card will be based on the packet's traffic off policy. According to the quintuple information in the data packet, the socket X will need to be processed. The data packet is offloaded to each protocol stack instance, so that the socket X indicated by the APP is created on each protocol stack instance included in the parallel protocol stack instance.
  • TCP Transmission Control Protocol
  • UDP User Datagram Protocol
  • the protocol stack instance that receives the UDP type data packet performs protocol processing on the UDP type data packet.
  • the protocol instance B is intercepted, and the data packet is sent to the protocol stack instance B that is offloaded by the network card, so that the protocol stack instance B performs protocol processing on the data packet to establish a TCP connection.
  • the data packet is used to indicate that a TCP connection between the client and the server is created.
  • the APP is in a server mode, and the data packet is The protocol handles to establish the TCP connection, that is, to make the TCP connection enter the TCP accept state.
  • the TCP type data packet is protocol processed by the protocol stack instance that receives the TCP type data packet. .
  • the protocol stack instance B is monitored to obtain an indication that the protocol stack instance B successfully establishes a TCP connection sent to the APP.
  • the TCP connection sent by the protocol instance B to the APP is successfully set, so that when the indication is received, according to the foregoing offload policy, the protocol stack instance C to which the TCP packet is offloaded is determined.
  • the socket Y is created on the protocol stack instance C.
  • the protocol stack instance C uses the socket Y to perform protocol processing on the TCP data packet.
  • the TCP data packet is a data packet transmitted by using the TCP connection.
  • the splitting policy of the data packet is determined according to the traffic splitting policy information of the network card, and the first protocol stack instance is determined according to the traffic splitting policy of the data packet, and then the target socket is created on the first protocol stack instance, so that the data packet is used.
  • the first protocol stack instance uses the target socket to perform protocol processing on the data packet to avoid conflicts between the protocol stack instance specified by the APP and the protocol stack instance specified by the network card, and the solution is solved.
  • Technical problem that the protocol cannot be processed by the packet.
  • the offloading policy information includes a traffic offloading policy of the network card.
  • the determining module 30 is connected to the obtaining module 31, and configured to determine a traffic offloading policy of the data packet according to the splitting policy information.
  • the offloading policy information further includes at least one of the following information: hardware configuration information, software configuration information, where the determining module 30 is specifically configured to perform, according to the hardware configuration information and/or the software configuration information.
  • the offloading policy of the network card is adjusted to determine a traffic offloading strategy of the data packet.
  • the first creating module 32 is connected to the determining module 30, and is configured to: when the application APP creates an indication of the target socket socket, determine, according to the traffic offloading policy, the first protocol stack instance, where the first protocol is The target socket is created on the stack instance, so that the first protocol stack instance performs protocol processing on the data packet by using the target socket.
  • the traffic offloading policy of the data packet is determined according to the traffic splitting policy information of the network card. Determining, according to the offloading policy of the data packet, the first protocol stack instance, and then creating a target socket on the first protocol stack instance, so that when the data packet is offloaded to the first protocol stack instance, the first protocol stack instance uses the target socket to The data packet is processed by the protocol to avoid the conflict between the protocol stack instance specified by the APP and the protocol stack instance specified by the network card, and the technical problem that the protocol cannot be processed by the data packet is solved.
  • the card writing module 41 is connected to the determining module 30, and configured to write a traffic offloading policy of the data packet to the network card, so that the network card branches the data packet to the according to a splitting policy of the data packet.
  • the first protocol stack instance is connected to the determining module 30, and configured to write a traffic offloading policy of the data packet to the network card, so that the network card branches the data packet to the according to a splitting policy of the data packet.
  • the sending module 43 is connected to the first creating module 32, and is configured to send a pseudo result of the created target socket to the application APP. Returning a false result means that the socket is not actually created on the protocol stack instance, but a false result is returned to the application to inform it whether it was created successfully.
  • a false result means that the socket is not actually created on the protocol stack instance, but a false result is returned to the application to inform it whether it was created successfully.
  • the identification module 42 is connected to the first creation module 32 for identifying the manner in which the APP indicates the creation of the target socket.
  • the first creating module 32 is specifically configured to: if the manner of the method is to invoke the connect mode, determine, according to the offloading policy of the data packet, to offload the data packet to the first protocol stack instance, Creating the target socket on the first protocol stack instance.
  • FIG. 4B is a schematic structural diagram of another data packet processing apparatus based on a parallel protocol stack example according to another embodiment of the present invention.
  • the apparatus further includes a second creation module 44, a first processing module 45, and a second processing module 46.
  • the second creation module 44 is connected to the identification module 42 for creating the target socket on each protocol stack instance included in the parallel protocol stack instance if the manner of calling the bind mode and/or the listen mode is used. .
  • the first creation module 32 is specifically configured to monitor the successful establishment of the TCP connection sent by one of the protocol stack instances of the protocol stack in which the target socket is created. And indicating, according to the offloading policy of the data packet, determining the first protocol stack instance, and creating the target socket on the first protocol stack instance.
  • the first processing module 45 is connected to the second creation module 44 and the first creation module 32, and is configured to monitor the successful establishment of the TCP connection sent by one of the protocol stack instances of the protocol stack in which the target socket is created. Before the indication, if a TCP type data packet is received and the indication that the TCP connection establishment is successful is not detected, the TCP type data packet is protocol processed by the protocol stack instance that receives the TCP type data packet.
  • the second processing module 46 is connected to the second creating module 44, and after the target socket is created on each protocol stack instance included in the parallel protocol stack instance, if a UDP type data packet is received, The protocol stack instance that receives the UDP type data packet performs protocol processing on the UDP type data packet.
  • the functional modules of the data packet processing apparatus of another parallel protocol stack example provided in this embodiment may be used to execute the data packet processing method flow of the parallel protocol stack instance shown in FIG. 1 and FIG. 2, and the specific working principle is not described again. See the description of the method embodiment for details.
  • the splitting policy of the data packet is determined according to the traffic splitting policy information of the network card, and the first protocol stack instance is determined according to the traffic splitting policy of the data packet, and then the target socket is created on the first protocol stack instance, so that the data packet is used.
  • the first protocol stack instance uses the target socket to perform protocol processing on the data packet to avoid conflicts between the protocol stack instance specified by the APP and the protocol stack instance specified by the network card, and the solution is solved.
  • Technical problem that the protocol cannot be processed by the packet.
  • the memory 51 is for storing a program.
  • the program may include program code, and the program code includes computer operation instructions.
  • the memory 51 may include a high speed RAM memory and may also include a non-volatile memory such as at least one disk memory.
  • the communication interface 52 is specifically configured to obtain hardware configuration information and a software configuration letter of the network card.
  • the offloading policy of the network card is adjusted by the processor 53 to adjust the offloading policy of the network card according to the hardware configuration information and/or the software configuration information to obtain a traffic offloading policy of the data packet.
  • the offloading policy is written to the network card, so that the network card offloads the data packet according to the offloading policy of the data packet.
  • the first protocol stack instance is specifically configured to obtain hardware configuration information and a software configuration letter of the network card.
  • the offloading policy of the network card is adjusted by the processor 53 to adjust the offloading policy of the network card according to the hardware configuration information and/or the software configuration information to obtain a traffic offloading policy of the data packet.
  • the processor 53 is specifically configured to adjust a traffic offloading policy of the network card according to the hardware configuration information and/or the software configuration information, to obtain a traffic offloading policy of the data packet.
  • the communication interface 52 monitors that the application APP indicates to create the target socket, it identifies the manner in which the APP indicates the creation of the target socket. If the mode is to invoke the connect mode, the APP is in the client mode, and according to the offloading policy, determining to offload the target data packet to the first protocol stack instance, and creating on the first protocol stack instance. The target socket.
  • the processor 53 is specifically configured to adjust a traffic off policy of the network card according to the hardware configuration information and/or the software configuration information, to obtain a traffic offloading policy of the data packet.
  • the communication interface 52 monitors that the application APP indicates to create the target socket, it identifies the manner in which the APP indicates the creation of the target socket. If the mode is to call the bind mode and/or the listen mode, the APP is the server-side mode, and the target socket is created on each protocol stack instance included in the parallel protocol stack instance.
  • the target socket is created on the first protocol stack instance. If a UDP type data packet is received, the UDP type data packet is processed by the protocol stack instance that receives the UDP type data packet; if the TCP type data packet is received and the TCP connection establishment is not monitored The indication of success is that the TCP type data packet is protocol processed by the protocol stack instance that receives the TCP type data packet.
  • the functional modules of the data packet processing apparatus of the parallel protocol stack example provided in this embodiment may be used to execute the data packet processing method flow of the parallel protocol stack instance shown in FIG. 1 and FIG. 2, and the specific working principle is not described herein. Description of method embodiments.
  • the aforementioned program can be stored in a computer readable storage medium.
  • the program when executed, performs the steps including the foregoing method embodiments; and the foregoing storage medium includes various media that can store program codes, such as a ROM, a RAM, a magnetic disk, or an optical disk.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)
  • Communication Control (AREA)

Abstract

本发明提供一种基于并行协议栈实例的数据包处理方法和装置。所述方法包括:通过根据网卡的分流策略信息确定数据包的分流策略,根据该数据包的分流策略,确定第一协议栈实例,进而在第一协议栈实例上创建目标套接字(socket),以便当数据包分流到第一协议栈实例时,第一协议栈实例利用目标socket对该数据包进行协议处理,避免出现应用(APP)指定的针对目标socket的协议栈实例与网卡指定的协议栈实例冲突的情况,解决了无法对该数据包进行协议处理的技术问题。

Description

基于并行协议栈实例的数据包处理方法和装置 技术领域
本发明涉及通信技术,尤其涉及一种基于并行协议栈实例的数据包处理方法和装置。
背景技术
随着云计算的快速发展,对协议栈实例的处理能力提出了更高的要求。目前,通常采用多个协议栈实例共享套接字(socket)的方式,因此存在多协议栈实例之间对socket的竞争问题,进而提出了在CPU的多核架构下并行协议栈实例,该并行协议栈实例包括至少两个协议栈实例,每个协议栈实例运行在CPU的一个虚拟处理器(virtual CPU,VCPU)上,采用独占协议栈实例所关联的socket的方式从而避免上述多协议栈实例之间对socket的竞争问题。当网卡根据分流策略,向各协议栈实例分流数据包时,各协议栈实例可利用与该协议栈实例关联的socket对数据包并行进行协议处理。
但是应用(Application,APP)在指示创建进行上述协议处理所需的socket时,指定了socket与协议栈实例之间的关联关系,从而仅可由相关联的协议栈实例占用该socket对数据包进行协议处理,当网卡将数据包分流到的协议栈实例,与该socket相关联的协议栈实例不同时,即出现了APP指定的协议栈实例与网卡指定的协议栈实例冲突的情况,无法对数据包进行协议处理。
发明内容
本发明实施例提供一种基于并行协议栈实例的数据包处理方法和装置。
第一个方面是提供一种基于并行协议栈实例的数据包处理方法,获得网卡的分流策略信息;根据所述分流策略信息确定数据包的分流策略;监听到应用APP创建目标套接字socket的指示时,根据所述数据包的分流策略,确定第一协议栈实例,在所述第一协议栈实例上创建所述目标socket,以便所述第一协议栈实例利用所述目标socket对所述数据包进行协议处理。
在第一方面的第一种可能的实现方式中,所述分流策略信息中包括网卡 的分流策略。
结合第一方面的第一种可能的实现方式,在第一方面的第二种可能的实现方式中,所述分流策略信息中还包括如下信息中的至少一种:硬件配置信息、软件配置信息;则所述根据所述分类策略信息确定数据包的分流策略,包括:根据所述硬件配置信息和/或所述软件配置信息对所述网卡的分流策略进行调整,确定所述数据包的分流策略;所述方法还包括:将所述数据包的分流策略写入所述网卡,以使所述网卡根据所述数据包的分流策略,将所述数据包分流到所述第一协议栈实例。
结合第一方面,在第一方面的第三种可能的实现方式中,所述根据所述数据包的分流策略,确定第一协议栈实例,在所述第一协议栈实例上创建所述目标socket之前,还包括:识别所述APP指示创建所述目标socket时所采用的方式;则所述根据所述数据包的分流策略,确定第一协议栈实例,在所述第一协议栈实例上创建所述目标socket,包括:若所述采用的方式为调用连接connect方式,则根据所述数据包的分流策略,确定所述第一协议栈实例,在所述第一协议栈实例上创建所述目标socket。
结合第一方面,在第一方面的第四种可能的实现方式中,所述根据所述数据包的分流策略,确定第一协议栈实例,在所述第一协议栈实例上创建所述目标socket之前,还包括:识别所述APP指示创建所述目标socket时所采用的方式;若所述采用的方式为调用绑定bind方式和/或监听listen方式,则在所述并行协议栈实例所包括的各协议栈实例上均创建所述目标socket;所述根据所述数据包的分流策略,确定第一协议栈实例,在所述第一协议栈实例上创建所述目标socket,包括:监听到所述创建了所述目标socket的各协议栈实例中的一个协议栈实例发送的TCP连接建立成功的指示,根据所述数据包的分流策略,确定所述第一协议栈实例,在所述第一协议栈实例上创建所述目标socket。
结合第一方面的第四种可能的实现方式,在第一方面的第五种可能的实现方式中,所述监听到所述创建了所述目标socket的各协议栈实例中的一个协议栈实例发送的TCP连接建立成功的指示之前,还包括:若收到TCP类型的数据包且未监听到TCP连接建立成功的指示,则由收到所述TCP类型的数据包的协议栈实例对所述TCP类型的数据包进行协议处理。
结合第一方面的第四种可能的实现方式,在第一方面的第六种可能的实 现方式中,在所述并行协议栈实例所包括的各协议栈实例上均创建所述目标socket之后,还包括:若收到UDP类型的数据包,则由收到所述UDP类型数据包的协议栈实例对所述UDP类型的数据包进行协议处理。
在第一方面的第七种可能的实现方式中,所述监听到应用APP创建目标套接字socket的指示之后,还包括:向所述应用APP发送已创建所述目标socket的伪结果。
第二方面是提供一种基于并行协议栈实例的数据包处理装置,包括:获得模块,用于获得网卡的分流策略信息;确定模块,用于根据所述分流策略信息确定数据包的分流策略;第一创建模块,用于监听到应用APP创建目标套接字socket的指示时,根据所述数据包的分流策略,确定第一协议栈实例,在所述第一协议栈实例上创建所述目标socket,以便所述第一协议栈实例利用所述目标socket对所述数据包进行协议处理。
在第二方面的第一种可能的实现方式中,所述分流策略信息中包括网卡的分流策略。
结合第二方面的第一种可能的实现方式,在第二方面的第二种可能的实现方式中,所述分流策略信息中还包括如下信息中的至少一种:硬件配置信息、软件配置信息;则所述确定模块,具体用于根据所述硬件配置信息和/或所述软件配置信息对所述网卡的分流策略进行调整,确定所述数据包的分流策略;所述装置还包括:写卡模块,用于将所述数据包的分流策略写入所述网卡,以使所述网卡根据所述数据包的分流策略,将所述数据包分流到所述第一协议栈实例。
结合第二方面,在第二方面的第三种可能的实现方式中,所述装置,还包括:识别模块,用于识别所述APP指示创建所述目标socket时所采用的方式;则所述第一创建模块,具体用于若所述采用的方式为调用连接connect方式,则根据所述数据包的分流策略,确定所述第一协议栈实例,在所述第一协议栈实例上创建所述目标socket。
结合第二方面,在第二方面的第四种可能的实现方式中,所述装置,还包括:识别模块,用于识别所述APP指示创建所述目标socket时所采用的方式;第二创建模块,用于若所述采用的方式为调用绑定bind方式和/或监听listen方式,则在所述并行协议栈实例所包括的各协议栈实例上均创建所述目标socket;所述第一创建模块,具体用于监听到所述创建了所述目标socket 的各协议栈实例中的一个协议栈实例发送的TCP连接建立成功的指示,根据所述数据包的分流策略,确定所述第一协议栈实例,在所述第一协议栈实例上创建所述目标socket。
结合第二方面的第四种可能的实现方式,在第二方面的第五种可能的实现方式中,所述装置,还包括:第一处理模块,用于监听到所述创建了所述目标socket的各协议栈实例中的一个协议栈实例发送的TCP连接建立成功的指示之前,若收到TCP类型的数据包且未监听到TCP连接建立成功的指示,则由收到所述TCP类型的数据包的协议栈实例对所述TCP类型的数据包进行协议处理。
结合第二方面的第四种可能的实现方式,在第二方面的第六种可能的实现方式中,所述装置,还包括:第二处理模块,用于在所述并行协议栈实例所包括的各协议栈实例上均创建所述目标socket之后,若收到UDP类型的数据包,则由收到所述UDP类型数据包的协议栈实例对所述UDP类型的数据包进行协议处理。
结合第二方面,在第二方面的第七种可能的实现方式中,所述装置,还包括:发送模块,用于向所述应用APP发送已创建所述目标socket的伪结果。
本发明实施例提供的基于并行协议栈实例的数据包处理方法和装置,通过根据网卡的分流策略信息确定数据包的分流策略,根据该数据包的分流策略,确定第一协议栈实例,进而在第一协议栈实例上创建目标socket,以便当数据包分流到第一协议栈实例时,第一协议栈实例利用目标socket对该数据包进行协议处理,避免出现APP指定的针对目标socket的协议栈实例与网卡指定的协议栈实例冲突的情况,解决了无法对该数据包进行协议处理的技术问题。
附图说明
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作一简单地介绍,显而易见地,下面描述中的附图是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。
图1为本发明一实施例提供的基于并行协议栈实例的数据包处理方法的 流程示意图;
图2为本发明另一实施例提供的基于并行协议栈实例的数据包处理方法的流程示意图;
图3为本发明一实施例提供的基于并行协议栈实例的数据包处理装置的结构示意图;
图4A为本发明另一实施例提供的一种基于并行协议栈实例的数据包处理装置的结构示意图;
图4B为本发明另一实施例提供的另一种基于并行协议栈实例的数据包处理装置的结构示意图;
图5为本发明又一实施例提供的基于并行协议栈实例的数据包处理装置的结构示意图。
具体实施方式
为使本发明实施例的目的、技术方案和优点更加清楚,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。
图1为本发明一实施例提供的基于并行协议栈实例的数据包处理方法的流程示意图,如图1所示,本实施例可以包括:
101、获得网卡的分流策略信息。
其中,分流策略信息中包括网卡的分流策略。
可选的,可从网卡获得上述网卡的分流策略信息,该网卡可为物理网卡或者虚拟网卡。
进一步,分流策略信息还可包括硬件配置信息和/或软件配置信息。
102、根据分流策略信息确定数据包的分流策略。
其中,所述数据包的分流策略用于指示数据包所分流到的第一协议栈实例。
可选的,若分流策略信息包括网卡的分流策略,还包括硬件配置信息和/或软件配置信息,则根据所述硬件配置信息,例如网卡所包含的硬件队 列个数,和/或所述软件配置信息,例如是否开启协议栈实例的转发功能,对网卡的分流策略进行调整,确定该数据包的分流策略。相应的,在确定该数据包的分流策略之后,将该数据包的分流策略写入所述网卡,以使所述网卡根据所述数据包的分流策略,将数据包分流到所述第一协议栈实例。
103、监听到APP创建目标socket的指示时,根据数据包的分流策略,确定第一协议栈实例,在第一协议栈实例上创建目标socket。
其中,目标socket是对所述数据包进行协议处理所需的socket。
可选的,当监听到应用APP指示创建所述目标socket时,可进一步识别所述APP指示创建所述目标socket时所采用的方式,若采用的方式为调用连接(connect)方式,则确定APP当前处于客户端模式,根据所述数据包的分流策略,确定将所述数据包分流到所述第一协议栈实例,在所述第一协议栈实例上创建所述目标socket,以当所述数据包分流到所述第一协议栈实例时,所述第一协议栈实例利用所述目标socket,对所述数据包进行协议处理。
或者可选的,当监听到应用APP指示创建所述目标socket时,可进一步识别所述APP指示创建所述目标socket时所采用的方式,若采用的方式为调用绑定(bind)方式和/或监听(listen)方式,则确定APP当前处于服务器端模式,则在所述并行协议栈实例所包括的各协议栈实例上均创建所述目标socket。当监听到所述创建了所述目标socket的各协议栈实例中的第二协议栈实例发送的TCP连接建立成功的指示时,根据所述数据包的分流策略,确定将所述数据包分流到所述第一协议栈实例,在所述第一协议栈实例上创建所述目标socket。
本实施例中,通过根据网卡的分流策略信息确定数据包的分流策略,根据该数据包的分流策略,确定第一协议栈实例,进而在第一协议栈实例上创建目标socket,以便当数据包分流到第一协议栈实例时,第一协议栈实例利用目标socket对该数据包进行协议处理,避免出现APP指定的针对目标socket的协议栈实例与网卡指定的协议栈实例冲突的情况,解决了无法对该数据包进行协议处理的技术问题。
图2为本发明另一实施例提供的基于并行协议栈实例的数据包处理方法的流程示意图,本实施例中的并行协议栈具体用于对网卡所分流的数据包进行协议处理,本实施例所提供的方法由并行协议栈中的数据包处理装 置执行,如图2所示,本实施例可以包括:
201、监听APP对应用程序接口(Application Programming Interface,API)的调用。
202、当监听到APP调用API指示创建socket X时,判断APP指示创建该socket X时所采用的方式是否为调用connect方式,若是,则执行203,否则执行204至208。
其中,X为socket所绑定的逻辑端口号。socket X用于对数据包进行协议处理。
进一步,在监听到APP调用API指示创建socket X时,若APP指示并行协议栈中的指定协议栈创建socket X,则还可根据并行协议栈的网络运行情况确定是否可以创建该socket X,例如:是否该指定协议栈内创建的socket的总数达到预设限值,和/或该APP指示创建的socket所绑定的逻辑端口X是否已占用,若总数未达到预设限值,且逻辑端口未占用则向该APP返回已创建该socket的伪结果。返回伪结果是指并不真正在协议栈实例上创建socket,而是给应用返回伪的结果,通知其是否创建成功。后续再进行创建socket的工作。
203、若采用的方式为调用connect方式,则根据数据包的分流策略,确定将数据包分流到协议栈实例A,在协议栈实例A上创建socket X。
其中,数据包的分流策略是获得网卡的分流策略信息之后,根据网卡的分流策略信息预先确定的,并且该数据包的分流策略已写入网卡中,以使该网卡根据数据包的分流策略,将数据包分流到协议栈实例A。数据包的分流策略用于指示各数据包所分流到的协议栈实例,一般情况下,具体根据数据包中的五元组信息对数据包进行分流。其中,分流策略信息中包括网卡的分流策略,分流策略信息中还包括如下信息中的至少一种:硬件配置信息、软件配置信息。
可选的,若采用的方式为调用connect方式,则APP为客户端模式,根据网卡的分流策略确定数据包的分流策略,进而确定需要该socket X进行协议处理的数据包所分流到的协议栈实例A,采用部署协议控制块(PCB)的方式,在协议栈实例A上创建socket X。
204、若采用的方式为调用bind方式和/或listen方式,则APP为服务器端模式,则在所述并行协议栈实例所包括的各协议栈实例上均创建 socket X。
可选的,若采用的方式为调用bind方式和/或listen方式,可确定该socket X为服务器端模式,需要利用该socket X进行处理的数据包的五元组信息中,具有相同的目的端口和相同的目的IP,但目的端口和目的IP不一定相同,因此,一般情况下,网卡会基于数据包的分流策略,根据数据包中的五元组信息,将需要利用该socket X进行处理的数据包分流到各协议栈实例中,从而,在所述并行协议栈实例所包括的各协议栈实例上均创建APP所指示的socket X。
205、接收网卡向协议栈实例B分流的数据包,判断分流到协议栈实例B的数据包所采用的协议类型,是否为传输控制协议(Transmission Control Protocol,TCP)类型,若是执行207,否则,执行206。
其中,协议栈实例B为创建了socket X的各协议栈实例中的一个协议栈实例。
206、若为用户数据包协议(User Datagram Protocol,UDP)类型,向网卡所分流的协议栈实例B发送该数据包,以使协议栈实例B对该数据包进行协议处理。
可选的,若为UDP类型,则由收到UDP类型数据包的协议栈实例对UDP类型的数据包进行协议处理。
207、若为TCP类型,则对该协议栈实例B进行监听,以及向网卡所分流的协议栈实例B发送该数据包,以使协议栈实例B对该数据包进行协议处理以建立TCP连接。
可选的,若为TCP类型,也就是说收到TCP类型的数据包,则该数据包用于指示创建客户端与服务器端的TCP连接,此时,APP为服务器端模式,对该数据包进行协议处理,以建立该TCP连接,也就是说,使该TCP连接进入TCP接受(accept)状态。在收到TCP类型的数据包且收到TCP类型的数据包之前未监听到TCP连接建立成功的指示,则由收到TCP类型的数据包的协议栈实例对该TCP类型的数据包进行协议处理。并且对协议栈实例B进行监听,以获得该协议栈实例B向APP发送的TCP连接建立成功的指示。
208、当监听到该协议栈实例B向APP发送的TCP连接建立成功的指示时,根据上述分流策略,在协议栈实例C上创建socket Y。
其中,Y为在协议栈实例C上创建的socket所绑定的逻辑端口号,socket Y用于对利用上述TCP连接传输的TCP数据包进行协议处理。
可选的,该TCP连接建立完成后,协议栈实例B向APP发送的TCP连接建立成功的指示,从而当监听到该指示时,根据上述分流策略,确定TCP数据包分流到的协议栈实例C,在协议栈实例C上创建socket Y,以当TCP数据包分流到协议栈实例C时,协议栈实例C利用所述socket Y,对所述TCP数据包进行协议处理。其中,TCP数据包是利用所述TCP连接传输的数据包。
本实施例中,通过根据网卡的分流策略信息确定数据包的分流策略,根据该数据包的分流策略,确定第一协议栈实例,进而在第一协议栈实例上创建目标socket,以便当数据包分流到第一协议栈实例时,第一协议栈实例利用目标socket对该数据包进行协议处理,避免出现APP指定的针对目标socket的协议栈实例与网卡指定的协议栈实例冲突的情况,解决了无法对该数据包进行协议处理的技术问题。
图3为本发明一实施例提供的基于并行协议栈实例的数据包处理装置的结构示意图,如图3所示,包括:获得模块31、确定模块30和第一创建模块32。
获得模块31,用于获得网卡的分流策略信息。
其中,分流策略信息中包括网卡的分流策略。
确定模块30,与获得模块31连接,用于根据所述分流策略信息确定数据包的分流策略。
其中,数据包的分流策略用于指示数据包所分流到的第一协议栈实例。
可选的,基于分流策略信息中还包括如下信息中的至少一种:硬件配置信息、软件配置信息,则确定模块30具体用于根据所述硬件配置信息和/或所述软件配置信息对所述网卡的分流策略进行调整,确定所述数据包的分流策略。
第一创建模块32,与确定模块30连接,用于监听到应用APP创建目标套接字socket的指示时,根据所述数据包的分流策略,确定第一协议栈实例,在所述第一协议栈实例上创建所述目标socket,以便所述第一协议栈实例利用所述目标socket对所述数据包进行协议处理。
本实施例中,通过根据网卡的分流策略信息确定数据包的分流策略, 根据该数据包的分流策略,确定第一协议栈实例,进而在第一协议栈实例上创建目标socket,以便当数据包分流到第一协议栈实例时,第一协议栈实例利用目标socket对该数据包进行协议处理,避免出现APP指定的针对目标socket的协议栈实例与网卡指定的协议栈实例冲突的情况,解决了无法对该数据包进行协议处理的技术问题。
图4A为本发明另一实施例提供的一种基于并行协议栈实例的数据包处理装置的结构示意图,如图4A所示,在上一实施例的基础上,分流策略信息包括网卡的分流策略,还包括如下信息中的至少一种:硬件配置信息、软件配置信息,则本实施例中的装置进一步包括写卡模块41、识别模块42和发送模块43。
写卡模块41,与确定模块30连接,用于将所述数据包的分流策略写入所述网卡,以使所述网卡根据所述数据包的分流策略,将所述数据包分流到所述第一协议栈实例。
发送模块43,与第一创建模块32连接,用于向应用APP发送已创建目标socket的伪结果。返回伪结果是指并不真正在协议栈实例上创建socket,而是给应用返回伪的结果,通知其是否创建成功。后续再进行创建socket的工作。
识别模块42,与第一创建模块32连接,用于识别所述APP指示创建所述目标socket时所采用的方式。
基于此,可选的,第一创建模块32具体用于若采用的方式为调用connect方式,则根据所述数据包的分流策略,确定将所述数据包分流到所述第一协议栈实例,在所述第一协议栈实例上创建所述目标socket。
进一步,图4B为本发明另一实施例提供的另一种基于并行协议栈实例的数据包处理装置的结构示意图,在图4所示的基于并行协议栈实例的数据包处理装置的基础上,该装置进一步包括:第二创建模块44、第一处理模块45和第二处理模块46。
第二创建模块44,与识别模块42连接,用于若采用的方式为调用bind方式和/或listen方式,则在所述并行协议栈实例所包括的各协议栈实例上均创建所述目标socket。
基于此,可选的,第一创建模块32具体用于监听到所述创建了所述目标socket的各协议栈实例中的一个协议栈实例发送的TCP连接建立成功的 指示,根据所述数据包的分流策略,确定所述第一协议栈实例,在所述第一协议栈实例上创建所述目标socket。
第一处理模块45,与第二创建模块44和第一创建模块32连接,用于监听到所述创建了所述目标socket的各协议栈实例中的一个协议栈实例发送的TCP连接建立成功的指示之前,若收到TCP类型的数据包且未监听到TCP连接建立成功的指示,则由收到所述TCP类型的数据包的协议栈实例对所述TCP类型的数据包进行协议处理。
第二处理模块46,与第二创建模块44连接,用于在所述并行协议栈实例所包括的各协议栈实例上均创建所述目标socket之后,若收到UDP类型的数据包,则由收到所述UDP类型数据包的协议栈实例对所述UDP类型的数据包进行协议处理。
本实施例提供的另一种并行协议栈实例的数据包处理装置的各功能模块可用于执行图1和图2所示的并行协议栈实例的数据包处理方法流程,其具体工作原理不再赘述,详见方法实施例的描述。
本实施例中,通过根据网卡的分流策略信息确定数据包的分流策略,根据该数据包的分流策略,确定第一协议栈实例,进而在第一协议栈实例上创建目标socket,以便当数据包分流到第一协议栈实例时,第一协议栈实例利用目标socket对该数据包进行协议处理,避免出现APP指定的针对目标socket的协议栈实例与网卡指定的协议栈实例冲突的情况,解决了无法对该数据包进行协议处理的技术问题。
图5为本发明又一实施例提供的基于并行协议栈实例的数据包处理装置的结构示意图,如图5所示,本实施例中的装置可以包括:存储器51、通信接口52和处理器53。
存储器51,用于存放程序。具体的,程序可以包括程序代码,上述程序代码包括计算机操作指令。存储器51可能包含高速RAM存储器,也可能还包括非易失性存储器(non-volatile memory),例如至少一个磁盘存储器。
通信接口52,用于获得网卡的分流策略信息;其中,分流策略信息中包括网卡的分流策略,分流策略信息中还包括如下信息中的至少一种:硬件配置信息、软件配置信息。
可选的,通信接口52具体用于获得网卡的硬件配置信息、软件配置信 息和网卡的分流策略,以使处理器53根据所述硬件配置信息和/或所述软件配置信息对所述网卡的分流策略进行调整,获得所述数据包的分流策略。则通信接口52从处理器53获得所述数据包的分流策略之后,将所述分流策略写入所述网卡,以使所述网卡根据所述数据包的分流策略,将所述数据包分流到所述第一协议栈实例。
处理器53,用于执行存储器51存放的程序,以用于:根据所述分流策略信息确定数据包的分流策略;监听到应用APP创建目标套接字socket的指示时,根据所述数据包的分流策略,确定第一协议栈实例,在所述第一协议栈实例上创建所述目标socket,以便所述第一协议栈实例利用所述目标socket对所述数据包进行协议处理。
可选的,处理器53具体用于根据所述硬件配置信息和/或所述软件配置信息对所述网卡的分流策略进行调整,获得所述数据包的分流策略。当通信接口52监听到应用APP指示创建所述目标socket时,识别所述APP指示创建所述目标socket时,所采用的方式。若采用的方式为调用connect方式,则APP为客户端模式,则根据所述分流策略,确定将所述目标数据包分流到所述第一协议栈实例,在所述第一协议栈实例上创建所述目标socket。
和/或可选的,处理器53具体用于根据所述硬件配置信息和/或所述软件配置信息对所述网卡的分流策略进行调整,获得所述数据包的分流策略。当通信接口52监听到应用APP指示创建所述目标socket时,识别所述APP指示创建所述目标socket时,所采用的方式。若采用的方式为调用bind方式和/或listen方式,则APP为服务器端模式,则在所述并行协议栈实例所包括的各协议栈实例上均创建所述目标socket。监听到所述创建了所述目标socket的各协议栈实例中的第二协议栈实例发送的TCP连接建立成功的指示,根据所述分流策略,确定将所述数据包分流到所述第一协议栈实例,在所述第一协议栈实例上创建所述目标socket。若收到UDP类型的数据包,则由收到所述UDP类型数据包的协议栈实例对所述UDP类型的数据包进行协议处理;若收到TCP类型的数据包且未监听到TCP连接建立成功的指示,则由收到所述TCP类型的数据包的协议栈实例对所述TCP类型的数据包进行协议处理。
基于此,通信接口52还用于监听APP的指示和第二协议栈实例发送的指示,以及监听到应用APP指示创建所述目标socket之后,向所述APP 发送已创建所述目标socket的伪结果。返回伪结果是指并不真正在协议栈实例上创建socket,而是给应用返回伪的结果,通知其是否创建成功。后续再进行创建socket的工作。
本实施例提供的并行协议栈实例的数据包处理装置的各功能模块可用于执行图1和图2所示的并行协议栈实例的数据包处理方法流程,其具体工作原理不再赘述,详见方法实施例的描述。
本实施例中,通过根据网卡的分流策略信息确定数据包的分流策略,根据该数据包的分流策略,确定第一协议栈实例,进而在第一协议栈实例上创建目标socket,以便当数据包分流到第一协议栈实例时,第一协议栈实例利用目标socket对该数据包进行协议处理,避免出现APP指定的针对目标socket的协议栈实例与网卡指定的协议栈实例冲突的情况,解决了无法对该数据包进行协议处理的技术问题。
本领域普通技术人员可以理解:实现上述各方法实施例的全部或部分步骤可以通过程序指令相关的硬件来完成。前述的程序可以存储于一计算机可读取存储介质中。该程序在执行时,执行包括上述各方法实施例的步骤;而前述的存储介质包括:ROM、RAM、磁碟或者光盘等各种可以存储程序代码的介质。
最后应说明的是:以上各实施例仅用以说明本发明的技术方案,而非对其限制;尽管参照前述各实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分或者全部技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明各实施例技术方案的范围。

Claims (16)

  1. 一种基于并行协议栈实例的数据包处理方法,其特征在于,包括:
    获得网卡的分流策略信息;
    根据所述分流策略信息确定数据包的分流策略;
    监听到应用APP创建目标套接字socket的指示时,根据所述数据包的分流策略,确定第一协议栈实例,在所述第一协议栈实例上创建所述目标socket,以便所述第一协议栈实例利用所述目标socket对所述数据包进行协议处理。
  2. 根据权利要求1所述的方法,其特征在于,所述分流策略信息中包括网卡的分流策略。
  3. 根据权利要求2所述的方法,其特征在于,所述分流策略信息中还包括如下信息中的至少一种:硬件配置信息、软件配置信息;则
    所述根据所述分类策略信息确定数据包的分流策略,包括:
    根据所述硬件配置信息和/或所述软件配置信息对所述网卡的分流策略进行调整,确定所述数据包的分流策略;
    所述方法还包括:
    将所述数据包的分流策略写入所述网卡,以使所述网卡根据所述数据包的分流策略,将所述数据包分流到所述第一协议栈实例。
  4. 根据权利要求1所述的方法,其特征在于,所述根据所述数据包的分流策略,确定第一协议栈实例,在所述第一协议栈实例上创建所述目标socket之前,还包括:
    识别所述APP指示创建所述目标socket时所采用的方式;
    则所述根据所述数据包的分流策略,确定第一协议栈实例,在所述第一协议栈实例上创建所述目标socket,包括:
    若所述采用的方式为调用连接connect方式,则根据所述数据包的分流策略,确定所述第一协议栈实例,在所述第一协议栈实例上创建所述目标socket。
  5. 根据权利要求1所述的方法,其特征在于,所述根据所述数据包的分流策略,确定第一协议栈实例,在所述第一协议栈实例上创建所述目标 socket之前,还包括:
    识别所述APP指示创建所述目标socket时所采用的方式;
    若所述采用的方式为调用绑定bind方式和/或监听listen方式,则
    在所述并行协议栈实例所包括的各协议栈实例上均创建所述目标socket;
    所述根据所述数据包的分流策略,确定第一协议栈实例,在所述第一协议栈实例上创建所述目标socket,包括:
    监听到所述创建了所述目标socket的各协议栈实例中的一个协议栈实例发送的TCP连接建立成功的指示,根据所述数据包的分流策略,确定所述第一协议栈实例,在所述第一协议栈实例上创建所述目标socket。
  6. 根据权利要求5所述的方法,其特征在于,所述监听到所述创建了所述目标socket的各协议栈实例中的一个协议栈实例发送的TCP连接建立成功的指示之前,还包括:
    若收到TCP类型的数据包且未监听到TCP连接建立成功的指示,则由收到所述TCP类型的数据包的协议栈实例对所述TCP类型的数据包进行协议处理。
  7. 根据权利要求5所述的方法,其特征在于,在所述并行协议栈实例所包括的各协议栈实例上均创建所述目标socket之后,还包括:
    若收到UDP类型的数据包,则由收到所述UDP类型数据包的协议栈实例对所述UDP类型的数据包进行协议处理。
  8. 根据权利要求1所述的方法,其特征在于,所述监听到应用APP创建目标套接字socket的指示之后,还包括:
    向所述应用APP发送已创建所述目标socket的伪结果。
  9. 一种基于并行协议栈实例的数据包处理装置,其特征在于,包括:
    获得模块,用于获得网卡的分流策略信息;
    确定模块,用于根据所述分流策略信息确定数据包的分流策略;
    第一创建模块,用于监听到应用APP创建目标套接字socket的指示时,根据所述数据包的分流策略,确定第一协议栈实例,在所述第一协议栈实例上创建所述目标socket,以便所述第一协议栈实例利用所述目标socket对所述数据包进行协议处理。
  10. 根据权利要求9所述的装置,其特征在于,所述分流策略信息中包 括网卡的分流策略。
  11. 根据权利要求10所述的装置,其特征在于,所述分流策略信息中还包括如下信息中的至少一种:硬件配置信息、软件配置信息;则
    所述确定模块,具体用于根据所述硬件配置信息和/或所述软件配置信息对所述网卡的分流策略进行调整,确定所述数据包的分流策略;
    所述装置还包括:
    写卡模块,用于将所述数据包的分流策略写入所述网卡,以使所述网卡根据所述数据包的分流策略,将所述数据包分流到所述第一协议栈实例。
  12. 根据权利要求9所述的装置,其特征在于,所述装置,还包括:
    识别模块,用于识别所述APP指示创建所述目标socket时所采用的方式;
    则所述第一创建模块,具体用于若所述采用的方式为调用连接connect方式,则根据所述数据包的分流策略,确定所述第一协议栈实例,在所述第一协议栈实例上创建所述目标socket。
  13. 根据权利要求9所述的装置,其特征在于,所述装置,还包括:
    识别模块,用于识别所述APP指示创建所述目标socket时所采用的方式;
    第二创建模块,用于若所述采用的方式为调用绑定bind方式和/或监听listen方式,则在所述并行协议栈实例所包括的各协议栈实例上均创建所述目标socket;
    所述第一创建模块,具体用于监听到所述创建了所述目标socket的各协议栈实例中的一个协议栈实例发送的TCP连接建立成功的指示,根据所述数据包的分流策略,确定所述第一协议栈实例,在所述第一协议栈实例上创建所述目标socket。
  14. 根据权利要求13所述的装置,其特征在于,所述装置,还包括:
    第一处理模块,用于监听到所述创建了所述目标socket的各协议栈实例中的一个协议栈实例发送的TCP连接建立成功的指示之前,若收到TCP类型的数据包且未监听到TCP连接建立成功的指示,则由收到所述TCP类型的数据包的协议栈实例对所述TCP类型的数据包进行协议处理。
  15. 根据权利要求13所述的装置,其特征在于,所述装置,还包括:
    第二处理模块,用于在所述并行协议栈实例所包括的各协议栈实例上均 创建所述目标socket之后,若收到UDP类型的数据包,则由收到所述UDP类型数据包的协议栈实例对所述UDP类型的数据包进行协议处理。
  16. 根据权利要求9所述的装置,其特征在于,所述装置,还包括:
    发送模块,用于向所述应用APP发送已创建所述目标socket的伪结果。
PCT/CN2014/091727 2014-01-29 2014-11-20 基于并行协议栈实例的数据包处理方法和装置 WO2015113437A1 (zh)

Priority Applications (3)

Application Number Priority Date Filing Date Title
EP14880886.8A EP3091707A4 (en) 2014-01-29 2014-11-20 METHOD FOR PROCESSING DATA PACKETS AND DEVICE BASED ON PARALLEL PROTOCOL BATTERY INSTANCES
KR1020167023319A KR20160113671A (ko) 2014-01-29 2014-11-20 병렬 프로토콜 스택 인스턴스에 기초하여 데이터 패킷을 처리하는 방법 및 장치
US15/222,741 US10218820B2 (en) 2014-01-29 2016-07-28 Method and apparatus for processing data packet based on parallel protocol stack instances

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201410043932.4 2014-01-29
CN201410043932.4A CN104811432A (zh) 2014-01-29 2014-01-29 基于并行协议栈实例的数据包处理方法和装置

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US15/222,741 Continuation US10218820B2 (en) 2014-01-29 2016-07-28 Method and apparatus for processing data packet based on parallel protocol stack instances

Publications (1)

Publication Number Publication Date
WO2015113437A1 true WO2015113437A1 (zh) 2015-08-06

Family

ID=53695929

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2014/091727 WO2015113437A1 (zh) 2014-01-29 2014-11-20 基于并行协议栈实例的数据包处理方法和装置

Country Status (5)

Country Link
US (1) US10218820B2 (zh)
EP (1) EP3091707A4 (zh)
KR (1) KR20160113671A (zh)
CN (1) CN104811432A (zh)
WO (1) WO2015113437A1 (zh)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2017509055A (ja) * 2014-01-29 2017-03-30 華為技術有限公司Huawei Technologies Co.,Ltd. 並列プロトコル・スタック・インスタンスに基づいてデータパケットを処理する方法および装置
CN107612840A (zh) * 2017-09-26 2018-01-19 东软集团股份有限公司 一种四层负载均衡设备的数据处理方法及装置
WO2019024997A1 (en) 2017-08-03 2019-02-07 Pierburg Pump Technology Gmbh PALLET PUMP AND LUBRICATION VARIABLE FLOW RATE

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR102083142B1 (ko) 2016-09-05 2020-03-02 현대모비스 주식회사 커튼 에어백 장치

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN201805555U (zh) * 2010-05-14 2011-04-20 中兴通讯股份有限公司 一种双模移动终端
CN102769575A (zh) * 2012-08-08 2012-11-07 南京中兴特种软件有限责任公司 一种用于智能网卡的流量负载均衡方法
CN102904729A (zh) * 2012-10-26 2013-01-30 曙光信息产业(北京)有限公司 根据协议、端口分流支持多应用的智能加速网卡

Family Cites Families (18)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6757731B1 (en) 1999-02-25 2004-06-29 Nortel Networks Limited Apparatus and method for interfacing multiple protocol stacks in a communication network
US7647414B2 (en) * 2002-07-26 2010-01-12 Broadcom Corporation System and method for managing multiple stack environments
US8230090B2 (en) * 2002-09-11 2012-07-24 Broadcom Corporation System and method for TCP offloading and uploading
CA2408474A1 (en) * 2002-10-17 2004-04-17 Ibm Canada Limited-Ibm Canada Limitee Apparatus and method for enabling efficient multi-protocol database transaction processing
US7802001B1 (en) * 2002-10-18 2010-09-21 Astute Networks, Inc. System and method for flow control within a stateful protocol processing system
US7562145B2 (en) * 2003-08-28 2009-07-14 International Business Machines Corporation Application instance level workload distribution affinities
US7734829B2 (en) 2004-06-09 2010-06-08 Emc Corporation Methods, systems, and computer program products for transparently controlling communications between network applications and a plurality of network communications protocol stacks using deferred protocol stack association
US7808983B2 (en) * 2004-07-08 2010-10-05 Cisco Technology, Inc. Network device architecture for centralized packet processing
US20070242671A1 (en) 2006-04-13 2007-10-18 Christenson David A Method and Apparatus for Routing Data Packets Between Different Internet Communications Stack Instances
US7885257B2 (en) 2006-07-20 2011-02-08 Oracle America, Inc. Multiple virtual network stack instances using virtual network interface cards
DE602007013652D1 (de) * 2006-08-04 2011-05-19 Canon Kk Kommunikationsvorrichtung und Kommunikationssteuerungsverfahren
US7715428B2 (en) 2007-01-31 2010-05-11 International Business Machines Corporation Multicore communication processing
US8793117B1 (en) * 2008-04-16 2014-07-29 Scalable Network Technologies, Inc. System and method for virtualization of networking system software via emulation
CN101415025B (zh) 2008-09-28 2011-09-07 中控科技集团有限公司 网络数据处理的方法、装置和系统
US8849972B2 (en) 2008-11-25 2014-09-30 Polycom, Inc. Method and system for dispatching received sessions between a plurality of instances of an application using the same IP port
CN101931584A (zh) 2009-06-22 2010-12-29 中兴通讯股份有限公司 支持同一系统中多种协议栈之间数据转发的方法和系统
CN101656677B (zh) 2009-09-18 2011-11-16 杭州迪普科技有限公司 一种报文分流处理方法及装置
CN102523208A (zh) 2011-12-06 2012-06-27 无锡聚云科技有限公司 多核架构下的应用层协议并行处理方法

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN201805555U (zh) * 2010-05-14 2011-04-20 中兴通讯股份有限公司 一种双模移动终端
CN102769575A (zh) * 2012-08-08 2012-11-07 南京中兴特种软件有限责任公司 一种用于智能网卡的流量负载均衡方法
CN102904729A (zh) * 2012-10-26 2013-01-30 曙光信息产业(北京)有限公司 根据协议、端口分流支持多应用的智能加速网卡

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2017509055A (ja) * 2014-01-29 2017-03-30 華為技術有限公司Huawei Technologies Co.,Ltd. 並列プロトコル・スタック・インスタンスに基づいてデータパケットを処理する方法および装置
US10069947B2 (en) 2014-01-29 2018-09-04 Huawei Technologies Co., Ltd. Method and apparatus for processing data packet based on parallel protocol stack instances
WO2019024997A1 (en) 2017-08-03 2019-02-07 Pierburg Pump Technology Gmbh PALLET PUMP AND LUBRICATION VARIABLE FLOW RATE
CN107612840A (zh) * 2017-09-26 2018-01-19 东软集团股份有限公司 一种四层负载均衡设备的数据处理方法及装置
CN107612840B (zh) * 2017-09-26 2020-10-30 东软集团股份有限公司 一种四层负载均衡设备的数据处理方法及装置

Also Published As

Publication number Publication date
CN104811432A (zh) 2015-07-29
EP3091707A1 (en) 2016-11-09
KR20160113671A (ko) 2016-09-30
US20160337482A1 (en) 2016-11-17
US10218820B2 (en) 2019-02-26
EP3091707A4 (en) 2016-12-21

Similar Documents

Publication Publication Date Title
JP6091724B2 (ja) リンクのヘルスチェック方法および装置
US10257024B2 (en) Data transmission method, apparatus, and terminal
US9872205B2 (en) Method and system for sideband communication architecture for supporting manageability over wireless LAN (WLAN)
WO2015067118A1 (zh) 多协议栈负载均衡方法及装置
US9787589B2 (en) Filtering of unsolicited incoming packets to electronic devices
US10027781B2 (en) TCP link configuration method, apparatus, and device
CN103051605B (zh) 一种数据包处理方法、装置和系统
CN102404396B (zh) P2p流量识别方法、装置、设备和系统
US20160065479A1 (en) Distributed input/output architecture for network functions virtualization
WO2014000297A1 (zh) 虚拟端口监控方法和设备
WO2015188579A1 (zh) 分布式虚拟防火墙装置、方法及防火墙控制器
JP2009266202A5 (ja) 情報処理装置、情報処理装置の制御方法、セッション管理システム並びにプログラム
WO2015113437A1 (zh) 基于并行协议栈实例的数据包处理方法和装置
CN103746977A (zh) 一种Linux服务器的连接方法和装置
WO2016107424A1 (zh) 一种链路状态检测方法、装置和系统
JP2007006477A (ja) 装置及び方法
US9560141B2 (en) Method and apparatus of performing peer-to-peer communication establishment
WO2015113435A1 (zh) 基于并行协议栈实例的数据包处理方法和装置
WO2018024200A1 (zh) 虚拟桌面组播控制方法、终端、代理终端及云桌面服务器
CN115277806A (zh) 云桌面连接方法、装置和设备
WO2020187295A1 (zh) 异常主机的监控
CN107493254B (zh) Tcp报文转发的方法、装置和系统
WO2016188081A1 (zh) 扩展端口的处理方法、装置及系统
WO2017219667A1 (zh) Mss的修改方法、装置及系统
JP2013123211A5 (zh)

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 14880886

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2016549161

Country of ref document: JP

Kind code of ref document: A

NENP Non-entry into the national phase

Ref country code: DE

REEP Request for entry into the european phase

Ref document number: 2014880886

Country of ref document: EP

WWE Wipo information: entry into national phase

Ref document number: 2014880886

Country of ref document: EP

ENP Entry into the national phase

Ref document number: 20167023319

Country of ref document: KR

Kind code of ref document: A