cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
18781
Views
20
Helpful
9
Replies

How OSPF avoids Loop??

Sanjib Pradhan
Level 1
Level 1

Dear Friend,

Please find the below Loop avoidance mechanism.

Loop avoidance mechanism on EIGRP:

Secondary Ad< Primary FD

Loop avoidance mechanism on BGP:

EBGP:

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

IBGP:

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

Question:

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

Regards,

Sanjib

9 Replies 9

Richard Burts
Hall of Fame
Hall of Fame

Sanjib

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.

HTH

Rick

HTH

Rick

cowseatsoil
Level 1
Level 1

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:

http://www.cisco.com/en/US/tech/tk365/technologies_white_paper09186a0080094e9e.shtml#t5

Cheers,

Liam

daniel.dib
Level 7
Level 7

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:

http://blog.ine.com/wp-content/uploads/2011/01/Loop-Prevention-in-OSPF.pdf

Daniel Dib
CCIE #37149

Please rate helpful posts.

Daniel Dib
CCIE #37149
CCDE #20160011

Please rate helpful posts.

@daniel.dib 

 

Does ABR always have full adjacency in area 0? I am not sure I understand this.

I do not understand your question. Full adjacency is based on relationships within a particular network segment/subnet. Every OSPF device on a particular network segment/subnet has full adjacency with DR and with BDR and DR or BDR has full adjacency with all OSPF devices on that network segment/subnet. Area 0 is likely to have several network segments/subnets. Full adjacency is meaningful for the local subnet, but not for other subnets within area 0.

The ABR receives LSAs describing the subnets within area 0 and runs the Dijkstra algorithm to produce a loop free path to destinations within area 0. Whether adjacency is full or not is not part of that calculation.

If this does not resolve your question then please clarify what it is that you are asking.

HTH

Rick

I am not sure what does this mean:

ABR will accept and use summary LSA over non area 0 if if it does not have full adjacency in area 0. ?

Paul George
Level 1
Level 1
OSPF uses the SPF algorithm , since inter-area OSPF is distance vector, it is vulnerable to routing loops. It avoids loops by manipulating a loop-free topology, in which traffic from one area can only reach another area through area 0.

Hello,

 

As I skimmed I didn't see anyone else mention it specifically, but among the many good suggestions OSPF also avoids loops by its Router ID (RID). If it sees its own RID sending a LSA/LSU then it will discard it similar to BGP same AS. (there are special cases where this is not true but for the most part is).

 

Hope that helps

 

-David

Joseph W. Doherty
Hall of Fame
Hall of Fame

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

In details, eh?

If you want great authoritative details, you might start by examining the corresponding RFCs.

RIP: https://datatracker.ietf.org/doc/html/rfc1058

OSPFv2: https://datatracker.ietf.org/doc/html/rfc2328

Wiki articles are also often worth reviewing too.

RIP: https://en.wikipedia.org/wiki/Routing_Information_Protocol

OSPF: https://en.wikipedia.org/wiki/Open_Shortest_Path_First

Wiki also has articles that further describe the core algorithms used by IGPs like RIP and OSPF.

RIP: https://en.wikipedia.org/wiki/Bellman%E2%80%93Ford_algorithm

OSPF: https://en.wikipedia.org/wiki/Dijkstra%27s_algorithm

Much more can be found, on the Internet, following references possibly provided by the above or by using a search engine, against terminology found in the above.

 

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Review Cisco Networking products for a $25 gift card