Networking: Routing Algorithms Summer 2016 Cornell University 1 - - PowerPoint PPT Presentation

networking routing algorithms summer 2016 cornell
SMART_READER_LITE
LIVE PREVIEW

Networking: Routing Algorithms Summer 2016 Cornell University 1 - - PowerPoint PPT Presentation

CS 4410 Operating Systems Networking: Routing Algorithms Summer 2016 Cornell University 1 Today Dijkstras algorithm Distance-Vector (DV) algorithm Hierarchical Routing Resources:


slide-1
SLIDE 1

1

CS 4410 Operating Systems

Networking: Routing Algorithms

Summer 2016 Cornell University

slide-2
SLIDE 2

Today

  • Dijkstra’s algorithm
  • Distance-Vector (DV) algorithm
  • Hierarchical Routing
  • Resources:

– http://www-net.cs.umass.edu/kurose-ross-ppt-6e/ – Computer Networking: A Top-Down Approach J.F. Kurose and K.W. Ross

2

slide-3
SLIDE 3

The routing problem

  • A host is usually attached directly to one router:

default router.

  • Source router: default router of the source host.
  • Destination router: default router of the destination

host.

  • Target: route a packet from source router to

destination router.

– Given a set of routers connected with links, a routing algorithm finds a “good” path from source router to destination router. – “good” is usually “low cost” (e.g., length, speed, money).

3

slide-4
SLIDE 4

Least-cost path

  • A graph G is used to

formulate routing problems.

  • G=(N,E)

– N: nodes that represent routers – E: edges that represent physical links

  • Each edge has a value

representing its cost.

  • Find a path between the

source and destination that has least cost.

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

4

slide-5
SLIDE 5

Dijkstra’s algorithm

  • Compute the least-cost path from one node to all
  • ther nodes in the network.
  • Iterative algorithm.

– After the kth iteration, the least-cost paths for k destination nodes are found.

  • D(v): cost of the least-cost path from source node

to destination v

  • p(v): previous node of v along the least-cost path

from source.

  • N’: set of nodes to which the least-cost path is

found.

5

slide-6
SLIDE 6

Dijkstra’s algorithm: Example

  • Source is node u.

Step N' u D(v),p(v) 2,u D(w),p(w) 5,u D(x),p(x) 1,u D(y),p(y) ∞ D(z),p(z)

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

6

slide-7
SLIDE 7

Dijkstra’s algorithm: Example

  • Source is node u.

Step 1 N' u ux D(v),p(v) 2,u 2,u D(w),p(w) 5,u 4,x D(x),p(x) 1,u D(y),p(y) ∞ 2,x D(z),p(z)

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

7

slide-8
SLIDE 8

Dijkstra’s algorithm: Example

  • Source is node u.

Step 1 2 N' u ux uxy D(v),p(v) 2,u 2,u 2,u D(w),p(w) 5,u 4,x 3,y D(x),p(x) 1,u D(y),p(y) ∞ 2,x D(z),p(z)

∞ ∞

4,y

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

8

slide-9
SLIDE 9

Dijkstra’s algorithm: Example

  • Source is node u.

Step 1 2 3 N' u ux uxy uxyv 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

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

9

slide-10
SLIDE 10

Dijkstra’s algorithm: Example

  • Source is node u.

Step 1 2 3 4 5 N' 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

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

10

slide-11
SLIDE 11

Dijkstra’s algorithm: Example

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:

2 1 1 1 2 u w z y x v

11

slide-12
SLIDE 12

Dijkstra’s algorithm

  • Global routing algorithm:

– It takes the connectivity between all nodes and all link costs as inputs. – Source u needs to have global knowledge of the network in order to determine its forwarding table.

12

slide-13
SLIDE 13

Distance-Vector (DV) algorithm

  • Decentralized algorithm:

– No node has complete information about the costs of all links. – Each node begins with only the knowledge of the costs of its own directly attached links. – Then, each node gradually calculates the least- cost path to a destination by exchanging information with its neighboring nodes.

13

slide-14
SLIDE 14

DV algorithm

  • Each node x begins with an estimate Dx(y) of the cost of the

least-cost path from itself to y, for all nodes.

– Distance vector of x: Dx = [Dx(y): y є N ]

  • Node x knows the cost c(x,v) for each neighbor v.
  • Neighbors exchange their distance vectors.
  • When x receives v’s distance vector, it uses Bellman-Ford

equation to update its own distance vector:

– Dx(y) = minv{c(x,v) + Dv(y)} for each node y ∊ N

  • If x’s distance vector changed, x sends its distance vector to

its neighbors.

  • If nodes continue exchanging updated distance vectors,

each cost estimate Dx(y) will converge to the actual least- cost from x to y.

14

slide-15
SLIDE 15

from

x y z x y z 0 2 7

cost to

2 0 1 7 1 0

cost to from

x y z x y z 0 2 7 2 0 1 3 1 0 x y z x y z 0 2 3

from cost to

2 0 1 3 1 0 x y z x y z 0 2 3

from cost to

3 1 0 2 0 1 x y z x y z 0 2 3

from cost to

2 0 1 3 1 0 time x y z x y z 0 2 7 ∞ ∞ ∞ ∞ ∞ ∞

cost to from from

x y z x y z ∞ ∞ ∞ ∞ ∞

cost to

x y z x y z ∞ ∞ ∞ 7 1

cost to

∞ 2 0 1 ∞ ∞ ∞ time 1 2 7 node x table node y table node z table

from

x y z x y z 2 0 1 7 1 0 3 2

cost to from

y x z

15

slide-16
SLIDE 16

Hierarchical Routing

  • As the number of routers become large, the
  • verhead involved in maintaining routing

information becomes prohibitive.

  • Internet providers want to manage their

network as they wish, while still being able to connect to other networks.

  • Organizing routers into autonomous systems

(ASs) solve these problems.

16

slide-17
SLIDE 17

Hierarchical Routing

  • Routers within the same AS all run the same routing

algorithm (e.g., Dijkstra or DV).

– Intra-AS routing protocol

  • One or more routers in an AS are responsible to

forward packets to destinations outside AS.

– Gateway routers

AS3

AS2

3b 3c 3a AS1 1c 1a 1d 1b 2a 2c 2b

3b 3c 3a 2b 2c 2a 1b 1c 1a 1d

17

slide-18
SLIDE 18

Hierarchical Routing

  • How to route packets outside an AS?
  • Inter-AS routing protocol:

– Obtain reachability information from neighboring ASs, and – Propagate the reachability information to all routers in AS.

  • In the Internet, all ASs run the same inter-AS

routing protocol: BGP (Border Gateway Protocol)

– Uses a DV-like algorithm.

18

slide-19
SLIDE 19

Today

  • Dijkstra’s algorithm
  • Distance-Vector (DV) algorithm
  • Hierarchical Routing
  • Resources:

– http://www-net.cs.umass.edu/kurose-ross-ppt-6e/ – Computer Networking: A Top-Down Approach J.F. Kurose and K.W. Ross

19

slide-20
SLIDE 20

Coming up…

  • Next lecture: Transport layer
  • HW5:

– Released today – Due on Wednesday

20