Thursday, March 20, 2025


**OSI Model: Fundamental Networking Framework**

The OSI (Open Systems Interconnection) model is a conceptual framework that standardizes the functions of a telecommunication or computing system into a communication system, without regard to its underlying internal structure and technology. It characterizes and standardizes the communication functions of a computing system without regard to its underlying internal structure and technology.

**Key Learnings and Notes:**

1.  **Purpose of the OSI Model:**

    * Provides a standardized way to understand how data travels across a network.

    * Facilitates troubleshooting by isolating network problems to specific layers.

    * Promotes interoperability between different hardware and software.

2.  **The Seven Layers:**

    * The OSI model consists of seven distinct layers, each with specific functions.

3.  **Layers and Their Functions:**

    * **Layer 7: Application Layer**

        * Provides network services directly to end-user applications.

        * Handles protocols like HTTP, HTTPS, SMTP, DNS, and FTP.

        * **Example:**

            * When you open a web browser and type `www.example.com`, the Application Layer uses HTTP/HTTPS to communicate with the web server.

            * Email clients use SMTP to send emails.

            * DNS translates domain names to IP addresses.

    * **Layer 6: Presentation Layer**

        * Handles data formatting, encryption, and compression.

        * Ensures that data is in a format that the Application Layer can understand.

        * **Example:**

            * Converting data from ASCII to EBCDIC.

            * Encrypting data using SSL/TLS.

            * Image compression like JPEG or PNG.

    * **Layer 5: Session Layer**

        * Manages communication sessions between applications.

        * Establishes, maintains, and terminates connections.

        * **Example:**

            * Managing login sessions on a web server.

            * Handling RPC (Remote Procedure Call) sessions.

            * NetBIOS session management.

    * **Layer 4: Transport Layer**

        * Provides reliable or unreliable data delivery between end systems.

        * Uses protocols like TCP (reliable) and UDP (unreliable).

        * **Example:**

            * TCP ensures that all packets are delivered in the correct order and without errors.

            * UDP is used for streaming video or online gaming, where speed is more important than reliability.

            * TCP port 80 for web traffic.

    * **Layer 3: Network Layer**

        * Handles logical addressing (IP addresses) and routing.

        * Determines the best path for data to travel across a network.

        * Uses protocols like IP, ICMP, and ARP.

        * **Example:**

            * Routers use IP addresses to forward packets between networks.

            * ICMP is used for pinging network devices.

            * ARP resolves IP addresses to MAC addresses.

    * **Layer 2: Data Link Layer**

        * Handles physical addressing (MAC addresses) and error detection.

        * Divides data into frames and transmits them across a physical link.

        * Uses protocols like Ethernet and Wi-Fi.

        * **Example:**

            * Ethernet switches use MAC addresses to forward frames within a local network.

            * Error detection through CRC (Cyclic Redundancy Check).

            * Wireless communication using 802.11 standards.

    * **Layer 1: Physical Layer**

        * Handles the physical transmission of data bits over a medium.

        * Defines electrical, mechanical, and procedural specifications for the physical link.

        * **Example:**

            * Ethernet cables, fiber optic cables, and wireless signals.

            * Voltage levels, frequencies, and data rates.

            * RJ45 connectors.


4.  **Data Encapsulation:**

    * As data travels down the OSI model, each layer adds its own header (and sometimes a trailer) containing control information.

    * This process is known as encapsulation.

    * **Example:**

        * Application data is encapsulated into TCP segments, then IP packets, then Ethernet frames, and finally transmitted as electrical signals.


5.  **Data Decapsulation:**

    * As data travels up the OSI model at the receiving end, each layer removes its corresponding header and trailer.

    * This process is known as decapsulation.


6.  **Troubleshooting with the OSI Model:**

    * By understanding the OSI model, you can systematically troubleshoot network problems.

    * For example, if you can't access a website, you can check if the problem is at the Application Layer (HTTP), Transport Layer (TCP), Network Layer (IP), or Data Link Layer (Ethernet).

    * **Example:**

        * If pinging an ip address fails, the problem is at layer 3 or below.

        * If pinging works, but a website does not load, the problem is at layer 4 or above.


7.  **Mnemonics for Remembering the Layers:**

    * "Please Do Not Throw Sausage Pizza Away" (Physical, Data Link, Network, Transport, Session, Presentation, Application)

    * "All People Seem To Need Data Processing" (Application, Presentation, Session, Transport, Network, Data Link, Physical)


8.  **Practical Application in Cybersecurity (TryHackMe Context):**

    * Understanding the OSI model is crucial for network security assessments.

    * It helps in identifying vulnerabilities at different layers, such as:

        * Application Layer: Web application vulnerabilities (e.g., SQL injection, XSS).

        * Network Layer: IP spoofing, routing attacks.

        * Data Link Layer: ARP poisoning, MAC flooding.

        * Physical Layer: Cable tapping.

    * Wireshark is a tool that allows you to see the traffic at the different layers, helping you to understand how the OSI model works, and also to find potential problems.


No comments:

Post a Comment

Splunk

Splunk  has three main components, namely Forwarder, Indexer, and Search Head. These components are explained below: Splunk  Forwarder Splun...