Routing - Technion moodle

advertisement
•
•
•
4. 1 Introduction
4.2 Virtual circuit and
datagram networks
4.3 IP: Internet Protocol
•
•
•
Datagram format
IPv4 addressing
4.4 Routing: Concepts and
Algorithms
•
•
•
•
•
•
•
•
Introduction
Math Detour – Graph Theory
Routing via Broadcast – PI, PIF
Connectivity Test – CT
Distributed Routing
Bellman – Ford – Distance Vector
Link State
Optimal Routing
• Network Model
• Math Detour – Convexity
• Flow Deviation
• Math Detour – Inequality
Constraints
• Optimal Routing – Necessary
and Sufficient Conditions
Chapter 4: Network Layer
• 4.5 Routing in the
Internet
•
•
•
•
Hierarchical Routing
RIP
OSPF
BGP
• 4.6 Broadcast and
multicast routing
Network Layer
4-1
Routing
Definition: selection of path(s) between source and destination over which
data will travel from source to destination
•
Routing process is complicated because:
•
requires cooperation between a large number of nodes ( not only
neighbors )
•
needs to cope with a large number of situations, sometimes
unpredictable
•
performance requirements may be strict because it is a basic part of
the operation of the network
•
Two aspects:
•
path selection
•
transfer of data over the path (data forwarding)
Normally second part is simpler than the first. Second operation may be
performed using tables in the nodes (to be seen shortly) or description of
the entire path in the header of the message (Source Routing).
•
Routing Algorithm classification
Global or decentralized
information?
Global:
• all routers have complete
topology, link cost info
• “link state” algorithms
Decentralized:
• router knows physicallyconnected neighbors, link
costs to neighbors
• iterative process of
computation, exchange of
info with neighbors
• “distance vector” algorithms
Static or dynamic?
Static:
• routes change slowly
over time
Dynamic:
• routes change more
quickly
• periodic update
• in response to link
cost changes
•
Routing Protocol Requirements
•
Performance: delay, throughtput, etc.
•
Correctness: messages should reach destination
•
Reliability
•
Stability and Convergence
•
Fairness: in the enclosed example, maximum traffic will not allow
traffic from X to X’
•
Performance Criteria
•
Throughput, i.e. amount of traffic
•
Low Delay
• Network point of view
• User point of view
•
Cost
•
Other network-specific criteria
How does the Routing Protocol affect Network Performance ?
•
•
•
•
•
•
The network should apply procedures to limit the amount of traffic that enters the
network, thus better routing will allow more traffic to traverse the network
On the other hand, given the throughput, better routing will provide lower delay (as we
shall see shortly) and more throughput.
Example for throughput: all links have 10 units capacity
Low load: 5 units from 1 to 6 and from 2 to 6
•
via 3 and 5 respectively: good routing
•
both via 4 : bad routing (more congestion – higher delay)
source
High load: 5 units from 1 to 6,
source
15 units from 2 to 6
1
•
if no flow splitting is allowed,
2
( at least ) 5 units are rejected
4
•
if splitting is allowed, we can handle all
requirements, e.g. by sending the traffic
from 1 via 3, half of the traffic from 2
3
via 4 and the other half via 5
5
Maximum Load:
•
both flows via 4, max. flow = 10, bad choice
6
•
no splitting, max. =20 , better routing
dest
•
with splitting, max = 30
Graph abstraction
5
2
u
2
1
Graph: G = (N,E)
v
x
3
w
3
1
5
1
y
z
2
N = set of routers = { u, v, w, x, y, z }
E = set of links ={ (u,v), (u,x), (v,x), (v,w), (x,w), (x,y), (w,y), (w,z), (y,z) }
Remark: Graph abstraction is useful in other network contexts
Example: P2P, where N is set of peers and E is set of TCP connections
Graph abstraction: costs
5
2
u
v
2
1
x
• c(x,x’) = cost of link (x,x’)
3
w
3
1
5
1
y
2
- e.g., c(w,z) = 5
z
• cost could always be 1, or
proportional to delay or
inversely related to bandwidth,
or inversely related to
congestion
Cost of path (x1, x2, x3,…, xp) = c(x1,x2) + c(x2,x3) + … + c(xp-1,xp)
Question: What’s the least-cost path between u and z ?
The most obvious routing algorithm:
algorithm that finds least-cost path
•
•
•
4. 1 Introduction
4.2 Virtual circuit and
datagram networks
4.3 IP: Internet Protocol
•
•
•
Datagram format
IPv4 addressing
4.4 Routing: Concepts and
Algorithms
•
•
•
•
•
•
•
•
Introduction
Math Detour – Graph Theory
Routing via Broadcast – PI, PIF
Connectivity Test – CT
Distributed Routing
Bellman – Ford – Distance Vector
Link State
Optimal Routing
• Network Model
• Math Detour – Convexity
• Flow Deviation
• Math Detour – Inequality
Constraints
• Optimal Routing – Necessary
and Sufficient Conditions
Chapter 4: Network Layer
• 4.5 Routing in the
Internet
•
•
•
•
Hierarchical Routing
RIP
OSPF
BGP
• 4.6 Broadcast and
multicast routing
Network Layer
4-8
Graphs - definitions
•
•
•
•
•
•
•
•
•
•
Graph (N,A)
• A - collection of links
• N - collection of nodes
link is denoted by (n1, n2) or by ai
Walk - Arbitrary collection of successive links
Path - Loop-less walk ( no node appears more than once )
Cycle - walk that starts and ends at the same node
Connected graph - there is a path between every pair of nodes
Non-connected graph
Sub-graph - Part of a given graph
Tree - Connected loop-less graph
Spanning Tree for graph G is a tree that is a sub-graph of G and
contains all nodes of G
Spanning Tree Algorithm
•
•
•
Given a connected graph G = ( N,A)
1. Select an arbitrary node V, N’={V}, A’={}
2. If N=N’, stop. A’ is the Spanning Tree.
A'  A'{( i, j )}, N '  N '{ j}
3. Select a link (i,j), such that i  N ' , j  N ' . Update
4. Go to 2
Proof:
•
there always exists a link in 3. ( since G is connected )
•
A’ is always a tree
•
the final A’ is spanning
Properties
•
Any connected graph G = (N,A) has a spanning tree
•
in any graph G holds | A || N | 1
•
holds
| A || N | 1 iff G is a tree.
Routing in Networks of LAN’s
•
•
Here the LAN’s are the “Network
Nodes” and the bridges are the
“Network Links”
The routing is done on a Spanning
Tree, because:
• Need to be able to reach each
LAN from each LAN
• difficult to split traffic ( each
LAN is a broadcast medium )
Minimum Spanning Tree (MST)
If Network links are not the same, different Spanning Trees have
different properties, we want to select the Spanning Tree with the
“best performance”
• Assumption: The “quality” of each link can be measured and
expressed as a strictly positive number ( e.g. delay, load, etc.)
• Definition: “tree weight” = sum of tree link weights.
Problem: Given a graph G=(N,A), with link weights {wij}, select an MST,
i.e. the Spanning Tree with minimum weight among all Spanning
Trees
Definitions:
• segment = sub-graph of a MST
• outgoing link = link with one end in the segment and the other
outside the segment
•
Minimum Spanning Tree - continued
  (i, j ) be the outgoing link from F,
Lemma: Given a segment F, let
i  F , j  F with minimum weight. Then F  
is also a segment.
Proof:
Let M be the MST that F belongs to. If   M then qed. Suppose   M
We shall show that there is another MST M’ for which F   is a
segment.
Since M is a Spanning Tree, M   generates a loop, with all links, except  ,
 
in M. Since j  F , there exists an additional link
that
belongs to the loop and that is outgoing from F. This is because traveling
along the loop, we leave F when we cross  . The link that takes us back
to F is  .
Let M’ be the graph that we get when we delete  from M and add  , M’
is connected, has |N|-1 links and no loops, hence it is a Spanning Tree.
Since w  w , M’ is a MST that includes F and  thus F  
is a
segment.

M
F
j

i
MST algorithms
•
•
Prim-Dijkstra
• Select any node as a first segment.
• Keep enlarging the segment, by selecting the minimum
outgoing edge.
Kruskal
• start with |N| segments, each composed of one node.
• Select a minimum weight link and combine two segments.
• Convenient for distributed computation.
Example MST algorithms
Topology
Kruskal
B
1
2
s
s
s
s
6
3
7
8
5
s
s
9
A
s
2
Prim Dijkstra
s
s
s
s
s
s
Shortest Path Routing
Routing along MST doesn’t always make sense:
•
does not make use of all routes
•
there are shorter routes ( e.g. between nodes A and B on previous slide )
•
Therefore, there is need to find shortest paths between all sourcedestination pairs
Problem: Given a weighted graph, find Minimum Weight Path between all sourcedestination pairs
Notes:
•
Path Length = sum of link weights ; this is often a good measure, but not
always. E.g. if we want to find bottleneck, then we look for min(link
weights)
•
All weights are strictly positive
•
Every Shortest Path is loop-free (easy to see, since if there were loops
we could delete them and get shorter paths.
•
Bellman-Ford method
•
•
•
•
•
Find Shortest Paths to a given destination by classifying the paths according to
their physical lengths ( one link, two links, etc.)
Notations and definitions:
•
h-path = path from i to dest with at most h links
wij
•
= weight of link (i,j), wij   if link is nonexistent, wii  0
.
h
•
= estimated weight of shortest h-path from i to dest
Di
h
•
= weight of actual shortest h-path from i to dest
Xi
Algorithm:
•
initialization: i  dest , Di 0  
; h, Ddest h  0
•
in each step, for each h  0
and for each i ,
h 1
h
• do: Di  min j ( wij  D j ) , link for which minimum is achieved is the
link on the shortest (h+1)-path to dest
•
completion: when Di h1  Di h
Reason:
•
In each step, concatenate the h-hop path with the (h+1)- st hop to minimize
the sum.
http://en.wikipedia.org/wiki/Bellman%E2%80%93Ford_algorithm
Example of Bellman-Ford
Step 0:
2
dest 0 1
3
Step 2:
1
2
3
4
3
1
1
1
3
1
1
01
1
4
4
4
1
Step 1:
1
3
2
4
4
5
1
Step 3:
1
3
2
3
1
5
2
3
3
1
1
01
1
4
1
01
1
4
4
4
1
5
4
3
1
5
2
Proof of Bellman-Ford
Theorem:
•
after step h , holds Di h  X i h
.
h
•
The algorithm completes after at most |N| steps, and then Di is the
length of the shortest path from i to dest.
Proof: induction on h
Di1  min j [wij  D0j ]  wi ,dest , and indeed wi ,dest is the length of
•
for h=1:
the shortest 1- path
hk
•
assume statement is true for
, prove it’s true for h  k  1
•
from definition, since collection of paths with at most k links includes
collection of paths with at most k-1 links: X i k  X i k 1 thus from
induction hypothesis Di k  Di k 1
•
if shortest (k+1)-path from i to dest contains  k links, then its
length is X i k  Di k
•
if shortest (k+1)-path from i to dest contains k+1 links, then it is
composed of some link (i,j) and then from j to dest with exactly k
links. Therefore its length is:
Xi
•
k 1
 min j (wij  X j )  min j (wij  D j )  Di
k
k
k 1
since shortest path contains no loops, it can contain at most |N|-1
links, thus the algorithm terminates after at most |N| steps.
Bellman-Ford ( continued)
•
•
Number of calculations:
•
number of steps |N|
•
each step for |N|-1 nodes, for each node |N|-1 comparisons
•
total : O(|N|3) calculations
Determining shortest path from i to dest :
•
after sufficient number of steps holds the Bellman equation
Ddest  0 ; Di  min j ( wij  D j )
to determine the shortest path, select node k such that Di  wik  Dk
Node k is the next node on the shortest path from i to dest
•
repeat from k
•
in this way we can find all shortest paths to dest
Note: Collection of shortest paths to dest is a Spanning Tree ( normally
different from the MST).
•
•
Dijkstra’s algorithm
Algorithm for finding shortest paths :
•
Determine shortest paths in order of node distance from dest
•
closest node to dest is the neighbor of dest with smallest link weight
•
second closest node is
• neighbor of dest with second smallest link weight, or
• a node two hops away, when the last hop is the previously selected
link
Method: each node gets a temporary label that estimates its distance from
dest . When the estimate is validated, the label becomes final.
•
Notations:
•
P = set of nodes with final label
•
Di = label of node i
Dijkstra ( continued)
•
Initialization:
P  {dest} ; Ddest  0
; i  dest
Di  wi ,dest
iP
1. Find node
for which Di  min jP ( D j )
and P  P  {i}
•
2. If | P || N | stop.
iP
•
3. For all
, do Di  min jP ( Di , D j  wij )
and return to step 1.
i  P, j  P
Lemma: For every
, holds Di  D j
Proof: easy by induction. Step 1. Ensures that the statement holds for each
iteration.
•
Lemma: For each
, the label Di
gives the shortest path from i to
iP
dest on a path whose links, except for the first, have edges that belong to
P.
Proof: easy by induction. Step 3. ensures that the statement holds for a node
that enters P.
Number of calculations: |N|-1 iterations, operations/iteration proportional to
|N|, therefore total O(|N|2) : better than Bellman-Ford
Example of Dijkstra
Step 0:
2
3
3
1
3
4
3
1
1
1
3
Step 3:
1
2
1
1
1
1
4
4
4
1
Step 1:
1
3
2
5
3
4
1
Step 4:
1
3
2
3
1
5
3
3
1
1
1
1
1
01
4
1
4
4
4
1
5
4
3
Step 2:
1
2
3
1
Step 5:
1
3
2
4
3
1
5
2
3
3
1
1
1
1
4
1
01
1
4
4
4
1
5
2
4
3
1
5
2
2
Distributed Algorithms
In Networks, nodes are usually “smart” and we want to take advantage
of this.
A Distributed Algorithm is an algorithm performed, normally
asynchronously by all nodes while performing computations and
exchanging messages, so that together they achieve a common task.
We will start with the simplest Distributed Algorithm and build our
way up to more complicated ones.
•
•
•
4. 1 Introduction
4.2 Virtual circuit and
datagram networks
4.3 IP: Internet Protocol
•
•
•
Datagram format
IPv4 addressing
4.4 Routing: Concepts and
Algorithms
•
•
•
•
•
•
•
•
Introduction
Math Detour – Graph Theory
Routing via Broadcast – PI, PIF
Connectivity Test – CT
Distributed Routing
Bellman – Ford – Distance Vector
Link State
Optimal Routing
• Network Model
• Math Detour – Convexity
• Flow Deviation
• Math Detour – Inequality
Constraints
• Optimal Routing – Necessary
and Sufficient Conditions
Chapter 4: Network Layer
• 4.5 Routing in the
Internet
•
•
•
•
Hierarchical Routing
RIP
OSPF
BGP
• 4.6 Broadcast and
multicast routing
Network Layer 4-25
Routing via Broadcast
Problem: Source node wants to transmit same information to all nodes
in the network (broadcast)
• Best performance: on Spanning Tree, if one is available, if not,
easiest to “flood”
Flooding: each node sends information to all its neighbors
Advantages:
• No need to know network structure
• No need to know network current topology
• Reliable and fast: every connected node will get the information
at the earliest possible time.
Assumptions and notations:
• every node knows its adjacent topology
• every node assigns local id’s to its adjacent links
• MSG(info) - message carrying the information info
Routing via Broadcast (continued)
Protocol PI ( Propagation of Information )
•
Every node i performs the following algorithm ( the source node receives
START):
m0
initialization :
upon START or receipt of MSG(info)
if m=0 then
m 1
accept info
send MSG(info) to all neighbors
Notes:
•
•
•
Protocol is completely distributed; every node works independently and
upon its own schedule
The variable m makes sure that nodes will transfer and accept
information no more than once.
Last line can be changed to:
• send MSG(info) to all neighbors except the one MSG was received
from
Properties of PI
•
•
•
•
•
During the operation of the protocol, exactly one message travels on each
link in each direction
All nodes connected to the source will accept the info, exactly once
For each node i , let pi be the neighbor from which node i receives the first
MSG:
•
The collection {(i,pi)} forms a Spanning Tree
•
If wij is the delay on link (i,j), then the above is the tree of shortest
paths from source to all other node
If several nodes have the same info and start PI asynchronously, their PI’s
converge and all properties above hold, except that the collection {(i,pi)} will
form a Spanning Forest ( collection of non-overlapping trees whose union
spans all nodes)
The source does not know the termination time, i.e. some time when it can
be sure that all nodes have received the information. It knows the
information will be received and accepted by all nodes, but it doesn’t know
when.
Broadcast with termination indication (feedback) (PIF)
Protocol:
•
Use PI-type to broadcast information and to form Spanning Tree
•
Use Spanning Tree to collect termination information
Method:
•
node that accepts info, forwards it to all neighbors, except pi ( the
neighbor it has received the info from )
•
upon receipt of MSG from all neighbors, send info backwards on the
Spanning Tree ( towards source ).
•
Termination indication = source receives MSG from all its neighbors
Notations:
•
m = flag that indicates participation in protocol
•
N(l) = flag that indicates that the node has received MSG from
neighbor l
•
p = neighbor from which first MSG was received first
•
receive MSG from nil = START
Above notations are for each node i and each source s
mi ; N i (l ); pi
•
to distinguish between nodes:
•
to distinguish between sources: ms ; N s (l ); p s ; MSGs (info)
PIF algorithm
•
Every node i performs the following algorithm ( the source node receives
START):
initialization : mi s  0; pi s  nil; Ni s (l )  0 l
upon receipt of MSGs (info)
from l  neighbors  {nil}
Ni (l )  1
s
if
mi  0
s
mi  1;
s
then
(propagation phase)
pi  l;
s
accept info
send MSGs (info)
to all neighbors except l
(l '  neighbors
Ni (l ')  1)
if
then
send MSGs (info) to pi s
mi  0; l '  neighbors
s
(feedback phase)
Ni (l ')  0
s
• Properties:
– all connected nodes will accept
message exactly once
– one MSG on each link in each
direction
– collection {(i, pi )} form a spanning
tree
– all nodes perform mi s  0 and
complete protocol
– each node i completes protocol before
its preferred neighbor pi s
– source node completes protocol last,
and thus this is the termination
indication
Example PIF
2
8
1
1
source
3
3
8
7
1
6
6
5
5
6
3
4
6
2
1
1
1
3
3
4
4
5
5
1
6
time link m1 N1(1)
0
-0
0
0
-1
3 (1,2)
4 (2,4)
5 (2,3)
5 (4,3)
6 (1,3)
6 (3,4)
7 (4,2)
8 (3,2)
11 (3,1)
11 (2,1) 0
1/0
N1(2) p1 m2
0
-0
time
0
0
3
4
5
5
6
6
7
8
11
11
N3(2) N3(3) p3 m4 N4(1)
0
0
-- 0
0
link
---
m3 N3(1)
0
0
N2(1) N2(2) N2(3)
0
0
0
1
1
1
1
1
0
1
/0
/0
1/0
source
/0
N4(2)
0
p4
--
(2,4)
1
1
(4,3)
(1,3)
(3,4)
(4,2)
(3,2)
(3,1)
(2,1)
0
1/0
/0
1
1
0
/0
1
2
1
/0
1/0
1
1
2
2
1
/0
3
2
2
3
1
(1,2)
(2,3)
Example
p2
--
4
2
6
1
3
1
3
2
•
•
•
4. 1 Introduction
4.2 Virtual circuit and
datagram networks
4.3 IP: Internet Protocol
•
•
•
Datagram format
IPv4 addressing
4.4 Routing: Concepts and
Algorithms
•
•
•
•
•
•
•
•
Introduction
Math Detour – Graph Theory
Routing via Broadcast – PI, PIF
Connectivity Test – CT
Distributed Routing
Bellman – Ford – Distance Vector
Link State
Optimal Routing
• Network Model
• Math Detour – Convexity
• Flow Deviation
• Math Detour – Inequality
Constraints
• Optimal Routing – Necessary
and Sufficient Conditions
Chapter 4: Network Layer
• 4.5 Routing in the
Internet
•
•
•
•
Hierarchical Routing
RIP
OSPF
BGP
• 4.6 Broadcast and
multicast routing
Network Layer 4-33
Connectivity Test
Goal: every node wants to learn what are the nodes in its connected network
Protocol CT1:
•
every node sends its id in PI
•
nodes wake up when they get the first message, at which time they
start their own PI
Properties:
•
can be started asynchronously at several nodes
•
every node will receive the identity of every other connected node
•
disconnected nodes will not know of each other
•
a node cannot determine a termination time, i.e. a time when it knows
for sure the identities of all connected nodes
CT2
Idea: use PIF’s instead of PI’s
Protocol CT2:
•
A node starts its own PIF when:
• gets a START
• upon receiving the first message ( of some PIF started by another
node )
•
A node participates in every PIF started by other nodes and registers
every source of such a PIF
Properties:
•
can be started asynchronously at several nodes
•
every node will receive the identity of every other connected node
•
disconnected nodes will not know of each other
•
a node i can determine a termination time, i.e. a time when it knows for
jN
sure the identities of all connected nodes
. This time is the
time when i completes its own PIF. This property follows from the fact
i
that the broadcast phase of PIF reaches node i before the feedback
phase of PIF j
.
CT3
Idea: same as CT1, except that nodes broadcast their neighbors’ identities
along with their own identity
Properties:
•
all “good” properties of CT1
•
termination signal: when a PI j arrives, it also indicates that PI’s from
all neighbors of j will also arrive. Termination when all expected
identities have arrived.
•
each node needs to know or find out neighbors’ identities.
Additional variations on CT1, CT2, CT3:
•
encoded information to reduce MSG contents
•
reduction of number of messages
•
pruning of MSG contents
•
•
•
4. 1 Introduction
4.2 Virtual circuit and
datagram networks
4.3 IP: Internet Protocol
•
•
•
Datagram format
IPv4 addressing
4.4 Routing: Concepts and
Algorithms
•
•
•
•
•
•
•
•
Introduction
Math Detour – Graph Theory
Routing via Broadcast – PI, PIF
Connectivity Test – CT
Distributed Routing
Bellman – Ford – Distance Vector
Link State
Optimal Routing
• Network Model
• Math Detour – Convexity
• Flow Deviation
• Math Detour – Inequality
Constraints
• Optimal Routing – Necessary
and Sufficient Conditions
Chapter 4: Network Layer
• 4.5 Routing in the
Internet
•
•
•
•
Hierarchical Routing
RIP
OSPF
BGP
• 4.6 Broadcast and
multicast routing
Network Layer 4-37
Distributed Calculation of Shortest Paths
Motivation:
•
Since network conditions change, there is need to periodically recalculate the routing tables.
•
Reasons for preferring distributed calculation:
• congestion at central node
• survivability ( what if central node fails )
Goal: Distributed calculation of shortest paths. In fact a node needs to know
only the next hop to each destination, not necessarily the entire path, nor
the length of the path.
Basis: a node knows the information about its neighborhood.
Distributed Bellman-Ford
Assumptions:
•
every node knows the weights of its adjacent outgoing links
•
network remains connected (failures treated separately)
•
the protocol calculates paths from all nodes to some node dest
(separate calculations for each destination).
Bellman-Ford algorithm equations:
Initialization:
Di
•
h 1
min j ( wij  D j h ) i  dest

0
i  dest

After |N|-1 steps, the equations converge to:
min jN ( i ) ( wij  D j ) i  dest
Di  
0
i  dest

where N(i) is the set of neighbors of i
 i  dest
0
Di  
 0 i  dest
Synchronous Distributed Bellman-Ford
This is a direct implementation of the Bellman-Ford algorithm:
•
•
•
h
h 1
At step h , every node i calculates Di
from D j
neighbors and sends Di h to all neighbors.
Then h is incremented.
received from
Drawbacks:
•
needs synchronization between nodes - hard to do.
•
needs mechanism for early end of the protocol, if some link weight
changes during its operation
•
restart needs reset ( inefficient use of previous information)
Asynchronous Distributed Bellman-Ford
(Distance Vector Routing Protocol )
Protocol:
•
every node i performs Di  min jN (i ) (wij  Dj )
from time to time
Di
•
from time to time, every node i sends calculated
to all its
neighbors.
Assumptions:
•
nodes do not postpone forever update of Di
•
nodes do not postpone forever sending update to neighbors
•
on each link there is a DLC that ensures that messages sent on each link
arrive and preserve order
Variables at node i :
•
Di = estimate of distance from i to dest
•
Di(j) = estimate of distance from neighbor j to dest as received in the
last message from j
Algorithm for node i :
•
whenever there is a change in some wij or in Di (j), perform Di  min jN (i ) (wij  Di ( j ))
and update neighbors by sending them Di ; select the neighbor that
provides the minimum as your next-hop preferred neighbor towards
dest .
Asynchronous Distributed Bellman-Ford (continued)
•
•
Theorem (not easy to prove):
•
For any given initial condition, if changes in {wij} cease, the protocol
converges in finite time to a state where all Di reflect the shortest
distances to dest.
Note: the protocol should be performed separately for each dest . Update
messages can contain estimated distances for several or all destinations.
Example of update step
A
E
I
B
F
C
G
K
DJ A
DJ I
A
B
C
D
E
F
G
H
I
J
K
L
0
12
25
40
14
23
18
17
21
9
24
29
24
36
18
27
7
20
31
20
0
11
22
33
DJ H DJ K
D
H
L
J
Dest
dJ,i
dJ,A= dJ,I
8
= 10
20
31
19
8
30
19
6
0
14
7
22
9
21
28
36
24
22
40
31
19
22
10
0
9
dJ,H dJ,K
= 12 = 6
Table at node J
New
DJ
Line
8
20
28
20
17
30
18
12
10
0
6
15
A
A
I
H
I
I
H
H
I
J
K
K
stability
A=dest
• unbounded number of steps
• the “number”  should be
redefined as a bounded large
number
• to overcome the problem :
• run in parallel a protocol
with weights=1 and stop
when variables reach |N|
B
C
D
E
link AB recovers




1



1
2


1
2


1
2

4
after some time link AB fails
3
2
3
4
3
4
3
4
5
4
5
4
5
6
5
6
7
6
7
6
keeps going up indefinitely




Loops
73
15
1
a
1
8 4
62
b
100
S
Problem: Detecting Situations
when old information is
irrelevant and should
not be used
Loops
c
1
3
a
1
1
b
100
S
Poisoned reverse
•
If Z routes through Y to get to X then:
• Z sends to all neighbors, except Y, the true
estimated distance to X ( as usual), but
Z sends to Y an infinite distance (so Y won’t route to X
via Z)
Obviously, this solves only 2-node loops
•
•
Distance Vector Protocol
•
•
Distributed Asynchronous Bellman-Ford is also called Distance Vector
Protocol
The Distributed Asynchronous Bellman-Ford forms the basis for the
Routing Information Protocol (RIP) used in Internet and other Networks
•
•
•
4. 1 Introduction
4.2 Virtual circuit and
datagram networks
4.3 IP: Internet Protocol
•
•
•
Datagram format
IPv4 addressing
4.4 Routing: Concepts and
Algorithms
•
•
•
•
•
•
•
•
Introduction
Math Detour – Graph Theory
Routing via Broadcast – PI, PIF
Connectivity Test – CT
Distributed Routing
Bellman – Ford – Distance Vector
Link State
Optimal Routing
• Network Model
• Math Detour – Convexity
• Flow Deviation
• Math Detour – Inequality
Constraints
• Optimal Routing – Necessary
and Sufficient Conditions
Chapter 4: Network Layer
• 4.5 Routing in the
Internet
•
•
•
•
Hierarchical Routing
RIP
OSPF
BGP
• 4.6 Broadcast and
multicast routing
Network Layer 4-49
Link State Routing Protocol
Protocol:
•
every node broadcasts from time to time, like in CT3: sequence
number, its identity, the identity of its neighbors, the “weights” of its
adjacent links
•
every node uses the received information to maintain an updated
picture of the network topology and weights
•
every node performs a Dijkstra algorithm to find shortest path to each
node
•
first link of the resulting shortest path provides the forwarding table
entry to that destination
This is the basis for the OSPF ( Open Shortest Path First) algorithm used
in Internet and other networks
The protocol is distributed in the sense that the information is
disseminated in a distributed manner and each node makes its own
calculation ( Dijkstra)
Comparison of LS and DV algorithms
Message complexity
•
•
LS: with n nodes, E links,
O(nE) msgs sent
DV: exchange between
neighbors only
• convergence time varies
Speed of Convergence
•
•
LS: O(n2) algorithm requires
O(nE) msgs
• may have oscillations
DV: convergence time varies
• may be routing loops
• count-to-infinity problem
Robustness: what happens
if node malfunctions?
LS:
•
•
node can advertise
incorrect link cost
each node computes only
its own table
DV:
•
•
DV node can advertise
incorrect path cost
each node’s table used by
others
• error propagate thru
network
Download