So, guys, now going forward now, let us discuss that, how SPF algorithm ensures traffic flow across
the network in the loop free manner.
Right.
So the routing table that is constructed using SPF algorithm by all the L3 devices and shows loop free
traffic flow because of the following two conditions.
Every L3 device has the same view of the network topology, and every device computes the shortest path
to every other reachable device.
Right.
As long as all the devices of the network topology meets these two constraints, the routing table that
is constructed by SPF algorithm would ensure that the traffic would flow between any pair of devices
in a loop free manner.
Right.
So now let us try to understand this problem visually.
Suppose you have a L3 device D, which is one of the L3 router present in the topology.
Right?
And the logical view of the entire topology of which this router D is a part of is shown by this diagram.
Right?
So remember, this is a logical view which is nothing but a internal data structure present in the memory
of the router device.
D Right.
Now router device runs its SPF algorithm on this logical view of the topology and computes that to reach
the remote device be the next hop is a right.
So whenever the device receives a traffic which is destined for the node B, then the traffic would
be forwarded towards the node A and then eventually it reaches to B, Right?
Because this is the shortest path to reach the node B from the node D, Right.
Now consider another router of this topology, which is router A.
And let us suppose that the logical view of the router a do not match with the logical view of the topology
which is present in the memory of the router d for any x, y, z reason.
There could be multiple reasons why this could happen.
For example, for some reason Router A has not updated its link state database because for some reason
it did not receive the latest link state packets from other nodes of the topology.
Right.
So the assumption is that that for some reason the routing device A has an obsolete view of the network
topology in its internal memory.
So the distinction between these two logical topologies is that that in the view of router A, the link
which connects the nodes A and B is absent.
Right?
So now with this logical view of the topology in the memory, the router A will run SP algorithm and
as per the SP algorithm output router A will conclude that in order to reach node B, the traffic needs
to be forwarded to the next hop router D right.
So the traffic will take the following path.
So now can you see the problem here?
An infinite loop has been created.
When the router receives the traffic which is destined for the router, B it will forward the traffic
to the next hop router.
A Right, because as per the SPF algorithm, router, D knows that in order to forward the traffic which
is just trying to the router, b the next hop is a right.
Whereas as per the second topology router, A believes that in order to forward the traffic which is
just trying to the router, b it should forward the traffic to the next hop router D right.
So you can see that because router D and router A has distinct view of the network topology, it would
create an infinite loop because router D and a independently run SPF algorithm on the logical network
topology maintained in their internal data structures.
On the physical topology router D will forward the traffic to the router A and this traffic is destined
for the destination router B, whereas router A will forward the traffic to the router d router when
receives the traffic from the router, a will again forward the traffic to the router a and this continues
until the TTL value in the IP header of the packet.
Reduces to zero.
Right?
So this is how loops are formed.
Now let us see how this.
Now let us see how we can recover from this infinite loop problem.
Now, suppose that after some time router A receives the updated Neighborship database advertisement
or it receives the updated packet from other routers in the topology such that it updates its logical
view of the topology and ad this link between the Node A and B, right?
So at this point of time the logical view of the topology of the router D and the router A are exactly
clone of each other.
Right?
So now Router A will run the algorithm again by choosing itself as an SPF root of the algorithm.
And it will come to know that in order to reach the destination Node B, the shortest path is the link
connecting from A to B itself.
Right?
So when router A receives the traffic which is destined for the.
Destination Node B, the traffic will be forwarded along the link A and B, and the older path from
A to D will not be used anymore.
Right.
So it simply means that if router D has to forward the traffic which is just trying to the router b
it will forward the traffic to the next hop node A, whereas now Node A knows that in order to reach
the destination Node B, it has to forward the packet along this path, right?
So you can see that because Router A has rerun the algorithm on the latest view of the topology, the
loop is automatically resolved.
Router A will not bounce back the traffic back to the router D anymore after it has triggered SPF algorithm.
Again on the latest view of the topology in which the link A and B is also present.