The Open Systems Interconnect Model is an ISO standard that gives us a framework for how how computers communicate with one another over a network. It is a seven-layered approach to transmission that places different operations into specific groups or types of action at each layer.

Each layer provides service for the layer above it, and is supported by the one below it.

OSI Reference Model Table

LayerFunctionExample TechnologyReal-World Example
1. PhysicalTransmit raw data as electrical signalsEthernet, fiber optics, Wi-Fi frequenciesEthernet cable connection
2. Data LinkReliable local data deliveryEthernet (MAC addresses), switchesSwitch forwarding a frame to the correct device
3. NetworkRouting data between networksIPv4/IPv6, routers, ARPSending an email across the internet
4. TransportReliable or fast data deliveryTCP, UDP, portsVideo streaming (UDP) or file download (TCP)
5. SessionManage sessions/connectionsSSH, SQL session managementPersistent remote desktop connection
6. PresentationFormat/encrypt data for applicationsSSL/TLS, JPEG, UTF-8Viewing an HTTPS webpage
7. ApplicationProvide user-facing servicesHTTP, FTP, DNSBrowsing a website or sending an email

Upper OSI Layers

Layers 5, 6, and 7 are the upper layers - mostly occupied by Software Engineers, and less so by Network Engineers.

OSI Layer 7 - Application

This provides network services to the applications of the user. Importantly, it is the only layer that does not provide service to other layers.

It establishes the availability of intended communication partners (which other applications will be communicated with). It also syncs and establishes on procedures for error recovery and control of data integrity.

  • Explanation:
    • Provides network services directly to end-user applications.
    • This is where users interact with networked software.
  • Key Concepts:
    • Protocols for web browsing, email, file transfer, etc.
  • Examples:
    • HTTP/HTTPS, FTP, SMTP (email), DNS.
  • Real-World Example:
    • Opening your web browser and loading a webpage via HTTPS.

OSI Layer 6 - Presentation

This layer ensures that the information sent at the application layer of one system is readable by the application layer of another system. It can translate between multiple data formats - for example, ensures that a host sending ASCII data can communicate with a host that only receives UTF-8.

  • Explanation:
    • Translates data into a format the application layer can process. Handles data encryption, compression, and formatting.
    • Ensures interoperability between different systems.
  • Key Concepts:
    • Encryption, compression, character encoding (e.g., UTF-8).
  • Examples:
    • SSL/TLS encryption, image compression (JPEG), or text encoding.
  • Real-World Example:
    • Viewing an encrypted webpage (HTTPS), where the browser decrypts the SSL/TLS data before displaying it.

OSI Layer 5 - Session

This layer establishes, manages, and terminates communication sessions between two hosts. It also synchronizes the dialogue between the presentation layers of the two hosts and manages their data exchange.

For example, a web server may have multiple users so there will be multiple processes for communication open at any given time. Layer 5 manages each of these processes so that the presentation and application layers can do their thing.

  • Explanation:
    • Manages sessions between applications. Establishes, maintains, and terminates connections.
    • Handles synchronization (e.g., checkpoints in file transfer).
  • Key Concepts:
    • Sessions, connection management.
  • Examples:
    • Logging into a remote server via SSH, file transfer protocols.
  • Real-World Example:
    • A video conferencing app (like Zoom) maintaining a session between two participants.

Lower OSI Layers

Transport Layer

The main characteristic of the transport layer is to decide whether to use TCP or UDP, and which port number to use.

It is defined as a layer that defines services to segment, transfer, and reassemble data for individual communication between end devices. It also breaks down files into smaller segments that are less likely to incur transmission problems.

  • Explanation:
    • Ensures reliable delivery of data between applications. Handles segmentation, reassembly, and error recovery.
    • Two main protocols:
      1. TCP (Transmission Control Protocol): Reliable, ensures data arrives in order.
      2. UDP (User Datagram Protocol): Fast but unreliable (no error correction or acknowledgment).
  • Key Concepts:
    • Ports, segmentation, error handling.
  • Examples:
    • TCP, UDP, and port numbers (e.g., HTTP uses port 80, HTTPS uses port 443).
  • Real-World Example:
    • Streaming a YouTube video (UDP) or downloading a file over HTTP (TCP).

OSI Layer 3 - Network

This layer includes devices such as routers.

It provides connectivity and path selection for hosts that can be in different geographical locations; it does so by providing logical addressing systems (that is, it handles IP addressing)

  • Explanation:
    • This layer is responsible for routing data across multiple networks, ensuring it gets to the correct destination.
    • It uses IP addresses to identify devices and route data packets.
  • Key Concepts:
    • Packets, IP addresses, routers, subnetting.
  • Examples:
    • IPv4, IPv6, ICMP (used in ping), and OSPF (routing protocol).
  • Real-World Example:
    • Sending an email from New York to London. Routers use the destination IP address to route the data across different networks.

Like OSI Layer 3, Layer 2 is concerned with source and destination addresses; but rather than using IP addressing, it uses physical addressing systems - such as MAC address for Ethernet connectivity, for example.

A switch is a layer 2 device.

Layer 2 defines how data is formatted for transmission and how access to physical media is controlled. Often it includes error detection and correction to ensure reliable delivery

  • Explanation:
    • The data link layer is responsible for reliable data transfer across a single physical link or local network.
    • It uses MAC addresses to identify devices and handles error detection and correction.
    • Divided into two sublayers:
      1. Logical Link Control (LLC): Handles flow control and error checking.
      2. Media Access Control (MAC): Governs how devices access the physical medium (e.g., Ethernet, Wi-Fi).
  • Key Concepts:
    • Frames, MAC addresses, switches, and ARP (Address Resolution Protocol).
  • Examples:
    • Ethernet, Wi-Fi (IEEE 802.11), MAC address filtering.
  • Real-World Example:
    • A switch forwarding data to the correct device on the local network using MAC addresses.

OSI Layer 1 - Physical

This includes the physical components of a network, such as the cables, connectors, etc. being used.

The layer enables bit transmission between devices, defines specifications for activating, maintaining, and deactivating the physical links between devices.

For example, this can manage things like voltage levels, physical data rates, maximum transmission distances, etc.

  • Explanation:
    • The physical layer is responsible for the transmission of raw binary data (0s and 1s) over a physical medium, such as cables or radio waves.
    • It deals with the hardware and physical connection between devices, including cables, switches, and network interfaces.
  • Key Concepts:
    • Bit rate, voltage levels, signal modulation, and physical connectors.
  • Examples:
    • Ethernet cables, fiber optics, Wi-Fi radio frequencies, USB cables, hubs.
  • Real-World Example:
    • Plugging an Ethernet cable into your laptop to connect to the internet.

OSI Acronyms

Please Do Not Touch Superman’s Private Area Physical, Data, Network, Transport, Session, Presentation, Application

Simple example

Imagine that a computer, A, is sending an email via a switch, S, to an email server, B:

A > S > B

In doing so, A will build a packet starting at the top OSI layer:

The application level will include everything like the body of the email, to/from information, subject, etc. This is where the user interacts with the application.

This will be encapsulated into Layer 6, which includes data translations and compression - managing the formatting of data, creating encryption, etc. For example, Layer 6 is responsible for encoding the text of the email into UTF-8, or making sure that attachments are compressed. Additionally, layer 6 will ensure that SSL/TLS encryption is in place, or that the email itself is formatted as MIME, etc.

Before being further encapsulated into the Session layer.