Finite-state machine of TCP