SlideShare a Scribd company logo
1 of 5
Download to read offline
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

What's hot

Analysis of Short RSA Secret Exponent d
Analysis of Short RSA Secret Exponent dAnalysis of Short RSA Secret Exponent d
Analysis of Short RSA Secret Exponent dDharmalingam Ganesan
 
Cryptocurrency Jeopardy!
Cryptocurrency Jeopardy!Cryptocurrency Jeopardy!
Cryptocurrency Jeopardy!David Evans
 
Dependency Analysis of RSA Private Variables
Dependency Analysis of RSA Private VariablesDependency Analysis of RSA Private Variables
Dependency Analysis of RSA Private VariablesDharmalingam Ganesan
 
Security of RSA and Integer Factorization
Security of RSA and Integer FactorizationSecurity of RSA and Integer Factorization
Security of RSA and Integer FactorizationDharmalingam Ganesan
 
Cyclic Attacks on the RSA Trapdoor Function
Cyclic Attacks on the RSA Trapdoor FunctionCyclic Attacks on the RSA Trapdoor Function
Cyclic Attacks on the RSA Trapdoor FunctionDharmalingam Ganesan
 
Solutions to online rsa factoring challenges
Solutions to online rsa factoring challengesSolutions to online rsa factoring challenges
Solutions to online rsa factoring challengesDharmalingam Ganesan
 
An Analysis of Secure Remote Password (SRP)
An Analysis of Secure Remote Password (SRP)An Analysis of Secure Remote Password (SRP)
An Analysis of Secure Remote Password (SRP)Dharmalingam Ganesan
 
SJUT/Mat210/Interpolation/Newton's Divided Difference 2013-14S2
SJUT/Mat210/Interpolation/Newton's Divided Difference  2013-14S2SJUT/Mat210/Interpolation/Newton's Divided Difference  2013-14S2
SJUT/Mat210/Interpolation/Newton's Divided Difference 2013-14S2John Ham
 

What's hot (14)

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

Similar to Dijkstra

08-routing-1-slides.pdf
08-routing-1-slides.pdf08-routing-1-slides.pdf
08-routing-1-slides.pdfAdhiRizal2
 
From RNN to neural networks for cyclic undirected graphs
From RNN to neural networks for cyclic undirected graphsFrom RNN to neural networks for cyclic undirected graphs
From RNN to neural networks for cyclic undirected graphstuxette
 
Link Prediction in the Real World
Link Prediction in the Real WorldLink Prediction in the Real World
Link Prediction in the Real WorldBalaji Ganesan
 
Linear conformal mapping
Linear conformal mappingLinear conformal mapping
Linear conformal mappingTarun Gehlot
 
Module 3- transport_layer .pptx
Module 3- transport_layer           .pptxModule 3- transport_layer           .pptx
Module 3- transport_layer .pptxhariprasad279825
 
Bellman Ford Routing Algorithm-Computer Networks
Bellman Ford Routing Algorithm-Computer NetworksBellman Ford Routing Algorithm-Computer Networks
Bellman Ford Routing Algorithm-Computer NetworksSimranJain63
 
04 greedyalgorithmsii 2x2
04 greedyalgorithmsii 2x204 greedyalgorithmsii 2x2
04 greedyalgorithmsii 2x2MuradAmn
 
Chap10 slides
Chap10 slidesChap10 slides
Chap10 slidesHJ DS
 
Lecture_10_Parallel_Algorithms_Part_II.ppt
Lecture_10_Parallel_Algorithms_Part_II.pptLecture_10_Parallel_Algorithms_Part_II.ppt
Lecture_10_Parallel_Algorithms_Part_II.pptWahyuAde4
 
Convolution Neural Networks
Convolution Neural NetworksConvolution Neural Networks
Convolution Neural NetworksAhmedMahany
 
23 industrial engineering
23 industrial engineering23 industrial engineering
23 industrial engineeringmloeb825
 
Analysis of Pathfinding Algorithms
Analysis of Pathfinding AlgorithmsAnalysis of Pathfinding Algorithms
Analysis of Pathfinding AlgorithmsSigSegVSquad
 

Similar to Dijkstra (20)

5.2_video_slides.pptx
5.2_video_slides.pptx5.2_video_slides.pptx
5.2_video_slides.pptx
 
Routing Algorithm
Routing AlgorithmRouting Algorithm
Routing Algorithm
 
08-routing-1-slides.pdf
08-routing-1-slides.pdf08-routing-1-slides.pdf
08-routing-1-slides.pdf
 
P2P Supernodes
P2P SupernodesP2P Supernodes
P2P Supernodes
 
04 greedyalgorithmsii
04 greedyalgorithmsii04 greedyalgorithmsii
04 greedyalgorithmsii
 
From RNN to neural networks for cyclic undirected graphs
From RNN to neural networks for cyclic undirected graphsFrom RNN to neural networks for cyclic undirected graphs
From RNN to neural networks for cyclic undirected graphs
 
Link Prediction in the Real World
Link Prediction in the Real WorldLink Prediction in the Real World
Link Prediction in the Real World
 
DIJKSTRA_123.pptx
DIJKSTRA_123.pptxDIJKSTRA_123.pptx
DIJKSTRA_123.pptx
 
Linear conformal mapping
Linear conformal mappingLinear conformal mapping
Linear conformal mapping
 
Module 3- transport_layer .pptx
Module 3- transport_layer           .pptxModule 3- transport_layer           .pptx
Module 3- transport_layer .pptx
 
Bellman Ford Routing Algorithm-Computer Networks
Bellman Ford Routing Algorithm-Computer NetworksBellman Ford Routing Algorithm-Computer Networks
Bellman Ford Routing Algorithm-Computer Networks
 
04 greedyalgorithmsii 2x2
04 greedyalgorithmsii 2x204 greedyalgorithmsii 2x2
04 greedyalgorithmsii 2x2
 
Chap10 slides
Chap10 slidesChap10 slides
Chap10 slides
 
Cnetwork
CnetworkCnetwork
Cnetwork
 
Lecture_10_Parallel_Algorithms_Part_II.ppt
Lecture_10_Parallel_Algorithms_Part_II.pptLecture_10_Parallel_Algorithms_Part_II.ppt
Lecture_10_Parallel_Algorithms_Part_II.ppt
 
Convolution Neural Networks
Convolution Neural NetworksConvolution Neural Networks
Convolution Neural Networks
 
23 industrial engineering
23 industrial engineering23 industrial engineering
23 industrial engineering
 
Analysis of Pathfinding Algorithms
Analysis of Pathfinding AlgorithmsAnalysis of Pathfinding Algorithms
Analysis of Pathfinding Algorithms
 
Deepwalk vs Node2vec
Deepwalk vs Node2vecDeepwalk vs Node2vec
Deepwalk vs Node2vec
 
Bellmanford
BellmanfordBellmanford
Bellmanford
 

More from David Wood

Internet of Things (IoT) two-factor authentication using blockchain
Internet of Things (IoT) two-factor authentication using blockchainInternet of Things (IoT) two-factor authentication using blockchain
Internet of Things (IoT) two-factor authentication using blockchainDavid Wood
 
Returning to Online Privacy?
Returning to Online Privacy?Returning to Online Privacy?
Returning to Online Privacy?David Wood
 
Methods for Securing Spacecraft Tasking and Control via an Enterprise Ethereu...
Methods for Securing Spacecraft Tasking and Control via an Enterprise Ethereu...Methods for Securing Spacecraft Tasking and Control via an Enterprise Ethereu...
Methods for Securing Spacecraft Tasking and Control via an Enterprise Ethereu...David Wood
 
BlockSW 2019 Keynote
BlockSW 2019 KeynoteBlockSW 2019 Keynote
BlockSW 2019 KeynoteDavid Wood
 
Returning to Online Privacy - W3C/ANU Future of the Web Roadshow 20190221
Returning to Online Privacy - W3C/ANU Future of the Web Roadshow 20190221Returning to Online Privacy - W3C/ANU Future of the Web Roadshow 20190221
Returning to Online Privacy - W3C/ANU Future of the Web Roadshow 20190221David Wood
 
Privacy in the Smart City
Privacy in the Smart CityPrivacy in the Smart City
Privacy in the Smart CityDavid Wood
 
Controlling Complexities in Software Development
Controlling Complexities in Software DevelopmentControlling Complexities in Software Development
Controlling Complexities in Software DevelopmentDavid Wood
 
Privacy Concerns related to Verifiable Claims
Privacy Concerns related to Verifiable ClaimsPrivacy Concerns related to Verifiable Claims
Privacy Concerns related to Verifiable ClaimsDavid Wood
 
Implementing the Verifiable Claims data model
Implementing the Verifiable Claims data modelImplementing the Verifiable Claims data model
Implementing the Verifiable Claims data modelDavid Wood
 
So You Wanna be a Startup CTO 20170301
So You Wanna be a Startup CTO 20170301So You Wanna be a Startup CTO 20170301
So You Wanna be a Startup CTO 20170301David Wood
 
Functional manipulations of large data graphs 20160601
Functional manipulations of large data graphs 20160601Functional manipulations of large data graphs 20160601
Functional manipulations of large data graphs 20160601David Wood
 
When Metaphors Kill
When Metaphors KillWhen Metaphors Kill
When Metaphors KillDavid Wood
 
Secularism in Australia
Secularism in AustraliaSecularism in Australia
Secularism in AustraliaDavid Wood
 
Meditations on Writing in Paradoxes, Oxymorons, and Pleonasms
Meditations on Writing in Paradoxes, Oxymorons, and PleonasmsMeditations on Writing in Paradoxes, Oxymorons, and Pleonasms
Meditations on Writing in Paradoxes, Oxymorons, and PleonasmsDavid Wood
 
Building a writer's platform with social media
Building a writer's platform with social mediaBuilding a writer's platform with social media
Building a writer's platform with social mediaDavid Wood
 
Summary of the Hero's Journey
Summary of the Hero's JourneySummary of the Hero's Journey
Summary of the Hero's JourneyDavid Wood
 
Open by Default
Open by DefaultOpen by Default
Open by DefaultDavid Wood
 
Lod Then, Now and Next 20110926
Lod Then, Now and Next 20110926Lod Then, Now and Next 20110926
Lod Then, Now and Next 20110926David Wood
 
Linked Data ROI 20110426
Linked Data ROI 20110426Linked Data ROI 20110426
Linked Data ROI 20110426David Wood
 
Introduction to Linked Data: RDF Vocabularies
Introduction to Linked Data: RDF VocabulariesIntroduction to Linked Data: RDF Vocabularies
Introduction to Linked Data: RDF VocabulariesDavid Wood
 

More from David Wood (20)

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