DCE-210 · Lesson 8 of 12 · 31 min

Internet routing, content delivery and the enterprise WAN

Lesson 7 described the business of connecting networks: transit, peering, exchange points and meet-me rooms. This lesson looks at how traffic actually finds its way once the connections exist. It covers how BGP chooses routes across the internet and how operators steer traffic with it, why routing is vulnerable to mistakes and attacks and how it is being secured, how DNS and content delivery networks bring content close to users, and how enterprises connect their offices and data centres over wide-area networks.

The internet as autonomous systems

The internet is a network of more than 75,000 independently operated networks called autonomous systems (ASes), each identified by an AS number (ASN) and each controlling a set of IP address blocks (prefixes). Carriers, cloud providers, content companies, universities and large enterprises all run their own ASes. Regional internet registries assign addresses and ASNs: ARIN serves Canada, the United States and parts of the Caribbean.

ASes exchange reachability information using the Border Gateway Protocol (BGP). Each AS announces the prefixes it originates to its neighbours, and each neighbour passes the announcement on, adding its own ASN to the front of the AS path. A router that receives the same prefix from several neighbours chooses one best path and installs it in its forwarding table. The global table held by internet edge routers contains roughly a million IPv4 prefixes and over 200,000 IPv6 prefixes (Lesson 6).

How BGP chooses a path

BGP is a policy protocol: it does not simply pick the fastest path, it picks the path the operator's policy prefers. When several paths to the same prefix are available, a router compares them in a fixed order and stops at the first difference. Simplified, the common order is:

1. Highest local preference: a value the operator sets inside its own AS to express which exit it prefers, such as customers over peers over transit providers, because customers pay and transit costs money.

2. Shortest AS path: fewer ASes to cross.

3. Lowest origin type, then lowest multi-exit discriminator (MED), a hint from a neighbour about which of several links into it to use.

4. Paths learned from external neighbours (eBGP) over internal ones (iBGP).

5. Lowest internal routing cost to the exit point (hot-potato routing: hand the traffic off as soon as possible).

6. Tie-breakers such as the oldest path or lowest router ID.

BGP does not see latency, congestion or packet loss. A path that is short in AS hops may be long in kilometres, which is one reason large content providers add their own measurement-driven traffic engineering on top of BGP.

Diagram of a data centre network, AS 64500, connected to two transit providers, AS 100 and AS 200, and to a peer, AS 300, at an exchange point. A destination prefix 203.0.113.0/24 is originated by AS 400. Three paths are shown: via AS 100 with path 100 500 400, via AS 200 with path 200 400, and via the peer AS 300 with path 300 400. Local preference values are marked: 100 for each transit and 200 for the peer. The chosen path through the peer is highlighted.
Local preference is compared before AS path length, so policy outranks distance.

Worked problem

Which path wins?

A data centre AS receives the prefix 203.0.113.0/24 from transit A with AS path "100 500 400" and local preference 100, from transit B with AS path "200 400" and local preference 100, and from peer C with AS path "300 400" and local preference 200. Which path is chosen? Which would be chosen if the peering session went down?

Show solution
  1. Highest local preference: peer C (200) beats both transits (100). Path via C is chosen.
  2. Without C, both transits have local preference 100, a tie.
  3. Shortest AS path: B has 2 ASes, A has 3. Path via B is chosen.

Answer: Traffic goes via the peer, which is free, and fails over to transit B, which has the shorter AS path. The operator expressed the business preference (peer before transit) with local preference, and BGP handled the rest.

Steering inbound traffic

Local preference controls how traffic leaves an AS. Controlling how traffic arrives is harder, because other networks make that choice. Operators use several tools:

  • AS-path prepending: announcing a prefix with its own ASN repeated, such as "64500 64500 64500", over a less preferred link so that the path looks longer to others.
  • More-specific prefixes: announcing a /24 over one link and the covering /23 over both. Routers always prefer the most specific matching prefix, so traffic for the /24 arrives on the first link while the /23 provides a backup.
  • BGP communities: tags attached to announcements that ask a provider to take actions, such as lowering local preference in its network, not announcing the route to certain peers, or dropping traffic to an attacked address (blackholing, Lesson 4).

When routing goes wrong

BGP was designed in an era of trust: by default a router believes what its neighbours announce. That makes the internet vulnerable to two kinds of incident:

  • Route hijacks: an AS announces prefixes it does not own, accidentally or deliberately, attracting traffic meant for someone else. In February 2008 Pakistan Telecom, trying to block YouTube domestically, announced a more-specific route for YouTube's addresses; it leaked to the world and took YouTube offline globally for about two hours.
  • Route leaks: an AS passes routes learned from one provider or peer to another, against policy, so that traffic is pulled through a network that cannot carry it. In June 2019 a small ISP in Pennsylvania leaked thousands of more-specific routes, generated by route-optimization software, to a large transit provider that accepted and propagated them, disrupting access to major services for hours.

Defences have improved steadily:

  • Prefix filtering: providers accept from each customer only the prefixes that customer is registered to announce, built from internet routing registry data.
  • RPKI (Resource Public Key Infrastructure): address holders publish signed Route Origin Authorizations (ROAs) stating which ASN may originate each prefix. Routers performing route origin validation reject announcements that conflict with a ROA. By 2025 about half of IPv4 routes were covered by ROAs, and most large networks reject invalid routes.
  • Maximum-prefix limits shut down a session if a neighbour suddenly announces far more routes than expected.
  • MANRS (Mutually Agreed Norms for Routing Security) is an industry program in which networks commit to filtering, anti-spoofing, coordination and validation.

RPKI validates who may originate a prefix but not the rest of the path; work on path validation (such as ASPA, Autonomous System Provider Authorization) continues.

Worked problem

Checking an announcement against RPKI

A ROA says AS 64500 may originate 198.51.100.0/22 with a maximum length of /23. Classify each announcement: (a) 198.51.100.0/22 from AS 64500; (b) 198.51.100.0/23 from AS 64500; (c) 198.51.100.0/24 from AS 64500; (d) 198.51.100.0/22 from AS 64999.

Show solution
  1. (a) Correct origin, length /22 within maximum /23: valid.
  2. (b) Correct origin, /23 within maximum: valid.
  3. (c) Correct origin, but /24 is longer than the maximum /23: invalid.
  4. (d) Wrong origin AS: invalid.

Answer: (a) and (b) are valid; (c) and (d) are invalid and would be rejected by networks performing route origin validation. The maximum length matters: a ROA that allowed /24s the operator never announces would let a hijacker announce a more-specific /24 with a forged origin and still look valid, so ROAs should be no looser than needed.

DNS and anycast

Users reach services by name, so DNS (Lesson 4) is the first step of nearly every connection. A user's device asks a recursive resolver (run by the ISP, the enterprise or a public service), which queries the root servers, then the servers for the top-level domain (such as .ca or .com), then the domain's authoritative servers, caching each answer for its time to live (TTL).

DNS is a natural fit for anycast: the same IP address is announced by BGP from many locations, and each user's traffic goes to the nearest one in routing terms. The 13 root server identities (A to M) are served by more than 1,500 anycast instances around the world, and large public resolvers and authoritative DNS providers work the same way. Anycast spreads load, shortens distances and absorbs DDoS attacks, because each instance takes only the attack traffic from its own region.

DNS is also a traffic-steering tool. Authoritative servers can return different addresses to different users, directing each to a nearby or healthy data centre (global server load balancing). Short TTLs let operators shift traffic quickly during a failure, at the cost of more queries.

Content delivery networks

A content delivery network (CDN) is a distributed system of cache servers placed in many cities, often inside ISPs' networks and at exchange points, that stores copies of popular content close to users. When a user requests an image, video segment or software update, the CDN serves it from a nearby cache if it has it (a hit) and fetches it from the origin data centre if it does not (a miss).

  • Users get lower latency and higher throughput, because the content travels a short distance (Lesson 2).
  • The origin data centre serves only the misses, so it needs far less capacity and transit.
  • ISPs save on long-haul and transit capacity by hosting caches inside their networks.

Most internet traffic by volume, especially video, is now delivered from CDNs and from the caches that the largest content providers place directly in ISP networks. The same edge sites increasingly run application code, security services and DDoS protection (Lesson 4).

Map-style diagram with an origin data centre in the centre connected by long-haul links to five edge cache sites in different cities. Users connect to their nearest edge site. A legend shows that 92 percent of requests are served from the edge as hits and 8 percent travel back to the origin as misses.
A CDN serves most requests from nearby caches and sends only misses to the origin.

Worked problem

What a CDN saves

A video service peaks at 2.5 Tb/s of delivered traffic. Its CDN achieves a byte hit ratio of 92%. (a) How much traffic must the origin serve at peak? (b) If the hit ratio improves to 96%, by what factor does origin traffic fall?

Show solution
  1. (a) Misses: \((1 - 0.92) \times 2.5 = 0.20\) Tb/s = 200 Gb/s.
  2. (b) At 96%: \(0.04 \times 2.5 = 0.10\) Tb/s = 100 Gb/s, half as much.

Answer: The origin serves 200 Gb/s instead of 2.5 Tb/s, and raising the hit ratio from 92% to 96% halves it again. Small gains in hit ratio have large effects on origin capacity, which is why CDNs work hard on cache size, placement and the popularity of what they store.

The enterprise WAN

Enterprises connect offices, factories, stores and data centres with wide-area networks (WANs). Two approaches dominate.

MPLS VPNs

A carrier's MPLS (Multiprotocol Label Switching) network carries each customer's traffic in a separate layer 3 VPN: the customer's sites exchange routes with the carrier, which keeps them in a per-customer VRF (Lesson 4) and forwards packets by short labels across its backbone. MPLS VPNs offer predictable performance, QoS classes for voice and video, and service-level agreements, but are relatively expensive per megabit and slow to order and change.

SD-WAN

Software-defined WAN (SD-WAN) builds encrypted tunnels between sites over any mix of transports, typically ordinary broadband internet, fixed wireless or cellular, and sometimes MPLS. Edge devices at each site measure the latency, jitter and loss of every path continuously and steer each application over the best one, failing over in under a second. Central controllers push policy to all sites. SD-WAN has largely displaced pure MPLS for branch offices because it is cheaper, quicker to deploy and can send cloud-bound traffic directly to the internet instead of back through a central data centre.

Diagram of a branch office with an SD-WAN edge device connected to two internet links, broadband and cellular, and an MPLS link. Encrypted tunnels run over each link to the corporate data centre and directly to cloud providers. A small table shows live measurements: broadband 18 milliseconds and 0.1 percent loss, cellular 45 milliseconds and 0.5 percent loss, MPLS 22 milliseconds and 0 percent loss. Voice is steered to MPLS, web traffic to broadband.
SD-WAN measures every path and steers each application over the best one.

Worked problem

Availability of a dual-link branch

A branch has a broadband link with 99.5% availability and a cellular link with 99.0% availability, failing independently. With SD-WAN failover, what is the availability of connectivity? How many hours a year is the branch offline, compared with broadband alone?

Show solution
  1. Probability both are down: \((1 - 0.995) \times (1 - 0.990) = 0.005 \times 0.010 = 0.00005\).
  2. Availability: \(1 - 0.00005 = 99.995\%\).
  3. Offline time: \(0.00005 \times 8{,}760 = 0.44\) h per year, versus \(0.005 \times 8{,}760 = 43.8\) h with broadband alone.

Answer: 99.995%, about 26 minutes offline per year instead of about 44 hours. The calculation assumes independent failures; if both links share the same building entrance or the same utility pole, a single event can take out both (Lesson 7), so physical diversity matters as much as the number of links.

Enterprises increasingly combine SD-WAN with cloud-delivered security services (an approach often called SASE, secure access service edge), so that branch and remote users connect to nearby security points of presence rather than back-hauling traffic to a central firewall.

Common mistakes

  • MistakeAssuming BGP picks the fastest path.

    InsteadBGP follows policy (local preference) and AS-path length; it does not measure latency or loss.

  • MistakeAccepting any route a customer or peer announces.

    InsteadFilter prefixes, set maximum-prefix limits and validate origins with RPKI.

  • MistakePublishing ROAs with a looser maximum length than needed.

    InsteadSet maximum length to what is actually announced to avoid forged-origin sub-prefix hijacks.

  • MistakeSetting very long DNS TTLs on records used for failover.

    InsteadUse TTLs short enough to shift traffic within the required recovery time.

  • MistakeCounting two WAN links as redundant without checking their physical paths.

    InsteadMake sure links do not share entrances, poles or upstream facilities.

Summary and key terms

  • The internet is more than 75,000 autonomous systems exchanging routes with BGP.
  • BGP chooses by policy first (local preference), then AS-path length and further tie-breakers.
  • Prepending, more-specific prefixes and communities steer inbound traffic.
  • Hijacks and leaks exploit BGP's trust; filtering, RPKI, max-prefix limits and MANRS defend against them.
  • DNS and anycast direct users to nearby, healthy instances.
  • CDNs serve most content from nearby caches; the byte hit ratio sets origin load.
  • MPLS VPNs give predictable carrier WANs; SD-WAN steers traffic over many transports.
Autonomous system
An independently operated network with its own routing policy and ASN.
AS path
The list of ASes a route announcement has passed through.
Local preference
An operator-set value expressing which exit path is preferred.
AS-path prepending
Repeating an ASN to make a path look longer.
Route hijack
Announcing prefixes one does not hold.
Route leak
Propagating routes against routing policy.
RPKI
A system of signed records that say which AS may originate a prefix.
Anycast
Announcing one address from many locations so users reach the nearest.
CDN
A distributed network of caches that serves content close to users.
SD-WAN
A WAN built from encrypted tunnels over many transports, steered by measured performance.

Practice problems

Work each problem on paper first, then reveal the answer to check.

  1. Which regional internet registry serves Canada and the US?

    Show answer

    ARIN.

  2. Two paths: local preference 150 with AS path length 4, and 100 with length 1. Which wins?

    Show answer

    The local preference 150 path.

  3. How can an AS make one inbound link less attractive?

    Show answer

    Prepend its ASN on announcements over that link (or use communities).

  4. Why did the 2008 YouTube hijack spread so widely?

    Show answer

    The announcement was more specific than YouTube's own, and routers prefer the most specific prefix.

  5. ROA: 192.0.2.0/24, AS 65010, max length /24. Is 192.0.2.0/25 from AS 65010 valid?

    Show answer

    No; it exceeds the maximum length.

  6. What does a short DNS TTL allow?

    Show answer

    Faster redirection of traffic, at the cost of more queries.

  7. Peak demand 800 Gb/s, byte hit ratio 95%. Origin traffic?

    Show answer

    40 Gb/s.

  8. Main advantage of MPLS VPNs?

    Show answer

    Predictable performance with QoS and service-level agreements.

  9. Two independent links of 99.9% each. Combined availability?

    Show answer

    99.9999%.

  10. What does SASE combine?

    Show answer

    SD-WAN with cloud-delivered security services.

Lesson quiz · 5 questions

Score 60% or more to complete this lesson.

Take the quiz