SW1 is connected to SW2 with 2 different connections. So
SW1 gi0/1 -> gi0/1 SW2
SW1 gi0/2 -> gi0/2 SW2
So there is in effect a loop between the switches ie. a packet sent from SW1 on gi0/1 to gi0/1 on SW2 could actually be then sent from SW2 on gi0/2 back to SW1 on gi0/2.
As Giuseppe noted Cisco usually run an STP instance per vlan (MST being an exception). So lets say that each port gi0/1, gi0/2 on SW1 and gi0/1, gi0/2 on SW2 are in the same vlan. A broadcast packet is sent from SW1 on gi0/1 to SW2 on gi0/2. A L2 switch will forward a broadcast out of all ports (within that vlan) except the port it was received on. So SW2 sends the broadcast out of gi0/2 to SW1 on gi0/2. And SW1 then resends out gi0/1 etc...
It doesn't have to be a broadcast packet it can be a unicast packet as well with each switch learning the mac-address on the different interfaces.
That is a loop. STP should block one of these links so that there is no loop between the switches.
Thank you for the detail. I am still confused. why the SW2 sends the broadcast out of gi0/2 to SW1 on gi0/2? and why the SW1 resends out gi0/1 again? Also, can you explain the loop from MAC perspective?
A switch will forward a broadcast out of all it's ports except the one it receives it on.
So SW1 forwards a broadcast packet to SW2 out of gi0/1. SW2 receives this packet on it's gi0/1. Now bearing in mind the rule about how a switch handles broadcasts SW2 will not send the packet back out of gi0/1 because it received the packet on this port. But it will send it out of gi0/2.
SW1 now receives the same packet on it's gi0/2 interface. Again SW1 won't send it back out of gi0/2 because it received it on this port but it will send it out of gi0/1 etc...
Jon provides a good explanation based on the behavior of broadcast packets. Since you asked about an explanation from MAC perspective let me give one: assume that SW1 has received a frame with destination MAC address of 00-22-19-03-7B-F7 and looks in the switch forwarding table. If the switch does not find a match in the forwarding table then the switch forwards the frame to all ports in the VLAN. So SW1 will forward the frame over Gi0/1 to SW2. SW2 looks in its switch forwarding table for MAC 00-22-19-03-7B-F7 and does not find it. So SW2 forwards the frame. SW2 received the frame on Gi0/1 and will not send it over that port but will forward it over Gi0/2. So SW1 receives a frame on Gi0/2 with destination MAC of 00-22-19-03-7B-F7 and looks in its switch forwarding table. When it does not find a match it forwards the frame out Gi0/1... and the loop goes on and on.
We are pleased to announce availability of Beta software for 16.6.3.
16.6.3 will be the second rebuild on the 16.6 release train targeted
towards Catalyst 9500/9400/9300/3850/3650 switching platforms. We are
looking for early feedback from customers befor...
Introduction Featured Speakers Luis Espejel is the Telecommunications
Manager of IENova, an Oil & Gas company. Currently he works with Cisco
IOS® and Cisco IOS XE platforms, and NX to some extent. He has also
worked as a Senior Engineer with the Routing P...
In this session you can learn more about Layer 3 multicast and the best
practices to identify possible threats and take security measures. It
provides an overview of basic multicast, the best security practices for
use of this technology, and recommendati...