Computer Networks Routing Algorithms Topics • Routing Algorithms – Shortest Path (Dijkstra Algorithm) – Distance Vector Routing • Count to infinity problem • Solutions for count to infinity problem – Link State Routing • Measuring line cost Routing • Point-to-point networks are dynamic networks • A router may stop working or a new router may join the network • The connections between routers may change • The properties of the connections may change • As a result, the routing tables should be updated from time to time • To update routing tables, routing algorithms are used Routing Protocol Characteristics Criteria used to compare routing protocols includes Time to convergence – how quickly all routers share consistent information Scalability – can the network continue to grow? Resource usage - memory, CPU, bandwidth Implementation & maintenance – intelligence level required of network admin. Shortest Path Routing 1. Mark starting node as current node. 2. Check neighboring nodes of the current node and tentatively label them with (current node, cumulative distance from start) if cumulative distance is less than their current distance shown by the label. 3. Search all tentatively labeled nodes (and not just the nodes labeled from the current node) for the minimum label, make this minimum node's label permanent, and make it the new current node. 4. If the current node is the destination/source, stop, else goto 2. Example-Shortest Path Distance Vector Routing (1) • Distance Vector Technology – A router using distance vector routing protocols knows 2 things: • Distance to final destination • Vector, or direction, on which the traffic should be directed Distance Vector Routing (2) • Characteristics of Distance Vector routing protocols: – Periodic updates – 30 or 90 seconds – Detects the immediate Neighbors and measure distance to each one – Exchange routing tables with the neighbors – Update routing tables using the information from the neighbors Initial Network Discovery • Directly connected networks are initially placed in routing table • These will be sent to their directly connected neighbors! • Also true if the router loses power for any reason! Distance Vector Routing (3) Left: A subnet. Right: Inputs from A, I, H, K, and the new routing table for J. Updating Routing Tables • Changes may occur for several reasons, including: – Failure of a link – Introduction of a new link – Failure of a router – Change of link parameters – Periodic update Failure to Converge The count-to-infinity problem. Solutions for Count-to-Infinity (1) • Setting a maximum for packet hops – Typically is 16, once it reaches the 16th hop, it will declare the network UNREACHABLE! • Distance Vector routing protocols set a specified metric value to indicate infinity • Once a router “counts to infinity” it marks the route as unreachable Solutions for Count-to-Infinity (2) • The Split Horizon Rule is used to prevent routing loops • Split Horizon rule: – A router should not advertise a network through the interface from which the update came. Solutions for Count-to-Infinity (3) • Split horizon with poison reverse • The rule states that once a router learns of an unreachable route through an interface, advertise it as unreachable back through the same interface Link State Routing Each router must do the following: 1. Discover its neighbors, learn their network address. 2. Measure the delay or cost to each of its neighbors. 3. Construct a packet telling all it has just learned. 4. Send this packet to all other routers. 5. Compute the shortest path to every other router. Learning about the Neighbors (a) Nine routers and a LAN. (b) A graph model of (a). Measuring Line Cost • Line cost is measured by sending an ECHO message and measuring the return time. • Waiting time in router queue can be added to include the line traffic load Including Traffic Load in Line Cost Including traffic load in cost line may cause oscillation in choosing the shortest path. Building Link State Packets (a) A subnet. (b) The link state packets for this subnet. Distributing the Link State Packets The packet buffer for router B. Updating the Routing Tables • After receiving the link state packets, each router creates a labeled graph of the network. • The shortest path to each destination is found using Dijkstra’s shortest path algorithm Questions?
© Copyright 2026 Paperzz