Vous êtes sur la page 1sur 45

Routing Protocols

1
Router
A hardware device designed to
 take incoming packets,
 analyze the packets,
 moving the packets to another network,
 converting the packets to another network interface,
 dropping the packets,
 directing packets to the appropriate locations

2
A big WAN

3
What’s Routing
Routing - path finding from one end to the other
 Routing occurs at layer 3

Application layer Application layer


Presentation layer Presentation layer
Session layer Session layer
Transport layer Transport layer
Network layer Network layer Network layer
Data link layer Data link layer Data link layer
Physical link Physical link Physical link

Network A Network B

4
IP Routing
 IP performs:
 search for a matching host address
 search for a matching network address
 search for a default entry
 Routing done by IP router, when it searches the
routing table and decide which interface to end a
packet out.

incoming

which interface ?

5
Routing
Routing protocol
Goal: determine “good” path 5
(sequence of routers) thru
B 3 C
network from source to dest. 5
2
A 2 F
1
Graph abstraction for 1
3
D E 2
routing algorithms: 1
 graph nodes are routers
 graph edges are physical  “good” path:
links  typically means minimum

 link cost: delay, $ cost, or cost path


congestion level  other definitions possible

6
Routing Component
 Three important routing elements :
 algorithm
 database
 protocol
 Algorithm : can be differentiate based on several
key characteristics
 Database : table in routers or routing table
 Protocol: the way information for routing to be
gathered and distributed

7
Routing Tables
 Routing is carried out in a router by consulting
routing table.
 No unique format for routing tables, typically table
contains:
 address of a destination
 IP address of next hop router
 network interface to be used
 subnet mask for the this interface
 distance to the destination

8
Routing Algorithm
Design goals
 Optimality - compute the best route
 Simplicity/low overhead - efficient with a minimum
software and utilization overhead
 Robustness/stability- perform correctly in the face
of unusual circumstances
 Rapid convergence- responds quickly when the
network changes
 Flexibility- accurate adapt to a variety of network

9
Routing Protocols
 Routing protocol: protocol to exchange of
information between routers about the current
state of the network
 Routing protocol jobs
 create routing table entries
 keep routing table up-to-date
 compute the best choice for the next hop router

10
Routing Protocol Metrics
 How do we decide that one route is better than another?
 Metric: the determining factor used by a routing algorithm to
decide which route to a network is better than another
 Examples of metrics:
 Bandwidth - capacity
 Delay - time
 Load - amount of network traffic
 Reliability - error rate
 Hop count - number of routers that a packet must travel
through before reaching the destination network
 Cost - arbitrary value defined by the protocol or
administrator

11
Hop Count
 A hop is defined as a passage through one router

2 hops

1 hop 1 hop
R1 R2

1 hop 1 hop

R3

12
Routing Algorithms
 Static routing
 Calculated beforehand, offline
 Default routing
 “If I don’t recognize the destination, just send the packet
to Router X”
 Dynamic routing protocol
 Distance-vector algorithms
 Link-state algorithms
 Source routing Vs. Hop-by-hop

13
Routing Algorithm: Static Route
 Manually configuration routing table
 Can’t react dynamically to network change such as
router’s crash
 Work well with small network or simple topology

point to point
connection

route to this
way only, no need
for update

14
Routing Algorithm: Static Technique
Flooding / Brute force routing
 Every incoming packet is sent out every outgoing
 Retransmit on all outgoing at each node
 Simple technique, require no network information
 Generate vast numbers of duplicate packet

flooding
incoming

15
Static Routing Example
172.16.20.1 172.16.20.2 172.16.40.1 172.16.40.2

Router A Router B Router C


s0 s0
s0 s1

e0 e0 e0
172.16.10.1 172.16.30.1 172.16.50.1

Host A Host B Host C

172.16.10.2 172.16.30.2 172.16.50.2

RouterA(config)#ip route 172.16.50.0 255.255.255.0 172.16.20.2


Send packets for subnet 50 to 172.16.20.2 (Router B)
16
Default Routing Example
172.16.20.1 172.16.20.2 172.16.40.1 172.16.40.2

Router A Router B Router C


s0 s0
s0 s1

e0 e0 e0
172.16.10.1 172.16.30.1 172.16.50.1

Host A Host B Host C

172.16.10.2 172.16.30.2 172.16.50.2

RouterA(config)#ip route 0.0.0.0 0.0.0.0 172.16.20.2


If it’s not local, send it to 172.16.20.2 (Router B)
17
Routing Algorithm: Dynamic Route
 Network protocol adjusts automatically for
topology or traffic changes

 Routing protocol maintains and distributes routing


information

18
Classification of routing protocols

19
Interior Versus Exterior Routing
Protocols
 Interior routing protocols are used within an
autonomous system
 Exterior routing protocols are used between
autonomous systems
Autonomous system (two definitions that are often used):
“A set of routers that presents a common routing policy to the
internetwork”
“A network or set of networks that are under the administrative control
of a single entity”

20
Distance Vector Routing Protocol
 Distance means routing metric
 Vector means destination
 Flood routing table only to its neighbors
 RIP is an example
 Also known as Bellmann-Ford algorithm or Ford-
Fulkerson algorithm

21
Distance Vector Routing
 Router maintains a routing table that lists known
networks, direction (vector) to each network, and the
distance to each network
 Router periodically (every 30 seconds, for example)
transmits the routing table via a broadcast packet that
reaches all other routers on the local segments
 Router updates the routing table, if necessary, based on
received broadcasts

22
Distance-Vector Routing Tables

23
Distance Vector Routing Algorithm
Distance Table data structure
 each node has its own row for each
possible destination
 column for each directly-attached
neighbor to node
 example: in node X, for dest.Y via
neighbor Z:

distance from X to
X = Y, via Z as next hop
D (Y,Z)
= c(X,Z) + min {DZ(Y,w)}
w

24
Example: Distance Table for E
Column only for each neighbor

1 cost to destination via


B C E
7 D () A B D
A 8 2
1 A 1 14 5
E E D
D (row, col) 2
B 7 8 5
E
D (C,D) = c(E,D) + min {DD(C,w)}
w C 6 9 4
= 2+2 = 4
E
D (A,D) = c(E,D) + min {DD(A,w)}
= 2+3 = 5
w D 4 11 2
Loop back through E!
Rows for each possible dest !
E
D (A,B) = c(E,B) + min {D B(A,w)}
w
= 8+6 = 14
25 Loop back through E!
Distance table gives routing table
= least cost
cost to destination via
E Outgoing link
D () A B D
to use, cost

A 1 14 5 A A,1

B 7 8 5 B D,5

C 6 9 4 C D,4

D 4 11 2 D D,2

Distance table Routing table

26
Distance Vector Algorithm:

At all nodes, X:
1 Initialization (don’t start knowing link costs for all links in graph):
2 for all adjacent nodes v:
3 D X(*,v) = infty /* the * operator means "for all rows" */
4 D X(v,v) = c(X,v)
5 for all destinations, y
6 send min D X(y,w) to each neighbor /* w over all X's neighbors */
w

Then in steady state…

27
Distance Vector Algorithm (cont.):
8 loop
9 wait (until I see a link cost change to neighbor V
10 or until I receive update from neighbor V)
11
12 if (c(X,V) changes by d)
13 /* change cost to all dest's via neighbor v by d */
14 /* note: d could be positive or negative */
15 for all destinations y: D X(y,V) = D X(y,V) + d
16
17 else if (update received from V wrt destination Y)
18 /* shortest path from V to some Y has changed */
19 /* V has sent a new value for its min DV(Y,w) */
w
20 /* call this received new value is "newval" */
21 for the single destination y: D X(Y,V) = c(X,V) + newval
22
23 if we have a new min DX(Y,w)for any destination Y
w
24 send new value of min D X(Y,w) to all neighbors
w
25
28 26 forever
Dx(z) = min{c(x,y) +
Dx(y) = min{c(x,y) + Dy(y), c(x,z) + Dz(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 X hears news from Y and Z

from
from

y ∞∞ ∞ y 2 0 1
z ∞∞ ∞ z 7 1 0
node y table
cost to
x y z y
2 1
x ∞ ∞ ∞
x z
from

y 2 0 1 7
z ∞∞ ∞
node z table To start just know directly connected
cost to links…tell neighbors
x y z
x ∞∞ ∞
from

y ∞∞ ∞
z 7 1 0
time
29
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

from
y ∞∞ ∞ y 2 0 1 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
from

from
y 2 0 1 y 2 0 1 y 2 0 1 7
z ∞∞ ∞ z 7 1 0 z 3 1 0
node z table In steady
cost to cost to cost to
state, when
x y z x y z x y z have good
x ∞∞ ∞ x 0 2 7 x 0 2 3 news tell
from

from

neighbor
from

y ∞∞ ∞ y 2 0 1 y 2 0 1
z 7 1 0 z 3 1 0 z 3 1 0
time
30
Distance Vector Routing Update
 Step by step from router to router
 Slow convergence

• •
recompute R1’s recompute R2’s recompute R3’s
routing table routing table routing table

Œ
topology
R1 R2 R3 change

R2 sends out R3 sends out


the updated table the updated table
• Ž

31
Distance Vector: Broadcast (I)
 The first round
I, 1 hop
R1 J, 1 hop

J, 1 hop
K, 1 hop
J M, 1 hop
I
N, 1 hop
R3
K
R2 N, 1 hop
O, 1 hop
I, 1 hop
L N
K, 1 hop R5
M
L, 1 hop
O

R4
L, 1 hop
M, 1 hop
O 1 hop

32
Distance Vector: Broadcast (II)
 The second round I, 1 hop
J, 1 hop
K, 2 hops J, 1 hop
R1 L, 2 hops K, 1 hop
M, 2 hops M, 1 hop
N, 2 hops N, 1 hop
I, 2 hops N, 1 hop
J L, 2 hops O, 1 hop
I O, 2 hops J, 2 hops
R3 K, 2 hops
K M, 1 hop
R2 L, 2 hops

I, 1 hop L N
R5
K, 1 hop M
L, 1 hop
J, 2 hops O
M, 2 hops
N, 2 hops R4
O, 2 hops L, 1 hop
M, 1 hop
O, 1 hop
I, 2 hops
K, 2 hops
J, 2 hops
N, 2 hops

33
Distance Vector: Broadcast (III)
 The third round I, 1 hop
J, 1 hop
K, 2 hops
L, 2 hops J, 1 hop
R1 K, 1 hop
M, 2 hops
N, 2 hops M, 1 hop
O, 3 hops N, 1 hop N, 1 hop
I, 2 hops O, 1 hop
J L, 2 hops
I J, 2 hops
O, 2 hops K, 2 hops
R3
K M, 1 hop
R2 L, 2 hops
I, 3 hops
I, 1 hop
L N
K, 1 hop R5
M
L, 1 hop
J, 2 hops O
M, 2 hops
N, 2 hops
O, 2 hops R4
L, 1 hop
M, 1 hop
O, 1 hop
I, 2 hops
K, 2 hops
J, 2 hops
N, 2 hops

34
Distance Vector: Crashed Recovery
 R3 crashed R1

 New complete route of R1


J
I
R2 R3
K
R1 routing table
net hop via L N R5
M
I 1 N/A
J 1 N/A O
2 R2 net hop via
K
2 R2 I 1 N/A R4
L
2 R3 J 1 N/A
M
2 R3 K 2 R2
N
3 R5 L 2 R2
O
M 3 R2
N 4 R2
O 3 R2

35
Routing Information Protocol (RIP)
 First standard routing protocol developed for TCP/IP
environments
 RIP Version 1 is documented in RFC 1058 (1988)
 RIP Version 2 is documented in RFC 2453 (1998)
 Easy to configure and troubleshoot
 Broadcasts its routing table every 30 seconds; 25 routes per
packet
 Uses a single routing metric (hop count) to measure the
distance to a destination network; max hop count is 15

36
RIP V2 Features
 Includes the subnet mask with route updates
 Supports prefix routing (classless routing, supernetting)
 Supports variable-length subnet masking (VLSM)

 Includes simple authentication to foil crackers sending


routing updates

37
IGRP Solved Problems with RIP
 15-hop limitation in RIP
 IGRP supports 255 hops

 Reliance on just one metric (hop count)


 IGRP uses bandwidth, delay, reliability, load
 (By default just uses bandwidth and delay)

 RIP's 30-second update timer


 IGRP uses 90 seconds

38
EIGRP
 Adjusts to changes in internetwork very quickly
 Incremental updates contain only changes, not full
routing table
 Updates are delivered reliably
 Router keeps track of neighbors’ routing tables and
uses them as feasible successor
 Same metric as IGRP, but more granularity (32 bits
instead of 24 bits)

39
Link-State Routing
 Routers send updates only when there’s a change
 Router that detects change creates a link-state
advertisement (LSA) and sends it to neighbors
 Neighbors propagate the change to their neighbors
 Routers update their topological database if necessary

40
Open Shortest Path First (OSPF)
 Open standard, defined in RFC 2328
 Adjusts to changes quickly
 Supports very large internetworks
 Does not use a lot of bandwidth
 Authenticates protocol exchanges to meet security
goals

41
IS-IS
 Intermediate System-to-Intermediate System
 Link-state routing protocol
 Designed by the ISO for the OSI protocols
 Integrated IS-IS handles IP also

42
Path vector routing table

43
Border Gateway Protocol (BGP)
 Allows routers in different autonomous systems to
exchange routing information
 Exterior routing protocol
 Used on the Internet among large ISPs and major companies
 Supports route aggregation
 Main metric is the length of the list of autonomous
system numbers, but BGP also supports routing based on
policies

44
Routing Algorithm: Source Routing

 Source routing
 Source will determine the entire route
 Routers only act as store-forward devices
 Hop-by-hop
 Routers determine the path based on theirs own
calculation

45

Vous aimerez peut-être aussi