This preview shows page 1. Sign up to view the full content.
Unformatted text preview: •Data Communication and Networks 1 Routing Algorithms
The Optimality Principle Shortest Path Routing Flooding Hierarchical Routing Distance Vector Routing Link State Routing 2 Routing Algorithms
Main Function of Network Layer: Routing packets from source to destination Routing Algorithm Part of the network layer software responsible for deciding which output line an incoming packet should be transmitted on Maintains routing table 3 DATAGRAM SUBNETS: In case of datagram subnets, the routing decision must be made anew for every arriving data packet since the best route may have changed since last time. VIRTUAL CIRCUIT SUBNETS: VIRTUAL CIRCUIT SUBNETS: If the subnet uses virtual circuits internally, routing decisions are made only when a new virtual circuit is being set up. Thereafter, data packets just follow the previously Thereafter, data packets just follow the previously established route. This is sometimes called session routing because a This is sometimes called route remains in force for an entire user session 4 Router Processes
Forwarding: Forwarding: Move packets from router’s incoming line to appropriate router outgoing line by checking the routing table Routing Algorithm: Routing Algorithm: The process which is responsible for filling in and updating the routing tables 5 Desired properties for a routing algorithm: correctness simplicity robustness
The ability of a routing algorithm to cope with changes in the topology and traffic without requiring all jobs in all hosts to be aborted and the network to be rebooted every time some router crashes. stability of the routing decisions
fairness of the resource allocation optimality of the packet travel times
6 Fairness and Optimality
Fairness and optimality are often contradictory goals •Suppose that there is enough traffic between A and A', between B and B', and between C and C' to saturate the horizontal links. •To maximize the total flow, the X to X' traffic should be shut off altogether. •Unfortunately, X and X' may not see it that way. •Evidently, some compromise between efficiency and fairness to individual connections is needed. 7 Minimizing mean packet delay is an obvious candidate, but so is maximizing total network throughput. Furthermore, these two goals are also in conflict, since operating any queuing system near capacity implies a long queuing delay. As a compromise, many networks attempt to minimize the number of hops a packet must make, because reducing the number of hops tends to improve the delay and also reduce the amount of bandwidth consumed, which tends to improve the throughput as well.
8 Classes of Routing Algorithms
Routing algorithms can be grouped into two major classes: nonadaptive and adaptive Nonadaptive / Static Algorithms
The routing table is not changed according to network conditions The path from source to destination is computed in advance, offline, and downloaded to the routers when they are booted 9 Adaptive / Dynamic Algorithms They change their routing decisions to reflect changes in the topology and traffic They differ from each other on the basis of where they get their information (e.g., locally, from adjacent routers, or from all routers), when they change the routes (e.g., every few sec, when the load changes or when the topology changes), what metric is used for optimization (e.g., distance, number of hops, or estimated transit time). 10 The Optimality Principle
If router J is on the optimal path from router I to router K, then the optimal path fromJ to K also falls along the same route (a) A subnet (b) A sink tree for router B 11 As a result of the optimality principle, we can see that the set of optimal routes from all sources to a given destination form a tree rooted at the destination. Such a tree is called a sink tree Such a tree is called a Sink tree does not contain any loops Sink tree does not contain any loops So, each packet will be delivered within a finite and So, each packet will be delivered within a finite and bounded number of hops 12 Shortest Path Routing
To choose a route between a given pair of routers, the algorithm just finds the shortest path between them. One way of measuring path length is the number of One way of measuring path length is the number of hops. Using this metric, the paths ABC and ABE are Using this metric, the paths ABC and ABE are equally long. Another metric is the geographic distance in Another metric is the geographic distance in kilometers, in which case ABC is clearly much longer than ABE
13 The shortest path is the fastest path rather than the path with the fewest arcs or kilometers The labels on the arcs could be computed as a The labels on the arcs could be computed as a function of the distance, bandwidth, average traffic, communication cost, mean queue length, measured delay, and other factors By changing the weighting function, the algorithm By changing the weighting function, the algorithm would then compute the ''shortest'' path measured according to any one of a number of criteria or to a combination of criteria. 14 To compute the shortest path from A to D: Dijkstra’s algorithm Shortest Path Routing 15 Flooding
flooding P P P P Transmit a copy of each packet it receives on every one of its transmission links Advantages: robust, useful, broadcasting Disadvantages: uses too much resources How to dampen the process of flooding: 1- Hop Count 2. Sequence Numbers 16 A hop counter contained in the header of each packet, which is decremented at each hop, with the packet being discarded when the counter reaches zero The source router puts a sequence number in each The source router puts a packet it receives from its hosts to keep track of flooded packets and to avoid sending them out a second time Selective Flooding Routers do not send every incoming packet out on every line, only on those lines that are going approximately in the right direction 17 Hierarchical Routing
The routers are divided into regions, with each router knowing all the details about how to route packets to destinations within its own region, but knowing nothing about the internal structure of other regions From U.S., send a packet to csie.ndhu.edu.tw
first send to domain tw (Taiwan) then to subdomain edu then to host csie then to subsubdomain ndhu 18 Advantage Simple Efficient Saving routing table space Consider a subnet with 720 routers. Consider a subnet with 720 routers. If there is no hierarchy, each router needs 720 If there is no hierarchy, each router needs 720 routing table entries. If the subnet is partitioned into 24 regions of 30 If the subnet is partitioned into 24 regions of 30 routers each, each router needs 30 local entries plus 23 remote entries for a total of 53 entries. 19 Hierarchical Routing 20 Hierarchical Routing
Unfortunately, gain in routing table space is not free
There is a penalty to be paid, and this penalty is in the form of increased path length e.g., the best route from 1A to 5C is via region 2, but with hierarchical routing all traffic to region 5 goes via region 3, because that is better for most destinations in region 5 21 When a single network becomes very large, an interesting question is: How many levels should the hierarchy have? Answer: Answer: The optimal number of levels for an N router subnet is lnN, requiring a total of elnN entries entries per router 22 ...
View Full Document
This note was uploaded on 12/18/2010 for the course ME 22 taught by Professor Rashid during the Spring '10 term at Superior University Lahore.
- Spring '10