OSI Network Model

The Open Systems Interconnection (OSI) model is a conceptual framework that standardises the functions of a telecommunication or computing system into seven abstract layers. It provides a common language for discussing network protocols and architecture.

The Seven Layers

7. Application Layer

The Application layer is the closest to the end user. It provides network services directly to applications. Protocols include http, smtp, ftp, ssh, and DNS.

6. Presentation Layer

The Presentation layer translates data between the application layer and the network format. It handles:

  • Encryption/Decryption: TLS/SSL.
  • Serialization: JSON, XML, Protocol Buffers.
  • Compression: gzip, Brotli.

5. Session Layer

The Session layer establishes, manages, and terminates connections (sessions) between applications. It handles authentication, reconnection, and checkpoints. Examples include NetBIOS, RPC, and PPTP.

4. Transport Layer

The Transport layer provides end-to-end communication services. Key protocols:

  • TCP: Connection-oriented, reliable, ordered delivery. Used by HTTP, SSH, email.
  • UDP: Connectionless, unreliable, low overhead. Used by DNS, VoIP, gaming.

Ports identify specific services: HTTP uses 80, HTTPS uses 443, SSH uses 22.

3. Network Layer

The Network layer handles routing of data between different networks. The primary protocol is IP (IPv4 and IPv6). Routers operate at this layer.

Key concepts:

  • IP addressing: Unique addresses for network interfaces.
  • Routing: Determining the path packets take across networks.
  • Fragmentation: Breaking large packets into smaller units for transmission.

The Data Link layer provides reliable transmission between directly connected nodes. It handles:

  • MAC addressing: Physical addresses of network interfaces.
  • Framing: Packaging bits into frames.
  • Error detection: CRC, parity checks.

Switches operate at this layer. Examples: Ethernet, Wi-Fi (802.11), PPP.

1. Physical Layer

The Physical layer transmits raw bits over a physical medium. It defines:

  • Voltage levels and pin layouts: For cables and connectors.
  • Modulation: Converting digital signals to analog for transmission.
  • Transmission media: Copper (Ethernet), fiber optics, radio waves (Wi-Fi).

Hubs, repeaters, and network cables operate at this layer.

The TCP/IP Model

The TCP/IP model is a simpler, four-layer model that matches the modern internet protocol suite:

  • Application: Combines OSI Application, Presentation, and Session.
  • Transport: Maps to OSI Transport.
  • Internet: Maps to OSI Network (IP).
  • Link: Maps to OSI Data Link and Physical.

Practical Relevance

Understanding the OSI model helps when:

  • Troubleshooting: Determine which layer a problem occurs (physical cable, network configuration, service binding, application logic).
  • Protocol design: Understand where new protocols fit.
  • Security: Firewalls can filter at different layers (physical, network, transport, application).