14 ‐ OSI Model - CloudScope/DevOpsWithCloudScope GitHub Wiki

Certainly! Below is a textual representation of the OSI model along with a brief explanation of each layer. For a visual diagram, imagine a stacked diagram with each layer labeled from bottom to top.

OSI Model Diagram:

+----------------------+
|    Application       | (Layer 7)
|----------------------|
|    Presentation      | (Layer 6)
|----------------------|
|    Session           | (Layer 5)
|----------------------|
|    Transport         | (Layer 4)
|----------------------|
|    Network           | (Layer 3)
|----------------------|
|    Data Link         | (Layer 2)
|----------------------|
|    Physical          | (Layer 1)
+----------------------+

Descriptions:

  1. Physical Layer (Layer 1):

    • Description: Handles the transmission of raw data bits over a physical medium. It involves the hardware technologies and the actual connections (e.g., cables, switches).
    • Examples: Ethernet cables, fiber optics.
  2. Data Link Layer (Layer 2):

    • Description: Responsible for node-to-node data transfer and error detection/correction at the physical layer. It uses MAC addresses to identify devices on the same network segment.
    • Examples: Ethernet, Wi-Fi, switches.
  3. Network Layer (Layer 3):

    • Description: Manages logical addressing and routing of data packets between devices across networks. It ensures data is sent from the source to the destination.
    • Examples: IP addresses, routers, routing protocols.
  4. Transport Layer (Layer 4):

    • Description: Provides end-to-end communication services for applications. It handles data segmentation, reassembly, and error recovery, ensuring reliable data transfer.
    • Examples: TCP (reliable), UDP (best-effort).
  5. Session Layer (Layer 5):

    • Description: Manages sessions or connections between applications. It establishes, maintains, and terminates connections.
    • Examples: APIs, session management protocols.
  6. Presentation Layer (Layer 6):

    • Description: Translates and formats data for the application layer. It handles data encryption, compression, and translation between different data formats.
    • Examples: Encryption (SSL/TLS), data translation.
  7. Application Layer (Layer 7):

    • Description: Provides network services directly to end-user applications. It is where network applications and protocols reside.
    • Examples: HTTP, FTP, SMTP, DNS.

Key Concepts:

  • Encapsulation: As data passes down from Layer 7 to Layer 1, each layer adds its own header (or trailer) to the data, encapsulating it.
  • Decapsulation: As data ascends from Layer 1 to Layer 7, headers (or trailers) are removed, and the data is processed according to each layer’s function.

This model helps in understanding and designing network communication systems by breaking down complex processes into manageable, distinct functions.

Encapsulation and decapsulation are fundamental concepts in networking that describe how data is prepared for transmission over a network and how it is interpreted upon receipt. These processes align with the OSI model's layers and their responsibilities.

Encapsulation

Encapsulation is the process of wrapping data with protocol information at each layer of the OSI model as it is prepared for transmission from the source to the destination.

Here’s how encapsulation works across the OSI model layers:

  1. Application Layer (Layer 7):

    • Role: Generates data or application payload, such as a web page or email.
    • Data Unit: Data.
  2. Presentation Layer (Layer 6):

    • Role: Translates or formats the data from the Application Layer. This can include data encryption or compression.
    • Data Unit: Data.
  3. Session Layer (Layer 5):

    • Role: Manages sessions and maintains communication state.
    • Data Unit: Data.
  4. Transport Layer (Layer 4):

    • Role: Segments data into smaller units for transmission. Adds headers for error detection, correction, and flow control.
    • Data Unit: Segments (TCP) or Datagrams (UDP).
  5. Network Layer (Layer 3):

    • Role: Adds logical addressing (e.g., IP addresses) and routes packets to the destination network.
    • Data Unit: Packets.
  6. Data Link Layer (Layer 2):

    • Role: Encapsulates packets into frames, adding MAC addresses for local network delivery. Handles error detection and flow control on the local network.
    • Data Unit: Frames.
  7. Physical Layer (Layer 1):

    • Role: Converts frames into electrical, optical, or radio signals suitable for transmission over physical media.
    • Data Unit: Bits.

Encapsulation Example:

  • Application Data: A user’s email message.
  • Presentation Layer: The email is formatted and encrypted.
  • Session Layer: A session is established for the email transfer.
  • Transport Layer: The email data is segmented into smaller pieces, each with a TCP or UDP header.
  • Network Layer: Each segment is encapsulated into a packet with an IP address.
  • Data Link Layer: Packets are encapsulated into frames with MAC addresses.
  • Physical Layer: Frames are converted into bits and transmitted over the network.

Decapsulation

Decapsulation is the reverse process of encapsulation. It occurs at the receiving end where the data is processed from the lowest layer up to the highest layer. The headers and trailers added at each layer during encapsulation are removed in reverse order to extract the original data.

Here’s how decapsulation works across the OSI model layers:

  1. Physical Layer (Layer 1):

    • Role: Receives the raw bits from the physical medium.
    • Data Unit: Bits.
  2. Data Link Layer (Layer 2):

    • Role: Receives frames, checks for errors, and extracts packets from the frames.
    • Data Unit: Packets.
  3. Network Layer (Layer 3):

    • Role: Extracts data segments from packets, performs routing, and checks logical addresses.
    • Data Unit: Segments (TCP) or Datagrams (UDP).
  4. Transport Layer (Layer 4):

    • Role: Reassembles data segments into a complete message, checks for errors and flow control.
    • Data Unit: Data.
  5. Session Layer (Layer 5):

    • Role: Manages the session, maintains the state of the communication.
    • Data Unit: Data.
  6. Presentation Layer (Layer 6):

    • Role: Decrypts and translates data into a format usable by the Application Layer.
    • Data Unit: Data.
  7. Application Layer (Layer 7):

    • Role: Delivers the final data to the application (e.g., displaying the email message).
    • Data Unit: Data.

Decapsulation Example:

  • Bits: The raw signal is received and converted back into frames.
  • Frames: Frames are analyzed to extract packets.
  • Packets: Packets are processed to extract segments.
  • Segments: Segments are reassembled into a complete message.
  • Data: The message is translated and decrypted if needed.
  • Application Data: The final data is delivered to the application, such as an email client displaying the received message.

In summary, encapsulation prepares data for transmission by adding necessary protocol information at each layer, while decapsulation extracts and processes the data upon arrival by removing these protocol headers.