3 ms·
The article kind of misses the point. The reason for having a separate queue for connections in a SYN-RECEIVED state is to provide a defense against SYN floodin
by Animats 11y ago
The article kind of misses the point. The reason for having a separate queue for connections in a SYN-RECEIVED state is to provide a defense against SYN flooding attacks.[1] An incoming SYN has a source IP address, but that may be faked. In a SYN flooding attack, large numbers of SYN packets with fake source addresses are sent. The connection will never reach ESTABLISHED, because the reply ACK goes to the fake source address, which didn't send the SYN and won't complete the handshake.
Early TCP implementations allocated all the resources for a connection, including the big buffers, when a SYN came in. SYN flooding attacks could tie up all of a server's connection resources until the connection attempt timed out after a minute or two. So now, TCP implementations have to have a separate pool of connection data for connections in SYN-RECEIVED state. There's no data at that stage, so buffers are not yet needed, and a minimum amount of state has to be kept until the 3-way handshake completes. Once the handshake completes, full connection resources are allocated and the connection goes to ESTABLISHED state.
This has nothing to do with behavior of established connections, or connection dropping.
[1] https://en.wikipedia.org/wiki/SYN_flood https://en.wikipedia.org/wiki/SYN_flood
- nly 11y ago> There's no data at that stage There can be. The initial SYN can contain a payload.
- Animats 11y agoTrue, although few implementations send data with SYN, because the BSD socket interface, which everybody uses, forces a full handshake before sending data. Some firewalls treat data with SYN as an attack.