Method, device and medium for processing data flow entry

By determining the target data flow table entry from the four-tuple information of the received data packet, and processing the writing and uploading of the data packet according to the data packet length, the problem of low data packet transmission efficiency under the large packet segmentation function of the smart network card is solved, and more efficient data packet transmission is achieved.

CN114281824BActive Publication Date: 2026-03-20BEIJING ZHUANWEI TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-22
Publication Date
2026-03-20

AI Technical Summary

Technical Problem

When the large packet splitting function is enabled on a smart network interface card (NIC), the latency of a single data packet increases, resulting in reduced data packet transmission efficiency.

Method used

The target data flow table entry is determined by receiving the four-tuple information of the data packet, and the writing and uploading of the data packet are processed according to the data packet length, including updating the data carrying page and uploading to the server in the data flow table entry, thereby optimizing the data packet transmission process.

Benefits of technology

It reduces data packet transmission latency and improves data packet transmission efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114281824B_ABST
    Figure CN114281824B_ABST
Patent Text Reader

Abstract

The application provides a data flow table entry processing method, device and medium. The method receives a data packet transmitted by a current network through a transmission control protocol (TCP) session connection; determines a target data flow table entry corresponding to the data packet based on four-tuple information of the data packet; if a data length of the data packet is greater than a preset data length, writes data of the data packet into a data carrying page in the target data flow table entry, and updates table entry data in the target data flow table entry; otherwise, when there is no historical data of a historical data packet in the data carrying page in the target data flow table entry, writes the data of the data packet into the data carrying page, and uploads the data carrying page with the data to a server; or when there is historical data in the data carrying page, uploads the data carrying page with the historical data to the server, and then uploads the data to the server. The method improves the transmission efficiency of the data packet.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of data processing, in particular to a data flow entry processing method, device and medium. BACKGROUND

[0002] The rise of trends such as big data, machine learning, hyper-scale architecture and cloud services, and the requirement for lower latency applications and services such as 5G and autonomous driving, have placed unprecedented demands on the network, especially in terms of performance and latency. These factors, combined with the growing number of 5G users and short video application browsing, are driving an increase in network bandwidth, the number of users and the amount of active network traffic, and the increased network traffic is increasing the CPU computing complexity of the server, which is putting a huge computing pressure on the CPU of the server.

[0003] In order to reduce the CPU burden, the data packet processing flow is transferred from the CPU to the FPGA-based NIC by using the SmartNIC, and the network processing flow of the CPU is offloaded by the SmartNIC, which improves the performance of the server and thus improves the efficiency of the overall solution. The LRO function is one of the NIC offloading schemes, which aggregates multiple TCP type data packets into one large data packet before sending them to the CPU, and then passes them to the network protocol stack for processing, in order to reduce the upper protocol stack processing overhead, improve the system's ability to receive TCP type data packets, and improve network throughput.

[0004] However, when the NIC starts the LRO function, the delay of a single data packet will increase due to the need to wait for multiple TCP type data packets to be aggregated, thereby reducing the transmission efficiency of the data packet. SUMMARY

[0005] The purpose of the embodiments of the present application is to provide a data flow entry processing method, device and medium, which solves the above-mentioned problems existing in the prior art and improves the transmission efficiency of the data packet 。

[0006] In a first aspect, a data flow entry processing method is provided, which can include:

[0007] receiving a data packet transmitted by a current network through a transmission control protocol (TCP) session connection;

[0008] determine a target data flow table item corresponding to the data packet based on four-tuple information of the data packet;

[0009] if the data length of the data packet is greater than the preset data length, write data of the data packet into a data bearing page in the target data flow table item, and update table item data in the target data flow table item;

[0010] if the data length of the data packet is not greater than the preset data length, when there is no historical data of a historical data packet in the data bearing page in the target data flow table item, write data of the data packet into the data bearing page, and upload the data bearing page in which the data exists to the server; or, when there is the historical data in the data bearing page, upload the data bearing page in which the historical data exists to the server, and then upload the data to the server.

[0011] In an optional implementation, if the data length of the data packet is greater than the preset data length, writing the data of the data packet into the data bearing page in the target data flow table item comprises:

[0012] if the data length of the data packet is greater than the preset data length, and the target data flow table item meets a preset table item condition, write the data of the data packet into the data bearing page in the target data flow table item;

[0013] if the data length of the data packet is greater than the preset data length, and the target data flow table item does not meet any of the preset table item conditions, obtain a new data bearing page of the target data flow table item, and write the data of the data packet into the new data bearing page.

[0014] In an optional implementation, the preset table item condition comprises that a page identifier is valid, an item serial number is a serial number field value in a current data packet, and a sum of a total length of data packets and the data length of the current data packet is less than a length of the data bearing page.

[0015] In an optional implementation, the table item data of the target data flow table item comprises a current page identifier, a current item serial number, a current total length of data packets, and a current length of the data bearing page.

[0016] if the data length of the data packet is greater than the preset data length, and the target data flow table item does not meet any of the preset table item conditions, obtaining a new data bearing page of the target data flow table item comprises:

[0017] if the data length of the data packet is greater than the preset data length, and the current page identifier is valid:

[0018] if the current entry number is not the value of the sequence number field in the data packet, or the sum of the current data packet total length and the data length of the data packet is not less than the length of the current data carrying page, and if the data carrying page in which the target data flow entry exists has historical data of the historical data packet, then after uploading the data carrying page in which the historical data exists to the server, a new data carrying page of the target data flow entry is obtained; or

[0019] if the data carrying page in the target data flow entry does not have historical data of the historical data packet, then a new data carrying page of the target data flow entry is obtained.

[0020] In an optional implementation, the method further includes:

[0021] In a case where the data length of the data packet is greater than a preset data length, and the current page identifier in the target data flow entry is invalid, a new data carrying page of the target data flow entry is obtained.

[0022] In an optional implementation, the entry data of the target data flow entry further includes an entry aging time; after the data of the data packet is written into the data carrying page in the target data flow entry, the method further includes:

[0023] if the data carrying page in the target data flow entry has not joined data of other data packets within the entry aging time, then the data carrying page in the target data flow entry is deleted, and the entry identifier in the target data flow entry is updated to be valid.

[0024] In an optional implementation, the entry data of the target data flow entry further includes a timeout time;

[0025] After the data of the data packet is written into the data carrying page in the target data flow entry, the method further includes:

[0026] if the timeout time is greater than a preset timeout threshold, and the current page identifier is valid, then the data carrying page in which the data exists in the target data flow entry is uploaded to the server, and the current page identifier is updated to be invalid.

[0027] In an optional implementation, the entry data of the target data flow entry further includes a current hit value, a current page identifier of the data carrying page, and an address of the data carrying page; the current hit value represents a number of times that a data flow entry corresponding to a data packet is determined to be the target data flow entry;

[0028] updating the entry data in the target data flow entry includes:

[0029] updating the current packet total length as a sum of a packet total length and a data length of the packet;

[0030] updating the current entry serial number as a sum of a serial number field value in the packet and the data length of the packet;

[0031] marking a current page identifier of the data carrying page as valid;

[0032] increasing the current hit value by 1;

[0033] updating an address of the data carrying page as a first address of the data carrying page plus the updated packet total length;

[0034] updating both a time to live of the data carrying page and an entry aging time as a time when the data of the packet is written into the data carrying page.

[0035] In an optional implementation, the method further comprises:

[0036] if a target data flow entry corresponding to the packet is not determined based on four tuple information of the packet, obtaining a to-be-created data flow entry with an entry identifier marked as valid in a pre-configured data flow entry;

[0037] writing the data of the packet into a data carrying page in the to-be-created data flow entry, and updating entry data in the to-be-created data flow entry.

[0038] In an optional implementation, the entry data of the to-be-created data flow entry comprises a miss value and a hit value; the miss value represents a number of times that a data flow entry corresponding to a packet is not determined as the to-be-created data flow entry; the method further comprises:

[0039] if the miss value is greater than the hit value, writing the data of the packet into the data carrying page in the to-be-created data flow entry.

[0040] In an optional implementation, updating the entry data in the to-be-created data flow entry comprises:

[0041] updating four tuple information in the to-be-created data flow entry as four tuple information in the packet; the four tuple information comprises a source IP address, a destination IP address, a source port and a destination port;

[0042] updating a packet total length in the to-be-created data flow entry as a packet total length of the packet;

[0043] updating an entry serial number in the to-be-created data flow entry as a sum of a serial number field value in the packet and a data length of the packet;

[0044] setting the table item identifier in the to-be-created data flow table item to be invalid, and setting the page identifier of the target data carrying page to be valid;

[0045] updating the address of the target data carrying page to be the first address of the target data carrying page plus the total length of the updated data packet;

[0046] updating the existence time of the data carrying page and the table item aging time in the to-be-created data flow table item to be the time when the data of the data packet is written into the target data carrying page;

[0047] setting the hit value and the miss value in the to-be-created data flow table item to be 0.

[0048] In a second aspect, a processing apparatus of a data flow table item is provided, which can include:

[0049] a receiving unit configured to receive a data packet transmitted by a current network through a transmission control protocol (TCP) session connection;

[0050] a determining unit configured to determine a target data flow table item corresponding to the data packet based on four-tuple information of the data packet;

[0051] a writing unit configured to write data of the data packet into a data carrying page in the target data flow table item if a data length of the data packet is greater than a preset data length;

[0052] an updating unit configured to update table item data in the target data flow table item;

[0053] the writing unit is further configured to write the data of the data packet into the data carrying page if the data length of the data packet is not greater than the preset data length and no historical data of a historical data packet exists in the data carrying page;

[0054] an uploading unit configured to upload the data carrying page in which the data exists to the server, or upload the data carrying page in which the historical data exists to the server and then upload the data to the server if the historical data exists in the data carrying page.

[0055] In an optional implementation, the apparatus further includes an obtaining unit;

[0056] the writing unit is specifically configured to write the data of the data packet into the data carrying page in the target data flow table item if the data length of the data packet is greater than the preset data length and the target data flow table item meets a preset table item condition;

[0057] The acquisition unit is configured to acquire a new data carrying page of the target data flow table item and write data of the data packet into the new data carrying page if the data length of the data packet is greater than the preset data length and the target data flow table item does not satisfy any of the preset table item conditions.

[0058] In an optional implementation, the preset table item conditions include that a page identifier is valid, an item serial number is a serial number field value in a current data packet, and a sum of a total length of data packets and the data length of the current data packet is less than a length of the data carrying page.

[0059] In an optional implementation, the item data of the target data flow table item includes a current page identifier, a current item serial number, a current total length of data packets, and a current length of the data carrying page.

[0060] The acquisition unit is specifically configured to:

[0061] In a case where the data length of the data packet is greater than the preset data length and the current page identifier is valid:

[0062] When the current item serial number is not a serial number field value in a data packet or a sum of the current total length of data packets and the data length of the data packet is not less than the length of the current data carrying page, if historical data of historical data packets exists in the data carrying page in the target data flow table item, the data carrying page in which the historical data exists is uploaded to the server, and then a new data carrying page of the target data flow table item is acquired; or

[0063] If historical data of historical data packets does not exist in the data carrying page in the target data flow table item, a new data carrying page of the target data flow table item is acquired.

[0064] In an optional implementation, the acquisition unit is further configured to acquire a new data carrying page of the target data flow table item in a case where the data length of the data packet is greater than the preset data length and the current page identifier in the target data flow table item is invalid.

[0065] In an optional implementation, the item data of the target data flow table item further includes an item aging time.

[0066] After the data of the data packet is written into the data carrying page in the target data flow table item, the apparatus further includes a deletion unit.

[0067] The deleting unit is configured to delete the data carrying page in the target data flow entry and update the entry identifier in the target data flow entry to valid if data in the data carrying page in the target data flow entry is not added to data of other data packets within the entry aging time.

[0068] In an optional implementation, the entry data of the target data flow entry further includes a timeout time.

[0069] After the data of the data packet is written into the data carrying page in the target data flow entry, the method further includes:

[0070] The uploading unit is further configured to upload the data carrying page in which the data exists in the target data flow entry to the server if the timeout time is greater than a preset timeout threshold and the current page identifier is valid.

[0071] The updating unit is further configured to update the current page identifier to invalid.

[0072] In an optional implementation, the entry data of the target data flow entry further includes a current hit value, a current page identifier of the data carrying page, and an address of the data carrying page; the current hit value represents a number of times that a data flow entry corresponding to a data packet is determined to be the target data flow entry; and the updating unit is specifically configured to:

[0073] update the current total length of the data packet to a sum of the total length of the data packet and a data length of the data packet;

[0074] update the current entry serial number to a sum of a serial number field value in the data packet and the data length of the data packet;

[0075] mark the current page identifier of the data carrying page as valid;

[0076] increment the current hit value by 1;

[0077] update the address of the data carrying page to a first address of the data carrying page plus the updated total length of the data packet;

[0078] update both the existence time of the data carrying page and the entry aging time to a time when the data of the data packet is written into the data carrying page.

[0079] In an optional implementation, the obtaining unit is further configured to obtain a to-be-created data flow entry in which an entry identifier in a preconfigured data flow entry is valid if a target data flow entry corresponding to the data packet is not determined based on the four-tuple information of the data packet.

[0080] The write unit is further configured to write the data of the data packet into the data carrying page in the to-be-created data flow table entry.

[0081] The update unit is further configured to update entry data in the to-be-created data flow table entry.

[0082] In an optional implementation, the entry data of the to-be-created data flow table entry includes a miss value and a hit value; the miss value represents a number of times that it is determined that a data flow entry corresponding to a data packet is not the to-be-created data flow table entry;

[0083] The write unit is further configured to write the data of the data packet into the data carrying page in the to-be-created data flow table entry if the miss value is greater than the hit value.

[0084] In an optional implementation, the update unit is specifically configured to:

[0085] update four-tuple information in the to-be-created data flow table entry as four-tuple information in the data packet; the four-tuple information includes a source IP address, a destination IP address, a source port and a destination port;

[0086] update a total data packet length in the to-be-created data flow table entry as a total data packet length of the data packet;

[0087] update a data packet sequence number in the to-be-created data flow table entry as a sum of a sequence number field value in the data packet and a data length of the data packet;

[0088] set an entry identifier in the to-be-created data flow table entry as invalid, and set a page identifier of the target data carrying page as valid;

[0089] update an address of the target data carrying page as a first address of the target data carrying page plus an updated total data packet length;

[0090] update a data carrying page existence time and an entry aging time in the to-be-created data flow table entry as a time when the data of the data packet is written into the target data carrying page;

[0091] set the hit value and the miss value in the to-be-created data flow table entry as 0.

[0092] In a third aspect, an electronic device is provided, which includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory complete communication with each other through the communication bus;

[0093] The memory is configured to store a computer program.

[0094] A processor is configured to implement the method steps of any one of the first aspect when executing a program stored in a memory.

[0095] In a fourth aspect, a computer readable storage medium is provided, and the computer readable storage medium stores a computer program. The computer program is configured to implement the method steps of any one of the first aspect when executed by a processor.

[0096] The data flow entry processing method provided by the embodiments of the present application receives a data packet transmitted by a current network through a transmission control protocol (TCP) session connection; determines a target data flow entry corresponding to the data packet based on four-tuple information of the data packet; if a data length of the data packet is greater than a preset data length, writes data of the data packet into a data carrying page in the target data flow entry, and updates entry data in the target data flow entry; if the data length of the data packet is not greater than the preset data length, writes the data of the data packet into the data carrying page when there is no historical data of a historical data packet in the data carrying page, and uploads the data carrying page with data to a server; or, when there is historical data in the data carrying page, uploads the data carrying page with the historical data to the server, and then uploads the data to the server. The method directly uploads data packets smaller than the preset data length to the server, reduces transmission delay in the prior art, simultaneously detects whether there is data not uploaded in the entry in real time, and uploads the data in time, thereby improving transmission efficiency of the data packet. BRIEF DESCRIPTION OF DRAWINGS

[0097] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following will briefly introduce the drawings needed to be used in the embodiments of the present application. It should be understood that the following drawings only show some embodiments of the present application, and therefore should not be regarded as a limitation to the scope. For those skilled in the art, other related drawings can also be obtained without creative labor on the basis of these drawings.

[0098] Figure 1 A structural schematic diagram of a field programmable logic gate array provided by the embodiments of the present application is shown in FIG. 1.

[0099] Figure 2 A flowchart of a data flow entry processing method provided by the embodiments of the present application is shown in FIG. 2.

[0100] Figure 3 A structural schematic diagram of a data flow entry processing device provided by the embodiments of the present application is shown in FIG. 3.

[0101] Figure 4 A structural schematic diagram of an electronic device provided by the embodiments of the present application is shown in FIG. 4. DETAILED DESCRIPTION

[0102] With reference to the accompanying drawings, the technical solutions in the embodiments of the present application will be described clearly and completely. Obviously, the described embodiments are only a part of the embodiments of the present application, and not all the embodiments. Based on the embodiments of the present application, all the other embodiments obtained by those skilled in the art without creative work fall within the scope of the present application.

[0103] For the convenience of understanding, the technical abbreviations involved in the embodiments of the present application are explained as follows:

[0104] FPGA: Field Programmable Gate Array (FPGA).

[0105] Page: memory page, representing the basic page allocation unit of system memory.

[0106] Page pool: a collection of some memory pages, applied by the host and configured for the FPGA.

[0107] Flow entry: a data flow table entry storing a TCP connection information.

[0108] Flow table: a collection of table entries.

[0109] Figure 1 A structural schematic diagram of an FPGA for applying a processing method of a data flow table entry is provided in the embodiments of the present application. As shown in Figure 1 , it can include:

[0110] Packet parsing module, for receiving Ethernet transmitted data packets through TCP session connection and parsing the received data packets.

[0111] Table entry processing module, for implementing functions such as Flow entry creation, Flow entry processing, Flow entry timeout and Flow entry deletion.

[0112] Data packet upload module, for uploading data packets with a data length less than a preset data length, such as 128 bytes, to a server through a bus, such as PCIE (Peripheral Component Interconnect Express), i.e. executing UploadPacket processing.

[0113] Data carrying page upload module, for uploading data carrying pages Page to a server through a Pcie bus, i.e. executing Upload Page processing.

[0114] The flow entry includes a data carrying page for storing data.

[0115] The table entry data of the flow entry includes four-tuple information, a lifetime of the data carrying page Page, a data packet sequence number Nseq, a total length of the data packet Length, a current length of the data carrying page Page, a table entry aging time Expires, a timeout time of the data carrying page Page, a miss value, a hit value, an entry identifier Invalid, and a page identifier Page_invalid. The four-tuple information includes a source IP address, a destination IP address, a source port, and a destination port.

[0116] Invalid: is marked as true initially, indicating that it is not occupied.

[0117] Page_invalid: indicates whether the data carrying page Page in the entry is available, and is initially set as true, indicating that it is not available, and is set as false after the page is added.

[0118] Nseq: is the seq of the next data packet, and can be set as 0 initially, and is the field value of the seq field in the TCP data packet plus the data length of the data packet in the updated value.

[0119] Length: is the data length stored in the Page in the entry, and can be set as 0 initially.

[0120] Figure 2 A flowchart of a processing method of a data flow table entry provided by an embodiment of the present application is shown in FIG. 1. As shown in FIG. 1, the method can be applied to an FPGA, and can include the following steps. Figure 2

[0121] In step S210, a data packet transmitted by a current network through a TCP session connection is received.

[0122] Before the step is performed, a TCP session connection between two terminals needs to be created, so that the FPGA receives a data packet transmitted by an Ethernet through the TCP session connection.

[0123] In step S220, a target data flow table entry corresponding to the data packet is determined based on four-tuple information of the data packet.

[0124] In the implementation, after receiving the data packet transmitted by the Ethernet through the created TCP session connection, it is parsed that the data packet type of the data packet is a TCP type and the data packet does not carry a SYN flag, the four-tuple information of the data packet is extracted, and the four-tuple information of the data packet is calculated by HASH to obtain an entry index.

[0125] ​In the configured Flow table, the table item index corresponding to the created Flow entry is found, and the four-tuple information in the created Flow entry is matched with the four-tuple information of the data packet; the four-tuple information includes source IP address, destination IP address, source port and destination port.

[0126] If the matching is successful, the found Flow entry is determined as the target data flow table item, and then step S230 is executed.

[0127] In some embodiments, (1) if the matching is successful, and the data packet load is greater than a preset data length, such as 128 bytes, the Flow entry corresponding to the table item index in the configured Flow table is an uncreated Flow entry, and the table item identifier in the Flow entry is valid (i.e., it represents that the position has not been occupied), the Flow entry is determined as the to-be-created data flow table item.

[0128] Then, a data carrying page Page is taken out from the Page pool as the target data carrying page page corresponding to the to-be-created data flow table item, so as to obtain the target data carrying page Page corresponding to the to-be-created data flow table item. The data of the data packet is written into the target data carrying page Page, and the table item data in the to-be-created data flow table item is updated. Specifically, the following steps are included:

[0129] The four-tuple information in the to-be-created data flow table item is updated as the four-tuple information in the data packet;

[0130] The Length in the to-be-created data flow table item is updated as the total length of the data packet;

[0131] The table item serial number Nseq in the to-be-created data flow table item is updated as the sum of the serial number field value seq in the data packet and the data length of the data packet;

[0132] The table item identifier in the to-be-created data flow table item is set as invalid, and the page identifier of the data carrying page Page in the to-be-created data flow table item is set as valid;

[0133] The address of the data carrying page Page in the to-be-created data flow table item is updated as the first address of the data carrying page page plus the updated total length of the data packet Length;

[0134] The existence time and the table item aging time Expires of the data carrying page Page in the to-be-created data flow table item are both updated as the time when the data of the data packet is written into the data carrying page Page in the to-be-created data flow table item;

[0135] Set the hit value hits and the miss value uhit in the data flow table item to be created to 0.

[0136] (2) If the matching is successful, and the data packet load is greater than a preset data length, such as 128 bytes, in the case that the Flow entry corresponding to the table item index in the configured Flow table is not created, and the table item identifier in the Flow entry is invalid (i.e., representing that the position is occupied), check whether the miss value uhit in the Flow entry is greater than the hit value hits.

[0137] If the uhit value is not greater than the hits value, it indicates that the addition cannot be performed, at which time the uhit value in the Flow entry needs to be updated by 1, and then the Upload Packet processing is performed on the data packet.

[0138] If the uhit value is greater than the hits value, the table item has not been hit for a long time, and at this time the data packet wants to occupy the table item, which needs to first judge whether Page_invalid is valid. In the case that Page_invalid is valid and historical data (i.e., unuploaded data) of the historical data packet exists in the data carrying page Page in the table item, the Upload Page processing needs to be performed on the data carrying page Page in which the historical data exists, and then a data carrying page page is taken out from the Page pool as the data carrying page Page in the data flow table item to be created, so as to obtain the data carrying page Page in the data flow table item to be created. The data of the data packet is written into the data carrying page Page in the data flow table item to be created, and the table item data in the data flow table item to be created is updated.

[0139] It needs to be noted that the preset data length can be set according to actual business requirements, which is not limited in the present application.

[0140] Further, if the matching fails, it indicates that the Flow entry matching the data packet does not exist in the configured Flow table. In this case: in order to reduce the transmission delay of small data packets and improve the transmission efficiency of data packets, the load of the data packet, i.e., the data length of the data packet, needs to be detected. If the data packet load is not greater than a preset data length, such as 128 bytes, it indicates that the data packet of this type is data that needs to be processed by the server as soon as possible, such as a data packet that needs to be forwarded to the destination terminal as soon as possible, and the data packet of this type is directly uploaded to the server, i.e., the Upload Packet processing is performed.

[0141] Step S230, processing the target data flow table item based on the data length of the data packet.

[0142] If the data length of the data packet is not greater than the preset data length, such as 128 bytes, when the data carrying page Page in the target data flow table entry does not have the historical data of the historical data packet, the data of the data packet is written into the data carrying page Page, and the data carrying page Page having the data is uploaded to the server; or when the data carrying page Page has historical data, the data carrying page Page having the historical data is uploaded to the server, and then the data of the data packet is uploaded to the server.

[0143] That is, the data packet whose data length is not greater than the preset data length is considered as not having subsequent data in a period of time or needing to be uploaded to the server for processing as soon as possible, so the data packet cannot be added to the target data flow table entry Flow entry, and at this time, it is needed to determine whether the page_invalid in the target data flow table entry Flow entry is valid, if it is valid, and there is still data needing to be processed on the corresponding data carrying page Page, it is needed to perform the Upload Page processing on the data carrying page Page first, and then perform the UploadPacket processing on the data packet.

[0144] If the data length of the data packet is greater than the preset data length (128 bytes), the data of the data packet can be written into the data carrying page Page in the target data flow table entry, and the table entry data in the target data flow table entry is updated.

[0145] In the embodiment, when the data length of the data packet is greater than the preset data length, the data of the data packet is written into the data carrying page Page in the target data flow table entry, and the following two schemes exist:

[0146] (1) If the data length of the data packet is greater than the preset data length, and the target data flow table entry meets the preset table entry condition, the data of the data packet is written into the data carrying page Page in the target data flow table entry.

[0147] The preset table entry condition can include that the page_invalid is valid, the Nseq is the sequence number field value in the current data packet, and the sum of the total length of the data packet and the data length of the current data packet is less than the length PageSize of the data carrying page Page.

[0148] Specifically, when the data length of the data packet is greater than the preset data length, and the table entry data in the target data flow table entry meets all the above conditions in the preset table entry condition, the data of the data packet is written into the data carrying page Page in the target data flow table entry, and the table entry data in the target data flow table entry is updated.

[0149] (2) If the data length of the data packet is greater than the preset data length, and the target data flow table entry does not satisfy any of the preset table entry conditions, a new data carrying page Page of the target data flow table entry is obtained, and the data of the data packet is written into the new data carrying page Page.

[0150] Specifically, in the case that the data length of the data packet is greater than the preset data length, and the current page identifier in the target data flow table entry is valid, the current table entry sequence number Nseq is not the sequence number field value seq in the data packet; or the sum of the current data packet total length and the data length of the data packet is not less than the length PageSize of the current data carrying page Page, if the data carrying page Page in the target data flow table entry exists historical data of historical data packets, the data carrying page Page with the existing historical data is uploaded to the server, and then a data carrying page Page is obtained from the Page pool as a new data carrying page Page of the target data flow table entry.

[0151] That is, if the load data length in the data packet is greater than the preset data length, and any other condition is not satisfied, the data packet can be added to the Flow entry, but at this time, it is also necessary to previously judge whether the page_invalid in the Flow entry is valid, if false, there is still data to be processed on this table entry, the Upload Page operation needs to be performed first, and then a new Page is obtained from the Page pool.

[0152] Or, if the data carrying page Page in the target data flow table entry does not exist historical data of historical data packets, a data carrying page Page can be directly obtained from the Page pool as a new data carrying page Page of the target data flow table entry.

[0153] In the case that the data length of the data packet is greater than the preset data length, and the current page identifier in the target data flow table entry is invalid, a data carrying page Page can be directly obtained from the Page pool as a new data carrying page Page of the target data flow table entry.

[0154] Further, updating the table entry data in the target data flow table entry can include:

[0155] updating the current data packet total length Length as the sum of the data packet total length and the data length of the data packet;

[0156] updating the current table entry sequence number Nseq as the sum of the sequence number field value seq in the data packet and the data length of the data packet;

[0157] Mark the current page identifier of the data-carrying page Page as valid: Page_invalid is false;

[0158] Add 1 to the current hit value;

[0159] Update the address of the data-carrying page Page to the first address of the data-carrying page page plus the total length of the updated data packet Length.

[0160] Update the existence time and the entry aging time Expires of the data-carrying page Page to the time when the data of the data packet is written into the data-carrying page Page, that is, the current time stamp.

[0161] In some embodiments, when the target data flow entry Flow entry is created, the data packets transmitted in a period of time hit the target data flow entry Flow entry, at this time, the hit value in the target data flow entry is very large, if the TCP session connection is disconnected at this time, the data packets newly transmitted want to use the target data flow entry Flow entry, a large number of data packets are needed to update the unhit value in the target data flow entry Flow entry, so as to meet the condition that the unhit value is greater than the hit value in the created Flow entry, that is, in the case of TCP session connection disconnection, there is a problem of non-reusable data flow entry.

[0162] In order to be able to reuse the target data flow entry, if the entry data in the target data flow entry has not been updated within the entry aging time, that is, the data-carrying page in the target data flow entry has not added the data of other data packets within the aging time, that is, has not been hit, delete the data-carrying page Page in the target data flow entry, and update the entry identifier in the target data flow entry to valid, so as to allow other data packets to use the target data flow entry Flowentry.

[0163] In some embodiments, in order to prevent the data-carrying page Page in the target data flow entry from existing in the target data flow entry for too long time, causing the data in the data-carrying page Page to not be uploaded in time, the embodiments of the present application need to detect whether the timeout time Timeout in each data flow entry Flow entry (that is, including the target data flow entry) in the Flow table is greater than a preset timeout threshold value in real time;

[0164] If it is greater, and the page identifier is valid (that is, page_invalid is false), upload the data in the data-carrying page page to the server, and update the page identifier to invalid (that is, page_invalid is true).

[0165] The method provided by the embodiments of the present application comprises the following steps: receiving a data packet transmitted by a current network through a transmission control protocol (TCP) session connection; determining a target data flow table item corresponding to the data packet based on four-tuple information of the data packet; if a data length of the data packet is greater than a preset data length, writing data of the data packet into a data carrying page in the target data flow table item and updating table item data in the target data flow table item; if the data length of the data packet is not greater than the preset data length, writing the data of the data packet into the data carrying page when there is no historical data of a historical data packet in the data carrying page in the target data flow table item, and uploading the data carrying page in which the data exists to a server; or, when there is historical data in the data carrying page, uploading the data carrying page in which the historical data exists to the server and then uploading the data to the server. The method directly uploads data packets smaller than the preset data length to the server, reduces transmission delay in the prior art, simultaneously detects whether there is data not uploaded in the table item in real time, and uploads the data in time, thereby improving transmission efficiency of the data packet.

[0166] Corresponding to the above method, the embodiments of the present application also provide a processing device of a data flow table item, as shown in the following table. Figure 3 The device comprises a receiving unit 310, a determining unit 320, a writing unit 330, an updating unit 340 and an uploading unit 350.

[0167] The receiving unit 310 is configured to receive a data packet transmitted by a current network through a transmission control protocol (TCP) session connection.

[0168] The determining unit 320 is configured to determine a target data flow table item corresponding to the data packet based on four-tuple information of the data packet.

[0169] The writing unit 330 is configured to write data of the data packet into a data carrying page in the target data flow table item if a data length of the data packet is greater than a preset data length.

[0170] The updating unit 340 is configured to update table item data in the target data flow table item.

[0171] The writing unit is further configured to write the data of the data packet into the data carrying page when there is no historical data of a historical data packet in the data carrying page in the target data flow table item if the data length of the data packet is not greater than the preset data length.

[0172] The uploading unit 350 is configured to upload the data carrying page in which the data exists to the server, or upload the data carrying page in which the historical data exists to the server and then upload the data to the server when there is the historical data in the data carrying page.

[0173] The functions of the functional units of the data flow table processing apparatus provided in the embodiments of the present application can be implemented by the above-mentioned method steps, and thus the specific working processes and advantages of each unit in the data flow table processing apparatus provided in the embodiments of the present application will not be repeated here.

[0174] The embodiments of the present application further provide an electronic device, such as Figure 4 as shown, comprising a processor 410, a communication interface 420, a memory 430 and a communication bus 440, wherein the processor 410, the communication interface 420 and the memory 430 complete mutual communication through the communication bus 440.

[0175] The memory 430 is used to store a computer program.

[0176] The processor 410 is used to execute the program stored in the memory 430, and implement the method steps as Figure 2 described.

[0177] The above-mentioned communication bus can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For the convenience of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or only one type of bus.

[0178] The communication interface is used for communication between the above-mentioned electronic device and other devices.

[0179] The memory can include a Random Access Memory (RAM) and can also include a Non-Volatile Memory (NVM), for example at least one disk memory. Optionally, the memory can also be at least one storage device located away from the aforementioned processor.

[0180] The processor described above can be a general processor, including a central processing unit (CPU), a network processor (NP), etc.; can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component.

[0181] The implementation manners and beneficial effects of the electronic device in the above embodiments can be achieved by referring to the implementation manners of each step in the above embodiments, and thus, the specific working process and beneficial effects of the electronic device provided by the embodiments of the present application are not repeated here. Figure 2 The implementation manners and beneficial effects of the electronic device in the above embodiments can be achieved by referring to the implementation manners of each step in the above embodiments, and thus, the specific working process and beneficial effects of the electronic device provided by the embodiments of the present application are not repeated here.

[0182] In another embodiment provided by the present application, a computer readable storage medium is provided, and the computer readable storage medium stores instructions, when the instructions are run on a computer, the computer is caused to execute the data flow table item processing method in any of the above embodiments.

[0183] In another embodiment provided by the present application, a computer program product containing instructions is provided, when the instructions are run on a computer, the computer is caused to execute the data flow table item processing method in any of the above embodiments.

[0184] Those skilled in the art should understand that the embodiments in the embodiments of the present application can be provided as a method, a system or a computer program product. Therefore, the embodiments in the embodiments of the present application can be in the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware aspects. Moreover, the embodiments in the embodiments of the present application can be in the form of a computer program product implemented on one or more computer usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer usable program codes.

[0185] The computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart block or blocks. Figure 1 one or more flowcharts and / or blocks Figure 1 means for functionally implementing the

[0186] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instructions which implement the Figure 1 one or more flowcharts and / or blocks Figure 1 means for functionally implementing the

[0187] The computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart block or blocks. Figure 1 one or more flowcharts and / or blocks Figure 1 means for functionally implementing the

[0188] While the preferred embodiments in the application have been described, additional variations and modifications can be applied to those embodiments without departing from the spirit and scope of the application. Therefore, the appended claims are intended to encompass within their scope all such variations and modifications as are within the scope of the application.

[0189] It will be apparent to those skilled in the art that various modifications and variations can be made to the embodiments of the present application without departing from the spirit or scope of the application. Thus, it is intended that the present application cover the modifications and variations of this application provided they come within the scope of the appended claims and their equivalents.

Claims

1. A method for processing data flow table entries, characterized in that, The method includes: Receive data packets transmitted over the current network via a Transmission Control Protocol (TCP) session connection; Extract the four-tuple information of the data packet, and determine the target data flow table entry corresponding to the data packet based on the four-tuple information of the data packet; If the data length of the data packet is greater than the preset data length, then the data of the data packet is written into the data carrying page in the target data flow table entry, and the table entry data in the target data flow table entry is updated. If the data length of the data packet is not greater than the preset data length, then when there is no historical data of the historical data packet in the data carrier page of the target data flow table entry, the data of the data packet is written into the data carrier page, and the data carrier page containing the data is uploaded to the server; or, when the historical data exists in the data carrier page, the data carrier page containing the historical data is uploaded to the server, and then the data is uploaded to the server. The table entry data for the data flow table entry to be created includes miss values ​​and hit values; the miss value represents the number of times the data flow table entry corresponding to the data packet was not determined to be the data flow table entry to be created; the method further includes: If the target data flow table entry corresponding to the data packet cannot be determined based on the four-tuple information of the data packet, and a data flow table entry to be created is identified as invalid in the pre-configured data flow table entries, then check whether the miss value in the data flow table entry to be created is greater than the hit value. If the miss value is not greater than the hit value, update the miss value in the data flow table entry to be created by 1 and upload the data packet to the server. If the miss value is greater than the hit value and the data carrier page in the data flow table entry to be created contains historical data of historical data packets, upload the data carrier page of the historical data to the server. Then, retrieve a data carrier page from the Page pool as the target data carrier page for the data flow table entry to be created. After that, write the data of the data packet into the target data carrier page in the data flow table entry to be created and update the table entry data in the data flow table entry to be created.

2. The method as described in claim 1, characterized in that, If the data length of the data packet is greater than the preset data length, then the data of the data packet is written into the data carrier page in the target data flow table entry, including: If the data length of the data packet is greater than the preset data length, and the target data flow table entry meets the preset table entry conditions, then the data of the data packet is written into the data carrying page in the target data flow table entry; If the data length of the data packet is greater than the preset data length, and the target data flow table entry does not meet any of the preset table entry conditions, then a new data bearer page for the target data flow table entry is obtained, and the data of the data packet is written into the new data bearer page.

3. The method as described in claim 2, characterized in that, The preset entry conditions include that the page identifier is valid, the entry sequence number is the sequence number field value in the current data packet, and the sum of the total length of the data packet and the data length of the current data packet is less than the length of the data-carrying page.

4. The method as described in claim 3, characterized in that, The table entry data of the target data stream includes the current page identifier, the current table entry number, the current total length of the current data packet, and the current length of the data carrying page; If the data length of the data packet is greater than the preset data length, and the target data stream entry does not meet any of the preset entry conditions, then a new data carrier page for the target data stream entry is obtained, including: If the data length of the data packet is greater than the preset data length, and the current page identifier is valid: When the current entry sequence number is not the value of the sequence number field in the data packet, or when the sum of the total length of the current data packet and the data length of the data packet is not less than the length of the current data-bearing page, if the data-bearing page in the target data stream entry contains historical data of historical data packets, then the data-bearing page containing the historical data is uploaded to the server, and a new data-bearing page for the target data stream entry is obtained; or, If the data carrier page in the target data flow table entry does not contain historical data for historical data packets, then a new data carrier page for the target data flow table entry is obtained.

5. The method as described in claim 4, characterized in that, The method further includes: If the data length of the data packet is greater than the preset data length, and the current page identifier in the target data flow table entry is invalid, a new data carrying page for the target data flow table entry is obtained.

6. The method as described in claim 4, characterized in that, The table data of the target data stream table entry also includes the table entry aging time; After writing the data packet into the data bearer page in the target data flow table entry, the method further includes: If no data from other data packets is added to the data carrier page in the target data flow table entry within the aging time of the table entry, then the data carrier page in the target data flow table entry is deleted, and the table entry identifier in the target data flow table entry is updated to valid.

7. The method as described in claim 4, characterized in that, The table entry data of the target data stream also includes a timeout period; After writing the data packet into the data bearer page in the target data flow table entry, the method further includes: If the timeout period is greater than the preset timeout threshold and the current page identifier is valid, then the data-bearing page containing the data in the target data flow table entry is uploaded to the server, and the current page identifier is updated to invalid.

8. The method as described in claim 6 or 7, characterized in that, The table entry data of the target data flow table entry also includes the current hit value, the current page identifier of the data carrying page, and the address of the data carrying page; the current hit value represents the number of times the data flow table entry corresponding to the data packet is determined to be the target data flow table entry; Updating the table entry data in the target data stream table includes: Update the current total length of the data packet to the sum of the total length of the data packet and the data length of the data packet; Update the current entry number to the sum of the sequence number field value in the data packet and the data length of the data packet; Mark the current page identifier of the data-carrying page as valid; Increment the current hit value by 1; Update the address of the data carrying page to the starting address of the data carrying page plus the updated total length of the data packet; The existence time and entry aging time of the data carrier page are both updated to the time when the data of the data packet is written to the data carrier page.

9. The method as described in claim 1, characterized in that, Updating the table entry data in the data flow table entry to be created includes: Update the four-tuple information in the data flow table entry to be created to the four-tuple information in the data packet; the four-tuple information includes the source IP address, destination IP address, source port, and destination port. Update the total length of the data packets in the data flow table entry to be created to the total length of the data packets; Update the entry number in the data flow table to be created to the sum of the entry number field value in the data packet and the data length of the data packet; Set the entry identifier in the data flow table entry to be created to invalid, and set the page identifier of the target data carrying page to valid; Update the address of the target data carrying page to the starting address of the target data carrying page plus the updated total length of the data packet; Update the existence time and aging time of the data carrier page in the data flow table entry to be created to the time when the data of the data packet is written to the target data carrier page; Set both the hit value and the miss value in the data flow table entry to be created to 0.

10. A processing apparatus for data flow table entries, characterized in that, The device includes: The receiving unit is used to receive data packets transmitted through the Transmission Control Protocol (TCP) session connection on the current network, and extract the four-tuple information of the data packets; The determining unit is used to determine the target data flow table entry corresponding to the data packet based on the four-tuple information of the data packet; The writing unit is used to write the data of the data packet into the data bearer page of the target data flow table entry if the data length of the data packet is greater than the preset data length. An update unit is used to update the table entry data in the target data stream table entry; The writing unit is further configured to write the data of the data packet into the data carrying page when the data length of the data packet is not greater than the preset data length; An upload unit is used to upload the data-carrying page containing the data to the server; or, when the historical data exists on the data-carrying page, upload the data-carrying page containing the historical data to the server and then upload the data to the server. The table entry data of the data flow table entry to be created includes a miss value and a hit value; the miss value represents the number of times the data flow table entry corresponding to the data packet was not determined to be the data flow table entry to be created. The update unit is further configured to, if the target data flow table entry corresponding to the data packet is not determined based on the four-tuple information of the data packet, and an entry in the pre-configured data flow table entry is identified as invalid, check whether the miss value in the data flow table entry to be created is greater than the hit value; if the miss value is not greater than the hit value, update the miss value in the data flow table entry to be created by 1. The upload unit is also used to upload the data packet to the server; when the miss value is greater than the hit value and the data carrier page in the data flow table entry to be created contains historical data of historical data packets, the data carrier page of the historical data is uploaded to the server. The writing unit is further configured to retrieve a data carrier page from the Page pool as the target data carrier page for the data flow table entry to be created; and write the data of the data packet into the target data carrier page of the data flow table entry to be created; The update unit is also used to update the table entry data in the data flow table entry to be created.

11. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 9.

Citation Information

Patent Citations

  • Packet Filter Optimization For Network Interfaces

    US20100106874A1

  • TCP-aware receive side coalescing

    US20130205037A1