Skip to content

OSI Model (7 Layers)

The OSI model provides a framework for understanding network interactions. In practice, we focus on the TCP/IP model, but OSI terminology is standard for troubleshooting. What is the OSI Model? (Cloudflare).

LayerNamePDUKey ConceptsTroubleshooting Context
L7ApplicationDataHTTP, DNS, TLS, SSHStatus codes (502, 404), Headers, Payload corruption.
L6PresentationDataEncryption (TLS), EncodingSSL Handshake failures, Certificate errors.
L5SessionDataSession MgmtKeep-alives, Timeouts.
L4TransportSegmentTCP, UDP, PortsSyn/Ack, Retransmissions, Buffer bloat, Port exhaustion.
L3NetworkPacketIP, ICMP, BGP, IPSecRouting loops, MTU/Fragmentation, Packet loss.
L2Data LinkFrameEthernet, MAC, VLANARP issues, MAC flapping, CRC errors.
L1PhysicalBitFiber, CopperSignal degradation, Cable cuts, Interface errors.

Data flows down the stack, with each layer adding a header (Encapsulation).

  1. L7: HTTP Request.
  2. L4: Adds TCP Header (Source/Dest Port).
  3. L3: Adds IP Header (Source/Dest IP).
  4. L2: Adds Ethernet Header (Source/Dest MAC).

Upon reception, the process is reversed (Decapsulation).

  • MTU (Maximum Transmission Unit): Typically 1500 bytes (Ethernet). If L3 packet > MTU, fragmentation occurs (bad for performance).
  • MSS (Maximum Segment Size): L4 parameter to prevent fragmentation.