AiTechWorlds
AiTechWorlds
You want to send a letter to a friend in Japan. Here is what actually happens: you write the letter (create the content), fold it and seal it in an envelope (package it), write the address on the outside (add routing information), drop it at the post office (hand it to a transport system), it gets sorted and transported across countries (network routing), passes through customs (security and protocol checking), gets delivered to their local post office (local delivery), and finally your friend opens it and reads it (decapsulation and consumption).
Every step adds something. Every step has a defined job. No step needs to know the details of other steps — the postal worker does not read your letter, and you do not know which aircraft your letter flew on. This separation of concerns is the genius of the OSI model.
In the 1970s, every computer manufacturer had its own proprietary networking protocols. IBM's network equipment only worked with IBM computers. DEC's only worked with DEC. This was a business advantage for vendors but a nightmare for customers who needed interoperability.
The International Organization for Standardization (ISO) developed the OSI (Open Systems Interconnection) model in 1984 as a conceptual framework that:
The OSI model does not describe actual protocols (TCP/IP does that). It describes what needs to happen at each conceptual stage of communication.
Mnemonic (Layer 7 to Layer 1): "All People Seem To Need Data Processing"
Mnemonic (Layer 1 to Layer 7): "Please Do Not Throw Sausage Pizza Away"
What it does: Provides network services directly to user applications. This is where user-facing protocols live.
Not the application itself — it is the interface between your application and the network. When Chrome wants to load a web page, it uses HTTP at Layer 7.
Protocols: HTTP, HTTPS, FTP, SMTP, POP3, IMAP, DNS, SSH, Telnet
Devices: None specific — this is software/application level
Real analogy: You write the content of your letter in English
PDU (Protocol Data Unit): Data
What it does: Translates, encrypts, and compresses data. Ensures data from the sender's application layer can be read by the receiver's application layer.
Handles: Character encoding (ASCII vs Unicode), encryption (SSL/TLS begins here), data compression (JPEG, MPEG compression formats)
Protocols: SSL/TLS (partially), JPEG, PNG, MPEG, ASCII, Unicode
Real analogy: You decide to write in a language both of you understand, and you seal the envelope for privacy
PDU: Data
What it does: Establishes, manages, and terminates sessions (ongoing conversations) between applications. Handles session checkpoints for resuming interrupted transfers.
Responsible for: Session establishment, maintenance, and termination. When you log into a website, a session is created. When you log out, it is terminated.
Protocols: NetBIOS, RPC (Remote Procedure Call), PPTP
Real analogy: The formality of beginning a letter ("Dear Friend") and ending it ("Yours sincerely") — establishing and closing the communication context
PDU: Data
What it does: Provides reliable (or fast) end-to-end data delivery. Segments large data into smaller pieces, reassembles them at the destination, handles error recovery and flow control.
Two main protocols:
Protocols: TCP, UDP
Devices: Firewalls (stateful), load balancers
Real analogy: The post office decides whether to use standard mail or registered mail with tracking
PDU: Segment (TCP) / Datagram (UDP)
What it does: Handles logical addressing (IP addresses) and routing — finding the best path across multiple networks from source to destination.
Responsible for: IP addressing, routing between networks, fragmentation (breaking packets when they exceed path MTU)
Protocols: IP (IPv4, IPv6), ICMP, OSPF, BGP, ARP (debated — some say Layer 2.5)
Devices: Routers, Layer 3 switches
Real analogy: The address on your envelope — the city, country, and ZIP code that gets it routed to the right country and city
PDU: Packet
What it does: Handles physical addressing (MAC addresses) and reliable node-to-node delivery on the same local network. Detects and sometimes corrects errors in Layer 1 transmission.
Two sublayers:
Protocols: Ethernet, Wi-Fi (802.11), PPP, ARP, VLAN (802.1Q)
Devices: Switches, bridges, wireless access points
Real analogy: The specific street address on your envelope — which house on which street within the city to deliver to
PDU: Frame
What it does: Transmits raw bits (1s and 0s) over a physical medium. Defines voltages, cable types, connector types, pin layouts, radio frequencies.
Responsible for: Bit timing, signal encoding, transmission rate, physical connector specifications
Standards: Ethernet physical specs (Cat5e, Cat6, fiber), Wi-Fi radio specifications, Bluetooth
Devices: Hubs, repeaters, cables, connectors, NICs (physical component)
Real analogy: The actual truck, plane, or ship that physically carries your letter from one country to another
PDU: Bits
| Layer | Name | Function | Protocols | Device | PDU |
|---|---|---|---|---|---|
| 7 | Application | User-facing services | HTTP, FTP, SMTP, DNS | — | Data |
| 6 | Presentation | Encoding, encryption, compression | SSL/TLS, JPEG, MPEG | — | Data |
| 5 | Session | Session management | NetBIOS, RPC | — | Data |
| 4 | Transport | End-to-end delivery, segmentation | TCP, UDP | Firewall | Segment |
| 3 | Network | Logical addressing, routing | IP, ICMP, OSPF, BGP | Router | Packet |
| 2 | Data Link | Physical addressing, local delivery | Ethernet, Wi-Fi, ARP | Switch | Frame |
| 1 | Physical | Raw bit transmission | Ethernet physical, fiber, DSL | Hub, Cable | Bits |
When data travels down the OSI model (sender side), each layer adds its own header — this is called encapsulation:
When data travels up the OSI model (receiver side), each layer strips its own header — this is decapsulation. The receiver's Layer 2 reads and removes the Ethernet header. Layer 3 reads and removes the IP header. Layer 4 reads and removes the TCP header. Layer 7 receives the original data.
| Protocol | Layer | Why |
|---|---|---|
| HTTP/HTTPS | Layer 7 | Application-level web protocol |
| TLS/SSL | Layer 6 (or 4-7) | Encryption/presentation |
| TCP | Layer 4 | Transport — segmentation and reliability |
| UDP | Layer 4 | Transport — fast, connectionless |
| IP | Layer 3 | Network — logical addressing |
| ICMP (ping) | Layer 3 | Network — diagnostics |
| ARP | Layer 2 (or 2.5) | Resolves IP to MAC address |
| Ethernet | Layer 2 | Local data link framing |
| Wi-Fi (802.11) | Layer 1–2 | Physical + data link for wireless |
The OSI model's real value is not memorizing layers — it is having a common vocabulary. When a network engineer says "the problem is at Layer 3," everyone knows to look at IP routing. That shared language saves enormous time during troubleshooting.
Get this course's notes on Telegram!
Free cheat sheets, summaries & practice exercises