The OSI Model

Ka Kavitha V Updated 08 Oct 2026
12 min read ·Lesson 11 of 45

The OSI Model

The OSI (Open Systems Interconnection) Model is a reference model developed by the International Organization for Standardization (ISO) in 1984. It describes how data travels from an application on one computer to an application on another computer across a network.

Instead of treating network communication as one large, monolithic process, the OSI Model breaks it down into seven separate layers, where each layer is responsible for one specific job. This layered approach makes networking easier to understand, easier to design, easier to troubleshoot, and easier to standardize across different vendors and technologies.

Why Was the OSI Model Created?

Before standardized networking models existed, different manufacturers used their own proprietary communication methods. A network card or software stack built by one vendor often could not talk to equipment from another vendor, which made building large, mixed-vendor networks difficult and expensive.

The OSI Model was introduced to solve this by:

  • Standardizing how network communication is described and implemented
  • Allowing devices and software from different vendors to interoperate
  • Simplifying network design by splitting a complex problem into smaller pieces
  • Improving troubleshooting by isolating problems to a specific layer
  • Allowing each piece of networking technology to be developed independently

A useful analogy is a building blueprint. Just as a blueprint separates construction into electrical work, plumbing, and structural work — each handled by a different specialist, following its own rules — the OSI Model separates network communication into layers that each handle one concern without needing to know the internal details of the others.

It's worth being direct about one thing upfront: the OSI Model is a conceptual/teaching model. The Internet itself is built and operated on the TCP/IP model (covered in the next lesson), which has four layers instead of seven. The OSI Model is still essential to learn because it gives you precise vocabulary — "Layer 2 problem," "Layer 3 device," "Layer 7 attack" — that network engineers use constantly, even when the underlying network runs on TCP/IP.

Characteristics of the OSI Model

1. Layered Architecture

Communication is divided into seven independent layers. Each layer:

  • Performs one specific, well-defined task
  • Communicates only with the layers directly above and below it
  • Operates independently of how other layers are implemented internally

2. Modularity

Because each layer only depends on the service provided by the layer below it — not on how that layer implements the service — changes inside one layer usually don't affect the others. For example, a network can switch from Wi-Fi to Ethernet (a Physical Layer change) without requiring any change to the web browser or email application running at the Application Layer.

3. Standardization

The OSI Model gives network engineers worldwide a shared vocabulary and a shared way to reason about where a problem or feature belongs.

4. Easier Troubleshooting

Because responsibilities are cleanly separated, a fault can usually be isolated to one layer. For example, "no lights on the network card" points to the Physical Layer, while "the website loads but shows the wrong content" points toward the Application Layer.

Upper Layers vs. Lower Layers

The seven layers are often grouped into two categories:

GroupLayersFocus
Upper Layers5 – Session, 6 – Presentation, 7 – ApplicationUser-facing applications and software services
Lower Layers1 – Physical, 2 – Data Link, 3 – Network, 4 – TransportMoving data across the physical network

Software developers typically care most about the upper layers, since that's where applications interact with the network. Network engineers and infrastructure teams spend most of their time in the lower layers, since that's where cabling, addressing, and routing live.

The 7 Layers of the OSI Model

The OSI Model is numbered from 1 (bottom, closest to the physical wire) to 7 (top, closest to the user). Data always passes through the layers in order — it cannot skip from Layer 7 straight to Layer 3.

LayerNameData UnitKey Job
7ApplicationDataProvides network services to end-user applications
6PresentationDataTranslates, encrypts, and compresses data
5SessionDataEstablishes, manages, and ends communication sessions
4TransportSegmentEnd-to-end delivery, reliability, and flow control
3NetworkPacketLogical addressing and routing between networks
2Data LinkFramePhysical addressing and node-to-node delivery on a local link
1PhysicalBitTransmission of raw bits over a physical medium

Layer 1: Physical Layer

The Physical Layer is the lowest layer of the OSI Model. It is responsible for transmitting raw bits (0s and 1s) over a physical medium, with no understanding of what those bits mean.

Functions of the Physical Layer

  • Data transmission — converts bits into a physical signal: electrical voltage on copper cable, light pulses on fiber, or radio waves over the air.
  • Physical connections — defines the mechanical and electrical specifications of connectors and cabling, such as Ethernet cables, fiber-optic cables, and wireless radios.
  • Transmission modes — supports simplex (one direction only), half-duplex (both directions, but not at the same time), and full-duplex (both directions simultaneously).
  • Network topology — defines how devices are physically or logically arranged: bus, star, ring, or mesh.

Real-World Example

When you plug an Ethernet cable from your laptop into a router, the Physical Layer is what actually pushes electrical signals down that cable. It has no concept of "IP address" or "website" — it just moves bits.

The Data Link Layer ensures reliable communication between two devices on the same local network (the same physical or logical segment). It takes the raw bit stream from the Physical Layer and organizes it into structured units called frames.

Functions of the Data Link Layer

  • Framing — packages data into frames with a defined header and trailer, so the receiver knows where one unit of data starts and ends.
  • Physical addressing — uses MAC (Media Access Control) addresses, a hardware-burned identifier, to identify devices on the local network. Example: 00:1A:2B:3C:4D:5E.
  • Error detection — uses techniques such as CRC (Cyclic Redundancy Check) to detect whether a frame was corrupted in transit. Note that Layer 2 typically detects errors and discards bad frames; it does not usually correct them or retransmit — that's often left to higher layers.
  • Flow control — paces transmission so a fast sender doesn't overwhelm a slow receiver.
  • Access control — determines which device is allowed to transmit on a shared medium at a given moment (important on shared media like older Ethernet or Wi-Fi).

Data Link Sublayers

The Data Link Layer is itself commonly split into two sublayers:

  • Logical Link Control (LLC) — manages communication with the Network Layer above it and handles flow control.
  • Media Access Control (MAC) — controls access to the shared transmission medium and handles MAC addressing.

Real-World Example

When your computer sends a print job to a nearby printer on the same LAN, the Data Link Layer uses MAC addresses to make sure the frame lands on the correct physical device, not just "somewhere on the network."

Layer 3: Network Layer

The Network Layer is responsible for logical addressing and routing — getting data from a device on one network to a device on a different network. Its central job is finding the best path for a packet to travel.

Functions of the Network Layer

  • Logical addressing — uses IP addresses, such as 192.168.1.10 (IPv4) or 2001:db8::1 (IPv6), which identify a device regardless of its physical hardware.
  • Routing — determines the best path between source and destination, often across many intermediate networks.
  • Packet forwarding — moves packets from one network segment to the next, one hop at a time.
  • Internetworking — connects separate networks together into a larger network (this is literally where the term "Internet" comes from — an interconnection of networks).

Common Protocols: IPv4, IPv6, ICMP

Devices: Routers, Layer 3 switches

Real-World Example

When you visit a website hosted on a server in another country, routers along the path use Network Layer information (the destination IP address) to forward your packets across many networks until they reach that server.

Layer 4: Transport Layer

The Transport Layer provides end-to-end communication between applications running on the source and destination devices. It's responsible for making sure data arrives completely and in the correct order.

Functions of the Transport Layer

  • Segmentation — breaks a large message from the upper layers into smaller segments suitable for transmission.
  • Reassembly — reconstructs the original message from segments at the destination.
  • Error recovery — detects lost or corrupted segments and arranges for retransmission (in protocols that guarantee reliability).
  • Flow control — prevents a fast sender from overwhelming the network or the receiver.
  • Port addressing — uses port numbers (e.g., 80 for HTTP, 443 for HTTPS) to identify which specific application on a device a segment belongs to.

Transport Layer Protocols

ProtocolTypeKey TraitsTypical Uses
TCP (Transmission Control Protocol)Reliable, connection-orientedEstablishes a connection, acknowledges receipt, retransmits lost data, preserves orderWeb browsing, email, file transfer
UDP (User Datagram Protocol)Unreliable, connectionlessNo connection setup, no acknowledgment, minimal overheadVideo streaming, online gaming, voice calls

TCP trades speed for reliability — it's worth using whenever missing or out-of-order data would break the application (like a downloaded file). UDP trades reliability for speed — it's worth using when a late retransmission is worse than a small gap (like a live video call, where you'd rather skip a lost frame than pause to wait for it).

Real-World Example

When downloading a file, TCP tracks every segment, confirms each one arrived, and requests retransmission of anything lost, so the final file is a byte-for-byte match of the original.

Layer 5: Session Layer

The Session Layer establishes, manages, and terminates communication sessions between applications. Think of it as a meeting coordinator that keeps two parties properly connected for the duration of their conversation.

Functions of the Session Layer

  • Session establishment — opens communication between two devices.
  • Session maintenance — keeps the session active for as long as needed.
  • Session termination — closes the session cleanly when communication is finished.
  • Synchronization — inserts checkpoints during a long transfer, so that if the connection drops, transmission can resume from the last checkpoint instead of restarting from the beginning.

Real-World Example

A video call between two people needs an active session for the whole meeting — the Session Layer is conceptually responsible for keeping that ongoing conversation established and coordinated.

Layer 6: Presentation Layer

The Presentation Layer acts as the translator of the OSI Model. It makes sure that data sent by one system can be correctly interpreted by another system, even if the two use different internal data formats.

Functions of the Presentation Layer

  • Translation — converts data between different formats or character encodings so both ends understand it.
  • Encryption — protects sensitive data in transit, such as with SSL/TLS, which is critical for things like secure banking transactions.
  • Compression — reduces the size of data to speed up transmission, commonly applied to audio, video, and image files.

Real-World Example

When you visit a secure website over HTTPS, the encryption and decryption work conceptually maps to the Presentation Layer's responsibilities, even though in real-world TCP/IP-based systems TLS is usually implemented as part of the application's networking stack rather than as a strictly separate layer.

Layer 7: Application Layer

The Application Layer is the layer closest to the end user. It does not refer to end-user applications themselves (like a web browser), but to the network services that those applications rely on.

Functions of the Application Layer

  • File transfer — enables file sharing between systems.
  • Email services — supports sending and receiving email.
  • Directory services — provides access to distributed databases of network information (such as looking up a device or user).
  • Network resource access — lets users reach web servers, cloud services, and shared printers.

Real-World Example

When you open Gmail in your browser, the Application Layer is what defines the network services (like HTTP and DNS) that let the browser fetch and display your inbox.

How Data Travels Through the OSI Model

Let's trace a practical example: sending an email from New York to London.

Sender Side (top to bottom)

  1. Layer 7 – Application: The email application creates the message.
  2. Layer 6 – Presentation: The message is encoded and, if needed, encrypted.
  3. Layer 5 – Session: A communication session is established with the mail server.
  4. Layer 4 – Transport: TCP divides the message into segments and adds port information.
  5. Layer 3 – Network: IP addresses are added so the data can be routed.
  6. Layer 2 – Data Link: Frames and MAC addresses are added for delivery on the local network segment.
  7. Layer 1 – Physical: The frame is converted into electrical, optical, or wireless signals and sent onto the wire.

The signals then travel through cables, switches, and routers across the Internet.

Receiver Side (bottom to top)

  1. Physical Layer receives the raw signals.
  2. Data Link Layer reconstructs frames from the signal.
  3. Network Layer reads the IP packet and confirms it has reached the right destination network.
  4. Transport Layer reassembles the segments back into the original message.
  5. Session Layer maintains the ongoing communication.
  6. Presentation Layer decodes/decrypts the data.
  7. Application Layer hands the finished message to the email client, which displays it.

This process — adding a header at each layer on the way out, and removing it at the matching layer on the way in — is called encapsulation (sender side) and decapsulation (receiver side).

Advantages of the OSI Model

  • Standardization — provides a universal framework for describing network communication.
  • Easier troubleshooting — problems can be isolated layer by layer instead of debugging the whole system at once.
  • Vendor independence — as long as each vendor implements a layer's interface correctly, devices from different manufacturers can interoperate.
  • Scalability — new technologies can be introduced at one layer without redesigning the entire stack.
  • Modular design — each layer can evolve independently over time.

Limitations of the OSI Model

Although the OSI Model is extremely useful for learning and for discussing networks, it has real limitations:

  • It is primarily a conceptual/teaching model, not something every real protocol suite implements literally layer-by-layer.
  • Some layers overlap in functionality in real implementations (for example, TLS blends Presentation and Session Layer concerns into what's really a Transport-adjacent protocol).
  • Real-world networks — including the Internet — are built on the TCP/IP model, not the OSI Model.
  • Not every protocol fits cleanly into exactly one of the seven layers.

Easy Way to Remember the Layers

Top to bottom (Application → Physical): "All People Seem To Need Data Processing"

Application, Presentation, Session, Transport, Network, Data Link, Physical

Bottom to top (Physical → Application): "Please Do Not Throw Sausage Pizza Away"

Physical, Data Link, Network, Transport, Session, Presentation, Application

0 Comments

Reviewed before they appear

No comments yet.

Computer-Network
Ask about this post
AI Ask about this post

Ask questions about The OSI Model and get answers drawn from it.

Signed-in readers only.