networking routing algorithms summer 2016 cornell
play

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:


  1. CS 4410 Operating Systems Networking: Routing Algorithms Summer 2016 Cornell University 1

  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

  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

  4. Least-cost path 5 • A graph G is used to 3 formulate routing problems. w v 5 2 • G=(N,E) u 2 1 z 3 – N: nodes that represent routers 1 2 x y 1 – 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. 4

  5. Dijkstra’s algorithm • Compute the least-cost path from one node to all other 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

  6. Dijkstra’s algorithm: Example 5 • Source is node u. 3 w v 5 2 u 2 1 z 3 1 2 x y 1 D(v),p(v) D(w),p(w) D(x),p(x) D(y),p(y) Step N' D(z),p(z) ∞ ∞ 2,u 5,u 1,u 0 u 6

  7. Dijkstra’s algorithm: Example 5 • Source is node u. 3 w v 5 2 u 2 1 z 3 1 2 x y 1 D(v),p(v) D(w),p(w) D(x),p(x) D(y),p(y) Step N' D(z),p(z) ∞ ∞ 2,u 5,u 1,u 0 u ∞ 2,u 4,x 2,x 1 ux 7

  8. Dijkstra’s algorithm: Example 5 • Source is node u. 3 w v 5 2 u 2 1 z 3 1 2 x y 1 D(v),p(v) D(w),p(w) D(x),p(x) D(y),p(y) Step N' D(z),p(z) ∞ ∞ 2,u 5,u 1,u 0 u ∞ 2,u 4,x 2,x 1 ux 4,y 2,u 3,y 2 uxy 8

  9. Dijkstra’s algorithm: Example 5 • Source is node u. 3 w v 5 2 u 2 1 z 3 1 2 x y 1 D(v),p(v) D(w),p(w) D(x),p(x) D(y),p(y) Step N' D(z),p(z) ∞ ∞ 2,u 5,u 1,u 0 u ∞ 2,u 4,x 2,x 1 ux 4,y 2,u 3,y 2 uxy 4,y 3 3,y uxyv 9

  10. Dijkstra’s algorithm: Example 5 • Source is node u. 3 w v 5 2 u 2 1 z 3 1 2 x y 1 D(v),p(v) D(w),p(w) D(x),p(x) D(y),p(y) Step N' D(z),p(z) ∞ ∞ 2,u 5,u 1,u 0 u ∞ 2,u 4,x 2,x 1 ux 4,y 2,u 3,y 2 uxy 4,y 3 3,y uxyv 4,y 4 uxyvw 5 uxyvwz 10

  11. Dijkstra’s algorithm: Example Resulting shortest-path tree from u: w v 2 u 1 z 1 2 x y 1 Resulting forwarding table in u: Destination Link (u,v) v x (u,x) y (u,x) w (u,x) z (u,x) 11

  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

  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

  14. DV algorithm • Each node x begins with an estimate D x (y) of the cost of the least-cost path from itself to y, for all nodes. – Distance vector of x: D x = [D x (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: – D x (y) = min v {c(x,v) + D v (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 D x (y) will converge to the actual least- cost from x to y. 14

  15. node x cost to cost to cost to x y z x y z table x y z x 0 2 7 x 0 3 2 x 0 2 3 from from y y 2 0 1 from ∞ ∞ ∞ y 2 0 1 z z 7 1 0 ∞ ∞ ∞ z 3 1 0 node y cost to cost to cost to table x y z x y z x y z y x ∞ ∞ x 0 2 7 ∞ x 0 2 3 2 1 from from y y 2 0 1 from 2 0 1 y 2 0 1 x z z z 7 ∞ ∞ ∞ 7 1 0 z 3 1 0 node z cost to cost to cost to x y z x y z x y z table x 0 2 7 x 0 2 3 x ∞ ∞ ∞ from from from y y 2 0 1 y 2 0 1 ∞ ∞ ∞ z z z 3 1 0 3 1 0 7 1 0 time time 15

  16. Hierarchical Routing • As the number of routers become large, the overhead 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

  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 3c 3c 3a 3a 3b 3b 2c 2c AS3 1c 1d 2a 2b 2b 2a 1a 1a 1b 1b AS2 1d 1c AS1 17

  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

  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

  20. Coming up… • Next lecture: Transport layer • HW5: – Released today – Due on Wednesday 20

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend