Layer 3 equivalent to Layer two's loop prevention

danyzukodanyzuko Posts: 40Member ■■□□□□□□□□
I recently saw an interesting question but never got an answer to it. The question was:
What is the layer 3 equivalent to layer 2 loop prevention?
So here goes my brain ****:

Spanning tree involves mac address utilization to assign BPDUs which give switch ports sort of a hierarchy and based on those priorities (BPDUs)the best path is determined.

Layer 3 routing is IP based and utilizes route poisoning and split horizon. I believe there's others in protocols but not sure what they are just right now. And this is the Layer 3 method for loop prevention.

That's just me mirroring back what I've read. Can someone elaborate and is there an issue with looping in routing in the real world? Any elaboration on this is appreciated.


  • shodownshodown Posts: 2,271Member
    It depends on the protocol. Some of the protocols have way to prevent loop prevention. EIGRP for example uses feasibility conditions to ensure you don't make a loop.
    Currently Reading

    CUCM SRND 9x/10, UCCX SRND 10x, QOS SRND, SIP Trunking Guide, anything contact center related
  • theodoxatheodoxa Posts: 1,340Member
    RIP and EIGRP use Split Horizon
    RIP [and possibly EIGRP???] use Poison Reverse
    OSPF is a Link-State Protocol which inherently prevents loops
    BGP won't accept a route listing its own ASN in the AS_PATH attribute
    Various methods of route filtering can be used to prevent Loops from being caused by mutual redistribution of routes between two protocols

    The last two are CCNP level topics. The first 3 were covered in the 640-8xx CCNA.
    Security: CCNA [ ]
    Virtualization: VCA-DCV [ ]
  • TechGuru80TechGuru80 Posts: 1,539Member ■■■■■□□□□□
    Something else to mention is that if a router doesn't know where the IP address is...the packet is dropped. A switch floods it out all ports which is how broadcast storms happen.
  • danyzukodanyzuko Posts: 40Member ■■□□□□□□□□
    Wow, very good information. Thanks everyone. I actually passed my CCNA a few months ago and am about to start on CCDP-Routing. It's been a while so this was a great Re-hash of protocol loop prevention behaviors.

    So to sum up:
    Split Horizon: Never advertise a route out of the interface through which you learned it
    Poison Reverse: Once you learn of a route through an interface, advertise it as unreachable back through that same interface.
    So Poison reverse would come in handy if you had a fork in the path from Router A to Router D as they are load balanced through Router B and C. And say the link between B and D goes down. Router B sends a poison route back to Router A and I guess C also so as to say don't go thru here to reach this network.

    Hold Down Timer: Router B learns of a failed route from router A. So Router places a hold down of 180 seconds to prevent learning new information about the failed route, Unless the original router with failed route updates Router B concerning failed route.

    Then of course EIGRP has a 'is your metric lower than mine to given network' mentality. This combined with it's feasible successors it keeps in its topology table makes EIGRP more robust. Is there a shorter hold down time on EIGRP than RIP?

    I don't know about BGP yet but I guess OSPF thanks to LSA's keeps great track of changes to the network. And after researching, i saw that there's a sequence number much like this 0x80000001, and if the advert is a number smaller than the previous accepted update, it gets ignored. So only new changes are sent to LSDB which is on the ABR right? This is just a rough explanation
  • EdTheLadEdTheLad Posts: 2,112Member ■■■■□□□□□□
    OSPF uses the backbone area to stop loops, every area must be connected to the backbone.The ospf cloud works as a sort of hub and spoke with the backbone area being the hub and other areas being spokes.Within area's it uses the sequence numbers.
    BGP uses the the AS_PATH to stop inter AS loops and within the AS, iBGP learned routes are not propagated.If using route reflectors the designator_id and cluster_id are used to prevent loops.
    Networking, sometimes i love it, mostly i hate it.Its all about the $$$$
  • danyzukodanyzuko Posts: 40Member ■■□□□□□□□□
    Okay, here's the thing. A friend of mine applied at a cloud company called Rackspace and told me that when he was asked for the layer 3's equivalent to layer 2 loop prevention is, he told them TTL (time to live) and feels strongly that this was the answer they were looking for. Can someone tell me if that bears merit or if that is off track?
    I know a TTL field is set by the sender of the datagram, and reduced by every router on the route to its destination. If the TTL field reaches zero before the datagram arrives at its destination. Seems obvious but just trying to go over in the mechanics of a scenario, how that would stop a loop.

    Is TTL not a consideration, knowing that when a router doesn't know where the IP address is...the packet is dropped? (as TechGuru said above)? Or does TTL have a significant role in some way?
  • EdTheLadEdTheLad Posts: 2,112Member ■■■■□□□□□□
    TTL is used for ip loop prevention, which is part of the packet header.Now if you look at layer 2, there is no loop prevention in the ethernet header. Layer two uses a protocol i.e. STP, so if they want an equivalent to layer 2 that would mean a layer 3 protocol for loop prevention.
    They should have asked what mechanism does IP use to prevent loops to infinity. If your friend started to talk about l3 routing loops etc they could have pointed him in the right direction if they wanted to access is knowledge.
    Networking, sometimes i love it, mostly i hate it.Its all about the $$$$
  • danyzukodanyzuko Posts: 40Member ■■□□□□□□□□
    Yes thank you, but let's say R1 has an IP addressed packet that starts with a given TTL value of 7 and the general destination network is 8 hops away. Would it be the TTL mechanism that kills the packet? I can see that it is possible that R1 would send the packet if it had an entry in its routing table that broadly includes the packets destination IP.

    So could it be that TTL is what would kill the packet in the instance that the aggr router doesn't have an entirely accurate route for dest?

    And as a side question, is TTL most often what stops the loops or are they stopped more often when said router doesn't know where dest ip address is?

    I know I'm spitting hairs but I just want to get this settled. I know Routers are smart and weed out destinations but is it possible for a router to get bad information and send the packet out? and is that where TTL steps in?
  • EdTheLadEdTheLad Posts: 2,112Member ■■■■□□□□□□
    If R1 has a packet with TTL =7 , it will subtract 1 from the TTL and the outgoing packet will have a TTL=6, this will happen at every layer 3 hop along the way.When the packet arrives with TTL=1, if the packet is not destined for the local router it arrived on it is discarded. A router will not send out a packet with TTL=0. So in your case the router will be send until the second last hop and discarded.
    Normally if the routing protocols are screwing up and there is a loop, the packets TTL will decrement until 1 and finally the packet is dumped, so TTL is the final fail safe. If a router doesn't have a route for a packet is gets dropped, if R1 has a route to R2 and R2 has a route to R1, this is a loop and the packet bounces between the routers until TTL=1, then it gets dropped.
    Networking, sometimes i love it, mostly i hate it.Its all about the $$$$
  • danyzukodanyzuko Posts: 40Member ■■□□□□□□□□
    Great! Thanks for clearing that up.

    So in addition to TTL and aggregate routers stopping non existent routes you have also the following protocols that help with loop prevention:

    RIP's Split Horizon, Poison reverse, and Hold Down timer.
    EIGRP's 'is your metric lower than mine to given network' mentality with feasible successors, etc.
    OSPF's Link-State Protocol which inherently prevents loops using Designated Routers and backbone area.
Sign In or Register to comment.