OSI Model

From HackOps
Jump to navigation Jump to search

OSI Model

The OSI model explains how data travels through a network. It splits this process into **seven layers**. Each layer has its own job — from moving raw bits to showing a website.

Understanding the OSI model helps break down complex systems, and shows where tools, attacks, or failures happen.

OSI Layer Overview

The OSI model goes from Layer 1 (bottom) to Layer 7 (top). Each layer depends on the functionality of the ones above and below it. Knowing what happens at each layer helps in analyzing protocols, spotting weaknesses, and understanding where specific tools operate.

Layer Number What it does Common Examples
Application 7 Interfaces with user applications and defines network services HTTP, HTTPS, DNS, FTP, SMTP, IMAP, SSH, Telnet
Presentation 6 Translates, encrypts, and compresses data for the application layer TLS/SSL, ASCII, JPEG, MPEG, GZIP, Base64
Session 5 Manages and maintains sessions between systems NetBIOS, RPC, SMB, PPTP, SOCKS
Transport 4 Provides reliable or fast delivery of data streams TCP, UDP, SCTP, QUIC
Network 3 Handles routing and logical addressing across networks IP, ICMP, IGMP, IPsec, BGP, OSPF
Data Link 2 Transfers frames between directly connected devices using MAC addressing Ethernet, ARP, PPP, VLAN (802.1Q), LLDP
Physical 1 Moves electrical or optical signals across physical media Ethernet (cabling), Wi-Fi (802.11), fiber optics, hubs, radio signals

Easy Breakdown by Layer

This section gives a simplified explanation of each OSI layer and its function in the network stack. Each layer builds on the one below it, and together they define how data moves from one device to another.


Layer 1 – Physical

Responsible for the actual transmission of bits over a medium.

Covers physical components like voltage levels, timing, connectors, and media types. Defines how 0s and 1s are converted into signals and sent.


Layer 2 – Data Link

Ensures that data is correctly delivered between two devices on the same network.

Handles addressing at the hardware level and controls access to the transmission medium. Detects and may correct errors that occurred at the physical layer.


Layer 3 – Network

Enables communication between devices across different networks.

Provides logical addressing and determines the best route for data. Handles packet forwarding and fragmentation.


Layer 4 – Transport

Manages reliable or fast delivery of data across a connection.

Splits data into segments and reassembles it on arrival. Handles flow control and error correction for end-to-end communication.


Layer 5 – Session

Establishes and maintains sessions between devices.

Coordinates when communication starts, how long it lasts, and how it is terminated. Useful when multiple streams or long-lasting connections are needed.


Layer 6 – Presentation

Transforms data into formats the receiving system can understand.

Handles translation between data types, encryption, and compression. Ensures consistency in how data is interpreted across different systems.


Layer 7 – Application

Provides services that allow software to interact with the network.

Manages how user-facing programs access and use network resources. Defines network operations at the highest level, including authentication and data exchange.

What You Can Do with It

Understanding the OSI layers helps you:

  • Know where a tool or attack operates
  • Analyze traffic at the right level
  • Identify weak points or misconfigurations
  • Work smarter with packet captures, scans, or payloads

Protocols by Layer

Layer Number Function Summary Common Protocols
Application 7 Interfaces with apps like browsers and mail HTTP, FTP, DNS, SMTP
Presentation 6 Formats, encrypts, and compresses data TLS/SSL, Base64, JPEG
Session 5 Manages connections and sessions NetBIOS, PPTP, SMB
Transport 4 Ensures reliable or fast delivery TCP, UDP
Network 3 Routes packets between networks IP, ICMP, IPsec
Data Link 2 Sends frames on the local network Ethernet, ARP
Physical 1 Transfers raw bits via cables or air Wi-Fi (802.11), Ethernet (cabling)

See Also