TCP/IP Model

Beginner
Fundamentals

The TCP/IP model is the practical 4-layer networking framework that powers the internet — combining the OSI model's upper layers into one Application layer and mapping cleanly to real protocols.

Overview

While the OSI model is a reference framework, the TCP/IP model (also called the Internet model or DoD model) is what the modern internet actually implements. It has 4 layers: Network Access (or Link), Internet, Transport, and Application. The Internet layer corresponds to OSI Layer 3 (IP), the Transport layer to OSI Layer 4 (TCP/UDP), and the Application layer merges OSI Layers 5–7. TCP/IP emerged from ARPANET research in the 1970s and became the universal standard. Every HTTP request, database query over a network, and API call flows through these 4 layers. As a backend engineer, understanding where your code sits (Application layer) and how it depends on Transport and Internet layers is fundamental to debugging latency, connection issues, and designing resilient services.

The 4 Layers

TCP/IP collapses OSI's 7 layers into 4. The Application layer handles everything the user-facing protocol does. The Transport layer manages end-to-end delivery. The Internet layer handles logical addressing and routing. The Network Access layer handles the physical medium.

TCP/IP layers and Java HTTP flow
// TCP/IP vs OSI mapping:
// ┌──────────────────────┬──────────────────────────────────────┐
// │ TCP/IP Layer         │ OSI Equivalent      │ Protocols      │
// ├──────────────────────┼──────────────────────────────────────┤
// │ Application          │ Layers 5, 6, 7      │ HTTP, DNS, SSH │
// │ Transport            │ Layer 4             │ TCP, UDP       │
// │ Internet             │ Layer 3             │ IP, ICMP, ARP  │
// │ Network Access/Link  │ Layers 1, 2         │ Ethernet, Wi-Fi│
// └──────────────────────┴──────────────────────────────────────┘

// A Java HTTP request flows through:
// 1. Application:    HttpClient sends GET /api/users HTTP/1.1
// 2. Transport:      TCP segments the request, adds port (443), handles reliability
// 3. Internet:       IP adds source/destination IP, routes across routers
// 4. Network Access: Ethernet frames carry IP packets over the physical network

Data Units per Layer

Each layer works with a different unit of data. Understanding these terms is critical for reading packet captures (Wireshark) and networking documentation.

Data units at each TCP/IP layer
// Data units:
// Application layer → Message / Data
// Transport layer   → Segment (TCP) or Datagram (UDP)
// Internet layer    → Packet
// Network Access    → Frame (Layer 2) / Bits (Layer 1)

// When you call:
HttpClient client = HttpClient.newHttpClient();
HttpResponse<String> response = client.send(
    HttpRequest.newBuilder(URI.create("https://api.example.com/users")).build(),
    HttpResponse.BodyHandlers.ofString()
);

// The "GET /users HTTP/1.1" is a Message (Application layer)
// TCP breaks it into one or more Segments
// IP wraps each Segment into a Packet with IP header
// Ethernet wraps each Packet into a Frame with MAC header

Key Points to Remember

  • 1TCP/IP has 4 layers: Network Access, Internet, Transport, Application.
  • 2OSI is a conceptual model; TCP/IP is what the internet actually runs on.
  • 3Application layer = HTTP, HTTPS, DNS, SMTP, SSH, WebSocket.
  • 4Transport layer = TCP (reliable) and UDP (unreliable but fast).
  • 5Internet layer = IP addressing and routing between networks.
  • 6Data units: Message → Segment/Datagram → Packet → Frame → Bits.

Interview Questions

Sign in to ask Aria
1

What is the difference between the OSI model and the TCP/IP model?

EasyPersistent
2

What is the difference between a segment, a packet, and a frame?

EasyIBM
3

Which layer of TCP/IP is responsible for routing packets across networks?

EasyCapgemini
4

Where does your Java Spring Boot application sit in the TCP/IP model?

MediumThoughtWorks

Ask Aria about TCP/IP Model

Your personal AI tutor — ask anything about this concept

Revision Status

Personal Notes

Sign in to save personal notes for this topic.

Discussion

Sign in to join the discussion.

Loading discussion…