You press Send on a photo, and five workers inside your phone get busy before a single radio wave leaves. Here is who does what.

You’re in a mountain valley, the view is perfect, and you snap a photo of the peaks. You pick your friend’s name and press Send. One tap and it’s gone. Simple, right?

Not quite. In that instant your phone chops the photo into small pieces called IP packets (IP is the Internet Protocol). Then every packet travels down through five processing layers before it reaches the antenna. Each layer speaks its own language, its protocol. Stack the layers up, and you get a protocol stack.

I like to picture those layers as a crew of five workers inside your phone, running a tiny parcel company. My new video lecture follows one packet through their hands; this post is the written tour. Ready to meet the crew?

Five cartoon workers wave from around a giant smartphone that shows a photo of two green peaks; from left to right they wear SDAP in green, PDCP in cyan, RLC in orange, MAC in red and PHY in purple. The PHY boy crouches at the lower right, and a thumb reaches for the Send button from the lower left
The crew inside your phone: one worker per layer, left to right in the order they work.

Rather watch the crew at work? Here is the video lecture:

Five workers, one stack

Here they are, from top to bottom: SDAP, PDCP, RLC, MAC and PHY. Don’t let the names scare you: I’ll unpack each one when we meet its worker. The bottom worker, PHY (short for physical layer), is Layer 1. He turns bits into radio waves. The four above him form Layer 2, as the 5G standard TS 38.300 lists them. Those four are today’s heroes.

Five workers on a staircase of green, cyan, orange, red and purple steps hand a parcel labelled IP PACKET downwards, from a smartphone at the top to an antenna at the bottom
One packet, handed down from SDAP to PHY at the antenna.

How do they work together? Like a well-run parcel company. Each worker does one job, then hands the parcel to the colleague below.

You askWhy does my phone need five separate workers? Couldn’t one clever program do the whole job?
I answerIt could, and it would be a nightmare to repair. Splitting the work keeps every job small. Each worker masters one job and can forget about all the others.

But the crew in your phone is only half the company.

Every worker has a twin

Here is the key picture. Each worker has a twin on the other side of the radio link, inside the base station (the equipment behind your cell tower). Whatever a worker does to your packet in the phone, the twin undoes in the base station. One twin locks, the other unlocks. One cuts, the other glues.

Two mountains under a starry night sky, a phone on the left one and a cell tower on the right one, with the same five workers on each; strings join each pair of twins, and purple radio waves join the bottom pair
Each layer talks only to its twin. Only the PHY pair shares real radio waves.

Think of a parcel inside a parcel inside a parcel. In your phone, each worker wraps one more box around the packet and sticks a label on it, the header. In the base station, each twin opens its own box, and only its own, in reverse order. At the top, the original packet comes out exactly as it went in.

Two wooden tables. On the one marked PHONE, a white parcel labelled IP PACKET sits inside a green SDAP box, which sits inside a blue PDCP box, an orange RLC box and a red MAC box. On the one marked BASE STATION, the same boxes stand unpacked in a row: MAC, RLC, PDCP, SDAP and, at the end, the IP PACKET parcel
Wrapped in the phone, unwrapped in reverse in the base station.

Jargon nugget: the input that a worker receives is called an SDU (Service Data Unit), and the output is called a PDU (Protocol Data Unit).

The PDCP worker stands at a workbench. A tray on the left, under a wooden sign that reads SDU, holds a green box; in the middle he closes a blue box around a second green box; a tray on the right, under a sign that reads PDU, holds a closed blue box with a white label
In comes an SDU, out goes a PDU.
Diagram: an IP packet passes the boxes SDAP, PDCP, RLC and MAC and gains one coloured header at each; arrows name what enters a layer its SDU and what leaves it its PDU, so the SDAP PDU is also the PDCP SDU
One more header at every layer. What a layer receives is its SDU; what it hands down is its PDU.

Now let’s follow one packet down the stairs. First stop: security.

PDCP: the security officer with three tricks

I’ll save the top worker, SDAP, for the end. Her talent shows only when two kinds of traffic meet. So our packet lands first with PDCP (Packet Data Convergence Protocol), and he has three tricks.

Trick one: shrink the label. At the front of every packet sits an IP header. It is the address label: who sends, who receives. From packet to packet that label hardly changes, so why ship it again and again? PDCP sends the full label a few times, then only the values that changed. We call this robust header compression (ROHC).

The PDCP worker presses a rubber stamp onto the third of four parcels on his bench; parcels number 1 and 2 carry the full address label, parcels number 3 and 4 only a stamp that reads SAME ADDRESS
The first two packets carry the full address. After that, only the number changes.

Trick two: lock it. Your packet is about to fly through open air, where anyone with the right receiver can catch it. So PDCP scrambles it with a secret key that only your phone and the base station know. Engineers call this ciphering. Picture a locked suitcase, and only the twin holds the key.

The PDCP worker closes a cyan padlock labelled CIPHERING on a green suitcase
The lock (ciphering) stops strangers from reading.

Trick three: seal it. A lock stops readers, but someone could still flip bits in the air. So PDCP can add a 4-byte check value, computed from the packet and a secret key. The twin has the same secret key, so he computes the check value again from the packet that arrived. If the value he computed doesn’t match the value he received, somebody tampered with the packet, and the twin throws it away. This is integrity protection, a tamper-evident seal on the suitcase.

A hooded attacker holds a magnet to a locked see-through suitcase full of scrambled bits; the bits next to the magnet turn red The PDCP worker presses a round seal marked INTEGRITY PROTECTION onto the cyan strap around a green suitcase; a padlock marked CIPHERING hangs beside it
Left: the suitcase is locked, yet a vandal can still flip bits from outside. Right: PDCP’s seal makes any tampering visible. (In reality the seal goes on first, and the lock then hides both.)
You askSo is my photo locked all the way to my friend’s phone?
I answerNo, and that surprises many people. PDCP’s lock covers only the radio hop, from your phone to the base station. For the rest of the journey your app can add its own lock, as HTTPS does.
The PDCP worker locks a see-through green suitcase; inside it sits a brown parcel labelled HTTPS PACKET with its own golden padlock
A lock within a lock: the app’s HTTPS parcel inside PDCP’s locked suitcase.

Locked and sealed, the packet moves one step down.

RLC: the carpenter who cuts to fit

RLC (Radio Link Control) asks a practical question: how much of this packet can we send right now? You see, in 5G your phone doesn’t decide. The base station decides when your phone may send, and how much. Picture that allowance as an empty container, which the base station tosses over to your phone.

At a cell tower on the right, a worker in a red MAC jacket has thrown an empty metal container labelled Transport Block towards his twin, who waits beside a phone on the left with three white parcels
Here comes the container. The men in red are MAC and his twin, up next.

Is the container too small for our packet? Then RLC saws off a piece that fits and sends that piece now. The rest of the packet waits with RLC for the next container. On the other side, RLC’s twin glues the pieces back together.

On the left, at a bench marked PHONE, a carpenter in an orange RLC jacket saws a long orange block; pieces fly past a metal container to a bench marked BASE STATION, where his twin glues two pieces together
RLC saws in the phone. His twin glues in the base station.

But what if the container is bigger than our packet?

MAC: the packer at the loading dock

Then MAC (Medium Access Control) steps in, because filling the container is his job. He pulls several packets from RLC, one after another. Remember, the rest of your photo queues right behind our packet. RLC cuts only the last packet, and only if it doesn’t fit. Nothing else to send? Then MAC fills the unused space with padding bytes.

The MAC worker pumps up a grey cushion labelled PADDING above three orange blocks labelled RLC PDU inside a metal container marked Transport Block, while the RLC carpenter shrugs behind an empty workbench
RLC has nothing left to give, so MAC pumps padding into the gap.

The packed container has an official name: the transport block. And who sets its size? The base station decides that too. (How? My post on link adaptation tells that story.) MAC hands the transport block down to PHY. PHY turns its bits into a radio signal, and off it flies. Or does it?

What if the air garbles the packet?

Air is not a cable. Noise and interference get in the way, and sometimes the base station cannot decode a transport block. What now?

The base station does not throw the noisy copy away. It asks for the block again, and MAC in your phone has kept a copy for exactly this moment. Then the base station combines the two noisy copies. It’s like laying two faint photocopies of the same page on top of each other: suddenly the letters are readable.

Repeating plus combining: that mix is why engineers call it Hybrid Automatic Repeat Request, or HARQ.

The PHY boy stands beside a cell tower and holds up two scorched sheets that glow purple, each labelled TRANSPORT BLOCK The PHY boy slides two faint printed sheets over each other on a light table; where they overlap, the text is dark and sharp
An illustration of HARQ retransmission. Left: two noisy copies reach PHY in the base station. Right: overlapped, they become readable.
You askDoes MAC wait for the verdict before he sends the next block?
I answerNo, that would waste time. MAC runs up to 16 of these loops side by side (TS 38.214). Picture 16 loading bays at a dock: each bay keeps one transport block and sends it again when asked. Engineers call each bay a HARQ process.
A phone drawn as a warehouse with loading bays numbered HARQ PROCESS 1 to 4; the MAC worker stands at bay 1 under a sign reading NEW DATA, and transport blocks wait in the other bays
Each loading bay is one HARQ process. A bay is free again only when the base station asks it for new data.
You askWhat happens if the block still can’t be decoded after a few tries?
I answerThen the base station stops asking and requests new data instead. Now the next worker up steps in. RLC numbers his packets, so his twin spots the gap: 2 and 3 arrived, 1 didn’t. Then he reports the gap to your phone’s RLC, who sends packet 1 again.
At the cell tower, the RLC twin stands at a bench with parcels 2 and 3, an empty chalk outline numbered 1 and an hourglass; a red card reading RESEND 1 flies to the RLC worker at the phone, who holds up parcel 1
RLC’s twin spots the gap, waits, then asks for packet 1 again.

RLC’s retry is simpler than MAC’s: no noisy copies, no combining. He just asks again. That is plain Automatic Repeat Request, or ARQ.

And if RLC gives up too? Then TCP (Transmission Control Protocol) takes over, a protocol far above our stack that watches the whole journey. TCP is the customer of our parcel company. After delivery it checks the complete order, and asks again for anything missing.

Three lanes on a time axis, MAC at the bottom, RLC in the middle and TCP on top: many short retry arcs in the MAC lane, fewer and longer ones in the RLC lane, one long one in the TCP lane
MAC retries often and fast, RLC less often, TCP last.

See the pattern? The higher the worker, the slower the retry.

A three-storey workshop: MAC on the ground floor under a sign reading milliseconds, RLC above under tens of milliseconds, TCP on top under seconds, each floor with a slower clock
Milliseconds for MAC, tens of milliseconds for RLC, seconds for TCP.
You askWait. If packet 1 arrives after packets 2 and 3, isn’t my photo jumbled?
I answerGood catch! RLC never reorders. He passes packets up just as they arrive. Reordering is a job for PDCP again: he numbers the packets too, so his twin can put them back in order.
The PDCP worker moves numbered parcels from a shelf marked ARRIVED, where they stand as 2, 3, 1, to a shelf marked IN ORDER, where they stand as 1, 2, 3
Arrived as 2, 3, 1. Handed on as 1, 2, 3.

One worker is still waiting for her turn.

SDAP at last: who goes first?

A hand holds a phone that shows a voice call in progress and a photo uploading; a line of small green VOICE parcels and a line of white PHOTO parcels travel from the phone to a cell tower
Two streams, one phone.

Suppose you are on a voice call while the photo uploads. Now two streams of packets share your phone, and they are not equally patient. A voice packet can’t wait: 5G’s rulebook budgets just 100 milliseconds of delay for it (TS 23.501). The photo can. We call each stream a Quality-of-Service flow, or QoS flow.

So your phone builds a second path just for voice, with a second PDCP and a second RLC. Each path is called a radio bearer. This is where SDAP (Service Data Adaptation Protocol) comes in. Think of her as the check-in receptionist at an airport, who puts every bag on the right conveyor belt. Photo packets go on one belt, voice packets on the other.

An older woman in a green SDAP blazer stands at an airport check-in desk and places a box marked PHOTO PACKET on a belt labelled RADIO BEARER 1; a box marked VOICE PACKET rides on the belt labelled RADIO BEARER 2
SDAP at her check-in desk: one belt per radio bearer.

At the end of the belts stands MAC, who loads bags from all the belts into one container. He reaches for the voice belt first, because it has the higher priority.

Two conveyor belts labelled Radio Bearer 1 and Radio Bearer 2 each pass through a blue PDCP machine and an orange RLC machine; at the end the MAC worker loads parcels from both belts into a container labelled Transport Block
Each belt runs through its own PDCP and RLC. At the end, MAC loads the voice bags first.
You askDoes a voice packet go through exactly the same steps as my photo?
I answerNot quite, because many of these steps are optional. RLC’s “send it again”, for example, is switched ON for the photo and OFF for the voice call. A voice packet that arrives late is useless anyway.
The RLC carpenter leans out of a wooden booth marked RETRY SERVICE and points at a chalkboard that reads RETRANSMISSION, optional: PHOTO and FILE have green ticks; VOICE, GAMING and LIVE VIDEO have red crosses. A parcel with a camera icon stands at the counter, and a parcel with a microphone icon walks past carrying an alarm clock
Retransmission suits traffic that can wait, not live traffic.
The RLC carpenter stands at a counter under a sign that reads RETRANSMISSION: OPTIONAL and holds a rubber stamp; the VOICE parcels in front of him are stamped NO RETRY in red, the PHOTO parcels RETRY IF LOST in green
RLC stamps each parcel: RETRY IF LOST or NO RETRY.
Small parcels walk two tightropes from a phone to a cell tower: under the rope of the PHOTO parcels hangs a net labelled RETRANSMISSION that has caught one; the VOICE rope has no net and one parcel falls
Photo packets walk above RLC’s retransmission net. Voice packets get none.

The 5G stack in one breath

  • SDAP sorts packets onto radio bearers, by their QoS flow.
  • PDCP protects: shrinks the label, then seals and locks the packet.
  • RLC resizes: cuts packets to fit, and resends what went missing.
  • MAC merges all bearers into one transport block, pads it, and retries fast with HARQ.
  • PHY turns the transport block into radio waves.
  • Each worker has a twin in the base station that undoes the work.
The staircase again, now with one word painted on each step: SORTS under the SDAP worker, PROTECTS under PDCP, RESIZES under RLC and MERGES under MAC, with the PHY boy sending radio waves at the bottom
If you forget everything else, remember four words: sorts, protects, resizes, merges.

That’s the whole journey, from the Send button to the antenna. (Curious what PHY does next? My post on how 5G builds its signal picks up right there.)


Leave a Reply

Your email address will not be published. Required fields are marked *