Concept of Layering (OSI & TCP/IP Models)

Layering is a design principle used in networking to break down complex communication into simpler steps. It divides the network communication process into layers, where each layer has a specific role and talks only to the layers directly above or below it.


OSI Model (Open Systems Interconnection)

It breaks down the communication process into 7 layers, each with specific roles. OSI is theoretical model.

OSI Model
LayerCommon Protocols

Application

Interfaces directly with end-user applications to provide network services. Ex - Web browsers, email apps, file sharing apps

HTTP, HTTPS, FTP, SMTP, POP3, IMAP, DNS

Presentation

Translates data between the application and the network like handles encryption, decryption, compression, formatting and character encoding (e.g., ASCII, EBCDIC, Unicode). Ex - SSL/TLS for encryption, converting text to readable formats.

SSL, TLS, JPEG, MPEG, ASCII, EBCDIC

Session

Manages sessions (connections) between applications like establishes, maintains, and terminates connections. Ensures both sides agree on when to start/stop sending data in complex interactions. Ex - Logging into a website or remote server

NetBIOS, PPTP, RPC, SMB, SIP

Transport

Ensures reliable delivery of data end-to-end, manages flow control, error detection and retransmission. Port addressing to differentiate multiple applications running on the same host. Ex - Downloading a file, video streaming (buffering), gaming

TCP (connection-oriented, reliable), UDP (connectionless, less overhead, faster but no guaranteed delivery.), SCTP

Network

Handles routing, path determination and routing decisions, and packet forwarding across networks. Assigns logical addresses (IP). Ex- Routers sending data to the correct destination

IP, ICMP, IGMP, IPSec, ARP, RIP, OSPF, BGP

Data Link

Provides node-to-node data transfer, handles MAC addressing and error detection between devices on the same network. Ex - Wi-Fi access, LAN communication, Ethernet switching

Ethernet (802.3), Wi-Fi (802.11), PPP(Point-to-Point Protocol), HDLC, ARP, VLANs

Physical

Deals with the physical connection between devices, transmitting raw bits over cables or wireless. Ex - Ethernet cables, fiber optics, radio signals

RJ45, USB, Bluetooth, DSL, coaxial, optical fiber

Only Layers 1 to 4 (Physical, Data link, Network and Transport) are concerned with actual data transmission, while Layers 5 to 7 (Session, Presentation, and Application) handle how apps use and understand that data.




TCP/IP Model (Transmission Control Protocol / Internet Protocol)

The TCP/IP model is a simplified 4-layer model that describes how data is transmitted over the internet. It is the real-world implementation of networking. It maps closely to the OSI Model but with fewer layers. TCP/IP is practical and widely used. The Internet is based on TCP/IP.

Comparison to OSI
TCP/IP LayerOSI Layers

Application

7 – Application

6 – Presentation

5 – Session

Transport

4 – Transport

Internet

3 – Network

Network Access

2 – Data Link

1 – Physical