An application layer message transmission method, system and DPU device based on improved TCP transmission protocol architecture
By adding command words to the TCP socket, the protocol stack parses the application layer messages in advance, solving the problem of CPU overhead caused by multiple reads in the prior art, and achieving efficient application layer message transmission.
Patent Information
- Application Number
- CN202411265594.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-10
- Publication Date
- 2025-04-04
- Estimated Expiration
- 2044-09-10
AI Technical Summary
During the application-level message transmission process, multiple reads will increase CPU overhead and affect the server's processing capabilities.
By adding command words to the TCP socket, the protocol stack receives structural information of application layer messages based on pre-configured command words, thereby parsing the complete application layer messages in advance in the reception buffer, reducing the number of interactions between the application and the protocol stack.
It realizes one-time reading of application-level messages, reduces CPU usage and overhead, and improves the transmission efficiency of application-level messages.
Smart Images

Figure CN118984342B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of application layer message transmission, and in particular to an application layer message transmission method, system and DPU device based on an improved TCP transmission protocol architecture. Background Art
[0002] TCP (Transmission Control Protocol) is a connection-oriented, reliable transport layer protocol used to transmit data on the network. It provides reliable data transmission and ensures the reliability and order of data through mechanisms such as sequence number, confirmation, retransmission and window control. Figure 2 This is the existing TCP / IP network transmission protocol architecture diagram, which shows the communication between host A and host B at the application layer. For example, host A and host B use WeChat to send messages to each other, based on the TCP / IP five-layer structure and forwarded by the router. The transport layer is a layer in the computer network architecture, which is located above the network layer and below the application layer. The main responsibility of the transport layer is to provide end-to-end data transmission services to ensure that data can be reliably and effectively transmitted from the source end (SourceEndpoint) to the destination end (DestinationEndpoint). The "end" here usually refers to the application on the computer, not the physical device (computer or router). Specifically, end-to-end refers to two application processes that need to communicate through the network. The data transmission between them will be routed and forwarded through the network layer (such as the IP layer). The network layer is responsible for the host-to-host communication service (Host-to-Host), and the transport layer is responsible for sending data to the specified application.
[0003] The existing TCP transport protocol architecture is as follows Figure 3 As shown, Figure 3 In the application, a TCP connection is created through a TCP socket, and the sending buffer (txbuf) and receiving buffer (rxbuf) of the TCP socket are used to interact with the protocol stack to achieve the purpose of sending and receiving data. Generally speaking, an application needs to process multiple complete application layer messages (which can be abbreviated as msg1, msg2, msg3), etc. in one connection. Multiple complete application layer messages are connected end to end to form a data stream and transmitted in the buffer (buf, which can be txbuf or rxbuf).
[0004] Since TCP data is in stream mode, when the application reads data through the TCP socket, it obtains a string of buf byte streams. It is necessary to parse the received buf byte stream according to the structural information of the application layer message to determine whether the message is complete. If it is incomplete, it is necessary to repeatedly call the read interface and splice the buf byte streams obtained by read several times until a complete application layer message is obtained. This mode interacts with the protocol stack multiple times, increasing the CPU overhead of the application and the application processing delay. Figure 5 The present invention is a flowchart of an application layer receiving an application layer message under an existing TCP transmission protocol architecture.
[0005] In summary, the problem with the prior art is that during the application layer message transmission process, the multiple reading process will increase the CPU server overhead, and the server occupation will also affect the CPU processing other tasks. Summary of the invention
[0006] In view of this, the embodiments of the present invention provide an application layer message transmission method, system and DPU device based on an improved TCP transmission protocol architecture to eliminate or improve one or more defects existing in the prior art.
[0007] One aspect of the present invention provides an application layer message transmission method based on an improved TCP transmission protocol architecture, wherein the application transmits messages through a TCP connection established by a TCP socket, wherein the TCP socket includes a receiving buffer and a message buffer, and the method comprises the following steps: a protocol stack receives structural information of an application layer message sent by the application based on a command word pre-configured in the TCP socket; wherein the structural information of the application layer message is used to instruct a parsing module of the protocol stack to parse a complete application layer message from a TCP data stream; during the application layer message sending process, multiple application layer messages are connected end to end to form a TCP data stream, and the protocol stack transmits the TCP data stream in a network through a TCP connection link; during the application layer message receiving process, the protocol stack stores the received TCP data stream in a message buffer, and the protocol stack parses the TCP data stream stored in the message buffer based on the structural information of the received application layer message, and stores the complete application layer message obtained after parsing in the receiving buffer, so that the application and the protocol stack interactively access the receiving buffer to obtain the complete application layer message at one time.
[0008] In some embodiments of the present invention, the command word is formed by configuring parameters on a TCP socket using a setopt function, the command word is added to the TCP socket, and the structural information of the application layer message is sent to the protocol stack using the command word.
[0009] In some embodiments of the present invention, the type of the command word is a parse command word; and the protocol stack is a protocol stack located on a DPU device.
[0010] In some embodiments of the present invention, the parse command word is subjected to command line parsing by any one of an argparse parser, a getopt parser or an optparse parser.
[0011] In some embodiments of the present invention, the method further includes: the application reads a single complete application layer message from the receiving buffer of the TCP socket at one time by calling a read interface.
[0012] In some embodiments of the present invention, the protocol stack includes a TCP protocol and an IP protocol, and the TCP data stream is transmitted in the network through a TCP connection according to the TCP protocol and the IP protocol.
[0013] In some embodiments of the present invention, the TCP socket also includes a sending buffer, and the setting options of the TCP socket include a transport layer TCP protocol, pointers and sizes of a sending buffer, a receiving buffer and a message buffer, and the command word.
[0014] Another aspect of the present invention provides an application layer message transmission system based on an improved TCP transmission protocol architecture, comprising a processor, a memory, and a computer program / instruction stored in the memory, wherein the processor is used to execute the computer program / instruction, and when the computer program / instruction is executed, the system implements the steps of the method described in any one of the above embodiments.
[0015] Another aspect of the present invention provides a DPU device for application layer message transmission, the DPU device includes a protocol stack, and an application deployed on the DPU device transmits messages through a TCP connection established by a TCP socket, and the TCP socket includes a receiving buffer and a message buffer; the protocol stack on the DPU device is used to receive structural information of application layer messages issued by the application based on a command word pre-configured in the TCP socket; wherein the structural information of the application layer message is used to instruct a parsing module of the protocol stack to parse a complete application layer message from a TCP data stream; during the application layer message sending process, multiple application layer messages are connected end to end to form a TCP data stream, and the protocol stack on the DPU device is used to transmit the TCP data stream in a network through a TCP connection link; during the application layer message receiving process, the protocol stack on the DPU device is used to store the received TCP data stream in a message buffer, parse the TCP data stream stored in the message buffer based on the structural information of the received application layer message, and store the complete application layer message obtained after parsing in the receiving buffer, so that the application and the protocol stack interactively access the receiving buffer to obtain the complete application layer message at one time.
[0016] In some embodiments of the present invention, the command word is formed by configuring parameters on the TCP socket using the setopt function, the command word is added to the TCP socket, and the structural information of the application layer message is sent to the protocol stack using the command word.
[0017] The application layer message transmission method, system and DPU device based on the improved TCP transmission protocol architecture of the present invention can send the structural information of the application layer message to the protocol stack through the TCP socket and command word. The protocol stack parses the TCP data stream to be transmitted based on the structural information that has been known in advance. Therefore, during the reading process of the receiving party, the complete application layer message can be parsed in advance and stored in the receiving buffer, so that the application layer only needs to access the receiving buffer once to obtain a complete application layer message, which can reduce the occupancy of the CPU and improve the transmission efficiency of the application layer message.
[0018] Additional advantages, purposes, and features of the present invention will be described in part in the following description, and will become apparent to those skilled in the art after studying the following, or may be learned from the practice of the present invention. The purposes and other advantages of the present invention may be achieved and obtained by the structures specifically indicated in the specification and the accompanying drawings.
[0019] Those skilled in the art will appreciate that the objectives and advantages that can be achieved with the present invention are not limited to the above specific description, and the above and other objectives that can be achieved by the present invention will be more clearly understood from the following detailed description. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] The drawings described herein are used to provide a further understanding of the present invention, constitute a part of the present application, and do not constitute a limitation of the present invention. In the drawings:
[0021] Figure 1 The present invention is an application layer message transmission flow chart based on the improved TCP transmission protocol architecture in one embodiment of the present invention.
[0022] Figure 2 This is a diagram of the existing TCP / IP network transmission protocol architecture.
[0023] Figure 3 This is a schematic diagram of the existing TCP transmission protocol architecture.
[0024] Figure 4 The figure shows the structure of the existing TCP data stream passing through the receiving buffer.
[0025] Figure 5 The present invention is a flowchart of an application layer receiving an application layer message under an existing TCP transmission protocol architecture.
[0026] Figure 6Schematic diagram of an improved TCP transmission protocol architecture in one embodiment of the present invention.
[0027] Figure 7 It is a schematic diagram of an improved TCP transmission protocol architecture in another embodiment of the present invention. DETAILED DESCRIPTION
[0028] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the embodiments and the accompanying drawings. Here, the illustrative embodiments of the present invention and their descriptions are used to explain the present invention, but are not intended to limit the present invention.
[0029] It should also be noted that, in order to avoid obscuring the present invention due to unnecessary details, only structures and / or processing steps closely related to the solutions according to the present invention are shown in the accompanying drawings, while other details that are not closely related to the present invention are omitted.
[0030] It should be emphasized that the term “include / comprises” when used herein refers to the presence of features, elements, steps or components, but does not exclude the presence or addition of one or more other features, elements, steps or components.
[0031] It should also be noted that, unless otherwise specified, the term “connection” herein may refer not only to a direct connection but also to an indirect connection involving an intermediate.
[0032] Hereinafter, embodiments of the present invention will be described with reference to the accompanying drawings. In the accompanying drawings, the same reference numerals represent the same or similar components, or the same or similar steps.
[0033] In the prior art, the read interface used is part of the system call, which is used to read data from the data source and store the read data in the specified user buffer (buf). The system call requires the CPU to execute. When network communication is performed, TCP connection or UDP connection, the data transmitted by the network will be processed by the protocol stack. The protocol stack is responsible for receiving data from the network and putting the received data into the receiving buffer of the TCP socket. When the read call occurs, the protocol stack will read the data from the receiving buffer. In addition, if the protocol stack is empty and the socket is set to blocking mode, the read call will wait until there is data to read in the buffer.
[0034] Among them, the protocol stack is an important part of the computer network protocol suite, responsible for providing end-to-end communication between hosts. Specifically, the transport layer protocol stack mainly includes two core protocols: TCP protocol and UDP protocol. The popular understanding of the protocol stack is that it uses code to implement the library function of the protocol content, so every time the protocol content is executed, the protocol stack needs to be accessed. The protocol stack configures a memory space rxBuf and txBuf for serial port transmission and reception, respectively, as the receiving buffer and sending buffer.
[0035] The purpose of the present invention is to propose an improved TCP transmission protocol architecture, and to transmit application layer information based on the improved TCP transmission protocol architecture. Specifically, the present application proposes a message buffer (msgbuf), which can assemble a complete application layer message in the protocol stack using the message buffer, so that the application can read the complete application layer message at one time. Therefore, when the application reads the application layer message through the TCP socket, the number of interactions between the application and the protocol stack can be reduced, the CPU overhead can be reduced, and the processing delay of the application can be reduced.
[0036] Figure 1 The present invention is an application layer message transmission flow chart based on an improved TCP transmission protocol architecture in one embodiment of the present invention. In the improved TCP transmission protocol architecture proposed in the present invention, a TCP connection established by a TCP socket is used for message transmission. The TCP socket includes a receiving buffer and a message buffer. The application layer message transmission method proposed in the present invention includes the following steps:
[0037] Step S110: The protocol stack receives the structural information of the application layer message sent by the application based on the command word pre-configured in the TCP socket; wherein the structural information of the application layer message is used to instruct the parsing module of the protocol stack to parse the complete application layer message from the TCP data stream.
[0038] In the specific implementation process, the unit of transmission in the transport layer is the message segment, and the complete application layer message is the message. The message is segmented and encapsulated into segments and handed over to the transport layer. TCP socket (tcp socket) is a standard network program interface in the operating system. Using sockets can facilitate network data transmission. Among them, TCP sockets can be used to create tcp connections, socket rxbuf cache and txbuf cache. Sockets are used to distinguish network communications and connections between different program processes. TCP socket is an encapsulation of TCP / IP protocol. Socket itself is not a protocol, but a calling interface (API). Through tcp sockets, we can use TCP / IP protocol.
[0039] In some embodiments of the present invention, the command word type is a parse command word. The parse command word is a command line parameter expression method applicable to the Linux system, and is parsed using the parse parser to help developers process and obtain command line parameters when writing scripts or programs, making it more convenient and flexible.
[0040] In some embodiments of the present invention, the protocol stack may be a protocol stack located on a DPU device. The present invention is a general technology that can be applied to technical solutions for TCP transmission based on a protocol stack under different hardware conditions. Optionally, the protocol stack may be a protocol stack located on a DPU device. Using the TCP transmission technology proposed by the present invention can accelerate the TCP transmission performance of the protocol stack on the DPU.
[0041] In the specific implementation process, the structure of the application layer message can be set according to the understanding of those skilled in the art. The application layer protocol specifies the structure of the message, and each field can be parsed according to the protocol.
[0042] Step S120: During the application layer message sending process, multiple application layer messages are connected end to end to form a TCP data stream, and the protocol stack transmits the TCP data stream in the network through a TCP connection link.
[0043] Step S130: During the application layer message reception process, the protocol stack stores the received TCP data stream in the message buffer. The protocol stack parses the TCP data stream stored in the message buffer based on the structural information of the received application layer message, and stores the complete application layer message obtained after parsing in the receiving buffer, so that the application and the protocol stack can interactively access the receiving buffer to obtain the complete application layer message at one time. In the specific implementation process, the TCP data stream is received by using the protocol stack.
[0044] By adopting the application layer message transmission method based on the improved TCP transmission protocol architecture proposed in the present invention, the TCP socket and command word can send the structural information of the application layer message to the protocol stack. The protocol stack parses the TCP data stream to be transmitted based on the structural information that has been known in advance. Therefore, during the reading process of the receiver, the complete application layer message can be parsed in advance and stored in the receiving buffer, so that the application layer only needs to access the receiving buffer once to obtain a complete application layer message, which can reduce the occupancy of the CPU and improve the transmission efficiency of the application layer message.
[0045] In some embodiments of the present invention, the command word is formed by configuring parameters on a TCP socket using a setopt function, the command word is added to the TCP socket, and the structure information of the application layer message is sent to the protocol stack using the command word. The setopt function may be a curl_setopt function, which is a function used to set cURL transfer options.
[0046] By adopting the embodiment of the invention, the transmission of structural information of application layer messages can be realized by parameter configuration.
[0047] Furthermore, in some embodiments of the present invention, the aforementioned parse command word may be parsed through any one of the argparse parser, the getopt parser or the optparse parser.
[0048] By adopting the embodiment of the invention, the argparse parser, the getopt parser or the optparse parser can be configured in the parsing module of the protocol stack, thereby realizing the parsing of the parse command word as the command word.
[0049] In the specific implementation process, when the protocol stack receives the TCP data stream, it parses out the relevant fields according to the structure of the application layer message. The protocol stack has a preset application layer message parsing module, which can parse out each field according to the protocol.
[0050] like Figure 6 As shown, Figure 6 The schematic diagram of the improved TCP transport protocol architecture in one embodiment of the present invention is shown in FIG. The application (app) sends the structural information of the application layer message to the protocol stack through the parse command word of the setopt API, and the parse command word is sent through the TCP socket. The protocol stack uses the setopt function to add a parse command word to process, parse the structural information of the application layer message carried by the parse command word, and the parsing module included in the protocol stack uses the structural information to parse the received TCP data stream to obtain each complete application layer message.
[0051] in, Figure 6The setopt process mentioned refers to the option setting of the protocol stack, allowing the program to configure various parameters on the socket to meet different network communication requirements. Specifically, for the setopt process of the protocol stack socket, the setsockopt function is used to set the socket options. The socket options include but are not limited to the protocol layer (transport layer TCP protocol), the name of the option to be set (optname), the pointer to the buffer containing the new option value, and the size of the buffer. In the present invention, it is proposed to add a parse command word to represent the structural information of the application layer message.
[0052] In the specific implementation process, the Socket options can be set through the setsockopt function. The setsockopt function is an API used to set socket options in Socket programming, which allows the program to configure various parameters on the socket to meet different network communication requirements.
[0053] In some embodiments of the present invention, the method further includes: the application reads a single complete application layer message from the receiving buffer of the TCP socket at one time by calling a read interface.
[0054] By adopting the embodiment of the invention, a complete application layer message can be read at one time.
[0055] In some embodiments of the present invention, the protocol stack includes the TCP protocol and the IP protocol, and the TCP data stream is transmitted in the network through the TCP connection according to the TCP protocol and the IP protocol. TCP (Transmission Control Protocol) is a connection-oriented, reliable, byte-stream-based transport layer communication protocol. The UDP protocol, i.e., the User Datagram Protocol, is a transport layer protocol widely used in computer networks. In the implementation process of the present invention, the structural information of the application layer message existing in the protocol stack can be synchronized through the TCP connection.
[0056] In some embodiments of the present invention, the TCP socket also includes a sending buffer, and the setting options of the TCP socket include a transport layer TCP protocol, pointers and sizes of a sending buffer, a receiving buffer and a message buffer, and the command word.
[0057] By adopting the embodiment of the invention, the implementation path of the method for transmitting application layer messages packet by packet is more clearly understood.
[0058] Figure 7This is a schematic diagram of the improved TCP transport protocol architecture in another embodiment of the present invention. A message buffer (msgbuf cache) is added under the receiving buffer (rxbuf cache). The message buffer is used to cache incomplete application layer messages. The protocol stack parses the TCP data stream in the message buffer, and after forming a complete application layer message, it waits until the application layer message in the cache of the message buffer is complete and then sends it to the message buffer. Thus, it is ensured that the application can read a complete application layer message from the receiving buffer at one time.
[0059] Corresponding to the above method, the present invention also provides an application layer message transmission system based on an improved TCP transmission protocol architecture, the system comprising a computer device, the computer device comprising a processor and a memory, the memory storing computer instructions, the processor being used to execute the computer instructions stored in the memory, and when the computer instructions are executed by the processor, the system implements the steps of the method described above.
[0060] Another aspect of the present invention further proposes a DPU device for application layer message transmission, the DPU device includes a protocol stack, and the application deployed on the DPU device transmits messages through a TCP connection established by a TCP socket, and the TCP socket includes a receiving buffer and a message buffer.
[0061] The functions of the DPU device in different TCP transmission stages include:
[0062] (1) The protocol stack on the DPU device is used to receive the structural information of the application layer message sent by the application based on the command word pre-configured in the TCP socket; wherein the structural information of the application layer message is used to instruct the parsing module of the protocol stack to parse the complete application layer message from the TCP data stream.
[0063] (2) During the application layer message sending process, multiple application layer messages are connected end to end to form a TCP data stream, and the protocol stack on the DPU device is used to transmit the TCP data stream in the network through a TCP connection link.
[0064] (3) During the application layer message reception process, the protocol stack on the DPU device is used to store the received TCP data stream into a message buffer, parse the TCP data stream stored in the message buffer based on the structural information of the received application layer message, and store the complete application layer message obtained after parsing into the receiving buffer, so that the application and the protocol stack can interactively access the receiving buffer to obtain the complete application layer message at one time.
[0065] Furthermore, for the protocol stack on the DPU device, the command word is formed by configuring parameters on the TCP socket using the setopt function, the command word is added to the TCP socket, and the structural information of the application layer message is sent to the protocol stack using the command word.
[0066] In summary, the application layer message transmission method, system and DPU device based on the improved TCP transmission protocol architecture proposed in the present invention can send the structural information of the application layer message to the protocol stack through the TCP socket and command word. The protocol stack parses the TCP data stream to be transmitted based on the structural information that has been known in advance. Therefore, during the reading process of the receiving party, the complete application layer message can be parsed in advance and stored in the receiving buffer, so that the application layer only needs to access the receiving buffer once to obtain a complete application layer message. The application can read the application layer message with fewer interactions with the protocol stack, which can reduce the occupancy of the CPU, reduce the CPU overhead, improve the transmission efficiency of the application layer message, and reduce the delay of application processing.
[0067] The method proposed by the present invention can send and receive complete application layer messages at one time, and the mechanism can be summarized as a msgbuf mechanism. The present invention introduces a message buffer (msgbuf cache), which is added to a receiving buffer (rxbuf cache) for parsing a TCP data stream, forming a complete application layer message, and then sending it to the receiving buffer, thereby realizing the reception or sending of a complete application layer message only through a single interaction of the application protocol stack, and the mechanism can be named as a msgbuf mechanism.
[0068] It should be understood by those skilled in the art that the exemplary components, systems and methods described in conjunction with the embodiments disclosed herein can be implemented in hardware, software or a combination of the two. Whether it is performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention. When implemented in hardware, it can be, for example, an electronic circuit, an application specific integrated circuit (ASIC), appropriate firmware, a plug-in, a function card, etc. When implemented in software, the elements of the present invention are programs or code segments used to perform the required tasks. The program or code segment can be stored in a machine-readable medium, or transmitted on a transmission medium or a communication link via a data signal carried in a carrier.
[0069] It should be clear that the present invention is not limited to the specific configuration and processing described above and shown in the figures. For the sake of simplicity, a detailed description of the known method is omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present invention is not limited to the specific steps described and shown, and those skilled in the art can make various changes, modifications and additions, or change the order between the steps after understanding the spirit of the present invention.
[0070] In the present invention, features described and / or illustrated for one embodiment may be used in the same or similar manner in one or more other embodiments, and / or combined with features of other embodiments or replace features of other embodiments.
[0071] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the embodiments of the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. An application layer message transmission method based on an improved TCP transmission protocol architecture, characterized in that: The method uses a TCP connection established by a TCP socket to transmit messages, wherein the TCP socket includes a receiving buffer and a message buffer, and the method includes the following steps: The protocol stack receives the structural information of the application layer message sent by the application based on the command word pre-configured in the TCP socket; wherein the structural information of the application layer message is used to instruct the parsing module of the protocol stack to parse the complete application layer message from the TCP data stream; In the process of sending application layer messages, multiple application layer messages are connected end to end to form a TCP data stream, and the protocol stack transmits the TCP data stream in the network through a TCP connection link; During the application layer message reception process, the protocol stack stores the received TCP data stream in the message buffer. The protocol stack parses the TCP data stream stored in the message buffer based on the structural information of the received application layer message, and stores the complete application layer message obtained after parsing in the receiving buffer, so that the application and the protocol stack can interactively access the receiving buffer to obtain the complete application layer message at one time.
2. The method according to claim 1, characterized in that The command word is formed by configuring parameters on the TCP socket using the setopt function, the command word is added to the TCP socket, and the structural information of the application layer message is sent to the protocol stack using the command word.
3. The method according to claim 2, characterized in that The type of the command word is a parse command word; the protocol stack is a protocol stack located on a DPU device.
4. The method according to claim 3, characterized in that The parse command word is subjected to command line parsing by any one of the argparse parser, the getopt parser or the optparse parser.
5. The method according to claim 1, characterized in that The method further includes: the application reads a single complete application layer message from the receiving buffer of the TCP socket at one time by calling a read interface.
6. The method according to claim 1, characterized in that The protocol stack includes the TCP protocol and the IP protocol, and the TCP data stream is transmitted in the network through a TCP connection according to the TCP protocol and the IP protocol.
7. The method according to claim 1, characterized in that The TCP socket also includes a sending buffer. The setting options of the TCP socket include the transport layer TCP protocol, pointers and sizes of the sending buffer, receiving buffer and message buffer, and the command word.
8. An application layer message transmission system based on an improved TCP transmission protocol architecture, comprising a processor, a memory and a computer program / instruction stored in the memory, characterized in that: The processor is used to execute the computer program / instructions, and when the computer program / instructions are executed, the system implements the steps of the method according to any one of claims 1 to 7.
9. A DPU device for application layer message transmission, characterized in that: The DPU device includes a protocol stack, and the application deployed on the DPU device transmits messages through a TCP connection established by a TCP socket, and the TCP socket includes a receiving buffer and a message buffer; The protocol stack on the DPU device is used to receive the structural information of the application layer message sent by the application based on the command word pre-configured in the TCP socket; wherein the structural information of the application layer message is used to instruct the parsing module of the protocol stack to parse the complete application layer message from the TCP data stream; In the process of sending application layer messages, multiple application layer messages are connected end to end to form a TCP data stream, and the protocol stack on the DPU device is used to transmit the TCP data stream in the network through the TCP connection link; During the application layer message reception process, the protocol stack on the DPU device is used to store the received TCP data stream into the message buffer, parse the TCP data stream stored in the message buffer based on the structural information of the received application layer message, and store the complete application layer message obtained after parsing into the receiving buffer, so that the application and the protocol stack can interactively access the receiving buffer to obtain the complete application layer message at one time.
10. The DPU device according to claim 9, characterized in that: The command word is formed by configuring parameters on the TCP socket using the setopt function, the command word is added to the TCP socket, and the structural information of the application layer message is sent to the protocol stack using the command word.
Citation Information
Patent Citations
High-speed socket receiving method and system
CN111970128A
Data processing method and system
CN116781650A