Hierarchical and BGP
Hierarchical and BGP
B
D
B
•Notice the C does not announce the
D link CG to Area 1.
•Notice that C gets a summary from
G, which is distances to destinations,
like distance vector.
•ABR G tells all routers in the Backbone that it can reach D in 2 hop.•C uses the distances from G to
•ABR F tells all routers in the Backbone that it can reach D in 1 hops
•ABR C tells all routers in Area 1 that it can reach D in 3 hops
determine its distances.
•ABR F tells all routers in Area 1 that it can reach D in 1 hop •C announces these distances to
•A decides B is the best next hop toward D Area 1
•This is like a one hop distance
vector protocol
Area Border Router Summaries
The backbone is completely
connected because each router
area border router
essentially sends distance vector
E updates directly to its neighbor
F F
A in 1 hop A in 4 hop
C B in 2 hops 2 1 B in 5 hop
… …
… 3 …
G
C 2
A in 2 hop
A 1 G B in 3 hops
… Area 3
…
B Area 1
Area 2
D
223.1.1.1 223.1.1.4
223.1.1.3
223.1.9.2 223.1.7.0
223.1.9.1 223.1.7.1
223.1.8.1 223.1.8.0
223.1.2.6 223.1.3.27
Organization 0
200.23.16.0/23
Organization 1
“Send me anything
200.23.18.0/23 with addresses
Organization 2 beginning
200.23.20.0/23 . ISP1 200.23.16.0/20”
.
. .
. Border Router Internet
Organization 7 .
200.23.30.0/23
“Send me anything
ISP2
with addresses
beginning
199.31.0.0/16”
This way, the whole 32 bit address does not need to be examined
Hierarchical addressing: more specific
routes
ISP2 has a more specific route to Organization 1
Organization 0
200.23.16.0/23
“Send me anything
with addresses
Organization 2 beginning
200.23.20.0/23 . ISP1 200.23.16.0/20”
.
. .
. Border Router Internet
Organization 7 .
200.23.30.0/23
“Send me anything
ISP2 with addresses
Organization 1 beginning 199.31.0.0/16
or 200.23.18.0/23”
200.23.18.0/23
Longest prefix matching
Border Router Forwarding Table
Organization 0
200.23.16.0/23
Organization 1
“Send me anything
200.23.18.0/23 with addresses
Organization 2 beginning
200.23.20.0/23 . ISP1 ……”
.
. .
. Border Router Internet
Organization 7 .
200.23.30.0/23
“Send me anything
ISP2
with addresses
beginning
…..
Hierarchical Routing
Our routing study thus far has been an idealization
all routers identical
network “flat”
… not true in practice
scale: with 200 million destinations: administrative autonomy
can’t store all dest’s in routing tables! internet = network of networks
Memory for address table must be very fast each network admin wants to control
• How fast? How long can an address lookup take on a
10GBit interface? routing in its own network
•
E.g., 64B/1010=50nsec
ATT does not want Sprint to know what
routing table exchange would swamp links! their topology is
There are ~ 1 million links • Trade secret
• Improves security
If link state was flooded every 30 minutes
ATT wants to select a routing protocol
seconds and each link state is 20B, then each
router receives and processes 100kbps in link and parameters without getting Sprint’s
announcements permission
But, perhaps, only changes in link state could
be distributed.
Hierarchical Routing
aggregate routers into regions,
“autonomous systems” (AS) Gateway router
Direct link to router in another
Single administrative domain
Routers in the same AS run
AS
Gateway routers run a common
same routing protocol
inter-networking routing
“intra-AS” routing protocol protocol
routers in different AS can run
different intra-AS routing
protocol
An ISP may be made of 1 or
more ASs
ATT-USA = 1 AS and ATT-
Europe is another
Some stub networks are an AS
• UD is an AS
• Some companies have routers
but are not ASs
ASs have their own number,
assigned by ICANN
There are ~50K ASs
Simple example
Connections to other ASs and the rest of the Internet
AS2
Service provider of AS1 (e.g., AS1=UD and AS2=cogent)
E
(Recall that ASs (ISPs) sometimes
meet at NAPs. E.g., google: MAE-
East)
The rest of the internet An AS could also meet its provider
at a POP.
to the rest of
the Internet
1.2.0.0/16
1.1.0.0/16
AS2 E
10.1.1.1/24
A 10.1.1.0/24 3
3
10.1.2.0/24
2 4 10.1.4.0/22 2
10.1.4.0/22
D
AS3 2.2.0.0/16
Interconnected ASes
3c
3a 2c
3b 2a
AS3 2b
1c AS2
1a 1b AS1
1d forwarding table
configured by both
intra- and inter-AS
Intra-AS
Routing
Inter-AS
Routing routing algorithm
algorithm algorithm
intra-AS sets entries
Forwarding for internal dests
table
inter-AS & intra-As
sets entries for
external dests
Example: Setting forwarding table in router
1d
suppose AS1 learns (via inter-AS protocol) that subnet x is reachable via AS3
(gateway 1c) but not via AS2.
inter-AS protocol propagates reachability info to all internal routers.
router 1d determines from intra-AS routing info that its interface I is on the
least cost path to 1c.
installs forwarding table entry (x,I)
Alternatively, 1d has two table entries
One entry says x is reachable via 1c (determined by IBGP)
A second entry says which is the next hop to reach 1c (determined by intra-routing protocol)
3c
… x
3a 2c
3b 2a
AS3 2b
1c AS2
1a 1b AS1
1d
Example: Choosing among multiple ASes
now suppose AS1 learns from inter-AS protocol that subnet
x is reachable from AS3 and from AS2.
to configure forwarding table, router 1d must determine
towards which gateway it should forward packets for dest x.
this is also job of inter-AS routing protocol!
If both gateways are equivalent, then the intra-AS
routing protocol will route packets to the best gateway
• This is called hot potato routing: send packet towards closest of two
routers.
3c … x …
3a 2c
3b 2a
AS3 2b
1c AS2
1a 1b AS1
1d
Hot Potato Routing
128.4.0.0/16
AS1
A B
AS2
•AS2 could give send the pkt to gateway B – hot potato routing.
•But AS1 would prefer AS2 to carry its own traffic.
•So AS1 might require that AS2 gives higher priority to gateway A.
•But how can AS1 enforce AS2 to do this?
Example: Choosing among multiple ASes
now suppose AS1 learns from inter-AS protocol
that subnet x is reachable from AS3 and from
AS2.
to configure forwarding table, router 1d must
determine which gateway it should forward
packets for dest x.
this is also job of inter-AS routing protocol!
hot potato routing: send packet towards closest of
two routers.
eBGP session
3c iBGP session
3a 2c
3b 2a
AS3 2b
1c AS2
1a 1b
AS1 1d
Distributing reachability info
using eBGP session between 3a and 1c, AS3 sends prefix
reachability info to AS1.
1c can then use iBGP do distribute new prefix info to all
routers in AS1
1b can then re-advertise new reachability info to AS2
over 1b-to-2a eBGP session
when router learns of new prefix, it creates entry for
prefix in its forwarding table.
eBGP session
3c iBGP session
3a 2c
3b 2a
AS3 2b
1c AS2
1a 1b
AS1 1d
Aggregation Problem
1.1.1.0/24
1.1.0.0/22 1.1.0.0/22
1.1.2.0/24
ISP
ISP
1.1.3.0/24 ISP
Y
W
1.1.4.0/24
1.1.4.0/24 1.1.4.0/24
ISP ISP
ISP ISP X
A advertises path AW to B
B advertises path BAW to X
Should B advertise path BAW to C?
No way! B gets no “revenue” for routing CBAW
since neither W nor C are B’s customers
B wants to force C to route to w via A
B wants to route only to/from its customers!
BGP route processing
configuration configuration
Adj-rib-out peer
peer Adj-rib-in
Sample routing environment
•deny 0/0 from AS1
•Give 192.213.1.0/24 from AS3
AS1 AS1 better preference
•Do not propagate 0/0
•Do not send 193.214.10.0/24 to AS4
•Accept other routes •Give 192.213.1.0/24 with metric = 10
to AS3
•193.214.10.0/24 path=(AS5, AS2)
•192.213.1.0/24 path=(AS5, AS1)
192.213.1.0/24
metric=10
0/0
input output •172.16.10.0/24 path=(AS5)
decision
policy routes policy
process
engine engine
•172.16.10.0/24 path=(AS5)
•192.213.1.0/24 path=(AS5 AS1)
•Use 0/0 from AS2
192.213.1.0/24 •Use 192.213.1.0/24 from AS1
AS2
193.214.10.0/24
0/0
•Use 193.214.10.0/24 from AS2
•Use 172.16.10.0/24 from AS5 (this AS4
AS)
Fun with BGP
Policy:
Inter-AS: admin wants control over how its traffic
routed, who routes through its net.
Intra-AS: single admin, so no policy decisions
needed
Scale:
hierarchical routing saves table size, reduced
update traffic
Performance:
Intra-AS: can focus on performance
Inter-AS: policy may dominate over performance