| Layer Number | Layer Name | Main Function | Examples |
|---|---|---|---|
| 7 | Application | Interfaces with user applications and services | HTTP, FTP, SMTP |
| 6 | Presentation | Translates, encrypts, and compresses data | SSL/TLS, JPEG, MP3 |
| 5 | Session | Establishes and maintains communication sessions | NetBIOS, RPC |
| 4 | Transport | Provides reliable or unreliable delivery | TCP, UDP |
| 3 | Network | Routes packets between devices | IP, ICMP |
| 2 | Data Link | Handles error detection and physical addressing | Ethernet, MAC addresses |
| 1 | Physical | Transmits raw bits over a physical medium | Cables, Hubs, NICs |
Encapsulation means wrapping data with protocol information at each layer before transmission.
Decapsulation means the reverse process at the receiving end, removing headers as data moves up the layers.
Example: An email message (Application Layer) becomes bits on a wire (Physical Layer) after passing through all layers.
| Layer | Data Unit Name |
|---|---|
| Application, Presentation, Session | Data |
| Transport | Segments (TCP) / Datagrams (UDP) |
| Network | Packets |
| Data Link | Frames |
| Physical | Bits |
Each layer communicates with its peer layer on the receiving device using protocols.
Example: TCP on one computer communicates directly with TCP on another.
| OSI Model | TCP/IP Model |
|---|---|
| 7 layers | 4 layers |
| Conceptual and detailed | Practical and widely implemented |
| Transport layer uses TCP/UDP | Same protocols |
| Examples: IP, ICMP, HTTP | Same, but grouped differently |