DevOps

OSI vs TCP/IP Model Cheatsheet

Comprehensive guide comparing OSI and TCP/IP networking models covering layers, PDUs, protocols, and practical applications. Understand how data flows through network stacks.

Understanding these network models is essential for optimizing server infrastructure. Whether you're evaluating VPS hosting providers or analyzing network performance benchmarks, knowing how data flows through each layer helps you make informed decisions.

#networking #osi #tcp-ip #protocols #network-stack #architecture
Sign In to Download

Free account required

i

What are Network Models?

Network models provide a conceptual framework for understanding how data is transmitted across networks. The OSI model is a theoretical standard with 7 layers, while TCP/IP is the practical implementation used in the modern internet with 4 layers. When comparing VPS providers, understanding these models helps evaluate network performance and latency characteristics.

OSI Model (7 Layers)
Theoretical framework developed by ISO for standardizing network communication
TCP/IP Model (4 Layers)
Practical implementation used in modern internet and networking

OSI Model (7 Layers)

The Open Systems Interconnection (OSI) model is a conceptual framework that standardizes network communication functions into seven distinct layers. Each layer serves a specific purpose and communicates with the layers directly above and below it.

Layer 7

Application Layer

Allow access to network resources

Provides network services directly to end-user applications. This layer interacts with software applications that implement a communicating component.

Examples:
HTTP HTTPS FTP SMTP DNS Telnet
Layer 6

Presentation Layer

Translate, encrypt and compress data

Translates data between the application layer and the network format. Handles data encryption/decryption, compression, and format conversion.

Functions:
Data Encryption/Decryption Data Compression Format Conversion SSL/TLS
Layer 5

Session Layer

Manage and terminate sessions

Establishes, maintains, and terminates connections (sessions) between applications. Manages dialog control and synchronization between communicating systems.

Functions:
Session Establishment Session Maintenance Session Termination Synchronization
Layer 4

Transport Layer

Segments and reassembles data for communications between end hosts

Provides reliable data transfer between systems. Handles segmentation, flow control, error checking, and ensures complete data transfer through acknowledgments.

Protocols:
TCP UDP SCTP DCCP
Layer 3

Network Layer

Provides logical addressing in the form of IP Address

Handles packet forwarding and routing through intermediate routers. Manages logical addressing (IP addresses) and determines the best path for data transmission.

Protocols:
IP (IPv4/IPv6) ICMP IGMP ARP IPSec
Layer 2

Data Link Layer

Provides node-to-node connectivity and data transfer

Handles physical addressing (MAC addresses), error detection, and frame synchronization. Divided into two sublayers: LLC (Logical Link Control) and MAC (Media Access Control).

Protocols & Technologies:
Ethernet Wi-Fi (802.11) PPP Token Ring Frame Relay
Layer 1

Physical Layer

Defines the physical characteristics of a medium used to transfer data

Transmits raw bit streams over physical media. Deals with electrical and physical specifications, including cables, connectors, voltages, and data rates.

Hardware & Media:
Cables (Fiber, Copper) Hubs Repeaters Network Adapters Connectors

TCP/IP Model (4 Layers)

The TCP/IP model is a practical, protocol-oriented network model that describes how data is transmitted over the internet. It has 4 layers and is the foundation of modern internet communication.

Layer 4

Application Layer

Combines OSI Layers 5, 6, and 7

Provides network services directly to applications. Encompasses the functionality of OSI's Application, Presentation, and Session layers.

Protocols:
HTTP/HTTPS FTP SMTP DNS SSH Telnet SNMP POP3 LDAP
PDU: Data
Layer 3

Transport Layer

Same as OSI Layer 4

Provides end-to-end communication services. Handles segmentation, flow control, error checking, and provides either reliable (TCP) or unreliable (UDP) data delivery.

Protocols:
TCP (Reliable) UDP (Unreliable) SCTP DCCP
PDU: Segment
Layer 2

Internet Layer

Similar to OSI Layer 3

Handles logical addressing and routing of packets across networks. Responsible for path determination and packet forwarding between different networks.

Protocols:
IP (IPv4/IPv6) ICMP IGMP ARP IPSec
PDU: Packet
Layer 1

Network Access Layer

Combines OSI Layers 1 and 2

Handles physical transmission of data over network hardware. Combines the functionality of OSI's Physical and Data Link layers, dealing with both hardware addressing and physical transmission.

Technologies:
Ethernet Wi-Fi (IEEE 802.11) Token Ring PPP ATM SLIP Frame Relay
PDU: Frame / Bits

OSI vs TCP/IP Comparison

OSI Model Layer # TCP/IP Model PDU Key Protocols
Application 7 Application Data HTTP, FTP, SMTP, DNS, SSH
Presentation 6
Session 5
Transport 4 Transport Segment TCP, UDP
Network 3 Internet Packet IP, ICMP, ARP
Data Link 2 Network Access Frame Ethernet, Wi-Fi, PPP
Physical 1 Bits

Key Differences

  • OSI: 7 layers, theoretical framework
  • TCP/IP: 4 layers, practical implementation
  • TCP/IP combines OSI layers 5-7 into Application layer
  • TCP/IP combines OSI layers 1-2 into Network Access

Practical Usage

  • OSI: Used for learning and troubleshooting
  • TCP/IP: Actually used in internet and LANs
  • Both models complement each other
  • Industry uses OSI terms with TCP/IP protocols

Protocol Data Units (PDUs)

PDUs are the data format specific to each layer. As data moves down the network stack, each layer adds its own header (and sometimes trailer) to the data, a process called encapsulation.

L7

Data

Application/Presentation/Session Layer PDU

Raw application data generated by user applications (e.g., HTTP request, email message, file content).

L4

Segment

Transport Layer PDU

Data divided into smaller chunks with transport layer header (source/destination ports, sequence numbers, checksums).

Contains: Source Port, Destination Port, Sequence Number, Checksum + Data
L3

Packet

Network/Internet Layer PDU

Segment with network layer header containing logical addressing information (IP addresses).

Contains: Source IP, Destination IP, TTL, Protocol + Segment
L2

Frame

Data Link Layer PDU

Packet encapsulated with data link header and trailer, including physical addressing (MAC addresses).

Contains: Source MAC, Destination MAC, Frame Check Sequence + Packet
L1

Bits

Physical Layer PDU

Frame converted to binary bits (1s and 0s) and transmitted as electrical signals, light pulses, or radio waves over physical media.

Encapsulation Process

Sending Data (Top to Bottom):

1. Application creates Data
2. Transport adds header → Segment
3. Network adds header → Packet
4. Data Link adds header + trailer → Frame
5. Physical converts to Bits and transmits

Receiving Data (Bottom to Top):

Each layer removes its header/trailer (de-encapsulation) and passes data up to the next layer.

Layer Protocols Reference

L7 Application Layer Protocols

HTTP/HTTPS
Web browsing (ports 80/443)
FTP
File transfer (ports 20/21)
SMTP
Email sending (port 25)
POP3/IMAP
Email retrieval (ports 110/143)
DNS
Domain name resolution (port 53)
SSH
Secure remote access (port 22)
Telnet
Remote terminal (port 23)
SNMP
Network management (port 161)
LDAP
Directory services (port 389)
SMB
File/printer sharing (port 445)
SSL/TLS
Secure communications
NetBIOS
Network basic I/O

L4 Transport Layer Protocols

TCP
Connection-oriented, reliable
UDP
Connectionless, fast
SCTP
Stream control transmission
DCCP
Datagram congestion control
RTP
Real-time protocol (VoIP, video)

L3 Network/Internet Layer Protocols

IP (IPv4/IPv6)
Internet protocol addressing
ICMP
Error reporting (ping, traceroute)
IGMP
Internet group management
ARP
IP to MAC address resolution
IPSec
IP security for VPNs

L2 Data Link / Network Access Layer

Ethernet
Wired LAN technology
Wi-Fi (802.11)
Wireless LAN
PPP
Point-to-point protocol
Token Ring
Legacy LAN technology
ATM
Asynchronous transfer mode
SLIP
Serial line IP (legacy)
Frame Relay
WAN technology

Practical Applications & Use Cases

Real-World Example: Web Browsing

When you visit https://example.com, data flows through all layers. You can compare how different VPS providers handle this data transmission process:

7
Application: Browser creates HTTP GET request
4
Transport: TCP breaks data into segments, adds port 443 (HTTPS)
3
Network: IP adds source/destination IP addresses, routes packets
2
Data Link: Ethernet adds MAC addresses, creates frames
1
Physical: Converts to electrical signals over cable or radio waves

Network Troubleshooting

  • • Use OSI model to isolate issues by layer
  • L1 issue: Cable unplugged, faulty NIC
  • L2 issue: Wrong VLAN, MAC filtering
  • L3 issue: Routing problems, wrong IP
  • L4 issue: Firewall blocking ports
  • L7 issue: Application configuration
  • • Use our network diagnostic tools for testing
  • • Monitor performance via your server dashboard

Security Considerations

  • L7: Application firewalls (WAF)
  • L6: SSL/TLS encryption
  • L4: Stateful firewalls
  • L3: IP filtering, ACLs
  • L2: Port security, VLAN isolation
  • L1: Physical security
  • • Learn about SSH server hardening
  • • Explore Linux security hardening

Why Learn Both Models?

  • OSI model provides detailed framework for understanding and teaching networking concepts
  • TCP/IP model reflects actual internet protocols and is used in real-world implementations
  • Network professionals use OSI terminology while working with TCP/IP protocols
  • Understanding both helps in troubleshooting, security analysis, and network design

Related Networking Cheatsheets

Explore these related cheatsheets to deepen your understanding of network protocols and server administration:

Master Network Architecture & Performance

Understanding OSI and TCP/IP models is fundamental for network optimization. Check our VPS benchmarks to find providers with optimal network performance for your infrastructure needs.