The OSI Model

A deep dive into the 7 layers of the Open Systems Interconnection reference model.

Why Do We Need a Layered Model?

Imagine designing a complete communication system from scratch. You would need to think about electrical signals, addressing, error checking, data formatting, application interfaces, and much more. Tackling this all at once is incredibly complex. The OSI model applies a "divide and conquer" strategy to this problem.

The Open Systems Interconnection (OSI) Model is an abstract, conceptual framework that standardizes the functions of a telecommunication or computing system into seven logical layers. Its primary purpose is to ensure that systems from different manufacturers can by providing a common reference point for designing network protocols.

Principles of Layered Communication

Layered models work based on a few key principles:

  • Abstraction: Each layer performs a specific, well-defined set of functions. It doesn't need to know the complex details of how the layers above or below it work.
  • Peer-to-Peer Communication: Conceptually, Layer N on the sending machine communicates with Layer N on the receiving machine. This is called a peer-to-peer process. They speak the same "language" or protocol.
  • Services and Interfaces: In reality, data passes vertically. Each layer provides services to the layer directly above it and uses the services of the layer directly below it through a well-defined interface.

The Process: Encapsulation and Decapsulation

As data moves down the layers on the sending device, each layer adds its own control information, called a header (and sometimes a trailer). This process is called encapsulation. It's like putting a letter into an envelope, then putting that envelope into a larger courier pouch, and so on. The unit of data at each layer has a specific name, known as a .

Walk through the OSI stack

Toggle the direction and explore what each layer adds or removes, then compare it with the classic office memo analogy.

Flow
View

Step 1 of 7

Layer 7 路 Application

Data
What happens here

User intent becomes application payload that can be formatted, secured and passed down the stack.

Headers added so far
Encapsulation stack
L7Data
Key responsibilities
  • Provides network services to end-user applications such as messaging, file transfer and directories.
  • Negotiates capabilities like authentication, resource sharing and service quality.
Typical protocols
HTTP
SMTP
DNS

Selected layer

Drag the handle or tap a tile to change layers.

Layer 7 路 Application
L7L6L5L4L3L2L1

The receiver performs the reverse process, decapsulation, removing headers at each layer as the data moves up towards the application.

Protocol Data Units (PDUs) by Layer

  • Layers 7, 6, 5 (Application, Presentation, Session): The PDU is generally referred to as Data.
  • Layer 4 (Transport): The PDU is a Segment (for TCP) or Datagram (for UDP).
  • Layer 3 (Network): The PDU is a Packet.
  • Layer 2 (Data Link): The PDU is a Frame.
  • Layer 1 (Physical): The PDU is Bits (or sometimes Symbols).

An Analogy: Sending an Office Memo

To understand the roles of the layers, let's use the analogy from your notes of sending a message from a Project Manager named Erik to another named Louis in a different office building.

  • (Layer 7) Application - Erik, the Project Manager: Creates the original message or request (e.g., "Request for Q4 sales data").
  • (Layer 6) Presentation - The Translator: Translates the message into a standard company format and language that Louis' office will understand. Maybe it encrypts it for confidentiality.
  • (Layer 5) Session - The Cryptographer/Session Clerk: Establishes and manages the formal communication "session" with Louis' office, ensuring both sides are ready to communicate.
  • (Layer 4) Transport - The Secretary: Takes the long message and splits it into numbered pages to ensure everything arrives and can be reassembled in the correct order. Handles acknowledgements.
  • (Layer 3) Network - The Postmaster: Puts the pages into an envelope with Louis' full mailing address (street, city, zip code). Determines the best overall route for the mail truck to take.
  • (Layer 2) Data Link - The Mailroom Clerk: Takes the envelope from the postmaster and puts it in the correct local courier bag for the next stop (e.g., the bag going to the downtown postal hub). Adds a local delivery tag.
  • (Layer 1) Physical - The Courier (Van, Plane): The physical means of transport. The courier doesn't care what's in the letter, only about physically moving it from point A to point B.

The Seven Layers of the OSI Model

Let's dive into the specific functions of each of the seven layers, from top to bottom.

Layer 7: Application Layer

The Application Layer is the closest to the end-user. It provides the interface for applications to access network services. It does not include the applications themselves (like a web browser), but the protocols that these applications use.

  • Functions: Network virtual terminal, file transfer, access and management (FTAM), mail services, directory services.
  • Examples: HTTP, FTP, SMTP, DNS.

Layer 6: Presentation Layer

This layer acts as a "translator" for the network. It ensures that data is presented in a format that the receiving application can understand. It manages data formatting, character set conversion, data compression, and encryption.

  • Functions: Character code translation (e.g., ASCII to EBCDIC), data compression, encryption and decryption.
  • Examples: SSL/TLS (for encryption), JPEG, MPEG (for image/video compression).

Layer 5: Session Layer

The Session Layer establishes, manages, and terminates communication sessions between applications. It handles dialogue control, deciding whose turn it is to "speak", and synchronization by placing checkpoints in the data stream.

  • Functions: Session establishment, maintenance and termination; dialogue control; synchronization.
  • Examples: NetBIOS, PPTP.

Layer 4: Transport Layer

This layer provides reliable, end-to-end data transfer between hosts. It is responsible for segmenting large data from the upper layers, flow control, and error checking.

  • PDU: Segment (TCP), Datagram (UDP).
  • Functions: Segmentation and reassembly, connection control, flow control, error control.
  • Protocols: TCP (reliable, connection-oriented), UDP (unreliable, connectionless).

Layer 3: Network Layer

The Network Layer is responsible for logical addressing and routing packets across multiple networks. It determines the best path for data to travel from source to destination.

  • PDU: Packet.
  • Functions: Logical addressing (IP addresses), routing.
  • Devices: Routers.
  • Protocols: IP (IPv4, IPv6), ICMP, OSPF.

Layer 2: Data Link Layer

This layer provides reliable node-to-node data transfer. It is responsible for physical addressing (MAC addresses), framing data into frames, and error detection on the physical link.

  • PDU: Frame.
  • Functions: Framing, physical addressing (MAC), flow control, error detection (e.g., CRC).
  • Devices: Switches, Bridges.
  • Protocols: Ethernet, HDLC, PPP.

Layer 1: Physical Layer

The Physical Layer defines the electrical, mechanical, and functional specifications for the physical connection. It is responsible for transmitting raw bits over the physical medium.

  • PDU: Bits.
  • Functions: Defines voltage levels, pinouts, cable types, connectors (e.g., RJ-45), and signal timing.
  • Devices: Hubs, Repeaters, Network Interface Cards (NICs), cables.
    The OSI Model | Teleinf Edu