• Post author:Bhaskar Soni
  • Post published:
  • Post category:Networking
  • Post comments:2 Comments
  • Reading time:3 mins read

The OSI (Open Systems Interconnection) model is a seven-layer framework that describes how data travels between devices on a network. ISO published it in 1984 as ISO/IEC 7498-1. Real networks run on the simpler TCP/IP suite, but the OSI model remains the common language engineers use to learn, design and troubleshoot networks.

This guide explains each layer, with example protocols and devices, how encapsulation works and how to use the model to solve problems.

OSI model

The seven layers at a glance

LayerNameMain jobExamplesData unit
7ApplicationNetwork services for applicationsHTTP, DNS, SMTP, SSHData
6PresentationData format, encryption, compressionTLS, JPEG, UTF-8Data
5SessionOpen, manage and close sessionsSession management in RPC, SMBData
4TransportEnd-to-end delivery, ports, reliabilityTCP, UDPSegment / datagram
3NetworkLogical addressing and routingIPv4, IPv6, ICMP, OSPFPacket
2Data linkDelivery on the local link, MAC addressesEthernet, Wi-Fi, ARP, VLANsFrame
1PhysicalBits on the mediumCables, fibre, radio, connectorsBits

A popular memory aid, from layer 7 down, is “All People Seem To Need Data Processing”.

Layer by layer

Layer 1: Physical

This layer turns bits into electrical, optical or radio signals. It covers cables, connectors, voltages and frequencies. Hubs, repeaters and transceivers work here.

Layer 2: Data link

The data link layer packages bits into frames and delivers them between devices on the same network using MAC addresses. It also detects transmission errors. Switches and network cards work mainly at this layer, and VLANs and Spanning Tree belong here.

Layer 3: Network

The network layer gives devices logical addresses, such as IP addresses, and chooses paths between networks. Routers and Layer 3 switches operate here.

Layer 4: Transport

The transport layer delivers data between programs using port numbers. TCP provides reliable, ordered delivery with acknowledgements and flow control. UDP is faster but does not guarantee delivery. Firewalls often filter traffic at this layer.

Layer 5: Session

The session layer sets up, maintains and ends conversations between applications. In practice, applications and transport protocols usually handle this job.

Layer 6: Presentation

The presentation layer makes sure both sides understand the data format. It covers character encoding, data serialisation, compression and encryption.

Layer 7: Application

This layer provides network services to software, such as web browsing, email and file transfer. It is not the application itself, but the protocols it uses. Web application firewalls and proxies inspect traffic here.

Encapsulation and decapsulation

On the sender, each layer adds its own header as data moves down: transport adds ports, network adds IP addresses and data link adds MAC addresses. On the receiver, each layer removes its header as data moves up. For an everyday version, read our OSI model analogy.

Why the OSI model still matters

  • Troubleshooting: work up from layer 1 (cable) to layer 7 (application) to find a fault quickly.
  • Communication: terms like “layer 2 switch” or “layer 7 load balancer” are understood everywhere.
  • Security: controls map to layers, for example port security at layer 2, ACLs at layers 3 and 4, and WAFs at layer 7.
  • Learning: it breaks a complex system into manageable parts.

OSI vs TCP/IP

The TCP/IP model has four layers: application (OSI 5 to 7), transport, internet and link (OSI 1 and 2). Read more in the TCP/IP model explained.

Sources

Need help with network security? We test routers, firewalls, ACLs and segmentation as part of our VAPT services and hardening audits. Contact us for a quote.

Post author avatar

Bhaskar Soni

Bhaskar Soni is a Security Engineer and the founder of Youngster Company, based in Ahmedabad, Gujarat. He works hands-on with Linux server hardening, vulnerability assessment and penetration testing (VAPT), ISO 27001 compliance and OSINT investigations. He writes practical, tested guides for IT professionals and Indian businesses, and every article on this site is written or reviewed by him.

This Post Has 2 Comments

Leave a Reply