OSI Model: Difference between revisions

From HackOps
Jump to navigation Jump to search
 
(3 intermediate revisions by the same user not shown)
Line 7: Line 7:
== OSI Layer Overview ==
== OSI Layer Overview ==


The OSI model goes from Layer 1 (bottom) to Layer 7 (top). Each layer works with the ones above and below it.
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.


{| class="wikitable"
{| class="wikitable"
! Layer !! Number !! What it does !! Example
! Layer !! Number !! What it does !! Common Examples
|-
|-
| Application || 7 || Talks directly with user apps || HTTP (web), DNS
| Application || 7 || Interfaces with user applications and defines network services || HTTP, HTTPS, DNS, FTP, SMTP, IMAP, SSH, Telnet
|-
|-
| Presentation || 6 || Translates and encrypts data || TLS, JPEG
| Presentation || 6 || Translates, encrypts, and compresses data for the application layer || TLS/SSL, ASCII, JPEG, MPEG, GZIP, Base64
|-
|-
| Session || 5 || Keeps communication open || NetBIOS, RPC
| Session || 5 || Manages and maintains sessions between systems || NetBIOS, RPC, SMB, PPTP, SOCKS
|-
|-
| Transport || 4 || Sends data fully and in order || TCP, UDP
| Transport || 4 || Provides reliable or fast delivery of data streams || TCP, UDP, SCTP, QUIC
|-
|-
| Network || 3 || Routes packets between networks || IP, ICMP
| Network || 3 || Handles routing and logical addressing across networks || IP, ICMP, IGMP, IPsec, BGP, OSPF
|-
|-
| Data Link || 2 || Sends frames on the local network || Ethernet, ARP
| Data Link || 2 || Transfers frames between directly connected devices using MAC addressing || Ethernet, ARP, PPP, VLAN (802.1Q), LLDP
|-
|-
| Physical || 1 || Moves bits through cables or air || Wi-Fi, fiber, ethernet cables
| 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 ==
== Easy Breakdown by Layer ==
Each layer in the OSI model has a specific role. Together, they describe how data moves across a network — from your device to another system, step by step.


=== Layer 1 – Physical ===   
=== Layer 1 – Physical ===   
Moves raw data (0s and 1s) over wires or radio.   
 
Involves: cables, Wi-Fi signals, connectors.
Moves raw bits (0s and 1s) over cables or air.   
 
Involves physical elements like Ethernet cables, fiber optics, and Wi-Fi signals
 
Example: When you plug in a network cable or connect to Wi-Fi, Layer 1 is active.
 


=== Layer 2 – Data Link ===   
=== Layer 2 – Data Link ===   
Sends frames between devices on the same network.   
 
Uses: MAC addresses, switches, ARP.
Connects devices on the same local network.   
 
Uses MAC addresses to make sure data reaches the right device. 
 
Example: Your router sends a frame to your laptop using its MAC address.
 


=== Layer 3 – Network ===   
=== Layer 3 – Network ===   
Chooses the best path for data across networks.   
 
Uses: IP addresses, routers, ICMP.
Routes data between networks. 
 
Uses IP addresses to find the best path for packets.   
 
Example: Sending a ping to a website shows Layer 3 in action.
 


=== Layer 4 – Transport ===   
=== Layer 4 – Transport ===   
Breaks data into smaller parts and reassembles it.   
 
TCP ensures reliability, UDP focuses on speed.
Ensures complete delivery of data
 
Splits information into segments and reassembles them correctly.   
 
Example: TCP guarantees a webpage loads fully, UDP is used for faster but less reliable connections like video calls.
 


=== Layer 5 – Session ===   
=== Layer 5 – Session ===   
Keeps a connection open and manages how long systems talk.   
 
Used for: remote access, file sharing.
Manages the start, duration, and end of communication sessions. 
 
Keeps track of active connections between systems.   
 
Example: Maintaining a stable connection while using SSH or video conferencing.
 


=== Layer 6 – Presentation ===   
=== Layer 6 – Presentation ===   
Changes how data looks — like converting text or encrypting.   
 
Handles: encoding, compression, TLS.
Makes data readable and secure.   
 
Handles file formats, encryption, and compression
 
Example: TLS secures your connection when using HTTPS, and JPEG ensures images display correctly.
 


=== Layer 7 – Application ===   
=== Layer 7 – Application ===   
Where programs like browsers and email clients connect to the network.   
 
Talks via: HTTP, FTP, DNS, SMTP.
Connects software to the network. 
 
Defines how user-facing programs communicate over the network. Often includes a graphical user interface (GUI) for interacting with network services.   
 
Example: Opening a website in a browser (HTTP), sending an email from an app (SMTP), or resolving a domain name using DNS.


== What You Can Do with It ==
== What You Can Do with It ==

Latest revision as of 17:59, 7 June 2025

OSI Model[edit | edit source]

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[edit | edit source]

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[edit | edit source]

Each layer in the OSI model has a specific role. Together, they describe how data moves across a network — from your device to another system, step by step.


Layer 1 – Physical[edit | edit source]

Moves raw bits (0s and 1s) over cables or air.

Involves physical elements like Ethernet cables, fiber optics, and Wi-Fi signals.

Example: When you plug in a network cable or connect to Wi-Fi, Layer 1 is active.


Layer 2 – Data Link[edit | edit source]

Connects devices on the same local network.

Uses MAC addresses to make sure data reaches the right device.

Example: Your router sends a frame to your laptop using its MAC address.


Layer 3 – Network[edit | edit source]

Routes data between networks.

Uses IP addresses to find the best path for packets.

Example: Sending a ping to a website shows Layer 3 in action.


Layer 4 – Transport[edit | edit source]

Ensures complete delivery of data.

Splits information into segments and reassembles them correctly.

Example: TCP guarantees a webpage loads fully, UDP is used for faster but less reliable connections like video calls.


Layer 5 – Session[edit | edit source]

Manages the start, duration, and end of communication sessions.

Keeps track of active connections between systems.

Example: Maintaining a stable connection while using SSH or video conferencing.


Layer 6 – Presentation[edit | edit source]

Makes data readable and secure.

Handles file formats, encryption, and compression.

Example: TLS secures your connection when using HTTPS, and JPEG ensures images display correctly.


Layer 7 – Application[edit | edit source]

Connects software to the network.

Defines how user-facing programs communicate over the network. Often includes a graphical user interface (GUI) for interacting with network services.

Example: Opening a website in a browser (HTTP), sending an email from an app (SMTP), or resolving a domain name using DNS.

What You Can Do with It[edit | edit source]

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[edit | edit source]

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[edit | edit source]