Exercise 3: Policy is the app feature
In the BGP twin, make spine2 stop carrying traffic for leaf1, without touching any link.
Can you do the same in OSPF without making other routers re-run SPF?

Answer
BGP: policy on spine2 only (episode 1's DRAIN pattern). A prefix-list matches leaf1's prefixes
(172.16.1.0/24, 10.0.1.1/32); a route-map prepends 65000 three times on those towards leaf2/leaf3,
and a second route-map prepends everything towards leaf1. Longer AS paths via spine2 lose, so
leaf2/leaf3 reach leaf1 only via spine1 and leaf1 sends only via spine1. No SPF anywhere; spine1
sends nothing. (spine2 re-sends its table to the 3 leaves when the outbound policy changes, so the
UPDATE count is not tiny, but it's per-prefix, per-neighbor, and touches nobody else's work.)
    ip prefix-list LEAF1 seq 5 permit 172.16.1.0/24
    ip prefix-list LEAF1 seq 10 permit 10.0.1.1/32
    route-map DRAIN-LEAF1 permit 10
     match ip address prefix-list LEAF1
     set as-path prepend 65000 65000 65000
    route-map DRAIN-LEAF1 permit 20
    route-map PREPEND-ALL permit 10
     set as-path prepend 65000 65000 65000
    router bgp 65000
     address-family ipv4 unicast
      neighbor eth0 route-map PREPEND-ALL out
      neighbor eth1 route-map DRAIN-LEAF1 out
      neighbor eth2 route-map DRAIN-LEAF1 out
OSPF: no. The only knob is link cost ("ip ospf cost 1000" on spine2 eth0 and leaf1 eth1). Each cost
change re-originates a Router LSA that floods everywhere, and every router re-runs SPF: +2 SPF runs
on all 5 routers (10 in total), lsa_updates +2 everywhere. There is no per-prefix, per-neighbor
policy in the protocol; a cost moves everything that crosses the link.

Reproduce it: sudo sh solutions/exercise3/run.sh   (drains, counts, then undoes)

Kit run on containerlab (not shown on camera):
--- OSPF twin (change since snap)
router         lsa_updates           lsdb_lsas          rib_routes            spf_runs
spine1             50 (+2)              5 (+0)              8 (+0)             19 (+2)
spine2             50 (+2)              5 (+0)              8 (+0)             21 (+2)
leaf1              50 (+2)              5 (+0)              9 (+0)             21 (+2)
leaf2              50 (+2)              5 (+0)              9 (+0)             21 (+2)
leaf3              50 (+2)              5 (+0)              9 (+0)             22 (+2)
--- BGP twin (change since snap)
router        bgp_prefixes    bgp_updates_rcvd    bgp_updates_sent          rib_routes
spine1              7 (+0)             35 (+1)             27 (+0)              7 (+0)
spine2              7 (+0)             39 (+1)            93 (+21)              7 (+0)
leaf1               8 (+0)             43 (+8)             34 (+2)              9 (+0)
leaf2               8 (+0)             40 (+8)             20 (+0)              9 (+0)
leaf3               8 (+0)             37 (+5)             20 (+0)              9 (+0)
