2 - Routing Algorithms
2 - Routing Algorithms
Introduction
1. Overview
The network layer plays a important role in the networking stack by ensuring that data packets are
delivered from the source to the destination. This process usually involves multiple intermediary nodes
and requires mechanisms for:
Routing is especially critical in broadcast networks when the source and destination reside on separate
subnets. The key challenge here is to maintain timely, reliable, and efficient delivery, particularly in
dynamic and unpredictable network conditions.
Purpose: Determines the optimal path for packets to travel through the network.
Characteristics:
Operates over longer time scales, focusing on strategic decision-making.
Utilizes routing algorithms to update and maintain routing tables dynamically or statically.
Considers various metrics such as hop count, bandwidth, and latency to decide the best
route.
Outcome: Updates routing tables that guide the forwarding process.
3. Routing Implementation 1 / 40
3.1 Datagram Networks: Connectionless Approach
Each packet is treated independently, with no prior knowledge of preceding or following packets.
Advantages:
Highly adaptable to changes in network topology.
Allows for flexible load balancing as routes can vary for each packet.
Disadvantages:
Higher overhead since routing decisions must be made for each packet.
Potential for out-of-order delivery if packets take different routes.
A fixed path (virtual circuit) is established before any data transmission begins.
Advantages:
Guarantees in-order packet delivery since all packets follow the same route.
Reduces per-packet processing overhead after the connection setup.
Disadvantages:
Less adaptable to network changes during a session.
Connection setup introduces initial delay, unsuitable for short-lived sessions.
1. Correctness:
Ensures accurate route computation and error-free packet delivery.
Validates routes against potential routing loops or dead ends.
2. Simplicity:
Avoids overly complex algorithms that may require excessive computational resources.
Prioritizes maintainable code for real-world implementations.
3. Robustness:
Handles hardware or software failures gracefully.
Adapts to changes in network topology without significant disruptions.
4. Stability:
Maintains consistent routes even during transient network changes.
Achieves convergence (route updates) quickly to avoid oscillations or inconsistencies.
5. Fairness:
Balances resource allocation across competing users or data flows.
Prevents scenarios where certain users 2dominate
/ 40
bandwidth.
6. Efficiency:
Minimizes packet delays while maximizing overall network throughput.
Strives for optimal resource utilization with minimal overhead.
Fairness vs. Efficiency: Achieving fairness may involve redistributing resources, potentially
lowering overall throughput.
Stability vs. Adaptability: Highly adaptive algorithms can destabilize networks due to frequent
updates.
Complexity vs. Performance: More sophisticated algorithms may improve performance but
require greater processing power.
6. Optimization Goals
6.1 Performance Metrics
1. Mean Packet Delay: Reduces the average time taken for packets to traverse the network.
2. Network Throughput: Maximizes the rate of successful packet delivery over the network.
3. Resource Utilization: Optimizes the use of network infrastructure, avoiding bottlenecks or
underutilized paths.
4. Path Efficiency: Minimizes path length or energy consumption in wireless networks.
1. Overview
4 / 40
The Optimality Principle (Bellman, 1957) is a foundational concept in routing algorithms, stating that
optimal routes from one node to another depend on the optimality of intermediate nodes. This principle
helps define how routing paths are determined and provides a benchmark for evaluating routing
algorithms.
If router b is part of the optimal path from router a to router c, the optimal path from b to c must
also lie along the same route.
The result of this principle is that optimal paths from all routers to a destination form a tree, called
a sink tree.
Sink Tree: A tree rooted at the destination node, where all optimal paths converge.
Example: If the distance metric is hops, a sink tree shows the least number of hops needed
to reach the destination.
3.2 Non-uniqueness
Sink trees are not necessarily unique, as other trees with the same path lengths might exist.
When considering all possible paths, the structure can be generalized into a Directed Acyclic
Graph (DAG), which represents all paths but without any loops.
4. Practical Considerations
5 / 40
4.1 Robustness of Paths
The assumption is made that paths do not interfere with each other (e.g., no congestion).
In reality, network conditions can change dynamically, causing disruptions such as link failures or
varying router states.
The method by which routers acquire the information to compute their respective sink trees is not
straightforward.
Routers may need to individually gather topology data or rely on other means of information
collection.
This becomes an important consideration in real-world implementations.
Since a sink tree is indeed a tree, it does not contain any loops, so each packet will be delivered
within a finite and bounded number of hops.
In practice, life is not quite this easy. Links and routers can go down and come back up during
operation, so different routers may have different ideas about the current topology.
5. Key Takeaways
6 / 40
based on a specific metric. These metrics can range from the number of hops to more sophisticated
measures like delay, bandwidth, or communication cost.
The metric used will determine the shortest path. For instance, if we're considering hops, the algorithm
will prioritize paths with fewer routers. However, if we are considering delay, the algorithm will prioritize
paths with the minimum cumulative delay.
3.1 Overview
Dijkstra’s algorithm, introduced by Edsger Dijkstra in 1959, is a well-known algorithm for computing the
shortest paths between a source node and all other nodes in a graph. It works by iteratively exploring
the graph, updating tentative distances (labels) for each node until the shortest paths are found.
The algorithm works on weighted graphs where each edge has a non-negative weight (e.g., delay
or distance).
The algorithm assigns a distance label to each node, representing the shortest known distance
from the source node.
7 / 40
Initially, all nodes are labeled with infinity (∞), indicating that no paths are known. As the algorithm
progresses, labels are updated to reflect shorter paths.
Once the shortest path to a node is found, the label is made permanent, and no further updates
are made to that node.
4.1 Initialization
Every node starts with an initial label of infinity, except for the source node, which has a label of 0,
representing the distance from itself.
A node is said to be "tentatively labeled" when its distance is still subject to change. Once a node's
label reflects the shortest distance from the source node, it is considered "permanent."
At each step, Dijkstra’s algorithm guarantees that once a node’s label is made permanent, it
reflects the shortest possible path from the source node.
If there were a shorter path discovered later, it would have been found earlier because any new
tentative path must be longer than any current8 / permanent
40 path.
This ensures that the algorithm always finds the shortest path in the graph.
5.2 No Cycles
The algorithm assumes that the graph is free of negative-weight cycles, as negative weights would
allow for infinite reductions in the path length, violating the assumption of non-negative labels.
In some implementations, the search starts from the destination node and proceeds backward. This is
done by labeling each node with its predecessor, and the final path is reconstructed by reversing the
order of labels.
6.2 Efficiency
The algorithm’s time complexity is O(n^2) in the naive implementation, though more efficient versions
using priority queues (like Fibonacci heaps) can achieve a time complexity of O(E + log V).
7. Conclusion
Dijkstra's algorithm can work with various metrics, such as delay, cost, or hops, allowing it to be applied
in different types of networks with different optimization goals.
This algorithm forms the foundation for many routing protocols in modern computer networks, ensuring
efficient data transfer by computing optimal paths.
Even in distributed settings where not all routers have complete network knowledge, algorithms like
Dijkstra’s are used to find optimal routes.
3. Flooding
9 / 40
Flooding is a routing technique where each incoming packet is sent out on every outgoing link, except
the one it arrived on. It enables routers to make decisions based solely on local knowledge, without
requiring a complete view of the network.
1.1 Duplicate Packets: Flooding can result in a massive number of duplicate packets, potentially
leading to an infinite number of them.
1.2 Hop Counter:
Each packet contains a hop counter in its header.
The counter is decremented at each hop, and the packet is discarded once the counter
reaches zero.
Ideally, the hop counter is initialized to the path length between source and destination.
If the path length is unknown, the worst-case value (the network's full diameter) is used.
1.3 Exponential Growth: Even with a hop counter, flooding can still generate exponential
numbers of duplicate packets as the hop count increases.
2.1 Tracking Packets: Routers can track which packets have already been flooded by using a
sequence number.
Each source router adds a unique sequence number to its packets.
Routers maintain a list of sequence numbers they’ve processed per source router.
If a router sees a packet with a sequence number it has already processed, the packet is not
flooded again.
2.2 Counter (k): To avoid an unbounded list, a counter k is used, which indicates all sequence
numbers up to k have been seen.
When a packet arrives, if its sequence number is less than or equal to k, it is discarded.
This counter-based approach reduces the need for a full list of sequence numbers.
3.1 Broadcasting:
Flooding ensures that a packet reaches every node in the network.
It is effective for broadcasting, although inefficient for communication with a single
destination.
10 / 40
3.2 Wireless Networks:
In wireless networks, messages transmitted by a station are received by all stations within its
radio range.
This behavior mimics flooding and is used by some algorithms for efficient data distribution.
3.3 Robustness:
Flooding is resilient, capable of finding a path even if large parts of the network fail (e.g., in
conflict zones).
It will still deliver a packet as long as some route exists.
3.4 Minimal Setup:
Flooding requires minimal setup: routers only need to know their immediate neighbors.
This simplicity allows flooding to serve as a building block for more sophisticated routing
algorithms.
4. Flooding as a Benchmark
Distance vector routing is a class of dynamic routing algorithms used to determine the best path to
each destination in a computer network. It is called "distance vector" because each router maintains a
table (or vector) that lists the distance (or cost) to reach each destination in the network. These distance
vectors are periodically exchanged between neighboring routers to update routing tables. This allows
routers to collectively compute the best possible paths for routing packets to their destinations.
2- Example:
12 / 40
Consider a network where routers use delay as the metric for routing. Each router knows the delay to
its immediate neighbors, and they exchange this information with each other. Let's assume that router J
has neighbors A, I, H, and K, with known delays of 8, 10, 12, and 6 milliseconds, respectively.
Suppose router J wants to compute the best route to router G. Here's how J might update its routing
table:
Route through A: The delay to A is 8 msec, and A reports a delay of 18 msec to G. So, the total
delay to G via A is 8 + 18 = 26 msec.
Route through I: The delay to I is 10 msec, and I reports a delay of 31 msec to G. So, the total
delay to G via I is 10 + 31 = 41 msec.
Route through H: The delay to H is 12 msec, and H reports a delay of 6 msec to G. So, the total
delay to G via H is 12 + 6 = 18 msec.
Route through K: The delay to K is 6 msec, and K reports a delay of 31 msec to G. So, the total
delay to G via K is 6 + 31 = 37 msec.
From these calculations, router J concludes that the best route to G is through H, with a total delay of
18 msec.
This issue arises when a network experiences a topology change, such as a link failure. Due to the
nature of distance vector routing, routers may take a long time to update their tables and may
temporarily use suboptimal routes, leading to inefficient routing and slow convergence.
4- Explanation of Count-to-Infinity:
Imagine a simple linear network of routers: A, B, C, D, and E. Suppose that the link between A and B
fails, causing the routers to update their routing tables. Here’s how the count-to-infinity problem unfolds:
1. Initial State: Initially, the routers know that A is unreachable because the link between A and B is
down. Thus, the distance to A for all routers except A is infinity.
2. First Exchange: When router B sends its routing table to C, it tells C that it has no path to A. C will
then update its table, marking the distance to A as 2 (C’s distance to B + 1).
3. Subsequent Exchanges: C then sends this information to D, which updates its distance to A as 3
(C’s distance to A + 1). D then sends this to E, and so on, gradually increasing the distance to A in
each router's table.
4. Count to Infinity: This process continues until all routers eventually converge to the fact that A is
unreachable, but this may take a significant number of exchanges. The number of exchanges
grows with the length of the network, causing delays in convergence.
In some cases, routers may even temporarily believe that they have a valid path to A through another
router, causing the routing tables to increment by one hop per exchange. This gradual increase in the
distance to infinity is what gives the problem its name.
Despite these techniques, distance vector routing is still slower in terms of convergence compared
to link-state routing algorithms.
In link-state routing, routers have a complete map of the network and can compute the shortest
paths more efficiently.
In particular, it reacts rapidly to good news, but leisurely to bad news
Distance vector routing is better suited for smaller networks with fewer topological changes.
6- Conclusion:
Distance vector routing is a simple and effective method for dynamic routing in networks, relying
on periodic exchanges of routing tables between neighboring routers.
Convergence can take time, especially when the network experiences failures, and the count-to-
infinity problem can cause delays in the network’s recovery.
Techniques like split horizon, poisoned reverse, and triggered updates help mitigate the
problem, but distance vector routing remains less efficient compared to link-state routing in large
14 / 40
and complex networks.
This algorithm continues to be popular in small-scale or legacy networks, especially in protocols like
RIP (Routing Information Protocol), but more modern networks often prefer link-state routing for
faster convergence and better scalability.
5. Link State
1. Introduction
Distance Vector Routing was used in ARPANET until 1979 but was replaced by Link State
Routing due to inefficiency in handling network topology changes (e.g., the count-to-infinity
problem).
Link State Routing is faster and avoids the pitfalls of Distance Vector Routing.
Modern Protocols: Variants like IS-IS and OSPF are widely used in large networks and the
Internet today.
2. Key Idea
Link State Routing involves distributing the complete network topology to every router.
Each router uses this information to compute the shortest path to every other router using
Dijkstra’s Algorithm.
Each router identifies its directly connected neighbors and learns their network addresses.
The router calculates the cost metric for each link to its neighbors (e.g., based on bandwidth,
delay, or other criteria).
The router generates a packet containing all the information it has learned about its neighbors and
link costs.
15 / 40
3.4 Flood LSPs Across the Network
LSPs are distributed to all other routers through flooding. Each router receives and processes the
LSPs from all others.
With the complete topology data, each router applies Dijkstra’s Algorithm to compute the
shortest path to every other router.
Link Delay: For geographically dispersed networks, delay can be considered in the cost metric.
Measuring Delay:
Use an ECHO packet:
1. Send an ECHO packet over the link.
2. The neighbor immediately sends it back.
3. Measure the round-trip time (RTT) and divide it by two to estimate the delay.
Once a router gathers all necessary information about its neighbors, it prepares a link state packet
(LSP). The packet includes:
Sender identity
Sequence number (incremented with each new packet)
Age (to manage outdated information)
List of neighbors and the cost of reaching each one
5.1.1 Example
17 / 40
For the network in Fig. 5-12(a):
The data structure used by router B for managing link state packets is illustrated in Fig. 5-13. Each row
corresponds to a link state packet that has recently arrived but has not yet been fully processed. The
table keeps track of the packet’s source, sequence number, age, and data. Additionally, flags for
sending and acknowledging packets are included for each of B's three links (to A, C, and F).
When the link state packet from A arrives at router B, it is sent to routers C and F and must be
acknowledged by router A.
Similarly, the packet from F is forwarded to A and C and acknowledged by F.
If a duplicate packet arrives while the original is still being processed in the buffer, the flags need
to be updated. For example, if the C state packet arrives again from F before the original packet
is forwarded, the flags are changed to 100011, indicating that the packet must be acknowledged
by F but not forwarded to F again.
Loops
Unreachable devices
Other routing issues
1. Holding Area:
When an LSP arrives, it is temporarily stored in a holding area before being forwarded.
This allows the router to:
Combine updates.
Discard duplicates.
2. Duplicate Handling:
If a second LSP arrives before the first is sent:
If sequence numbers are equal, discard the duplicate.
If sequence numbers are different, keep the latest and discard the older one.
3. Acknowledgments:
LSPs are acknowledged to ensure reliability.
Each router collects all the link state packets from every other router in the network.
Using this information, it builds a network graph, where:
Nodes represent routers.
Edges represent links between routers with their associated costs.
Links are bidirectional, and their costs may differ in each direction.
Each router runs Dijkstra’s shortest path algorithm locally on its network graph to determine:
The shortest path to every other router.
20 / 40
The next hop to take for each destination.
The result is stored in the routing table.
1. Memory Requirement:
Link State Routing requires storing information about all links in the network, which scales
with kn (where k is the average number of neighbors per router, and n is the total number of
routers).
This is at least as large as the size of a routing table listing all destinations, making it
memory-intensive.
2. Computation Time:
Computing the shortest paths using Dijkstra's Algorithm involves processing the entire
network topology. Even with efficient data structures, the computation time grows faster than
kn, which can be a concern in large networks.
3. Advantages of Link State Routing:
Despite its higher resource demands, Link State Routing is preferred in many practical
scenarios because it avoids slow convergence issues seen in Distance Vector Routing
(e.g., the count-to-infinity problem).
Its ability to quickly adapt to topology changes makes it well-suited for dynamic networks.
In essence, while Link State Routing is more demanding in terms of memory and processing, its
reliability and speed in handling network changes often outweigh these drawbacks, particularly in
modern networks.
7. Broadcast Routing
Introduction
In some applications, hosts need to send messages to many or all other hosts.
For example, a service distributing weather reports, stock market updates, or live radio programs might
work best by sending to all machines and letting those that are interested read the data. Sending a
packet to all destinations simultaneously is called broadcasting. Various methods have been proposed
for accomplishing it.
Methods of Broadcasting
1- Simple Broadcasting
2- Multidestination Routing
3- Flooding
Concept:
23 / 40
When a broadcast packet arrives at a router, the router checks if the packet arrived on the
preferred link used for sending packets toward the broadcast source.
If yes, the router forwards the packet to all links except the one it arrived on.
If no, the packet is discarded as a likely duplicate.
Example: Refer to Figure 5-15:
Part (a): A network.
Part (b): A sink tree for router I.
Part (c): Reverse path forwarding in action.
Steps:
First hop:
Router I sends packets to F, H, J, and N.
Packets arrive on the preferred path to I.
Second hop:
Eight packets are generated (two by each receiving router).
All eight arrive at previously unvisited routers, with five arriving along the preferred line.
Third hop:
Six packets are generated; three arrive on the preferred path (C, E, and K), while the
rest are duplicates.
Final result:
Broadcasting terminates after five hops and 24 packets.
Comparatively, following the sink tree exactly would take four hops and 14 packets.
Advantages:
Efficient and easy to implement.
Each broadcast packet is sent over each link only once in each direction.
Does not require sequence numbers or a list of destinations in the packet.
Summary of Methods
Each method has trade-offs between efficiency, simplicity, and implementation requirements, making
them suitable for different network scenarios.
6. Hierarchical Routing
Here's a detailed explanation of Hierarchical Routing, including the concept, benefits, drawbacks, and
practical examples, while incorporating additional depth as requested:
1. Memory Requirements:
Larger networks mean more entries in routing tables, consuming substantial router memory.
2. Processing Overhead:
Scanning through extensive routing tables requires more CPU time.
3. Bandwidth Usage:
Status reports on table updates consume network bandwidth.
25 / 40
To address these issues, hierarchical routing introduces a structure where the network is divided into
regions. Routers manage detailed routing for their own region but store summarized information about
other regions.
3. Efficiency Gains
1. Reduction in Routing Table Size:
Hierarchical routing condenses routing tables by grouping remote destinations into fewer
entries.
Example (Fig. 5-14):
A router’s table reduces from 17 entries (flat routing) to 7 entries (hierarchical
routing) in a two-level hierarchy.
2. Scalability:
With growing network size, the ratio of regions to routers per region increases, further
reducing the number of routing entries.
3. Optimal Hierarchy Levels
When a single network grows very large, the question arises: How many levels should the
hierarchy have?
1. Example: A Network with 720 Routers:
No Hierarchy: Each router needs 720 entries.
Two-Level Hierarchy:
The network is divided into 24 regions with 30 routers each.
Each router requires 30 local entries + 23 remote entries, totaling 53 entries.
Three-Level Hierarchy:
The network is divided into 8 clusters, each containing 9 regions with 10 routers
each.
Each router requires:
10 entries for local routers.
8 entries for other regions in the cluster.
7 entries for distant clusters.
Total: 25 entries.
2. Mathematical Insight:
Kamoun and Kleinrock (1979) discovered that the optimal number of levels for an N-
router network is Ln N, requiring a total of e Ln N entries per router.
The increase in effective mean path length caused by hierarchical routing is typically
small and acceptable.
27 / 40
4. Drawbacks of Hierarchical Routing
1. Increased Path Length:
Simplified routing results in non-optimal paths, increasing the travel distance for packets.
Example:
In a flat network, the best path from Router 1A to Router 5C passes through Region 2
In a hierarchical setup, the packet may pass through Region 3 instead, as all Region 5
traffic is directed via Region 3.
2. Complex Configuration:
Designing and maintaining a multi-level hierarchy can be challenging, especially as the
number of levels increases.
3. Fault Tolerance:
If a gateway router fails, inter-region communication can be disrupted unless redundancy is
implemented.
5. Practical Example
Imagine a large international network with thousands of routers:
6. Key Insights
28 / 40
1. Trade-off Between Space and Path Length:
Hierarchical routing drastically reduces the size of routing tables but may increase path
lengths.
This trade-off is generally acceptable for large-scale networks.
2. Scalability:
Hierarchical routing supports scaling to millions of routers, as seen in the Internet and
telephone networks.
3. Optimal Hierarchy Design:
The hierarchy must balance:
Levels of hierarchy (too few vs. too many).
Redundancy to prevent failures at critical points.
4. Use Cases:
Widely used in the Internet, where autonomous systems (ASes) represent regions in
hierarchical routing.
Summary
Hierarchical routing is an essential strategy for managing large networks by dividing them into regions
and grouping these regions into higher levels. While it offers significant efficiency in memory and
processing, it comes with the cost of slightly increased path lengths. By optimizing the number of
hierarchical levels, networks can maintain scalability without compromising performance.
Introduction
Multicast routing is essential for efficiently sending packets to multiple receivers in large networks. This
method is used in applications like multiplayer games or live video streaming, where delivering distinct
packets to each receiver is too costly, and broadcasting would be wasteful. The primary objective of
multicast routing is to send messages to specific groups of receivers without overburdening the
network. The routing algorithms for multicast focus on creating and maintaining efficient paths to deliver
packets to group members while minimizing bandwidth usage.
Multicast Groups: Each multicast group is identified by a multicast address, and routers know
which groups they belong to.
Efficient Use of Bandwidth: Instead of broadcasting packets to all network nodes or sending
individual packets to each receiver, multicast29routing
/ 40 sends data to well-defined groups, reducing
wasted bandwidth.
Dense Groups: For groups where receivers are scattered across most of the network, broadcast
can be a good starting point. However, broadcast is inefficient as it reaches routers not interested
in the message. Pruning the broadcast tree removes unnecessary links and optimizes the
multicast path.
Sparse Groups: For groups with a limited number of receivers compared to the network size,
efficient routing is achieved by constructing a multicast tree that minimizes the network resources
used.
One solution for dense groups is to prune the broadcast spanning tree by removing links that do not
lead to group members. This creates a more efficient multicast tree. For example:
Spanning Tree for Broadcast: Initially, a spanning tree can be used for broadcast but is not
optimal for multicast due to redundant paths.30 / 40
Pruned Spanning Tree: By removing non-essential paths, the tree becomes more efficient. For
example, a multicast tree for group 1 may be pruned to include only the links necessary to reach
members of group 1, reducing the total number of links from 10 to 7 (fig 5.16 b and fig 5.16 c).
4- Pruning Strategies
Link State Routing: In this approach, routers know the entire network topology, including group
membership, and can prune spanning trees accordingly. The MOSPF (Multicast OSPF) protocol
is an example of this.
Distance Vector Routing: This approach involves reverse path forwarding. Routers without any
hosts interested in the group will send a PRUNE message to stop forwarding multicast packets for
that group. This process continues recursively, pruning unnecessary paths.
While pruning improves efficiency, it requires significant router processing, especially in large networks.
For instance, if a network has n groups and each group has an average of m nodes, routers must store
mn pruned spanning trees, which can be resource-intensive.
5- Core-Based Trees
An alternative approach to pruning is the use of core-based trees, which construct a single spanning
tree for the entire multicast group. The tree is rooted at a core (or rendezvous point), and packets are
sent from each member to this core, merging the paths into a unified tree.
Tree Construction: All routers agree on the core, and the tree is built by sending packets from
group members to the core.
Performance Optimization: Once a packet reaches the tree, it can be forwarded both up towards
the core and down to other branches, reducing latency.
31 / 40
Efficiency Concerns: Although core-based trees may not always provide the shortest path (e.g.,
when the core is far from the sender), they are efficient for sparse groups because routers only
need to maintain one tree per group, instead of multiple pruned trees.
Storage and Bandwidth Savings: With a shared tree, routers store only one tree per group,
significantly reducing storage requirements and message overhead.
Suitable for Sparse Groups: Core-based trees are commonly used for sparse multicast groups,
as seen in protocols like PIM (Protocol Independent Multicast).
Conclusion
Multicast routing, through strategies like pruning and core-based trees, optimizes the delivery of
packets to multicast groups. While pruning offers tailored, efficient paths for dense groups, core-based
trees provide a simplified and efficient structure for sparse groups, ensuring that multicast routing
scales effectively across large networks.
9. Anycast Routing
The content has been structured and formatted for clarity and readability as follows:
Anycast is a routing model where a packet is delivered to the nearest member of a group of nodes,
rather than a specific one. This is distinct from unicast (one-to-one), multicast (one-to-many), and
broadcast (one-to-all) delivery models. In anycast, the main goal is not to contact a particular node, but
to get the right information from any node in a group.
32 / 40
Anycast routing does not require entirely new routing protocols. Distance vector and link state
protocols can be adapted to support anycast.
Distance vector routing: Multiple nodes can be assigned the same address (e.g., group 1 in the
diagram), and each node will receive routing information as usual. When a node wants to send a
packet to "1," it will send it to the closest instance of that address, according to the routing table.
For example, the routing in Figure 5-18(a) shows how nodes will route to the nearest instance
of destination "1." The routing protocol doesn't differentiate between the multiple nodes that
share the same address; it simply sends the packet along the shortest path to the destination.
This procedure works because the routing protocol does not realize that there are multiple
instances of destination 1. That is, it believes that all the instances of node 1 are the same
node, as in the topology shown in Fig. 5-18(b)
Link state routing: Works similarly, though with a slight difference in how routing information is
handled. The protocol must avoid calculating routes that incorrectly pass through the same
instance of "1," as this could cause loops or incorrect routing paths. Link state protocols already
differentiate between routers and hosts, so this distinction helps avoid errors.
Summary
Anycast routing allows for efficient delivery to the nearest available node in a group, making it useful for
services where the specific node doesn't matter, but proximity does. Regular routing protocols like
distance vector and link state can be adapted to work with anycast by considering multiple nodes as
a single entity for routing purposes.
With the increasing need to stay connected from virtually anywhere in the world, mobile hosts introduce
a challenge in routing: how to route packets to a mobile host, which can be located anywhere. To
address this, we explore a model where hosts have a permanent home location and home address
that never changes. The routing goal is to enable sending packets to mobile hosts using their fixed
home addresses while efficiently reaching them wherever they may be.
34 / 40
Mobile Routing Process:
Important Concepts:
Triangle Routing: This routing model is referred to as triangle routing, as the packets may take
a longer, indirect path (from Seattle → New York → San Diego) if the remote location is far from
the home location.
35 / 40
Dynamic Routing: After the initial interaction, subsequent packets are routed directly to the
mobile host’s care of address, ensuring faster communication.
4- Security Considerations
When a mobile host changes its location, the home agent must verify the authenticity of the registration
message to prevent unauthorized users from hijacking the mobile host’s packets. Cryptographic
protocols ensure the validity of such messages.
6- Summary
In mobile routing, the home agent plays a central role in tracking the mobile host’s location and
forwarding packets to its current address. This approach allows packets to be sent to the mobile host’s
permanent home address while routing them to the correct current location. This method prevents the
need for constant route recalculations and ensures that mobile hosts can stay connected even while
moving across different networks.
1- Introduction
Ad hoc networks (or MANETs, Mobile Ad hoc Networks) are formed by mobile nodes that communicate
wirelessly and act as both hosts and routers. These networks are dynamic, meaning the topology can
change frequently as nodes move or join/leave the network.
1. Topology Changes: The network topology can change at any time due to mobility.
2. Dynamic Routes: Routes may become invalid or change frequently.
3. Limited Resources: Ad hoc nodes have limited bandwidth and battery life.
36 / 40
Example Use Cases:
Once the RREQ reaches the destination node I, it constructs a Route Reply (RREP) packet.
The RREP is unicast back to the source (A) along the reverse path taken by the RREQ.
Each intermediate node, like B, D, and G, remembers the node from which it received the
request. This memory allows the RREP to follow the reverse route correctly.
Each intermediate node also increments a hop count as the RREP is forwarded. This hop count
indicates the distance (in terms of hops) from the destination.
5- Route Selection:
As the RREP travels back toward the source, intermediate nodes, such as G and D, use the best
route they have heard (based on the hop count) to update their routing tables.
Finally, when the RREP reaches Node A, a new route (denoted ADGI) is created, which now
allows Node A to communicate with Node I via nodes D, G, and I.
3- Route Maintenance
The network topology can change dynamically due to node mobility. To ensure route validity:
1. Hello Messages: Nodes periodically send Hello messages to neighbors. If a node does not
receive a response, it knows that the neighbor is unreachable.
2. Route Purging: If a node detects that a neighbor is unreachable, it purges any routes involving
that neighbor. This information is propagated throughout the network to ensure consistency.
38 / 40
3. Sequence Numbers: To avoid issues like count-to-infinity or slow convergence during topology
changes, a sequence number is used to ensure that newer routes are preferred over old ones.
Nodes ask for routes with higher sequence numbers to ensure they are using up-to-date paths.
4. Efficient Resource Use: AODV minimizes bandwidth usage by only maintaining routes that are in
use. Other routes are discarded after a timeout.
5- Optimizations
To reduce overhead, the scope of broadcasts is limited using the Time to Live (TTL) field in the IP
packet. The TTL is incremented in successive attempts, ensuring the search starts locally and gradually
expands.
If multiple nodes need the same route (e.g., B also needs to reach I), they share the discovered route,
preventing redundant broadcasts.
7- Conclusion
39 / 40
Routing in ad hoc networks is challenging due to dynamic topology and resource constraints. AODV is
one of the widely-used routing protocols due to its on-demand nature, sequence numbering, and
minimal maintenance overhead. However, the choice of protocol depends on the specific application,
and other protocols like DSR and GPSR are also popular for different types of networks.
40 / 40