Search code examples
c++ctcppacketstate-machine

How do TCP state transitions occur?


This link explains the TCP State Machine. It lists all the state transitions based on send/receive events. I feel like it only describes the obvious ones. I'd like to know what happens when you're in a LISTEN state and you receive a DATA packet, or when you're in a ESTABLISHED state and you receive a SYN.

Are there any implementations of TCP in c/c++ available, WINSOCK library or others? The TCP RFC document is nice and all, but implementation would be much more helpful, imo.


Solution

  • This is an excellent resource for what you want:

    1995 - TCP/IP Illustrated, Volume 2: The Implementation (with Gary R. Wright) - ISBN 0-201-63354-X