ByteByte CityCity
All lessons
OSI Model

What Happens When You Click a Link: All 7 OSI Layers in One Trip

8:28 Watch on YouTube

One click. That's all it takes — and in this episode we follow everything that click sets off: seven floors down through the house, across Byte City, seven floors back up at the far end, and the answer making the same trip in reverse. Nothing new is taught. Every object, number and rule from the seven layer lessons is used exactly as it was taught there, in one delivery.

You'll learn

Chapters

  1. 0:00One click
  2. 0:34Before the slip can leave: three arrangements
  3. 0:45The Yellow Pages, the call-ahead, the lock
  4. 1:29Down the stairs: floor 7 to floor 1
  5. 2:50Across the city: the crate is rebuilt, the bag is not
  6. 3:46Up the stairs at the far end, and the reply
  7. 5:13The real names: data, segment, packet, frame, bits
  8. 5:44Who works on which floor, and the honest footnote
  9. 6:27The real thing: one click as a packet capture
  10. 6:59Frame 8 opened, floor by floor
  11. 7:35Exam corner
  12. 7:46Recap and next time

The written lesson

One click, one trip

You click a link. That's all it takes. This lesson follows everything that one click sets off: seven floors down through your house, out onto the road, across Byte City, and seven floors back up at the far end. Then the answer makes the same trip in reverse.

Nothing new is taught here. Every layer, every wrapper and every number comes from the earlier lessons, used exactly as it was taught there. You have walked each floor on its own. Now we take the stairs.

Before the slip can leave: three arrangements

A diagram titled Before the slip can leave: three arrangements. Your house at 192.168.1.10 with door 51514, our return door, and the catalogue server at 10.0.5.20 with door 443, which is marked with a lock. Between them a certificate card reads catalog.bytecity.tech, Byte City Root CA, above two keys and a padlock on the line. A counter reads trips down the stairs so far: 3, and the banner reads Three arrangements, a fraction of a second
Name, doors, lock: three trips down the stairs before the request itself can leave.

The click is a request slip: "get me the catalogue page." But before that slip can go anywhere, three things are arranged, and each of them is a trip down the stairs of its own.

First, the Yellow Pages. The link says catalog.bytecity.tech, and trucks need numbers. One bullhorn shout to door 53, and the answer comes back: 10.0.5.20. That is the server across town, the same house the truck reached in the Layer 4 lesson. In real names, that is a DNS lookup over UDP.

Second, the call-ahead. The truck knocks at door 443 from our return door, 51514. The far end answers, and we confirm. Those are the three knocks of the TCP three-way handshake. The doors are now open at both ends.

Third, the lock. The far end shows its ID card, its certificate. The two houses agree a key, and from now on everything through door 443 is wrapped. That is the TLS handshake.

Three arrangements, a fraction of a second. Only now can the slip itself take the stairs.

Down the stairs: one slip, seven floors

A diagram titled Down the stairs: one slip, seven floors. A column lists the floors from 7 Application, the storefront, to 1 Physical, the road, with floor 2 Data Link, the crate, lit. Beside it a crate holds a mail bag tagged 192.168.1.10 > 10.0.5.20 TTL 64 containing pieces 1, 2 and 3 tagged 51514 > 443, with plaques FROM A4:BB:6D:4D:5E:6F and TO 3C:52:82:0A:11:01. The banner reads Floor 2, the crate: two plaques
Every floor adds one wrapper. By floor 2 the data sits inside a bag, inside a crate.

Floor 7, the storefront. The slip is written: "GET /catalog". That is the data.

Floor 6, the packing room. Label it (plain text, UTF-8), seal it, and shrink-wrap it, because the road is public. From here on nobody on the road can read the slip.

Floor 5, the window. This slip belongs to the conversation we opened with the catalogue server. It is stamped onto that window, so the answer comes back to the right one.

Floor 4, the truck. The slip is cut into numbered pieces, and each piece gets the TCP tag: from door 51514, to door 443. A signature will be expected for what arrives. (Simplified, as in the Layer 4 lesson: one real signature can cover a whole run of pieces.)

Floor 3, the mail bag. Each piece goes into a bag with the tag that never changes: from 192.168.1.10, to 10.0.5.20. The tag also carries the expiry stamp, 64. The atlas says: that's not my street. Send it to the gate.

Floor 2, the crate. The bag goes into a crate with two plaques: from our brass plaque, A4:BB:6D:4D:5E:6F, to the gate's plaque, 3C:52:82:0A:11:01. Our house learned the gate's plaque by asking the street.

Floor 1, the road. The crate becomes a stream of light in the glass tube, or pulses in the copper. It's gone.

Across the city: the crate is rebuilt, the bag is not

A diagram titled Across the city: the crate is rebuilt, the bag is not. A row of stops reads Your house 192.168.1.10, switch-depot street 1, the gate 192.168.1.1, intersection 192.168.2.2, switch-depot last street, far house 10.0.5.20. A crate at the far end reads FROM 70:4C:A5:9D:30:02, TO B8:27:EB:61:0C:20, with the bag 192.168.1.10 > 10.0.5.20 and TTL 62. The banner reads The crate has been rebuilt twice
Same bag, same addresses, stamp down to 62. The crate is on its third set of plaques.

On our street, the switch-depot reads the crate's plaque, the gate's, and forwards it out of the right ribbon. It never opens the crate. Floor 2 only.

At the gate, the crate is opened and the bag comes out. The atlas row reads 10.0.5.0/24 via 192.168.2.2. The stamp is punched: 63. Then the bag goes into a brand-new crate, with the gate's far-side plaque as sender, 3C:52:82:0A:11:02, and the next intersection's plaque as receiver, 70:4C:A5:9D:30:01. Plaques belong to streets, and this is a new street.

At the second intersection it happens again: bag out, atlas, stamp punched to 62, new crate. This time the plaques read from 70:4C:A5:9D:30:02, to B8:27:EB:61:0C:20.

On the last street, the crate carries the far house's own plaque. The switch-depot there reads it, and the crate arrives at the garage.

Look at what changed and what didn't. The bag inside has never been re-addressed: it still says 192.168.1.10 to 10.0.5.20. Only its expiry stamp moved, 64 to 63 to 62, one punch per router. The crate, meanwhile, has been rebuilt twice. IP addresses stay the same for the whole trip. MAC addresses change at every hop.

Up the stairs at the far end, and back

A diagram titled Up the stairs at the far end, and back. The floor column from 7 Application to 1 Physical has floor 1 Physical, the road, lit, with light on the road drawn beside it. A label reads The reply, every tag swapped, and the banner reads FROM 10.0.5.20, TO 192.168.1.10
The receipt goes back down the same stairs with every tag swapped: from the server, to us.

At the far end, the same seven floors are climbed upwards, and each wrapper comes off in turn.

  • Floor 1: light becomes a crate.
  • Floor 2: that's my plaque. Open it.
  • Floor 3: that's my address. Open the bag.
  • Floor 4: door 443, piece number one. Send the signature back.
  • Floor 5: this belongs to the window we opened with 192.168.1.10.
  • Floor 6: unwrap it, unseal it, read the label: plain text.
  • Floor 7: the storefront reads the slip, "GET /catalog". It fetches the page and writes a receipt: 200 OK.

Then the receipt takes the stairs down, with every tag swapped. From 10.0.5.20, to 192.168.1.10. From door 443, to door 51514. It crosses the city, punched twice and re-crated twice, and climbs our own stairs until floor 7 hands your browser a page.

That is one click. The round trip for a page takes about a tenth of a second.

The real names: data, segment, packet, frame, bits

The seven-floor house cut away like a doll's house, with floors labelled 7 Application to 1 Physical on the right. A card reads In Byte City, what the exam calls it: the slip, wrapped and stamped (7, 6, 5) is DATA; a numbered piece plus TCP tag (4) is SEGMENT, datagram on the bullhorn; the mail bag and its tag (3) is PACKET; the crate and its plaques (2) is FRAME; the light, the pulses (1) is BITS
Data, segment, packet, frame, bits: the name of the data on each floor.

This is the part the exam loves. Each wrapper has a real name, and the general term for them is the protocol data unit, or PDU.

FloorIn Byte CityWhat the exam calls itWho works here
7, 6, 5The slip, wrapped and stampedDataThe application and its libraries
4A numbered piece with its TCP tagSegment (TCP), datagram (UDP, the bullhorn)Firewalls read the doors
3The mail bag and its tagPacketRouters read the bag
2The crate and its plaquesFrameSwitches read the plaque
1The light, the pulsesBitsCables, radios, hubs

Data, segment, packet, frame, bits. The exam will ask you which name belongs to which floor.

Each wrapper also tells you who works on that floor. A switch reads plaques, which means frames, and never opens the crate. A router opens the crate, reads the bag, which means packets, and punches the stamp. A firewall reads the doors on the TCP tag.

The wrapping on the way down is called encapsulation. The unwrapping on the way up is de-encapsulation.

And the honest footnote, one last time. The seven floors are the map. The real building has fewer walls: the top three floors are one room in practice, and engineers argue about where the lock lives. Use the map. Don't mistake it for the building.

The real thing: one click as a packet capture

A protocol analyser window titled frame 8 opened, listing nine frames: two DNS rows for catalog.bytecity.tech and 10.0.5.20, three TCP rows 51514 to 443 SYN, SYN ACK and ACK, TLSv1.3 Client Hello, Server Hello, and two Application Data rows. Row 8 is selected and its detail pane shows Ethernet II from A4:BB:6D:4D:5E:6F (ours) to 3C:52:82:0A:11:01 (the gate), IPv4 from 192.168.1.10 to 10.0.5.20 with Time to Live 64, TCP source port 51514 and destination port 443, and Transport Layer Security Application Data, encrypted, which the capture cannot read. Floor chips 1·2, 2, 3, 4 and 5·6·7 sit beside the lines, labelled the road, the crate, the mail bag, the truck and the wrap
One frame opened in a protocol analyser: crate, bag, tag and wrap, exactly as the series drew them.

Here is the same click, as a packet capture. Every row is one crate on the road, and you can read the whole trip in nine of them.

  • Rows 1 and 2: the Yellow Pages. The shout to the name server on our street, 192.168.1.53, asking for catalog.bytecity.tech, and the number back: 10.0.5.20.
  • Rows 3, 4 and 5: the three knocks of the call-ahead. 51514 to 443 [SYN], then [SYN, ACK], then [ACK].
  • Rows 6 and 7: the lock. Client Hello, Server Hello: hello, hello, key agreed.
  • Row 8: our slip, wrapped, on its way.
  • Row 9: the receipt.

Twenty-one milliseconds, start to finish, for these nine frames.

Now open row 8. The capture shows you the floors from the bottom up, exactly as this series drew them. The frame: from our plaque, A4:BB:6D:4D:5E:6F, to the gate's plaque, 3C:52:82:0A:11:01. Inside it the packet: from our address to the server's, 192.168.1.10 to 10.0.5.20, Time to Live 64. Inside that the segment: from port 51514 to port 443. And inside that, the wrap, which the capture cannot read, because it isn't the far end.

Notice the destination MAC address. A capture taken on our computer shows the gate's plaque, not the server's, because the crate only ever carries the next stop. Every Byte City picture is in that one pane. Reading captures gets a complete lesson of its own.

For the Network+ exam: at which OSI layer is the protocol data unit called a packet? Layer 3, Network. The bag with the tag. Frames are the crate; segments are the pieces.

Quick answers

What happens when you click a link?

Your computer first looks up the name in DNS, opens a TCP connection with a three-way handshake, and agrees encryption with TLS. Then the request is encapsulated down the layers, routed across the network, de-encapsulated at the server, and the response comes back the same way.

What is encapsulation in the OSI model?

Each layer wraps the data from the layer above with its own header on the way down: a TCP header, then an IP header, then an Ethernet frame. At the far end each layer removes its own wrapper on the way up, which is de-encapsulation.

What is the PDU at each OSI layer?

Data at Layers 5 to 7, a segment at Layer 4 (a datagram for UDP), a packet at Layer 3, a frame at Layer 2 and bits at Layer 1. The exam often asks you to match the name to the layer.

Does the IP address change at every router hop?

No. The source and destination IP addresses stay the same across a routed path, while the TTL drops by one at every router. The MAC addresses change at every hop, because each router builds a new frame for the next network.

What does a packet capture show?

A list of every frame seen on the wire, and for any one frame its layers from the bottom up: Ethernet, IP, TCP and the payload. Encrypted payloads such as TLS application data show up, but their contents can't be read.

Key terms

Encapsulation
—
each layer wrapping the data from the layer above on the way down.
De-encapsulation
—
each layer removing its own wrapper on the way up at the far end.
Protocol data unit (PDU)
—
the name of the data at a given layer: data, segment, packet, frame, bits.
Segment
—
the Layer 4 PDU with its TCP tag; with UDP it is a datagram.
Packet
—
the Layer 3 PDU, carrying source and destination IP addresses and the TTL.
Frame
—
the Layer 2 PDU, carrying source and destination MAC addresses; rebuilt at every router.
TTL
—
time to live, lowered by one at every router; 64 to 63 to 62 on this trip.
Packet capture
—
a record of frames on the wire, read in a protocol analyser.
Next: "The Internet Is Down": Troubleshoot Any Network Layer by Layer

Quick quiz

Five questions on this lesson. Pick an answer to see why.

  1. 1. A user clicks a link to an HTTPS page on a server whose name is not cached. Which of these happens first?
  2. 2. As data moves down the OSI layers on the sending host, which sequence of PDU names is correct?
  3. 3. A technician captures the same request leaving a PC and arriving at a server two routers away, with no NAT on the path. Which of these values changed on the way?
  4. 4. A PC sends a packet with a TTL of 64 to a server. The path crosses two routers. What TTL does the server see in the packet?
  5. 5. Which device forwards traffic by reading the destination MAC address in the frame, without examining the packet inside?

Keep learning

Previous

Thumbnail for Ping Works, Names Don't: DNS and the Application Layer | OSI Layer 78:07
OSI Model

Ping Works, Names Don't: DNS and the Application Layer | OSI Layer 7

The storefront, the mail room and the Yellow Pages, where every conversation begins.

8:07 Watch

Next

Thumbnail for "The Internet Is Down": Troubleshoot Any Network Layer by Layer8:00
OSI Model

"The Internet Is Down": Troubleshoot Any Network Layer by Layer

Five tickets, four words: "the internet is down." Five questions, bottom up, find the floor.

8:00 Watch

Related

Thumbnail for Ping Works, Page Won't Load: Ports, TCP and UDP | OSI Layer 49:32
OSI Model

Ping Works, Page Won't Load: Ports, TCP and UDP | OSI Layer 4

Numbered doors, the truck that calls ahead and the bullhorn that doesn't.

9:32 Watch

Related

Thumbnail for "Your Connection Is Not Private": TLS and Encoding | OSI Layer 68:11
OSI Model

"Your Connection Is Not Private": TLS and Encoding | OSI Layer 6

The packing room: the label printer, the vacuum sealer and the lock on door 443.

8:11 Watch

Exam objectives: CompTIA Network+ N10-009: 1.1 (OSI layers, encapsulation and de-encapsulation, PDUs), 1.4 (ports and protocols), 1.6 (DNS), 5.5 (protocol analyser output).

Byte City is not affiliated with or endorsed by CompTIA.