Outage24 Feb 2008

Pakistan Telecom Hijacks YouTube via BGP

A route meant to block YouTube inside one country leaked to the whole internet and pulled YouTube's traffic to Pakistan.

Severity
Status page turned red
Difficulty
intermediate
Companies
Pakistan Telecom, PCCW Global, YouTube
Tech
BGP, IP routing, Autonomous Systems
Root cause
network control plane, operator mistake

The story

Quick (1 min)

On Sunday 24 February 2008, YouTube became unreachable for much of the internet for about two hours.

Pakistan wanted to block YouTube inside the country. Pakistan Telecom did it by announcing to the network "send YouTube's addresses to us". That announcement was meant to stay inside Pakistan, but an upstream provider, PCCW Global, passed it on to the rest of the internet.

The internet's routing system, BGP, prefers the most specific route it hears. Pakistan's route was more specific than YouTube's own, so routers worldwide started sending YouTube traffic to Pakistan, where it was dropped.

The lesson: internet routing largely runs on trust. One network announcing something it doesn't own can redirect traffic globally unless its neighbours filter it.

Keep reading to the end to earn XP.Read. XP earned.

Engineer (2 min)

BGP in one paragraph. The internet is made of networks called Autonomous Systems (AS). They tell each other which IP address blocks (prefixes) they can deliver using the Border Gateway Protocol. When a router has several routes to an address, it picks the longest (most specific) prefix match first, then applies policy such as the shortest AS path.

Normal state. YouTube (AS36561) announced 208.65.152.0/22, a block of 1,024 addresses that included youtube.com's IPs (208.65.153.238, .251, .253).

The hijack. At 18:47 UTC Pakistan Telecom (AS17557) began announcing 208.65.153.0/24. A /24 is more specific than a /22, so any router that heard it preferred it. Its upstream PCCW Global (AS3491) propagated the announcement. RIPE NCC's data shows it reached its widest spread within two minutes.

YouTube fights back.

  • 20:07 UTC: YouTube also announces the /24. Now two identical prefixes compete, and AS path length decides, so Pakistan still attracts some traffic.
  • 20:18 UTC: YouTube announces two /25s (208.65.153.0/25 and 208.65.153.128/25). These are more specific than the hijacker's /24, so every router that receives them sends traffic to YouTube.
  • 21:01 UTC: PCCW withdraws the prefixes originated by Pakistan Telecom, ending the hijack.

Why it was possible. PCCW didn't filter what its customer could announce. RIPE NCC noted that "appropriate routing configuration by operators" (prefix filters based on routing registries) can stop such announcements from spreading, and pointed to digital certificates for number resources. That idea later became RPKI.

Interview takeaway: BGP trusts announcements by default; route filtering and origin validation are how you contain mistakes.

Keep reading to the end to earn XP.Read. XP earned.

Deep dive (2 min)

Timeline (all UTC, from RIPE NCC's RIS case study)

  • Before the event: YouTube (AS36561) announces 208.65.152.0/22. The /24 208.65.153.0/24 is not announced on the internet.
  • 18:47: AS17557 (Pakistan Telecom) starts announcing 208.65.153.0/24. AS3491 (PCCW Global) propagates it. "Routers around the world receive the announcement, and YouTube traffic is redirected to Pakistan."
  • 18:49: the unauthorised route has reached its largest extent in RIS's view.
  • 20:07: YouTube starts announcing 208.65.153.0/24 itself, about 80 minutes after the hijack began.
  • 20:18: YouTube announces 208.65.153.0/25 and 208.65.153.128/25. Longest prefix match now favours YouTube wherever those routes reach. RIS saw these /25s at far fewer peers (21) than the /24 (105) or /22 (112), because many networks filter prefixes smaller than /24.
  • 20:51: Pakistan's announcements are seen prepended with an extra 17557, a longer AS path, which makes more routers prefer YouTube's route.
  • 21:01: PCCW withdraws all prefixes originated by AS17557. The last unauthorised announcement is received at 21:01:22.

What one router saw

RIPE NCC's own AS3333 had no path to the /24 before 18:47. From 18:47 to 20:52 it reached it via Pakistan Telecom through two paths (3333 6320 3549 3491 17557 and 3333 12859 3491 17557). From 20:52 it used YouTube's path (3333 3356 3549 36561).

Why

RIPE NCC states: "Pakistan aimed to block the YouTube website." Announcing the /24 inside Pakistan would black-hole the traffic locally. The problem was that the announcement escaped to the global routing table through PCCW.

Limits of the data

RIPE NCC cautions that RIS shows collected BGP information, not every router's actual forwarding: "it is not possible to make statements about how many sites had their traffic to YouTube hijacked."

The fix the community pointed to

"Unauthorised announcements like this can be prevented from spreading throughout the Internet by appropriate routing configuration by operators of Autonomous Systems." (RIPE NCC)

RIPE NCC highlighted its Routing Registry for building filters, and discussion of "digital certificates for Internet number resources."

Keep reading to the end to earn XP.Read. XP earned.

Failure replay

Step by step, what broke and what it hit next.

  1. Before
    YouTube AS36561healthy

    YouTube announces 208.65.152.0/22, a block containing its web servers' addresses.

    Affects: Internet routers

  2. 18:47 UTC
    Pakistan Telecom AS17557compromised

    To block YouTube locally, Pakistan Telecom announces the more specific 208.65.153.0/24.

    Affects: PCCW Global AS3491

  3. 18:47 UTC
    PCCW Global AS3491failing

    The upstream provider doesn't filter its customer's announcement and forwards it to the world.

    Affects: Internet routers

  4. 18:49 UTC
    Internet routersfailing

    Longest prefix match picks the /24 over YouTube's /22. Within two minutes the bogus route is at its widest spread.

    Affects: Users

  5. 18:49 UTC
    Usersdown

    Requests for youtube.com flow to Pakistan and disappear.

  6. 20:07 UTC
    YouTube AS36561recovering

    YouTube announces the same /24. With equal prefixes, AS path length decides and some traffic still goes to Pakistan.

    Affects: Internet routers

  7. 20:18 UTC
    YouTube AS36561recovering

    YouTube announces two /25s, more specific than the hijacker's /24, and wins wherever they propagate.

    Affects: Internet routers

  8. 21:01 UTC
    PCCW Global AS3491recovering

    PCCW withdraws Pakistan Telecom's announcements. The hijack ends about two hours and fourteen minutes after it began.

    Affects: Internet routers

  9. 21:23 UTC
    Usershealthy

    Routers now only see paths to YouTube's own network.

Impact

Who was affected
YouTube users across much of the internet whose providers accepted the bogus route; RIPE NCC notes the exact number of affected sites can't be measured from its data.
How long
About 2 hours 14 minutes (18:47 to 21:01 UTC).
Cost
not disclosed

Lessons

  • BGP trusts announcements by default; providers must filter what customers are allowed to announce.
  • The most specific prefix wins. That is how the hijack spread and also how YouTube took its traffic back.
  • A local policy action (blocking a site) can have global effects when routing configuration leaks.
  • Origin validation (route registries, signed certificates such as RPKI) exists to contain exactly this kind of mistake.

Quiz

  1. Why did routers prefer Pakistan Telecom's route over YouTube's own?

    Check answer

    It was a more specific prefix (/24 versus /22). BGP routers use the longest prefix match first. A /24 inside YouTube's /22 beat it everywhere it was heard.

  2. How did YouTube take most of its traffic back at 20:18 UTC?

    Check answer

    By announcing two /25 prefixes, which are more specific than the hijacker's /24. The /25s beat the /24 by longest prefix match wherever they reached, though many networks filter prefixes smaller than /24, so they spread less widely.

  3. What finally ended the hijack at 21:01 UTC?

    Check answer

    PCCW Global withdrew the prefixes originated by Pakistan Telecom. The upstream provider, PCCW Global (AS3491), withdrew Pakistan Telecom's announcements.

  4. What was Pakistan Telecom trying to do?

    Check answer

    Block YouTube within Pakistan. RIPE NCC says Pakistan aimed to block YouTube. The announcement was meant to stay local but leaked globally.

Interview prep

Try answering out loud before you open the model answer.

  1. system design

    Explain how BGP route selection allowed a single ISP to redirect YouTube's global traffic in 2008, and what controls prevent it.

    Show model answer

    Routers choose the longest matching prefix before anything else. YouTube announced a /22; Pakistan Telecom announced a /24 inside it, so routers that heard the /24 preferred it regardless of who really owned the space. PCCW, the upstream provider, didn't filter the customer's announcement, so it spread globally within minutes. Controls: upstreams filter customer announcements against registered routes (IRR-based prefix lists), cryptographic origin validation such as RPKI so routers reject routes from the wrong origin AS, max-prefix limits, and monitoring that alerts when your prefixes appear from an unexpected origin.

    A strong answer hits:

    • Longest prefix match beats AS path and policy
    • Upstream failed to filter customer routes
    • IRR filtering and RPKI origin validation
    • Monitoring and alerting for your own prefixes
  2. debugging

    Your service suddenly becomes unreachable from many networks, but your servers are healthy and your own routes look normal. How do you investigate?

    Show model answer

    Look outside your network. Check public BGP looking glasses and route collectors (like RIPE RIS) for your prefixes. Are they being announced by another origin AS, or are more specific prefixes covering your space? Traceroute from several vantage points to see where traffic ends up. If it's a hijack, a quick mitigation is to announce more specific prefixes yourself (YouTube used /25s), contact the offending network's upstreams to filter or withdraw, and later set up origin validation and monitoring.

    A strong answer hits:

    • Check external routing views, not just internal health
    • Look for unexpected origin AS or more specific prefixes
    • Mitigate with more specific announcements
    • Escalate to upstream providers
  3. behavioural

    Describe a time a change meant for a narrow scope had a much wider impact. How would you prevent it?

    Show model answer

    Use a story where a local change escaped its intended boundary, then link it to guardrails. Pakistan Telecom's block was meant to affect only Pakistan, but nothing at the boundary stopped it leaving. Prevention means explicit scoping (export policies, environment separation), defence at the boundary (the neighbour filters too, not just the sender), and fast detection: YouTube needed about 80 minutes to react.

    A strong answer hits:

    • Changes need explicit scope boundaries
    • Defence in depth at boundaries
    • Detection time matters as much as prevention

Go deeper