










































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Material Type: Notes; Class: Computer Networks; Subject: Engineering Computer Science; University: University of California - Davis; Term: Spring 2005;
Typology: Study notes
1 / 50
This page cannot be seen from the preview
Don't miss anything!











































n path determination: route taken by packets from source to dest. Routing algorithms
n forwarding: move packets from router’s input to appropriate router output
n call setup: some network architectures require router call setup along path before data flows (not Internet)
network data link physical
network data link physical
network data link physical
network data link physical
network data link physical
network data link physical
network data link physical
network data link physical
application transport network data link physical
application transport network data link physical
The Internet Network layer
routing table
Routing protocols •path selection •RIP, OSPF, BGP
IP protocol •addressing conventions •datagram format •packet handling conventions
ICMP protocol •error reporting •router “signaling”
Transport layer: TCP, UDP
Link layer
physical layer
Graph abstraction for routing algorithms:
n graph nodes are routers
n graph edges are physical links n link cost: delay, $ cost, or congestion level
Goal: determine “good” path (sequence of routers) thru network from source to dest.
2 2 1
3
1
1 2
5
3
5
A Link-State Routing
Algorithm Dijkstra’s algorithm
n net topology, link costs known to all nodes n accomplished via “link state broadcast” n all nodes have same info
n computes least cost paths from one node (‘source”) to all other nodes n gives routing table for that node
n iterative: after k iterations, know least cost path to k dest.’s
Notation: n c(i,j): link cost from node i to j. cost infinite if not direct neighbors n D(v): current value of cost of path from source to dest. V n p(v): predecessor node along path from source to v, that is next v n N: set of nodes whose least cost path definitively known
Dijsktra’s Algorithm
1 Initialization: 2 N = {A} 3 for all nodes v 4 if v adjacent to A 5 then D(v) = c(A,v) 6 else D(v) = infty 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) + c(w,v) ) 13 /* new cost to v is either old cost to v or known 14 shortest path cost to w plus cost from w to v */ 15 until all nodes in N
Dijkstra’s algorithm: example
Step 0 1 2 3 4 5
start N A AD ADB ADBE ADBEC ADBECF
D(B),p(B) 2,A 2,A
D(C),p(C) 5,A 4,D 4,D 3,E
D(D),p(D) 1,A
D(E),p(E) infinity 2,D 2,D
D(F),p(F) infinity infinity infinity 4,E 4,E
2 2 1
3
1
1 2
5
3
5
Dijkstra’s algorithm: example
Step 0 1 2 3 4 5
start N A AD ADB ADBE ADBEC ADBECF
D(B),p(B) 2,A 2,A
D(C),p(C) 5,A 4,D 4,D 3,E
D(D),p(D) 1,A
D(E),p(E) infinity 2,D
D(F),p(F) infinity infinity infinity 4,E 4,E
2 2 1
3
1
1 2
5
3
5
Dijkstra’s algorithm: example
Step 0 1 2 3 4 5
start N A AD ADB ADBE ADBEC ADBECF
D(B),p(B) 2,A 2,A
D(C),p(C) 5,A 4,D 4,D 3,E
D(D),p(D) 1,A
D(E),p(E) infinity 2,D
D(F),p(F) infinity infinity infinity 4,E 4,E
2 2 1
3
1
1 2
5
3
5
Distance Vector Routing
Algorithm
distributed:
iterative:
asynchronous:
Distance Vector Algorithm:
1 Initialization: 2 for all adjacent nodes v: 3 D (,v) = infty / the * operator means "for all rows" / 4 D (v,v) = c(X,v) 5 for all destinations, y 6 send min D (y,w) to each neighbor / w over all X's neighbors */
X X
X w
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 (y,V) = D (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) / 20 / call this received new value is "newval" */ 21 for the single destination y: D (Y,V) = c(X,V) + newval 22 23 if we have a new min D (Y,w)for any destination Y 24 send new value of min D (Y,w) to all neighbors 25 26 forever
w
X X
X X
X
w w
Distance Vector Algorithm:
example
(^27)
1
Distance Vector Algorithm:
example
(^27)
1
D (Y,Z) X (^) c(X,Z) + min {D (Y,w)} = w = (^) 7+1 = 8
Z
D (Z,Y) X (^) c(X,Y) + min {D (Z,w)} = w = (^) 2+1 = 3
Y