0% found this document useful (0 votes)
184 views10 pages

Static Vs Dynamic: Routing Algorithm

1) Routing algorithms determine the optimal path between nodes on a network and allow for adaptive routing based on changes to network topology or traffic load. Static algorithms use pre-determined paths while dynamic algorithms can change paths in response to changes. 2) Common routing algorithms include shortest path routing, flooding, distance vector routing, and link state routing. Distance vector routing uses hop counts to determine optimal paths but has issues with slow convergence. Link state routing addresses this by sharing full topology information between routers. 3) Hierarchical routing is needed at large scales as it is infeasible for routers to know full network details; the network is divided into regions with inter-region routing and intra-region details.

Uploaded by

AnjuPandey
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
184 views10 pages

Static Vs Dynamic: Routing Algorithm

1) Routing algorithms determine the optimal path between nodes on a network and allow for adaptive routing based on changes to network topology or traffic load. Static algorithms use pre-determined paths while dynamic algorithms can change paths in response to changes. 2) Common routing algorithms include shortest path routing, flooding, distance vector routing, and link state routing. Distance vector routing uses hop counts to determine optimal paths but has issues with slow convergence. Link state routing addresses this by sharing full topology information between routers. 3) Hierarchical routing is needed at large scales as it is infeasible for routers to know full network details; the network is divided into regions with inter-region routing and intra-region details.

Uploaded by

AnjuPandey
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 10

Routing Algorithm

The Optimality Principle Shortest Path Routing Flooding Distance Vector Routing Link State Routing Hierarchical Routing Broadcast Routing Multicast Routing Routing for Mobile Hosts Routing in Ad Hoc Networks The routing algorithm is a part of network layer software to decide which output line an incoming packet should be transmitted on. Session routing is a route remains in force for an entire user session. Routing algorithms should be correctness, simplicity, robustness, stability, fairness, and optimality Routing Algorithms Non-adaptive algorithms They do not base their routing decisions on measurements or estimates of the current traffic and topology. Choice of route is done in advance This procedure is sometimes called static routing. Adaptive algorithms They change their routing decisions to reflect changes in the topology. This procedure is sometimes called dynamic routing. routing decisions are changed as per the change in topology or load Static Manually created and maintained Does not share information Function of IP Small Dynamic Dynamically built Share information among routers Function of Routing protocol(e.g.,RIP) Large

Static vs Dynamic
Function Routing Tables Sharing Information Route Discovery Internetwork

Static Algorithm Shortest Path Routing Flooding Flow Based Routing

Dynamic Algorithm Distance Vector Routing Link State Routing


The Optimality Principle
If the router J is on the optimal path from the router I to the router K, then the optimal path from J to K also falls along the same route. Proof: If there is a better router from J to K, the route from I to K can be improved. Construct a sink tree with the destination to be root. The goal of all routing algorithms is to discover and use the sink tree for all routers. Since it is a tree, there is no loops. A real network is complex. Routers and links may be down at any time.

(a) A subnet. (b) A sink tree for router B.

Static Algorithm
1)Shortest Path Routing: Shortest Path Routing is a static routing algorithm
that just finds the shortest path. A graph is used to represent the network. Each node of the graph represents a router. Each arc of the graph represents a communication link. To choose the route between a given pair of routers, the algorithm just finds the shortest path between them on the graph. Metric used in the shortest path. Number of hops Geographic distance in miles/kilometers Transmission delay fastest path Each arc (link) is labeled with a weight (link distance).

Dijkstra Algorithm

Each node is labeled with the distance from the source node along the best known path and the source node. Initially, no paths are known, all nodes except the source are labeled as (, -). All labels may be either tentative or permanent. Initially, the labels are tentative. When it is discovered to be shortest possible path, the label is made permanent and never changed thereafter.. An example: find the shortest path from A to D We start out by making node A permanent indicated by a filled-in circle. Then we examine each node adjacent to A, relabeling each one. Scan all the tentatively labeled nodes in the whole graph and make the one with the smallest distance to A permanent. This node becomes the new working node. Repeat the steps till the destination becomes permanent

The first 5 steps used in computing the shortest path from A to D. The arrows indicate the working node.

2)Flooding:

Flooding is a static routing algorithm. Every incoming packet is sent out on every outgoing line except the one it arrived on.

There are several variants of flooding algorithm: most work roughly as follows. Each node acts as both a transmitter and a receiver. Each node tries to forward every message to every one of its neighbors except the source node Selective Flooding The IMPs(routers) do not send every incoming packet out on every line, only those lines that are going approximately in the right direction. Random Walk The IMP simply picks a line at random and forwards the packet on it. Also, the IMP can make some attempt to get the packet heading in roughly the right direction. Flooding has tremendous reliability and always choose the shortest delay used in applications such as military, distributed database, wireless network, and a metric compared to other routing algorithm

3)Flow Based Routing


This algorithm requires the knowledge of topology and load condition to decide the route. i.e if the load from A to B is very high(due to short path) and packets are coming to another path having route through B (say A to C) then route is diverted not through B but through some other nodes (even though it is not optimal path)

Dynamic Algorithm
1)Link State Routing: Link State Routing is a dynamic 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

2)Distance Vector Routing


Dijkstra algorithm can find the shortest path from the source to the destination. In a real network, how the topology is obtained. Distance Vector Routing algorithm Dynamic routing Each router maintains a table (vector), giving the best known distance to each destination and the outgoing line to get there. These tables are updated by exchanging information with the neighbors. The metric used might be the number of hops, the time delay, or the number of queued packets. The router is assumed to know the distance to each of its neighbors

(a) A subnet. (b) Input from A, I, H, K, and the new routing table for J. Distance vector works in theory but has a serious drawback in practice. React rapidly to good news when a router comes up. Though it finally converge to correct result, it takes long time when where is a bad news. There are several attempts to solve the problem, but none is perfect. Distance vector routing was used in ARPANET until 1979 when it is replaced by link state routing. Two problems of distance vector routing: It does not take line bandwidth into account. It took too long to converge

The count-to-infinity problem

The count-to-infinity problem

Measuring Line Cost


Measuring Line Cost Send an ECHO packet, measure the round trip delay, and divide it by two. Repeat it several items to have a better estimation.

Whether to take the load into the account? Consider the load: start measuring delay when ECHO is queued. Choosing unloaded line results in better performance. But the load might oscillate. Ignore the load: start measuring delay when the ECHO packet reaches the front of the queue.

A subnet in which the East and West parts are connected by two lines.

Building Link State Packets:

Build the link state packet containing: node ID, sequence number, age, a list of neighbors and the delay to the neighbor. Building the state packet is easy. The hard part is to determine when to build them. Periodically or event-driven

(a) A subnet. (b) The link state packets for this subnet Distributing the Link State Packets: The trickiest part is to
distribute link state packet. Basic idea: Use flooding to distribute the link state packets. To keep the flood in check, each packet contains a sequence number that is increased by one for each new packet. When the link state packet arrives, the router check if it is new. Yes forward it to all outgoing lines except the one it arrived.

No (duplicated or with low sequence number) discard it. Potential problems: The sequence number wrap around use the 32-bit sequence number. It takes 137 years to wrap around. The router crashes. Its sequence number starts again from 0, it is rejected. The sequence number is corrupt (e.g., 65540 is received instead of 4, then packets from 5 to 65540 will be rejected.) Use age to solve the problems: The age decreases by one per second. The packet is discarded when age = 0. Problem packets wont last for a long time. Each router uses a table to maintain the link state packets. Each row is a recently received but not processed packet. Each entry includes the source address, sequence number, age, and send/ACK flags

The packet buffer for router B in the previous slide (Fig. 5-13). Computing Routes: Once a router has accumulated a full set of link
state packets, it knows all nodes and links, thus can construct the subnet graph. Run Dijkstra algorithm to find the shortest paths from the source to all other nodes. For a network with n routers, each with k neighbors, the memory required in nk. Memory and computational time may be a problem for large subnets. But it works fine for many practical situations. The OSPF (Open Shortest Path First) protocol is used in the Internet. IS-IS (Intermediate System-Intermediate System) is used in some the Internet backbone (NSFNET With the increase of network/routers, it is infeasible to have an entry for each router. The hierarchical routing is required.

Hierarchical Routing

Divide the routers into regions. The router only knows details to route packets to the destination within the same region. But may not be optimal (e.g., The best route from 1A to 5C is via region 2, but since the route via region 3 is better for most nodes in region 5.

Broadcast Routing
Broadcasting: send a packet to all destinations. Distributing weather reports, stock, radio programs, etc. Broadcast routing algorithm Send a distinct packet to each destination (waste bandwidth) Flooding (generate too many packets) Multi-destination routing The packet includes a list of destinations The router sends the packet on an outgoing line if it is the best route for at least one of destinations (according to routing table). Broadcast routing algorithm A spanning tree is a subset of the subnet that includes all the routers but contains no loops. Copy an incoming broadcast packet onto all the spanning tree lines except the one it arrived on. excellent use of bandwidth But each router is required to know some spanning tree. Reverse path forwarding: approximate spanning tree Router check if the packet arrived on the line normally used for sending packets to the source; if so, the broadcast packet is likely following the best route, the router rebroadcast it; if no, discards it

Reverse path forwarding. (a) A subnet. (b) a Sink tree. (c) The tree built by reverse path forwarding. Multicast Routing:
Sending a packet to a group of nodes (a subset of the nodes in the network) is called multicasting. Multiple unicast or broadcast are too expensive Build spanning tree Upon receiving a packet, prune the spanning tree (cut off the routers/lines that do not lead to any member in the group) Not scalable

(a) A network. (b) A spanning tree for the leftmost router. (c) A multicast tree for group 1. (d) A multicast tree for group 2. Routing for Mobile Hosts
All hosts are assumed to have a permanent home location (home address) that never changes.

Each area has one or more foreign agents (FA), keeping track of all mobile hosts (MH) visiting the area. Each area has a home agent (HA), which keep track of hosts whose home is in the area but are currently visiting another area

A WAN to which LANs, MANs, and wireless cells are attached

Routing in Ad Hoc Networks


Possibilities when the routers are mobile: 1. Military vehicles on battlefield. No infrastructure. 2. A fleet of ships at sea. All moving all the time 3. Emergency works at earthquake . The infrastructure destroyed. 4. A gathering of people with notebook computers. In an area lacking 802.11. 5. A MANET (Mobile Ad Hoc Networks) is a network forming by an autonomous collection of mobile devices. 6. The Ad hoc On Demand Distance Vector (AODV) routing algorithm is a routing protocol designed for ad hoc mobile networks. AODV is capable of both unicast and multicast routing. It is an on demand algorithm, meaning that it builds routes between nodes only as desired by source nodes. It maintains these routes as long as they are needed by the sources. AODV forms trees which connect multicast group members. The trees are composed of the group members and the nodes needed to connect the members. AODV uses sequence numbers to ensure the freshness of routes.

You might also like