Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Lecture 7 - Routing

Download as pdf or txt
Download as pdf or txt
You are on page 1of 130

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

Router mạng trục


Hitachi
Juniper M10 http://www.cisco.com.vn
GR2000-1B
Foundry Networks
NetIron 800 http://www.juniper.net/
http://www.buffalotech.com
8

Cisco 3700 Router cỡ trung


Routing table
 Lists of possible routes, saved in the
memory of router
 Main components of routing table
 Destination network address/network mask
 Next router
#show ip route
Prefix Next Hop
203.238.37.0/24 via 203.178.136.14
203.238.37.96/27 via 203.178.136.26
203.238.37.128/27 via 203.178.136.26
203.170.97.0/24 via 203.178.136.14
192.68.132.0/24 via 203.178.136.29
203.254.52.0/24 via 203.178.136.14
202.171.96.0/24 via 203.178.136.14
9
Routing table and forwarding
mechanism (1)

Network Next-hop
10.0.0.0/24 A
172.16.0.0/24 C

Router A Router B Router C

10.0.0.0/24 172.16.0.0/24

10.0.0.0/24 192.168.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)

Router A Router B Router C

10.0.0.0/24 172.16.0.0/24

10.0.0.0/24 192.168.0.0/24 172.16.0.0/24

Network Next-hop Q. What is the


routing table in C?
10.0.0.0/24 A
172.16.0.0/24 C Q: What if C is
connected to the
192.168.0.0/24 Direct Internet? 13

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

Router kế tiếp luôn là A


14
Route aggregation
 How many networks in the Internet?
 There will be a lot of entries in the routing table?
 The entries to sub-networks of the same “big” network can be
aggregated inorder to reduce the size of routing table.
200.23.1.0/24
200.23.0.0/24
200.23.0.0/23

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

Default Gateway: 192.168.1.1


21
===========================================================================
Example of routing table in a
Router
#show ip route
Prefix Next Hop
203.238.37.0/24 via 203.178.136.14
203.238.37.96/27 via 203.178.136.26
203.238.37.128/27 via 203.178.136.26
203.170.97.0/24 via 203.178.136.14
192.68.132.0/24 via 203.178.136.29
203.254.52.0/24 via 203.178.136.14
202.171.96.0/24 via 203.178.136.14

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.0.0/24 B 172.16.0.0/24 C 192.168.0.0/24 B

172.16.1.0/24 B 172.16.1.0/24 C

Router A Router B Router C New Network

10.0.0.0/24 192.168.0.0/24 172.16.0.0/24 172.16.1.0/24


How to update routing table?
 Static routing
 Entries in routing table are added manually by
administrator

 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

Routing table of 10.0.0.1 (extract)


Prefix Next-hop 10.0.0.1

0.0.0.0/0 10.0.0.3
Next-hop 10.0.0.1
Unreachable route
Slide 26

s1 Fix the ip address


sonnh, 8/03/2008
Dynamic Routing
 When there is a failure: Internet

 Alternative route is added


automatically

Routing table of 10.0.0.1 (extract)


10.0.0.3 10.0.0.2
Prefix Next-hop Alternative route
0.0.0.0/0 10.0.0.2 Next-hop 10.0.0.3

0.0.0.0/0 10.0.0.3 Unreachable route


10.0.0.1

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

traverse from given initial source


link link
physica physica
l l

host to final destination host networ


k networ
k

 “good”: least “cost”, “fastest”,


link
physica link networ
l physica k datacenter

“least congested”
l link network
physica
l

 routing: a “top-10” networking applicatio


n
challenge! enterprise
transport
network
network link
physical
Network as a graph
 Graph with nodes (routers) and edges (links)
 Link “cost” c(x,y)
 Bandwidth, delay, cost, congestion level…
 Determine least cost path from every node to every
other node
5

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

 A tree that links go out from root to leaves


 The unique path from root to any node v is the
shortest path from the root to v
 Each node has a different SPT
Routing algorithm
classification
global: all routers have
complete topology, link cost info
How fast • “link state” algorithms
do routes dynamic: routes
change? static: routes change more quickly
change slowly over • periodic updates or
time in response to link
decentralized: iterative process of cost changes
computation, exchange of info with
neighbors
• routers initially only know link costs to
attached neighbors
• “distance vector” algorithms

global or decentralized information?


Dijkstra’s link-state routing
algorithm
 centralized: network topology, notation
link costs known to all nodes
• accomplished via “link state  cx,y: direct link cost from
broadcast” node x to y; = ∞ if not
• all nodes have same info direct neighbors
 computes least cost paths from  D(v): current estimate of
one node (“source”) to all other cost of least-cost-path
nodes from source to destination
v
• gives forwarding table for that
node  p(v): predecessor node
along path from source to
 iterative: after k iterations, know v
least cost path to k destinations
 N': set of nodes whose
least-cost-path definitively
known
Dijkstra’s link-state routing
algorithm
1 Initialization:
2 N' = {u} /* compute least cost path from u to all other nodes */
3 for all nodes v
4 if v adjacent to u /* u initially knows direct-path-cost only to direct
neighbors */
5 then D(v) = cu,v /* but may not be minimum cost!
*/
6 else D(v) = ∞
7
8 Loop
9 find w not in N' such that D(w) is a minimum
10 add w to N'
11 update D(v) for all v adjacent to w and not in N' :
12 D(v) = min ( D(v), D(w) + cw,v )
13 /* new least-path-cost to v is either old least-cost-path to v or known
14 least-cost-path to w plus direct-cost from w to v */
15 until all nodes in N'
Dijkstra’s algorithm: an example
v w x y z
Step N' D(v),p(v) D(w),p(w) D(x),p(x) D(y),p(y) D(z),p(z)
0 u 2,u 5,u 1,u ∞ ∞
1 ux 2,u 4,x 2,x ∞
2 uxy 2,u 3,y 4,y
3 uxyv 3,y 4,y
4 uxyvw 4,y
5 uxyvwz
Initialization (step 0): For all a: if a adjacent to
5 then D(a) = cu,a
3
v w 5
2
u 2 z find a not in N' such that D(a) is a minimum
1
3 add a to N'
1 2
x 1
y update D(b) for all b adjacent to a and not in N' :
D(b) = min ( D(b), D(a) + ca,b )
Dijkstra’s algorithm: an example
5
3
v w 5
2
u 2 1 z
3
1 2
x 1
y

resulting least-cost-path tree from u: resulting forwarding table in u:


destination outgoing link
v w
v (u,v) route from u to v directly
u z x (u,x)
y (u,x) route from u
x y
w (u,x)
to all other
z (u,x)
destinations
via x
Dijkstra’s algorithm: another example
v w x y z x
D(v), D(w), D(x), D(y), D(z),
9
Step N' p(v) p(w) p(x) p(y) p(z)

0 u 7,u 3,u 5,u ∞ ∞ 5 7


4
1 uw 6,w 5,u 11,w ∞ 8
2 uwx 6,w 11,w 14,x 3 w z
u y
2
3 uwxv 10,v 14,x
3
4 uwxvy 12,y 7 4

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

Based on Bellman-Ford (BF) equation (dynamic programming):

Bellman-Ford equation

Let Dx(y): cost of least-cost path from x to y.


Then:
Dx(y) = minv { cx,v + Dv(y) }

v’s estimated least-cost-path cost to y


min taken over all neighbors v of x direct cost of link from x to v
Bellman-Ford Example
Suppose that u’s neighboring nodes, x,v,w, know that for destination z:

Dv(z) = 5 Dw(z) = 3 Bellman-Ford equation says:


5
Du(z) = min { cu,v + Dv(z),
3 w
v 5 cu,x + Dx(z),
2
u 2 1 z cu,w + Dw(z) }
3
1 2
= min {2 + 5,
x 1
y 1 + 3,
5 + 3} = 4
Dx(z) = 3
node achieving minimum (x)
is next hop on estimated
least-cost path to destination
(z)
Distance-vector algorithm (2)
Main ideas:
At each node:
 Distance vector: vector of all distance
from the current node to all other nodes Wait for a DV from
 Each node send periodically the its neighbor
distance vector to its adjacent nodes
 When a node x receives a distance
vector, it updates its distance vector by Re-calculate its DV
using equation Bellman-ford
 With some condition, the distance Dx(y)
in each vector will converge to the If DV changes, Inform its
smallest value of dx(y) neighbor

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

 All nodes send their


local distance
g h i
vector to their 1 1
neighbors
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
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

Let’s next take a look at the iterative computations at nodes


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 b c Dc(g) = ∞
Da(d) = 1 8 1
Dc(h) = ∞
Da(e) = ∞
t=1 Da(f) = ∞
Da(g) = ∞ 1 1
Dc(i) = ∞

 b receives DVs Da(h) = ∞ DV in e:


from a, c, e 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
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) = ∞

 b receives DVs Da(h) = ∞ DV in e:


from a, c, e, Da(i) = ∞ e De(a) = ∞
computes: De(b) = 1
d f De(c) = ∞
1 min{8,∞,∞} = 8e
Db(a) = min{cb,a+Da(a), cb,c +Dc(a), cb,e+De(a)} = 1 De(d) = 1
Db(c) = min{cb,a+Da(c), cb,c +Dc(c), c b,e +De(c)} = min{∞,1,∞} = 1 De(e) = 0
Db(d) = min{cb,a+Da(d), cb,c +Dc(d), c b,e +De(d)} = min{9,2,∞} = 2 De(f) = 1
1 1 1 De(g) = ∞
Db(e) = min{cb,a+Da(e), cb,c +Dc(e), c b,e +De(e)} = min{∞,∞,1} = 1
De(h) = 1
Db(f) = min{cb,a+Da(f), cb,c +Dc(f), c b,e +De(f)} = min{∞,∞,2} = 2 DV in b:
De(i) = ∞
Db(g) = min{cb,a+Da(g), cb,c +Dc(g), c b,e+De(g)} = min{∞, ∞, ∞} = ∞ Db(a) = 8 Db(f) =2
g D (c) = 1 Dib(g) = ∞
Db(h) = min{cb,a+Da(h), cb,c +Dc(h), c b,e+De(h)} 1= min{∞, ∞, 2} =h2 1Db(d) = 2 Db(h) = 2
b
Db(i) = min{cb,a+Da(i), cb,c +Dc(i), c b,e+De(i)} = min{∞, ∞, ∞} = ∞ Db(e) = 1 Db(i) = ∞
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 b c Dc(g) = ∞
Da(d) = 1 8 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:

t=0 c’s state at t=0 is at c only


a b c
8 1
c’s state at t=0 has propagated to b, and
t=1 may influence distance vector
computations up to 1 hop away, i.e., at b 1 1
t=1
c’s state at t=0 may now influence distance t=2
t=2 vector computations up to 2 hops away, i.e.,
at b and now at a, e as well d e f
1 1
c’s state at t=0 may influence distance vector
t=3 computations up to 3 hops away, i.e., at b,a,e
and now at c,f,h as well 1 1 1 t=3
c’s state at t=0 may influence distance
vector computations up to 4 hops away, i.e.,
t=4 at b,a,e, c, f, h and now at g,i as well
g
1
h 1
i
t=4
Comparison of Link-state and
Distance vector
Number of exchange Reliability: If one routers
messages provide incorrect information
 LS: n nodes, E links, LS:
O(nE) messages  The router may send out
 DV: Exchange only with incorrect cost
neighbor  Each node calculate its
own routing table
Convergent time DV:
 LS: Complexity O(n2)  Incorrect distance vector
 DV: Varies may be sent out
 Each node calculate its
DV based to what receives
from the neighbor
 Error propagates in the
network. 66
Hierarchical routing
Autonomous System
Intra and Inter domain routing

67
Making routing scalable

our routing study thus far - idealized


 all
routers identical
 network “flat”

… not true in practice

scale: billions of destinations: administrative autonomy:


 can’t store all destinations in  Internet: a network of networks
routing tables!  each network admin may want to
 routing table exchange would control routing in its own network
swamp links!
Internet approach to scalable
routing

aggregate routers into regions known as “autonomous


systems” (AS) (a.k.a. “domains”)
intra-AS (aka “intra-domain”): inter-AS (aka “inter-domain”):
routing among within same AS routing among AS’es
(“network”)  gateways perform inter-domain
 all routers in AS must run same routing (as well as intra-domain
intra-domain protocol routing)
 routers in different AS can run
different intra-domain routing
protocols
 gateway router: at “edge” of its own
AS, has link(s) to router(s) in other
AS’es
s3

Hierarchical structure of the


Internet
 Internet = network of networks
 Such networks can select its own routing policy
(routing domain)
 Such networks are called autonomous system (AS)
AS 2
AS 5
AS 1
AS 4
AS 3

70
Slide 70

s3 Combine 5 and 6
sonnh, 8/03/2008
s4

Autonomous System (AS)


 A set of routers with the same routing policy (routing protocol,
metric…) is aggregated into an AS
 Gateway: router connect between two ASes
 Each AS has an unique number (ASN - 16 bits or 32 bits).

2914 NTT-COMMUNICATIONS-2914 - NTT America, Inc.


3491 BTN-ASN - Beyond The Network America, Inc.
4134 CHINANET-BACKBONE No.31,Jin-rong Street
6453 GLOBEINTERNET Teleglobe America Inc.
24087 VNGT-AS-AP Vietnam New Generation Telecom
24066 VNNIC-AS-VN Vietnam Internet Network Information Center
17981 CAMBOTECH-KH-AS ISP Cambodia
……………………………….
71

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

forwarding table configured by


intra- and inter-AS routing
Intra-AS
Routing
Inter-AS
Routing algorithms
forwarding  intra-AS routing determine entries
table
for destinations within AS
 inter-AS & intra-AS determine
entries for external destinations
intra-AS
3c
routing3a inter-AS intra-AS
2c
3b 2arouting
routing
1c
2b
AS3 intra-AS
1a routing 1b AS2
1d
AS1
Inter-AS routing: a role in intradomain
forwarding
 suppose router in AS1 receives AS1 inter-domain routing must:
datagram destined outside of 1. learn which destinations reachable
AS1: through AS2, which through AS3
• router should forward packet 2. propagate this reachability info to
to gateway router in AS1, but
which one? all routers in AS1

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

Router A To 133.27.4.0/24 Router C


2 hop
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
2 hop 81
Review: DV routing (3)
 Friend of friend is friend

Net A
133.27.4.0/24

Router A To 133.27.4.0/24 Router C


2 hop To 133.27.4.0/24
To 133.27.4.0/24 3 hop
1 hop
Net B
Router B
133.27.5.0/24
Router D
To 133.27.4.0/24
2 hop 82
s5
s6

Review: DV routing (4)


 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
To 133.27.4.0/24 83
2 hop
Slide 83

s5 Explain in opposite way: How B is annouced


sonnh, 8/03/2008

s6 Expain that we announce networks address. not router id


sonnh, 8/03/2008
RIP: Exchange information
 Routing table of router is exchanged
 Periodic
 Node advertise its distance-vector with neighbors every
30s
 Each message contains up to 25 routing table entries
 In practice, multiple messages are sent
 Triggered
 When every entry changes, send copy of entry to
neighbors
 Neighbors use to update their tables

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

When it receives update, Hold down timer


Invalid timer restarts

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

192.168.0.0/24 192.168.1.0/24 192.168.2.0/24


s7

RIP: to avoid this loop


 Limit the maximum hop count
 16
 Split horizon
 The routing info will not return back to the sender
 Poison reverse
 When network is down, send update with metric
16
 That routing information become Hold-down
status

89
Slide 89

s7 16 TTL vs. this?


sonnh, 8/03/2008
OSPF (Open Shortest Path First) routing
 IGP
 “open”: publicly available - standard by IETF (current version, version
3, defined in RFC 2740)
 classic link-state
• each router floods OSPF link-state advertisements (directly over IP
rather than using TCP/UDP) to all other routers in entire AS
• multiple link costs metrics possible: bandwidth, delay
• each router has full topology, uses Dijkstra’s algorithm to compute
forwarding table (Shortest Path First)
 Advanced features
• security: all OSPF messages authenticated (to prevent malicious
intrusion)
• Large AS: Hierarchical OSPF
• Classless routing (able to use Variable-Length Subnet Masking -VLSM )
• Different metric for each link based on TOS (is not used in practice)

Network Layer: 5-90


s8

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

s8 Explain why we need to reduce the calculaiton


sonnh, 8/03/2008
Hierarchical OSPF
 two-level hierarchy: local area, backbone.
• link-state advertisements flooded only in area, or backbone
• each node has detailed area topology; only knows direction to
reach other destinations
area border routers: boundary router:
“summarize” distances connects to other
backbone ASes
to destinations in own backbone
area, advertise in router: runs
backbone OSPF limited to
local routers: backbone
• flood LS in area only area 3
• compute routing within
area
internal
• forward packets to routers
area 1
outside via area border
area 2
router
Which information is exchanged
among routers?
 Link-State Advertisement (LSA): Contain the link
and the cost to the neighbor
 For example, node A
 link to B, cost 30
A 20
 link to D, cost 20 D
 link to C, cost 10 C
10
20
 For example, node D 30 50

 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

Link state flooding


LSAX
LSAX
X A X A
X has link to A, cost 10 LSAX
X has link to C, cost 20 C B D C B D

(a) (b)

X A X A

LSAX LSAX
C B D C B D

LSAX
(c) (d) 97
Slide 97

s9 What information is flood


sonnh, 8/03/2008
Designated router (DR)

 To improving efficiency on exchanging link state


 Each router forms an adjacency with the designated
router (DR)
 Exchanging link state through DR
 If DR fails, use a BDR (Backup DR)
 How to select DR and BDR?

B A C B A C

D E D E
98

Do not use DR Use DR


s10

Neighbor & Adjacency

 Neighbor and adjacency are different concept!


 Adjacency: router which exchange the routing
information each other
 Neighbor: routers have a direct link
 Broadcast multi-access network (e.g Ethernet)
 Neighbor != Adjacency
 Point-to-point network
 Neighbor == Adjacency
 Non Broadcast Multi-access network (e.g. ATM)
 Exchanging data using unicast

99
Slide 99

s10 Chang the order


sonnh, 8/03/2008
s11

RIP vs. OSPF


RIP OSPF

Characteristics • Flat relation between • Support hierarchy


routers • Implementation is
• Implementation is complicated
simple • Middle and large-scale
• Small-scale network network
Scalability x o
Computational complexity little many
Convergence time Low speed high speed

Exchanged information Routing table Link-state information

Algorithm Distant vector type Link-state type


Neighbor discovery 30s 10s (Hello packet)
100
Metric number of hops Cost (band width)
Slide 100

s11 Exchanged informatio


Rip:
OSPF
sonnh, 8/03/2008
Inter-domain routing protocol

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

1c gateway routers run both eBGP and iBGP protocols


BGP basics
 BGP session: two BGP routers (“peers”) exchange BGP
messages over semi-permanent TCP connection:
• advertising paths to different destination network prefixes (BGP is a
“path vector” protocol)
 when AS3 gateway 3a advertises path AS3,X to AS2 gateway 2c:
• AS3 promises to AS2 it will forward datagrams towards X
AS 3 3b
AS 1b 3a 3c
1
1a 1c AS 2 3d
2b
1d BGP advertisement:
2a 2c
AS3, X
X
2d
s12

BGP: Path vector routing


 Which routing protocol can be used to connect multiple ASes?
 No universal metric – policy decisions
 LS: No, Metric are not the same, LS database too large – entire
Internet
 DV: Bellman-Ford algorithm may not converge
 Solution: Path vector routing
1 2 A
A
A B B→A C
3 A
1 C→B→A
A

D E
2 A 4 A
D→A D→A best path 105
C→B→A ×
Slide 105

s12 Change the symbol of router into AS


sonnh, 29/02/2008
Path attributes and BGP routes
 BGP advertised route: prefix + attributes
• prefix: destination being advertised
• two important attributes:
• AS-PATH: list of ASes through which prefix advertisement has passed
• NEXT-HOP: indicates specific internal-AS router to next-hop AS
 policy-based routing:
• gateway receiving route advertisement uses import policy to
accept/decline path (e.g., never route through AS Y).
• AS policy also determines whether to advertise path to other
other neighboring ASes
BGP path advertisement
AS 3 3b
AS 1b 3a 3c
1
1a 1c AS 2 3d X
2b
1d AS3, X
AS2,AS3,X 2a 2c

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

gateway router may learn about multiple paths to destination:


 AS1 gateway router 1c learns path AS2,AS3,X from 2a
 AS1 gateway router 1c learns path AS3,X from 3a
 based on policy, AS1 gateway router 1c chooses path AS3,X and
advertises path within AS1 via iBGP
Loop free mechanism
 Detecting loop depending on whether that router is
included in path of received routing information or not
 B will cancel the route to A, which B includes in path
B

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

 2d learns (via iBGP) it can route to X via 2a or 2c


 hot potato routing: choose local gateway that has least intra-
domain cost (e.g., 2d chooses 2a, even though more AS hops to
X): don’t worry about inter-domain cost!
BGP: achieving policy via
advertisements
A,w
B provider
x network
w A legend:
A,w 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 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

 router may learn about more than one route to


destination AS, selects route based on:
1. local preference value attribute: policy decision
2. shortest AS-PATH
3. closest NEXT-HOP router: hot potato routing
4. additional criteria
Các thuộc tính của đường đi
 ORIGIN
 Source of the information (IGP/EGP/incomplete)
 AS_PATH
 NEXT_HOP
 MED (MULTI_EXIT_DISCRIMINATOR)
 LOCAL_PREF
 ATOMIC_AGGREGATE
 AGGREGATOR
 COMMUNITY

118
Steps to select the path
: NEXT_HOP?
 Step 1: Compare LOCAL_PREF

 Step 2: Compare AS_PATH

 Step 3: Compare ORIGIN

 Step 4: Compare MED

 Step 5: Compare EBGP/IBGP

 Step 6: Compare cost to NEXT_HOP

 Step 7: Compare Router ID

119
Sử dụng LOCAL_PREF
 Chọn giá trị lớn hơn của
LOCAL_PREF AS1 AS1 AS1

 Control the upbound


bandwidth AS2
AS1 AS2
AS4
AS3

AS1 AS4
AS3 AS2 AS1

LOCAL_PREF 100 LOCAL_PREF 80


AS5
120
Routing with AS_PATH Prepend
AS2 AS3 AS5 AS4 AS5 AS5 AS5

AS1

AS2
AS3 AS5
AS4
AS3

AS5 AS5 AS5


AS5

121 AS5
Example of AS PATH

Network Next Hop Metric LocPrf Weight Path


4.79.201.0/26 203.178.136.29 700 500 0 7660 22388 11537 10886 40220
203.178.136.29 700 500 0 7660 22388 11537 10886 40220
203.178.136.29 700 500 0 7660 22388 11537 10886 40220
6.1.0.0/16 203.178.136.29 700 500 0 7660 22388 11537 668
203.178.136.29 700 500 0 7660 22388 11537 668
203.178.136.29 700 500 0 7660 22388 11537 668
6.2.0.0/22 203.178.136.29 700 500 0 7660 22388 11537 668

122
Example of AS PATH prepend

Network Next Hop Metric LocPrf Weight Path


8.5.192.0/22 203.178.136.14 100 0 2516 209 13989 13989 13989 13989
203.178.136.14 100 0 2516 209 13989 13989 13989 13989
203.178.136.14 100 0 2516 209 13989 13989 13989 13989
8.5.196.0/24 203.178.136.14 100 0 2516 209 13989 13989 13989 13989
203.178.136.14 100 0 2516 209 13989 13989 13989 13989
203.178.136.14 100 0 2516 209 13989 13989 13989 13989
8.5.200.0/22 203.178.136.14 100 0 2516 209 13989 13989 13989 13989
203.178.136.14 100 0 2516 209 13989 13989 13989 13989

Some AS are repeated on the path to make it longer


and not being selected

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

How to see routing table at AS2


Prefix AS_PATH MED
AS2 172.16.0.0/16 AS1 100 ◎
172.16.0.0/16
124 AS1 200
Load balancing with MED
 Set MED for different paths
 Also control the bandwidth
172.16.0.0/16、172.17.0.0/16
AS1
Routing information of AS1 Routing information of AS1
172.16.0.0/16 = MED 100 172.16.0.0/16 = MED 200
172.17.0.0/16 = MED 200 172.17.0.0/16 = MED 100

Route used for Route used for


172.16.0.0/16 172.17.0.0/16
AS2

125

You might also like