Module 17 of 45 · Applied

How routing and forwarding really differ

27 min 4 outcomes Scenario quiz

By the end of this module you will be able to:

  • Explain the difference between the control plane (routing) and the data plane (forwarding)
  • Describe longest prefix match and how a router selects between overlapping routes
  • Explain what BGP hijacking is and why it is possible
  • Classify a BGP announcement as valid, invalid or not-found under RPKI Route Origin Validation and say what a validating router does with each

Real-world incident · February 24, 2008

Pakistan Telecom BGP hijack: how a routing announcement took YouTube offline globally

On February 24, 2008, Pakistan Telecom (PTCL) was instructed by the Pakistan Telecommunications Authority to block YouTube within Pakistan. To implement the block, PTCL announced a route for YouTube's IP prefix, 208.65.153.0/24, redirecting traffic to a null route inside Pakistan.

The problem was that PTCL's upstream provider, PCCW, accepted the announcement and propagated it to the global routing table. Within minutes, routers around the world had a route to 208.65.153.0/24 pointing toward Pakistan. The /24 prefix was more specific than YouTube's own /22 announcement. rules meant the /24 won everywhere. YouTube's traffic globally was redirected to Pakistan, where PTCL discarded it.

The incident lasted approximately two hours before the route was withdrawn. It illustrates a fundamental property of BGP: the protocol is built on trust. Any that announces a prefix can, if its upstream accepts it, attract traffic for addresses it does not own.

YouTube's servers were running. The internet was functioning. Pakistan Telecom accidentally took the site offline for two hours worldwide. What mechanism could allow that?

Routing decides paths; forwarding moves packets

The planes run on different clocks, minutes on the left and microseconds on the right, and only the compile arrow joins them, so a route can already be correct in the RIB while packets keep following a FIB entry that has not been pushed yet.

Routing builds knowledge; forwarding spends it. A router can hold a route and still drop a packet because the two planes answer different questions on different clocks.

Every router runs two planes on two different clocks Two side-by-side plane regions fill the canvas. The left plane (white) is Plane 1 Control, carrying three stacked blocks top to bottom: Routing protocol input (minutes/seconds tag), Best-path selection, and RIB (Routing Information Base, emphasised). The right plane (light red, emphasised) is Plane 2 Data, carrying three stacked blocks top to bottom: FIB (Forwarding Information Base, emphasised, microseconds tag), Packet lookup, and TTL decrement and rewrite. A diagonal arrow labelled COMPILE / push FIB crosses from the control plane RIB block to the data plane FIB block. A footer names the two clocks and the two questions each plane answers. PLANE 1: CONTROL Builds the routing table MINUTES / SECONDS Routing protocol input BGP updates, OSPF LSAs, static config Best-path selection policy, AD, metric, longest prefix RIB (Routing Information Base) candidate routes per destination PLANE 2: DATA Moves each packet MICROSECONDS FIB (Forwarding Information Base) selected route per destination, often in ASIC Packet lookup longest prefix match on dst IP TTL decrement and re-write L2 rewrite, send out egress interface COMPILE push FIB Two clocks, two questions. The control plane asks "what is the network?" The data plane asks "what do I do with this packet, now?"

Forwarding chooses the longest matching prefix

Forwarding counts specified bits and nothing else: the twenty four bit route wins over the twenty two bit route that legitimately covers the address, and prefix length settles the match with no check on who announced it.

Longest prefix match counts how many leading bits the route specifies. The route with the most specified bits wins, regardless of how it was learned.

Longest prefix match: more specified bits win A target 32-bit IP address 208.65.153.45 (YouTube during the 2008 PTCL incident) appears at the top with all bits shown as red-soft cells. Below it, four route rows show the same 32-bit grid. The default route 0.0.0.0/0 has zero filled bits (deemphasised). The YouTube 208.65.152.0/22 fills 22 bits in brand-red. The PTCL 208.65.153.0/24 fills 24 bits in brand-red and is emphasised with PTCL HIJACK: WINS. A non-matching 10.0.0.0/8 row has filled bits in neutral grey to show 'matched bits but disqualified'. A footer paragraph names the 2008 incident. TARGET 208.65.153.45 (destination) 1 1 0 1 0 0 0 0 0 1 0 0 0 0 0 1 1 0 0 1 1 0 0 1 0 0 1 0 1 1 0 1 0.0.0.0/0 /0 bits specified 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 FALLBACK 208.65.152.0/22 /22 bits specified 1 1 0 1 0 0 0 0 0 1 0 0 0 0 0 1 1 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 YOUTUBE LEGITIMATE 208.65.153.0/24 /24 bits specified 1 1 0 1 0 0 0 0 0 1 0 0 0 0 0 1 1 0 0 1 1 0 0 1 0 0 0 0 0 0 0 0 PTCL HIJACK: WINS 10.0.0.0/8 /8 bits specified 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 NO MATCH 2008: PTCL announced 208.65.153.0/24. YouTube's own 208.65.152.0/22 was less specific. Every router with both routes picked the /24.

Traceroute is path evidence, not path proof

Each row is one interface that answered a TTL or Hop Limit expiry, so the starred hops record silence rather than loss, and every RTT includes a return path the table never shows, which is why hop six can jump without anything on the forward path being wrong.

A traceroute row is a forward-path probe that returned an ICMP TTL-expired from one interface. Stars, MPLS hops, and asymmetric returns mean the output is evidence to interpret, not a complete map.

Read a traceroute row by row: what it shows, what it hides A five-column traceroute table with eight hop rows. Columns: HOP (TTL number), RESPONSE (IP or stars), REVERSE DNS, RTT, SIGNAL (what the row tells you). Hop 1 local gateway. Hop 2 ISP-facing interface. Hop 3 MPLS-tunnelled core. Hop 4 stars (emphasised) caused by rate-limited or filtered ICMP, not a drop. Hop 5 IX exchange point. Hop 6 RTT jump suggesting asymmetric return path. Hop 7 stars (deemphasised) because the destination AS filters ICMP. Hop 8 destination (emphasised). A footer reminds the reader that stars are silence and RTT includes the reverse path. HOP RESPONSE REVERSE DNS RTT SIGNAL: what this row tells you 1 192.168.1.1 home-gateway.local 1 ms your local router answered 2 10.55.0.1 ge-0-0-1.cust.isp.net 8 ms ISP CPE-facing interface 3 172.16.4.7 mpls-core1.isp.net 9 ms MPLS label seen via RFC 4884 (tunnel hop) 4 * * * (no reply) - rate-limited or ICMP filtered, not a drop 5 203.0.113.42 peer-ix.london.aspath 14 ms exchange point; outgoing interface only 6 198.51.100.5 edge-1.dst-as.net 33 ms RTT jumps: return path may differ 7 * * * (filtered) - destination AS drops TTL-expired replies 8 93.184.216.34 destination 35 ms final reachable host (this run only) Stars are silence, not always drops. RTTs include the reverse path. MPLS hops may be hidden. Read each row before drawing a path.

15.1 Control plane and data plane

The distinction between routing and forwarding is a distinction between two planes in a network device: the control plane and the data plane.

The control plane is where routing decisions are made. It builds and maintains the routing table by running routing protocols (BGP, OSPF, static configuration) or receiving external route information. The control plane operates on minutes to seconds timescales. It is computationally expensive and relatively slow.

The data plane (also called the forwarding plane) handles individual packets. For each packet, the router reads the destination IP address, looks it up in the forwarding table (derived from the routing table), and sends the packet out the appropriate interface. The data plane operates on microsecond timescales and is often implemented in dedicated hardware (ASICs) for line-rate performance.

Routing is how the router learns what it knows. Forwarding is what the router does with that knowledge for each packet. A routing protocol problem and a forwarding table problem are not the same fault.

Because the two planes are separable, the routing table can be filled by completely different means without the forwarding behaviour changing at all. A router does not care whether an entry was typed by an engineer or learned from a neighbour thirty seconds ago; it looks the entry up either way. What differs is how quickly the table notices that the world has moved.

15.2 Static routes and dynamic routing protocols

A static route is manually configured: the network administrator tells the router "to reach network X, send packets to next hop Y." Static routes are simple and predictable but do not respond to topology changes. If the next hop fails, the static route remains in the table and packets continue being sent to a dead path.

Dynamic routing protocols allow routers to discover, share, and update routes automatically. Two major protocol families are relevant for this module.

OSPF (Open Shortest Path First), defined in RFC 2328, is a link-state interior gateway protocol. Routers using OSPF exchange Link State Advertisements (LSAs) describing their connected networks and link costs. Each router builds a complete map of the network and runs Dijkstra's algorithm to compute the shortest path to each destination. OSPF is used within a single organisation's network.

BGP (Border Gateway Protocol), defined in RFC 4271, is the exterior gateway protocol that interconnects autonomous systems across the internet. An autonomous system (AS) is a network under a single administrative control with a unique AS number. BGP carries path attributes, not just metrics. Route selection considers factors including AS path length, local preference, and origin type.

The Border Gateway Protocol (BGP) is an inter-Autonomous System routing protocol. The primary function of a BGP speaking system is to exchange network reachability information with other BGP systems.

RFC 4271 - Section 1, Introduction

BGP's word 'reachability' is important. BGP does not optimise for speed or quality. It exchanges information about which networks are reachable via which path. A BGP speaker can advertise routes for any prefix it wishes, subject only to the policies of its peers accepting those advertisements.

OSPF and BGP both end up writing entries into the same table, and those entries routinely overlap: a /16 learned from one source and a /24 covering part of it learned from another. The data plane needs one deterministic answer for every packet, and it gets it from a rule that ignores which protocol supplied the entry.

15.3 Longest prefix match

When a router's forwarding table contains multiple entries that could match a destination address, it uses the most specific match: the entry with the longest prefix (the most bits specified). This is longest prefix match.

Consider a router with two entries for the 10.0.0.0 space: one for 10.0.0.0/16 via interface A, and one for 10.0.1.0/24 via interface B. A packet for 10.0.1.5 matches both entries (10.0.1.5 is within 10.0.0.0/16 and within 10.0.1.0/24). The /24 entry is more specific, so the router forwards the packet via interface B.

This rule is why the Pakistan Telecom incident worked. YouTube's own /22 route was less specific than PTCL's /24 announcement. Every router in the world with both routes in its table chose the /24, because that is the rule, regardless of which announcement was legitimate.

The quiz at the end of this module asks: two routes to 10.0.0.0, one via /16 and one via /24. The answer is always the /24. More specific always wins in longest prefix match, regardless of which path is "better" by other measures.

If the most specific prefix always wins, the least specific one is the interesting edge case: the entry that matches every address and therefore only ever gets used when nothing else does.

15.4 The default gateway and default route

The default gateway is the router a host sends packets to when it has no more specific route for the destination. On a home network, this is typically your router. Your laptop has routes for the local subnet and a default route pointing at the router for everything else.

In routing tables, the default route is written as 0.0.0.0/0. It matches every destination address (since every address starts with zero matching bits), but it is also the least specific possible prefix. Any more specific route will override it via longest prefix match. The default route only handles destinations with no other match.

Everything to this point describes how a router acts on the routes it holds. It says nothing about whether those routes are true. Inside one organisation that gap is closed by the fact that one team configures every router. Between organisations there is no such team, which is the problem the rest of this module deals with.

15.5 The inter-domain trust problem, 2026 state

BGP-4, specified in RFC 4271, has no mechanism for deciding whether an announcement is truthful. A router that receives an UPDATE checks that the message is well formed and that its own policy permits the neighbour, then it believes what the neighbour said about which prefixes it can reach. That is the design. The Pakistan Telecom incident was not an exploit of a flaw; it was BGP working exactly as specified on an announcement nobody had any way to check.

The check now exists. , specified in RFC 6811, gives a router a way to test an announcement against a signed statement from the address holder. The address holder publishes a in the Resource Public Key Infrastructure: a cryptographically signed record naming the prefix, the maximum prefix length permitted, and the autonomous system authorised to originate it. Routers fetch the validated set of these records and compare every announcement against it.

The comparison produces one of three states. Valid means a ROA covers the prefix and the announcing AS is the authorised origin. Invalidmeans a ROA covers the prefix but the origin AS is wrong or the announcement is more specific than the ROA's maximum length. NotFound means no ROA covers the prefix at all, which is the honest answer for address space whose holder has never published one. RFC 6811 deliberately stops there and leaves the action to local policy. The operational norm that has settled around it is to reject Invalid announcements outright, to accept Valid ones, and to accept NotFound because rejecting it would disconnect every network that has not yet signed its space.

An announcement like PTCL's is Invalid today wherever the prefix holder has published a ROA, because the origin AS in the announcement is not the one the signed record authorises, and a validating router drops it before it can spread. That is a real improvement and a bounded one. ROV checks the origin of a route, not the AS path attached to it, so an attacker who forges a plausible path with the correct origin still passes validation. Path validation is a separate and far less deployed problem.

The adoption figures are what make this teachable as engineering rather than as a story about a bad day in 2008. Reading the NIST RPKI Monitor in July 2026, ROAs now cover more than half of the IPv4 routes in the global table, from a published set of roughly 480,000 ROAs. The same measurement exposes the gap: only about 12 percent of stub autonomous systems, the networks at the edge that originate their own space and transit nobody, are fully protected. Signing your prefixes and validating what you accept are two separate acts, and the edge of the internet has done far less of either than the core has.

For an operator, that turns routing security into two checkable questions rather than a warning. Has this organisation published ROAs for every prefix it originates, at the right maximum length so its own more specific announcements do not read as Invalid? And does it reject Invalid routes at every peering session, rather than logging them? Both have answers you can produce from a configuration and a monitor, which is what a measurable partial fix looks like.

Route Origin Validation now checks most of the internet's routes

The gate has three exits and only one of them rejects anything, so every route still outside the validated set leaves through NotFound unchecked, and even a Valid verdict tests which network claims the prefix rather than the path it travelled.

Route Origin Validation (RFC 6811) is a measurable partial fix: the NIST RPKI Monitor puts ROAs over more than 50 percent of IPv4 routes, roughly 480,000 of them, while only about 12 percent of stub ASes are fully protected.

Route Origin Validation now checks most of the internet's routes A gate board. A BGP announcement arrives carrying a prefix and the autonomous system claiming to originate it, which BGP-4, RFC 4271, cannot test. A labelled arrow leads to the gate: Route Origin Validation, RFC 6811, checks it against the validated set of Route Origin Authorisations. Three labelled paths leave the gate. Valid is accepted, Invalid is rejected before it can spread, NotFound is accepted although nothing has checked it. A closing card notes the origin is checked but the AS path is not, and two chips from the NIST RPKI Monitor give the coverage and the gap. AN ANNOUNCEMENT ARRIVES A neighbour says it originates this prefix It carries a prefix and the autonomous system number that claims to originate it. BGP-4, RFC4271, gives the receiving router no way at all to test that claim. THE GATE: ROUTE ORIGIN VALIDATION, RFC 6811 Check the announcement against the validated ROA set A Route Origin Authorisation is a signed record naming the prefix, the longest prefix lengthpermitted, and the AS authorised to originate it. Routers fetch the validated set andcompare every announcement against it. VALIDATION STATE Valid VALIDATION STATE Invalid VALIDATION STATE NotFound WHAT IT MEANS A ROA covers the prefix andthe announcing AS is theauthorised origin. WHAT IT MEANS A ROA covers the prefix, butthe origin AS is wrong orthe announcement is morespecific than the ROAallows. WHAT IT MEANS No ROA covers the prefix atall, the honest answer foraddress space nobody hassigned. ROUTER ACTION Accept it. The route joinsthe table like any other. ROUTER ACTION Reject it. The route isdropped before it canspread. ROUTER ACTION Accept it. Rejecting wouldcut off everyone yet tosign. A MEASURABLE PARTIAL FIX The origin is checked; the path is not RFC 6811 defines the three states and leaves the action to local policy; the actions aboveare the norms operators settled on. Validation tests the origin of a route, not the AS pathattached to it, so a forged path with the right origin still passes. COVERAGE, NIST RPKI MONITOR More than 50 percent of IPv4 routes arecovered by a ROA, from roughly 480,000published ROAs. THE REMAINING GAP Only about 12 percent of stub autonomoussystems, the networks at the edge, are fullyprotected. the claim needs testing, not trusting ROA matches the origin ROA exists, origin wrong no ROA covers it accepted as authorised dropped before it spreads accepted, still unchecked

Common misconception

Routers choose the best path for each packet.

Routers forward each packet using a forwarding table built by the routing protocol. The routing protocol runs on the control plane and selects paths based on protocol-specific metrics and policies. For each individual packet, the router simply does a forwarding table lookup and sends it out the matching interface. The per-packet decision is a lookup, not a fresh route calculation.

15.6 Check your understanding

A router has two routes: 10.0.0.0/16 via interface A and 10.0.0.0/24 via interface B. A packet arrives for 10.0.0.5. Which interface does the router use?

What is the difference between a routing table and a forwarding table?

In the 2008 Pakistan Telecom incident, PTCL announced a /24 prefix for YouTube's IP space. YouTube had previously announced the same addresses as a /22. Why did PTCL's route win globally?

Your router receives an announcement for 198.51.100.0/24 originated by AS64500. A ROA exists covering 198.51.100.0/22 with a maximum length of /22, authorising AS64511. What is the validation state, and what does a router following the operational norm do?

Core distinctions

  • Routing (control plane) builds and updates the routing table. Forwarding (data plane) uses the forwarding table to make per-packet decisions. These are distinct operations on different timescales.
  • Longest prefix match selects the most specific entry. A /24 always beats a /16 for matching addresses, regardless of other route characteristics.
  • BGP connects autonomous systems across the internet. It is built on trust: any AS can announce any prefix, and upstream providers decide whether to accept and propagate the advertisement.
  • The default route (0.0.0.0/0) matches everything but wins only when no more specific route exists. It is always the least specific possible match.
  • RPKI Route Origin Validation (RFC 6811) tests an announcement against a signed ROA and returns Valid, Invalid or NotFound. The operational norm is to reject Invalid, accept Valid, and accept NotFound.
  • ROV is a measurable partial fix: ROAs now cover more than half of IPv4 routes from roughly 480,000 published records, while only about 12 percent of stub autonomous systems are fully protected. It validates the origin, not the AS path.

Standards and sources cited in this module

  1. RFC 4271, A Border Gateway Protocol 4 (BGP-4)

    Section 1, Introduction; Section 9, UPDATE Message Handling

    Defines BGP. Quoted in Section 15.2 for the description of BGP as an inter-AS routing protocol, and the basis for Section 15.5: nothing in the specification lets a router test whether an announcement is truthful.

  2. RFC 2328, OSPF Version 2

    Section 1, Introduction; Section 4.1, Routing Protocol Overview

    Defines OSPF for IPv4. Referenced in Section 15.2 for the link-state protocol description and LSA mechanism.

  3. RFC 6811, BGP Prefix Origin Validation

    Section 2, Validation States; Section 3, Policy Configuration

    Defines Route Origin Validation and the Valid, Invalid and NotFound states used in Section 15.5, and leaves the action taken on each state to local policy.

  4. NIST RPKI Monitor

    IPv4 route and ROA coverage measurements

    The measurement source for the adoption figures in Section 15.5: ROA coverage of IPv4 routes, the published ROA count, and the share of stub autonomous systems fully protected.

  5. RIPE NCC: YouTube Hijacking: A RIPE NCC RIS case study

    Published February 2008

    Technical analysis of the Pakistan Telecom BGP hijack. Used as the opening case study and for the /22 versus /24 prefix details.

  6. Cisco CCNA 200-301 v1.1 Exam Topics

    Section 3.0: IP Connectivity, routing protocols

    Longest prefix match and routing protocol distinctions are examined in the CCNA IP Connectivity objective.

Routing decides which network a packet is sent towards, and ROV decides whether the announcement that produced that decision can be believed. Neither touches the addresses inside the packet. The next module does: NAT rewrites them at the border, keeps a state table to match the replies, and in doing so breaks the assumption that a device has one address the rest of the internet can reach.

Module 17 of 45 · Applied stage