Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Routing Algorithms: Dijkstra, Bellman-Ford vs. Real-World Implementations, Study notes of Computer Systems Networking and Telecommunications

An overview of routing algorithms in computer networks, focusing on dijkstra and bellman-ford algorithms. The text also discusses the ideal and real-world implementation of routing, including the use of link state and distance vector protocols, and the role of autonomous systems and border gateway protocol (bgp).

Typology: Study notes

Pre 2010

Uploaded on 08/19/2009

koofers-user-y83-2
koofers-user-y83-2 ๐Ÿ‡บ๐Ÿ‡ธ

10 documents

1 / 39

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
1
Network Layer:
Routing algorithms
CS 242: Computer Networks
Week 10: Monday, 11/12/07
Daniel Bilar
Wellesley College
Fall 2007
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

Partial preview of the text

Download Routing Algorithms: Dijkstra, Bellman-Ford vs. Real-World Implementations and more Study notes Computer Systems Networking and Telecommunications in PDF only on Docsity!

Network Layer:Routing algorithms

CS 242: Computer NetworksWeek 10: Monday, 11/12/07Daniel BilarWellesley CollegeFall 2007

Goals today ^ Ideal: Routing with Link State and Distance Vectorprotocols

^ Dijkstra ^ Bellman-Ford

^ Real world

^ Routers aggregated into hierarchies called Autonomous Systems ^ Use different algorithms inter- and intra-domain ^ Routing is (mostly) based on metrics (intra-domain) and policies(inter-domain)

^ BGP (Path Vector algorithm) is used interdomainSome slides adapted and pictures gratefully acknowledgedfrom Liebeherr, Rexford, Schul

Forwarding vs. Routing ^ Forwarding: data plane ^ Directing a data packet to an outgoing link ^ Individual router

using

a forwarding table

^ Routing: control plane ^ Computing paths the packets will follow ^ Routers talking amongst themselves ^ Individual router

creating

a forwarding table

Why Does Routing Matter? ^ End-to-end performance ^ Quality of the path affects user performance ^ Propagation delay, throughput, and packet loss ^ Use of network resources ^ Balance of the traffic over the routers and links ^ Avoiding congestion by directing traffic to lightly-loaded links ^ Transient disruptions during changes ^ Failures, maintenance, and load balancing ^ Limiting packet loss and delay during changes

Graph abstraction: costs

u

y

x

w

v

z

  • c(x,xโ€™) = cost of link (x,xโ€™)- e.g., c(w,z) = 5โ€ข cost could always be 1, orinversely related to bandwidth,or inversely related tocongestion

Cost of path (x

, x, x 12

,โ€ฆ, x 3

) = c(xp

,x) + c(x 12

,x) + โ€ฆ + c(x 23

,xp-1p

Question: Whatโ€™s the least-cost path between u and z? Routing algorithm: algorithm that finds least-cost path

Internet routers ^ โ€˜Traffic copsโ€™ of networks ^ Must decide where to send packets ^ Decisions are reflected in routing tables which must be computed

5555 2222

1111

2222

3333 3333 1111

5555 2222

1111

BBBB

AAAA

CCCC^

DDDD EEEE

FFFF

source hostsource hostsource hostsource host

destination hostdestination hostdestination hostdestination host

firstfirstfirstfirst----hop routerhop routerhop routerhop routerdefault routerdefault routerdefault routerdefault router

source routersource routersource routersource router

destination routerdestination routerdestination routerdestination router leastleastleastleast----cost path

cost pathcost pathcost path

Routing algorithm: Dijkstra ^ โ€œTells world about the neighbours โ€

^ Each node assumed to know state of links to its neighbors

^ Step 1: Flooding

^ Each node โ€˜broadcastsโ€™ its state to all other nodes, a so-calledLink State Packet (LSP) ^ Node ID, List of neighbors and link cost, Time to live (TTL), andmore ^ Node outputs LSP on all its links

^ Step 2: Dijkstraโ€™s shortest path tree

^ Each node computes shortest paths to all other nodes fromglobal state ^ Dijkstraโ€™s shortest path tree (SPT) algorithm

^ Requires

global

information

^ Wide-spread Internet routing protocol that uses thisalgorithm is OSPF

Algorithm (at Node X) ^ Initialization ^ N = {X} ^ For all nodes V ^ If V adjacent to X, D(V) = C(X,V) else D(V) = โˆž ^ Loop ^ Find U not in N such that D(U) is smallest ^ Add U into set N ^ Update D(V) for all V not in N ^ D(V) = min{D(V), D(U) + C(U,V)} ^ Until all nodes in N

B G

C H

D

A^

F

E

(2,A)

(6,A)

0 4 2 โˆž 2 โˆž โˆž โˆž H

4 0 โˆž 1 โˆž โˆž โˆž 6 G

2 โˆž 0 2 โˆž 3 โˆž โˆž F

โˆž 1 2 0 โˆž โˆž 2 โˆž E

2 โˆž โˆž โˆž 0 3 โˆž โˆž D

โˆž โˆž 3 โˆž 3 0 7 โˆž C

โˆž โˆž โˆž 2 โˆž 7 0 2 B

โˆž 6 โˆž โˆž โˆž โˆž 2 0 A

H G F E D C B A

C(x,y)

Choosing A.Updating D(x).D(B) smallest, nextnode is B Routing table for A

B G

C H

D

A^

F

E

(2,A)

(9,B)

(4,B)

(6,A)

0 4 2 โˆž 2 โˆž โˆž โˆž H

4 0 โˆž 1 โˆž โˆž โˆž 6 G

2 โˆž 0 2 โˆž 3 โˆž โˆž F

โˆž 1 2 0 โˆž โˆž 2 โˆž E

2 โˆž โˆž โˆž 0 3 โˆž โˆž D

โˆž โˆž 3 โˆž 3 0 7 โˆž C

โˆž โˆž โˆž 2 โˆž 7 0 2 B

โˆž 6 โˆž 4 โˆž 9 2 0 A

H G F E D C B A

C(x,y)

Choosing B.Updating D(x)D(E) is smallest,so next node is E

Routing table for A

B G

C H

D

A^

F

E

(2,A)

(9,B)

(4,B)

(6,E)

(9,G)

(5,E)

0 4 2 โˆž 2 โˆž โˆž โˆž H

4 0 โˆž 1 โˆž โˆž โˆž 6 G

2 โˆž 0 2 โˆž 3 โˆž โˆž F

โˆž 1 2 0 โˆž โˆž 2 โˆž E

2 โˆž โˆž โˆž 0 3 โˆž โˆž D

โˆž โˆž 3 โˆž 3 0 7 โˆž C

โˆž โˆž โˆž 2 โˆž 7 0 2 B

9 5 6 4 โˆž 9 2 0 A

H G F E D C B A

C(x,y)

Choosing G.Updating D(x).D(F) is smallest,next node is F.

Routing table for A

B G

C H

D

A^

F

E

(2,A)

(9,B)

(4,B)

(6,E)

(8,F)

(5,E)

0 4 2 โˆž 2 โˆž โˆž โˆž H

4 0 โˆž 1 โˆž โˆž โˆž 6 G

2 โˆž 0 2 โˆž 3 โˆž โˆž F

โˆž 1 2 0 โˆž โˆž 2 โˆž E

2 โˆž โˆž โˆž 0 3 โˆž โˆž D

โˆž โˆž 3 โˆž 3 0 7 โˆž C

โˆž โˆž โˆž 2 โˆž 7 0 2 B

8 5 6 4 โˆž 9 2 0 A

H G F E D C B A

C(x,y)

Choosing F.Updating D(x).D(H) is smallest,next node is H.Notice howD(H) changedfrom 9 to 8.

Routing table for A

B G

C H

D

A^

F

E

(2,A)

(9,B)

(4,B)

(6,E)

(10,H)

(8,F)

(5,E)

0 4 2 โˆž 2 โˆž โˆž โˆž H

4 0 โˆž 1 โˆž โˆž โˆž 6 G

2 โˆž 0 2 โˆž 3 โˆž โˆž F

โˆž 1 2 0 โˆž โˆž 2 โˆž E

2 โˆž โˆž โˆž 0 3 โˆž โˆž D

โˆž โˆž 3 โˆž 3 0 7 โˆž C

โˆž โˆž โˆž 2 โˆž 7 0 2 B

A

H G F E D C B A

C(x,y)

Choosing C.Updating D(x) ...No D(x) getschanged, Cmust not be on ashortest pathfrom A to anyother node!Last node is D.

Routing table for A

B G

C H

D

A^

F

E

(2,A)

(9,B)

(4,B)

(6,E)

(10,H)

(8,F)

(5,E)

0 4 2 โˆž 2 โˆž โˆž โˆž H

4 0 โˆž 1 โˆž โˆž โˆž 6 G

2 โˆž 0 2 โˆž 3 โˆž โˆž F

โˆž 1 2 0 โˆž โˆž 2 โˆž E

2 โˆž โˆž โˆž 0 3 โˆž โˆž D

โˆž โˆž 3 โˆž 3 0 7 โˆž C

โˆž โˆž โˆž 2 โˆž 7 0 2 B

A

H G F E D C B A

C(x,y)

Choosing D.Updating D(x) ..Nothing toupdate since allnodes marked

We are done!Routing table for A