cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1582
Views
6
Helpful
14
Replies

Network Loop

IrfanKhan4904
Level 1
Level 1

How can loops be prevented in a network? What command can be issued to the core switch and all network switches to eliminate the loop and optimize network performance?

2 Accepted Solutions

Accepted Solutions

Hello! 

As MHM already mentioned best is to have STP configured correctly. 

Other ways would also include storm control enabled on ports, which will cause the port to go down in case of a loop. 

BR

****Kindly rate all useful posts*****

View solution in original post

You can not config portfast in links connected two SW 

Portfast +bpduguard use only in port connect to host

MHM

View solution in original post

14 Replies 14

L2 Loop is prevent by enable STP in SW 
and config PortFast+ BPDUguard in port connect to host.
for L3 Loop is auto prevent with the TTL, if there are L3 Loop the TTL will decrease until  it be Zero and then the packet will drop.
MHM

Hello! 

As MHM already mentioned best is to have STP configured correctly. 

Other ways would also include storm control enabled on ports, which will cause the port to go down in case of a loop. 

BR

****Kindly rate all useful posts*****

M02@rt37
VIP
VIP

Hello @IrfanKhan4904 

To prevent loops in a network, STP is commonly used. STP is designed to detect and eliminate loops by blocking redundant paths in the network.

The choice of STP "variant" depends on the specific requirements of your network in terms of convergence time, complexity, compatibility, and the presence of multiple VLANs. RSTP is often a good choice for modern networks due to its faster convergence time, while MSTP provides additional flexibility in VLAN management.

Also using storm control is a proactive measure to maintain network stability and prevent disruptions caused by excessive traffic. You have to adjust the threshold values based on the characteristics of your network and the traffic patterns it experiences.

 

Best regards
.ı|ı.ı|ı. If This Helps, Please Rate .ı|ı.ı|ı.

Leo Laohoo
Hall of Fame
Hall of Fame

Enable BPDU Guard and, most importantly, disable auto-recovery.

Core Switch Config

interface GigabitEthernet1/0/1

switchport mode trunk
load-interval 30
spanning-tree portfast
!
interface GigabitEthernet1/0/2

switchport mode trunk
load-interval 30
spanning-tree portfast
!
interface GigabitEthernet1/0/3

switchport mode trunk
load-interval 30
spanning-tree portfast
!
interface GigabitEthernet1/0/4

switchport mode trunk
load-interval 30
spanning-tree portfast
!
interface GigabitEthernet1/0/5

switchport mode trunk
load-interval 30
spanning-tree portfast

interface Vlan20

ip address 172.16.0.3 255.255.0.0
ip helper-address 10.0.0.110
!
interface Vlan30
description ****SVI FOR FYP 30 VLAN****

ip helper-address 10.0.0.110

hi Here is the Wire shark file. Could you please determine if there is a network loop by examining the file?

Switch Connected with Core switch configuration
interface GigabitEthernet0/4
description ****Electrical LAB Access Point
switchport trunk encapsulation dot1q
switchport mode trunk
load-interval 30
spanning-tree portfast
!
interface GigabitEthernet0/5
switchport trunk encapsulation dot1q
switchport mode trunk
load-interval 30
spanning-tree portfast
!
interface GigabitEthernet0/6
switchport trunk encapsulation dot1q
switchport mode trunk
load-interval 30
spanning-tree portfast
!
interface GigabitEthernet0/7
switchport trunk encapsulation dot1q
switchport mode trunk
load-interval 30
spanning-tree portfast

i am seeing on Core switch
Why designated root is following switch (10.0.0.55)

 

STP Instance Information

Root bridge

Yes

Bridge address (MAC)

bc:b2:fe:81:23:80 (10.0.0.3)

Protocol specification

unknown

Priority

4106

Time since topology change

 

Topology changes

0

Designated root (MAC)

00:00:00:00:00:00 (10.0.0.55)

Hello

First of all ,make sure you do not disable STP for any vlans (much more common than you think)

Trunks
Manually prune unwarranted vlans (pvst+/rstp ONLY)
Use a native vlan (other than vlan 1)
UDLD (aggressive)
Loopguard
Disable DTP (creation of dynamic tunnels)


Edge ports, (each interface)
Bpduguard as stated by @Leo Laohoo  disable error recovery for BPDUgaurd, in fact I would go even further and not enable it for any feature
Portfast - 
Disable DTP - (creation of dynamic tunnels)
Portsecurity -  (max mac limit/aging/shutdown), 
Storm control   - as stated by M02@rt37 ) you need to apply this over some time to obtain a good baseline for the network before applying more aggressive values

Unused ports
disable them
assign to an un used vlan

example:

spanning-tree mode rapid-pvst
spanning-tree loopguard default
udld aggressive

interface xxx
description Trunk port
switchport trunk native vlan x (not vlan 1)
switchport trunk allowed vlan x,x,x
switchport mode trunk
switchport nonegotiate
spanning-tree link-type point-to-point


interface xxx
description Edge port
switchport mode access
switchport access vlan x
spanning-tree portfast
spanning-tree bpduguard enable
spanning-tree guard loop
udld port aggressive
switchport nonegotiate
switchport port-security
switchport port-security maximum x
switchport port-security aging time x
switchport port-security aging type inactivity x
storm-control broadcast level xx
storm-control multicast level xx

Please rate and mark as an accepted solution if you have found any of the information provided useful.
This then could assist others on these forums to find a valuable answer and broadens the community’s global network.

Kind Regards
Paul

Core Switch Config

interface GigabitEthernet1/0/1

switchport mode trunk
load-interval 30
spanning-tree portfast
!
interface GigabitEthernet1/0/2

switchport mode trunk
load-interval 30
spanning-tree portfast
!
interface GigabitEthernet1/0/3

switchport mode trunk
load-interval 30
spanning-tree portfast
!
interface GigabitEthernet1/0/4

switchport mode trunk
load-interval 30
spanning-tree portfast
!
interface GigabitEthernet1/0/5

switchport mode trunk
load-interval 30
spanning-tree portfast

interface Vlan20

ip address 172.16.0.3 255.255.0.0
ip helper-address 10.0.0.110
!
interface Vlan30
description ****SVI FOR FYP 30 VLAN****

ip helper-address 10.0.0.110

Switch Connected with Core switch
interface GigabitEthernet0/4
description ****Electrical LAB Access Point
switchport trunk encapsulation dot1q
switchport mode trunk
load-interval 30
spanning-tree portfast
!
interface GigabitEthernet0/5
switchport trunk encapsulation dot1q
switchport mode trunk
load-interval 30
spanning-tree portfast
!
interface GigabitEthernet0/6
switchport trunk encapsulation dot1q
switchport mode trunk
load-interval 30
spanning-tree portfast
!
interface GigabitEthernet0/7
switchport trunk encapsulation dot1q
switchport mode trunk
load-interval 30
spanning-tree portfast

You can not config portfast in links connected two SW 

Portfast +bpduguard use only in port connect to host

MHM

Here is the Wire shark file. Could you please determine if there is a network loop by examining the file?

Joseph W. Doherty
Hall of Fame
Hall of Fame

"How can loops be prevented in a network?"

L2 or L3 loops?

As already mentioned by others, usually a STP variant, if correctly configured and correctly working, will preclude L2 loops.  Regarding network performance optimization, much depends on the variant of STP being used.  Cisco's per VLAN STP can be used to have different loop free topologies on the same physical topology.  That's also true for MST.

Some STP variants "converge" faster than others, which is something else to consider for network performance.  I.e. how long a L2 topology change will disrupt traffic.

BTW, your later configuration postings using port-fast, can (rarely) allow a L2 loop to form.  Cisco, though, offers other configuration options to reduce this risk even further, as described in other replies.

I believe there are other L2 loop prevention protocols, REP (?), etc. (?), but I've no personal experience using any of them.

At L3, there's no way to preclude a loop, beyond what dynamic routing protocols normally do, although as also mentioned in the other posts, there are "things" in place to mitigate the impact of L3 loops, such as dropping L3 packets that have transited too many routers.

For L3 performance, well there are different methods to trying to optimize performance.  The most sophisticated, IMO, is something like Cisco's PfR which can monitor RTT for all flows and attempts to find the best performing path for each flow.

Mention, in other replies, as been made of using storm control.  This technology is sort of a "last resort", as it isn't very selective about the traffic is drops.  I consider it like Civil War medical treatment, i.e. amputation of a limb that has sustained a gun shot wound.

Review Cisco Networking for a $25 gift card