








































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!









































CS 3251 - Computer Networks I
CS 3251 - Computer Networks I Tech Announcements
CS 3251 - Computer Networks I Tech Chapter 4: Network Layer
CS 3251 - Computer Networks I Tech 1 2 3 0111 value in arriving packet’s header routing algorithm local forwarding table header value output link 0100 0101 0111 1001 3 2 2 1 Interplay between routing, forwarding
CS 3251 - Computer Networks I Tech Graph abstraction: costs
CS 3251 - Computer Networks I Tech What are the costs?
CS 3251 - Computer Networks I Tech Chapter 4: Network Layer
CS 3251 - Computer Networks I Tech A Link-State Routing Algorithm Dijkstra’s algorithm
CS 3251 - Computer Networks I Tech Dijsktra’s Algorithm 1 Initialization: 2 N' = {u} 3 for all nodes v 4 if v adjacent to u 5 then D(v) = c(u,v) 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) + 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'
CS 3251 - Computer Networks I Tech Dijkstra’s algorithm: example
u ux uxy uxyv uxyvw uxyvwz D(v),p(v) 2,u 2,u 2,u D(w),p(w) 5,u 4,x 3,y 3,y D(x),p(x) 1,u D(y),p(y) ∞ 2,x D(z),p(z) ∞ ∞ 4,y 4,y 4,y u x^ y v w z 2 2 1 3 1 1 2 5 3 5
CS 3251 - Computer Networks I Tech Dijkstra’s algorithm: example
u ux uxy uxyv uxyvw uxyvwz D(v),p(v) 2,u 2,u 2,u D(w),p(w) 5,u 4,x 3,y 3,y D(x),p(x) 1,u D(y),p(y) ∞ 2,x D(z),p(z) ∞ ∞ 4,y 4,y 4,y u x^ y v w z 2 2 1 3 1 1 2 5 3 5
CS 3251 - Computer Networks I Tech Dijkstra’s algorithm: example
u ux uxy uxyv uxyvw uxyvwz D(v),p(v) 2,u 2,u 2,u D(w),p(w) 5,u 4,x 3,y 3,y D(x),p(x) 1,u D(y),p(y) ∞ 2,x D(z),p(z) ∞ ∞ 4,y 4,y 4,y u x^ y v w z 2 2 1 3 1 1 2 5 3 5
CS 3251 - Computer Networks I Tech Dijkstra’s algorithm: example
u ux uxy uxyv uxyvw uxyvwz D(v),p(v) 2,u 2,u 2,u D(w),p(w) 5,u 4,x 3,y 3,y D(x),p(x) 1,u D(y),p(y) ∞ 2,x D(z),p(z) ∞ ∞ 4,y 4,y 4,y u x^ y v w z 2 2 1 3 1 1 2 5 3 5
CS 3251 - Computer Networks I Tech Dijkstra’s algorithm: example (2) Resulting shortest-path tree from u: v x y w z (u,v) (u,x) (u,x) (u,x) (u,x) destination link Resulting forwarding table in u: u x^ y v w z