4.4 How Data Travel the Internet: Routing, Metrics, and Paths
🌐AP Networking Unit 4 Review
4.4 How Data Travel the Internet: Routing, Metrics, and Paths
🌐 AP Networking
4.1
What Happens When Networks Break or Fail?
4.2
The Language of the Network: Protocols and the OSI and TCP/IP Models
4.3
Tools of Network Analysts: Using the CLI
4.4
How Data Travel the Internet: Routing, Metrics, and Paths
4.5
From the Inside Out: Monitoring and Defending a Large Network
4.6
Moving Forward: Designing for Reliability and Growth
continue practicing 4.4
Multiple choice
Every time you load a webpage, your data takes a journey across multiple networks, bouncing through routers until it reaches a server that might be on the other side of the planet. How does your laptop know where to send that request? How does the response find its way back to you and not some random device? This topic breaks down the mechanics of that journey: how routers make decisions, how private networks talk to the wider internet, and how you can actually trace the path your data takes.
How Data Moves Between Networks
Before your device sends anything, it does a quick check. It compares its own IPv4 address and subnet mask against the destination's IPv4 address. This tells your device one critical thing: is the receiver on the same network as me, or somewhere else?
If the destination is on the same subnet, your device can send the data directly. But if the destination lives on a different network (like a web server across the country), your data has to leave your local network. That means it goes to the default gateway, which is almost always your router. From there, the data will pass through at least one router, and usually many more, before it reaches its destination.
The Role of the Default Gateway
Think of the default gateway as the exit door of your local network. Any packet headed somewhere "not here" gets handed off to this gateway. The gateway then forwards it onward through the internet.
Once the packet finally arrives at the destination network, the router there takes over. It sends the packet directly to the correct device using that device's private IP address on the local network.
Network Address Translation (NAT)
Here's the issue: there aren't enough public IPv4 addresses for every device on Earth to have one. Network Address Translation (NAT) solves this. NAT lets devices with private IP addresses (the ones inside your home or office network) communicate with the outside world through a shared public address.
Here's how it works. When an outbound packet leaves your network, the default gateway swaps the packet's source IP address. The private IP gets replaced with the gateway's single external (public) IP address. This way, many devices inside your network can share just one public IP address.
A Concrete NAT Example
Say your laptop has the private address 192.168.1.25 and wants to load a webpage. Your router's public address is 203.0.113.10.
- Your laptop sends a packet with source
192.168.1.25toward the web server. - The router swaps that source address, so when the packet hits the internet, it looks like it came from
203.0.113.10. - The web server sends its reply back to
203.0.113.10(because that's the only address it knows). - The router sees the reply, checks its NAT table, and forwards the packet directly to
192.168.1.25inside your network.
NAT does two important things: it conserves public IPv4 addresses (which are running out), and it adds a layer of security. Outside devices can't easily reach your internal machines because they don't know the private addresses behind the gateway.
Routing Tables and Hops
Routers (and switches that can route) decide where to send packets by consulting a routing table. This table is a list of networks the router knows about, along with the best path to reach each one.
Every time a router hands a packet off to the next router, that counts as one hop. The first hop is always through your default gateway. After that, the packet typically crosses routers run by Internet Service Providers (ISPs) as it makes its way toward the destination network.
Routing Tables in Detail
A single entry in a routing table typically holds four pieces of information:
- Destination network address (along with its subnet mask): where is this route taking packets?
- Next hop address: which router does the packet go to next?
- Physical interface: which port or network card does the router use to reach that next hop?
- Metric: a cost value that measures how "expensive" this route is, such as hop count or time
Static vs Dynamic Routing
Routes can be set up two ways:
- Static routing: an administrator manually configures each route. Simple, but doesn't adapt to changes.
- Dynamic routing: routers use a routing protocol to automatically share information and pick paths.
A routing protocol is the set of rules that governs how routers exchange info and decide which paths data should take. Different protocols use different algorithms to find the "best" path based on their chosen metrics.
Metrics: How Routers Pick the Best Path
A metric is a cost value tied to a route. The key rule: a lower metric means a more efficient route. When a router has multiple possible next hops to reach the same destination, it picks the one with the lowest metric.
Metrics reflect real network conditions like distance, speed, bandwidth, or congestion. Because networks change over time (a link gets congested, a router fails, bandwidth increases), metrics can shift. This means data might follow a different path tomorrow than it does today, even between the same two devices.
The Four Routing Protocols to Know
Each routing protocol computes metrics differently, which is why they can pick different "best" paths across the same network.
Routing Information Protocol (RIP)
RIP uses hop count as its metric. The best path is the one that passes through the fewest routers from source to destination. Simple, but it ignores things like speed. A path with 3 slow hops will be chosen over a path with 4 fast hops under RIP.
Open Shortest Path First (OSPF)
OSPF looks at link speed and bandwidth. It picks the shortest path based on those factors and can reroute as needed if conditions change. This usually produces faster paths than RIP because it cares about how fast each link is, not just how many there are.
Border Gateway Protocol (BGP)
BGP is the protocol that directs packets between the large sections of the internet operated by ISPs. If RIP and OSPF are about picking paths within a network or region, BGP is about picking paths between the huge chunks of the internet itself.
Intermediate System to Intermediate System (IS-IS)
IS-IS uses link state information to compute the most reliable path for data. It's often used in large service provider networks.
Quick Comparison
| Protocol | Metric Basis | Typical Use |
|---|---|---|
| RIP | Hop count | Smaller networks |
| OSPF | Link speed, bandwidth | Enterprise networks |
| BGP | Policy between ISPs | Between large internet sections |
| IS-IS | Link state | Reliable paths in large networks |
Tracing the Route with traceroute and tracert
Want to actually see the path your data takes? There are two command-line tools that reveal this:
tracerouteon Mac and Linuxtracerton Windows
Both do the same job: they show the route a packet follows from your network to the destination network, listing the IPv4 address of every hop along the way.
Reading the Output
Each line of the output represents one hop. For each hop, you'll typically see:
- The hop number
- The domain name or IP address of that router
- How long that hop took to respond (usually in milliseconds)
Here's what a trimmed tracert output might look like when tracing a path to a website:
</>CodeTracing route to example.com [93.184.216.34] 1 1 ms 1 ms 1 ms 192.168.1.1 2 12 ms 11 ms 13 ms 10.0.0.1 3 15 ms 14 ms 15 ms isp-router.net [203.0.113.1] 4 22 ms 21 ms 23 ms core1.isp.net [198.51.100.5] 5 45 ms 44 ms 46 ms 93.184.216.34
Hop 1 is your default gateway (your home router). Hops 2 through 4 are routers along the way, often operated by ISPs. Hop 5 is the destination.
What You Can Learn From It
The output lets you:
- Count the hops: how many routers did your data cross?
- Spot delays: if one hop suddenly jumps from 15 ms to 300 ms, something is slow there
- Find failure points: if the trace stops or shows asterisks (
* * *), a router along the path isn't responding
This makes traceroute and tracert useful for troubleshooting. If a website is loading slowly or not at all, running one of these tools can show you where the problem is, whether it's your gateway, your ISP, or somewhere deeper in the internet.
Practice Questions for 4.4
1 of 10
To contain a security threat, an administrator adds an Access Control List (ACL) to the corporate edge firewall to block outbound traffic to known malicious IP ranges. Shortly after, users report they cannot reach a legitimate partner portal at 198.51.100.50. The administrator runs tracert 198.51.100.50 from a user's Windows machine. Hop 1 (10.0.1.1, the local gateway) and hop 2 (172.16.1.1, the core router) respond successfully. Hop 3 and all subsequent hops display "Request timed out." The edge firewall is the next device after the core router. Which conclusion and resolution best address this availability issue?
A.
The partner portal is blocking the path; the administrator must request the partner to permit traffic from the corporate network.
B.
The local gateway is blocking the path; the administrator must update its ACL to permit traffic to the 198.51.100.0/24 network.
C.
The edge firewall is blocking the path; the administrator must update its ACL to permit traffic to the 198.51.100.0/24 network.
D.
The core router is blocking the path; the administrator must update its ACL to permit traffic to the 198.51.100.0/24 network.
Vocabulary
The following words are mentioned explicitly in the AP® course framework for this topic.Term | Definition |
|---|---|
best path | The route a routing protocol selects as optimal based on its metric, typically the one with the lowest metric value. |
Border Gateway Protocol | A routing protocol that directs packets between the large sections of the internet operated by ISPs. |
default gateway | The router IP address that devices on a local network use to send traffic to destinations outside the network. |
domain name | A human-readable name that identifies a network host or website, which may appear alongside an IP address for each hop in traceroute/tracert output. |
dynamic routing | A method in which routes are learned and updated automatically by routing protocols. |
first hop | The initial step of a packet's journey, in which it is sent through the default gateway. |
hop | A single step along a packet's route, typically a router or network device, where a packet is passed from one router to another. |
hop count | The number of routers a packet passes through from source to destination, used as a routing metric. |
Intermediate System to Intermediate System | A routing protocol that uses link state information to compute the most reliable path for data. |
IPv4 address | A 32-bit numerical address, written in dotted decimal notation, that identifies a device on an IPv4 network. |
ISP | Internet Service Provider, a company that provides internet access and often operates routers along the path between networks. |
link state | Information about the status and characteristics of a network link that routers use to calculate paths. |
lowest metric | The smallest metric value among multiple possible routes, indicating the most efficient route, which is selected when multiple next hops are possible. |
metric | A cost measure, such as number of hops, time, distance, speed, or bandwidth, used to evaluate how efficient a route is. |
NAT | Network Address Translation, a method that lets devices with private IP addresses communicate with outside networks by translating their addresses to a public IP address. |
network congestion | A condition where too much traffic on a network slows performance, which subnetting can help reduce. |
network delay | A slowdown in data transmission, identified by unusually long response times at specific hops in traceroute/tracert output. |
network failure | A point along a route where data cannot continue, which can be located by examining traceroute/tracert output. |
next hop | The next router or device a packet is forwarded to on its way toward its destination. |
Open Shortest Path First | A dynamic routing protocol that chooses paths based on link speed and bandwidth, rerouting as needed to use the shortest path. |
packet | A unit of data that is transmitted across a network, containing a header with addressing information and a payload. |
private IP address | An IP address reserved for use within a local network that cannot be routed directly on the public internet. |
public IP address | A globally unique IP address used to identify a network or device on the public internet. |
response time | The time, measured in milliseconds, it takes for a device to reply to a ping request; values over 100ms indicate slow performance. |
router | A networking device that forwards packets between networks by consulting a routing table to choose the path to the destination. |
routing algorithm | The computational method a dynamic routing protocol uses to determine the best path according to metrics. |
Routing Information Protocol | A dynamic routing protocol that selects the path with the fewest hops (routers) between source and destination. |
routing protocol | A set of rules that governs how routers exchange information and select the paths data travels along. |
routing table | A table stored in a router or switch that records known networks and the best path for reaching each one. |
source IP address | The IP address in a packet's header that identifies the device or network that sent the packet. |
static routing | A method in which routes are manually configured by an administrator and do not change automatically. |
subnet mask | A value paired with an IPv4 address that determines which part of the address identifies the network and which identifies the host. |
traceroute | A command-line tool that reveals the route a packet takes by listing each hop to its destination (tracert on Windows). |
troubleshooting | The systematic process of collecting information, diagnosing, and resolving problems affecting devices and networks. |
See Fiveable more often in Google
Mark Fiveable as a preferred source and Google is more likely to show you our guides in Top Stories, with a "preferred" badge in AI Mode and AI Overviews.