Presentation is loading. Please wait.

Presentation is loading. Please wait.

Fundamentals of Computer Networks ECE 478/578 Lecture #16: Routing Instructor: Loukas Lazos Dept of Electrical and Computer Engineering University of Arizona.

Similar presentations


Presentation on theme: "Fundamentals of Computer Networks ECE 478/578 Lecture #16: Routing Instructor: Loukas Lazos Dept of Electrical and Computer Engineering University of Arizona."— Presentation transcript:

1 Fundamentals of Computer Networks ECE 478/578 Lecture #16: Routing Instructor: Loukas Lazos Dept of Electrical and Computer Engineering University of Arizona

2 What is Routing? Construct directions from starting point to destination 2

3 3 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

4 4 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

5 Different Types of Routing Routing in a GPS device Routing in computer networks Shortest path Smallest delay Highest reliability Avoid congested nodes 5

6 Routing as a Graph Problem Network is mapped into a graph G(V,E), where each link has an associated cost Cost: delay, financial cost, probability of failure, etc. 6

7 Distance Vector Algorithm Construct a one-dimensional array (vector) of distances to all other nodes Exchange info with immediate neighbors Update distances based on received information Stop sending updates as soon as no change occurs Example: Assume unit cost for each link 7

8 Distance Vector – Global View Global view of the network 8 ABCDEFG A011  11  B101  C1101  D  10  1 E1  0  F1  01 G  1  10

9 Distance Vector – Local View DestCostNext Hop B1B C1C D  – E1E F1F G  – 9 DestCostNext Hop A1A C1C D  – E  – F  – G  – DestCostNext Hop A1A B1B D1D E  – F  – G  – DestCostNext Hop A  – B  – C1C E  – F  – G1G DestCostNext Hop A1A B  – C  – D  – F  – G  – DestCostNext Hop A1A B  – C  – D  – E  – G1G DestCostNext Hop A  – B  – C  – D1D E  – F1F

10 Distance Vector – 1 st Update DestCostNext Hop B1B C1C D2C E1E F1F G2F 10 DestCostNext Hop A1A C1C D2C E2A F2A G  – DestCostNext Hop A1A B1B D1D E2A F2A G2G DestCostNext Hop A2C B2C C1C E  – F2G G1G DestCostNext Hop A1A B2A C2A D  – F2A G  – DestCostNext Hop A1A B2A C2A D2G E2E G1G DestCostNext Hop A2F B  – C2D D1D E  – F1F

11 Distance Vector – 2 nd Update DestCostNext Hop B1B C1C D2C E1E F1F G2F 11 DestCostNext Hop A1A C1C D2C E2A F2A G3C DestCostNext Hop A1A B1B D1D E2A F2A G2G DestCostNext Hop A2C B2C C1C E3C F2G G1G DestCostNext Hop A1A B2A C2A D3A F2A G3A DestCostNext Hop A1A B2A C2A D2G E2E G1G DestCostNext Hop A2F B3D C2D D1D E3F F1F

12 Failure of F – G Link 12

13 Failure of F – G Link Step 1 A/DestCostNext Hop B1B C1C D2C E1E F1F G2F 13 B/DestCostNext Hop A1A C1C D2C E2A F2A G3C C/DestCostNext Hop A1A B1B D1D E2A F2A G2G D/DestCostNext Hop A2C B2C C1C E3C F2G G1G E/DestCostNext Hop A1A B2A C2A D3A F2A G3A F/DestCostNext Hop A1A B2A C2A D  – E2E G  – G/DestCostNext Hop A  – B3D C2D D1D E  – F  –

14 Failure of F – G Link Step 2 A/DestCostNext Hop B1B C1C D2C E1E F1F G  – 14 B/DestCostNext Hop A1A C1C D2C E2A F2A G3C C/DestCostNext Hop A1A B1B D1D E2A F2A G2G D/DestCostNext Hop A1A B2C C1C E3C F  – G1G E/DestCostNext Hop A1A B2A C2A D3A F2A G  – F/DestCostNext Hop A1A B2A C2A D  – E2E G  – G/DestCostNext Hop A  – B3D C2D D1D E  – F  –

15 Failure of F – G Link Step 3 A/DestCostNext Hop B1B C1C D2C E1E F1F G3C 15 B/DestCostNext Hop A1A C1C D2C E2A F2A G3C C/DestCostNext Hop A1A B1B D1D E2A F2A G2G D/DestCostNext Hop A2C B2C C1C E3C F3C G1G E/DestCostNext Hop A1A B2A C2A D3A F2A G  – F/DestCostNext Hop A1A B2A C2A D4A E2E G  – G/DestCostNext Hop A3D B3D C2D D1D E4D F  –

16 Failure of F – G Link Step 4 A/DestCostNext Hop B1B C1C D2C E1E F1F G3C 16 B/DestCostNext Hop A1A C1C D2C E2A F2A G3C C/DestCostNext Hop A1A B1B D1D E2A F2A G2G D/DestCostNext Hop A2C B2C C1C E3C F3C G1G E/DestCostNext Hop A1A B2A C2A D3A F2A G4A F/DestCostNext Hop A1A B2A C2A D4C E2E G4A G/DestCostNext Hop A3D B3D C2D D1D E3F F4D

17 A advertises a distance of infty to E and updates its neighbors C advertises a distance of 2 to E via A B advertises a distance of 3 to E via C A updates its table and advertises a distance of 4 via B C updates its table and advertises a distance of 5 via A… Count-to-Infinity Problem 17

18 Solutions for Count-to-Infinity Problem Sol A: Use a maximum hop count instead of infinity Sol B: Split Horizon Do not send updates on the neighbor that provided the info for a particular route. E.g.: B does not send an update for E to A, since it learned about E from A Sol C: Split Horizon with Poison Reverse B advertises a route of cost infinity to E to ensure that A does not use B to get to E Solutions do not always work for loops with more than 3 nodes 18

19 Routing Information Protocol (RIP) Distance-vector algorithm where vertices are networks and not hosts Valid hop count (distances) 1-15, with 16 representing infinity Limited to fairly small networks 19

20 20 Link-State Routing Path-selection model Destination-based Flood information regarding immediate neighbors to all nodes Each node obtains a complete map of the network 3 2 2 1 1 4 1 4 5 3

21 21 Shortest-Path Problem Given: network topology with link costs c(x,y): link cost from node x to node y Infinity if x and y are not direct neighbors Compute: least-cost paths to all nodes From a given source u to all other nodes p(v): predecessor node along path from source to v 3 2 2 1 1 4 1 4 5 3 u v p(v)

22 22 Dijkstra’s Shortest-Path Algorithm Iterative algorithm After k iterations, know least-cost path to k nodes S: nodes whose least-cost path definitively known Initially, S = {u} where u is the source node Add one node to S in each iteration D(v): current cost of path from source to node v Initially, D(v) = c(u, v) for all nodes v adjacent to u … and D(v) = ∞ for all other nodes v Continuously update D(v) as shorter paths are learned

23 23 Dijsktra’s Algorithm 1 Initialization: 2 S = {u} 3 for all nodes v 4 if v adjacent to u { 5 D(v) = c(u,v) 6 else D(v) = ∞ 7 8 Loop 9 find w not in S with the smallest D(w) 10 add w to S 11 update D(v) for all v adjacent to w and not in S: 12 D(v) = min{D(v), D(w) + c(w,v)} 13 until all nodes in S

24 24 Dijkstra’s Algorithm Example 3 2 2 1 1 4 1 4 5 3 3 2 2 1 1 4 1 4 5 3 3 2 2 1 1 4 1 4 5 3 3 2 2 1 1 4 1 4 5 3

25 25 Dijkstra’s Algorithm Example 3 2 2 1 1 4 1 4 5 3 3 2 2 1 1 4 1 4 5 3 3 2 2 1 1 4 1 4 5 3 3 2 2 1 1 4 1 4 5 3

26 26 Shortest-Path Tree Shortest-path tree from u Forwarding table at u 3 2 2 1 1 4 1 4 5 3 u v w x y z s t v(u,v) w(u,w) x y(u,v) z link s(u,w) t

27 Dijkstra Table 27 StepSvwxyzst D(v)P(v)D(w)P(w)D(x)P(x)D(y)P(y)D(z)P(z)D(s)P(s)D(t)P(t) 0u3u2u  u  u  u  u  u 1u,w3u--3w  u  u6w  u 2u, w, v----3w5v  u6w  u 3u,w,v,x------5v  u6w8x 4u,w,v,x, y --------6y6w8x 5u,w,v,x, y,s,z --------6y--8x 6u,w,v,x, y,s,z,t ------------8x

28 28 Link-State Routing Each router keeps track of the state of its incident links Link-state: working or non-working Cost (delay, throughput) Each router floods the link state in the entire network Every router gets a complete view of the network Each router runs Dijkstra’s algorithm to obtain shortest paths to all other destinations Link-state protocols Open Shortest Path First (OSPF) Intermediate System – Intermediate System (IS-IS)

29 29 Determining the State of a Link Beaconing Periodically exchange “hello” messages with neighbors Detect a failure after a threshold number of unanswered “hellos” HELLO A HELLO B HELLO C BC A

30 Distributing Link-State Info Flood the entire network Every node forwards link-state packet on all links but the incoming one 30

31 Link-State Packets Packets to be distributed Sequence number prevents nodes from using old messages Age determines a time to live for the packet (why do we need this?) 31

32 32 When to Initiate Flooding Topology change Link or node failure Link or node recovery Configuration change Link cost change Periodically Refresh the link-state information Typically (say) 30 minutes Corrects for possible corruption of the data

33 Link State vs. Distance Vector Link State Tell every node in the network about your immediate neighbors Distance Vector Tell only to your neighbors about every node in the network 33

34 Open Shortest Path First Protocol Format of an OSPF message Version: 1-4, 1:Hello msg, 2: request, 3:send, 4: Ack Area Id: area where node is connected in case of hierarchical routing Authentication type: 0:none, 1:simple pswd, 2: MAC 34

35 Type 1: cost of links Type 2: networks connected Other types: Hierarchy info LS Age: TTL Link-state ID, Advertising router: 32-bit address of router Length: length in bytes of the LSA Link ID, data, type: identify the link Type of Service (TOS): Allows assignment of different metrics for different services for the same link Link State Advertisements (LSA) 35

36 Link Metrics Hop count: Assign a metric of one at every hop Least-cost route  Least-hops route Delay: Delay= Tack – Tarr = (Td – Tarr) + Tt + 2 Tp Weight assigned to each link = average delay for packets passing through Problems with simply using delay Instability: A heavily loaded link would oscillate between busy and idle states Wide value range: a link could look hundreds of time more expensive than another – may cause very long routes 36

37 Suppression of the Dynamic Range New metric based on link utilization Highly loaded link never shows a cost more than three times its idle cost The most expensive link is only seven times the cost of the least expensive A high–speed satellite link is more attractive than a low speed terrestrial link Cost is a function of link utilization only at moderate to high loads 37

38 Link Metrics in the Real World For the most part metrics are static No dynamic adjustment, but hardcoded by network administrators Avoids route oscillation problems Most commonly used metric w = c/B, where c is a constant and B is the link bandwidth 38

39 Hierarchical Routing A scalable solution for very large networks Cluster routers into areas or regions 39

40 Hierarchical Routing Reduction in table size comes at a cost The route between a particular node pair may not necessarily be the shortest For large networks, how many levels should the hierarchy have? Example: Network with 720 nodes 1 level: 720 entries 2 levels: 24 regions and 30 nodes per region 29 (local) + 23 (region) = 52 entries 3 levels: 8 clusters; 9 regions/cluster; 10 routers/region 9 (local) + 8 (region) + 7 (cluster) = 24 entries 40


Download ppt "Fundamentals of Computer Networks ECE 478/578 Lecture #16: Routing Instructor: Loukas Lazos Dept of Electrical and Computer Engineering University of Arizona."

Similar presentations


Ads by Google