CN117812136A - TCP message transmission method and device - Google Patents

TCP message transmission method and device Download PDF

Info

Publication number
CN117812136A
CN117812136A CN202311848067.6A CN202311848067A CN117812136A CN 117812136 A CN117812136 A CN 117812136A CN 202311848067 A CN202311848067 A CN 202311848067A CN 117812136 A CN117812136 A CN 117812136A
Authority
CN
China
Prior art keywords
key value
session
tuple
tcp
address
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
CN202311848067.6A
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.)
Jingxin Microelectronics Technology Tianjin Co Ltd
Original Assignee
Jingxin Microelectronics Technology Tianjin 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 Jingxin Microelectronics Technology Tianjin Co Ltd filed Critical Jingxin Microelectronics Technology Tianjin Co Ltd
Priority to CN202311848067.6A priority Critical patent/CN117812136A/en
Publication of CN117812136A publication Critical patent/CN117812136A/en
Pending legal-status Critical Current

Links

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/50Reducing energy consumption in communication networks in wire-line communication networks, e.g. low power modes or reduced link rate

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The application discloses a TCP message transmission method and device, and relates to the technical field of communication. Receiving a TCP message sent by Ethernet side equipment; performing preset hash processing on the five-tuple of the TCP message to obtain a preset key value corresponding to the TCP message; based on a preset key value, matching a session number corresponding to a five-tuple of the TCP message from a session information storage table; and processing and transmitting the TCP message based on the session connection corresponding to the matched session number. Because the session information storage table comprises a plurality of key value addresses and a plurality of mapping relations between five-tuple and session numbers corresponding to the plurality of key value addresses, a TCP offload engine can process and transmit TCP messages connected by multiple paths of sessions through the session information storage table, the number of supporting TCP sessions is not limited by chip or FPGA resources any more, and the requirement of excessive TCP sessions under the high concurrency condition can be supported.

Description

TCP message transmission method and device
Technical Field
The present invention relates to the field of communications technologies, and in particular, to a method and an apparatus for transmitting a TCP packet.
Background
According to the conventional TCP/IP (Transmission Control Protocol/Internet Protocol ) in the process of processing network data transmission, a large amount of host CPU (Central Processing Unit ) resources are occupied, and in order to relieve the pressure of the CPU, network data that needs to be processed by a part of TCP/IP protocol can be transferred from the CPU to TOE hardware for processing through TOE (TCP/IP Offload Engine ) technology, so that the burden of the CPU is reduced.
In the prior art, a common implementation manner of the TOE technique is that each session corresponds to one TOE module, and five tuples (including a source IP address, a source port, a destination IP address, a destination port, and a transport layer protocol) of a TCP packet are sent to all TOE modules through a bus, so that each TOE module determines whether the TCP packet belongs to the TOE module and performs preemptive answering. The number of TOE modules is limited by the chip or FPGA (Field Programmable Gate Array ) resources and cannot support excessive TCP session requirements in high concurrency situations.
In summary, the number of TCP sessions in the prior art is limited by the number of TOE modules, and it is not possible to support excessive TCP session requirements under high concurrency.
Disclosure of Invention
Based on the above problems, the present application provides a method and an apparatus for transmitting TCP packets, where the number of TCP sessions is not limited to the number of TOE modules, and can support excessive TCP session requirements under high concurrency.
The embodiment of the application discloses the following technical scheme:
in a first aspect, the present application provides a method for transmitting a TCP packet, applied to a TCP offload engine, where the method includes:
receiving a TCP message sent by Ethernet side equipment;
Performing preset hash processing on the five-tuple of the TCP message to obtain a preset key value corresponding to the TCP message;
based on the preset key value, matching the session number corresponding to the five-tuple of the TCP message from a session information storage table; wherein the session information storage table includes: a plurality of key value addresses and the mapping relation between five-tuple and session number stored by the key value addresses;
and processing and transmitting the TCP message based on the session connection corresponding to the matched session number.
Optionally, the matching, based on the preset key value, the session number corresponding to the five-tuple of the TCP packet from the session information storage table includes:
performing exclusive-or calculation on the preset key value and the lowest bit of each tuple of the five-tuple of the TCP message, and determining left and right branch offset indications of the preset key value based on the exclusive-or calculation result of the preset key value;
and based on the preset key value and the left branch offset indication and the right branch offset indication of the preset key value, matching the session number corresponding to the five-tuple of the TCP message from a session information storage table.
Optionally, the matching, based on the preset key value and the left-right branch offset indication of the preset key value, the session number corresponding to the five-tuple of the TCP packet from the session information storage table includes:
Reading five-tuple and corresponding session number stored by the preset key value address from the session information storage table;
judging whether the five-tuple of the TCP message is matched with the five-tuple stored in the preset key value address;
if yes, matching to the session number corresponding to the five-tuple of the TCP message; the corresponding session number is stored in the preset key value address;
if not, determining the next preset address according to the left branch offset indication and the right branch offset indication; and re-matching the session number corresponding to the five-tuple of the TCP message based on the next preset address until the session number corresponding to the five-tuple of the TCP message is matched.
Optionally, the method further comprises:
and when the session number corresponding to the five-tuple of the TCP message is not matched, marking the TCP message as an invalid message, and returning an invalid signal to Ethernet side equipment for transmitting the TCP message.
Optionally, the processing and transmitting the TCP packet based on the session connection corresponding to the matched session number includes:
analyzing the TCP message to obtain effective data carried by the TCP message;
storing the effective data carried by the TCP message into a buffer memory corresponding to the matched session number;
Sending an application unloading request to user side equipment corresponding to session connection corresponding to the session number;
and receiving a response of the user side equipment to the application unloading request, reading effective data carried by the TCP message from a buffer memory corresponding to the matched session number, and transmitting the effective data to the user side equipment.
Optionally, the number of the preset key values is 2N; wherein N is a positive integer.
Optionally, when the number of preset key values is 2, the preset key values include a first key value and a second key value;
performing a preset hash processing on the five-tuple of the TCP packet to obtain a preset key value corresponding to the TCP packet, including:
performing hash processing on the five-tuple of the TCP message by using a first hash algorithm and a second hash algorithm respectively to obtain a first key value and a second key value corresponding to the TCP message; wherein the first hash algorithm and the second hash algorithm are different hash algorithms.
Optionally, the session information storage table further includes: the session state information corresponding to the session number, the method further comprises:
acquiring data indicated by user side equipment and a corresponding session number;
Based on the corresponding session number, reading the corresponding quintuple and the corresponding session state information from the session information storage table;
based on the corresponding five-tuple and the corresponding session state information, packaging the data indicated by the user side equipment to obtain a corresponding TCP message;
and transmitting the corresponding TCP message to the corresponding Ethernet side equipment through the session connection corresponding to the corresponding session number.
Optionally, before the corresponding TCP packet is transmitted to the corresponding ethernet side device through the session connection corresponding to the session number, the method further includes:
judging whether a back pressure signal returned by the Ethernet side equipment is received or not;
when a back pressure signal returned by the Ethernet side equipment is received, the corresponding TCP message is not transmitted to the corresponding Ethernet side equipment;
the transmitting the corresponding TCP message to the corresponding ethernet side device through the session connection corresponding to the session number includes:
and when the back pressure signal returned by the Ethernet side equipment is not received, transmitting the corresponding TCP message to the corresponding Ethernet side equipment through the session connection corresponding to the session number.
In a second aspect, the present application provides a TCP packet transmission device, including:
the message receiving module is used for receiving the TCP message sent by the Ethernet side equipment;
the key value determining module is used for carrying out preset hash processing on the five-tuple of the TCP message to obtain a preset key value corresponding to the TCP message;
the session number matching module is used for matching the session number corresponding to the five-tuple of the TCP message from a session information storage table based on the preset key value; the session information storage module is configured to store the session information storage table, where the session information storage table includes: a plurality of key value addresses and the mapping relation between five-tuple and session number stored by the key value addresses;
and the message processing module is used for processing and transmitting the TCP message based on the session connection corresponding to the matched session number.
Optionally, the session number matching module is specifically configured to read, from the session information storage table, a quintuple stored in a preset key value address and a corresponding session number; judging whether the five-tuple of the TCP message is matched with the five-tuple stored by the preset key value address; if yes, matching to the session number corresponding to the five-tuple of the TCP message; the corresponding session number is stored by a preset key value address; if not, determining the next preset address according to the left branch offset indication and the right branch offset indication; and re-matching the session number corresponding to the five-tuple of the TCP message based on the next preset address until the session number corresponding to the five-tuple of the TCP message is matched.
Optionally, the apparatus further comprises: and the invalidation judging module is used for marking the TCP message as an invalidation message when the session number corresponding to the five-tuple of the TCP message is not matched, and returning an invalidation signal to the Ethernet side equipment for sending the TCP message.
Optionally, the message processing module is specifically configured to parse the TCP message to obtain valid data carried by the TCP message; storing the effective data carried by the TCP message into a buffer corresponding to the matched session number; sending an application unloading request to user side equipment corresponding to session connection corresponding to the session number; and receiving a response of the user side equipment to the application unloading request, reading effective data carried by the TCP message from a buffer memory corresponding to the matched session number, and transmitting the effective data to the user side equipment.
Optionally, a session information storage module is configured to store the session information storage table; the session information storage table further includes: and session state information corresponding to the session number. The apparatus further comprises: the data acquisition module is used for acquiring data indicated by the user side equipment and a corresponding session number; the package information acquisition module is used for reading the corresponding five-tuple and the corresponding session state information from the session information storage table based on the corresponding session number; the message packaging module is used for packaging the data indicated by the user side equipment based on the corresponding five-tuple and the corresponding session state information to obtain a corresponding TCP message; and the message processing module is also used for transmitting the corresponding TCP message to the corresponding Ethernet side equipment through the session connection corresponding to the corresponding session number.
Compared with the prior art, the application has the following beneficial effects: because the session information storage table comprises a plurality of key value addresses and a plurality of mapping relations between quintuples and session numbers corresponding to the plurality of key value addresses, matching is carried out according to the quintuples of the TCP message and the quintuples stored in the information storage unit, so that the session numbers corresponding to the TCP message are determined, and the TCP message is processed and transmitted based on the session connection corresponding to the matched session numbers, so that the processing and transmission of the TCP message based on the TOE technology are realized. The data transmission of the multipath TCP session can be realized through one TCP offload engine, the number of the supported TCP session is not limited by the number of TOE modules, namely, the number of the supported TCP session is not limited by chip or FPGA resources, and the requirement of excessive TCP session under the high concurrency condition can be supported.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described below, it being obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive faculty for a person skilled in the art.
Fig. 1 is a flow chart of a method for transmitting a TCP packet according to an embodiment of the present application;
FIG. 2A is a flow chart illustrating a method for establishing a key value address tree according to an embodiment of the present application;
fig. 2B is a schematic diagram of a session information storage table according to an embodiment of the present application;
fig. 3 is a flow chart of matching session numbers corresponding to five tuples of a TCP packet according to an embodiment of the present application;
FIG. 4 is a schematic diagram of a session information storage table according to an embodiment of the present disclosure;
fig. 5 is a schematic flowchart of a specific process for processing and transmitting a TCP packet according to an embodiment of the present application;
fig. 6 is a flow chart of another TCP packet transmission method according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of a TCP packet transmission device according to an embodiment of the present application.
Detailed Description
As described above, in the prior art, a common implementation manner of the TOE technique is that one TOE module corresponding to each session, that is, each combination of TCP five-tuple corresponds to one TOE module alone, the five-tuple of the TCP packet is sent to all TOE modules through the bus, and each TOE module determines whether the TCP packet belongs to the TOE module, and when the TCP packet belongs to a certain TOE module, the TOE module performs a preemptive answer, so that the TOE module is used to process and transmit the TCP packet. However, the number of TOE modules in the implementation of this TOE technique is limited by the resources of the chip or FPGA, and the number of TOE modules that can be placed is limited, i.e. the number of TCP sessions that can be finally supported is limited by the number of TOE modules placed, so that the requirement of too many TCP sessions in the case of high concurrency cannot be supported.
Further, for devices with too small resources of the chip or FPGA itself, the basic TCP session requirements cannot be met.
Further, a plurality of TOE modules are arranged, more chip or FPGA resources are occupied, and unnecessary waste of resources is caused.
The application provides a TCP message transmission method, which comprises the steps of receiving a TCP message sent by Ethernet side equipment; performing preset hash processing on the five-tuple of the TCP message to obtain a preset key value corresponding to the TCP message; based on a preset key value, matching a session number corresponding to a five-tuple of the TCP message from a session information storage table; and processing and transmitting the TCP message based on the session connection corresponding to the matched session number. Because the session information storage table comprises a plurality of key value addresses and a plurality of mapping relations between quintuples and session numbers corresponding to the plurality of key value addresses, matching is carried out according to the quintuples of the TCP message and the quintuples stored in the information storage unit, so that the session numbers corresponding to the TCP message are determined, and the TCP message is processed and transmitted based on the session connection corresponding to the matched session numbers, so that the processing and transmission of the TCP message based on the TOE technology are realized. The data transmission of the multipath TCP session can be realized through one TCP offload engine, the number of the supported TCP session is not limited by the number of TOE modules, namely, the number of the supported TCP session is not limited by chip or FPGA resources, and the requirement of excessive TCP session under the high concurrency condition can be supported.
Furthermore, one TCP offload engine can realize the transmission of multiple TCP sessions, multiple TOE modules (TCP offload engines) are not required to be set, multiple TCP sessions are supported, and meanwhile, the TCP offload engines are not required to be set too much, so that the resource waste is reduced, and meanwhile, the overall cost is saved.
In order to make the present application solution better understood by those skilled in the art, the following description will clearly and completely describe the technical solution in the embodiments of the present application with reference to the accompanying drawings in the embodiments of the present application, and it is apparent that the described embodiments are only some embodiments of the present application, not all embodiments. All other embodiments, which can be made by one of ordinary skill in the art without undue burden from the present disclosure, are within the scope of the present disclosure.
Embodiment one:
a method for transmitting a TCP message according to an embodiment of the present application is described in detail below with reference to fig. 1 to 5. The method is applied to a TCP offload engine (i.e., TOE module).
S101, receiving a TCP message sent by Ethernet side equipment.
TCP (Transmission Control Protocol ) is a connection-oriented, reliable, ordered, byte-stream based transport layer communication protocol, among other things.
S102, performing preset hash processing on the five-tuple of the TCP message to obtain a preset key value corresponding to the TCP message.
Specifically, after preset splicing is performed on the five-tuple of the TCP message, preset hash processing is performed on the spliced five-tuple to obtain a preset key value corresponding to the TCP message.
In one possible implementation, the number of preset key values is 2N, where N is a positive integer.
For ease of understanding, two preset key values are exemplified below. The number of preset key values is 2, and the preset key values include: a first key value (key 1) and a second key value (key 2).
And carrying out hash processing on the five-tuple of the TCP message by using a first hash algorithm and a second hash algorithm respectively to obtain a first key value and a second key value corresponding to the TCP message. Carrying out hash processing on the five-tuple of the TCP message by using a first hash algorithm to obtain a key1; and carrying out hash processing on the five-tuple of the TCP message by using a second hash algorithm to obtain key2. The validity of key1 and key2 can be effectively improved by different hash algorithms in the first hash algorithm and the second hash algorithm.
It should be noted that, different two hash algorithms may be adopted to hash five-tuple of the TCP packet to obtain two preset key values respectively; the same hash algorithm may be used to hash five-tuple of the TCP packet, and hash results of different bits of the hash result may be intercepted to obtain two preset key values, which is not limited in this application.
S103, based on the preset key value, the session number corresponding to the five-tuple of the TCP message is matched from a session information storage table.
Wherein the session information storage table includes: a plurality of key value addresses, and a mapping relationship between a five-tuple and a session number stored by the key value addresses. To achieve mapping of five tuples and session numbers of the TCP message. The transmission of multiple TCP sessions can be realized by only one TOE module, so that the requirement of excessive TCP sessions under the condition of high concurrency can be supported, and the number of supported TCP sessions is not limited by the number of the TOE modules.
For ease of understanding, the following description is given by way of example only with respect to the key address corresponding to one preset key, and the stored five-tuple and session number in table 1.
TABLE 1
Key value address Session information
Address 1 Five-tuple B and session number 2
Address 2 Quintuple D and Session number 4
Address 3 Quintuple E and Session number 5
Address 4 Five-tuple F and session number 6
Address 5 Invalidation of
Address 6 Invalidation of
It should be noted that the five-tuple stored in the different key addresses are different, and each five-tuple represents one session connection, i.e. the five-tuple and the session number stored in the different key addresses represent different session connections. When the five-tuple is the same between the TCP messages, the session connection is the same, namely the same session connection is adopted. As shown in table 1, wherein the key value address in the session information storage table is address 1, and five-tuple B and corresponding session number 2 stored in address 1; the key value address is address 2, five-tuple D and corresponding session number 4 stored in address 2; the key value address is address 3, and the address 3 stores five-tuple E and a corresponding session number 5; the key value address is address 4, and the address 4 stores five-tuple F and a corresponding session number 6; address 5 and address 6 do not store the corresponding five-tuple and corresponding session number.
Specifically, performing exclusive-or calculation on the preset key value and the lowest bit of each tuple of the five-tuple of the TCP message, and determining left and right branch offset indications of the preset key value based on an exclusive-or calculation result of the preset key value; and based on the preset key value and the left branch offset indication and the right branch offset indication of the preset key value, matching the session number corresponding to the five-tuple of the TCP message from a session information storage table.
The exclusive-or calculation is a logic uniform speed, and when a=b, a exclusive-or b is 0; when a+.b, a exclusive OR b is 1. Wherein the mathematical sign of the exclusive or calculation is @.
Specifically, the exclusive or calculation is performed between the preset key value and the lowest bit of each tuple of the five-tuple of the TCP packet, where the exclusive or calculation is: presetting a key value of the lowest bit of a source port of a source IP address, the lowest bit of a destination port of a transport layer protocol, and the lowest bit of a transport layer protocol, obtaining an exclusive-OR calculation result, and determining left and right branch offset indications of the preset key value based on the exclusive-OR calculation result. For example: the exclusive-or calculation result is 0 and indicates the left branch offset, and the exclusive-or calculation result is 1 and indicates the right branch offset. Note that, the exclusive or calculation result may be a left branch offset instruction with 1, and the exclusive or calculation result may be a right branch offset instruction with 0, which are not particularly limited in this application.
In one possible implementation, based on a key value address tree of a preset key value, according to the preset key value and the left-right branch offset indication of the preset key value, the session number corresponding to the five-tuple of the TCP message is matched from the session information storage table.
The key value address tree is established in advance according to a preset key value address, left and right branch offset indication of a preset key value and a session information storage table. The preset key value address is an address corresponding to the preset key value in the session information storage table.
The key address tree creation process is described in detail below in conjunction with fig. 2A.
And S11, when the TCP session connection is established, performing preset hash processing on the five-tuple of the TCP session to obtain a preset key value corresponding to the TCP session.
S12, judging whether a preset key value address in the session information storage table stores the mapping relation between the quintuple and the session number.
And when the mapping relation between the five-tuple and the session number is not stored in the preset key value address in the session information storage table, S13 is performed.
When the mapping relationship between the five-tuple and the session number is stored in the preset key value address in the session information storage table, S14 is performed.
S13, storing the quintuple and the corresponding session number into a preset key value address of the session information storage table, marking the quintuple and the corresponding session number as effective addresses, and filling the preset key value address into a key value address tree corresponding to the preset key value.
S14, performing exclusive OR calculation on the preset key value and the lowest bit of each element of the five-element group, and determining left and right branch offset indication of the preset key value based on an exclusive OR calculation result of the preset key value.
S15, judging whether an effective address exists in a branch of a preset key value address in a key value address tree corresponding to the preset key value according to the left branch offset indication and the right branch offset indication of the preset key value.
And when the effective address exists in the offset branch of the preset key value address in the key value address tree corresponding to the preset key value, updating the key value corresponding to the effective address of the offset branch to the preset key value, and repeating S14.
And when the valid address does not exist in the paranoid of the preset key value address in the address value tree corresponding to the preset key value, S16 is performed.
S16, storing the quintuple and the corresponding session number into any invalid address of the session information storage table, marking the invalid address storing the quintuple and the corresponding session number as an effective address, and filling the effective address-free branch in a key value address tree corresponding to a preset key value.
When an effective address exists in a branch of a preset key value address in a key value address tree corresponding to a preset key value, updating the key value corresponding to the effective address of the branch to the preset key value, carrying out exclusive-or calculation on the preset key value and the lowest bit of each element of the five-element group again, determining left and right branch offset indication of the preset key value based on an exclusive-or calculation result of the preset key value, and judging whether the effective address exists in the branch. Therefore, the left branch index and the right branch index are recalculated, the load degree of the tree structure of the key value address tree can be reduced, if the left branch index and the right branch index obtained by the first operation are always used, the conflicted quintuple always shifts towards the same direction, the tree structure is more complex, and the query times in the session number matching process are excessive. If the key value corresponding to the effective address of the offset branch is updated to the preset key value every time, the offset indexes of the left branch and the right branch are recalculated, and the offset direction of two conflicted five-tuple groups is changed with high probability, so that the whole tree structure is more uniform, and the height is reduced.
Further, with the establishment of the key value address tree, the session information storage table is also synchronously established.
For ease of understanding, a detailed description of how the session information storage table is established will be provided below. Taking the preset key value including the first key value (key 1) and the second key value (key 2) as an example for explanation.
When the TCP session connection is established, the five-tuple of the TCP session is hashed by using a first hash algorithm and a second hash algorithm to obtain a key1 and a key2. And performing exclusive OR calculation with the key1 and the key2 according to the lowest bit of each element of the five-element group to obtain left and right branch offset indications of the key1 and the key2.
Then, reading a key1 address in the session information storage table, if the key1 address is invalid, simultaneously storing the five-tuple and the corresponding session number into the key1 address in the session information storage table, and marking the key1 address as valid; if the key1 address is valid, the key2 address in the session storage unit is read, and if the key2 address is invalid, the five-tuple and the corresponding session number are simultaneously stored in the key2 address in the session information storage table, and the key2 address is marked as valid.
When the key1 address and the key2 address are both valid, inquiring whether a left/right branch of the key1 is valid according to a left/right branch offset indication of the key1 (namely, if the left/right branch offset indication of the key1 is characterized as a left branch offset indication, inquiring whether the left branch address of the key1 is valid), if the left/right branch of the key1 is determined to be invalid, storing one of invalid addresses of a session information storage table into the left/right branch of the key1, and storing a quintuple and a corresponding session number into the address to finish mapping the quintuple and the session number; if the left/right branch of the key2 is determined to be valid, inquiring whether the left/right branch of the key2 is valid or not according to the left/right branch offset indication of the key2, and if the left/right branch of the key2 is determined to be invalid, storing one of invalid addresses of a session information storage table into the left/right branch of the key2, and storing the five-tuple and the corresponding session number into the address to finish mapping the five-tuple and the session number.
When the left/right branch of the key1 and the left/right branch of the key2 are valid, updating the key value corresponding to the left/right branch address of the key1 and the key value corresponding to the left/right branch address of the key2 into the key1 and the key2. And repeating the steps based on the updated key1 and key2 until the five-tuple and the corresponding session number are stored in the session information storage table, and finishing the mapping of the five-tuple and the session number.
Taking fig. 2B as an example, a key address tree establishment procedure and a session information storage table establishment procedure are described. Only one preset key value is taken as an example for introduction.
When establishing TCP session connection, hash processing is carried out on five-tuple of the session to obtain a preset key value keyA, the keyA address is an address 4, exclusive OR calculation is carried out according to the least significant bit of each element of the five-tuple and the keyA, and the obtained left branch offset indication and right branch offset indication are right branch offset indications.
As shown in fig. 2 (a), address 4 in the session information storage table is read, and five-tuple a and session number 1 are stored in address 4, i.e. address 4 is valid; inquiring that the right branch address of the address 4 is valid and is the address 7 according to the right branch offset indication; updating the key value corresponding to the address 7 to be key A, and carrying out exclusive OR calculation according to the least significant bit of each element of the five-element group and the key A again to obtain a left branch offset indication, wherein the left branch offset indication is a left branch offset indication, and the left branch address of the query address 7 is invalid, and then randomly selecting an invalid address of the session information storage table, for example: address 8, storing address 8 in the left branch of the address, and storing the five-tuple and the corresponding session number (e.g. five-tuple G and session number 7) of the session in address 8, to complete the mapping of the five-tuple and the session number (as shown in fig. 2 (B)).
When describing how to build the session information storage table, the following describes in detail with reference to fig. 3 and fig. 4, a flow of matching session numbers corresponding to five tuples of a TCP packet provided in the embodiment of the present application. As shown in a flow diagram of matching session numbers corresponding to five tuples of a TCP packet in fig. 3, the flow diagram is as follows:
s21, reading the quintuple stored by the preset key value address and the corresponding session number from the session information storage table.
S22, judging whether the five-tuple of the TCP message is matched with the five-tuple stored in the preset key value address.
When the five-tuple of the TCP packet is different from the five-tuple stored in the preset key address, it is indicated that the five-tuple of the TCP packet is not matched with the five-tuple stored in the preset key address, and S23 is performed.
When the five-tuple of the TCP packet is the same as the five-tuple stored in the preset key address, it is indicated that the five-tuple of the TCP packet is matched with the five-tuple stored in the preset key address, and S26 is performed.
S23, performing exclusive OR calculation on the preset key value and the lowest bit of each tuple of the five-tuple of the TCP message, and determining left and right offset indications of the preset key based on an exclusive OR calculation result of the preset key value. S24, determining the next preset address according to the corresponding key value address tree and the left branch offset indication and the right branch offset indication.
Wherein the next preset address may be a left/right branch address of the preset key address; further, the next preset address may be a left/right branch address of the preset key address.
S25, based on the next preset address, reading the five-tuple stored in the next preset address and the corresponding session number, and judging whether the five-tuple of the TCP message is matched with the five-tuple stored in the next preset address.
If yes, S26 is carried out, and the session number corresponding to the five-tuple of the TCP message is matched.
If not, updating the key value corresponding to the next preset address to the preset key value, and repeating S23 until the session number corresponding to the five-tuple of the TCP message is matched.
S26, matching the session number corresponding to the five-tuple of the TCP message.
Specifically, when S22 determines that the answer is yes, the corresponding session number is the corresponding session number stored in the preset key value address. And when the judgment of S25 is yes, the corresponding session number is the corresponding session number stored in the next preset address.
Further, in one possible implementation manner, the five-tuple of the TCP packet cannot be matched to the corresponding session number in the session information storage table, the next preset address finally determined by the five-tuple of the TCP packet is an invalid address, the TCP packet is marked as an invalid packet at this time, and an invalid signal is returned to the ethernet side device that sends the TCP packet, so as to prompt that the ethernet side device cannot transmit the TCP packet.
Further, when the five-tuple of the TCP packet cannot be matched to the corresponding session number in the session information storage table, the TCP session connection can be established according to the TCP packet according to the SYN bit and FIN bit identification of the TCP packet, if the SYN bit of the TCP packet is valid, and the five-tuple of the TCP packet and the corresponding session number are stored in the session information storage table, so that when the TCP packet with the same five-tuple is received again later, the TOE technique can be adopted to realize transmission of the TCP packet. The SYN bit is a synchronization flag that is only valid when the three-way handshake establishes a TCP connection.
For easy understanding, the following describes, by way of example, a procedure for matching session numbers corresponding to five tuples of a TCP packet according to an embodiment of the present application with reference to fig. 4. And taking the number of preset key values as 1, the preset key values as key B, and the key B address as address 1.
Firstly, the five-tuple B stored in the address 1 and the corresponding session number 2 are read, and whether the five-tuple of the TCP message and the five-tuple B in the address 1 are the same is judged.
If the five-tuple is the same, the session number corresponding to the five-tuple of the TCP message is session number 2.
If the two branch offset indications are different, performing exclusive or calculation on the key B and the lowest bit of each element of the five-element group of the TCP message, and determining that the left branch offset indication and the right branch offset indication of the key B are left branch offset indications based on exclusive or calculation results of preset key values, and determining that the next preset address is address 2 according to the left branch offset indications. And reading the five-tuple D and the session number 4 stored in the address 2, and judging whether the five-tuple of the TCP message and the five-tuple D in the address 2 are the same.
If the five-tuple is the same, the session number corresponding to the five-tuple of the TCP message is session number 4.
If the key values are different, updating the key value corresponding to the address 2 to be the key B, carrying out exclusive OR calculation on the key B and the lowest bit of each element of the five-element group of the TCP message again, determining that the left branch offset indication and the right branch offset indication of the key B are right branch offset indications based on exclusive OR calculation results of preset key values, and determining that the next preset address is the address 4 according to the right branch offset indications. Reading the five-tuple F and the session number 6 stored in the address 4, judging whether the five-tuple F in the TCP message is the same as the five-tuple F in the address 4, and if so, judging that the session number corresponding to the five-tuple of the TCP message is the session number 6; if the key values are different, the key value corresponding to the address 4 is updated to be the key B, the left branch offset indication and the right branch offset indication of the key B are recalculated to be left branch offset indications, the next preset address is determined to be an invalid address according to the left branch offset indications, and the TCP message is determined to be an invalid message.
In summary, the five-tuple stored by the preset key value address and the corresponding session number are read from the session information storage table; judging whether the five-tuple of the TCP message is matched with the five-tuple stored by the preset key value address; if yes, matching to the session number corresponding to the five-tuple of the TCP message; the corresponding session number is stored by a preset key value address; if not, carrying out exclusive or calculation on the preset key value and the lowest bit of each element of the five-element group of the TCP message, determining left and right offset indications of the preset key based on the exclusive or calculation result of the preset key value, and determining the next preset address according to the left and right offset indications; and judging whether the five-tuple stored in the next preset address is matched with the five-tuple of the TCP message or not based on the next preset address, if not, updating the key value corresponding to the next preset address to the preset key value, and re-determining left and right branch offset indications of the preset key value address, and re-matching the session number of the five-tuple of the TCP message until the session number corresponding to the five-tuple of the TCP message is matched. According to the preset key value and the left branch offset indication, the corresponding session number is matched through whether the five-tuple in the session information storage table is the same as the five-tuple in the TCP message, and the prior art does not need to traverse all TOE modules, so that each TOE module judges whether the TCP message belongs to the TOE module, and the matching operation of the session number is simplified.
S104, processing and transmitting the TCP message based on the session connection corresponding to the matched session number.
The five-tuple is used for representing one session connection, and different five-tuple represents different session connections; each five-tuple has a one-to-one mapped session number, i.e., each session number has a corresponding session connection.
Specifically, S104 is described in detail below in conjunction with fig. 5.
S501, analyzing the TCP message to obtain effective data carried by the TCP message.
Illustratively, the TCP packet is parsed to obtain a parsing result, and valid data (payload) carried by the TCP packet is extracted from the parsing result.
Further, the TCP message is analyzed to obtain an analysis result, and the ACK reply instruction and the current session state are stored in the corresponding address of the session information storage table according to the analysis result of the TCP message. The corresponding address is the address corresponding to the session number matched by the five-tuple of the TCP message. The method is convenient for judging whether the transmission sequence of the TCP message is wrong or not and processing the TCP message according to the current session state and the like according to the ACK reply instruction and the current session state stored in the session information storage table.
S502, storing the effective data carried by the TCP message into a buffer corresponding to the matched session number.
Each session number (i.e., each session connection/five-tuple) has a corresponding buffer for storing valid data carried by the TCP packet.
S503, sending an application unloading request to user side equipment corresponding to session connection corresponding to the session number.
Each session number has a corresponding session connection, which is determined by the IP addresses at both ends, the ports at both ends, and the transport layer protocol, and the session connection has a corresponding user side device. And after the effective data of the TCP message is stored in the corresponding buffer, sending an application unloading request to user side equipment (a receiving end of the TCP message).
S504, when receiving a response of the user side equipment to the application unloading request, reading effective data carried by the TCP message from a buffer corresponding to the matched session number, and transmitting the effective data to the user side equipment.
The user side device (i.e. the receiving end) receives the request for unloading, and responds to the request for unloading when the user side device can process the effective data of the TCP message according to the condition whether the user side device can receive the effective data of the TCP message. When receiving the response of the user side equipment to the application unloading request, the user side equipment (receiving end) is allowed to receive/process the effective data of the TCP message, and the effective data carried by the TCP message is read from the buffer memory corresponding to the matched session number and is transmitted to the user side equipment. And finishing the transmission of the TCP message.
The embodiment of the application provides a TCP message transmission method, which is applied to a TCP offload engine (TOE module), and comprises the following steps: receiving a TCP message sent by Ethernet side equipment; performing preset hash processing on the five-tuple of the TCP message to obtain a preset key value corresponding to the TCP message; based on a preset key value, matching a session number corresponding to a five-tuple of the TCP message from a session information storage table; and processing and transmitting the TCP message based on the session connection corresponding to the matched session number. Because the session information storage table comprises a plurality of key value addresses and a plurality of mapping relations between quintuples and session numbers corresponding to the plurality of key value addresses, matching is carried out according to the quintuples of the TCP message and the quintuples stored in the information storage unit, so that the session numbers corresponding to the TCP message are determined, and the TCP message is processed and transmitted based on the session connection corresponding to the matched session numbers, so that the processing and transmission of the TCP message based on the TOE technology are realized. The data transmission of the multipath TCP session can be realized through one TCP offload engine, the number of the supported TCP session is not limited by the number of TOE modules, namely, the number of the supported TCP session is not limited by chip or FPGA resources, and the requirement of excessive TCP session under the high concurrency condition can be supported.
Furthermore, one TCP offload engine can realize the transmission of multiple TCP sessions, multiple TOE modules (TCP offload engines) are not required to be set, multiple TCP sessions are supported, and meanwhile, the TCP offload engines are not required to be set too much, so that the resource waste is reduced, and meanwhile, the overall cost is saved.
Furthermore, the number of the TCP session support is not limited by the chip or FPGA resource, and the multipath TCP session support can be realized for the equipment with the too small chip or FPGA resource, so that the application range is wider.
Embodiment two:
a further TCP message transmission method provided in the embodiment of the present application is described in detail below with reference to fig. 6. Wherein the session information storage table further includes: the key value address stores corresponding session state information.
S601, acquiring data indicated by user side equipment and corresponding session numbers.
When the user side device sends a TCP packet to the ethernet side device, the indicated data (which may also be considered as the payload of the TCP packet) and the corresponding session number are sent to the TCP offload engine.
The corresponding session number is used for determining the corresponding quintuple and the corresponding session state information.
Further, when the data indicated by the user side device and the corresponding session number are obtained, the data are stored in the sending buffer corresponding to the session number. And traversing the current established session connection (i.e. the session connection corresponding to the session number stored in the session information storage table), and if the established session connection has data, preferentially processing the session connection with data.
S602, based on the corresponding session number, reading the corresponding quintuple and the corresponding session state information from the session information storage table.
In the session information storage table, in addition to the mapping relation between the five-tuple and the session number, session state information corresponding to the session number (i.e., session state information corresponding to the five-tuple) is stored in the key value address. That is, in the session information storage table, the mapping relation of the five-tuple, the session number, and the session state information is stored in the key value address.
S603, based on the corresponding five-tuple and the corresponding session state information, data indicated by the user side equipment are packaged, and a corresponding TCP message is obtained.
And encapsulating the five-tuple corresponding to the session number, the session state information and the data indicated by the user side in an encapsulation format of the TCP message to obtain the corresponding TCP message.
Before S603, the method further includes: judging whether the session connection needs to send data according to the session state information, for example: when the session state information indicates that the session connection is in a closed state, data does not need to be sent, and at the moment, the data indicated by the user side cannot be packaged into a TCP message for transmission; when the session state information indicates that the session is in a state of being successfully established, data can be sent, and the data indicated by the user side can be packaged into a TCP message for transmission.
S604, transmitting the corresponding TCP message to the corresponding Ethernet side equipment through the session connection corresponding to the corresponding session number.
Further, the method further includes, at S604: and judging whether a back pressure signal returned by the Ethernet side equipment is received or not.
The back pressure signal is used for controlling data transmission, so that data blocking is avoided. When the back pressure signal exists, the Ethernet side equipment can not receive the TCP message at the moment so as to control the data flow transmission.
Specifically, when a back pressure signal returned by the Ethernet side device is received, the corresponding TCP message is not transmitted to the corresponding Ethernet side device; and when the back pressure signal returned by the Ethernet side equipment is not received, transmitting the corresponding TCP message to the corresponding Ethernet side equipment through the session connection corresponding to the session number.
The embodiment of the application provides a TCP message transmission method, which comprises the following steps: acquiring data indicated by user side equipment and a corresponding session number; based on the corresponding session number, reading the corresponding quintuple and the corresponding session state information from the session information storage table; based on the corresponding five-tuple and the corresponding session state information, encapsulating the data indicated by the user side device to obtain a corresponding TCP message; and transmitting the corresponding TCP message to the corresponding Ethernet side equipment through the session connection corresponding to the corresponding session number. The data transmission of the multipath TCP session (the data transmission from the user side equipment to the Ethernet side equipment) is realized through one TCP offload engine, the number of supporting TCP sessions is not limited by the number of TOE modules, namely, the number of supporting TCP sessions is not limited by chip or FPGA resources, and the requirement of excessive TCP sessions under the high concurrency condition can be supported.
Embodiment III:
a detailed description of a TCP packet transmission device according to an embodiment of the present application is provided below with reference to fig. 7.
A message receiving module 701, configured to receive a TCP message sent by an ethernet side device;
the key value determining module 702 is configured to perform a preset hash process on the five-tuple of the TCP packet to obtain a preset key value corresponding to the TCP packet;
a session number matching module 703, configured to match, based on the preset key value, a session number corresponding to a five-tuple of the TCP packet from a session information storage table; the session information storage module 705 is configured to store the session information storage table, where the session information storage table includes: a plurality of key value addresses and the mapping relation between five-tuple and session number stored by the key value addresses;
and the message processing module 704 is configured to process and transmit the TCP message based on the session connection corresponding to the matched session number.
Further, the session number matching module 703 is specifically configured to perform exclusive-or calculation on the preset key value and the lowest bit of each tuple of the five-tuple of the TCP packet, and determine a left branch offset indication and a right branch offset indication of the preset key value based on the exclusive-or calculation result of the preset key value; based on the preset key value and the left branch offset indication and the right branch offset indication of the preset key value, the session number corresponding to the five-tuple of the TCP message is matched from the session information storage table.
Further, the session number matching module 703 is specifically configured to read, from the session information storage table, a quintuple stored in the preset key value address and a corresponding session number; judging whether the five-tuple of the TCP message is matched with the five-tuple stored by the preset key value address; if yes, matching to the session number corresponding to the five-tuple of the TCP message; the corresponding session number is stored by a preset key value address; if not, determining the next preset address according to the left branch offset indication and the right branch offset indication; and re-matching the session number corresponding to the five-tuple of the TCP message based on the next preset address until the session number corresponding to the five-tuple of the TCP message is matched.
Further, the apparatus further comprises: and the invalidation judging module is used for marking the TCP message as an invalidation message when the session number corresponding to the five-tuple of the TCP message is not matched, and returning an invalidation signal to the Ethernet side equipment for sending the TCP message.
Further, the message processing module 704 is specifically configured to parse the TCP message to obtain valid data carried by the TCP message; storing the effective data carried by the TCP message into a buffer corresponding to the matched session number; sending an application unloading request to user side equipment corresponding to session connection corresponding to the session number; and receiving a response of the user side equipment to the application unloading request, reading effective data carried by the TCP message from a buffer memory corresponding to the matched session number, and transmitting the effective data to the user side equipment.
Further, when the number of preset key values is 2, the preset key values include a first key value and a second key value; the key value determining module 702 is specifically configured to perform a preset hash process on a five-tuple of a TCP packet to obtain a preset key value corresponding to the TCP packet, where the key value determining module includes: performing hash processing on the five-tuple of the TCP message by using a first hash algorithm and a second hash algorithm respectively to obtain a first key value and a second key value corresponding to the TCP message; wherein the first hash algorithm and the second hash algorithm are different hash algorithms.
Further, a session information storage module 705, configured to store the session information storage table; the session information storage table further includes: and session state information corresponding to the session number. The apparatus further comprises: the data acquisition module is used for acquiring data indicated by the user side equipment and a corresponding session number; the package information acquisition module is used for reading the corresponding five-tuple and the corresponding session state information from the session information storage table based on the corresponding session number; the message packaging module is used for packaging the data indicated by the user side equipment based on the corresponding five-tuple and the corresponding session state information to obtain a corresponding TCP message; the message processing module 704 is further configured to transmit the corresponding TCP message to a corresponding ethernet side device through a session connection corresponding to the corresponding session number.
The embodiment of the application provides a TCP message transmission device, which comprises: a message receiving module 701, configured to receive a TCP message sent by an ethernet side device; the key value determining module 702 is configured to perform a preset hash process on the five-tuple of the TCP packet to obtain a preset key value corresponding to the TCP packet; a session number matching module 703, configured to match, based on the preset key value, a session number corresponding to a five-tuple of the TCP packet from a session information storage table; the session information storage module 705 is configured to store the session information storage table, where the session information storage table includes: a plurality of key value addresses and the mapping relation between five-tuple and session number stored by the key value addresses; and the message processing module 704 is configured to process and transmit the TCP message based on the session connection corresponding to the matched session number. Because the session information storage table stored by the session information storage module comprises a plurality of key value addresses and a plurality of corresponding mapping relations between quintuples and session numbers, the quintuples of the TCP message are matched with the quintuples stored by the information storage unit, so that the session number corresponding to the TCP message is determined, the TCP message is processed and transmitted based on the session connection corresponding to the matched session number, and the processing and the transmission of the TCP message are realized based on the TOE technology. The data transmission of the multipath TCP session can be realized by only setting one TCP message transmission device, the number of the supported TCP sessions is not limited by the number of TOE modules, namely the number of the supported TCP sessions is not limited by chip or FPGA resources, and the requirement of excessive TCP sessions under the condition of high concurrency can be supported.
It should be noted that, in the present specification, each embodiment is described in a progressive manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment is mainly described in a different point from other embodiments. In particular, for the method and apparatus embodiments, since they are substantially similar to the method embodiments, the description is relatively simple, and references to the details of the method embodiments are only provided. The above-described apparatus and system embodiments are merely illustrative, in which elements illustrated as separate elements may or may not be physically separate, and elements illustrated as elements may or may not be physical elements, may be located in one place, or may be distributed over a plurality of network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment. Those of ordinary skill in the art will understand and implement the present invention without undue burden.
The foregoing is merely one specific embodiment of the present application, but the scope of the present application is not limited thereto, and any changes or substitutions easily conceivable by those skilled in the art within the technical scope of the present application should be covered in the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (10)

1. A method for transmitting a TCP message, applied to a TCP offload engine, the method comprising:
receiving a TCP message sent by Ethernet side equipment;
performing preset hash processing on the five-tuple of the TCP message to obtain a preset key value corresponding to the TCP message;
based on the preset key value, matching the session number corresponding to the five-tuple of the TCP message from a session information storage table; wherein the session information storage table includes: a plurality of key value addresses and the mapping relation between five-tuple and session number stored by the key value addresses;
and processing and transmitting the TCP message based on the session connection corresponding to the matched session number.
2. The method according to claim 1, wherein the matching the session number corresponding to the five-tuple of the TCP packet from the session information storage table based on the preset key value includes:
performing exclusive-or calculation on the preset key value and the lowest bit of each tuple of the five-tuple of the TCP message, and determining left and right branch offset indications of the preset key value based on the exclusive-or calculation result of the preset key value;
and based on the preset key value and the left branch offset indication and the right branch offset indication of the preset key value, matching the session number corresponding to the five-tuple of the TCP message from a session information storage table.
3. The method according to claim 2, wherein the matching the session number corresponding to the five-tuple of the TCP packet from the session information storage table based on the preset key and the left-right branch offset indication of the preset key comprises:
based on a key value address tree of the preset key value, according to the left branch offset indication and the right branch offset indication of the preset key value and the preset key value, matching the session number corresponding to the five-tuple of the TCP message from a session information storage table; the key value address tree is established in advance according to a preset key value address, left and right branch offset indications of the preset key value and the session information storage table; the preset key value address is an address corresponding to the preset key value in the session information storage table.
4. A method according to claim 3, wherein the key address tree is established by:
s11, when establishing TCP session connection, performing preset hash processing on five-tuple of the TCP session to obtain a preset key value corresponding to the TCP session;
s12, judging whether a preset key value address in the session information storage table stores the mapping relation between the quintuple and the session number; if not, S13 is carried out; if yes, S14 is carried out;
S13, storing the five-tuple and the corresponding session number into a preset key value address of the session information storage table, marking the five-tuple and the corresponding session number as effective addresses, and filling the preset key value address into a key value address tree corresponding to the preset key value;
s14, performing exclusive-or calculation on the preset key value and the lowest position of each element of the five-element group, and determining left and right branch offset indications of the preset key value based on exclusive-or calculation results of the preset key value;
s15, judging whether an effective address exists in a branch of the preset key value address in a key value address tree corresponding to the preset key value according to the left branch offset indication and the right branch offset indication of the preset key value; if yes, updating the key value corresponding to the effective address of the offset branch to a preset key value, and carrying out S14 again; if not, S16 is carried out;
s16, storing the five-tuple and the corresponding session number into any invalid address of the session information storage table, marking the invalid address storing the five-tuple and the corresponding session number as an effective address, and filling the effective address into the offset without the effective address in the key value address tree corresponding to the preset key value.
5. The method according to claim 3, wherein the matching the session number corresponding to the five-tuple of the TCP packet from the session information storage table based on the preset key and the left-right branch offset indication of the preset key includes:
s21, reading the five-tuple and the corresponding session number stored in the preset key value address from the session information storage table;
s22, judging whether the five-tuple of the TCP message is matched with the five-tuple stored in the preset key value address; if yes, S26 is carried out; if not, S23 is carried out;
s23, performing exclusive OR calculation on the preset key value and the lowest bit of each tuple of the five-tuple of the TCP message, and determining left and right branch offset indications of the preset key value based on an exclusive OR calculation result of the preset key value;
s24, determining a next preset address based on the corresponding key value address tree and the left branch offset indication;
s25, judging whether the five-tuple of the TCP message is matched with the five-tuple stored in the next preset address; if yes, S26 is carried out; if not, updating the key value corresponding to the next preset address to a preset key value, and carrying out S23 again;
S26, matching the session number corresponding to the five-tuple of the TCP message.
6. The method of claim 5, wherein the method further comprises:
and when the session number corresponding to the five-tuple of the TCP message is not matched, marking the TCP message as an invalid message, and returning a TCP-rst message to the Ethernet side equipment for sending the TCP message so as to prompt the Ethernet side equipment that the TCP message is the invalid message.
7. The method according to claim 1, wherein the processing and transmitting the TCP packet based on the session connection corresponding to the matched session number includes:
analyzing the TCP message to obtain effective data carried by the TCP message;
storing the effective data carried by the TCP message into a buffer memory corresponding to the matched session number;
sending an application unloading request to user side equipment corresponding to session connection corresponding to the session number;
and receiving a response of the user side equipment to the application unloading request, reading effective data carried by the TCP message from a buffer memory corresponding to the matched session number, and transmitting the effective data to the user side equipment.
8. The method according to any one of claims 1 to 7, wherein the number of preset key values is 2N; wherein N is a positive integer.
9. The method of claim 8, wherein when the number of preset key values is 2, the preset key values include a first key value and a second key value;
performing a preset hash processing on the five-tuple of the TCP packet to obtain a preset key value corresponding to the TCP packet, including:
performing hash processing on the five-tuple of the TCP message by using a first hash algorithm and a second hash algorithm respectively to obtain a first key value and a second key value corresponding to the TCP message; wherein the first hash algorithm and the second hash algorithm are different hash algorithms.
10. A TCP message transmission apparatus, comprising:
the message receiving module is used for receiving the TCP message sent by the Ethernet side equipment;
the key value determining module is used for carrying out preset hash processing on the five-tuple of the TCP message to obtain a preset key value corresponding to the TCP message;
the session number matching module is used for matching the session number corresponding to the five-tuple of the TCP message from a session information storage table based on the preset key value; the session information storage module is configured to store the session information storage table, where the session information storage table includes: a plurality of key value addresses and the mapping relation between five-tuple and session number stored by the key value addresses;
And the message processing module is used for processing and transmitting the TCP message based on the session connection corresponding to the matched session number.
CN202311848067.6A 2023-12-29 2023-12-29 TCP message transmission method and device Pending CN117812136A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311848067.6A CN117812136A (en) 2023-12-29 2023-12-29 TCP message transmission method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311848067.6A CN117812136A (en) 2023-12-29 2023-12-29 TCP message transmission method and device

Publications (1)

Publication Number Publication Date
CN117812136A true CN117812136A (en) 2024-04-02

Family

ID=90432859

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311848067.6A Pending CN117812136A (en) 2023-12-29 2023-12-29 TCP message transmission method and device

Country Status (1)

Country Link
CN (1) CN117812136A (en)

Similar Documents

Publication Publication Date Title
US20220407948A1 (en) Load Balancing and Session Persistence in Packet Networks
JP4902635B2 (en) Connection forwarding
US10313402B2 (en) Single pass load balancing and session persistence in packet networks
US9705799B2 (en) Server-side load balancing using parent-child link aggregation groups
US8086846B2 (en) Providing non-proxy TLS/SSL support in a content-based load balancer
CN113014528B (en) Message processing method, processing unit and virtual private network server
CA2676770A1 (en) System and method for data transfer in a peer-to-peer hybrid communication network
US10587515B2 (en) Stateless information centric forwarding using dynamic filters
CN107360154B (en) Intranet secure access method and system
EP3278526B1 (en) System, apparatus and method for load balancing
WO2021008591A1 (en) Data transmission method, device, and system
US20030182440A1 (en) Network processor with high-speed transceiver
US20130223337A1 (en) Mobile device to generate multiple maximum transfer units and data transfer method
JP2017538335A (en) TCP man-in-the-middle processing method in a mode without protocol stack
CN113507483A (en) Instant messaging method, device, server and storage medium
CN117812136A (en) TCP message transmission method and device
US11184460B2 (en) Server device and transfer device for content distribution system
WO2017000564A1 (en) Data processing method and device
US10361997B2 (en) Auto discovery between proxies in an IPv6 network
EP1355472B1 (en) Method and system to determine the most appropriate software layer after reception of a packet
WO2018149673A1 (en) A method of distributing a sub-flow associated with a session and a network apparatus
CN114125080A (en) Message link terminal protocol stack construction method and analysis method, device and terminal
CN109660495B (en) File transmission method and device
CN112104635A (en) Communication method, system and network equipment
CN115361337B (en) Communication method and system based on communication route and star network

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