Loops in layers 2 and 3
Layer 2 loops
A layer 2 loop also known as a switching loop, or a bridging loop, is one where there is more than one layer 2 path between two endpoints. A layer 2 loop will take place when:
- there are multiple connections between two network switches on the same VLAN
- two ports on the same switch on the same VLAN are directly connected
- three or more switches are connected in a physical loop using ports on the same VLAN
Unlike Layer 3 loops, which employ a time to live (TTL) function, switching loop packets will circulate the network until they are dropped, e.g. due to resource exhaustion.
Layer 2 loops are dealt with using features such as STP, EtherChannel, or the creation of VLANs within the topology
Layer 3 loops
A layer 3 loop also known as a routing loop takes place when routing is configured in such a way to send an IP packet continuously around the same path. This differs from a switching loop in that the loop is created due to routing decisions. This means that a looped IP packet will be routed from one interface to another (or from one VLAN to another) resulting in a continuously looped packet.
This is primarily due to misconfiguration or a routing algorithm error. Unlike Layer 2 loops, IP packets have a TTL value that is decremented every hop, and when it reaches zero, it is dropped. Layer 3 loops are mitigated against using TTL as well as using correct routing configurations.
Links to this page:
- BGP - Loop Prevention
- BGP - redistributing iBGP routes into an IGP
- EIGRP - Hop Count
- EIGRP - Router ID and loop prevention
- EIGRP - internal vs external routes
- HSRP - Deployment in Distribution Layer
- IGRP
- IP SLA - Route Flapping Problem
- MAC address flapping
- Network Design - Spine and leaf architecture
- Networks - Overlay Transport Virtualization (OTV)
- OSPF - control plane vs data plane loops
- OSPF loop prevention
- Prefix Lists
- RIP - poison reverse
- Routing - Using the Null0 interface to prevent routing loops
- Routing - route tagging
- STP - BPDU Filter Use Cases
- STP - Cost of last link added by receiving switch
- STP - Dispute
- STP - Learning State
- STP - Per VLAN Spanning Tree plus (PVST+)
- STP - RSTP Proposal Timer Operation
- STP - Shortest Path Bridging (SPB)
- STP - UDLD and Fiber Links
- STP - UplinkFast
- STP - bridge priority
- STP - determining the blocked port using port ID
- STP Topology Change Timer
- STP determining blocked port using cost
- Security - broadcast-multicast storm
- Split-horizon