AP Networking 4.4: How Data Travel the Internet, Routing and Paths
AP Networking 4.4: How Data Travel the Internet
Every card payment, price update, and web request that leaves a network crosses a chain of routers, each picking the next step from a routing table. This guide shows how a host decides a destination is remote, how NAT gets it out the door, how metrics choose between paths, and how to read traceroute when something breaks.
The short answer: a device compares its own IP address and subnet mask against the destination; if the masked networks differ, the packet goes to the default gateway. Each router then matches the destination against its routing table, prefers the most specific route, breaks ties with the lowest metric, and forwards the packet one hop closer. Traceroute shows the whole chain, one line per hop. All of Topic 4.4 runs on the grocery store network of scenario 4A.
- How a packet leaves the store network
- NAT: one public address for the whole store
- Routing tables: turn-by-turn directions
- Routing protocols and metrics
- Reading traceroute like an analyst
- Worked walkthrough: the Saturday outage
- Practice: Path Finder
- Sample practice questions
- Key terms
- Frequently asked questions
How a packet leaves the store network
A register terminal at 192.168.50.23 sends a charge to the payment processor at 192.0.2.80. First the terminal runs one test: it applies its subnet mask, 255.255.255.0, to its own address and to the destination. Its masked network is 192.168.50.0; the destination's is 192.0.2.0. They differ, so the destination is remote, and the terminal hands the packet to its default gateway, the store router at 192.168.50.1.
That handoff is the first hop. A hop happens every time a packet is forwarded from one router to the next; after the gateway, the hops usually belong to ISPs. At the destination network, the last router delivers the packet by its private address. Watch the trap: 10.20.30.7 and 10.20.31.9 share two octets and still sit on different /24 networks. The mask decides.
NAT: one public address for the whole store
The register's 192.168.50.23 is a private address, unreachable from the internet. As the packet leaves, the router performs network address translation: it replaces the private source address with its own public address, 203.0.113.10. The processor replies to 203.0.113.10, and the router translates that destination back to 192.168.50.23. Every register, scale, and office PC shares that one public address.
NAT conserves public IPv4 addresses, since a building full of devices needs only one, and it adds a layer of security, because outside hosts cannot address an internal device directly. Note the direction: NAT rewrites the source on the way out. Destinations are only rewritten on the return trip.
Routing tables: turn-by-turn directions
At each router, the packet meets a routing table: a list of known networks and the best path to each. Here is the store router's table, the artifact this lesson turns on:
STORE-R1# show ip route Destination Next hop Interface Metric 192.168.50.0/24 directly connected lan0 0 172.16.0.0/16 203.0.113.1 wan0 5 0.0.0.0/0 203.0.113.1 wan0 10 0.0.0.0/0 198.51.100.1 lte0 50
Each entry carries four things: the destination network's address and mask, the next-hop address, the interface that reaches it, and the metric, that route's cost. Reading it is a fixed procedure:
- Match the destination. 192.0.2.80 falls inside neither listed network, so only the two default routes (0.0.0.0/0, "anywhere else") match.
- Prefer the most specific route. HQ traffic to 172.16.4.20 matches the /16 route and the defaults; the /16 wins.
- Break ties with the lowest metric. Two defaults match 192.0.2.80. Metric 10 beats 50, so the packet leaves for 203.0.113.1 on fiber, not the LTE backup.
- Forward and repeat. The next router runs the same procedure on its own table, hop after hop.
Routing protocols and metrics
Who writes the table? An administrator can enter routes statically, but at internet scale routers learn them through routing protocols, which define how routers share what they know and score paths. Each protocol computes its metric its own way, so two can honestly disagree.
| Protocol | Picks paths by | Where you meet it |
|---|---|---|
| RIP | Hop count: fewest routers to the destination | Small networks; blind to link speed |
| OSPF | Link speed and bandwidth; reroutes to keep the shortest path | Enterprise and campus networks |
| BGP | Routes between the large ISP-run sections of the internet | The glue between providers |
| IS-IS | Link state: the most reliable path | Large ISP backbones |
Picture two paths to the processor: two hops over 10 Mbps microwave, or four hops over 10 Gbps fiber. RIP takes the two-hop path because it only counts routers; OSPF takes the fiber because it weighs bandwidth. Neither is broken. And because metrics track congestion and failures, the winning path can change during the day. This morning's route is not a promise about this afternoon.
Reading traceroute like an analyst
You can watch the path itself: tracert on Windows, traceroute on Mac and Linux list every hop to a destination with its response time. A healthy trace from the back office to the payment processor:
C:\Users\intern>tracert 192.0.2.80 Tracing route to paygate.example [192.0.2.80] over a maximum of 30 hops: 1 1 ms 192.168.50.1 2 8 ms 203.0.113.1 3 12 ms isp-a-core1.example.net [203.0.113.65] 4 14 ms ix-peer2.example.net [198.51.100.201] 5 18 ms 192.0.2.1 6 19 ms paygate.example [192.0.2.80] Trace complete.
Six hops, all under 20 ms; the destination answers at hop 6. The "maximum of 30 hops" line is a probe limit, not a measurement. The same command on Saturday, while card readers time out:
1 1 ms 192.168.50.1 2 9 ms 203.0.113.1 3 12 ms isp-a-core1.example.net [203.0.113.65] 4 * Request timed out. 5 * Request timed out. 6 * Request timed out.
Read it top down. Hops 1 through 3 answer fast, so the store network, the router, and the ISP handoff are healthy. The silence starts after isp-a-core1: the failure sits beyond the ISP's core router, outside the store. The intern's move is a call to the ISP with this output, not an hour of rebooting registers. The same reading finds slowdowns: times jumping from 12 ms to 190 ms at hop 4 mean the delay begins there.
Worked walkthrough: the Saturday outage
Saturday, 11:40 am: prices display wrong, payments fail, and the manager fears an attack. You run the process instead.
- Trace the payment path. tracert 192.0.2.80 breaks after hop 3, as above. Availability problem, beyond the ISP handoff. Evidence beats fear.
- Check the router's view. When wan0 drops, the fiber routes via 203.0.113.1 are withdrawn and the metric-50 LTE default takes over. Traffic still flows, just slower.
- Explain the wrong prices. HQ price syncs ride the 172.16.0.0/16 route over fiber. The morning trace ran through 203.0.113.1 at 8 to 19 ms; the afternoon trace reaches HQ through 198.51.100.1 at 41 to 75 ms. New path, slower sync: the prices are queued, not altered.
- Verify after the fix. When ISP-A restores the fiber, routes return and a fresh trace shows the old path under 20 ms. Payments clear; the sync catches up.
Practice: Path Finder
Now read the artifacts yourself: decide where packets go, reroute around a dead link, and find where a path broke. Cases and choices shuffle every run, so the evidence is the only way through.
AP Networking - Unit 4 - Topic 4.4
Path Finder
Read the routing table or the trace, then make the call a network analyst would. The artifact is the only evidence you get.
Case 1
Your call:
AP is a trademark of the College Board, which was not involved in the production of, and does not endorse, this resource.
Sample practice questions
Three free questions in the graded quiz's style. Commit before you expand the explanation.
1. A laptop at 172.16.8.30 with mask 255.255.0.0 sends a file to a server at 172.16.200.4. What happens to the packet first?
Direct local delivery. Masking both addresses gives 172.16.0.0 for each, so they share a network. With mask 255.255.255.0 the answer flips: the networks would differ, and the packet would go to the default gateway (EK 4.4.A.1).
2. A router holds two routes to the same destination: metric 4 via eth1 and metric 12 via eth2. Which carries the traffic?
The metric-4 route via eth1. When several routes match, the lowest metric wins because metric measures cost. The metric-12 route takes over only if the better route is withdrawn, as when eth1's link fails (EK 4.4.B.1, 4.4.B.4).
3. In a traceroute, hops 1 through 5 answer between 2 ms and 15 ms, hop 6 answers at 240 ms, and hops 7 and 8 stay above 230 ms. Where does the delay begin?
At hop 6. Times are healthy through hop 5; the jump at hop 6 marks where the slowdown starts, and the later hops inherit it. Spotting where delay begins is exactly what the output is for (EK 4.4.C.2, 4.4.C.3).
Full quiz, saved progress, and every Path Finder case
Unlock the graded 8-question Topic 4.4 quiz, the complete Path Finder case bank, and saved progress that reports straight to your class gradebook. Ad-free.
Get AP Networking premiumKey terms
- Default gateway
- The router a host sends to when the destination is on a different network.
- Hop
- One forward of a packet from one router to the next.
- NAT (network address translation)
- The gateway's swap of a private source address for its public address, letting many devices share one public IP.
- Routing table
- A router's list of known networks with the next hop, interface, and metric for each.
- Next hop
- The neighboring router a packet is forwarded to for a given destination.
- Metric
- The cost of a route, such as hop count or time. Lowest wins.
- Routing protocol
- Rules routers use to share reachability and pick paths: RIP, OSPF, BGP, IS-IS.
- traceroute / tracert
- Command line tools that list every hop to a destination with its response time.
Frequently asked questions
How does data travel between two different networks?
The sending host masks both addresses; if the networks differ, it sends the packet to its default gateway. Each router then matches the destination against its routing table and forwards the packet one hop closer until the final router delivers it.
What does a routing metric actually measure?
Cost, in whatever currency the protocol uses: hop count for RIP, link speed and bandwidth for OSPF. Among matching routes, the lowest metric wins.
What is the difference between static and dynamic routing?
Static routes are typed in by an administrator and stay put. Dynamic routes are learned by routing protocols, which recalculate when conditions change, with no table edits.
What is NAT and why do networks use it?
Network address translation replaces a device's private source address with the gateway's public address on outgoing traffic. A whole network shares one public IPv4 address, and outside hosts cannot address internal devices directly.
Why does my traceroute show a different path than yesterday?
Congestion, a failed device, or a link speed change makes a different route cheapest, and dynamic protocols re-pick the path. A changed path is normal, not evidence of tampering.
How do I run traceroute?
Windows: open Command Prompt and run tracert followed by the address or name, like tracert 192.0.2.80. Mac and Linux: run traceroute in a terminal.
What do the stars or "Request timed out" lines mean?
That hop did not answer in time. A run of timeouts after a healthy hop usually marks where the path broke: investigate beyond the last responding hop. Some routers decline to answer probes while forwarding fine.
How many hops is normal?
Most destinations sit within about 8 to 20 hops. Count the numbered lines; the "maximum of 30 hops" header is only a probe limit, not the distance.
AP is a trademark of the College Board, which was not involved in the production of, and does not endorse, this resource.
Get in Touch
Whether you're a student, parent, or teacher — I'd love to hear from you.
Just want free AP CS resources?
Enter your email below and check the subscribe box — no message needed. Students get daily practice questions and study tips. Teachers get curriculum resources and teaching strategies.
Message Sent!
Thanks for reaching out. I'll get back to you within 24 hours.
Prefer email? Reach me directly at [email protected]