Networking models provide a layered framework so that products from different vendors can interoperate. Each layer provides services to the layer above and consumes services from the layer below.
The OSI Model (7 Layers)
| Layer | Name | Data unit | Function | Example |
|---|---|---|---|---|
| 7 | Application | Data | User interface, application services | HTTP, SMTP, DNS |
| 6 | Presentation | Data | Encoding, encryption, compression | SSL/TLS, JPEG |
| 5 | Session | Data | Session management, checkpoints | NetBIOS, RPC |
| 4 | Transport | Segment | End-to-end reliability, flow control | TCP, UDP |
| 3 | Network | Packet | Logical addressing, routing | IP, ICMP, OSPF |
| 2 | Data Link | Frame | Physical addressing (MAC), error detection | Ethernet, WiFi |
| 1 | Physical | Bits | Raw bit transmission, electrical signals | Cables, radio |
Mnemonic: Please Do Not Throw Sausage Pizza Away
The TCP/IP Model (4 Layers)
TCP/IP is the practical model used by the internet:
| Layer | Equivalent OSI layers | Protocols |
|---|---|---|
| Application | 5-7 (Session, Presentation, Application) | HTTP, DNS, SMTP, FTP |
| Transport | 4 (Transport) | TCP, UDP |
| Internet | 3 (Network) | IP, ICMP, ARP |
| Network Access | 1-2 (Physical, Data Link) | Ethernet, WiFi, PPP |
OSI vs TCP/IP
| Aspect | OSI | TCP/IP |
|---|---|---|
| Developed | Before protocols | Alongside protocols |
| Layers | 7 | 4 |
| Use | Teaching/Reference | Real-world internet |
| Flexibility | Rigid | Pragmatic |
| Protocols | Generic terms | Named protocols |
Q: List the 7 OSI layers from bottom to top.
A: Physical, Data Link, Network, Transport, Session, Presentation, Application. Mnemonic: Please Do Not Throw Sausage Pizza Away.
Q: What is the difference between OSI and TCP/IP?
A: OSI is a theoretical reference model (7 layers) developed before protocols existed — it teaches concepts. TCP/IP is the practical model (4 layers) that emerged from real protocol development — it powers the internet.
Q: Which OSI layer handles encryption?
A: The Presentation Layer (Layer 6). It handles data formatting, encryption (SSL/TLS), and compression. In TCP/IP, these functions are absorbed into the Application Layer.
Q: What happens at each layer during a web request?
A: Application creates HTTP data. Transport splits into TCP segments. Network adds IP headers (source/dest IP). Data Link adds MAC addresses. Physical sends the bits. The reverse happens at the receiver.
Premium Content
Unlock OSI & TCP/IP Reference Models and all premium lessons with a subscription.
From ₹199.99/year — See plans