NetworkLab 1ex

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 14

A routing protocol specifies how routers communicate with each other, distributing information

that enables them to select routes between any two nodes on a computer network. [1] There are
4 main categories of routing protocols:

•Distance Vector (RIP)

•Link-state (OSPF, ISIS)

•Path Vector (BGP)

•Hybrid (EIGRP)

Figure 1: Routing protocol category summary.

Distance Vector
The distance vector (DV) protocol is the oldest routing protocol in practice. With distance vector
routes are advertised based upon the following characteristics:

•Distance - How far the destination network is based upon a metric such as hop count.

•Vector - The direction (next-hop router or egress interface) required to get to the destination.

This routing information is exchanged between directly connected neighbours.[2] Therefore


when a node receives a routing update, it has no knowledge of where the neighbour learned it
from. In other words, the node has no visibility of the network past its own neighbour. This part
of distance vector is also known as "routing by rumour".

Furthermore, routing updates are sent in full (rather than delta-based updates) and at regular
intervals, resulting in extremely slow convergence times - one of the key downfalls to distance
vector protocols. In addition due to the slow convergence times and "routing by rumour",
distance vector protocols are prone to routing loops.
However, on the flipside, the resource consumption is low compared to link-state, due to not
having to hold the full state of the entire topology.

Link-state
In contrast to distance vector routing, link state routing (OSPF, ISIS) relies on each node
advertising/flooding the state (i.e. delay, bandwidth etc) of their links to every node within the
link state domain. This results in each node building a complete map of the network (shortest
path tree), with itself as the root using the shortest path first algorithm, also known as the
Dijkstra algorithm.

Unlike distance vector link-state neighbours only sends incremental routing updates (LSAs)
rather than a full routing update. Also, these updates are only sent at the point a change in
the network topology occurs, rather than at regular intervals.

Link-state protocols provide extremely low convergence times and, due to each router having a
complete view of the network, aren't prone to the same routing loops seen with DV-based
protocols.

However, due to the computation required for the algorithms to run across the shortest path
trees upon each node, greater resources are consumed compared to that of distance vector,
however, this really isn't a concern with the systems of today.

Path Vector
Path vector (PV) protocols, such as BGP, are used across domains aka autonomous systems. In
a path vector protocol, a router does not just receive the distance vector for a particular
destination from its neighbor; instead, a node receives the distance as well as path
information (aka BGP path attributes), that the node can use to calculate (via the BGP path
selection process) how traffic is routed to the destination AS.

Hybrid
A hybrid routing protocol consists of characteristics from both, link state and distance
vector routing protocols.

For example, EIGRP can be considered a hybrid routing protocol, as it displays characters of
both. As shown below:

Distance Vector Link-state


EIGRP routers only advertise the best route , not every route An EIGRP router forms neighbour
that is aware of. relationships.
EIGRP routers do not have a complete network map of the
Triggered updates are sent only
topology, but only what it has been told by its neighbour aka
when a topology change occurs.
"routing by rumour".

What is the Link State Routing Algorithm?


Link State Routing (LSR) is a routing algorithm used in computer networks to
determine the best path for data to travel from one node to another. LSR is
considered to be a more advanced and efficient method of routing compared to
Distance Vector Routing (DVR) algorithm.
In LSR, each node in the network maintains a map or database, called a link state
database (LSDB), that contains information about the state of all the links in the
network. This information includes the cost of each link, the status of each link (up
or down), and the neighboring nodes that are connected to each link.
When a node in the network wants to send data to another node, it consults its
LSDB to determine the best path to take. The node selects the path with the lowest
cost, also known as the shortest path, to reach the destination node. To determine
the shortest path, LSR uses Dijkstra’s shortest path algorithm.

Some Phases of Link State Routing:

Link state routing (LSR) is a routing protocol used in packet-switched networks that
uses a link state database to store information about the network topology. It is
one of the two main types of routing protocols, the other being distance-vector
routing.
The LSR process can be divided into several phases:
1.initialization phase: The first phase is the initialization phase, where each router
in the network learns about its own directly connected links. This information is
then stored in the router’s link state database.

2.flooding phase: The second phase is the flooding phase, where each router floods
its link state information to all other routers in the network. This allows each router
to learn about the entire network topology.

3.path calculation phase: The third phase is the shortest path calculation phase,
where each router uses the link state information to calculate the shortest path to
every other router in the network. This is typically done using Dijkstra’s algorithm.

4.route installation phase: The fourth and final phase is the route installation
phase, where each router installs the calculated shortest paths in its routing table.
This allows the router to forward packets along the optimal path to their
destination.

One of the main benefits of LSR is that it only requires routers to have knowledge
of their directly connected links, as opposed to the entire network topology. This
makes it well-suited for large and complex networks. Additionally, LSR is less prone
to routing loops and can quickly adapt to changes in the network topology.

Features of Link State Routing Algorithm:

Link state routing (LSR) is a routing protocol that uses a link state database to
store information about the network topology.
The main features of LSR include:
1.Each router in the network only needs to know about its directly connected links.
This allows for a more scalable solution, as routers do not need to maintain a full
view of the entire network topology.

2.LSR uses a link state database to store information about the network topology.
This database is updated by flooding link state information between routers.

3.LSR uses the shortest path algorithm, such as Dijkstra’s algorithm, to calculate
the shortest path to every other router in the network. This ensures that packets
are always forwarded along the most efficient path.

4.LSR can quickly adapt to changes in the network topology. When a link goes
down or a new link is added, the link state information is updated and the shortest
path is recalculated.

5.LSR is less prone to routing loops, as each router only installs the shortest path
in its routing table.

6.LSR supports multiple equal-cost paths, which allows for load balancing and
redundancy.

However, LSR has a higher overhead compared to distance-vector routing


protocols, as each router must maintain a link state database and constantly
exchange link state information with other routers. Additionally, LSR can consume
a large amount of memory and processing power, making it less suitable for
resource-constrained devices.
Overall, Link State Routing is an efficient and robust routing protocol that is well-
suited for large and complex networks. While it does have some drawbacks, its
ability to quickly adapt to changes in the network topology and avoid routing loops
makes it a valuable tool for network administrators.

Advantages of Link State Routing Algorithm:

Some advantages of the link state routing algorithm are given below-
One of the main advantages of LSR is that it only needs to know the state of the
links it is directly connected to, as opposed to DVR which needs to know the entire
state of the network. This allows LSR to converge quickly, and to adapt to changes
in the network more quickly. This is particularly useful in large networks where the
topology changes frequently.

Another advantage of LSR is that it does not suffer from the count-to-infinity
problem which is prevalent in DVR. In DVR, if two nodes have incorrect information
about the distance to a destination, they will continue to update each other
indefinitely, leading to a stalemate. However, with LSR, nodes only exchange
information about their directly connected links, so there is no possibility of the
count-to-infinity problem.

Disadvantages of Link State Routing Algorithm:

However, LSR also has some drawbacks. Let’s discuss some of the disadvantages
below-
One of the main disadvantages is that it requires more memory and processing
power than DVR. The LSDB of each node must be updated constantly to reflect
changes in the network, and this can consume a lot of resources.

Additionally, LSR is not as scalable as DVR. It can be difficult to implement in very


large networks with thousands of nodes.

Conclusion:
In conclusion, Link State Routing (LSR) is a powerful and efficient routing algorithm
used in computer networks. It uses a link state database (LSDB) to store
information about the state of all the links in the network and uses Dijkstra’s
shortest path algorithm to determine the best path for data to travel. LSR is
particularly useful in large networks where the topology changes frequently and it
does not suffer from the count-to-infinity problem. However, it requires more
memory and processing power than DVR and is not as scalable for very large
networks.

What is a Distance Vector Routing Algorithm?


Distance vector routing algorithm is a type of routing algorithm that is used to
determine the best path for data packets to travel through a network. This
algorithm is also known as Bellman-Ford Algorithm, named after its creators
Richard Bellman and Lester Ford Jr.
The distance vector routing algorithm works by each router in a network
maintaining a table of the distances to all other routers in the network. This table
is called the distance vector. The distance vector contains the distance to all the
other routers in the network as well as the next hop router that the data packet
should be sent to in order to reach its destination.
The distance vector routing algorithm uses the Bellman-Ford equation to calculate
the distance vector table. The Bellman-Ford equation takes into account the cost of
the link between the current router and its neighbors, as well as the distance
vector of the neighboring routers. The algorithm then selects the shortest path to
the destination router based on the information in the distance vector table.
One of the main advantages of the distance vector routing algorithm is its
simplicity. It is easy to implement and understand, making it a popular choice for
small networks. However, it is not as efficient as other routing algorithms such as
Link State Routing Algorithm, and it is more prone to routing loops.
A routing loop is when a packet is sent in a loop between routers because the
router’s distance vector table is not updated correctly. To prevent this from
happening, the Distance Vector Routing Algorithm uses a technique called split
horizon.
Split horizon is a technique that prevents a router from sending its distance vector
information back to the router from which it received it. This prevents a loop from
forming and ensures that the distance vector table is updated correctly.
In conclusion, the distance vector routing algorithm is a widely used routing
algorithm that is simple to implement and understand. It works by each router
maintaining a table of the distances to all other routers in the network and using
the Bellman-Ford equation to calculate the shortest path to the destination router.
However, it is not as efficient as other routing algorithms and is more prone to
routing loops. Thus it is used in small networks and not in large networks.

Features of Distance Vector Routing Protocol

The Distance vector routing protocol includes the following features:


1.It is distributed in nature, meaning that each node takes information from one or
more of its directly connected neighbors, does the calculation, and then distributes
the result to its neighbors.

2.It is an iterative process in which information is exchanged between neighbors


until no more information is available.

3.It is asynchronous because it does not require all of its nodes to work in unison.

4.It is mostly utilized in RIP and ARPANET.

5.Each router keeps a distance table called Vector.

6.Data sharing is only available between adjacent nodes.

7.The routers communicate the entire autonomous framework’s knowledge (or


concept).

How Distance Vector Routing Protocol Works

The Distance Vector Routing protocol follows these basic steps:


1.Initialization: Each router in the network is configured with its own distance
vector table, which lists the distance (in terms of hop count or other metrics) to
every other network in the inter-network.

2.Sending distance vectors: Each router sends its distance vector table to its
immediate neighbors.

3.Updating distance vectors: Upon receiving a distance vector from a neighbor, a


router updates its own table by comparing the distance to a network via its
neighbor with the distance currently listed in its own table. If the new distance is
shorter, the router updates its table with the new information.

4.Calculating best path: Using the information in its distance vector table, each
router calculates the best path to each network and updates its routing table
accordingly.

5.Periodic updates: The sending and updating distance vectors are repeated
periodically, typically every 30 seconds. This allows the network to adapt to
changes in topology quickly.

6.Convergence: The process of sending and updating distance vectors continues


until all routers in the network have the most up-to-date information and have
converged on the best path to each network.

Example of Distance Vector Routing

In the network shown below, there are three routers, A, C, and D, with the
following weights − AC =8, CD =4, and DA =3.

Step 1 − Each router in this DVR(Distance Vector Routing) network shares its
routing table with every neighbor. For example, A will share its routing table with
neighbors C and D, and neighbors C and D will share their routing table with A.
Step 2 − If the path via a neighbor is less expensive, the router adjusts its local
table to send packets to the neighbor. In this table, the router updates the lower
cost for A and C by updating the new weight from 8 to 7 in router A and from 8 to 7
in router C.
Step 3 − The final revised routing table with the reduced cost distance vector
routing protocol for all routers A, C, and D is shown below-
Advantages of Distance Vector Routing Algorithm

The distance vector routing algorithm, also known as the Shortest path routing
algorithm in computer networks, has several advantages:
Simplicity: The distance vector routing algorithm is relatively simple to
implement and understand, making it easy to use in small networks or in places
where resources are limited.

Low overhead: The distance vector routing algorithm requires minimal overhead,
as routers only exchange information with their immediate neighbors. This makes
it efficient in terms of bandwidth and processing power.

Flexibility: The distance vector routing algorithm is flexible and can be used with
different metrics, such as hop count or delay, to determine the best
path.Scalability: The Distance Vector Routing algorithm can be easily scaled to
accommodate a growing network, as new routers can simply be added to the
network and the distance vectors updated accordingly.

Stability: Distance vector routing protocols are less likely to be affected by


routing loops, which can be caused by changes in network topology and that can
cause network instability.

Compatibility: Distance vector routing protocols such as RIP and IGRP are widely
supported by router vendors and are compatible with a variety of network devices,
making them an attractive option for many organizations.

Limitations of Distance Vector Routing Algorithm

The distance vector routing algorithm, also known as the Shortest path routing
algorithm in computer networks, has several disadvantages:
Slow convergence: Distance vector routing protocols have slow convergence
time, meaning that it takes a long time for the network to adjust to changes in
topology. This can cause temporary black holes or routing loops.

Count-to-infinity problem: Distance vector routing protocols are prone to the


count-to-infinity problem, where the distance between two routers can increase
indefinitely if there is a broken link. This can make the network unreliable.

Limited scalability: Distance vector routing protocols are unsuitable for large
networks because they rely on every router knowing the entire routing table,
which can lead to a high overhead.

Limited accuracy: Distance vector routing protocols use only one metric, such as
hop count, to determine the best path, which can lead to suboptimal routes.
Limited security: Distance vector routing protocols do not have built-in security
features, which can make them vulnerable to attacks.

Limited feasibility in large networks: Distance vector routing protocols are not
suitable for large networks as they rely on periodic updates from all routers, which
can cause a high overhead and will not scale well.

Due to these limitations, the distance vector routing algorithm is primarily used in
small networks or places, where resources are limited and more advanced routing
protocols such as OSPF and EIGRP, are not feasible.
Summary
Distance vector routing is a sort of dynamic protocol.

The distance vector routing algorithm is also known as the Bellman-Ford


algorithm or the shortest path routing algorithm in computer networks.

The router distributes information to nearby nodes with a direct link.

The router is used to determine the best path from source to destination.

Each router in the network exchanges a topology change with an adjacent router
on a regular basis.

FAQs

Here are some frequently asked questions on the distance vector algorithm.
Q1: What is the difference between the distance vector algorithm and the link-
state algorithm?
Answer: The distance vector algorithm is a decentralized algorithm that exchanges
information about the distance between network nodes, while link-state algorithm
is a centralized algorithm that exchanges information about the entire network
topology.
Q2: What is a routing loop?
Answer: Routing loop is a problem that occurs in distance vector routing algorithm
when a node receives updates from multiple paths that have the same cost, and
as a result, the node sends data in a loop, continuously forwarding it between the
same nodes.
Q3: What is the counting-to-infinity problem?
Answer: Counting-to-infinity problem is a problem that occurs in the distance
vector routing algorithm when a node receives updates about a path that has
failed, and continues to use the same path in its routing table, causing the
distance to increase infinitely.
Q4: What is the Bellman-Ford algorithm?
Answer: Bellman-Ford algorithm is a distance vector routing algorithm that uses a
dynamic programming approach to determine the shortest path to all other nodes
in the network.
Q5: How do you prevent routing loops in the distance vector routing algorithm?
Answer: Routing loops can be prevented in distance vector routing algorithm by
using techniques such as the split horizon, poison reverse, and hold-down timers.
Q6: How do you prevent a counting-to-infinity problem in a distance vector routing
algorithm?
Answer: Counting-to-infinity problem can be prevented in the distance vector
algorithm by using techniques such as route poisoning and triggered updates.
Q7: What is the difference between the distance vector algorithm and the path-
vector algorithm?
Answer: The distance vector algorithm calculates the shortest path based on the
cost metric, while the path-vector algorithm calculates the shortest path based on
the path vector, which is a sequence of AS numbers.
----------------------------------------------------------------------------------------------------------------------
The fundamental difference between distance vector and link state routing protocols is in the
nature of the routing information routers send to each other.

In distance vector protocols, each router sends its neighbors a list of all known networks along
with its own distance to each one of these networks. Because in software engineering, a list (or
better said, an array) is also called a vector, the list of networks and distances is sometimes
called the vector of networks and distances, hence the name distance vector routing protocol.

In link state routing protocols, each router describes itself and its interfaces to its directly
connected objects; these objects can be either neighboring adjacent routers, or they can be
directly attached networks. This information is passed unchanged from one router to another,
so that in the end, every router knows about every other router, its interfaces and what exactly
they connect to. In essence, in link state routing protocols, each router knows the entire
network topology down to every single router and every single interconnection, also called the
state of a link, hence the name link state routing protocol.

So these protocol types differ in what they know about the network and what information they
use to compute the routing table. Distance vector routing protocols do not advertise the entire
network topology, and with a distance vector routing protocol, none of the routers in the
network knows how the network looks like in its entirety. A router running a distace vector
routing protocol only knows its directly connected neighbors, and it knows about the lists of
networks these neighbors have advertised, but it does not really know where those networks
really are.

Link state routing protocols allow a router to have a complete map of the network, and use
specific algorithms to find shortest paths to every object in the network, including destination
IP networks.
The fact that we have both distance vector and link state routing protocols is due to historical
reasons: Originally, distance vector protocols were much easier to design and implement in
software, and so they were very popular. However, without some clever ideas which haven't
been invented until early 90's, they had some drawbacks, especially in terms of how fast they
reacted to a change in the network and how they avoided creating a routing loop. In the
meantime, another approach to routing protocol design, the link state approach, was
developed. Link state protocols are much more complex and require more processing power
and memory, but as the resources in routers improved over time, link state routing protocols
slowly took over.

Nowadays, we have extremely fine routing protocol implementations from both worlds - EIGRP
is a state-of-the-art distance vector routing protocol, while in link state world, we have OSPF
and IS-IS.

-----------------------------------------------------------------------------------------------------------------------

You might also like