Labs ICT
โญ Pro Login

Network Models

OSI vs TCP/IP โ€” the blueprints every network engineer must know.

Two Models to Rule Them All

Networking is complex โ€” data passes through many layers of hardware and software before reaching its destination. To make this complexity manageable, we use reference models that break the process into logical layers. There are two main models: the OSI model and the TCP/IP model.

The OSI Model

The Open Systems Interconnection (OSI) model was developed by the International Organization for Standardization (ISO) in 1984. It divides networking into 7 layers, each with a specific job:


  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
  โ”‚  Layer 7: Application                   โ”‚  โ† User interfaces (HTTP, FTP, DNS)
  โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
  โ”‚  Layer 6: Presentation                  โ”‚  โ† Data format, encryption, compression
  โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
  โ”‚  Layer 5: Session                       โ”‚  โ† Managing connections between apps
  โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
  โ”‚  Layer 4: Transport                     โ”‚  โ† End-to-end delivery (TCP, UDP)
  โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
  โ”‚  Layer 3: Network                       โ”‚  โ† Routing & IP addressing
  โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
  โ”‚  Layer 2: Data Link                     โ”‚  โ† MAC addresses, frames, switching
  โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
  โ”‚  Layer 1: Physical                      โ”‚  โ† Cables, signals, bits on the wire
  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Mnemonic: "Please Do Not Throw Sausage Pizza Away" (Physical, Data Link, Network, Transport, Session, Presentation, Application) โ€” from bottom to top.

How the Layers Work Together

When you send data, it flows down through the layers (encapsulation). Each layer adds its own header (and sometimes trailer) to the data. When the data arrives at the destination, it flows back up through the layers (de-encapsulation), with each layer stripping off its header.


  SENDER                                          RECEIVER
  โ”€โ”€โ”€โ”€โ”€โ”€                                          โ”€โ”€โ”€โ”€โ”€โ”€โ”€
  Application  โ”€โ”€โ†’  Data                    Data  โ”€โ”€โ†’  Application
  Presentation โ”€โ”€โ†’  [Header] + Data    [Header] + Data โ”€โ”€โ†’  Presentation
  Session      โ”€โ”€โ†’  [Header] + ...     [Header] + ... โ”€โ”€โ†’  Session
  Transport    โ”€โ”€โ†’  Segment             Segment โ”€โ”€โ†’  Transport
  Network      โ”€โ”€โ†’  Packet              Packet โ”€โ”€โ†’  Network
  Data Link    โ”€โ”€โ†’  Frame               Frame โ”€โ”€โ†’  Data Link
  Physical     โ”€โ”€โ†’  Bits โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ†’ Bits โ”€โ”€โ†’  Physical

Think of it like putting a letter in an envelope, then in a package, then in a shipping box. Each layer adds its own packaging. The receiving side unpacks each layer in reverse order.

The TCP/IP Model

The TCP/IP model is the practical model used on the real internet. It simplifies the OSI model into 4 layers:


  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
  โ”‚  Application                            โ”‚  โ† OSI Layers 5-7 combined
  โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
  โ”‚  Transport                              โ”‚  โ† TCP, UDP
  โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
  โ”‚  Internet                               โ”‚  โ† IP, routing
  โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
  โ”‚  Network Access (Link)                  โ”‚  โ† OSI Layers 1-2 combined
  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

The TCP/IP model is what the internet actually uses. The OSI model is more of a teaching tool โ€” it's great for understanding concepts, but real-world protocols don't map neatly to all 7 layers.

OSI vs TCP/IP


  OSI Model          TCP/IP Model        Real Protocols
  โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€  โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€  โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
  Application        โ”
  Presentation       โ”œโ”€โ†’ Application     HTTP, DNS, FTP, SMTP
  Session            โ”˜
  Transport          โ†’ Transport         TCP, UDP
  Network            โ†’ Internet          IP, ICMP, ARP
  Data Link          โ”
  Physical           โ”˜โ”€โ†’ Network Access  Ethernet, Wi-Fi

Both models are important to understand. The OSI model helps you think about networking in structured layers. The TCP/IP model shows you how the internet actually works.

๐Ÿงช Quick Quiz

How many layers does the OSI model have?