7 Layers Detailed
A deeper dive into each layer with protocols, devices, and real-world examples. Keep the stack diagram from the previous lesson in mind — this is what happens inside each row.
01Application layer
The only layer a user or developer directly interacts with. It provides network services to applications — browsers, email clients, file transfer tools. No lower layers are visible here.
- Provides an interface for network-aware apps
- Defines message format and syntax
- Authentication and data privacy at app level
- Example: browser sends
GET /HTTP request
02Presentation layer
Translates data between the application format and network format. Handles encryption, compression, and character encoding so both sides speak the same language.
- Encrypts outgoing data (TLS handshake)
- Decrypts incoming data
- Compresses data to reduce size
- Converts character sets (UTF-8 ↔ ASCII)
03Session layer
Establishes, maintains, and terminates sessions between applications. Handles checkpointing and recovery — if a transfer breaks mid-way, it can resume from the last checkpoint.
- Opens and closes communication sessions
- Sets checkpoints in data streams
- Manages half-duplex / full-duplex
- Example: video call session management
04Transport layer
End-to-end delivery between processes, identified by port numbers. TCP guarantees delivery and ordering; UDP sacrifices both for raw speed.
- Segments data into chunks
- Assigns source + destination ports
- TCP: flow control, error recovery
- UDP: no handshake, low latency
05Network layer
Moves packets across multiple networks using IP addresses. Routers operate here — they read the destination IP, consult their routing table, and forward the packet toward its destination.
- Logical addressing (IP)
- Routing between networks
- Fragmentation of large packets
- Device: Router
06Data Link layer
Node-to-node delivery on the same network segment. Uses MAC addresses to identify devices on the local network. Switches operate here — they learn which MAC is on which port.
- MAC addressing (48-bit hardware)
- Frame construction + CRC error check
- Media access control (CSMA/CD)
- Device: Switch / Bridge
07Physical layer
Transmits raw bits as physical signals — electrical voltage on copper, light pulses on fiber, or radio waves in the air. Defines connectors, cable specs, and signal timing.
- Bit encoding (NRZ, Manchester)
- Signal levels and timing
- Connector and cable specs
- Device: Hub / Repeater / NIC
08Summary
The OSI model is a troubleshooting map. When something breaks, you ask: "at which layer?" A cable problem is Layer 1. A wrong IP is Layer 3. An expired TLS certificate is Layer 6. A broken API is Layer 7. Knowing which layer owns the problem cuts debugging time dramatically.