The OSI model divides network communication into seven layers. Each layer is responsible for something different, and when there's a problem — you go layer by layer from bottom to top to locate the issue.
The Seven Layers
Seven layers bottom-up: Physical (cables and signals), Data Link (MAC addresses and frames), Network (IP and routing), Transport (ports, TCP vs UDP), Session (conversation management), Presentation (encoding and encryption), Application (what the user sees). On the right, the four-layer TCP/IP model: Network Access covers 1 and 2, Internet maps to 3, Transport to 4, and Application to 5, 6 and 7. Troubleshooting works bottom-up.
- 1. Physical — Cables, fibers, electrical signals.
- 2. Data Link — MAC Address, Ethernet Frames, Switching.
- 3. Network — IP Address, Routing.
- 4. Transport — TCP (reliable) and UDP (fast), Port Numbers.
- 5. Session — Managing a conversation between two parties.
- 6. Presentation — Encryption, encoding, compression.
- 7. Application — HTTP, DNS, SMB, — what the user sees.
TCP vs. UDP
- TCP — Three-Way Handshake (SYN, SYN-ACK, ACK), ensures delivery and order. Examples: HTTP/443, SSH/22, /389.
- UDP — Connectionless and without acknowledgment, faster. Examples: DNS/53, DHCP/67-68, VoIP.