WO2011057525A1 - 基于包处理的http服务器及其数据处理方法 - Google Patents
基于包处理的http服务器及其数据处理方法 Download PDFInfo
- Publication number
- WO2011057525A1 WO2011057525A1 PCT/CN2010/077486 CN2010077486W WO2011057525A1 WO 2011057525 A1 WO2011057525 A1 WO 2011057525A1 CN 2010077486 W CN2010077486 W CN 2010077486W WO 2011057525 A1 WO2011057525 A1 WO 2011057525A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- data
- http server
- packet
- data packet
- network card
- Prior art date
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/02—Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L69/00—Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
- H04L69/16—Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP]
- H04L69/161—Implementation details of TCP/IP or UDP/IP stack architecture; Specification of modified or new header fields
Definitions
- the present invention relates to the field of network technologies, and in particular, to an HTTP server based on packet processing and a data processing method thereof.
- Hypertext Transfer Protocol ('HTTP') is a transport protocol for transferring hypertext from a web server to a local browser.
- the current HTTP server is based on the Transmission Control Protocol (Transmission Control). Protocol, abbreviated as 'TCP', as shown in FIG. 3, the specific process of the HTTP server processing the data packet sent by the client is: the data packet sent by the client to the HTTP server is first processed by the network card driver.
- 'TCP' Transmission Control Protocol
- the network data frame is restored to an IP data packet; then the network card driver delivers the IP data packet to the protocol stack of the kernel, and the protocol stack parses the data packet, and when the TCP data packet is parsed, the serial number check and sort operations are performed, Ensure the reliability of TCP transmission; after the protocol stack is processed, the TCP socket of the application layer receives the message and parses it on the data content of the TCP protocol to obtain the HTTP data and enter the relevant logic processing of HTTP.
- the above HTTP server processes the data packets sent by the client through layer layer resolution, layer-by-layer copying, and the processing logic is very complicated. Therefore, the number of connections supported by the HTTP server is very limited. For some small data volumes and applications that need to frequently interact with the server, when the current HTTP server faces a large number of requests from the client, the protocol stack consumes a large amount of system resources, so performance low.
- the invention provides an HTTP server based on packet processing, which uses raw sockets to process data packets of a communication port.
- the HTTP server receives the data sent by the client, and copies the data to the memory buffer of the application layer in a memory mapping manner after being processed by the network card driver.
- the network card driver can be used to convert the received network data frame into an IP data packet.
- the HTTP server constructs an IP data packet at the application layer, and sends the IP data packet to the IP protocol stack, and the IP data packet is sent to the network card driver by the IP protocol stack, and the network card driver processes the IP data packet and sends it to the client.
- the network card driver can be used to convert IP data packets into network data frames.
- the invention also provides an HTTP server data processing method, comprising: the HTTP server processing the data packet of the communication port by using the original socket.
- the step of the HTTP server processing the data packet of the communication port by using the original socket may include:
- the HTTP server receives the data sent by the client, and copies the data to the memory buffer of the application layer in a memory mapping manner after being processed by the network card driver.
- the step of the network card driving process may specifically be: the network card driver converts the received network data frame into an IP data packet.
- the step of processing, by the HTTP server, the data packet of the communication port by using the original socket may further include:
- the HTTP server constructs an IP data packet at the application layer, and sends the IP data packet to the IP protocol stack, and the IP data packet is sent to the network card driver by the IP protocol stack, and the network card driver processes the IP data packet and sends it to the client.
- the step of processing the IP data packet by the network card driver may specifically be: the network card driver converts the IP data packet into a network data frame.
- An HTTP server based on packet processing comprising: a network card driver, receiving a data packet; a memory buffer copying the data packet processed by the network card driver in a memory mapping manner; and an HTTP server, using the original socket pair data The package is processed.
- the network card driver converts the received network data frame into an IP data packet.
- the packet processing-based HTTP server further includes an IP protocol stack; the HTTP server constructs an IP data packet at an application layer, and sends the IP data packet to an IP protocol stack, and the IP protocol stack transmits IP data.
- the packet is sent to the network card driver, and the network card driver processes the IP data packet and sends it to the client.
- the network card driver is configured to convert IP data packets into network data frames.
- the above-mentioned packet processing-based HTTP server and its data processing method process the data packet of the communication port by using the original socket, and when the HTTP server receives the data sent by the client, it is not necessary to hand the data to the protocol stack, but directly
- the data is copied to the memory buffer of the application layer in a memory-mapped manner, and the HTTP server can directly use the data, and does not need to go through other processing of the socket, thereby reducing a large part of system resource consumption.
- the data packet Since the data processing of the HTTP server is implemented on the IP protocol level, the data packet does not enter the TCP protocol stack, thereby improving the response speed of the HTTP server, enabling the HTTP server to process the massive data request of the client; on the other hand, the HTTP server returns
- the IP data packet is directly constructed by the application layer, and the IP data packet is sent to the IP protocol stack, and then sent by the IP protocol stack to the network card driver, because the performance of the data transmission of the original socket is much higher than that.
- TCP sockets are sent for data, which also improves performance.
- FIG. 1 is a schematic diagram of a client interacting with an HTTP server in an embodiment
- FIG. 2 is a schematic diagram of an HTTP server data processing method in an embodiment
- FIG. 3 is a schematic diagram of a prior art HTTP server data processing method.
- the communication mode is a request-response mode.
- the client sends a SYN packet to the HTTP server
- the HTTP server sends a SYN+ACK packet to the client
- the client sends a packet with the content GET to the HTTP server
- the HTTP server returns a packet with a content of 200 OK to the client;
- the SYN packet is a handshake packet
- the ACK is a response packet
- the FIN is an end packet.
- the above steps (1) to (3) are typical TCP three-way handshake procedures
- the GET packet is a request packet of the HTTP protocol, 200.
- OK is the content package returned by the HTTP server to the client.
- the first communication between the client and the HTTP server includes three data packets (SYN packets, ACK packets, and GET packets) sent by the client to the HTTP server and two data packets (ACK+SYN) that the HTTP server responds to the client.
- Handshake reply packet and ACK+FIN with content of 200 OK's business-related response package).
- the packet processing-based HTTP server processes the data packets of the communication port using the original socket.
- the communication port here is the default port 80.
- the original socket is a different network communication method than the TCP socket. It can collect the data packets of the link layer. Because the link layer is the IP protocol layer, IP. Above the protocol layer is the TCP protocol layer, and the original socket is the lowest level application programming interface (Application The Programming Interface (referred to as 'API') is therefore able to collect packets from all layers.
- 'API' Application The Programming Interface
- the packet processing-based HTTP server of the present invention includes: a network card driver, an IP protocol stack, a memory buffer, and an HTTP server;
- the network card driver receives the data packet, and converts the received network data frame into an IP data packet and converts the IP data packet into a network data frame;
- the memory buffer copies the data packet processed by the network card driver in a memory mapping manner
- HTTP The server uses the original socket to process the data packet, constructs an IP data packet in the application layer, and sends the IP data packet to the IP protocol stack, and the IP protocol stack sends the IP data packet to the network card driver, and the network card driver drives the IP data packet. After processing, send it to the client.
- the process of processing the data packet of the communication port by using the original socket by the HTTP server includes a process of receiving data sent by the client and a process of returning data to the client.
- the process of the HTTP server receiving the data sent by the client is as follows: (1) The client sends data to the network card driver.
- the network card driver receives the network data frame transmitted by the client through the network; (2) the network card driver converts the received network data frame into an IP data packet; and (3) the network card driver processes the obtained IP data packet into a memory mapped The way to copy the data to the memory buffer of the application layer. After IP packets are copied into memory, the HTTP server can use these packets directly without having to go through other socket processing.
- the HTTP server responds to the client as follows: (1) The HTTP server constructs an IP packet at the application layer and sends the IP packet to the IP protocol stack; (2) The IP protocol stack sends the IP packet to NIC driver; (3) NIC driver to process IP packets. Specifically, the network card driver converts IP data packets into network data frames. (4) The network card driver sends the network data frame to the client through the network.
- the above-described packet processing-based HTTP server and its data processing method are widely applicable to HTTP applications having a large number of requests and a very small amount of data transmission per request and response because of the high number of connections that can be supported.
- statistics server such as counters on online advertising
- chat server such as HTTP-based two-person chat or chat room
- verification code server such as generating complex captcha pictures
- avatar image server such as processing GZIP compressed Images smaller than 1460 bytes
- other HTTP applications with less than 1460 bytes of request and response content are widely applicable to HTTP applications having a large number of requests and a very small amount of data transmission per request and response because of the high number of connections that can be supported.
- chat server such as HTTP-based two-person chat or chat room
- verification code server such as generating complex captcha pictures
- avatar image server such as processing GZIP compressed Images smaller than 1460 bytes
- other HTTP applications with less than 1460 bytes of request and response content such as processing GZIP compressed Images smaller than 1460 bytes
Description
Claims (14)
- 一种基于包处理的HTTP服务器,其特征在于,所述HTTP服务器采用原始套接字对通讯端口的数据包进行处理。
- 根据权利要求1所述的基于包处理的HTTP服务器,其特征在于,所述HTTP服务器接收客户端发送的数据,经网卡驱动处理后以内存映射的方式将数据拷贝到应用层的内存缓冲区中。
- 根据权利要求2所述的基于包处理的HTTP服务器,其特征在于,所述网卡驱动用于将接收到的网络数据帧转换为IP数据包。
- 根据权利要求1至3中任一项所述的基于包处理的HTTP服务器,其特征在于,所述HTTP服务器在应用层构造IP数据包,并将所述IP数据包发送给IP协议栈,由IP协议栈将IP数据包发送给网卡驱动,所述网卡驱动对IP数据包进行处理后发送给客户端。
- 根据权利要求4所述的基于包处理的HTTP服务器,其特征在于,所述网卡驱动用于将IP数据包转换为网络数据帧。
- 一种HTTP服务器数据处理方法,其特征在于,所述方法包括:所述HTTP服务器采用原始套接字对通讯端口的数据包进行处理。
- 根据权利要求6所述的HTTP服务器数据处理方法,其特征在于,所述HTTP服务器采用原始套接字对通讯端口的数据包进行处理的步骤包括:所述HTTP服务器接收客户端发送的数据,经网卡驱动处理后以内存映射的方式将数据拷贝到应用层的内存缓冲区中。
- 根据权利要求7所述的HTTP服务器数据处理方法,其特征在于,所述网卡驱动处理的步骤具体是:所述网卡驱动将接收到的网络数据帧转换为IP数据包。
- 根据权利要求6至8中任一项所述的 HTTP服务器数据处理方法,其特征在于,所述HTTP服务器采用原始套接字对通讯端口的数据包进行处理的步骤还包括:所述HTTP服务器在应用层构造IP数据包,并将所述IP数据包发送给IP协议栈,由IP协议栈将IP数据包发送给网卡驱动,所述网卡驱动对IP数据包进行处理后发送给客户端。
- 根据权利要求9所述的HTTP服务器数据处理方法,其特征在于,所述网卡驱动对IP数据包进行处理的步骤具体是:所述网卡驱动将IP数据包转换为网络数据帧。
- 一种基于包处理的HTTP服务器,其特征在于,包括:网卡驱动, 接收数据包;内存缓冲区,以内存映射的方式拷贝经所述网卡驱动处理后的数据包;以及HTTP 服务器,采用原始套接字对数据包进行处理。
- 根据权利要求11所述的基于包处理的HTTP服务器,其特征在于,所述网卡驱动将接收到的网络数据帧转换为IP数据包。
- 根据权利要求11或12所述的基于包处理的HTTP服务器,其特征在于,进一步包括IP协议栈;所述HTTP服务器在应用层构造IP数据包,并将所述IP数据包发送给IP协议栈,由IP协议栈将IP数据包发送给网卡驱动,所述网卡驱动对IP数据包进行处理后发送给客户端。
- 根据权利要求13所述的基于包处理的HTTP服务器,其特征在于,所述网卡驱动用于将IP数据包转换为网络数据帧。
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN200910193804.7 | 2009-11-10 | ||
CN200910193804.7A CN102055774B (zh) | 2009-11-10 | 2009-11-10 | 基于包处理的http服务器及其数据处理方法 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2011057525A1 true WO2011057525A1 (zh) | 2011-05-19 |
Family
ID=43959700
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2010/077486 WO2011057525A1 (zh) | 2009-11-10 | 2010-09-29 | 基于包处理的http服务器及其数据处理方法 |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN102055774B (zh) |
WO (1) | WO2011057525A1 (zh) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109194747A (zh) * | 2018-09-10 | 2019-01-11 | 四川长虹电器股份有限公司 | 云环境下的流量镜像方法及系统 |
Families Citing this family (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102202094A (zh) * | 2011-05-13 | 2011-09-28 | 中兴通讯股份有限公司 | 一种基于http的业务请求处理方法及装置 |
CN102685243B (zh) * | 2012-05-22 | 2015-03-04 | 清华大学 | 一种轻量级tcp/ip协议栈的实现方法 |
CN102984025B (zh) * | 2012-11-23 | 2015-09-30 | 华为技术有限公司 | 网关设备虚拟隧道性能的测试方法、装置及系统 |
KR102244824B1 (ko) | 2014-08-28 | 2021-04-27 | 삼성전자주식회사 | 전자 장치 및 전자 장치에서 ip 네트워크 서비스 방법 |
CN106706657A (zh) * | 2015-11-17 | 2017-05-24 | 北大方正集团有限公司 | 基于喷墨印刷的在线检测系统及方法 |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1435773A (zh) * | 2002-01-29 | 2003-08-13 | 深圳市中兴通讯股份有限公司上海第二研究所 | 基于多处理机的虚拟网卡系统及其通信方法 |
US7313600B1 (en) * | 2000-11-30 | 2007-12-25 | Cisco Technology, Inc. | Arrangement for emulating an unlimited number of IP devices without assignment of IP addresses |
-
2009
- 2009-11-10 CN CN200910193804.7A patent/CN102055774B/zh active Active
-
2010
- 2010-09-29 WO PCT/CN2010/077486 patent/WO2011057525A1/zh active Application Filing
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7313600B1 (en) * | 2000-11-30 | 2007-12-25 | Cisco Technology, Inc. | Arrangement for emulating an unlimited number of IP devices without assignment of IP addresses |
CN1435773A (zh) * | 2002-01-29 | 2003-08-13 | 深圳市中兴通讯股份有限公司上海第二研究所 | 基于多处理机的虚拟网卡系统及其通信方法 |
Non-Patent Citations (1)
Title |
---|
ZHANG WEI CHENG ET AL.: "The Application of Raw Socket Programming in Embedded Internet Communication Protocol.", APPLICATION RESEARCH OF COMPUTERS., vol. 2002, no. 10, December 2002 (2002-12-01), pages 29 - 30, 74 * |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109194747A (zh) * | 2018-09-10 | 2019-01-11 | 四川长虹电器股份有限公司 | 云环境下的流量镜像方法及系统 |
Also Published As
Publication number | Publication date |
---|---|
CN102055774A (zh) | 2011-05-11 |
CN102055774B (zh) | 2015-09-16 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US8458280B2 (en) | Apparatus and method for packet transmission over a high speed network supporting remote direct memory access operations | |
US7716731B2 (en) | Method for dynamically tunneling over an unreliable protocol or a reliable protocol, based on network conditions | |
US7817634B2 (en) | Network with a constrained usage model supporting remote direct memory access | |
TWI677222B (zh) | 應用於伺服器負載均衡中的連接建立方法及裝置 | |
KR100255501B1 (ko) | 전송 제어 프로토콜 글루를 통한 세션 및 전송 계층 프록시 개선 방법 | |
US7761588B2 (en) | System and article of manufacture for enabling communication between nodes | |
JP4903270B2 (ja) | 冗長の接続を除去する方法 | |
US7966380B2 (en) | Method, system, and program for forwarding messages between nodes | |
WO2011057525A1 (zh) | 基于包处理的http服务器及其数据处理方法 | |
US20060031518A1 (en) | Method and apparatus for transparent negotiations | |
US20070025374A1 (en) | TCP normalization engine | |
WO2006133651A1 (en) | Communication method between communication devices and communication apparatus | |
JP2006279394A (ja) | セッション中継装置、セッション中継方法およびプログラム | |
Natarajan et al. | SCTP: An innovative transport layer protocol for the web | |
AU2007320794A1 (en) | Selective session interception method | |
JP6444988B2 (ja) | Httpを利用する通信システム | |
KR20050026881A (ko) | 페일오버 이벤트를 지원하는 네트워크 상태 객체의 다중오프로드용 방법 및 컴퓨터 프로그램 제품 | |
JP3988475B2 (ja) | 送信装置、受信装置およびそれらの方法 | |
WO2015150975A1 (en) | Remote asymmetric tcp connection offload over rdma | |
CN105791239B (zh) | 一种tcp中间人处理方法 | |
CN101064671A (zh) | 一种基于p2p技术的网络视频信号的处理方法 | |
CN100423513C (zh) | 一种tcp连接的合并方法 | |
Dalessandro et al. | AcceleratingWeb Protocols Using RDMA | |
JP2010153944A (ja) | 通信システム、受信装置、送信装置、および通信方法 | |
CN111314447B (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: 10829489 Country of ref document: EP Kind code of ref document: A1 |
|
WWE | Wipo information: entry into national phase |
Ref document number: 3286/CHENP/2012 Country of ref document: IN |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
32PN | Ep: public notification in the ep bulletin as address of the adressee cannot be established |
Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 10/10/2012) |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 10829489 Country of ref document: EP Kind code of ref document: A1 |