TCP/IP Model·Lesson 2 of 8

Layers of the TCP/IP Model

01

The Four Layers

The TCP/IP model organizes all of networking into four , each stacked on top of the last. A layer is simply a group of related jobs handled together — and the golden rule is that every layer does its own work and then hands off to the layer next to it, trusting that layer to do the rest. From the top (closest to you and your apps) down to the bottom (the actual cable or radio signal), the four layers are Application, Transport, Internet, and Network Access.

Here is the full stack. The label on the right of each tier is the name the data goes by once that layer has done its work — a detail we'll come back to at the end:

The TCP/IP stack, top to bottom

Application

The layer your programs talk to directly

Data

Transport

Delivers data to the right program, reliably or quickly

Segments

Internet

Addresses and routes data across networks

Packets

Network Access

Sends the data over the physical link to the next device

Frames

The one rule to remember

Each layer only talks to the layer directly above and below it. The application layer never touches the wire, and the network access layer never reads your web page — each just does its job and passes the result on.

02

What Each Layer Does

Before we follow a piece of data through the stack, here's a one-line summary of each layer's job and something you'd recognize at that layer:

LayerIts jobYou'd recognize
ApplicationProvide the protocols apps use to talkWebsites, email, video calls
TransportGet data to the right program, in order or fastTCP and UDP
InternetAddress packets and route them between networksIP addresses like 192.168.1.10
Network AccessPut the data onto the physical mediumEthernet cables, Wi-Fi
03

How Data Travels Down the Stack

When you send data, it starts at the top and moves down through every layer before it reaches the wire. At each step, the layer wraps the data in its own extra information — mostly a , a small block of control data added to the front. This wrapping process is called . Think of it as putting a message inside a series of envelopes, one for each layer.

✉️

Envelopes inside envelopes

Imagine writing a note, sealing it in an envelope with an apartment number, sealing that inside a bigger envelope with a street address, and finally handing it to a courier. Each envelope adds exactly the information its handler needs, and nobody opens an envelope that isn't theirs. Encapsulation works the same way: each layer adds its own wrapper, and the matching layer on the other side is the only one that opens it.

Here's the same journey step by step, from your app down to the physical link. Notice how the data picks up a new name at each layer as it gets wrapped:

Sending: down the stack (encapsulation)

  • Application — your app produces the raw data (for example, a web request)
  • Transport — adds a header with port numbers and reliability info; the data is now called a segment
  • Internet — adds a header with source and destination IP addresses; it's now a packet
  • Network Access — wraps it with MAC addresses into a frame, then turns the frame into signals (bits) on the wire
04

And Back Up the Other Side

When the data arrives at the destination device, the whole process runs in reverse. Each layer opens its own wrapper, reads its header, and passes what's left up to the layer above. This unwrapping is called . By the time the data reaches the top, it's back to being the exact message your app sent.

Receiving: up the stack (decapsulation)

  • Network Access — reassembles the signals into a frame, checks the MAC address, strips the frame wrapper
  • Internet — reads the IP header to confirm the packet reached the right device, strips it
  • Transport — uses the port number to find the right program and puts segments back in order
  • Application — hands the original data to the app, exactly as it was sent
05

The Name of the Data at Each Layer

You may have noticed the data is called something different at each layer — segment, packet, frame. Each of these is a (Protocol Data Unit), which is just the technical name for "the chunk of data as it looks at a particular layer." Knowing these names is a common interview check, so here they are side by side:

LayerData is calledWhat it adds
ApplicationData / MessageThe actual content (a request, a file, a message)
TransportSegmentPort numbers and, for TCP, reliability info
InternetPacketSource and destination IP addresses
Network AccessFrameMAC addresses, then raw bits on the medium
🚫

"Each layer sends its data straight across to the same layer on the other computer."

Logically it looks that way — the transport layer on one side 'talks to' the transport layer on the other. But physically, data always travels all the way down the sender's stack, across the network, and all the way back up the receiver's stack. Only the bottom layer actually touches the wire.

Q:What is encapsulation in the TCP/IP model?

A: It's the process of each layer wrapping the data from the layer above in its own header (and, at the network access layer, a trailer) as the data moves down the stack. The receiver reverses it with decapsulation, stripping each header on the way up. This is why the data is called a segment, then a packet, then a frame.

Quick Revision Cheat Sheet

Order (top→down): Application, Transport, Internet, Network Access

Encapsulation: Each layer adds a header as data moves down

Decapsulation: Each layer strips its header as data moves up

Transport PDU: Segment

Internet PDU: Packet

Network Access PDU: Frame