The idea
Learning a path with BGP is only half the job. A router inside an AS still has to turn “the route to X goes through gateway 1c” into an actual forwarding decision — which physical interface a packet for X leaves on. And once more than one path exists, something has to pick between them, and that something is allowed to care about the AS’s own priorities as much as about which path is objectively shortest.
How it works
BGP path advertisement — propagation
The lecture works through path propagation across three ASes:
- AS2 router
2creceives path advertisementAS3, X(via eBGP) from AS3 router3a. - Based on AS2’s policy,
2caccepts pathAS3, Xand propagates it (via iBGP) to all AS2 routers. - Based on AS2’s policy, AS2 router
2athen advertises (via eBGP) pathAS2, AS3, Xonward to AS1 router1c.
How it works
Multiple path learning
A gateway router can end up hearing about the same destination more than once, from different directions. In the lecture’s example:
- AS1 gateway router
1clearns pathAS2, AS3, Xfrom2a. - AS1 gateway router
1calso learns pathAS3, Xdirectly from3a. - Based on policy,
1cchooses pathAS3, X(the shorter of the two) and advertises it within AS1 via iBGP.
Worked example
From a learned path to a forwarding table entry
Every router in AS1 has learned, via iBGP from 1c, that the path to X
goes through 1c. How does each router turn that into a forwarding
decision?
Each router already runs its own intra-domain routing (OSPF), which already tells it which interface reaches
1c.At router
1d: OSPF intra-domain routing says “to get to1c, use interface 1.” Since the path toXgoes through1c,1dalso uses interface 1 to get toX.At router
1a: OSPF intra-domain routing says “to get to1c, use interface 2.” So1aalso uses interface 2 to get toX.Resulting forwarding table entries:
Router Destination Interface 1d1c11dX11a1c21aX2
Each router ends up with two entries built the same way — one for the gateway itself, one for the external destination reached through it, both pointing at the same interface.
Answer1d uses interface 1 for both 1c and X; 1a uses interface 2 for both — because each router reuses its own intra-domain interface toward the gateway
How it works
Hot potato routing
Router 2d learns, via iBGP, that it can reach X through either gateway
2a or gateway 2c. Hot potato routing is the rule for choosing
between them: pick whichever local gateway has the least intra-domain
cost to reach, without worrying about the inter-domain (AS-hop) cost at
all.
In the lecture’s own example, 2d chooses 2a — even though 2a is more
AS hops away from X — because reaching 2a costs less inside AS2’s own
network than reaching 2c does. The name reflects the idea: get the
traffic off your own network as quickly as possible, and let the receiving
AS worry about the rest of the journey.
Where marks get lost
Hot potato optimises the wrong thing on purpose
It looks like a bad routing decision to send traffic to the more distant gateway, but hot potato routing is deliberately optimising local cost, not end-to-end cost. Do not describe this as a flaw or an inefficiency in an exam answer — it is the defined behaviour, and the “why” is exactly that inter-domain cost is not this router’s concern.
How it works
Achieving policy purely through advertisements
BGP enforces policy without any extra mechanism beyond controlling what gets advertised to whom.
Example 1 — avoiding transit traffic. Provider network A advertises
path A, w to both provider B and provider C. B chooses not to
advertise B, A, w onward to C. The reasoning: B gets no “revenue” for
routing C, B, A, w, since none of C, A, or w are B’s customers —
this is a typical real-world ISP policy of only routing traffic to and from
its own customers. As a result, C never learns about the C, B, A, w
path, and instead routes to w via C, A, w directly, without going
through B at all.
Example 2 — a dual-homed customer refusing transit. Networks A, B
and C are providers; x, w and y are their customers. x is
dual-homed, meaning it is attached to two provider networks at once. The
policy x wants to enforce: it does not want to route traffic from B to
C via itself. x achieves this the same way — it simply does not
advertise to B a route to C.
How it works
BGP route selection
A router may learn more than one route to the same destination AS. BGP selects between them using these criteria, in order:
- Local preference value attribute — a policy decision.
- Shortest AS-PATH.
- Closest NEXT-HOP router — this is hot potato routing.
- Additional criteria.
Check yourself
- A router turns a learned BGP path into a forwarding entry by reusing its own intra-domain route to the relevant gateway.
- Hot potato routing picks the local gateway with the least intra-domain cost, ignoring AS-hop count entirely.
- Policy is enforced simply by choosing not to advertise a route onward — no separate blocking mechanism is needed.
- Route selection order: local preference, then shortest AS-PATH, then closest NEXT-HOP (hot potato), then additional criteria.
In the exam
- Trace the two-step forwarding logic exactly: iBGP tells a router which gateway leads to a destination; the router’s own intra-domain protocol tells it which interface leads to that gateway; the destination inherits that same interface.
- State hot potato routing’s rule precisely — least intra-domain cost to the gateway, inter-domain cost ignored — and be ready to explain why that is not a mistake.
- Both policy examples reduce to the same trick: withhold an advertisement, and the neighbour that never learns a route can never use it. No firewall or filter is needed.
- Memorise the route selection order. A question can give you two candidate routes and ask which wins — work down the list from local preference first, not straight to AS-PATH length.