Kahibaro
Discord Login Register

15.6 Internet Routing

Overview

Internet routing is the process that decides how data travels between different networks across the globe. When your device sends data to a server in another city or on another continent, routers along the path cooperate to move packets hop by hop until they reach the destination. In this chapter, the focus is on how routing works at the scale of the public internet, not on the local decisions inside a small home or office network.

Internet routing brings together three key ideas. First, the internet is a network of networks, where each large network is under its own administrative control. Second, these networks must be interconnected in a way that scales to millions of routes and thousands of organizations. Third, there needs to be a method to choose good paths, react to failures, and still remain relatively stable, even when the underlying physical links and business relationships are complex.

The Internet as a Network of Networks

At a high level the internet is built from many separate networks, each managed by a company, university, government, or other organization. Each of these big networks is called an Autonomous System, usually shortened to AS. An Autonomous System is a group of IP networks and routers operated by one entity that presents a common routing policy to the rest of the internet.

Each AS is identified by an Autonomous System Number (ASN). ASNs are assigned by regional internet registries, the same organizations that allocate public IP address blocks. For example, a large ISP, a cloud provider, or a major university campus typically has one or more ASNs.

Inside an AS, the operator uses internal routing protocols to move traffic among its routers, which is covered in more detail in routing protocol chapters. At the borders, different ASes exchange routes with each other. This exchange of routes and path information between ASes is what makes internet‑wide routing possible.

Interconnection: Peering and Transit

To move traffic between ASes, there must be physical and logical connections between them. At a physical level, routers from different networks are linked through fiber, copper, or cross‑connects in data centers and carrier hotels. At a logical level, the two networks agree to exchange routes with each other.

There are two main business relationships in internet routing. The first is transit. In a transit relationship, one network pays another network to carry its traffic to the rest of the internet. The provider gives its customer access to the provider’s own network and to all the networks that the provider can reach. Transit is often used by smaller networks that do not want to build many direct connections.

The second relationship is peering. In a peering relationship, two networks agree to exchange traffic between their own customers. Typically, they do not carry each other’s traffic further upstream. Peering is usually a settlement‑free arrangement, meaning that neither side pays the other, although paid peering also exists. Large content providers and large ISPs use peering to exchange high volumes of traffic efficiently.

Many peering relationships are implemented at Internet Exchange Points, often called IXPs. An IXP is a physical location where multiple networks connect their routers to a shared switching fabric, so they can establish many peering connections using a single physical presence. This leads to shorter paths, lower latency, and lower costs, because traffic between local networks can stay local instead of traveling through distant transit providers.

BGP and Path Advertisement

The core routing protocol of the internet is the Border Gateway Protocol, or BGP. While local routing within a single AS can use several different protocols, BGP is the standard protocol used between ASes. It is often called an interdomain routing protocol, where a domain here means an autonomous system.

BGP routers exchange information about which IP prefixes they can reach. A prefix is a block of IP addresses described by an address and a prefix length, such as 203.0.113.0/24. If an AS owns a prefix, or has learned a route to that prefix from somewhere else, it can advertise that prefix to its neighbors using BGP.

Each BGP route announcement includes an AS path attribute. This is a list of ASNs that shows the sequence of autonomous systems that traffic will pass through to reach that prefix. For example, an AS path might look like:

$$
\text{AS\_PATH} = 64510\ 64520\ 64530
$$

This tells a receiving router that the route to the prefix goes first through AS 64510, then AS 64520, then AS 64530, which is likely the originating AS.

BGP is incremental and policy driven. It does not flood the entire network with all routes at once. Instead, each BGP speaker advertises routes to its neighbors based on configured policies. These policies decide which prefixes to advertise, which ones to accept, and which paths to prefer. This policy control is important because routing is not only a technical problem but also reflects business decisions and traffic management goals.

Important statement: On the public internet, BGP is the standard protocol used to exchange reachability information and AS paths between autonomous systems.

Prefixes and Route Aggregation

Internet routing depends heavily on the use of prefixes, not single IP addresses. A prefix represents a contiguous block of addresses and is written with CIDR notation. For example:

PrefixAddress range example
198.51.100.0/24198.51.100.0 to 198.51.100.255
2001:db8:abcd::/482001:db8:abcd:: to 2001:db8:abcd:ffff:ffff:ffff:ffff:ffff

On the global internet, every additional prefix that is advertised increases the size of the global routing table. Routers that participate in full internet routing must store and process all these prefixes. To keep routing scalable, internet operators use route aggregation, also called summarization, whenever possible.

Route aggregation combines several more specific prefixes into a single larger prefix. For example, an ISP that has many customer networks inside 203.0.113.0/20 might advertise only this single /20 prefix to the rest of the internet instead of many smaller /24s. Inside its own network, the ISP still keeps the detailed internal routes, but other ASes only see the summary prefix.

This aggregation reduces the number of entries that need to be propagated globally and makes route processing more efficient. It also helps hide internal topology details from the outside, which is desirable for both security and simplicity.

However, not all prefixes can be aggregated. Multihoming, traffic engineering, and some addressing policies cause more specific prefixes to be advertised. A more specific prefix, such as 203.0.113.64/26, will be preferred over a less specific one like 203.0.113.0/24 when both are present, because it is a more exact match for a given destination IP.

Important rule: When routing a packet, routers always select the route with the longest prefix match, meaning the most specific prefix that still matches the destination address.

Path Selection and Routing Policies

When a BGP router receives multiple routes to the same prefix, it must choose one best path to use for forwarding and to advertise to its neighbors. The decision is not simply based on the number of hops. Instead, BGP follows a step‑by‑step selection process that looks at attributes assigned to each route.

Some important attributes that influence BGP path selection are local preference, AS path length, origin type, MED (Multi Exit Discriminator), and more. Local preference is commonly used inside an AS to prefer one exit point over another. AS path length is often used as a tie breaker, where shorter AS paths tend to be preferred. MED can suggest which entry point another AS should use when there are multiple links between the same pair of ASes.

Beyond these technical attributes, each AS uses routing policies that reflect business relationships and engineering goals. For example, an AS might prefer to send traffic through its free peering links instead of through a paid transit provider. It might avoid routing traffic through certain regions for legal or performance reasons. These policies are configured by network engineers and applied to BGP routes when they are received or advertised.

A simple and common policy pattern is to advertise customer routes to everyone, advertise peer and provider routes only to customers, and not advertise peer routes to other peers or providers. This helps maintain the intended flow of traffic according to who is paying whom.

Because of these policies, the path that packets take across the internet is not always the shortest in terms of physical distance. It is instead a compromise between reachability, policy, and performance.

Convergence and Route Changes

The internet is a dynamic system. Links fail, routers are upgraded, new ASes appear, and prefixes move. When something changes, routing must adapt. The process by which routers learn about changes and settle on new stable paths is called convergence.

With BGP, convergence is not instantaneous. When a route is withdrawn or a new route is announced, this information propagates from router to router along the BGP sessions. Each router updates its own best path and may send updates to its neighbors. During this time, some parts of the network may still use the old path while others use the new one.

Very fast convergence can cause instability if routes flap frequently. A route flap means a route appears, disappears, and reappears in quick succession. To reduce the impact of unstable routes, BGP implementations often use mechanisms like route flap damping, which can temporarily suppress a route that changes too often. BGP also uses timers, such as minimum route advertisement intervals and hold times, to avoid flooding neighbors with excessive updates.

From a user perspective, convergence usually appears as a brief interruption, increased latency, or slightly changed paths when running traceroute. On a global scale, large failures or misconfigurations can cause noticeable outages until routing reconverges on working paths.

Hierarchical Structure and Default‑Free Zone

Internet routing uses hierarchy to stay scalable. Most end networks do not carry full information about every other network. Instead, they rely on default routes that point towards an upstream provider. A default route tells the router to send packets for any unknown destination to a particular next hop.

At the core of the internet is a set of networks that carry a full view of all globally advertised prefixes. This part of the network is sometimes called the default‑free zone, because routers there do not rely on a single default route. Instead, they maintain complete routing tables and explicit paths to every published prefix.

Below the default‑free zone are layers of networks that depend on one or more providers for reachability. A small enterprise might have a full routing table from its provider, or it might simply use a default route to that provider. Home routers are at the very edge, usually knowing only the local subnet and a default route pointing to the ISP.

This hierarchical structure reduces the memory and CPU burden on edge devices and isolates much of the complexity of full internet routing to a relatively small number of routers and organizations that specialize in operating them.

Stability, Security, and Route Hijacking

Internet routing must also deal with security and trust. Classic BGP has very limited built‑in security. It assumes that participants behave correctly and announce only the prefixes they are authorized to announce. In practice, mistakes or malicious actions can lead to route leaks or route hijacks.

A route leak occurs when an AS accidentally advertises routes that it should not, for example, passing on routes learned from one provider to another provider or peer, which violates normal policy. A route hijack occurs when an AS claims ownership of a prefix that actually belongs to someone else. This can redirect traffic, causing outages or enabling man in the middle attacks.

To improve trust in routing, the internet community has developed mechanisms like Resource Public Key Infrastructure, often shortened to RPKI. With RPKI, the owner of an IP prefix can publish cryptographic statements called Route Origin Authorizations that declare which AS is allowed to originate that prefix. Routers can then validate received routes and prefer or reject them based on whether they match these authorizations.

Security measures for internet routing also include prefix filtering, where ISPs configure filters to accept or advertise only agreed sets of prefixes, and maximum prefix limits, which prevent a badly configured peer from sending an unreasonable number of routes.

Important rule: An AS should only advertise prefixes it is authorized to originate and should apply filters to control which routes it accepts and advertises to others.

Interaction with NAT and Edge Networks

In this course, NAT basics and related topics are covered in other chapters, but it is useful here to see how NATed edge networks fit into internet routing. The global internet routing system only carries routes to public IP prefixes. Private address ranges and internal subnets behind NAT devices are not visible in BGP.

From the perspective of an upstream ISP, a home router or small office firewall is simply one or a few public IP addresses. All internal private addresses share those public IPs for communication. The ISP’s BGP routers forward traffic based on the public source and destination addresses. The NAT device at the edge translates between those public addresses and the internal private addresses.

Because of this, internet routing remains focused on a relatively limited set of globally unique public prefixes, while NAT allows many more devices to exist behind those addresses without expanding the global routing table.

Practical View: Traceroute and Paths

A useful way to observe internet routing in practice is to use traceroute. Traceroute sends packets with gradually increasing Time To Live values and records the routers that respond along the way. The list of hops you see is a snapshot of the path that packets take at that moment.

Each IP address that appears is typically an interface on a router in some AS. The exact list of hops can change over time as BGP policies, link utilization, and failures evolve. For example, your traffic to the same destination might go through one provider in the morning and another path in the evening, depending on load balancing or changes in routing decisions.

Although traceroute does not reveal the entire BGP decision process, it gives a real‑world perspective on how packets cross organizational and geographical boundaries. It makes internet routing more concrete, transforming abstract AS paths into sequences of real routers and round trip times.

Summary

Internet routing ties together thousands of independent networks into a single reachable whole. Autonomous systems exchange reachability information and AS paths using BGP. Route aggregation keeps the global routing table manageable, while policies and attributes shape how paths are chosen. The hierarchical structure of the internet divides the network into core default‑free routers and edge devices that use default routes. Stability and security measures work to keep routing reliable in the face of failures, misconfigurations, and potential attacks. All of this operates behind the scenes whenever any two devices across the world exchange data over the public internet.

Views: 38

Comments

Please login to add a comment.

Don't have an account? Register now!