Dijkstra's Algorithm and Distance Vector Algorithm: Comparison and Analysis, Slides of Computer Networks

An explanation of dijkstra's algorithm and distance vector algorithm, two popular routing algorithms used in computer networks. It includes the steps of each algorithm, their differences, and the advantages and disadvantages of each. The document also discusses issues like transient disruptions and the count to infinity problem.

Typology: Slides

2013/2014

Uploaded on 01/29/2014

sundar
sundar 🇮🇳

4.7

(9)

104 documents

1 / 70

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
The Network Layer
Part 1: Routing
docsity.com
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36
pf37
pf38
pf39
pf3a
pf3b
pf3c
pf3d
pf3e
pf3f
pf40
pf41
pf42
pf43
pf44
pf45
pf46

Partial preview of the text

Download Dijkstra's Algorithm and Distance Vector Algorithm: Comparison and Analysis and more Slides Computer Networks in PDF only on Docsity!

The Network Layer

Part 1: Routing

Today

Starting on the internals of the network layer

Application Transport Network Link Layer Physical

Context and Terminology

“End hosts” “Clients”, “Users” “End points” “Interior Routers” “Border Routers” “Autonomous System (AS)” or “Domain” Region of a network under a single administrative entity “Route” or “Path”

Lecture#2: Routers Forward Packets to MIT to UW

UCB

to NYU Destination Next Hop UCB 4 UW 5 MIT 2 NYU 3 Forwarding Table 111010010 MIT switch# switch# switch# switch#

Routing Protocols

  • Routing protocols implement the core function of a network
    • Establish paths between nodes
    • Part of the network’s “control plane”
  • Network modeled as a graph
    • Routers are graph vertices
    • Links are edges
    • Edges have an associated “cost”
      • e.g., distance, loss
  • Goal: compute a “good” path from source to destination
    • “good” usually means the shortest (least cost) path A D E B C F 2 2 1 3 1 1 2 5 3 5

Internet Routing

  • Internet Routing works at two levels
  • Each AS runs an intra-domain routing protocol that

establishes routes within its domain

  • (AS -- region of network under a single administrative entity)
  • Link State, e.g., Open Shortest Path First (OSPF)
  • Distance Vector, e.g., Routing Information Protocol (RIP)
  • ASes participate in an inter-domain routing protocol that establishes

routes between domains

  • Path Vector, e.g., Border Gateway Protocol (BGP)

Outline

  • Link State
  • Distance Vector
  • Routing: goals and metrics (if time)

Link-State

Link State Routing

  • Each node maintains its local “link state” (LS)
  • Each node floods its local link state
    • on receiving a new LS message, a router forwards the message to all its neighbors other than the one it received the message from Host A Host B Host E Host D Host C N1 N N N N N6 N (N1,N2) (N1, N4) (N1, N5) (N1,N2) (N1, N4) (N1, N5) (N1,N2) (N1, N4) (N1, N5) (N1,N2) (N1, N4) (N1, N5) (N1,N2) (N1, N4) (N1, N5) (N1,N2) (N1, N4) (N1, N5) (N1,N2) (N1, N4) (N1, N5) (N1,N2) (N1, N4) (N1, N5) (N1,N2) (N1, N4) (N1, N5) (N1,N2) (N1, N4) (N1, N5)

Link State Routing

  • Each node maintains its local “link state” (LS)
  • Each node floods its local link state
  • Hence, each node learns the entire network topology
    • Can use Dijkstra’s to compute the shortest paths between nodes Host A Host B Host E Host D Host C N1 N N N N N6 N A B (^) E D C A B (^) E D C A B (^) E D C A B (^) E D C A B (^) E D C A B (^) E D C A B (^) E D C

Example

A D E B C F 2 2 1 3 1 1 2 5 3 5

Notation

  • c(i,j): link cost from node i

to j ; cost is infinite if not

direct neighbors; ≥ 0

  • D(v): total cost of the current

least cost path from source

to destination v

  • p(v): v ’s predecessor along

path from source to v

  • S: set of nodes whose least

cost path definitively known

A D E B C F 2 2 1 3 1 1 2 5 3 5 Source

Example: Dijkstra’s Algorithm

Step 0 1 2 3 4 5 set S A D(B),p(B) 2,A D(C),p(C) 5,A D(D),p(D) 1,A D(E),p(E) (^) D(F),p(F) A D E B C F 2 2 1 3 1 1 2 5 3 5

1 Initialization: 2 S = {A}; 3 for all nodes v 4 if v adjacent to A 5 then D(v) = c(A,v); 6 else D(v) = ; …

Example: Dijkstra’s Algorithm

Step 0 1 2 3 4 5 set S A D(B),p(B) 2,A D(C),p(C) 5,A … 8 Loop 9 find w not in S s.t. D(w) is a minimum; 10 add w to S ; 11 update D(v) for all v adjacent to w and not in S : 12 If D(w) + c(w,v) < D(v) then 13 D(v) = D(w) + c(w,v); p(v) = w; 14 until all nodes in S; A D E B C F 2 2 1 3 1 1 2 5 3 5 D(D),p(D) 1,A D(E),p(E) (^) D(F),p(F)