Layered Network Protocol Architectures: OSI and TCP/IP

Protocol architectures organize communication tasks into layers. Each layer handles a specific function, ensuring modularity, easier troubleshooting, and interoperability.


๐Ÿ”น What is a Protocol Stack?

A protocol stack is a collection of network protocols layered to work together. Each layer performs a specific function and interacts with layers directly above and below.


๐Ÿ”น OSI Model (Open Systems Interconnection)

The OSI model is a theoretical model developed by ISO to standardize networking.

๐Ÿ–ผ๏ธ OSI Model Layers (Top to Bottom)

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” 7. Application (e.g., HTTP, FTP)
โ”‚              โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค 6. Presentation (e.g., Encryption, JPEG)
โ”‚              โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค 5. Session (e.g., APIs, sockets)
โ”‚              โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค 4. Transport (e.g., TCP, UDP)
โ”‚              โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค 3. Network (e.g., IP, ICMP)
โ”‚              โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค 2. Data Link (e.g., MAC, PPP)
โ”‚              โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ 1. Physical (e.g., Ethernet cables, signals)

โœณ๏ธ Function of Each Layer:

LayerFunctionExample Protocols
7. ApplicationUser interface & serviceHTTP, FTP, DNS
6. PresentationData formatting, encryptionSSL/TLS, JPEG
5. SessionConnection setup, syncNetBIOS, RPC
4. TransportReliable transmissionTCP, UDP
3. NetworkLogical addressing, routingIP, ICMP
2. Data LinkMAC addressing, framingEthernet, ARP, PPP
1. PhysicalBits over mediumCables, Wi-Fi signals

๐Ÿ”น Mnemonic to Remember

All People Seem To Need Data Processing


๐Ÿ”น TCP/IP Model

The TCP/IP model is the real-world implementation and forms the foundation of the Internet.

๐Ÿ–ผ๏ธ TCP/IP Layers

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” 4. Application (HTTP, FTP, SMTP)
โ”‚                      โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค 3. Transport (TCP, UDP)
โ”‚                      โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค 2. Internet (IP, ICMP)
โ”‚                      โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ 1. Network Access / Link (Ethernet, Wi-Fi)

โœณ๏ธ TCP/IP vs OSI Layer Mapping

OSI LayerTCP/IP Layer
Application (7)
Presentation (6)โ†’ Application
Session (5)
Transport (4)โ†’ Transport
Network (3)โ†’ Internet
Data Link (2)
Physical (1)โ†’ Network Access

๐Ÿ”ธ TCP/IP merges OSI layers into four practical layers.


๐Ÿ”น Comparison: OSI vs TCP/IP

FeatureOSI ModelTCP/IP Model
Developed byISODoD (Department of Defense)
Layers74
ProtocolsTheoreticalPractical/Implemented
UsageReference modelReal-world networking
Layer separationStrictFlexible

๐Ÿ”น Benefits of Layering

  • Modularity: Layers are independent.
  • Interoperability: Vendors can create compatible products.
  • Troubleshooting: Problems can be isolated per layer.
  • Scalability: Easy to upgrade layers without affecting others.

๐Ÿ”น Encapsulation Process

Encapsulation adds headers as data moves down layers (sender). Each layer wraps the data.

[Application Data]
      โ†“
[App Header + Data]
      โ†“
[Transport Header + Data]
      โ†“
[Network Header + Data]
      โ†“
[Data Link Header + Data + Trailer]
      โ†“
[Physical Layer: Bits on wire]

On the receiver side, the reverse happens (decapsulation).


๐Ÿ“ Summary

Both OSI and TCP/IP models define how data is transmitted across networks using layered protocols. While OSI is a conceptual model, TCP/IP is the foundation of real-world networking. Understanding the layered architecture helps in designing, implementing, and troubleshooting network systems.


Next Up: LAN, WAN, MAN, PAN, and LAN Topologies