Download presentation
Presentation is loading. Please wait.
1
1 Routing Lesson 10 NETS2150/2850 http://www.ug.cs.usyd.edu.au/~nets2150/ School of Information Technologies
2
2 Lesson Outline Know the characteristics of unicast routing protocol Understand various ways of routing —Routing Strategies Experiment with common routing algorithms —Dijsktra’s Algorithm of OSPF —Bellman-Ford Algorithm of RIP
3
3 Routing Graph abstraction for routing algorithms: graph nodes are routers graph edges are physical links —link cost/weight: delay, $ cost or congestion level Goal: find “good” path thru network from source to destination. Routing protocol A E D CB F “good” path: —typically means minimum cost path
4
4 Routing in Packet Switched Network Routing protocol establish mutually consistent routing tables in every router Characteristics of routing protocol: —Correctness —Simplicity —Robustness —Stability —Fairness —Optimality —Efficiency application transport network data link physical application transport network data link physical 1. Send data 2. Receive data network data link physical Packet switching network
5
5 Performance Criteria How to select “best” path? Used for selection of path —Minimum hop —Least cost IP routing table Destination Gateway Netmask Iface 129.78.8.0 0.0.0.0 255.255.252.0 eth0 127.0.0.0 0.0.0.0 255.0.0.0 lo 0.0.0.0 129.78.11.254 0.0.0.0 eth0
6
6 Example Packet Switched Network Link cost Shortest path VS Least-cost path
7
7 Routing Strategies Fixed Flooding Random Adaptive
8
8 Fixed Routing Single permanent path for each source to destination pair Path fixed, at least until a change in network topology
9
9 Fixed Routing Tables Network Topology
10
10 Flooding Packet sent by node to every neighbour and the neighbour sends to its neighbours Incoming packets retransmitted on every link except incoming link Eventually a number of copies will arrive at destination Each packet is uniquely numbered so duplicates can be discarded To bound the flood, max hop count is included in the packets If (Packet’s hop count = = max_hop_count) discard!
11
11 Flooding Example
12
12 Properties of Flooding All possible routes are tried —Very robust At least one packet will have taken minimum hop count or “best” route All nodes are visited The common approach used to distribute routing information, like a node’s link costs to neighbours
13
13 Random Routing Node selects one outgoing path for retransmission of incoming packet Selection can be random or round robin Can select outgoing path based on probability calculation Path is typically not “best” one Used in ‘hot potato routing’ — nodes have no buffer to store packets — packets routed to any path of the lowest delay
14
14 Adaptive Routing Used by almost all packet switching networks Routing decisions change as conditions on the network change —Failure —Congestion Requires info about network Decisions more complex
15
15 Adaptive Routing - Advantages Improved performance Aids congestion control by exercising load balancing across different alternative paths But, it is complex —Reacting too quickly can cause oscillation —Too slowly, may not be relevant
16
16 Routing Algorithm classification Global or decentralised information? Global: all routers have complete topology, link cost info Known as “link state” algorithms E.g. Dijkstra’s Algorithm Decentralised: router knows physically-connected neighbours, i.e link costs to neighbours iterative process of computation, exchange of info with neighbours Known as “distance vector” algorithms E.g. Bellman-Ford Algorithm
17
17 Routing Algorithms Given network of nodes connected by bi- directional links Each link has a cost in each direction and may be different Cost of path between two nodes is sum of costs of links traversed For each pair of nodes, find a path with the least cost
18
18 Dijkstra’s Algorithm Definitions Find shortest paths from given source node to all other nodes, by developing paths in order of increasing path length N =set of nodes in the network s =source node T =set of nodes so far incorporated by the algorithm w(i, j) = link cost from node i to node j —w(i, i) = 0 —w(i, j) = if the two nodes are not directly connected —w(i, j) 0 if the two nodes are directly connected L(n) = cost of least-cost path from node s to node n
19
19 Dijkstra’s Algorithm Step 1 [Initialization] —T = {s} Set of nodes so far incorporated consists of only source node —L(n) = w(s, n) for n ≠ s Step 2 [Get Next Node] —Find neighbouring node, x, not in T with least-cost path from s —Incorporate node x into T Step 3 [Update Least-Cost Paths] —L(n) = min[L(n), L(x) + w(x, n)] for all n T Algorithm terminates when all nodes have been added to T
20
20 Dijkstra’s Algorithm Notes At termination, value L(x) associated with each node x is cost of least-cost path from s to x. One iteration of steps 2 and 3 adds one new node to T —Defines least cost path from s to that node
21
21 A E D CB F 2 2 1 3 2 2 2 5 3 5 T = {A} A E D CB F 2 2 1 3 2 2 2 5 3 5 T = {A,D} A E D CB F 2 2 1 3 2 2 2 5 3 5 T = {A,D,B} A E D CB F 2 2 1 3 2 2 2 5 3 5 T = {A,D,B,E} A E D CB F 2 2 1 3 2 2 2 5 3 5 T = {A,D,B,E,C} A E D CB F 2 2 1 3 2 2 2 5 3 5 T = {A,D,B,E,C,F}
22
22 Results of Example Dijkstra’s Algorithm NoTL(B) PathL(C) PathL(D) PathL(E) PathL(F)Path 1{A}2 A–B5 A-C1 A–D -- -- 2{A,D}2 A–B4 A-D-C1 A–D3 A-D-E -- 3{A,D,B}2 A–B4 A-D-C1 A–D3 A-D-E -- 4{A,D,B, E} 2 A–B4 A-D-C1 A–D3 A-D-E5 A-D-E-F 5{A,D,B, E,C} 2 A–B4 A-D-C1 A–D3 A-D-E5 A-D-E-F 6{A,D,B, E,C,F} 2 A–B4 A-D-C1 A–D3 A-D-E5 A-D-E-F
23
23 Bellman-Ford Algorithm Definitions Find shortest paths from given node considering at most one hop away Then, find the shortest paths with a constraint of paths of at most two hops. Then 3 hops, and so on… s =source node w(i, j) = link cost from node i to node j —w(i, i) = 0 —w(i, j) = if the two nodes are not directly connected —w(i, j) 0 if the two nodes are directly connected h =maximum number of hops (links) in path L h (n) = cost of least-cost path from s to n, at most h hops away
24
24 Bellman-Ford Algorithm Step 1 [Initialization] —L h (s) = 0, for all h —L 0 (n) = , for n s Step 2 [Update] —For each successive h > 0 and each node n: If L h (n) > min j [L h (j) + w(j,n)] Then –L h+1 (n)= min j [L h (j)+w(j,n)] Connect n with predecessor node j that achieves minimum cost
25
25 A E D CB F 2 2 1 3 2 2 2 5 3 5 h = 1 A E D CB F 2 2 1 3 2 2 2 5 3 5 h = 2 A E D CB F 2 2 1 3 2 2 2 5 3 5 h = 3 A E D CB F 2 2 1 3 2 2 2 5 3 5 h = 4
26
26 Results of Example Bellman-Ford Algorithm hopL h (B) PathL h (C) PathL h (D) PathL h (E) PathL h (F)Path 12 A–B5 A-C1 A–D -- -- 22 A–B4 A-D-C1 A–D3 A-D-E10 A-C-F 32 A–B4 A-D-C1 A–D3 A-D-E5 A-D-E-F 42 A–B4 A-D-C1 A–D3 A-D-E5 A-D-E-F
27
27 Algorithms Comparison Results from two algorithms agree Information gathered —Bellman-Ford Each node can maintain set of costs and paths for every other node Only exchange information with direct neighbours Can update costs and paths based on information from neighbours and knowledge of link costs Used as part of the Routing Information Protocol (RIP) —Dijkstra Each node needs complete topology Must know link costs of all links in network Must exchange information with all other nodes Used as part of Open Shortest Path First Protocol (OSPF)
28
28 OSPF Protocol
29
29 Example: ImageStream’s TransPort™ router Physical Spec: 533 MHz VIA C3 processor 128 MB SDRAM Runs on Linux Three onboard 10/100 Ethernet ports 1 or 2 T1/E1 ports Software spec: PPP, Cisco HDLC & frame relay ATM PPPoE & PPPoA Routing procotols: —RIP, RIP II, OSPF, IS-IS & BGP4
30
30 Summary Routing is the process of finding a path from a source to every destination in the network Different routing strategies available Common adaptive routing: —Dijsktra’s algorithm —Bellman-Ford algorithm Read Stallings Section 12.2 and 12.3 Next: Functions of internetwork layer protocol
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.