Oh My AlgorithmKO
←
Network
← All catalogs

Network

Network layers and TCP connection messages

OSI Model

The OSI model describes networking in seven layers. Follow this example as data is sent and received.

Sending host7 Application6 Presentation5 Session4 Transport3 Network2 Data Link1 PhysicalDataHello!
↔ Drag to explore
Principles and uses

Follow network communication through the seven OSI layers.

The sender processes data down the layers; the receiver processes it in reverse.

This simplified example shows headers, ports, addresses, and format conversion. Real Internet protocols do not always map one-to-one to OSI layers.

Use it to distinguish networking responsibilities and locate where communication problems occur.

TCP Handshake

3-Way Handshake · Connection Setup

A TCP connection begins with three messages. The client starts CLOSED and the listening server starts LISTEN.

ClientCLOSEDServerLISTENSYNseq=xSYN + ACKseq=y, ack=x+1ACKack=y+1
↔ Drag to explore

4-Way Handshake · Connection Teardown

TCP closes each sending direction independently. This example sends FIN and ACK separately, for four messages in total.

ClientESTABLISHEDServerESTABLISHEDFINseq=uACKack=u+1FINseq=vACKack=v+1
↔ Drag to explore
Principles and uses

Follow TCP connection establishment and the closing of each sending direction.

SYN and ACK establish sequence numbers; FIN announces the end of sending.

Establishment normally uses three messages. This close example uses four, although ACK and FIN may also be combined.

Use it to understand TCP state transitions, connection latency, and TIME-WAIT.

Learning topics