TCP Handshake Reconstruction via SYN-ACK Interception
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
In TCP/IP handshakes, especially when multiple clients attempt to connect to servers in parallel, resources are wasted as Transmission Control Blocks (TCBs) are maintained for extended periods, even for non-responsive devices, leading to inefficient resource allocation and potential timeouts.
Innovation Solution
A device and method that reconstruct the TCP handshake by intercepting SYN-ACK messages, generating corresponding ACK messages, and updating the TCP stack without initially sending the SYN message, allowing the terminator device to allocate resources only upon receiving SYN-ACK messages, thus avoiding unnecessary resource allocation for unresponsive devices.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Loss of energy
If the device waits for SYN-ACK messages before allocating TCB resources, then resource wastage is reduced, but the device cannot properly initiate or track TCP connections
Solution Approach 1:
The device performs preliminary actions by sending SYN messages and pre-allocating TCB records before actually needing to track the connection. This allows the device to have TCB records ready in advance, so when SYN-ACK messages arrive, the resources are already prepared and no additional allocation is needed during the waiting period.
Solution Approach 2:
The device creates copies of TCB records in advance for potential connections. Instead of creating unique TCB records for each possible connection, it pre-creates a pool of TCB records that can be reused. This copying approach allows rapid assignment of connection tracking resources without wasting memory on connections that never complete the handshake.
2Reliability
If TCB records are maintained for the entire handshake duration, then connection tracking is reliable, but resources are consumed for extended periods even for non-responsive devices
Solution Approach 1:
The device performs preliminary allocation of TCB records from a pre-created pool before the connection is actually established. This preliminary action separates the resource allocation from the connection establishment timeline, allowing TCB records to be quickly assigned and later released without long-term consumption for failed connections.
Solution Approach 2:
The device implements a mechanism to discard TCB records from the pool when they are no longer needed and recover them for reuse. When a SYN-ACK is received or a timeout occurs, the TCB record is discarded from active use and returned to the pool of available records, enabling continuous reuse of limited memory resources rather than allocating new records for each connection attempt.
3Productivity
If the device sends SYN messages to multiple servers in parallel, then connection establishment speed is improved, but resource allocation becomes inefficient due to maintained TCBs
Solution Approach 1:
The device prepares multiple TCB records in advance from a preallocated pool, enabling parallel connection attempts without the overhead of dynamic allocation during each handshake. This preliminary preparation allows the device to rapidly initiate multiple connections while maintaining efficient resource usage, as the TCB records are reused from the pool rather than being continuously allocated and freed.
Solution Approach 2:
The device uses copied TCB records from a shared pool to handle multiple parallel connections. Instead of maintaining separate persistent TCB records for each potential connection, it assigns copied records from the pool to active connections and recovers them when done, enabling parallel connection establishment with improved resource efficiency.
Data Source
Figure 1~2
Figure 3
AI summary
A TCP handshake is distributed by having an initiator device (210) send, to a server (220) SYN(m) with the IP address of a terminator device (230) as source address. The initiator device can then forget any TCP state for the SYN(m). The server (230) responds with a SYN-ACK(m+1, n) according to the normal TCP handshake, but the response goes to the terminator device (230) that receives (S310) the message, reconstructs (S320) the TCP handshake as if it had sent the initial SYN message, and sends (S330) an ACK(n+1) to the server (220). The TCP handshake method can be used to avoid allocation of resources in for example device monitoring.