SlideShare a Scribd company logo
A Link-State Routing Algorithm

Dijkstra’s algorithm            Notation:
❒ net topology, link costs      ❒ c(x,y): link cost from node
  known to all nodes                x to y; = ∞ if not direct
   ❍ accomplished via “link         neighbors
      state broadcast”
                                ❒   D(v): current value of cost
   ❍ all nodes have same info       of path from source to
❒ computes least cost paths         dest. v
  from one node (‘source”) to
                                ❒   p(v): predecessor node
  all other nodes
                                    along path from source to v
   ❍ gives forwarding table
      for that node             ❒   N': set of nodes whose
                                    least cost path definitively
❒ iterative: after k
                                    known
  iterations, know least cost
  path to k dest.’s
                                                     Network Layer 4-75
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'

                                                     Network Layer 4-76
Dijkstra’s algorithm: example
Step        N'   D(v),p(v) D(w),p(w)             D(x),p(x)   D(y),p(y)   D(z),p(z)
   0         u         2,u       5,u                   1,u          ∞           ∞
   1       ux          2,u       4,x                               2,x          ∞
   2      uxy          2,u       3,y                                          4,y
   3     uxyv                    3,y                                          4,y
   4    uxyvw                                                                 4,y
   5   uxyvwz

                             5

                             v   3       w
                         2                   5
                 u           2           1        z
                                     3
                     1                       2
                             x   1
                                         y

                                                                 Network Layer 4-77
Dijkstra’s algorithm: example (2)
Resulting shortest-path tree from u:


                             v     w
                  u                    z
                             x     y

Resulting forwarding table in u:
    destination       link
              v       (u,v)
              x       (u,x)
              y       (u,x)
              w       (u,x)
              z       (u,x)
                                           Network Layer 4-78
Dijkstra’s algorithm, discussion
    Algorithm complexity: n nodes
    ❒ each iteration: need to check all nodes, w, not in N
    ❒ n(n+1)/2 comparisons: O(n2)
    ❒ more efficient implementations possible: O(nlogn)
    Oscillations possible:
    ❒ e.g., link cost = amount of carried traffic


        1   A                      A                      A                  A
                  1+e     2+e             0        0            2+e    2+e         0
    D       0 0       B   D                   B   D               B    D 1+e 1 B
                                  1+e 1                   0 0
        0         e           0           0           1         1+e     0     e
1
            C                      C                      C                C
                      1
            e
                          … recompute             … recompute         … recompute
        initially
                             routing
                                                                      Network Layer 4-79

More Related Content

PPTX
Deep dive into rsa
DOCX
Pde unit 1
PPT
An engineer 1+1=2
PDF
Prim1_secx
PPT
Computer security
PPT
PPTX
PDF
P5 - Routing Protocols
Deep dive into rsa
Pde unit 1
An engineer 1+1=2
Prim1_secx
Computer security
P5 - Routing Protocols

What's hot (14)

PDF
Analysis of Short RSA Secret Exponent d
PPTX
Cryptocurrency Jeopardy!
PPTX
Bitcoin Script
PDF
Dependency Analysis of RSA Private Variables
PDF
Security of RSA and Integer Factorization
PDF
Cyclic Attacks on the RSA Trapdoor Function
PPTX
RSA without Padding
PDF
Solutions to online rsa factoring challenges
PDF
RSA without Integrity Checks
PDF
Analysis of Shared RSA Modulus
PDF
RSA cracking puzzle
PPTX
Proofs of Work
PDF
An Analysis of Secure Remote Password (SRP)
PDF
SJUT/Mat210/Interpolation/Newton's Divided Difference 2013-14S2
Analysis of Short RSA Secret Exponent d
Cryptocurrency Jeopardy!
Bitcoin Script
Dependency Analysis of RSA Private Variables
Security of RSA and Integer Factorization
Cyclic Attacks on the RSA Trapdoor Function
RSA without Padding
Solutions to online rsa factoring challenges
RSA without Integrity Checks
Analysis of Shared RSA Modulus
RSA cracking puzzle
Proofs of Work
An Analysis of Secure Remote Password (SRP)
SJUT/Mat210/Interpolation/Newton's Divided Difference 2013-14S2
Ad

Similar to Dijkstra (20)

PPTX
5.2_video_slides.pptx
PPT
12 routing
PPTX
Computer networks chapter 5 network layer : control plane
PPT
PPT
3 network-transport
PPTX
Network Layer: Control Plane (Computer Network Course)
PPTX
Part 3 : building a network and supporting applications
PPT
Routing algorithm network layer
PPT
Data Communications and Networks Network Layer
PDF
08-routing-1-slides.pdf
PDF
Lecture set 5
PPT
routing1 1X3 Router (capable of routing the data packets.ppt
PPTX
Computer Science Assignment Help
PPT
11-RoutingThe development of wireless systems traces its roots .ppt
PDF
Lec12 on Computer Networks by Tarun Mangla.pdf
PPTX
Ad hoc routing
 
PPT
Routing and IP in Advance Computer Network,Vikram Snehi
PPT
11 routing
PDF
Foss4g presentation
PPTX
routing algorithm
5.2_video_slides.pptx
12 routing
Computer networks chapter 5 network layer : control plane
3 network-transport
Network Layer: Control Plane (Computer Network Course)
Part 3 : building a network and supporting applications
Routing algorithm network layer
Data Communications and Networks Network Layer
08-routing-1-slides.pdf
Lecture set 5
routing1 1X3 Router (capable of routing the data packets.ppt
Computer Science Assignment Help
11-RoutingThe development of wireless systems traces its roots .ppt
Lec12 on Computer Networks by Tarun Mangla.pdf
Ad hoc routing
 
Routing and IP in Advance Computer Network,Vikram Snehi
11 routing
Foss4g presentation
routing algorithm
Ad

More from David Wood (20)

PPTX
Internet of Things (IoT) two-factor authentication using blockchain
PPTX
Returning to Online Privacy?
PPTX
Methods for Securing Spacecraft Tasking and Control via an Enterprise Ethereu...
PPTX
BlockSW 2019 Keynote
PDF
Returning to Online Privacy - W3C/ANU Future of the Web Roadshow 20190221
PDF
Privacy in the Smart City
PDF
Controlling Complexities in Software Development
PDF
Privacy Concerns related to Verifiable Claims
PDF
Implementing the Verifiable Claims data model
PDF
So You Wanna be a Startup CTO 20170301
PDF
Functional manipulations of large data graphs 20160601
PDF
When Metaphors Kill
PDF
Secularism in Australia
PDF
Meditations on Writing in Paradoxes, Oxymorons, and Pleonasms
PDF
Building a writer's platform with social media
PDF
Summary of the Hero's Journey
PDF
Open by Default
PDF
Lod Then, Now and Next 20110926
PDF
Linked Data ROI 20110426
PDF
Introduction to Linked Data: RDF Vocabularies
Internet of Things (IoT) two-factor authentication using blockchain
Returning to Online Privacy?
Methods for Securing Spacecraft Tasking and Control via an Enterprise Ethereu...
BlockSW 2019 Keynote
Returning to Online Privacy - W3C/ANU Future of the Web Roadshow 20190221
Privacy in the Smart City
Controlling Complexities in Software Development
Privacy Concerns related to Verifiable Claims
Implementing the Verifiable Claims data model
So You Wanna be a Startup CTO 20170301
Functional manipulations of large data graphs 20160601
When Metaphors Kill
Secularism in Australia
Meditations on Writing in Paradoxes, Oxymorons, and Pleonasms
Building a writer's platform with social media
Summary of the Hero's Journey
Open by Default
Lod Then, Now and Next 20110926
Linked Data ROI 20110426
Introduction to Linked Data: RDF Vocabularies

Dijkstra

  • 1. A Link-State Routing Algorithm Dijkstra’s algorithm Notation: ❒ net topology, link costs ❒ c(x,y): link cost from node known to all nodes x to y; = ∞ if not direct ❍ accomplished via “link neighbors state broadcast” ❒ D(v): current value of cost ❍ all nodes have same info of path from source to ❒ computes least cost paths dest. v from one node (‘source”) to ❒ p(v): predecessor node all other nodes along path from source to v ❍ gives forwarding table for that node ❒ N': set of nodes whose least cost path definitively ❒ iterative: after k known iterations, know least cost path to k dest.’s Network Layer 4-75
  • 2. 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' Network Layer 4-76
  • 3. Dijkstra’s algorithm: example Step N' D(v),p(v) D(w),p(w) D(x),p(x) D(y),p(y) D(z),p(z) 0 u 2,u 5,u 1,u ∞ ∞ 1 ux 2,u 4,x 2,x ∞ 2 uxy 2,u 3,y 4,y 3 uxyv 3,y 4,y 4 uxyvw 4,y 5 uxyvwz 5 v 3 w 2 5 u 2 1 z 3 1 2 x 1 y Network Layer 4-77
  • 4. Dijkstra’s algorithm: example (2) Resulting shortest-path tree from u: v w u z x y Resulting forwarding table in u: destination link v (u,v) x (u,x) y (u,x) w (u,x) z (u,x) Network Layer 4-78
  • 5. Dijkstra’s algorithm, discussion Algorithm complexity: n nodes ❒ each iteration: need to check all nodes, w, not in N ❒ n(n+1)/2 comparisons: O(n2) ❒ more efficient implementations possible: O(nlogn) Oscillations possible: ❒ e.g., link cost = amount of carried traffic 1 A A A A 1+e 2+e 0 0 2+e 2+e 0 D 0 0 B D B D B D 1+e 1 B 1+e 1 0 0 0 e 0 0 1 1+e 0 e 1 C C C C 1 e … recompute … recompute … recompute initially routing Network Layer 4-79