7 Routing

You might also like

Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 27

Routing

Gihan Dias

060529
Routing
5
Routing protocol
3
Goal: determine “good” path B C 5
2
(sequence of routers) thru A 2 1 F
network from source to dest. 3
1 2
D E
1
Graph abstraction for
routing algorithms:  “good” path:
 graph nodes are  typicallymeans
routers minimum cost path
 graph edges are  other def’s possible

physical links
 linkcost: delay, $
cost, or congestion
level
What is the “shortest” path
from A to F?

3
B C 5
2

A 2 1
3 F
1
2
D 1 E
Routing Algorithm classification
Global or Local routing? Static or dynamic?
Global: Static:
 router has complete  routes change slowly over
topology, link cost info time
 e.g.: Airline Dynamic:
Local:  routes change more
 router knows physically- quickly
connected neighbors, link  periodicupdate
costs to neighbors
 in response to link
 iterative process of
cost changes
computation, exchange of
info with neighbors
Static Routing
Network Next Hop
192.168.1.10
192.168.1.0/24 Direct (1)
192.168.1.0/24 192.168.2.0/24 Direct (2)

192.168.1.254
A
192.168.2.254

192.168.2.0/24

192.168.2.22
Static Routing (2)
Network Next Hop
192.168.1.10
192.168.1.0/24 Direct (1)
192.168.2.0/24 Direct (2)
192.168.1.0/24
192.168.8.0/24 192.168.2.253
192.168.1.254 192.168.9.0/24 192.168.2.253
A 192.168.10.0/24 192.168.2.253
192.168.2.254
192.168.8.0/24 192.168.2.253

192.168.10.0/24
B

192.168.9.0/24
Static Routing (3)
Network Next Hop
192.168.1.10
192.168.1.0/24 Direct (1)
192.168.2.0/24 Direct (2)
192.168.1.0/24
192.168.8.0/22 192.168.2.253
192.168.1.254
A
192.168.2.254
192.168.8.0/24 192.168.2.253

192.168.10.0/24
B
Network Aggregation
192.168.9.0/24
Static Routing (4)
192.168.1.10
192.168.0.4/30

192.168.1.0/24
192.168.0.6
192.168.1.254 192.168.0.5
A C
192.168.2.254
192.168.8.0/24 192.168.16.0/24
192.168.2.253
192.168.10.0/24
B
Network Next Hop
192.168.9.0/24 192.168.1.0/24 Direct (1)
192.168.2.0/24 Direct (2)
192.168.8.0/22 192.168.2.253
192.268.16.0/24 192.168.0.6
Autonomous Routers

 Q: How can a router, which


is directly connected to
only a few other routers on
a network, find the paths to
1
B C
all other routers? 7
A 8 2
 It can exchange
1
information with its E D
2
neighbors, who exchange
info with their neighbors,
etc…
Distance Vector Routing

 Each node keeps a list of the “shortest


distance” to every other node, and the
best way to reach it
Distance Vector Routing: overview
Iterative, asynchronous: Each node:
each local iteration
caused by:
 local link cost change
wait for (change in local link
cost of msg from neighbor)
 message from neighbor:
its least cost path change
from neighbor recompute distance table
Distributed:
 each node notifies
if least cost path to any dest
neighbors only when its
has changed, notify
least cost path to any
neighbors
destination changes
 neighbors then notify
their neighbors if
necessary
Distance Vector Routing Algorithm
iterative:
Distance Table data structure
 continues until no
nodes exchange info.
 each node has its own table
 self-terminating: no
 row for each possible
“signal” to stop destination
 column for each directly-
asynchronous: attached neighbor to node
 nodes need not  example: in node X, for dest. Y
exchange info/iterate via neighbor Z:
in lock step!
distributed: distance from X to
 each node X = Y, via Z as next hop
D (Y,Z)
communicates only Z
= c(X,Z) + minw{D (Y,w)}
with directly-attached
neighbors
Distance Table: example
Node E
cost to destination via
E
D () A B D

1 A 1 14 5
B C
7
A 8 2
B 7 8 5

destination
1
E D
2
C 6 9 4

D 4 11 2
Distance table gives routing
table
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
destination

destination
C 6 9 4 C D,4

D 4 11 2 D D,4

Distance table Routing table


Link-State Routing

 Each router finds out information


about directly connected links
 Sends this information to neighbours
 Eventually each node knows about all
the links
 Each node computes best path to get
to each other node, based on its
knowledge about links
 If
information is consistent, then
network will route packets correctly
A Link-State Routing Algorithm

Dijkstra’s algorithm Notation:


 net topology, link costs known to  c(i,j): link cost from node
all nodes i to j. cost infinite if not
 accomplished via “link state
direct neighbors
 D(v): current value of
broadcast”
 all nodes have same info
cost of path from source
to dest. V
 computes least cost paths from  p(v): predecessor node
one node (‘source”) to all other along path from source to
nodes v, that is next v
 gives routing table for that  N: set of nodes whose
node least cost path definitively
 iterative: after k iterations, know known
least cost path to k dest.’s
Dijkstra’s algorithm: example
Step start N D(B),p(B) D(C),p(C) D(D),p(D) D(E),p(E) D(F),p(F)
0 A 2,A 5,A 1,A infinity infinity
1 AD 2,A 4,D 2,D infinity
2 ADE 2,A 3,E 4,E
3 ADEB 3,E 4,E
4 ADEBC 4,E
5 ADEBCF

5
3
B C 5
2
A 2 1 F
3
1 2
D E
1
Routing Protocols
RIP ( Routing Information Protocol)
 Distance vector algorithm
 Included in BSD-UNIX Distribution in 1982
 Distance metric: # of hops (max = 15 hops)
 Can you guess why?

 Distance vectors: exchanged among neighbors


every 30 sec via Response Message (also called
advertisement)
 Each advertisement: list of up to 25 destination nets
within AS
RIP: Example 4 intermediate
routers

w x y
A D B
z
C
Destination Network Next Router Num. of hops to dest.
w A 2
y B 2
z B 7
x -- 1
…. …. ....
Routing table in D
RIP: Example
A finds that z is
Dest Next hops
w - - Advertisement reachable via C
x - - from A to D
z C 4
…. … ...

w x y
A D B
4 hops to net z z

Destination Network Next Router Num. of hops to dest.


w A 2
y B 2
z B A 7 5
x -- 1
…. …. ....
Routing table in D
OSPF (Open Shortest Path
First)
 “open”: publicly available
 Uses Link State algorithm
 LS packet dissemination
 Topology map at each node
 Route computation using Dijkstra’s algorithm

 OSPF advertisement carries one entry per neighbor


router
 Advertisements disseminated to entire AS (via
flooding)
 Carriedin OSPF messages directly over IP (rather
than TCP or UDP
OSPF “advanced” features (not in
RIP)
 Security: all OSPF messages authenticated (to
prevent malicious intrusion)
 Multiple same-cost paths allowed (only one path in
RIP)
 For each link, multiple cost metrics for different TOS
(e.g., satellite link cost set “low” for best effort; high
for real time)
 Integrated uni- and multicast support:
 Multicast OSPF (MOSPF) uses same
topology data base as OSPF
 Hierarchical OSPF in large domains.
Inter-AS routing in the Internet

Border Gateway Protocol (BGP)


Internet inter-AS routing: BGP

 Path Vector protocol:


 similar to Distance Vector protocol
 each Border Gateway broadcast to
neighbors (peers) entire path (i.e.,
sequence of AS’s) to destination
 BGP routes to networks (ASs), not
individual hosts
 E.g., Gateway X may send its path to
dest. Z:

Path (X,Z) = X,Y1,Y2,Y3,…,Z


Internet inter-AS routing: BGP
Suppose: gateway X send its path to peer gateway W
 W may or may not select path offered by X

 cost, policy (e.g., don’t route via competitors


AS), loop prevention reasons.
 If W selects path advertised by X, then:
Path (W,Z) = w, Path (X,Z)
 Note: X can control incoming traffic by controlling it’s
route advertisements to peers:
 e.g.,don’t want to accept traffic from Z ->
don’t advertise any routes to Z
Summary

 Routing principles
 linkstate
 distance vector

 Internet routing protocols


 RIP,
 OSPF,
 BGP

You might also like