Lecture 7 - Routing
Lecture 7 - Routing
Lecture 7 - Routing
Reading 5.2
Computer Networks, Tanenbaum
1
Contents
What is routing?
Static routing and dynamic routing
Routing algorithms and protocols
2
What is routing?
Routing principals
Forwarding mechanism
“Longest matching” rule
3
Routing principles (1)
When a host send an IP packet to another host
If the destination and the source are in the same physical
medium: Transfer directly
If the destination is in a different network with the source:
Send through some other routers (need to choose route)
Router Router
4
Routing principles (2)
Is it destination ?
(Looking for
route)
Destination?
(Looking for route)
5
What is routing?
A mechanism so that a host or a router
decides how to forward a packet from source
to destination.
Result of the routing is a routing table
What to consider in routing
Building routing table
Information need to calculating route
Routing algorithm and protocol.
6
What is a router?
Router is the device that forwards data
between networks
Is a computer with particular hardware
Connects multiple networks together, has multiple
network interfaces
Forward packets according to routing table
7
Some examples of routers…
YAMAHA
RTX-1500 Cisco 2600
BUFFALO PLANEX
BHR-4RV GW-AP54SAG
Router ngoại vi
Cisco CRS-1
Network Next-hop
10.0.0.0/24 A
172.16.0.0/24 C
10.0.0.0/24 172.16.0.0/24
10
Rule: No routes, no reachability!
“Longest matching” rule (1)
Assume that there are more than one entry
matching with a destination network in routing
table.
Destination address: 11.1.2.5
What should be chosen as the next hop?
Network Next hop
11.0.0.0/8 A
11.1.0.0/16 B
11.1.2.0/24 C
11
“Longest matching” rule (2)
Destination address:
11.1.2.5 = 00001011.00000001.00000010.00000101
Route 1:
11.1.2.0/24 = 00001011.00000001.00000010.00000000
Route 2:
11.1.0.0/16 = 00001011.00000001.00000000.00000000
Route 3:
11.0.0.0/8 = 00001011.00000000.00000000.00000000
12
Routing table and forwarding
Internet
mechanism (2)
10.0.0.0/24 172.16.0.0/24
0.0.0.0/0 C
Default route
If router does not find a route to a destination in its
routing table, default route is necessary
Default route is defined for all destination networks that are
not figured in the routing table.
0.0.0.0/0
Is a special notation for all destination networks
Router A
Internet
200.23.1.0/24
200.23.0.0/22
200.23.2.0/24
200.23.1.0/23
15
200.23.3.0/24
Route aggregation (2)
Example of Viettel network
Viettel own a big IP address space
203.113.128.0-203.113.191.255
For connecting to a subnet (client) of Viettel, routing
table needs only to have a route to Viettel network.
Default route is a type of route aggregation
0.0.0.0/0
16
Exercises
A router has the following (CIDR) entries in its routing table:
Address/mask Next hop
135.46.56.0/22 Interface 0 0011 1000
135.46.60.0/22 Interface 1 0011 1100
192.53.40.0/23 Router 1 0010 1000
default Router 2
For each of the following IP addresses, what does the router do if a packet with that
address arrives?
(a) 135.46.63.10 0011 1111
(b) 135.46.57.14
(c) 135.46.52.2
(d) 192.53.40.7
(e) 192.53.56.7 0011 1000
Solution:
Apply longest matching rule. 17
Solution
Apply longest matching rule.
(students should explain why by matching binary form of the addresses)
(a) 135.46.63.10 Interface 1
(b) 135.46.57.14 Interface 0
(c) 135.46.52.2 Router 2 (default route)
(d) 192.53.40.7 Router 1
(e) 192.53.56.7 Router 2 (default route)
40 = 0010 1000
56 = 0011 1000
18
Exercise
Assume that we have
a network with
following topology.
What should be
routing table of
routers B, C, D in
order to assure that
all hosts can send
data to each other
and to the Internet.
19
Solution
Routing table on B Routing table on C
Network Next hop Network Next hop
133.133.0.0/16 C 133.133.0.0/16 Direct
155.0.0.0/8 Direct 155.0.0.0/8 B
203.203.203.0/24 D 203.203.203.0/24 D
0.0.0.0/0 D 0.0.0.0/0 D
Routing table on D
Network Next hop
133.133.0.0/16 C
155.0.0.0/8 B
203.203.203.0/24 Direct
20
0.0.0.0/0 X
Example of routing table on a
host
C:\Documents and Settings\hongson>netstat -rn
Route Table
===========================================================================
Interface List
0x1 ........................... ………MS TCP Loopback interface
0x2 ...08 00 1f b2 a1 a3 ...... Realtek RTL8139 Family PCI Fast Ethernet NIC -
===========================================================================
Active Routes:
Network Netmask Gateway Interface Metric
0.0.0.0 0.0.0.0 192.168.1.1 192.168.1.34 20
127.0.0.0 255.0.0.0 127.0.0.1 127.0.0.1 1
192.168.1.0 255.255.255.0 192.168.1.34 192.168.1.34 20
192.168.1.34 255.255.255.255 127.0.0.1 127.0.0.1 20
192.168.1.255 255.255.255.255 192.168.1.34 192.168.1.34 20
224.0.0.0 240.0.0.0 192.168.1.34 192.168.1.34 20
255.255.255.255 255.255.255.255 192.168.1.34 192.168.1.34 1
22
Static and dynamic routing
Static routing
Dynamic routing
Advantage – Weakness
23
Updating routing table
Network structure may change
New network is added.
Router failure due to power corruption …
It’s necessary to update routing table
of all nodes (theory)
in pratice: some nodes
Network Next- Network Next- Network Next-
hop hop hop
192.168.0.0/24 B 10.0.0.0/24 A 10.0.0.0/24 B
172.16.1.0/24 B 172.16.1.0/24 C
Dynamic routing
Automatically update routing table
By mean of routing protocols
s1
Static routing
Internet
When there is a failure:
Problem happens even
there are alternative
routes.
Network administrator 10.0.0.3 10.0.0.2
needs to change setting
Next-hop 10.0.0.3
0.0.0.0/0 10.0.0.3
Next-hop 10.0.0.1
Unreachable route
Slide 26
Next-hop 10.0.0.1
s2
Static routing
Pros
Stable
Secure
It won’t be effected by other factors
Cons
Very stubborn
Back up link cannot be used
Difficult to manage
Slide 28
s2 If one ISP annouce the wrong routing information, so one part of Internet mis-operate
sonnh, 8/03/2008
Dynamic routing
Pros
Easy to manage
Backup link can be utilized
Cons
Insecure
Difficult to understand the routing protocols
Routing algorithm and
protocols
Dijkstra and Bellman-Ford Algo
link-state and distance-vector
protocols
30
Routing protocols mobile network
national or global ISP
Routing protocol goal: determine
“good” paths (equivalently, routes),
from sending hosts to receiving applicatio
n
host, through network of routers transport
network
link
path: sequence of routers packets physical networ
k
networ
k
“least congested”
l link network
physica
l
3
v w
2 5
u 2 1 z
3
1
2
x y
1
Shortest path tree - SPT
5
v 3 w 5 v w
2
u 2 1 z u z
3
1 2
x 1
y x y
5 uwxvyz v
notes:
construct least-cost-path tree by tracing predecessor nodes
ties can exist (can be broken arbitrarily)
Dijkstra’s algorithm: discussion
algorithm complexity: n nodes
each of n iteration: need to check all nodes, w, not in N
n(n+1)/2 comparisons: O(n2) complexity
more efficient implementations possible: O(nlogn)
message complexity:
each router must broadcast its link state information to other n routers
efficient (and interesting!) broadcast algorithms: O(n) link crossings to
disseminate a broadcast message from one source
each router’s message crosses O(n) links: overall message complexity: O(n2)
Distance vector algorithm
Bellman-Ford equation
45
Dx(y) = min{c(x,y) + Dy(y), c(x,z) + Dz(y)}
= min{2+0 , 7+1} = 2
node x table
cost to cost to
x y z x y z
x 0 2 7 x 0 2 3 Dx(z) = min{c(x,y) +
Dy(z), c(x,z) + Dz(z)}
from
from
y ∞∞ ∞ y 2 0 1
= min{2+1 , 7+0} = 3
z ∞∞ ∞ z 7 1 0
node y table
cost to
x y z y
2 1
x ∞ ∞ ∞
x z
y 2 0 1 7
from
z ∞∞ ∞
node z table
cost to
x y z
x ∞∞ ∞
from
y ∞∞ ∞
z 7 1 0
time
Dx(y) = min{c(x,y) + Dy(y), c(x,z) + Dz(y)} Dx(z) = min{c(x,y) +
= min{2+0 , 7+1} = 2 Dy(z), c(x,z) + Dz(z)}
node x table = min{2+1 , 7+0} = 3
cost to cost to
x y z x y z
x 0 2 7 x 0 2 3
from
from
y ∞∞ ∞ y 2 0 1
z ∞∞ ∞ z 7 1 0
node y table
cost to cost to
x y z x y z y
2 1
x ∞ ∞ ∞ x 0 2 7
x z
from
y 2 0 1 y 2 0 1 7
from
z ∞∞ ∞ z 7 1 0
node z table
cost to cost to
x y z x y z
x ∞∞ ∞ x 0 2 7
from
y 2 0 1
from
y ∞∞ ∞
z 7 1 0 z 3 1 0
Dx(y) = min{c(x,y) + Dy(y), c(x,z) + Dz(y)} Dx(z) = min{c(x,y) +
= min{2+0 , 7+1} = 2 Dy(z), c(x,z) + Dz(z)}
node x table = min{2+1 , 7+0} = 3
cost to cost to cost to
x y z x y z x y z
x 0 2 7 x 0 2 3 x 0 2 3
from
from
y ∞∞ ∞ y 2 0 1
from
y 2 0 1
z ∞∞ ∞ z 7 1 0 z 3 1 0
node y table
cost to cost to
x y z x y z y
2 1
x ∞ ∞ ∞ x 0 2 7
x z
from
y 2 0 1 y 2 0 1 7
from
z ∞∞ ∞ z 7 1 0
node z table
cost to cost to
x y z x y z
x ∞∞ ∞ x 0 2 7
from
y 2 0 1
from
y ∞∞ ∞
z 7 1 0 z 3 1 0
time
Dx(y) = min{c(x,y) + Dy(y), c(x,z) + Dz(y)} Dx(z) = min{c(x,y) +
= min{2+0 , 7+1} = 2 Dy(z), c(x,z) + Dz(z)}
node x table = min{2+1 , 7+0} = 3
cost to cost to cost to
x y z x y z x y z
x 0 2 7 x 0 2 3 x 0 2 3
from
from
y ∞∞ ∞ y 2 0 1
from
y 2 0 1
z ∞∞ ∞ z 7 1 0 z 3 1 0
node y table
cost to cost to cost to
x y z x y z x y z y
2 1
x ∞ ∞ ∞ x 0 2 7 x 0 2 3 x z
from
y 2 0 1 y 2 0 1 7
from
from
y 2 0 1
z ∞∞ ∞ z 7 1 0 z 3 1 0
node z table
cost to cost to cost to
x y z x y z x y z
x ∞∞ ∞ x 0 2 7 x 0 2 3
from
from
y 2 0 1 y 2 0 1
from
y ∞∞ ∞
z 7 1 0 z 3 1 0 z 3 1 0
time
Distance vector: example
DV in :
Da(a)=0
Da(b) = 8
Da(c) = ∞ a b c
Da(d) = 1 8 1
Da(e) = ∞
t=0 Da(f) = ∞
Da(g) = ∞ 1 1
Da(h) = ∞
Da(i) = ∞
d e f
A few asymmetries:
All nodes have 1 1
missing link
distance estimates
to nearest larger cost
neighbors (only) 1 1 1
a b c
8 1
t=1 1 1
All nodes:
receive distance vectors
from neighbors
d e f
compute their new local 1 1
distance vector
send their new local
distance vector to 1 1 1
neighbors
g h i
1 1
Distance vector example:
iteration
a
compute compute
b compute
c
8 1
t=1 1 1
All nodes:
receive distance vectors
from neighbors
d e f
compute
compute their new local compute 1 compute 1
distance vector
send their new local
distance vector to 1 1 1
neighbors
g h i
compute 1 compute 1 compute
Distance vector example:
iteration
a b c
8 1
t=1 1 1
All nodes:
receive distance vectors
from neighbors
d e f
compute their new local 1 1
distance vector
send their new local
distance vector to 1 1 1
neighbors
g h i
1 1
Distance vector example:
iteration
a b c
8 1
t=2 1 1
All nodes:
receive distance vectors
from neighbors
d e f
compute their new local 1 1
distance vector
send their new local
distance vector to 1 1 1
neighbors
g h i
1 1
Distance vector example:
iteration
compute
a compute
b
1
compute
c
2
t=2 1 1
All nodes:
receive distance vectors
from neighbors
compute their new local d
compute 1 compute
e
1
compute
f
distance vector
send their new local
distance vector to 1 1 1
neighbors
g
compute compute
h compute
i
8 1
Distance vector example:
iteration
a b c
8 1
t=2 1 1
All nodes:
receive distance vectors
from neighbors
d e f
compute their new local 1 1
distance vector
send their new local
distance vector to 1 1 1
neighbors
g h i
1 1
Distance vector example:
iteration
…. and so on
g h i
1 1
Distance vector example:
computation DV in b:
Db(a) = 8
Db(c) = 1
Db(f) = ∞
Db(g) = ∞
DV in c:
Dc(a) = ∞
Dc(b) = 1
Db(d) = ∞ Db(h) = ∞ Dc(c) = 0
DV in : Dc(d) = ∞
Db(e) = 1 Db(i) = ∞
Da(a)=0
Dc(e) = ∞
Da(b) = 8
Dc(f) = ∞
Da(c) = ∞ a bb c Dc(g) = ∞
Da(d) = 1 8 compute 1
Dc(h) = ∞
Da(e) = ∞
t=1 Da(f) = ∞
Da(g) = ∞ 1 1
Dc(i) = ∞
c receives Da(h) = ∞ DV in e:
DVs from b Da(i) = ∞ De(a) = ∞
De(b) = 1
d e f De(c) = ∞
1 1 De(d) = 1
De(e) = 0
De(f) = 1
1 1 1 De(g) = ∞
De(h) = 1
De(i) = ∞
g h i
1 1
Distance vector example:
computation DV in b:
Db(a) = 8
Db(c) = 1
Db(f) = ∞
Db(g) = ∞
DV in c:
Dc(a) = ∞
Dc(b) = 1
Db(d) = ∞ Db(h) = ∞ Dc(c) = 0
Db(e) = 1 Db(i) = ∞ Dc(d) = ∞
Dc(e) = ∞
Dc(f) = ∞
a b c
8 1 compute Dc(g) = ∞
Dc(h) = ∞
t=1 1 1
Dc(i) = ∞
c receives
DVs from b
computes: d +Db(a}} = 1 + 8 = 9 e
Dc(a) = min{cc,b f
DV in c:
Dc(b) = min{cc,b+Db(b)} = 1 + 0 = 1
Dc(a) = 9
Dc(d) = min{cc,b+Db(d)} = 1+ ∞ = ∞ Dc(b) = 1
Dc(e) = min{cc,b+Db(e)} = 1 + 1 = 2 Dc(c) = 0
Dc(d) = 2
Dc(f) = min{cc,b+Db(f)} = 1+ ∞ = ∞
Dc(e) = ∞
Dc(g) = min{cc,b+Db(g)} = 1+ ∞ = ∞ Dc(f) = ∞
g +Db(h)} = 1+ ∞ = ∞ h
Dc(h) = min{cbc,b Dc(g) = ∞ i
Dc(i) = min{cc,b+Db(i)} = 1+ ∞ = ∞ Dc(h) = ∞
Dc(i) = ∞
Distance vector example:
computation DV in b:
Db(a) = 8
Db(c) = 1
Db(f) = ∞
Db(g) = ∞
Db(d) = ∞ Db(h) = ∞ DV in e:
DV in d: Db(e) = 1 Db(i) = ∞
De(a) = ∞
Dc(a) = 1 De(b) = 1
Dc(b) = ∞ a De(c) = ∞
b c
Dc(c) = ∞ 8 1 De(d) = 1
Dc(d) = 0 De(e) = 0
t=1 Dc(e) = 1 Q: what is new DV De(f) = 1
Dc(f) = ∞ 1 computed1 in e at t=1? De(g) = ∞
e receives Dc(g) = 1 De(h) = 1
Dc(h) = ∞
DVs from b, Dc(i) = ∞
De(i) = ∞
d, f, h d compute
e f DV in f:
DV in h: 1 1
Dc(a) = ∞
Dc(a) = ∞ Dc(b) = ∞
Dc(b) = ∞ Dc(c) = ∞
Dc(c) = ∞ 1 1 1 Dc(d) = ∞
Dc(d) = ∞ Dc(e) = 1
Dc(e) = 1 Dc(f) = 0
Dc(f) = ∞ Dc(g) = ∞
Dc(g) = 1 g h i Dc(h) = ∞
1 1
Dc(h) = 0 Dc(i) = 1
Dc(i) = 1
Distance vector: state
information diffusion
Iterative communication, computation steps diffuses information through network:
67
Making routing scalable
70
Slide 70
s3 Combine 5 and 6
sonnh, 8/03/2008
s4
Source: http://www.cidr-report.org
Slide 71
s4 Explain about AS
sonnh, 8/03/2008
Number of AS by time
Source: http://www.potaroo.net/
72
Hierarchical routing protocols
Inside an AS: Intra-domain routing protocols
Also named IGP: Interior Gateway Protocol
RIP: Routing Information Protocol
OSPF: Open Shortest Path First
IS-IS, IGRP, EIGRP (Cisco)…
Among ASes: Inter-domain routing protocols
Also named EGP: Exterior Gateway Protocol
BGP (v4): Border Gateway Protocol
73
Intra-domain and Inter-domain
routing
AS2
AS1 EGP
IGP OSPF domain
IGP
EGP
RIP domain EGP
EGP
AS4 EGP IGP
IGP AS3
RIP domain
IGP
AS5 OSPF domain
RIP domain
74
RIP domain
Interconnected ASes
3c
3a other
2c
3b 2a networks
2b
1c
AS3
other 1a 1b AS2
networks
1d
AS1
Inter-AS routing: routing within an AS
most common intra-AS routing protocols:
RIP: Routing Information Protocol [RFC 1723]
• classic DV: DVs exchanged every 30 secs
• no longer widely used
OSPF: Open Shortest Path First [RFC 2328]
• link-state routing
• IS-IS protocol (ISO standard, not RFC standard) essentially same as OSPF
EIGRP: Enhanced Interior Gateway Routing Protocol
• DV based
• formerly Cisco-proprietary for decades (became open in 2013 [RFC 7868])
Intra-domain routing protocol
RIP
OSPF
78
RIP ( Routing Information Protocol)
IGP
RIP v.1, currently use RIP v.2
Distance-vector algorithm
Routing metric: # of hops (max = 15 hops)
From router A to subsets:
u v destination hops
u 1
A B w v 2
w 2
x 3
x y 3
z C D z 2
y 79
Review: DV routing (1)
Friend of friend is friend
Net A
133.27.4.0/24
Router A Router C
To 133.27.4.0/24
1 hop
Net B
Router B
133.27.5.0/24
Router D
80
Review: DV routing (2)
Friend of friend is friend
Net A
133.27.4.0/24
Net A
133.27.4.0/24
Net A
133.27.4.0/24
Router A Router C
To 133.27.4.0/24
1 hop
Net B
Router B
133.27.5.0/24
Router D
To 133.27.4.0/24 83
2 hop
Slide 83
84
RIP timer (1)
Update timer
Exchange routing table every 30 sec
Invalid timer
Updated every time router receives information
If it is time out (180sec), it becomes hold down status
Hold down timer
Router keeps routing information for 180 sec
Not refer the worse update (to avoid the loop)
Possibly down status
Flush timer
Update every time router receives information
If 240sec passed, routing entry will be deleted
85
RIP timer (2)
no
update update
update
↓ ↓ ↓
When it is timeout,
hold down timer starts
Invalid timer
When it is timeout,
This info will be deleted
from RIP database
Flush timer
When it is timeout,
Routing info will be deleted
from routing table
0 30 60 90 120 150 180 210 240 270 300 330 360 390 420
86
Ping-pong failure
If 192.168.0.0/24 is down…
B can update 192.168.0.0 info to A
Packets to 192.168.0.0/24 become loop status
A will update 192.168.0.0 info to B
Count up to infinity!
192.168.0.0/24 conn 192.168.1.0/24 conn
192.168.1.0/24 conn 192.168.2.0/24 conn
192.168.2.0/24 B 192.168.0.0/24 A
A B
88
89
Slide 89
Hierarchical OSPF
Why we have to divide the network into small area?
If we have more than 100 routers….
Link state update is delivered all the time
Number of re-calculation increase
Need more memory, need more CPU power
Number of link state update become large
Routing table become large
Area
Group of routers which share the same LSA
91
Slide 91
link to A, cost 20 B E
link to E, cost 20
link to C, cost 50
94
OSPF metric
Default value is existing
100Mbps / bandwidth of interface
But these days administrator assign the original
value
During the calculation of routing table
Smallest cost to the one path will be selected
If cost are same
Router will do load balancing
95
OSPF default cost
Link Bandwidth Default OSPF cost
56Kbps serial link 1785
64Kbps serial link 1562
T1 (1.544Mbps) serial link 65
E1 (2.048Mbps) serial link 48
4Mbps Token Ring 25
Ethernet 10
16Mbps Token Ring 6
FDDI or Fast Ethernet 1
Gigabit Ethernet / 10G network 1
96
s9
(a) (b)
X A X A
LSAX LSAX
C B D C B D
LSAX
(c) (d) 97
Slide 97
B A C B A C
D E D E
98
99
Slide 99
101
Internet inter-AS routing: BGP
BGP (Border Gateway Protocol): the de facto inter-domain
routing protocol
• “glue that holds the Internet together”
allows subnet to advertise its existence, and the
destinations it can reach, to rest of Internet: “I am here,
here is who I can reach, and how”
BGP provides each AS a means to:
• eBGP: obtain subnet reachability information from neighboring
ASes
• iBGP: propagate reachability information to all AS-internal routers.
• determine “good” routes to other networks based on reachability
information and policy
eBGP, iBGP connections
2b
2a 2c
∂
1b 3b
2d
1a 1c ∂
3a 3c
AS 2
1d 3d
AS 1 eBGP connectivity AS 3
logical iBGP connectivity
D E
2 A 4 A
D→A D→A best path 105
C→B→A ×
Slide 105
2d
AS2 router 2c receives path advertisement AS3,X (via eBGP) from AS3 router
3a
based on AS2 policy, AS2 router 2c accepts path AS3,X, propagates (via
iBGP) to all AS2 routers
based on AS2 policy, AS2 router 2a advertises (via eBGP) path AS2,
AS3, X to AS1 router 1c
BGP path advertisement (more)
AS 3 3b
AS 1b AS3,X 3a 3c
AS3,X
1 AS3,X
1a 1c AS 2 3d X
2b
AS3,X
1d AS3, X
AS2,AS3,X 2a 2c
2d
C
A !!LOOP!!
A
D→C→B→A
A
C→B→A
D
109
BGP messages
BGP messages exchanged between peers over TCP
connection
BGP messages:
• OPEN: opens TCP connection to remote BGP peer and
authenticates sending BGP peer
• UPDATE: advertises new path (or withdraws old)
• KEEPALIVE: keeps connection alive in absence of UPDATES;
also ACKs OPEN request
• NOTIFICATION: reports errors in previous msg; also used to
close connection
BGP path advertisement
AS 3 3b
AS 1b AS3,X 3a 3c
AS3,X
1 1
AS3,X
1a 1c AS 2 3d X
2 2b
AS3,X
local link 2
1d
1 AS3, X
AS2,AS3,X 2a 2c
interfaces
at 1a, 1d 2d
dest interface recall: 1a, 1b, 1d learn via iBGP from 1c: “path to X goes through 1c”
… …
at 1d: OSPF intra-domain routing: to get to 1c, use interface 1
1c 1
X 1 at 1d: to get to X, use interface 1
… …
BGP path advertisement
AS 3 3b
AS 1b 3a 3c
1 1
1a 1c AS 2 3d X
2 2b
1d
2a 2c
2d
dest interface
… … recall: 1a, 1b, 1d learn via iBGP from 1c: “path to X goes through 1c”
1c 2 at 1d: OSPF intra-domain routing: to get to 1c, use interface 1
X 2
… … at 1d: to get to X, use interface 1
at 1a: OSPF intra-domain routing: to get to 1c, use interface 2
at 1a: to get to X, use interface 2
Why different Intra-, Inter-AS routing ?
policy:
inter-AS: admin wants control over how its traffic routed, who
routes through its network
intra-AS: single admin, so policy less of an issue
scale:
hierarchical routing saves table size, reduced update traffic
performance:
intra-AS: can focus on performance
inter-AS: policy dominates over performance
Hot potato routing
AS 3 3b
AS 1b 3a 3c
1
1a 1c AS 2 3d X
2b 112
1d AS1,AS3,X AS3,X
2a 2c
201 263
2d
OSPF link weights
ISP only wants to route traffic to/from its customer networks (does not
want to carry transit traffic between other ISPs – a typical “real world” policy)
A advertises path Aw to B and to C
B chooses not to advertise BAw to C!
B gets no “revenue” for routing CBAw, since none of C, A, w are B’s
customers
C does not learn about CBAw path
C will route CAw (not using B) to get to w
BGP: achieving policy via
advertisements (more)
B provider
x network
w A legend:
C y customer
network:
ISP only wants to route traffic to/from its customer networks (does not
want to carry transit traffic between other ISPs – a typical “real world” policy)
A,B,C are provider networks
x,w,y are customer (of provider networks)
x is dual-homed: attached to two networks
policy to enforce: x does not want to route from B to C via
x
.. so x will not advertise to B a route to C
BGP route selection
118
Steps to select the path
: NEXT_HOP?
Step 1: Compare LOCAL_PREF
119
Sử dụng LOCAL_PREF
Chọn giá trị lớn hơn của
LOCAL_PREF AS1 AS1 AS1
AS1 AS4
AS3 AS2 AS1
AS1
AS2
AS3 AS5
AS4
AS3
121 AS5
Example of AS PATH
122
Example of AS PATH prepend
123
Routing with MED
In case of 2 AS with many links
Choose smaller MED
Apply in controlling bandwidth
172.16.0.0/16
AS1
Routing information Routing information of AS1
of AS1 MED 200
MED 100 used route
125