Method, system, device and medium for dynamically enhancing session-level tcp options on a domestic system

By reserving custom option space during the TCP handshake and data transmission phases, adjusting the MSS option, and updating the TCP/IP header checksum value, the problem of dynamic enhancement of TCP options during the connection lifecycle is solved, realizing dynamic information transmission and option space optimization throughout the entire connection lifecycle.

CN120602578BActive Publication Date: 2025-10-21中孚安全技术有限公司
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511093068.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-08-06
Publication Date
2025-10-21
Estimated Expiration
2045-08-06

AI Technical Summary

Technical Problem

In existing technologies, the intervention of TCP options is mainly concentrated in the TCP connection handshake phase, which cannot be dynamically enhanced throughout the entire connection lifecycle. Furthermore, the available space of TCP options is strictly limited, leading to a conflict between the inability to continuously transmit dynamic information and maximizing data payload.

Method used

By deploying network packet processing mechanisms in the network path or operating system kernel, monitoring the TCP handshake and data transmission phases, reserving space for custom options, adjusting MSS options, inserting custom options during data transmission, and updating TCP and IP header checksum values, compliance can be ensured.

Benefits of technology

It enables dynamic information transmission of TCP options throughout the entire connection cycle, optimizes the balance between payload and option space during data transmission, improves the flexibility and compatibility of network management and security policies, and avoids TCP retransmission and verification errors.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120602578B_ABST
    Figure CN120602578B_ABST
Patent Text Reader

Abstract

The application discloses a domestic system session-level TCP option dynamic enhancement method, system, device and medium, mainly relates to the technical field of option dynamic enhancement, and is used for solving the problems that the prior art cannot continuously deliver dynamic information through TCP options in the whole connection life cycle, and the available space of the TCP option is limited in the data transmission stage. The application comprises the following steps: intercepting a TCP handshake message through a preset interception point, reading original MSS data in an MSS option of a TCP handshake message header; subtracting a reserved length of a preset custom option from the original MSS data to obtain a reserved space and adjusted MSS data, and updating the adjusted MSS data to the MSS option; updating a TCP checksum value according to the TCP header content after updating the MSS option, and writing the new checksum value to a checksum field of the TCP header; and releasing the updated TCP handshake message.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of dynamic enhancement of options, and in particular to a method, system, device and medium for dynamic enhancement of session-level TCP options on a domestic system. Background Art

[0002] Conventional technology primarily operates on TCP (Transmission Control Protocol) header options, primarily focusing on the TCP protocol's negotiation mechanisms and intervention at specific network nodes or endpoint systems. The TCP / IP protocol suite includes option fields within the TCP header, primarily used to exchange key connection parameters and capabilities during the connection establishment (handshake) phase. These options are primarily used to set parameters and declare basic capabilities during connection initialization, but their content typically remains static after the connection is established.

[0003] To achieve more granular network management, security policy enforcement, or performance optimization for specific services, existing solutions involve inspecting, modifying, or adding options to TCP handshake packets through intermediate devices along the network path. However, these interventions are limited to the initial phase of TCP connection establishment and fail to meet the need for dynamic option enhancement throughout the lifecycle of a TCP session. Furthermore, while the TCP protocol itself allows options to be carried in TCP segments carrying application data, their practical application is strictly limited by the maximum length of the TCP header (60 bytes). To maximize network bandwidth utilization, TCP data segments are kept as close to the negotiated MSS as possible. Therefore, the available space for TCP options (up to 40 bytes) becomes significantly limited when sending large segments. Summary of the Invention

[0004] The present application provides a method, system, device and medium for dynamically enhancing session-level TCP options on a domestic system to solve the problem that the intervention of TCP options in the prior art is mainly concentrated in the handshake phase of the TCP connection, resulting in the inability to continuously transmit dynamic information through TCP options throughout the life cycle of the entire connection, and in the data transmission phase, the available space of TCP options is severely limited, which conflicts with the goal of maximizing data payload.

[0005] In a first aspect, the present application provides a method for dynamically enhancing session-level TCP options on a domestic system, the method comprising:

[0006] Configure a TCP phase listener, deploy a network packet processing mechanism on the network path or in the operating system kernel, and set preset interception points. The TCP phase is divided into the TCP handshake phase and the TCP data transmission phase, and the network packet processing mechanism is divided into the handshake packet processing mechanism and the transmission packet processing mechanism.

[0007] When monitoring the TCP handshake phase, the handshake message processing mechanism is triggered. The TCP handshake message is intercepted at a preset interception point, and the original MSS (Maximum Segment Size) option in the TCP handshake message header is read. The reserved length of the preset custom option is subtracted from the original MSS data to obtain the reserved space and the adjusted MSS data. The adjusted MSS data is updated in the MSS option. The TCP checksum value is updated based on the TCP header content after the MSS option is updated, and the new checksum value is written to the checksum field of the TCP header. The updated TCP handshake message is then released.

[0008] When it is detected that the TCP data transmission phase is in progress, the transmission message processing mechanism is triggered; all TCP messages are intercepted through the preset interception point, and the MSS option of the TCP message is checked to see if there is reserved space for the preset custom option; when there is reserved space, the preset custom option is inserted into the reserved space of the TCP header, and the TCP header field content and IP header field content corresponding to the TCP message are updated; based on the updated TCP header and IP header, the checksum value of the IP header and the checksum value of the TCP header are calculated, and updated to the corresponding header fields, and the updated TCP message is released.

[0009] In one implementation of the present application, intercepting a TCP handshake message through a preset interception point specifically includes:

[0010] Read all transmitted messages at the preset interception point;

[0011] Parse the message header and intercept if it contains preset TCP protocol information. The TCP handshake message includes the server's SYN-ACK message (Synchronize Sequence Numbers Acknowledge Character) received by the client, the SYN-ACK message sent by the server, and the initial SYN (Synchronize Sequence Numbers) message sent by the client.

[0012] In one implementation of the present application, subtracting the reserved length of the preset custom option from the original MSS data to obtain the reserved space and the adjusted MSS data specifically includes:

[0013] By formula:

[0014] Adjusted_MSS_C = Original_MSS_C - Option_Size, calculate the adjusted MSS data Adjusted_MSS_C; Original_MSS_C represents the original MSS data, and Option_Size represents the reserved length of the preset custom option;

[0015] The space expanded after subtracting the Option_Size length is the reserved space.

[0016] In one implementation of the present application, after detecting whether the MSS option of the TCP message has reserved space for a preset custom option, the method further includes:

[0017] If there is no reserved space for the preset custom option, the corresponding TCP packet is allowed to pass.

[0018] In one implementation of the present application, a preset custom option is inserted into the reserved space of the TCP header, and the TCP header field content and the IP header field content corresponding to the TCP message are updated, specifically including:

[0019] Get the length of the preset custom options; the unit of length is bytes;

[0020] Divide the length by 4 to obtain the increment of the Data Offset field value of the TCP header field content, and then update the Data Offset field value of the TCP header field content;

[0021] The total length of the IP header field content is increased by the length of the preset custom option to obtain the updated IP header field content.

[0022] In one implementation of the present application, the preset custom option complies with the format specification of the TCP option, including option type, option length and option data.

[0023] In a second aspect, the present application provides a session-level TCP option dynamic enhancement system on a domestic system, the system comprising:

[0024] The configuration processing module is used to configure the TCP phase listener, deploy the network message processing mechanism on the network path or in the operating system kernel, and set the preset interception point; the TCP phase is divided into the TCP handshake phase and the TCP data transmission phase, and the network message processing mechanism is divided into the handshake message processing mechanism and the transmission message processing mechanism;

[0025] The handshake processing module is used to trigger the handshake message processing mechanism when it detects that the TCP handshake phase is in progress. It intercepts the TCP handshake message through a preset interception point and reads the original MSS data in the MSS option in the TCP handshake message header. It subtracts the reserved length of the preset custom option from the original MSS data to obtain the reserved space and the adjusted MSS data, and updates the adjusted MSS data to the MSS option. It updates the TCP checksum value based on the TCP header content after the MSS option is updated, and writes the new checksum value into the checksum field of the TCP header. It then passes the updated TCP handshake message.

[0026] The transmission processing module is used to trigger the transmission message processing mechanism when it detects that the TCP data transmission phase is in progress; intercept all TCP messages through a preset interception point, and detect whether the MSS option of the TCP message has reserved space for preset custom options; when reserved space exists, insert the preset custom options into the reserved space of the TCP header, and update the TCP header field content and IP header field content corresponding to the TCP message; calculate the checksum value of the IP header and the checksum value of the TCP header based on the updated TCP header and IP header, and update them to the corresponding header fields, and release the updated TCP message.

[0027] In one implementation of the present application, the handshake processing module includes an interception unit,

[0028] Used to read all transmitted messages at a preset interception point;

[0029] The message header is parsed, and when there is preset TCP protocol information, an interception operation is performed; wherein, the TCP handshake message includes the server SYN-ACK message received by the client, the SYN-ACK message sent by the server, and the initial SYN message sent by the client.

[0030] In a third aspect, the present application provides a session-level TCP option dynamic enhancement device on a domestic system, the device comprising:

[0031] processor;

[0032] and a memory storing executable code, which, when executed, causes the processor to execute any one of the above-mentioned methods for dynamically enhancing session-level TCP options on a domestic system.

[0033] In a fourth aspect, the present application provides a non-volatile computer storage medium on which computer instructions are stored. When the computer instructions are executed, they implement a method for dynamically enhancing session-level TCP options on a domestic system such as any of the above items.

[0034] It can be seen from the above technical solutions that this application has the following advantages:

[0035] First, this application implements the dynamic information transmission capability of TCP options during the entire connection cycle. By actively reserving custom option space during the handshake phase (dynamically deducting a preset length from the original MSS data) and detecting and inserting custom options during the data transmission phase, it breaks through the limitation that traditional technologies can only intervene in TCP options during the handshake phase. This two-stage collaborative mechanism enables network devices or operating systems to continuously transmit dynamic information (such as path status, security policies, etc.) throughout the life cycle of a session without exhausting the option space due to the fixed structure of the TCP header. Compared with existing technologies, this application ensures the compliance of modified messages through a checksum dynamic update mechanism (synchronously correcting the TCP and IP header checksum values), which not only maintains the compatibility of the TCP protocol stack, but also provides a continuous and programmable option expansion channel for upper-layer applications.

[0036] Second, this application optimizes the balance between payload and option space during the data transmission phase. The transmission message processing mechanism intelligently detects the existence of reserved space and inserts custom options only when necessary, avoiding the problem of traditional solutions forcibly compressing the payload to fix the reserved option space. This on-demand dynamic processing method ensures the availability of custom options while maximizing the MSS value to the physical link carrying limit (through precise reservation calculations during the handshake phase). In addition, the kernel-level message interception and processing mechanism (deployed in the operating system or network path) achieves a seamless enhancement to the standard TCP protocol stack. It does not require modification of the application layer code and will not cause TCP retransmission or verification errors. It improves the utilization of the option space while maintaining the original data transmission efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] In order to more clearly illustrate the technical solution of the present invention, the following is a brief introduction to the drawings required for the description. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0038] Figure 1 This is a flow chart of a method for dynamically enhancing session-level TCP options on a domestic system provided by an embodiment of the present application.

[0039] Figure 2 This is a schematic diagram of the internal structure of a session-level TCP option dynamic enhancement system on a domestic system provided in an embodiment of the present application.

[0040] Figure 3 This is a schematic diagram of the internal structure of a session-level TCP option dynamic enhancement device on a domestic system provided in an embodiment of the present application. DETAILED DESCRIPTION

[0041] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.

[0042] It should be understood by those skilled in the art that the embodiments described below are merely preferred embodiments of the present disclosure and do not imply that the present disclosure can only be implemented through these preferred embodiments. These preferred embodiments are merely intended to explain the technical principles of the present disclosure and are not intended to limit the scope of protection of the present disclosure. Based on the preferred embodiments provided by the present disclosure, all other embodiments obtained by those skilled in the art without creative effort should still fall within the scope of protection of the present disclosure.

[0043] It should also be noted that the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, commodity, or apparatus that includes a series of elements includes not only those elements but also other elements not explicitly listed, or includes elements inherent to such process, method, commodity, or apparatus. In the absence of further limitations, an element defined by the phrase "comprises a ..." does not exclude the presence of other identical elements in the process, method, commodity, or apparatus that includes the element.

[0044] The technical solutions proposed in the embodiments of the present application are described in detail below with reference to the accompanying drawings.

[0045] The embodiment provides a method for dynamically enhancing session-level TCP options on a domestic system, such as Figure 1 As shown, the method provided in the embodiment of the present application mainly includes the following steps:

[0046] Step 110: Configure the TCP phase listener, deploy the network message processing mechanism on the network path or in the operating system kernel, and set the preset interception point.

[0047] Among them, the TCP stage is divided into the TCP handshake stage and the TCP data transmission stage, and the network message processing mechanism is divided into the handshake message processing mechanism and the transmission message processing mechanism.

[0048] It should be noted that those skilled in the art will understand that the system intercepts TCP handshake packets or all TCP packets at appropriate interception points (such as pre-routing, local outbound, or post-routing stages) through network packet processing mechanisms deployed on the network path or in the operating system kernel (for example, but not limited to kernel modules, network filters, etc.). This includes the server SYN-ACK packet received by the client, the SYN-ACK packet sent by the server, and the initial SYN packet sent by the client (if bidirectional reservation is required).

[0049] Step 120: When the TCP handshake phase is detected, the handshake message processing mechanism is triggered; the TCP handshake message is intercepted through a preset interception point, and the original MSS data in the MSS option in the TCP handshake message header is read; the reserved length of the preset custom option is subtracted from the original MSS data to obtain the reserved space and the adjusted MSS data, and the adjusted MSS data is updated to the MSS option; the TCP checksum value is updated according to the TCP header content after the MSS option is updated, and the new checksum value is written to the checksum field of the TCP header; and the updated TCP handshake message is released.

[0050] The preset custom options follow the format specification of TCP options, including option type, option length, and option data.

[0051] Among them, intercepting the TCP handshake message through the preset interception point specifically includes:

[0052] Read all transmitted messages at the preset interception point;

[0053] The message header is parsed, and when there is preset TCP protocol information, an interception operation is performed; wherein, the TCP handshake message includes the server SYN-ACK message received by the client, the SYN-ACK message sent by the server, and the initial SYN message sent by the client.

[0054] The reserved length of the preset custom option is subtracted from the original MSS data to obtain the reserved space and adjusted MSS data, which specifically includes:

[0055] By formula:

[0056] Adjusted_MSS_C = Original_MSS_C - Option_Size, calculate the adjusted MSS data Adjusted_MSS_C; Original_MSS_C represents the original MSS data, and Option_Size represents the reserved length of the preset custom option;

[0057] The space expanded after subtracting the Option_Size length is the reserved space.

[0058] The updated TCP handshake message is released so that it continues to be processed along the normal network protocol stack path or sent to the network.

[0059] Those skilled in the art will appreciate that the MSS option value in the TCP packet is updated to the adjusted MSS value. This step is intended to enable the peer to configure its data transmission behavior based on the reduced MSS value when establishing a connection, thereby ensuring that subsequent packets sent or requested to be sent by the system, even if custom options are included, do not exceed the negotiated payload limit.

[0060] Step 130: When it is detected that the TCP data transmission phase is in progress, the transmission message processing mechanism is triggered; all TCP messages are intercepted through the preset interception point, and it is detected whether there is reserved space for the preset custom option in the MSS option of the TCP message; when there is reserved space, the preset custom option is inserted into the reserved space of the TCP header, and the TCP header field content and the IP header field content corresponding to the TCP message are updated; based on the updated TCP header and IP header, the checksum value of the IP header and the checksum value of the TCP header are calculated, and updated to the corresponding header fields, and the updated TCP message is released.

[0061] Those skilled in the art will understand that the system, through its network packet processing mechanism, intercepts all TCP packets intended to be sent by the local machine at appropriate interception points (such as post-routing or local outbound stages). This includes packets that may be sent during the handshake phase (such as the SYN-ACK packets processed in phase 1), as well as all data packets and ACK packets after the connection is established.

[0062] After detecting whether the MSS option of the TCP packet has reserved space for a preset custom option, the method further includes:

[0063] If there is no reserved space for the preset custom option, the corresponding TCP packet is allowed to pass.

[0064] Insert preset custom options into the reserved space of the TCP header and update the TCP header field content and IP header field content corresponding to the TCP message, including:

[0065] Get the length of the preset custom options; the unit of length is bytes;

[0066] Divide the length by 4 to obtain the increment of the Data Offset field value of the TCP header field content, and then update the Data Offset field value of the TCP header field content;

[0067] The total length of the IP header field content is increased by the length of the preset custom option to obtain the updated IP header field content.

[0068] Those skilled in the art will understand that due to the addition of a new TCP option, the value of the "Data Offset" field in the TCP header (indicating the TCP header length in 4-byte units) must be increased accordingly. This increase is equal to the length (in bytes) of the added custom option divided by 4. Since the TCP header length has increased (due to the addition of the option), the total length of the IP datagram has also increased accordingly. Therefore, the value of the "Total Length" field in the IP header must be increased by the byte length of the added custom option. Since both the IP header (Total Length field) and the TCP header (Data Offset field, option content itself) have been modified, the IP header checksum and TCP header checksum must be recalculated and the new checksum values ​​updated in their respective header fields. The TCP packet with the added custom option and all relevant header fields updated is then allowed to pass through the network interface.

[0069] Based on the above description, it can be seen that this embodiment has the following beneficial effects compared with the prior art:

[0070] Ensuring reliable addition of custom options: By pre-adjusting the MSS during the handshake phase, a fixed amount of space is reserved for custom TCP options. This ensures that custom options can be reliably added to every (or selected) outgoing packet throughout the data transmission phase of the TCP connection, without being rejected by the TCP protocol stack due to exceeding the MSS limit or causing unpredictable behavior.

[0071] Avoiding MSS conflicts and IP-layer fragmentation: Because the total TCP segment length after adding custom options remains within the adjusted effective MSS, IP-layer fragmentation caused by adding the options is avoided. This is crucial for maintaining network performance and preventing issues with fragmented packets on certain network devices (such as firewalls).

[0072] Improved scalability and flexibility of the TCP protocol: This application provides a general mechanism that allows applications or network administrators to embed custom information in each packet of a TCP data stream as needed, for example:

[0073] Fine-grained performance telemetry data (such as per-packet latency, jitter markers), customized flow control or congestion control signaling, application-layer metadata or session identifiers, enhanced security tags or authentication information.

[0074] Good compatibility with existing TCP stacks: This application primarily modifies the value of a standard TCP option, the MSS. This allows the peer TCP stack to process the message normally without any modification, as it only sees a valid, possibly slightly smaller, MSS value. The custom option itself is ignored by peers that do not recognize it (according to TCP option processing rules).

[0075] The implementation is relatively simple and efficient: Using a kernel-level packet processing framework such as Netfilter, the above logic can be implemented without modifying the core TCP / IP protocol stack code, and the performance impact of the modified operations (calculation, option padding) on ​​the packet processing path is controllable.

[0076] Solve the problem of adding options when transmitting large amounts of data: Especially in scenarios where a large number of consecutive data packets need to be marked or carry additional information, this application provides a reliable solution that was previously difficult to achieve.

[0077] In addition, this application Figure 2 The embodiment of this application provides a dynamic enhancement system for session-level TCP options on a domestic system. Figure 2 As shown, the system provided in the embodiment of the present application mainly includes:

[0078] Configuration processing module 210 is used to configure the TCP stage listener, deploy the network message processing mechanism on the network path or in the operating system kernel, and set the preset interception point; wherein, the TCP stage is divided into the TCP handshake stage and the TCP data transmission stage, and the network message processing mechanism is divided into the handshake message processing mechanism and the transmission message processing mechanism.

[0079] The handshake processing module 220 is configured to trigger a handshake message processing mechanism when it detects that the TCP handshake phase is in progress; intercept the TCP handshake message through a preset interception point and read the original MSS data in the MSS option in the TCP handshake message header; subtract the reserved length of the preset custom option from the original MSS data to obtain the reserved space and the adjusted MSS data, and update the adjusted MSS data into the MSS option; update the TCP checksum value based on the TCP header content after the MSS option is updated, and write the new checksum value into the checksum field of the TCP header; and pass the updated TCP handshake message.

[0080] The handshake processing module 220 includes an interception unit,

[0081] Used to read all transmitted messages at a preset interception point;

[0082] The message header is parsed, and when there is preset TCP protocol information, an interception operation is performed; wherein, the TCP handshake message includes the server SYN-ACK message received by the client, the SYN-ACK message sent by the server, and the initial SYN message sent by the client.

[0083] The transmission processing module 230 is used to trigger the transmission message processing mechanism when it is monitored that the TCP data transmission stage is in progress; intercept all TCP messages through a preset interception point, and detect whether there is reserved space for the preset custom option in the MSS option of the TCP message; when there is reserved space, insert the preset custom option into the reserved space of the TCP header, and update the TCP header field content and IP header field content corresponding to the TCP message; calculate the checksum value of the IP header and the checksum value of the TCP header based on the updated TCP header and IP header, and update them to the corresponding header fields, and release the updated TCP message.

[0084] The above is a method embodiment of the present application. Based on the same inventive concept, the present application embodiment also provides a session-level TCP option dynamic enhancement device on a domestic system. Figure 3 As shown, the device includes: a processor; and a memory on which executable code is stored. When the executable code is executed, the processor executes a method for dynamically enhancing session-level TCP options on a domestic system as described in the above embodiment.

[0085] Specifically, the server configures a TCP stage listener, deploys a network message processing mechanism on the network path or in the operating system kernel, and sets a preset interception point; wherein, the TCP stage is divided into the TCP handshake stage and the TCP data transmission stage, and the network message processing mechanism is divided into the handshake message processing mechanism and the transmission message processing mechanism; when it is detected that it is in the TCP handshake stage, the handshake message processing mechanism is triggered; the TCP handshake message is intercepted through the preset interception point, and the original MSS data in the MSS option in the TCP handshake message header is read; the reserved length of the preset custom option is subtracted from the original MSS data to obtain the reserved space and the adjusted MSS data, and the adjusted MSS data is updated to the MSS option; according to the TCP after the MSS option is updated header content, update the TCP checksum value, and write the new checksum value into the checksum field of the TCP header; release the updated TCP handshake message; when monitoring the TCP data transmission stage, trigger the transmission message processing mechanism; intercept all TCP messages through the preset interception point, and detect whether the MSS option of the TCP message has reserved space for the preset custom option; when there is reserved space, insert the preset custom option into the reserved space of the TCP header, and update the TCP header field content and IP header field content corresponding to the TCP message; according to the updated TCP header and IP header, calculate the checksum value of the IP header and the checksum value of the TCP header, update them to the corresponding header fields, and release the updated TCP message.

[0086] In addition, an embodiment of the present application also provides a non-volatile computer storage medium on which executable instructions are stored. When the executable instructions are executed, a method for dynamically enhancing session-level TCP options on a domestic system as described above is implemented.

[0087] The above description of the disclosed embodiments is intended to enable one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be readily apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention is not limited to the embodiments shown herein but is intended to conform to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method for dynamically enhancing session-level TCP options on a domestic system, characterized in that: The method comprises: Configure a TCP phase listener, deploy a network packet processing mechanism on the network path or in the operating system kernel, and set preset interception points. The TCP phase is divided into the TCP handshake phase and the TCP data transmission phase, and the network packet processing mechanism is divided into the handshake packet processing mechanism and the transmission packet processing mechanism. When the TCP handshake phase is detected, the handshake message processing mechanism is triggered. The TCP handshake message is intercepted through a preset interception point, and the original MSS data in the MSS option in the TCP handshake message header is read. The reserved length of the preset custom option is subtracted from the original MSS data to obtain the reserved space and the adjusted MSS data, and the adjusted MSS data is updated to the MSS option. The TCP checksum value is updated according to the TCP header content after the MSS option is updated, and the new checksum value is written to the checksum field of the TCP header. The updated TCP handshake message is released. When it is detected that the TCP data transmission phase is in progress, the transmission message processing mechanism is triggered; all TCP messages are intercepted through the preset interception point, and the MSS option of the TCP message is checked to see if there is reserved space for the preset custom option; when there is reserved space, the preset custom option is inserted into the reserved space of the TCP header, and the TCP header field content and IP header field content corresponding to the TCP message are updated; based on the updated TCP header and IP header, the checksum value of the IP header and the checksum value of the TCP header are calculated, and updated to the corresponding header fields, and the updated TCP message is released.

2. The method for dynamically enhancing session-level TCP options on a domestic system according to claim 1, characterized in that: Intercept TCP handshake packets through preset interception points, including: Read all transmitted messages at the preset interception point; The message header is parsed, and when there is preset TCP protocol information, an interception operation is performed; wherein, the TCP handshake message includes the server SYN-ACK message received by the client, the SYN-ACK message sent by the server, and the initial SYN message sent by the client.

3. The method for dynamically enhancing session-level TCP options on a domestic system according to claim 1, characterized in that: Subtract the reserved length of the preset customized option from the original MSS data to obtain the reserved space and adjusted MSS data, including: By formula: Adjusted_MSS_C = Original_MSS_C - Option_Size, calculate the adjusted MSS data Adjusted_MSS_C; Original_MSS_C represents the original MSS data, and Option_Size represents the reserved length of the preset custom option; The space expanded after subtracting the Option_Size length is the reserved space.

4. The method for dynamically enhancing session-level TCP options on a domestic system according to claim 1, characterized in that: After detecting whether the MSS option of the TCP message has reserved space for a preset custom option, the method further includes: If there is no reserved space for the preset custom option, the corresponding TCP packet is allowed to pass.

5. The method for dynamically enhancing session-level TCP options on a domestic system according to claim 1, characterized in that: Insert preset custom options into the reserved space of the TCP header and update the TCP header field content and IP header field content corresponding to the TCP message, including: Get the length of the preset custom options; the unit of length is bytes; Divide the length by 4 to obtain the increment of the Data Offset field value of the TCP header field content, and then update the Data Offset field value of the TCP header field content; The total length of the IP header field content is increased by the length of the preset custom option to obtain the updated IP header field content.

6. The method for dynamically enhancing session-level TCP options on a domestic system according to claim 1, characterized in that: Preset custom options follow the format specifications of TCP options, including option type, option length, and option data.

7. A session-level TCP option dynamic enhancement system on a domestic system, characterized in that: The system comprises: The configuration processing module is used to configure the TCP phase listener, deploy the network message processing mechanism on the network path or in the operating system kernel, and set the preset interception point; the TCP phase is divided into the TCP handshake phase and the TCP data transmission phase, and the network message processing mechanism is divided into the handshake message processing mechanism and the transmission message processing mechanism; The handshake processing module is used to trigger the handshake message processing mechanism when it detects that the TCP handshake phase is in progress. It intercepts the TCP handshake message through a preset interception point and reads the original MSS data in the MSS option in the TCP handshake message header. It subtracts the reserved length of the preset custom option from the original MSS data to obtain the reserved space and the adjusted MSS data, and updates the adjusted MSS data to the MSS option. It updates the TCP checksum value based on the TCP header content after the MSS option is updated, and writes the new checksum value into the checksum field of the TCP header. It then passes the updated TCP handshake message. The transmission processing module is used to trigger the transmission message processing mechanism when it detects that the TCP data transmission phase is in progress; intercept all TCP messages through a preset interception point, and detect whether the MSS option of the TCP message has reserved space for preset custom options; when reserved space exists, insert the preset custom options into the reserved space of the TCP header, and update the TCP header field content and IP header field content corresponding to the TCP message; calculate the checksum value of the IP header and the checksum value of the TCP header based on the updated TCP header and IP header, and update them to the corresponding header fields, and release the updated TCP message.

8. The session-level TCP option dynamic enhancement system on a domestic system according to claim 7 is characterized in that: The handshake processing module includes an interception unit, Used to read all transmitted messages at a preset interception point; The message header is parsed, and when there is preset TCP protocol information, an interception operation is performed; wherein, the TCP handshake message includes the server SYN-ACK message received by the client, the SYN-ACK message sent by the server, and the initial SYN message sent by the client.

9. A dynamic enhancement device for session-level TCP options on a domestic system, characterized in that: The device comprises: processor; and a memory storing executable code thereon, which, when the executable code is executed, enables the processor to execute a method for dynamically enhancing session-level TCP options on a domestic system as described in any one of claims 1-6.

10. A non-volatile computer storage medium, characterized in that Computer instructions are stored thereon, and when the computer instructions are executed, they implement a method for dynamically enhancing session-level TCP options on a domestic system as described in any one of claims 1-6.

Citation Information

Patent Citations

  • TCP connection method and device, storage medium, electronic equipment and product

    CN118631914A

  • Hardware Clamping of the Transmission Control Protocol (TCP) Maximum Segment Size (MSS) Parameter In a Scalable and Programmable Network Device

    US20230308528A1