CN115499393A - TCP connection message processing method based on network interface chip - Google Patents

TCP connection message processing method based on network interface chip Download PDF

Info

Publication number
CN115499393A
CN115499393A CN202211069309.7A CN202211069309A CN115499393A CN 115499393 A CN115499393 A CN 115499393A CN 202211069309 A CN202211069309 A CN 202211069309A CN 115499393 A CN115499393 A CN 115499393A
Authority
CN
China
Prior art keywords
message data
physical address
address
minimum physical
sequence number
Prior art date
Legal status (The legal status 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 status listed.)
Pending
Application number
CN202211069309.7A
Other languages
Chinese (zh)
Inventor
罗南宁
李雪亮
朱峰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Netforward Microelectronic Co ltd
Original Assignee
Shenzhen Netforward Microelectronic Co ltd
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 Shenzhen Netforward Microelectronic Co ltd filed Critical Shenzhen Netforward Microelectronic Co ltd
Priority to CN202211069309.7A priority Critical patent/CN115499393A/en
Publication of CN115499393A publication Critical patent/CN115499393A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L49/00Packet switching elements
    • H04L49/90Buffering arrangements
    • H04L49/9057Arrangements for supporting packet reassembly or resequencing
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L49/00Packet switching elements
    • H04L49/90Buffering arrangements
    • H04L49/901Buffering arrangements using storage descriptor, e.g. read or write pointers
    • 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]
    • 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/22Parsing or analysis of headers

Abstract

The invention discloses a TCP connection message processing method and a device based on a network interface chip, wherein the method comprises the following steps: receiving message data, analyzing the message data, and acquiring a message data serial number; comparing the serial number of the received message data with the serial number of the minimum message data currently stored in the physical address; if the serial number of the received message data is greater than the serial number of the minimum message data stored in the physical address, the storage address of the received message data is the minimum physical address plus a first difference value; and if the serial number of the received message data is smaller than the serial number of the message data stored at the minimum physical address, storing the received message data in the address with the minimum physical address, adding a second difference value to the minimum physical address by using the new storage address of the message data originally stored at the minimum physical address, and updating the storage addresses of other message data which are sequenced. The message data sorting is processed through hardware, so that the CPU resource is saved, the CPU energy consumption is reduced, and the message sorting efficiency is improved.

Description

TCP connection message processing method based on network interface chip
Technical Field
The invention belongs to the technical field of network communication, and particularly relates to a TCP connection message processing method and device based on a network interface chip, computer equipment and a computer readable storage medium.
Background
With the development of information technology, the amount of network communication data increases day by day, and the requirement for devices for processing the data is higher and higher, so how to promote the processing of the network communication data in equivalent devices is extremely important.
When the current communication data is sorted by using the CPU, because the data volume is huge, a lot of resources of the CPU are consumed, but the sorting operation has the characteristics of high repeatability and low algorithm difficulty, and the CPU has limited resources, which should be more applied to the calculation with higher difficulty, and how to process the work with high repeatability, huge data volume and low algorithm difficulty by other methods is a problem that needs to be solved urgently at present.
Disclosure of Invention
Based on the above, the invention provides a method, a device, equipment and a storage medium for processing TCP connection messages based on a network interface chip, which solve the problems that the current communication data uses a CPU for sequencing processing, the CPU resource consumption is high, and the processing efficiency is low.
The embodiment of the invention provides a TCP connection message processing method based on a network interface chip, which comprises the following steps:
receiving message data, analyzing the message data, and acquiring a serial number of the message data;
comparing the sequence number of the received message data with the sequence number of the message data with the minimum physical address currently stored in the storage address; the received first message data is stored in the storage address with the minimum physical address;
if the serial number of the received message data is greater than the serial number of the message data stored in the minimum physical address, the storage address of the received message data is the minimum physical address plus a first difference value;
and if the sequence number of the received message data is smaller than the sequence number of the message data stored at the minimum physical address, storing the received message data in the storage address at the minimum physical address, adding a second difference value to the minimum physical address of the new storage address of the message data originally stored at the minimum physical address, and updating the new storage address of other sorted message data based on the new storage address of the message data originally stored at the minimum physical address.
Further, the updating the new storage address of the other sorted message data based on the new storage address of the message data originally stored at the physical address with the smallest physical address specifically includes:
and updating the minimum physical address in the storage addresses of the other sequenced message data into the minimum physical address plus a second difference value.
Further, the first difference is obtained by subtracting the serial number of the message data stored in the physical address from the serial number of the received message data;
and the second difference is stored in the sequence number of the message data with the minimum physical address minus the sequence number of the received message data.
Further, the receiving the message data, analyzing the message data, and before acquiring the sequence number of the message data, further includes:
and updating a pointer of a storage address in the network card, and marking a physical address of the storage address used for storing the message data in the network card.
Further, the receiving the message data, analyzing the message data, and before acquiring the sequence number of the message data, the method further includes:
and controlling the size of a message receiving memory in the network card according to the current communication state of the application layer, and adjusting the size of a window in a TCP protocol.
Further, initializing a head pointer and a tail pointer of the memory for receiving messages in the network card, and adjusting the value of the tail pointer according to the size of the allocated memory after initialization is completed.
Further, initializing the head pointer and the tail pointer of the memory for receiving the message in the network card specifically includes:
storing the received message data into the allocated memory address, and accumulating the allocated memory address for the head pointer and the tail pointer values of the memory, wherein the head pointer and the tail pointer of the memory for receiving the message in the network card are initialized to be zero for the first time.
The embodiment of the invention also provides a TCP connection message processing device based on the network interface chip, which comprises:
a message data sequence number obtaining module, configured to receive message data, parse the message data, and obtain a sequence number of the message data;
the message data sorting module is used for comparing the sequence number of the received message data with the sequence number of the message data with the minimum physical address stored in the storage address; the received first message data is stored in the storage address with the minimum physical address;
if the serial number of the received message data is greater than the serial number of the message data stored in the minimum physical address, the storage address of the received message data is the minimum physical address plus a first difference value;
and if the sequence number of the received message data is smaller than the sequence number of the message data stored in the minimum physical address, storing the received message data in the minimum physical address, adding a second difference value to the minimum physical address of the new memory address of the message data originally stored in the minimum physical address, and updating the new memory addresses of other sorted message data based on the new memory address of the message data originally stored in the minimum physical address.
An embodiment of the present invention further provides a computer device, where the computer device includes:
a memory: for storing a computer program;
a processor: the method is used for executing the computer program to realize the TCP connection message processing method based on the network interface chip.
The embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the method for processing a TCP connection packet based on a network interface chip is implemented.
The invention provides a TCP connection message processing method based on a network interface chip, which comprises the steps of receiving message data, analyzing the message data and acquiring the serial number of the message data; comparing the sequence number of the received message data with the sequence number of the message data with the minimum physical address currently stored in the storage address; the received first message data is stored in the storage address with the minimum physical address; if the serial number of the received message data is greater than the serial number of the message data stored in the minimum physical address, the storage address of the received message data is the minimum physical address plus a first difference value; and if the sequence number of the received message data is smaller than the sequence number of the message data stored in the minimum physical address, storing the received message data in the minimum physical address, adding a second difference value to the minimum physical address of the new memory address of the message data originally stored in the minimum physical address, and updating the new memory addresses of other sorted message data based on the new memory address of the message data originally stored in the minimum physical address. The method and the device have the advantages that the work of sequencing the message data by the CPU originally needed is sent to the hardware end, and the message data is sequenced at the hardware end, so that the CPU resource is saved, the CPU energy consumption is reduced, and the message data sequencing efficiency is improved. And a parallel processing mode can be adopted in hardware, more data can be processed within the same time, the method is specially used for processing message data sequencing, the pertinence is strong, the message data sequencing efficiency is further guaranteed, and the overall efficiency of communication work is improved. The TCP connection message processing device, the equipment and the storage medium based on the network interface chip can also realize the effects.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art that other drawings can be obtained according to these drawings without creative efforts.
Fig. 1 is a schematic diagram of a network interface chip-based TCP connection packet processing method implemented in a central processing unit-hardware end system according to an embodiment of the present invention;
fig. 2 is a schematic flowchart of a TCP connection packet processing method based on a network interface chip according to an embodiment of the present invention;
fig. 3 is a block diagram of a structure of a TCP connection packet processing apparatus based on a network interface chip according to an embodiment of the present invention;
FIG. 4 is a block diagram of a message data sorting module of FIG. 3;
fig. 5 is a block diagram of another TCP connection packet processing apparatus based on a network interface chip according to an embodiment of the present invention;
fig. 6 is a block diagram of a structure of another TCP connection packet processing apparatus based on a network interface chip according to an embodiment of the present invention;
FIG. 7 is a block diagram of the regulation module of FIG. 6;
FIG. 8 is a schematic structural diagram of a computer device according to an embodiment of the present disclosure;
FIG. 9 discloses a computer storage medium for an embodiment of the invention.
Detailed Description
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs; the terminology used in the description of the application herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application; the terms "including" and "having," and any variations thereof, in the description and claims of this application and the description of the above figures are intended to cover non-exclusive inclusions. The terms "first," "second," and the like in the description and claims of this application or in the above-described drawings are used for distinguishing between different objects and not for describing a particular order.
Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the application. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. It is explicitly and implicitly understood by one skilled in the art that the embodiments described herein can be combined with other embodiments.
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application. All other embodiments, which can be obtained by a person skilled in the art without making any creative effort based on the embodiments in the present invention, belong to the protection scope of the present invention.
In the following description, suffixes such as "module", "component", or "unit" used to indicate elements are used only for facilitating the description of the present application, and do not have a specific meaning per se.
As shown in fig. 1, a method for processing a TCP connection packet based on a network interface chip according to an embodiment of the present invention may be implemented in a central processing unit-hardware end system 100. The cpu-hardware end system 100 includes a cpu 101, a hardware end 102, and a network 103. The central processor 101 communicates with the hardware terminal 102 via a network 103. The central processing unit 101 is configured to receive message data for communication, encode the received message data through a TCP (Transmission Control Protocol), associate the message data with a corresponding sending sequence number, and send the encoded message data to the hardware terminal 102. The hardware end 102 is configured to receive the encoded message data, decode the encoded message data according to the TCP to obtain a sequence number of the message data, and compare the received sequence number of the message data with a sequence number of a message data with a minimum physical address currently stored in the storage address; the received first message data is stored in the storage address with the minimum physical address; if the serial number of the received message data is greater than the serial number of the message data stored in the minimum physical address, the storage address of the received message data is the minimum physical address plus a first difference value; and if the sequence number of the received message data is smaller than the sequence number of the message data stored in the minimum physical address, storing the received message data in the minimum physical address, adding a second difference value to the minimum physical address of the new memory address of the message data originally stored in the minimum physical address, and updating the new memory addresses of other sorted message data based on the new memory address of the message data originally stored in the minimum physical address. By traversing all the message data, the final sorting result of the message data is obtained, and the final sorting result is sent to the central processing unit 101.
In the embodiment of the invention, after receiving the message data of communication, the central processing unit 101 encodes the message data through the TCP, so that the message data has a corresponding sending sequence number, associates the sending sequence number of the message data with a sending interface of the central processing unit 101, then sends the encoded message data to the hardware end 102, the hardware end 102 receives the encoded message data, decodes the encoded message data according to the TCP to obtain the sequence number of the message data, and compares the received sequence number of the message data with the minimum physical address currently stored in the storage address; the received first message data is stored in the storage address with the minimum physical address; if the serial number of the received message data is greater than the serial number of the message data stored in the minimum physical address, the storage address of the received message data is the minimum physical address plus a first difference value; and if the sequence number of the received message data is smaller than the sequence number of the message data stored at the minimum physical address, storing the received message data in the storage address at the minimum physical address, adding a second difference value to the minimum physical address of the new storage address of the message data originally stored at the minimum physical address, and updating the new storage address of other sorted message data based on the new storage address of the message data originally stored at the minimum physical address. And traversing all the message data to obtain a final sequencing result of the message data. The original work of the central processing unit 101 for sequencing the message data is delivered to the hardware end 102 for processing, a parallel processing mode can be adopted in the hardware end 102, more data can be processed within the same time, the method is specially used for processing the message data sequencing, the pertinence is strong, the CPU resource is saved, the CPU energy consumption is reduced, and meanwhile, the efficiency of the message sequencing processing work is improved.
It should be noted that, in the system, the hardware end 102 may be a network card, which includes a network interface chip (e.g., a main chip on the network card) and is configured to receive message data sent by the central processing unit and execute the TCP connection message processing method. The number of the hardware terminals 102 may also be multiple, and the embodiment of the present invention is not limited thereto. Specifically, the central processing unit 101 may be any terminal such as a mobile phone, a tablet computer, a desktop computer, or a notebook computer.
As shown in fig. 2, a schematic flow chart of a TCP connection packet processing method based on a network interface chip according to an embodiment of the present invention is provided, where the method includes:
s1, receiving message data, analyzing the message data and acquiring a serial number of the message data;
s2, comparing the serial number of the received message data with the serial number of the message data with the minimum physical address currently stored in the storage address; the received first message data is stored in the storage address with the minimum physical address;
if the serial number of the received message data is greater than the serial number of the message data stored in the minimum physical address, the storage address of the received message data is the minimum physical address plus a first difference value; the first difference value is obtained by subtracting the serial number of the message data stored in the physical address with the minimum value from the serial number of the received message data; and the second difference is stored in the sequence number of the message data with the minimum physical address minus the sequence number of the received message data.
Further, the updating the new memory address of the other sorted packet data based on the new memory address of the packet data originally stored in the physical address with the smallest physical address specifically includes: and updating the minimum physical address in the storage addresses of the other sequenced message data into the minimum physical address plus a second difference value.
Specifically, before sending a message, the TCP encodes a message to be transmitted and a port through which the message is transmitted, the message is transmitted after the encoding is completed, the network card receives the message data and then analyzes the message data according to the TCP to obtain a serial number of the message data, the received first message data is stored in a storage address with the minimum physical address, after receiving the second message, the network card analyzes the message data to obtain a serial number of the second message, the serial number of the second message is compared with the serial number of the message data with the minimum physical address in the storage addresses, namely the received first message serial number, if the serial number of the second message is greater than the serial number of the first message, the storage address of the first message does not change, namely the second message is still stored in the storage address with the minimum physical address, the storage address of the second message is the storage address with the minimum physical address plus a first difference value, wherein the first difference value is a difference value obtained by subtracting the serial number of the first message from the serial number of the second message. And if the serial number of the second message is smaller than that of the first message, storing the received second message in the storage address with the minimum physical address, wherein the storage address of the first message is changed into the storage address with the minimum physical address and is added with a second difference value, and the second difference value is the difference value obtained by subtracting the serial number of the second message from the serial number of the first message.
After the third message is received, analyzing the third message to obtain a serial number of the third message, comparing the serial number of the third message with the serial number of the message data with the minimum physical address stored in the storage address, when the message data stored in the storage address with the minimum physical address is the first message data and the serial number of the third message data is greater than the serial number of the first message data, the storage addresses of the first message data and the second message data are unchanged, and the storage address of the third message data is the minimum physical address plus a first difference value, wherein the first difference value is the serial number of the third message data minus the serial number of the first message data. When the stored message data in the storage address with the minimum physical address is the second message data and the sequence number of the third message data is smaller than the sequence number of the first message data, the received third message data is stored in the storage address with the minimum physical address, the storage address of the received first message data is updated to be the minimum physical address plus a second difference value, wherein the second difference value is the difference value of the sequence number of the received first message data minus the sequence number of the received third message, and the storage address of the received second message data changes the former minimum address into the minimum address plus the difference value of the sequence number of the received first message data minus the sequence number of the received third message. And when the message data stored in the storage address with the minimum physical address is the second message data, sequencing in the same way.
And by the cyclic judgment, after the last message is received, the sequence of the minimum sequence numbers of all the messages stored according to the minimum physical address can be arranged.
The implementation process of the sorting method is exemplified by the fact that the physical addresses of the message data with sequence numbers of 1-1023 and the storage addresses for receiving the message data are 1024-2047.
Suppose that the serial number of the first received message data is 100, the serial number of the second received message data is 40, the serial number of the third received message data is 60, and the serial number of the fourth received message data is 10, \8230; writing the received first message data into a minimum physical address (1024 at this time) by default, and recording the physical storage address of the first message data as delta 1=1024; if the sequence number of the received second message data is 40, the sequence number of the received second message data is smaller than the sequence number of the received first message data, the received second message data is stored in the minimum physical address, the physical storage address of the second message data is recorded as δ 2=1024, the storage address of the first received message data is updated to the value obtained by adding the minimum physical address to the sequence number of the received first message data and subtracting the sequence number of the received second message data, that is, the storage address of the received first message data is updated to δ 1= δ 2+60=1024+60=1084 at this time; the sequence number of the received third message data is 60, and is compared with the sequence number of the message data stored in the current minimum physical address, and if the sequence number is greater than the sequence number of the message data stored in the minimum physical address, the storage addresses of the received first message data and the received second message data are unchanged, and the storage address of the received third message data is δ 3= δ 2+20=1024+20=1044. The sequence number of the received fourth message data is 10, and is compared with the sequence number of the message data stored in the current minimum physical address, and if the sequence number of the received fourth message data is smaller than the sequence number of the message data stored in the current minimum physical address, the received fourth message data is stored in the minimum physical address, and the physical storage address of the fourth message data is recorded as δ 4=1024, the physical storage address of the received second message data is changed to δ 2= δ 4+30=1054, and the physical storage address of the received first message data is changed to δ 1= δ 2+60= δ 4+30+60 =1024+60 1114; the physical storage address of the received third message data is changed to δ 3= δ 2+20= δ 4+30+20=1024+30+20=1074;
in the method for processing a TCP connection packet based on a network interface chip provided in this embodiment, a packet data is received, and the packet data is analyzed to obtain a sequence number of the packet data; comparing the sequence number of the received message data with the sequence number of the message data with the minimum physical address currently stored in the storage address; the received first message data is stored in the storage address with the minimum physical address; if the serial number of the received message data is greater than the serial number of the message data stored in the minimum physical address, the storage address of the received message data is the minimum physical address plus a first difference value; and if the sequence number of the received message data is smaller than the sequence number of the message data stored at the minimum physical address, storing the received message data in the storage address at the minimum physical address, adding a second difference value to the minimum physical address of the new storage address of the message data originally stored at the minimum physical address, and updating the new storage address of other sorted message data based on the new storage address of the message data originally stored at the minimum physical address. The method has the advantages that the work of sequencing the message data by the CPU originally is processed by hardware, a parallel processing mode can be adopted in the hardware, more data can be processed within the same time, the method is special for sequencing the message data, the pertinence is strong, the CPU resource is saved, the CPU energy consumption is reduced, and the efficiency of the message sequencing processing work is improved.
In some embodiments, before step S1, further comprising: and updating a pointer of a storage address in the network card, and marking a physical address of the storage address used for storing the message data in the network card.
In some embodiments, before step S1, further comprising: and controlling the size of a message receiving memory in the network card according to the current communication state of an application layer, and adjusting the size of a window in a TCP (transmission control protocol) protocol to realize the control function of the notification window.
Specifically, the CPU can control the memory capacity of the received message data according to the current communication state of the application layer, thereby saving memory resources while ensuring normal transceiving of the message data;
further, initializing a head pointer and a tail pointer of the memory for receiving messages in the network card, and adjusting the value of the tail pointer according to the size of the allocated memory after initialization is completed.
The initializing the head pointer and the tail pointer of the message receiving memory in the network card specifically comprises the following steps: storing the received message data into the allocated memory address, and accumulating the allocated memory address for the head pointer and the tail pointer values of the memory, wherein the head pointer and the tail pointer of the memory for receiving the message in the network card are initialized to be zero for the first time.
Specifically, when a head pointer and a tail pointer of a memory for receiving messages in the network card are initialized, the head pointer (Ptr _ head) and the tail pointer (Ptr _ tail) are both defaulted to 0, when the CPU is in a message receiving state, a fixed memory is allocated for the network card to directly write the received messages into the memory, the CPU adjusts the value of the tail pointer (Ptr _ tail) according to the allocated memory and informs the network card that the value of the tail pointer (Ptr _ tail) is updated, after the network card receives the messages, the messages are directly written into the memory allocated by the CPU, and the head pointer (Ptr _ head) is controlled to be accumulated. When the head pointer and the tail pointer are equal, it indicates that the memory allocated by the CPU for receiving the message is full, and at this time, the network card controls the tail pointer (Ptr _ tail) of the completion queue to update to the maximum value of the physical address currently storing the received message, and directly writes the tail pointer (Ptr _ tail) value into the memory, and waits for the CPU to read the data of the received message.
As shown in fig. 3, a block diagram of a structure of a TCP connection packet processing apparatus 200 based on a network interface chip according to an embodiment of the present invention is provided, where the apparatus 200 includes:
a message data sequence number obtaining module 201, configured to receive message data, analyze the message data, and obtain a sequence number of the message data;
a message data sorting module 202, configured to compare the received sequence number of the message data with the smallest physical address stored in the storage address; the received first message data is stored in the storage address with the minimum physical address;
if the serial number of the received message data is greater than the serial number of the message data stored in the minimum physical address, the storage address of the received message data is the minimum physical address plus a first difference value;
and if the sequence number of the received message data is smaller than the sequence number of the message data stored at the minimum physical address, storing the received message data in the storage address at the minimum physical address, adding a second difference value to the minimum physical address of the new storage address of the message data originally stored at the minimum physical address, and updating the new storage address of other sorted message data based on the new storage address of the message data originally stored at the minimum physical address.
As shown in fig. 4, which is a block diagram of a structure of the message data sorting module 202 in fig. 3, the message data sorting module 202 includes:
the updating module 2021 is configured to update the minimum physical address in the storage addresses of the sorted other packet data to the minimum physical address plus the second difference.
Further, the first difference is obtained by subtracting the serial number of the message data stored in the physical address from the serial number of the received message data; and the second difference is stored in the sequence number of the message data with the minimum physical address minus the sequence number of the received message data.
As shown in fig. 5, a block diagram of another TCP connection packet processing apparatus 200 based on a network interface chip according to an embodiment of the present invention is shown, where the apparatus 200 further includes:
and the marking module 203 is configured to update a pointer of a storage address in a network card, and mark a physical address of the storage address, which is used for storing the message data, in the network card.
As shown in fig. 6, which is a block diagram of a structure of another TCP connection packet processing apparatus 200 based on a network interface chip according to an embodiment of the present invention, the apparatus 200 further includes:
and the regulation and control module 204 is configured to control the size of the memory for receiving the message in the network card according to the current communication state of the application layer, and adjust the size of the window in the TCP protocol.
As shown in fig. 7, which is a block diagram of the adjusting and controlling module 204 in fig. 5, the adjusting and controlling module 204 includes an adjusting module 2041, which is configured to initialize a head pointer and a tail pointer of a memory in the network card that receives a message, and adjust a value of the tail pointer according to a size of an allocated memory after the initialization is completed.
As shown in fig. 7, the adjusting and controlling module 204 further includes an initializing module 2042, configured to store the received message data into the allocated memory address, and accumulate the allocated memory address for the head pointer and the tail pointer values of the memory, where the head pointer and the tail pointer of the memory for receiving the message in the network card are initialized to zero for the first time.
For specific limitations of the network interface chip-based TCP connection packet processing apparatus, reference may be made to the above limitations of the network interface chip-based TCP connection packet processing method, and details are not described herein again. All or part of each module in the TCP connection message processing apparatus based on the network interface chip may be implemented by software, hardware and a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
As shown in fig. 8, which is a schematic structural diagram of a computer device disclosed in the embodiment of the present invention, the computer device may include:
a memory 801 in which executable program code is stored;
a processor 802 connected to the memory 801;
the processor 802 calls the executable program code stored in the memory 801 to execute the steps of the TCP connection packet ordering method of the present invention.
Referring to fig. 9, an embodiment of the present invention discloses a computer storage medium 901, where the computer storage medium 901 stores computer instructions, and the computer instructions are used for executing steps in the TCP connection packet ordering method according to the present invention when being called.
The computer readable medium may be a computer readable signal medium or a computer readable storage medium. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a Read Only Memory (ROM), an Erasable Programmable Read Only Memory (EPROM), a flash Memory, an optical fiber, a portable compact disc Read Only Memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
A computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for aspects of the present application may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, smalltalk, C + +, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the latter scenario, the remote computer may be connected to the user's computer through any type of Network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The terminology used in the embodiments of the invention is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used in the description of the invention and the appended claims, the singular forms "a", "an", and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
The word "if" as used herein may be interpreted as "at 8230; …" or "when 8230; \8230; or" in response to a determination "or" in response to a detection ", depending on the context. Similarly, the phrase "if determined" or "if detected (a stated condition or event)" may be interpreted as "upon determining" or "in response to determining" or "upon detecting (a stated condition or event)" or "in response to detecting (a stated condition or event)", depending on the context.
In the several embodiments provided in the present invention, it should be understood that the disclosed system, apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and there may be other divisions in actual implementation, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like made within the spirit and principle of the present invention should be included in the scope of the present invention.

Claims (10)

1. A TCP connection message processing method based on a network interface chip is characterized by comprising the following steps:
receiving message data, analyzing the message data, and acquiring a serial number of the message data;
comparing the sequence number of the received message data with the sequence number of the message data with the minimum physical address currently stored in the storage address; the received first message data is stored in the storage address with the minimum physical address;
if the serial number of the received message data is greater than the serial number of the message data stored in the minimum physical address, the storage address of the received message data is the minimum physical address plus a first difference value;
and if the sequence number of the received message data is smaller than the sequence number of the message data stored at the minimum physical address, storing the received message data in the storage address at the minimum physical address, adding a second difference value to the minimum physical address of the new storage address of the message data originally stored at the minimum physical address, and updating the new storage address of other sorted message data based on the new storage address of the message data originally stored at the minimum physical address.
2. The method according to claim 1, wherein the updating of the new memory address of the other sorted packet data based on the new memory address of the packet data originally stored at the physical address with the smallest physical address specifically comprises:
and updating the minimum physical address in the storage addresses of the other sequenced message data into the minimum physical address plus a second difference value.
3. The method according to claim 1 or 2, wherein the first difference is a sequence number of the received message data minus a sequence number of the message data stored at a physical address with a minimum value;
and the second difference is stored in the sequence number of the message data with the minimum physical address minus the sequence number of the received message data.
4. The method according to claim 1, wherein before receiving the packet data, parsing the packet data, and obtaining the sequence number of the packet data, the method further comprises:
and updating a pointer of a storage address in the network card, and marking a physical address of the storage address used for storing the message data in the network card.
5. The method according to claim 1, wherein before receiving the packet data, parsing the packet data, and obtaining the sequence number of the packet data, the method further comprises:
and controlling the size of a message receiving memory in the network card according to the current communication state of the application layer, and adjusting the size of a window in a TCP protocol.
6. The method according to claim 5, wherein a head pointer and a tail pointer of a memory for receiving messages in the network card are initialized, and after the initialization is completed, a value of the tail pointer is adjusted according to a size of an allocated memory.
7. The method for processing the TCP connection packet based on the network interface chip according to claim 6, wherein the initializing the head pointer and the tail pointer of the packet memory received in the network card specifically comprises:
storing the received message data into the allocated memory address, and accumulating the allocated memory address for the head pointer and the tail pointer values of the memory, wherein the head pointer and the tail pointer of the memory for receiving the message in the network card are initialized to be zero for the first time.
8. A TCP connection message processing device based on a network interface chip is characterized in that the device comprises:
a message data sequence number acquisition module, configured to receive message data, parse the message data, and acquire a sequence number of the message data;
the message data sorting module is used for comparing the sequence number of the received message data with the sequence number of the message data with the minimum physical address stored in the storage address; the received first message data is stored in the storage address with the minimum physical address;
if the serial number of the received message data is greater than the serial number of the message data stored in the minimum physical address, the storage address of the received message data is the minimum physical address plus a first difference value;
and if the sequence number of the received message data is smaller than the sequence number of the message data stored at the minimum physical address, storing the received message data in the storage address at the minimum physical address, adding a second difference value to the minimum physical address of the new storage address of the message data originally stored at the minimum physical address, and updating the new storage address of other sorted message data based on the new storage address of the message data originally stored at the minimum physical address.
9. A computer device, the computer device comprising:
a memory: for storing a computer program;
a processor: for executing the computer program to implement the network interface chip based TCP connection message processing method according to any of claims 1-7.
10. A computer-readable storage medium, on which a computer program is stored, wherein the computer program, when executed by a processor, implements the TCP connection packet processing method based on the network interface chip according to any one of claims 1 to 7.
CN202211069309.7A 2022-09-02 2022-09-02 TCP connection message processing method based on network interface chip Pending CN115499393A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211069309.7A CN115499393A (en) 2022-09-02 2022-09-02 TCP connection message processing method based on network interface chip

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211069309.7A CN115499393A (en) 2022-09-02 2022-09-02 TCP connection message processing method based on network interface chip

Publications (1)

Publication Number Publication Date
CN115499393A true CN115499393A (en) 2022-12-20

Family

ID=84467685

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211069309.7A Pending CN115499393A (en) 2022-09-02 2022-09-02 TCP connection message processing method based on network interface chip

Country Status (1)

Country Link
CN (1) CN115499393A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1549535A (en) * 2003-05-09 2004-11-24 华为技术有限公司 Method for ordering to eliminate its jitter time delay by rank of RTP data packet
US20070186065A1 (en) * 2006-02-03 2007-08-09 Samsung Electronics Co., Ltd. Data storage apparatus with block reclaim for nonvolatile buffer
CN110806986A (en) * 2019-11-04 2020-02-18 盛科网络(苏州)有限公司 Method, equipment and storage medium for improving message storage efficiency of network chip
CN113141235A (en) * 2020-01-20 2021-07-20 华为技术有限公司 Method and related device for processing data

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1549535A (en) * 2003-05-09 2004-11-24 华为技术有限公司 Method for ordering to eliminate its jitter time delay by rank of RTP data packet
US20070186065A1 (en) * 2006-02-03 2007-08-09 Samsung Electronics Co., Ltd. Data storage apparatus with block reclaim for nonvolatile buffer
CN110806986A (en) * 2019-11-04 2020-02-18 盛科网络(苏州)有限公司 Method, equipment and storage medium for improving message storage efficiency of network chip
CN113141235A (en) * 2020-01-20 2021-07-20 华为技术有限公司 Method and related device for processing data

Similar Documents

Publication Publication Date Title
CN109756230B (en) Data compression storage method, data compression method, device, equipment and medium
WO2022062537A1 (en) Data compression method and apparatus, and computer-readable storage medium
CN108776934B (en) Distributed data calculation method and device, computer equipment and readable storage medium
CN108173938B (en) Server load distribution method and device
CN111818136B (en) Data processing method, device, electronic equipment and computer readable medium
CN109756568B (en) File processing method and device and computer readable storage medium
CN104899204B (en) Data storage method and device
CN109002424B (en) File format conversion method and device, computer equipment and storage medium
CN115186158B (en) Abnormal data determination method, electronic device and storage medium
CN112445725A (en) Method and device for pre-reading file page and terminal equipment
CN108064086B (en) Bandwidth allocation method and device, computer equipment and storage medium
CN111490947A (en) Data packet transmitting method, data packet receiving method, system, device and medium
CN114691595B (en) Multi-core circuit, data exchange method, electronic device, and storage medium
CN113114707B (en) Rule filtering method for power chip Ethernet controller
CN114020529A (en) Backup method and device of flow table data, network equipment and storage medium
CN115499393A (en) TCP connection message processing method based on network interface chip
CN110048865B (en) Bus data transmission method and device, electronic equipment and storage medium
CN115495406A (en) Message transmission method, device, equipment and storage medium based on PCIe
CN114490459A (en) Data transmission method, device, equipment, receiver and storage medium
CN114500403A (en) Data processing method and device and computer readable storage medium
CN114285838A (en) File uploading method, device, system, storage medium and electronic equipment
CN111490864B (en) Data transmission method and device, computer equipment and storage medium
EP2811308A1 (en) Method and system for tracing and processing smart card interactive data
CN115794353B (en) Cloud network service quality optimization processing method, device, equipment and storage medium
CN116467235B (en) DMA-based data processing method and device, electronic equipment and medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination