There are different types of paradigms or algorithms used by routing protocols.
The first type is distance vector also known as routing by rumor.
Distance vector routing protocols will determine
the direction and the distance to a destination.
The direction is also known as a vector
and the distance such as hop count is determined to any destination in the network.
RIP as an example, uses hop count to determine the cost or distance of a remote network.
The advantage of distance vector routing protocols
is that they are very simple to configure.
The major disadvantage of distance vector routing protocols
is that they have limited visibility
they only know what neighbors tell them
and that’s where the concept or analogy of routing by rumor comes from.
It’s possible that routers will learn incorrect information
or make bad choices based on the information that they received from their neighbors.
Distance vector routing protocols
used the Bellman–Ford algorithm to calculate paths.
This requires that a router inform its neighbors of topology changes
periodically and in some cases when changes are detected in the network.
RIP as an example, will advertise its entire routing table every 30 seconds
and will send triggered updates when there’s a change in the topology.
Distance vector means that routers advertise routes
as a vector of the distance and direction.
Direction is represented by the next hop address and local exit interface and distance
uses a metric such as hop count in RIP to determine the cost of a route.
It’s important to understand that distance vector routing protocols
do not have knowledge of the entire path to a destination
hence once again the term routing by rumors
used because the routers are relying on the information that they've received
from other routers and they themselves cannot determine
if the information is actually valid or true.
This can introduce instability and routing loops
and thus multiple features have been introduced to try and combat loops.
As an example, mechanisms or features
used to stop routing loops include split horizon
poisoned reverse and trigger updates.
As an analogy distance vector routing protocols have information available to them
in a similar fashion to the information shown on a road sign.
If you’re on a road going to a destination
and you don’t have a map you must rely on the road signs
to tell you the direction of the destination
and the distance to get to it, in the same way in distance vector routing protocols
a router does not know the entire path to every network segment.
The router only knows the direction or vector in which to send the packet.
The distance vector routing approach
to determine the direction called a vector
and distance such as hop count to any destination network.
So to summarize, distance vector means
that a destination such as 10.1.1.0 is a distance of 5 hops away
in the direction of the next hop router router 2
that statement sums up essentially
how distance vector routing protocol operate.
The destination 10.1.1.0 is a distance of 5 hops away in the direction or router 2
this is similar to our analogy of using a road sign to get to a destination.
Links state routing protocols on the other hand
have a complete map of the area
Every router built its own internal map of the entire network topology
in its link state also called topology database
each router then runs its own shortest path first algorithm
to calculate the shortest path to all known destinations.
An example, of a links state routing protocol is OSPF
which uses cast as its routing metric which is based on bandwidth.
Link state routing protocols cannot be fooled as easily
into making bad routing decisions
because they have a full view of the network topology.
They can make better choices or more informed decisions
because they have a full view of the path
to get to a destination network.
A road sign use by distance vector routing protocols
will just say go left and the network is 5 hops away.
However, a link state routing protocol has a road map
which allows the router to see the path to the destination
and therefore the router can make a better choice
and how to get to that destination network.
The name link state means that each router
originates information about itself
it’s directly connected interfaces or links and the state of those links
in other words other links up or other links down.
This information is then passed between all routers
and each router makes its own copy of that information
but doesn't change the information
That means that all routers end up sharing
the same information within a network or area
and that’s what called a topological database.
In OSPF as an example, you could use a command such as display ospf lsdb
to see the link-state database that’s identical on all routers in the area.
So each router has identical information about the network
and each router can make independent decisions
on how to calculate its best path.
link state routing protocols use an algorithm
called SPF or Shortest Path First which was develop by EW Dijkstra
and is a very powerful algorithm use by protocols
such as OSPF and ISIS, once again links state routing protocols
have a better visibility of the network than distance vector routing protocols do.
So in summary, each router has a copy of the topological database
which is all routes in the entire network or area
and the routers use the Shortest Path algorithm or SPF algorithm
to determine the best part to every destination.
The routers have better visibility than distance vector routing protocols.
However, the disadvantage of link state routing protocols
is that they are more difficult to configure
they require a hierarchical network topology
where you would have a backbone area, area 0 and multiple other areas.
Link state routing protocols also require more memory
because they maintain multiple tables such as a neighbor table
a link state database table and routing table
the SPF or Shortest Past First algorithm can also be process intensive
and thus link state routing protocols require more powerful CPUs
and more memory in routers than distance vector routing protocols do.