OSI Model Layers Summary

Listen to this Post

1. Physical Layer (Layer 1)

Defines the physical characteristics of network hardware, including cables, connectors, and signaling.
Manages bit transmission over the medium (wired or wireless).

Key protocols: Ethernet (physical aspects), DSL, Fiber optics.

Commands:

  • Check network interface details: `ifconfig` or `ip a`
  • Test physical connectivity: `ping `

2. Data Link Layer (Layer 2)

Responsible for MAC addressing, error detection, and frame transmission.
Divided into two sublayers: LLC (Logical Link Control) and MAC (Media Access Control).
Uses switches, bridges, and protocols like Ethernet, PPP, and VLANs.

Commands:

  • View MAC address: `ip link show`
  • Configure VLAN: `vconfig add `

3. Network Layer (Layer 3)

Handles logical addressing (IP addresses), routing, and packet forwarding.
Uses routers and protocols like IPv4, IPv6, OSPF, BGP, and ICMP.

Supports fragmentation and reassembly of packets.

Commands:

  • View routing table: `route -n` or `ip route show`
  • Trace route: `traceroute `

4. Transport Layer (Layer 4)

Ensures end-to-end communication, reliability, and flow control.

Uses TCP (connection-oriented, reliable) and UDP (connectionless, fast).

Implements segmentation and reassembly of data.

Commands:

  • Check open ports: `netstat -tuln`
  • Test TCP connection: `nc -zv `

5. Session Layer (Layer 5)

Manages sessions, including establishment, maintenance, and termination.

Provides synchronization and checkpointing for data recovery.

Examples: NetBIOS, RPC, and session management in HTTP.

Commands:

  • Check active sessions: `ss -t`

6. Presentation Layer (Layer 6)

Responsible for data translation, encryption, compression, and encoding.

Ensures compatibility between different data formats.

Examples: SSL/TLS encryption, ASCII, JPEG, MPEG.

Commands:

  • Encrypt file: `openssl enc -aes-256-cbc -salt -in -out `

7. Application Layer (Layer 7)

Provides end-user services and network applications.

Includes protocols like HTTP, FTP, DNS, SMTP, and SNMP.

Commands:

  • Test HTTP connection: `curl `
  • Query DNS: `nslookup `

What Undercode Say

The OSI model is a foundational framework for understanding network communication, dividing the process into seven distinct layers. Each layer has a specific role, from physical data transmission to application-level interactions. Mastering these layers is crucial for network engineers and cybersecurity professionals.

For Physical Layer, tools like `ping` and `ifconfig` help diagnose connectivity issues. The Data Link Layer relies on MAC addresses, which can be inspected using ip link show. The Network Layer is where IP addressing and routing occur, with commands like `route -n` providing insights into routing tables.

The Transport Layer ensures reliable data delivery, with `netstat` and `nc` being essential for monitoring connections. The Session Layer manages communication sessions, and `ss -t` can display active sessions. The Presentation Layer handles data formatting and encryption, with `openssl` being a powerful tool for securing data. Finally, the Application Layer includes protocols like HTTP and DNS, which can be tested using `curl` and nslookup.

Understanding these layers and their associated commands is vital for troubleshooting, securing, and optimizing networks. For further reading, visit:
OSI Model Explained
Networking Basics

By mastering these concepts and commands, you can build a strong foundation in networking and cybersecurity.

References:

initially reported by: https://www.linkedin.com/posts/raja-mazhar-aa101159_osi-model-layers-summary-1-physical-layer-activity-7300739689936752640-Y60G – Hackers Feeds
Extra Hub:
Undercode AIFeatured Image