Skip to content

TCP/IP Model

The real-world model that the internet actually runs on. While OSI is conceptual/theoretical, TCP/IP is what's actually implemented in practice.

The 4 Layers

OSI ModelTCP/IP Model
Application (L7)
Presentation (L6)Application
Session (L5)
Transport (L4)Transport
Network (L3)Internet
Data Link (L2)
Physical (L1)Network Access
#TCP/IP LayerProtocolsOSI Equivalent
4ApplicationHTTP, DNS, FTP, SMTP, SSHL5 + L6 + L7
3TransportTCP, UDPL4
2InternetIP, ICMP, ARPL3
1Network AccessEthernet, Wi-Fi, MACL1 + L2

Each Layer Explained

Layer 4 — Application

  • HTTP/HTTPS → web browsing
  • DNS → domain name resolution
  • SMTP/IMAP → email
  • SSH → secure remote access
  • FTP → file transfer

Layer 3 — Transport

TCPUDP
Connection-orientedConnectionless
Reliable (ACKs)No guarantee of delivery
OrderedNo ordering
SlowerFaster
Used for: HTTP, emailUsed for: video, DNS, gaming

Layer 2 — Internet

  • Core protocol: IP (Internet Protocol)
  • Handles logical addressing + routing
  • Every packet gets a source & destination IP here
  • ICMP lives here too (used by ping)

Layer 1 — Network Access

  • Combines OSI's Physical + Data Link
  • Handles how bits are physically transmitted
  • MAC addressing, Ethernet frames, Wi-Fi signals

Data Flow in TCP/IP

Application    → [HTTP Data]
Transport      → [TCP Header | HTTP Data]
Internet       → [IP Header | TCP Header | HTTP Data]
Network Access → [Frame Header | IP Header | TCP Header | HTTP Data | Frame Trailer]
                → 101010110101... (bits on wire)

OSI vs TCP/IP — Key Differences

OSITCP/IP
Layers74
PurposeConceptual / referencePractical / implemented
UsageTroubleshooting, teachingReal internet communication
DevelopmentISO standardDARPA (built for ARPANET)
ProtocolsProtocol-independentBuilt around IP & TCP

OSI = blueprint of a building (theoretical, clean) TCP/IP = the actual building (practical, what exists)

Common Interview Questions

Q: Why do we still learn OSI if TCP/IP is what's used? OSI gives a cleaner mental model for troubleshooting and understanding concepts layer by layer. In practice, engineers use TCP/IP but think in OSI terms.

Q: Where does TLS/HTTPS fit? TLS sits between Application and Transport — sometimes called Layer 6 in OSI terms, but in TCP/IP it is handled within the Application layer.