OSI Model
The OSI model is a conceptual framework that standardizes how data is transmitted across networks, broken into 7 layers. Each layer serves a specific role and communicates only with the layers directly above and below it.
The 7 OSI Layers (Bottom → Top)
Layer | Name | Purpose | Examples |
---|---|---|---|
7 | Application | Closest to the user. Provides network services to applications. | HTTP, FTP, SMTP, DNS, Telnet |
6 | Presentation | Translates, encrypts, compresses data into a format apps can understand. | SSL/TLS, JPEG, MP3, GIF |
5 | Session | Establishes, manages, and terminates sessions (conversations) between applications. | NetBIOS, RPC, PPTP |
4 | Transport | Provides end-to-end data transfer, reliability, and error handling. | TCP, UDP |
3 | Network | Routes data between devices across networks (logical addressing). | IP, ICMP, IPX, OSPF |
2 | Data Link | Provides node-to-node delivery, error detection/correction, framing. | Ethernet, PPP, Switches, MAC addresses |
1 | Physical | Transmits raw bits over physical media. Defines cables, voltage, signals. | Cables, Wi-Fi, Hubs, Modems |
Easy-to-Remember Mnemonics
- Bottom → Top (1 to 7): "Please Do Not Throw Sausage Pizza Away" (Physical, Data Link, Network, Transport, Session, Presentation, Application)
- Top → Bottom (7 to 1): "All People Seem To Need Data Processing" (Application, Presentation, Session, Transport, Network, Data Link, Physical)
Data Flow (Encapsulation)
Sending data:
- Application: "I want a web page" (HTTP).
- Presentation: encrypt/compress data (TLS).
- Session: manage the connection state.
- Transport: TCP splits data into segments, ensures reliability.
- Network: IP addresses, decides where to send data.
- Data Link: Ethernet frame with MAC addresses.
- Physical: converts to bits/signals, sends over wire/wifi.
When receiving data, the process is reversed (decapsulation).