TCP/IP Model·Lesson 2 of 8
Layers of the TCP/IP Model
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
Transport
Delivers data to the right program, reliably or quickly
Internet
Addresses and routes data across networks
Network Access
Sends the data over the physical link to the next device
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.
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:
| Layer | Its job | You'd recognize |
|---|---|---|
| Application | Provide the protocols apps use to talk | Websites, email, video calls |
| Transport | Get data to the right program, in order or fast | TCP and UDP |
| Internet | Address packets and route them between networks | IP addresses like 192.168.1.10 |
| Network Access | Put the data onto the physical medium | Ethernet cables, Wi-Fi |
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
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
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:
| Layer | Data is called | What it adds |
|---|---|---|
| Application | Data / Message | The actual content (a request, a file, a message) |
| Transport | Segment | Port numbers and, for TCP, reliability info |
| Internet | Packet | Source and destination IP addresses |
| Network Access | Frame | MAC addresses, then raw bits on the medium |
“"Each layer sends its data straight across to the same layer on the other computer."”
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