The lifecycle is a state machine living in the kernel. It starts with a passive open: the server binds and listens, and the accept queue stands ready. The handshake is three segments — SYN, SYN-ACK, ACK — during which both sides exchange initial sequence numbers, so the connection is established before a single byte of application data moves.
Once ESTABLISHED, data exchange is governed by sequence numbers, acknowledgments, and the advertised receive window; the sender may never have more unacknowledged bytes in flight than the window allows. Teardown is a four-way dance: FIN, ACK, then the other side's FIN and ACK. The active closer then pays the TIME-WAIT toll — 2×MSL — so stray segments from the dying connection cannot be mistaken for data on a reused connection. The ordering matters: neither side may reuse a sequence space or a port until the network has emptied of the connection's own packets.