BGP ROUTE HIJACKING

A lie propagates globally in minutes

L215 MINNETWORKING
PREDICT

Networks (autonomous systems, ASes) announce the address blocks they can reach to their neighbours. AS300 has 203.0.112.0/22 via AS100 (path length 1) and 203.0.113.0/24 via AS200 (path length 1). Where does it send a packet for 203.0.113.10?

Autonomous systems (ASes) tell their neighbours which prefixes they can reach, and the neighbours pass that on. Plain BGP never checks that the AS at the end of the path owns the prefix. Every router also forwards by longest-prefix match: if it knows both a /22 and a /24 that contain the destination, the /24 wins. So an attacker who announces a /24 carved out of your /22 pulls that slice of your traffic, even if its path is longer.

RPKI lets the address holder publish a signed ROA: “this prefix, origin AS100, no longer than /22”. Routers doing route origin validation drop announcements the ROA makes INVALID.

▶ SIMULATION
AS100 VICTIM
RIB empty
AS200 ATTACKER
RIB empty
AS300 TRANSIT
RIB empty
AS400 USER ISP
RIB empty
AS400 lookup 203.0.113.10no route
forwarding pathAS400 (no route)
UPDATEs in flightnone
last—
✓ traffic for 203.0.113.10 reaches the legitimate origin AS100
SCHEDULE
01[AS100]AS100 originates 203.0.112.0/22
02[NET]UPDATEs move one hop (round 1)
03[NET]UPDATEs move one hop (round 2)
04[NET]UPDATEs move one hop (round 3)
05[USER]user in AS400 sends a packet to 203.0.113.10
Start of normal scenario. 5 steps.
! AS300 accepts whatever its customer announces
router bgp 300
  neighbor 10.0.0.2 remote-as 200
  ! no prefix filter, no origin validation
!
! AS200 announces 203.0.113.0/24. AS100 owns 203.0.112.0/22.
! Every router that learns the /24 forwards 203.0.113.x to AS200:
! longest-prefix match prefers /24 over /22, whatever the AS_PATH.

Watch the forwarding path and the invariant strip. In HIJACK the invariant breaks the moment AS300 learns the /24, before AS400 has even heard of it. In FIX: RPKI ROV the same announcement is rejected at AS300. ROV vs FORGED ORIGIN shows why maxLength matters: the forged path names AS100 as origin, and the /24 is still INVALID.

BREAK IT NOT YET

No AS here validates anything. Inject AS200's /24 announcement at a point where the user's packet for 203.0.113.10 still ends up at AS200.

GOAL: the packet for 203.0.113.10 is delivered to AS200

FIX IT NOT YET

Implement RPKI route origin validation. Return 'valid' if some ROA covers the announced prefix, names its origin AS, and allows its length (len <= maxLength); 'invalid' if some ROA covers it but none match; 'not-found' if no ROA covers it. A ROA covers a prefix when the prefix is equal to or inside the ROA prefix.

Mental model:

BGP believes what it is told, and forwarding always prefers the most specific prefix. A hijacker does not need a better path, only a longer prefix. Route origin validation turns “trust the announcement” into “check it against the holder’s signed ROA”, and the ROA’s maxLength is what stops more-specifics. It checks the origin, not the path.

IN PRODUCTION

Route servers and transit providers dropping RPKI-invalid routes, RIR portals where you publish ROAs for your address space, and monitoring that alerts on unexpected more-specifics of your prefixes. The symptom of a hijack is reachability loss or odd latency for one slice of your addresses, with your own servers healthy.

IN INTERVIEWS

“How can someone steal traffic for an IP range they don't own?” Explain announcement, propagation and longest-prefix match. Then explain what RPKI ROV checks (origin AS and maxLength), what it misses (forged paths for an allowed prefix), and why a tight maxLength matters.

RECALL CARDS Tap to flip. They join your review deck when you mark the lesson complete.

USED IN

Chapters that build on this lesson.

NEXT: DNS RESOLUTION →