OSI Model
The OSI Model explained for network beginners — from physical signals to application data.
What is the OSI Model?
A conceptual reference for understanding how data travels through networks
A Standardized Framework
The Open Systems Interconnection (OSI) model is a conceptual framework developed by the International Organization for Standardization (ISO) to standardize network communication by dividing it into seven abstract layers, each handling specific functions to enable interoperability across diverse systems.
A Universal Language
This reference model provides a universal language to understand how data travels across networks, from physical transmission to application-level interaction, without specifying particular protocols.
OSI vs. TCP/IP Model
Reference framework vs. real-world implementation
OSI Model (7 Layers)
- Theoretical reference framework
- Developed by ISO in the late 1970s
- Strict layer separation
- Used for education and conceptual understanding
- Distributed error handling across layers
TCP/IP Model (4 Layers)
- Practical, real-world implementation
- Developed by DARPA for ARPANET
- Flexible layer interaction
- Foundation of the modern Internet
- Error handling at the Transport layer
The Seven Layers
Each layer provides services to the layer above and relies on the one below
Application Layer
Provides network services directly to end-user applications. Supports protocols like HTTP, FTP, SMTP for file transfer, email, and web browsing.
Presentation Layer
Handles data translation, encryption, and formatting. Ensures secure representation via SSL/TLS and manages syntax conversion (ASCII to EBCDIC).
Session Layer
Establishes, manages, and terminates communication sessions between applications. Handles dialog control and synchronization points for recovery.
Transport Layer
Provides reliable end-to-end communication. Segments data into packets, ensures delivery with acknowledgment using TCP or UDP.
Network Layer
Manages end-to-end routing and logical addressing. Uses protocols like IP to forward packets across multiple networks through routers.
Data Link Layer
Responsible for node-to-node data transfer. Frames bits into logical units, detects errors via checksum using protocols like Ethernet.
Physical Layer
Handles transmission of raw bits over physical media. Defines electrical and mechanical specifications for devices like cables, hubs, and repeaters.
Data Flow — Two Mirror Directions
The same 7 layers work both ways: sender encapsulates on the way down; receiver decapsulates on the way up.
Encapsulation
Adds L7 · Application
The end-user interacts with the application and triggers a network request; the Application layer selects the appropriate protocol (e.g., HTTP for web, SMTP for email) and prepares the raw data for transmission.
Adds L6 · Presentation
Translates the data into a standardised, interoperable format; applies compression to reduce size; and encrypts the payload using SSL/TLS to ensure confidentiality in transit.
Adds L5 · Session
Establishes and maintains the communication session between the two applications; manages dialog control (who speaks when); and inserts synchronisation checkpoints to enable recovery if the connection is interrupted mid-transfer.
Adds L4 · Transport
Segments the data stream into discrete Segments (TCP) or Datagrams (UDP); prepends source and destination port numbers to identify the target application; appends sequence numbers (TCP) for ordered reassembly; and calculates a checksum for error detection.
Adds L3 · Network
Prepends an IP header containing the source and destination IP addresses and a Time-to-Live (TTL) value; makes the routing decision to determine the next-hop path; and fragments the Packet if it exceeds the Maximum Transmission Unit (MTU) of the outbound link.
Adds L2 · Data Link
Encapsulates the Packet into an Ethernet Frame by prepending a header with the source and destination MAC addresses; appends a Frame Check Sequence (FCS) trailer for error detection; and governs access to the shared physical medium.
Sends L1 · Physical
Converts the complete Frame into a stream of raw bits and encodes them as physical signals — electrical voltages on copper, pulses of light on fibre, or radio waves over wireless — and transmits them across the physical medium to the next device.
Decapsulation
Receives L1 · Physical
Receives the raw physical signals from the medium and decodes them back into a stream of bits; performs clock recovery and bit synchronisation to reconstruct the original digital data reliably before passing it to the layer above.
Strips L2 · Data Link
Reassembles the bit stream into a complete Ethernet Frame; validates data integrity by verifying the Frame Check Sequence (FCS); confirms the destination MAC address matches the local interface; then strips the frame header and trailer to expose the encapsulated Packet.
Strips L3 · Network
Validates the IP header integrity; confirms the destination IP address matches the local host; reassembles any fragmented packets into the original Segment; then removes the IP header and forwards the payload upward.
Strips L4 · Transport
Reads the destination port number to identify the target application process; verifies the checksum for transport-level errors; reorders out-of-sequence Segments using sequence numbers (TCP); and removes the Transport header before delivering the data stream to the Session layer.
Strips L5 · Session
Matches the incoming data to the correct active session; manages dialog sequencing to maintain orderly communication; and verifies synchronisation checkpoints to confirm the data arrived completely and in the expected order.
Strips L6 · Presentation
Decrypts the payload using the negotiated SSL/TLS keys; decompresses the data back to its original size; and translates the encoding from the transmission format into the character set and data format understood by the destination application (e.g., UTF-8, JSON).
Delivers L7 · Application
Processes the application-layer protocol (e.g., HTTP response parsing, email rendering via SMTP/IMAP); interprets the received data according to the protocol specification; and presents the final, human-readable result to the end-user application.
Same 7 layers, mirror-image directions
The sender adds headers going down (L7 → L1); the receiver strips headers going up (L1 → L7). Each peer layer on both sides speaks the exact same protocol — a virtual conversation happening layer-by-layer.
Key Concepts
Protocol Data Units, peer-layer and adjacent-layer interactions
Protocol Data Unit (PDU)
The name of the data unit changes at each layer as headers are added. See the transformation chain below.
Peer-Layer Interaction
Each layer on the sender communicates virtually with the matching layer on the receiver. HTTP talks to HTTP; TCP talks to TCP; Ethernet talks to Ethernet.
Adjacent-Layer Interaction
Each layer serves the layer above it and uses services from the layer below — a strict service contract in both directions.
PDU Transformation Through Layers
How the same payload is named as it descends the stack
Packet Anatomy — Byte by Byte
Each layer adds its own header (and sometimes trailer) in front of the payload
PDU Transformation — Flowing Down the Stack
Watch the packet travel through each layer, growing as headers are appended
PDU Flow — Encapsulation ⇄ Decapsulation
Two mirror pyramids showing how the same PDU name appears on both sides of the wire
Sender · Encapsulation
L7 → L1 · Headers addedReceiver · Decapsulation
L1 → L7 · Headers strippedOver the wire: only bits
The bottom of the sender's pyramid and the top of the receiver's pyramid meet as raw bits on the physical medium. Every layer above that is a virtual conversation reconstructed from those bits.
Get In Touch
Complex infrastructure challenges deserve elegant solutions. Let's realize it together.
gynlam328@gmail.com
Phone
+84-83314-1685
Location
Ban Co Ward - Previously known as District 3, HCMC