Networking › Module 1 › Lesson 3
How Data Travels in Networks
Follow a message from your browser to a server through encapsulation and routing
Opening
A click is not magic. It is a chain of hand-offs you can name.
You type a hostname, press Enter, and a page appears. Between those two moments the host resolved a name, opened a transport conversation, and handed a packet to a neighbor that was not the server — then another, then another — until a data center answered. Each hop rewrote the Layer-2 wrapper. The destination IP stayed the goal. Defenders who cannot narrate that path blame "the internet" as if it were one device. Attackers who can narrate it know where interception is even possible. You will walk one request, on purpose, without probing anyone else's network.
1. From click to first packet: name, then conversation, then bits
The browser does not start with a server IP. It starts with a name. DNS (next module) turns example.com into an address your Internet layer can use. Treat that as a preview, not a full DNS course: if name resolution fails, no TCP handshake with the site ever begins. nslookup of example.com on your own machine is a safe way to see that a name becomes an IP — you are asking a resolver, not scanning a LAN.
For HTTPS, the next idea is a TCP handshake: the client sends SYN, the server answers SYN-ACK, the client sends ACK. Only then do application bytes (the HTTP request) ride inside TCP. You do not need the flag diagram memorized as trivia; you need the mechanism: no completed handshake, no reliable byte stream. UDP-based apps skip that setup and just send datagrams. A web click almost always waits on TCP after DNS.
Encapsulation then dresses the request for the local hop. Application data is wrapped by TCP (ports, sequence), then IP (your source address, the server's destination address, a TTL counter), then Ethernet or Wi-Fi (your NIC MAC as source, the next-hop MAC as destination — usually the default gateway, not the server). Layer 1 puts that frame on the wire. The server is often many networks away. The first frame only has to reach the next device that will take IP responsibility.
2. Hop by hop: NIC, switch, router, WAN — then peel on the way in
Your NIC emits a frame. On a typical LAN a switch copies that frame toward the port where it last saw the destination MAC. The switch is a Layer-2 device: it does not "open" the IP packet to decide. If the destination MAC is the router, the frame arrives at the gateway. ARP (later in this topic) is how your host learned that MAC. Wrong MAC, wrong next hop — even if the IP header is perfect.
The router de-encapsulates the frame, reads the destination IP, looks up a route, decrements TTL, and encapsulates a new frame toward its next hop. New MACs, same goal IP (NAT can rewrite IPs later — Module 5). That repeat is the WAN: hop after hop across ISP and backbone routers until the server's network. At the server, de-encapsulation runs in reverse: bits → frame → packet → segment → HTTP. The response climbs down the server's stack and walks home by the same rules.
TTL (Time To Live in IPv4; Hop Limit in IPv6) is why a routing loop does not live forever. Each router subtracts one. At zero, the packet is dropped and the router should send an ICMP Time Exceeded to the sender. traceroute abuses that politely: it sends probes with TTL=1, then 2, then 3, so each successive router is the one that expires the probe and reveals itself. Stars in traceroute often mean "this hop did not answer ICMP," not "the earth opened." That is a diagnostic on paths you are allowed to test — your own loopback, your own gateway — not a reason to trace a company you do not own.
Packet versus frame is the vocabulary that keeps this story honest. The IP packet is the letter with the city on it. The frame is the truck that carries it to the next warehouse. Warehouses (routers) unload the truck and load a new one. If you confuse the two, you will expect a remote server's MAC to appear on your LAN, or think a switch should fix a missing default route. ip route on your machine shows the first truck destination: the default via.
3. Wrong vs right: traceroute as a license to wander
Worked failure mode — "I want to see the whole internet." Stay on a host you own:
Wrong
You traceroute random corporate ranges and ping-sweep the apartment building because the diagram showed many hops. You treat every timeout as a dead host. You never ping 127.0.0.1, so you cannot tell a broken local stack from a filtered path. Encapsulation stays a cartoon.
Right
Prove your own stack: ping -c 4 127.0.0.1. Read ip route show so you know the default gateway on THIS machine. Optional traceroute to 127.0.0.1 is a tiny demo of TTL, not a world tour. Ping a public resolver only if you are allowed to use it as a client; prefer loopback and your own routes. Never scan or trace networks that are not yours.
4. Practical: loopback ping and YOUR route table
A reply from 127.0.0.1 means your Internet/Transport stack can talk to itself. ip route show names the first hop for everyone else. That is enough to ground this lesson. Do not nmap. Do not traceroute the school.
Reachability of self, then your own routes
# YOUR VM / WSL / spare machine only ping -c 4 127.0.0.1 # How this host forwards (default via = first router hop) ip route ip route show # Tiny TTL demo — loopback, not a foreign network command -v traceroute >/dev/null && traceroute -n 127.0.0.1 || \ command -v tracepath >/dev/null && tracepath -n 127.0.0.1 || \ echo 'traceroute/tracepath optional; ip route is the lesson' # Optional: nslookup of a public documentation name (resolver query, not a LAN scan) # nslookup example.com # NEVER: traceroute, ping flood, or path discovery against networks you do not own # NEVER: treat a hop list as permission to "test" those routers
Mission: narrate one click, then prove loopback and a route
1) Write the path in order: click → DNS (name to IP) → TCP handshake idea → NIC frame to gateway MAC → switch → router (IP, TTL--) → WAN hops → server de-encapsulation. 2) On your own VM or WSL, ping -c 4 127.0.0.1 and run ip route. Write the default via if you have one. 3) Optional: traceroute/tracepath to 127.0.0.1 only. Do not trace or scan other people's networks.
Stuck? Ask Cyberlium AI Mentor
If "the server MAC never appears on my LAN" still feels wrong, ask Cyberlium AI Mentor for a hint — not a scan. Try: "Hint only: why does the first Ethernet destination equal my gateway MAC, not the website?" Keep the answer in your own words.
You mapped OSI, then TCP/IP headers; now you can follow one message: DNS preview, handshake, frame to a switch, packet to a router, TTL as a hop budget, traceroute as expired probes. Next up — Quiz — OSI Model — ten APPLY scenarios that check whether you can place an incident on the right floor and the right hop, not reciting pizza.
Knowledge Check
APPLY: Your capture on the laptop (authorized home lab) shows destination MAC = the home router, destination IP = a remote web server. What is happening?
Multiple choice
Knowledge Check
APPLY: You want to see traceroute "in action" for class. Which action is acceptable?
Multiple choice
Knowledge Check
APPLY: True or False: traceroute lists hops because each router decrements TTL and a hop that hits zero should send Time Exceeded — which is why stars can mean "no ICMP reply," not "no path for all traffic."
True or False