Professional Documents
Culture Documents
Unit 4 Routing
Unit 4 Routing
Unit 4 Routing
1. Static routing does not involve any change in routing table unless the network
administrator changes or modify them manually. Static routing algorithms
function well where the network traffic is predictable. This is simple to design
and easy to implement. There is no requirement of complex routing protocols.
The routing decisions are not made by current topology or traffic because the static
routing systems can not react to network changes hence it doesn’t require extra
resources to learn the changes. That is the reason, static routing is considered as
inappropriate for large and constantly changing networks.
The technique uses routing protocols to disseminate knowledge such as RIP, OSPF,
BGP, etc. Unlike static routing, it does not require manual updation instead its
automatic in manner and updates the routing table information periodically relying
upon network conditions. For doing so, it requires extra resources for storing the
information.
Dynamic routing or otherwise called as adaptive routing. The routing decisions are
altered in these algorithms to mirror the changes in the topology or traffic. There are
various adaptive algorithms which can be classified according to the source of
information (from where router get the information, adjacent routers or from all
routers), change in routes (whether the route is changing when load changes or when
topology changes), optimization metrics used (distance, number of hops, residual
bandwidth).
The routes on which dynamic routing is performed are known as dynamic routes where
the information is responsive to changes in the network so that it is consistently being
updated. Though, there is always a slack between the period that a network changes and
when all the routers are informed about the change. The router tries to match the
network change, and it causes a delay which is also known as convergence time. The
convergence time must be shorter. The larger network requires dynamic routing
because with static routing larger networks could not be manageable and result in loss
of connectivity.
BASIS FOR
STATIC ROUTING DYNAMIC ROUTING
COMPARISON
change in topology.
Link failure Link failure obstructs the Link failure doesn't affect the
rerouting. rerouting.
routing process.
the information.
1. The routers are configured manually, and the table is also created manually in static
routing whereas in dynamic routing the configuration and table creation is automatic and
router driven.
2. In static routing, the routes are user-defined while in dynamic routing the routes are
updated as topology changes.
3. Static routing does not employ complex algorithms. As against, dynamic routing uses the
complex algorithm for calculating shortest path or route.
4. Dynamic routing is suitable for large networks where the number of hosts is high.
Conversely, static routing can be implemented in a small network.
5. When a link fails in static routing, the rerouting is discontinued and requires manual
intervention to route traffic. In contrast, link failure in dynamic routing does not disrupt
rerouting.
6. The message broadcast and multicast in dynamic routing makes it less secure. On the
other hand, static routing does not involve advertisement which makes it more secure.
7. Dynamic routing involves protocols such as RIP, EIGRP, BGP, etc. Inversely, static
routing does not require such protocols.
8. Static routing does not need any additional resources while dynamic routing requires
additional resources such as memory, bandwidth, etc.
Disadvantages
Disadvantages
Initially, it could be complicated to implement.
The broadcasting and multicasting of routing updates make it less secure.
Routes rely on current topologies.
Additional resources are required such as CPU, memory and link bandwidth.
Optimal Routing
Stability
Ease of Use
Flexibility
Rapid Convergence
Optimal Routing
One of the primary goals of all routing protocols is to select the most
optimal path through the network from the source subnet or host to
the destination subnet or host. The most optimal route depends on
the metrics used by the routing protocols. A route that may be
considered the best by one protocol may not necessarily be the most
optimal route from the perspective of another protocol. For
example, RIP might consider a path that is only two hops long as the
most optimal path to a destination network, even though the links
were 64Kbps links, while advanced protocols such as OSPF and
EIGRP might determine that the most optimal path to that same
destination is the one traversing four routers, but using 10Gbps
links, for example.
Stability
Ease of Use
Flexibility
Rapid Convergence
Flooding –
Requires no network information like topology, load condition
,cost of diff. paths
Every incoming packet to a node is sent out on every outgoing
like except the one it arrived on.
For Example in above figure
A incoming packet to (1) is sent out to (2),(3)
from (2) is sent to (6),(4) and from (3) it is sent to (4),(5)
from (4) it is sent to (6),(5),(3) , from (6) it is sent to
(2),(4),(5),from (5) it is sent to (4),(3)
Characteristics –
All possible routes between Source and Destination is tried. A
packet will always get through if path exists
As all routes are tried, there will be atleast one route which is
the shortest
All nodes directly or indirectly connected are visited
Limitations –
Flooding generates vast number of duplicate pakects
Suitable damping mechanism must be used
Hop-Count –
A hop counter may be contained in the packet header which is
decremented at each hop.
with the packet being discarded when the counter becomes
zero
The sender initializes the hop counter. If no estimate is known,
it is set to the full diameter of the subnet.
Keep track of the packets which are responsible for flooding
using a sequence number. 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 go in approximately in the
direction of the destination.
Advantages of Flooding :
Highly Robust, emergency or immediate messages can be sent
(eg military applications)
Set up route in virtual circuit
Flooding always chooses the shortest path
Broadcast messages to all the nodes
Dynamic routing
Shortest path routing
Use Dijkstra's algorithm to compute the shortest paths from a given source node to all
other nodes in a network. Links are bi-directional, with the same distance in either
direction. Distance can be any measure of cost.
linklist = [('A', 'B', 2), ('B', 'C', 7), ('C', 'D', 3),
# (node,node,distance)
('B', 'E', 2), ('E', 'F', 2), ('F', 'C', 3),
('A', 'G', 6), ('G', 'E', 1), ('G', 'H', 4),
('F', 'H', 2), ('H', 'D', 2), ]
The strategy is to start at the source node, send probes to each of its adjacent nodes, pick
the node with the shortest path from the source, and make that the new working node.
Send probes from the new working node, pick the next shortest path, and make that the
next working node. Continue selecting the shortest possible path until every node in the
network has been selected.
Figure 1 shows the first few steps in our example network. Labels on each node show its
distance from the source, and the previous node on the path from which that distance
was computed. As new nodes are first probed, they are added to a working set, shown
with a darkened open circle. After each probe cycle, we look at the entire set of working
nodes. The node with the shortest path is moved to a final set, shown with a solid circle.
Figure 1b shows the situation after the first probes from node 'A', with one node in the
final set, and two nodes in the working set.
The labels on nodes in the working set are tentative. They will be replaced if another
probe arrives with a shorter total path. Figure 1d shows node G getting an update of its
label after a probe from node E. The updates at a node stop when no other working set
node has a shorter path. This is the proof that the
method works. The node with the shortest path in a working set can never get any
shorter, because subsequent probes can only come from other working nodes, and those
paths are already at least as long. There are no negative links.
Figure 1i shows the final tree for node A. The light dotted lines are links not used in any
shortest path from node A. They might be used in another tree, however. Each node in
a network can compute its own shortest path tree, given the linklist for the entire
network.
'''Create a Link State Database to quickly look up the adjacent nodes for any given
node.
'''Given a source node and a Link State Database for the network, return a table with
two values for each node - the distance on the shortest path from the source to that
node, and the name of the last node on that path before the final node. Saving the
previous node makes it easy to re-construct an entire path,
from any leaf to the root of the tree.
Given a source node and a Link State Database for the network, return a table with
three values for each node - the distance on the shortest path from the source to that
destination node, and the names of the first and last nodes on the path,
not including the endpoints. The first node is needed in a routing table. The last node is
needed to construct a tree with src at the root.
Limitations
The main limitations of simple shortest-path routing have to do with real-
world problems that occur in large networks. We can't just keep adding nodes
to a huge routing table at each and every node. As shown in Figure 2, the time
to build (or re-build) a table increases as the square of the number of nodes.
Also, as nodes are added, the number of failing links, changes in topology, and
other events that trigger re-builds throughout the network - these events will
occur more frequently.
Aside from these technical limitations, there are administrative headaches
that come with huge networks, and these often set a size limit far short of what
is technically possible. A campus-wide network might have 100 nodes with
only two connections to the outside world, and no desire to keep track of
nodes for businesses in the same city. Those businesses might be better served
by a city-wide network that includes one of the campus "border" routers. The
city-wide network might include a few hundred nodes that all have routing
table entries for each other, but only one entry for all the nodes on campus.
Similarly, the city network might look like just one node in a larger regional
network. Hierarchical routing is one way to partition a network into smaller,
more manageable pieces.
A routing algorithm is not enough to design a network. We need a complete
routing protocol to deal with real-world issues. The Routing protocol articles
will discuss how we handle issues such as:
partitioning - strictly hierarchical is not the only possibility
rapid recovery - minimize the time that routing tables are "out of sync" with
actual topology
preferential routing - voice packets must not have a noticeable delay
load balancing - don't overload the shortest path
security - keep the bad guys from diverting traffic
policy overrides - block our competitors, even if they are coming through one
of our customers
Step-01:
Each router prepares its routing table. By their local knowledge. each
router knows about-
All the routers present in the network
Distance to its neighboring routers
Step-02:
Each router exchanges its distance vector with its neighboring routers.
Each router prepares a new routing table using the distance vectors it
has obtained from its neighbors.
This step is repeated for (n-2) times if there are n routers in the
network.
After this, routing tables converge / become stable.
Consider-
There is a network consisting of 4 routers.
The weights are mentioned on the edges.
Weights could be distances or costs or delays.
Step-01:
Each router prepares its routing table using its local knowledge.
Routing table prepared by each router is shown below-
At Router A-
Destination Distance Next Hop
A 0 A
B 2 B
C ∞ –
D 1 D
At Router B-
A 2 A
B 0 B
C 3 C
D 7 D
At Router C-
A ∞ –
B 3 B
C 0 C
D 11 D
At Router D-
A 1 A
B 7 B
C 11 C
D 0 D
Step-02:
Each router exchanges its distance vector obtained in Step-01 with its
neighbors.
After exchanging the distance vectors, each router prepares a new
routing table.
At Router A-
A 0 A
B 2 B
C 5 B
D 1 D
At Router B-
A 2 A
B 0 B
C 3 C
D 3 A
At Router C-
A 5 B
B 3 B
C 0 C
D 10 B
At Router D-
A 1 A
B 3 A
C 10 B
D 0 D
Step-03:
Each router exchanges its distance vector obtained in Step-02 with its
neighboring routers.
After exchanging the distance vectors, each router prepares a new
routing table.
At Router A-
A 0 A
B 2 B
C 5 B
D 1 D
At Router B-
A 2 A
B 0 B
C 3 C
D 3 A
At Router C-
B 3 B
C 0 C
D 6 B
At Router D-
A 1 A
B 3 A
C 6 A
D 0 D
We have-
The value of next hop in the final routing table of router A suggests
that only edges AB and AD are used.
The value of next hop in the final routing table of router B suggests
that only edges BA and BC are used.
The value of next hop in the final routing table of router C suggests
that only edge CB is used.
The value of next hop in the final routing table of router D suggests
that only edge DA is used.
Important Notes-
Note-01:
Note-02:
Note-03:
The algorithm is called so because-
It involves exchanging of distance vectors between the routers.
Distance vector is nothing but an array of distances.
Note-04:
Note-05:
Routing tables are prepared total (n-1) times if there are n routers in
the given network.
This is because shortest path between any 2 nodes contains at most n-1
edges if there are n nodes in the graph.
Note-06:
Using all the details from its link state table, a router is able to
compute, using the Dijkstra algorithm, the shortest path to any
given destination.
For example, the best path for Router A to reach Router D would be
the following:
Routing in a Mobile Network
Routing in a mobile ad-hoc network depends on many factors such as:
In a MANET, each node or device is expected to serve as a router, and each router is
indistinguishable from another in the sense that all routers execute the same routing
algorithm to compute paths through the entire network.
Routing Classification
Routing protocol can be classified as:
1. Proactive Protocol
2. Reactive Protocol
3. Hybrid Protocol
Proactive Protocol
Proactive protocols attempt to evaluate continuously the routes within the network.
It means proactive protocol continuously maintain the routing information, so that
when a packet needs to be forwarded, the path is known already and can be
immediately used. The family of distance vector protocols is an example of proactive
scheme.
Reactive Protocols
Reactive protocols do not maintain routes but invoke a route determination
procedure only on demand or we can say reactive protocols build the routes only on
demand. Thus, when a route is required, some sort of global search procedure is
initiated. The family of classical flooding algorithms belongs to the reactive protocol
group. Examples of reactive ad-hoc network routing protocols include ad hoc on
demand distance vector (AODV) and temporally ordered routing algorithm (TORA).
Hybrid Protocols
Hybrid protocols attempt to take advantage of best of reactive and proactive
schemes. The basic idea behind such protocols is to initiate route discovery on
demand but at a limited search cost. One of the popular hybrid protocols is zone
routing protocol (ZRP).
o AODV is a routing protocol for MANETs (mobile ad hoc networks) and other
wireless ad hoc networks.
o It is a reactive routing protocol; it means it establishes a route to a destination
only on demand.
o AODV routing is built over the DSDV (Destination sequenced distance vector
routing ) algorithm. It is a significant improvement over DSDV.
o The devices that are not on a particular path do not maintain routing
information, nor do they participate in the routing table exchanges.
o When a source requires sending a message to a destination and does not have
a valid route to it, the source initiates a route discovery process.
o Source sends a route request (RREQ) packet to all its neighbors, the latter
forward the request to all their neighbors, and so on, until either the
destination or an intermediate mobile (node) with a "fresh enough" route to
the destination is reached.
The above figure illustrates the propagation of the broadcast request (RREQs) across
the network. Since in DSDV, destination sequence numbers are used to ensure that
all routes are loop free and contain the most recent route information. Each node
has a unique sequence number and a broadcast ID, which is incremented each time
the node, initiates RREQ.
The broadcast ID, together with the IP address of node, uniquely identifies every
RREQ.
Intermediate mobile reply only if they have a route to the destination with a
sequence number greater than or at least equal to that contained in the RREQ. To
optimize the route performance, intermediate nodes record the address.
From the above figure, since RREP (route reply packet) travels back on the reverse
path, the nodes on this path set up their forward route entries to point to the node
from which RREP had just been received. These forward route records indicate the
active forward route. The RREP continues traveling back along the reverse path till it
reaches the initiator of the route discovery. Thus, AODV can support only the use of
symmetric links.