Cisco Support Community
Community Member

How OSPF avoids Loop??

Dear Friend,

Please find the below Loop avoidance mechanism.

Loop avoidance mechanism on EIGRP:

Secondary Ad< Primary FD

Loop avoidance mechanism on BGP:


Verify the AS number, If the AS no. is the part of it's own As no. then It will reject the packet.


Verify the router-Id. If the Router-Id is the part of it's own router-id then it will reject the packet.


How OSPF and RIP avoid Loop??? Please Explain in details.



Hall of Fame Super Gold

How OSPF avoids Loop??


OSPF uses the information advertised in LSAs and the Dijkstra algorithm to calculate the topology of the network and then uses that topology information to prevent loops.



Community Member

How OSPF avoids Loop??

Hi Sanjib,

There is no form of 'loop avoidance' with OSPF like the distance/patch vector protocols (EIGRP/BGP).

OSPF's algorithm (and all link state routing protocols) calculates all the links of all the routers in the 'Area' similar to a 'tree' fashion with each router being the 'root' of it's calculated tree.

Doing this means that all routers in the same 'Area' have a complete topology of that 'Area' and then use this information when routing traffic, traffic will then traverse the 'Area'/network without creating loops and will garentee the best (loop-free) route.

Take a look at the following link for more detail how the SPF algorithm works and how it populates the routing table with the best 'loop-free' routes:



How OSPF avoids Loop??

Like Richard and Liam said OSPF is a link state protocol and exchanges LSAs within an area to build a SPF tree ensuring that there are no loops within the area.

Between areas Area Border Routers (ABRs) send summary LSAs hiding the internal topology of the area. This is actually distance vector behavior. Due to this there needs to be some loop prevention mechanism.

  • ABR must have interface in area 0 and it must not be in DOWN state. Only ABR may generate summary LSA.
  • ABRs expect summary LSAs over area 0 only. Summary LSAs may not be sent over other areas.
  • ABR will accept and use summary LSA over non area 0 if if it does not have full adjacency in area 0. Doing so is safe because it can't flood them back to area 0 to create a routing loop.

Read this excellent paper by Petr Lapukhov for the full explanation:

Daniel Dib
CCIE #37149

Please rate helpful posts.

Daniel Dib CCIE #37149 Please rate helpful posts.
CreatePlease to create content