Routing Algorithms
Main issue is how the routers that constitute the network layer of a network cooperate to find the best routes between all pairs of stations. Routing algorithm at a router decides which output line an incoming packet should go, i.e. making a routing decision. McGraw-Hill Classified The McGraw-Hill e-material Companies, Inc., 2001 2
Adaptive Algorithm (Dynamic Routing) change their routing decisions (based on factors) to reflect changes in the topology Non Adaptive Algorithm (Static Routing) choice of the route to use to get from source I to destination J (for all I and J) is computed in advance, off-line, and downloaded to the routers when the network is booted McGraw-Hill Classified The McGraw-Hill e-material Companies, Inc., 2001 4
Adaptive Algorithms Distance Vector Routing Link State Routing Hierarchical Routing Broadcast Routing Multicast Routing Routing for Mobile Hosts Routing in Ad Hoc Networks Non Adaptive Algorithms Shortest Path Routing Flooding McGraw-Hill Classified The McGraw-Hill e-material Companies, Inc., 2001 5
Each router periodically shares its knowledge about the entire network with its neighbors. Three key steps: 1. Knowledge about the whole network. 2. Routing only to neighbors. 3. Information sharing at regular intervals.
Example of an Internet
The Concept of Distance Vector Routing
Distance Vector Routing Table In Distance vector routing, each router periodically shares its knowledge about the entire network with its neighbors.
Routing Table Distribution
Final Routing Tables
Each router shares its knowledge of its neighborhood with every other router in the internetwork. Three key steps: 1. Knowledge about the neighborhood. 2. To all Routers. 3. Information sharing when there is a change.
Concept of Link State Routing
Cost in Link State Routing
Link State Packet
Link State Database
Costs in the Dijkstra Algorithm
Shortest Path Calculation, Part I
Shortest Path Calculation, Part II
Shortest Path Calculation, Part III
Shortest Path Calculation, Part IV
Shortest Path Calculation, Part V
Shortest Path Calculation, Part VI
Shortest Path Calculation, Part VII
Shortest Path Calculation, Part VIII
Shortest Path Calculation, Part IX
Shortest Path Calculation, Part X
Shortest Path Calculation, Part XI
Shortest Path Calculation, Part XII
Shortest Path Calculation, Part XIII
Routing Table for Router A
Internet growth translates into Routing table growth. In Hierarchical Routing, the routers are divided into regions. Each router knowing all the details about its own region, but knowing nothing about the internal structure of other regions. Routing Procedure: Route first to the Region Then network within the Region Then particular node within the network
McGraw-Hill The McGraw-Hill Companies, Inc., 35 2001
Broadcast Send same packet to all receivers. all usually limited in some way LAN, subnet, organization
Sending a packet to all destinations simultaneously is called Broadcasting. Direct Method: Source sends a distinct packet to each destination routers in the subnet: 1. Wasteful of the bandwidth. 2. It requires source to have a list of all destinations. Flooding: Ordinarily ill suited for point-to-point communication: Generates to many packets, and Consumes to much bandwidth. McGraw-Hill Veton Këpuska April The 26, McGraw-Hill 2014 Companies, Inc., 37 2001
Multi-destination Routing Each packets contains: A list of destinations, or A bit map indicating the desired destinations. When packet arrives at a router: The router checks all the destinations to determine the set of output lines that will be needed. Generates a new copy of the packed for each output line to be used and includes in each packet only those destinations that are to use the line. After a sufficient number of hops, each packed will carry only one destination and can be treated as normal packet. Multi-destination routing is like separately addressed packets, except that when several packets must follow the same route, one of them pays full fare and the rest ride free. McGraw-Hill Veton Këpuska April The 26, McGraw-Hill 2014 Companies, Inc., 38 2001
Spanning Tree: It is a subset of the subnet that includes all routers but contains no loops. Each router knows which of its lines belong to the spanning tree, it can copy an incoming broadcast packet onto all the spanning tree lines except the one it arrived on. Makes excellent use of bandwidth (generates absolute minimum number of packets necessary to do the job) Must have knowledge of some spanning tree for the method to be applicable. Information available in some instances (e.g., link state routing) Information not available (e.g., distance vector routing) McGraw-Hill Veton Këpuska April The 26, McGraw-Hill 2014 Companies, Inc., 39 2001
Reverse Path Forwarding: Router checks if the broadcast packet arrived on the line that is normally used for sending packets to the source of the broadcast. If so, there is excellent chance that the broadcast packet itself followed the best route from the router and is therefore the first copy to arrive at the router. The router forwards copies of it onto all lines except the one it arrived on. If the broadcast packet arrived on a line other than the preferred one for reaching the source, the packet is discarded as a likely duplicate. McGraw-Hill Veton Këpuska April The 26, McGraw-Hill 2014 Companies, Inc., 40 2001
April 26, 2014 Veton Këpuska 41 Example of Reverse path Forwarding A B C D G J O M N L K H E I F A B C D G J O M N L K H E I F A subnet A sink tree for router I
The tree build by reverse path forwarding. After 5 hops and 24 packets the broadcasting terminates compared to 14 packets had the sink tree been followed exactly I F H J N A D E K G O M O E C G D N K H B L H L B McGraw-Hill Veton Këpuska April The 26, McGraw-Hill 2014 Companies, Inc., 42 2001