network-programmingtcp

What is the difference between tcp fast open and carrying data with the second ACK?


I've learned that you can carry data with the second ACK during a tcp handshake, and it feels a little redundant to have a separate feature to do two way handshake when you can practically do it already.

What are the benefits of using a cookie instead of simply the sequence number if it actually makes a difference?


Solution

  • Without TCP fast open, the client can send data with the second packet, ie:

    > SYN
    < SYN+ACK
    > ACK+data

    With TCP fast open, both the client and the server can send data with the first packet. To prevent attacks using IP spoofing in this case, a TFO cookie established in a previous connection needs to be provided by the client:

    > SYN+cookie+data
    < SYN+ACK+data