The OSI (Open Systems Interconnection) model is a conceptual framework for understanding network communication in seven layers.

The Seven Layers

LayerNameFunctionProtocols/Examples
7ApplicationUser interface, application servicesHTTP, FTP, SMTP, DNS
6PresentationData formatting, encryption, compressionSSL/TLS, JPEG, ASCII
5SessionSession management, authenticationNetBIOS, RPC
4TransportEnd-to-end delivery, flow controlTCP, UDP
3NetworkLogical addressing, routingIP, ICMP, OSPF
2Data LinkPhysical addressing, framingEthernet, 802.1Q, ARP
1PhysicalBits on the wireCables, hubs, radio

Mnemonic: “Please Do Not Throw Sausage Pizza Away” (Layers 1-7)

TCP/IP Model Comparison

The TCP/IP model is more practical and commonly referenced:

TCP/IP LayerOSI Equivalent
ApplicationApplication, Presentation, Session (5-7)
TransportTransport (4)
InternetNetwork (3)
Network AccessData Link, Physical (1-2)

Which Layer Do Tools Operate At?

  • Layer 1-2: ethtool, ip link, cable testers
  • Layer 3: ping, traceroute, ip route
  • Layer 4: netstat, ss, tcpdump
  • Layer 7: curl, wget, dig
  • Multi-layer: Wireshark (all layers)

Why It Matters

  • Troubleshooting: isolate where problems occur
  • Security: understand where to apply controls (e.g., Firewalls at L3/L4, WAF at L7)
  • Architecture: know which layer your application operates at

References