Before a browser can send an HTTPS request, TCP must open a connection. This page draws one complete TCP conversation as a UML sequence diagram: the 3-way handshake, a request and response with real sequence and acknowledgement numbers, and the 4-way close. A second diagram shows the two most common failures.
1. The Diagram
Time flows downward. Each arrow is one TCP segment with its flags and sequence numbers; the labels at the sides are the TCP states (RFC 9293) each host is in after that segment.
SYN. The client picks a random initial sequence number (here 1000) and moves to SYN_SENT.
SYN-ACK. The server, in LISTEN, replies with its own sequence number (5000) and acknowledges 1001, meaning "I expect your byte 1001 next."
ACK. The client acknowledges 5001. Both sides are now ESTABLISHED. That is one round trip before any data moves.
Data. The client sends a 100-byte request; the server acknowledges 1101 and sends a 1400-byte response, which the client acknowledges with 6401.
FIN from the client. The client is done sending; it enters FIN_WAIT_1, then FIN_WAIT_2 once the ACK arrives. The server enters CLOSE_WAIT and may still send.
FIN from the server. The server closes its half (LAST_ACK). The client's final ACK puts it into TIME_WAIT for twice the maximum segment lifetime so stray segments die out.
2. How to Read It
Hosts are participants with a dashed lifeline. Solid arrows carry new data or control flags; dashed arrows are pure acknowledgements. Dashed boxes are combined fragments that group the three phases.
3. Variant: Failure Paths
Two alt fragments show what goes wrong. If nothing listens on the port, the server answers with RST and the client gets "connection refused" at once. If a firewall silently drops the SYN, the client retransmits with a doubling timeout (1 s, 2 s, 4 s ...), which is why a blocked port looks like a hang rather than an error.
4. Pros, Cons, and When to Use
Pros
Shows ordering and round trips, which is what latency is made of.
Sequence and ack numbers make the reliability mechanism visible.
Maps one-to-one onto a Wireshark or tcpdump capture.
Side state labels connect the picture to the TCP state machine.
Fragments put normal and failure paths on one page.