We help IT Professionals succeed at work.

Spanning Tree  + Switching Loops

Hi,
I am trying to understand bridign loops to get better understanding of spanning tree
Firstly the cisco documentation talks alot about segments to me i take it as a segment is broadcast domain so each vlan is a segment??

So for example say we have 2 vlans spread over couple of switches same user vlans 2 + 3.

Say a pc connected to one of the access ports on 1  of the switches say fa0/3 in vlan 2 on switch2 . When it sends a frame to a pc on vlan 3. Does all the access ports in vlan 2 see the frame or is just fa0/3?? Do all switch access ports see all frames in the same vlan/same segment or is just broadcast frames that all switchports will see.
The way i though it happened was that each switch learns from each source address so say the pc on fa0/3 transmits a frame the switch puts in it cam table the source mac of the pc as reachable though fa0/3


What is confusing is the bridging loops.
the example i have  has    2 segments and 2 switches a pc on 1 segment transmits to a pc on another segment why does both switches on the first segment get the frame and put in there cam table would  switch 2 not just get it as it is on the fa0/3 of the switch ?? see attachement

Figure5-1.gif
Comment
Watch Question

nociSoftware Engineer
Distinguished Expert 2019

Commented:
>> i take it as a segment is broadcast domain so each vlan is a segment??
Well multiple segments may combine into one Broadcast domain. VLAN's are distinct Broadcast domains thus also different segments.


>> Does all the access ports in vlan 2 see the frame or is just fa0/3??
That depends...
  If the target address is a multicast or broadcast MAC address then yes it goes to all ports.
  If the target address is unknown (in the CAM/MAC table) then it is treated as broadcast.
  If the target address us unicast and known where it lives, it is direct delivery only.

>>Do all switch access ports see all frames in the same vlan/same segment or is just
>> broadcast frames that all switchports will see.
See previous.

>>The way i though it happened was that each switch learns from each source address
>> so say the pc on fa0/3 transmits a frame the switch puts in it cam table the source
>> mac of the pc as reachable though fa0/3
That's correct. But if the PC has never sent a message than a broadcast is needed to get a response.

>> What is confusing is the bridging loops.
>> the example i have  has    2 segments and 2 switches a pc on 1 segment transmits to
>> a pc on another segment why does both switches on the first segment get the frame
>> and put in there cam table would  switch 2 not just get it as it is on the fa0/3 of the
>> switch ?? see attachement
Well the address is of the target system behind the the switch so both will absorb the packet. WITHOUT Spanning Tree or other measures then BOTH will forward the packets.
(no think of what will happen with a broadcast packet..., and there are many broadcast packet in any network for address discovery ARP, or DHCP etc.)
 If there is a STP protocol then both switch will agree on who will forward a packet.
The other will block an interface.
Try a 'show span' on both switches. (And in a LAB env try it without STP, the network will come down on you, so no real live network please, this is like a big DONT TRY THIS AT HOME warning!!! ;).

But your picture is not an UTP network one, this can only be configured this way if you still have a COAX network (10Base5 or 10Base 2).
Jason WatkinsIT Project Leader

Commented:
Spanning Tree exists to help in the prevention of loops by making sure frames exiting one segment are not processed as incoming from to that segment when multiple paths out are available.

http://www.cisco.com/en/US/docs/internetworking/technology/handbook/Transparent-Bridging.html#wp1020561
Most Valuable Expert 2011

Commented:
Here is a diagram I did a while back that may help visualize it.  I partially color coded the VLANs so some are Red some are Blue.  Then you can see the center lines that are "both" colors,..these are the truck line that carry multiple "segments" (aka multiple VLANs)

MultiSubnetSimpleLANwithTrunks.jpg
nociSoftware Engineer
Distinguished Expert 2019

Commented:
@pwindell
Your drwaing only doesn't contain double links or loops.

If the L2 Switches are linked through a 2nd L3 Switch there are loops that need to be resolved. And that's where STP comes in. where selectively some ports on the trunking are blocked to still allow traffic. to go from any place to any other place.
BarepAssetsSys Admin

Author

Commented:
thanks for the replies

@nico   Well the address is of the target system behind the the switch so both will absorb the packet. WITHOUT Spanning Tree or other measures then BOTH will forward the packets.-- this is exactly the point i am confused on. So the pc is connected to either 1 of the switches or the other. Why would both absorb a typical unicast packet i can understand why broadcast??  Why would both forward unicast traffic?

Is it because say  the initial unicast destination is unknown the switch will broadcast to find destination because it broadcast it is recieved on the other  switch as both switches have switchports in the same vlan i.e same segment so then it will put the source as on that segment in its cam table??

But still that does not make sense going forward then if it is just unicast the traffic will go to switchport that it is connected to say switch 1 and switch 1 will just forward it. It is not going broadcast once it is aware of the destination.

Is the spanning tree only concerned with broadcast traffic??
Software Engineer
Distinguished Expert 2019
Commented:
The spanning tree (STP) is ONLY concerned with automatically BLOCKING double routes, and if

    Say you have a tirangle of switches: Switch1 connected to Switch2 which is connected to Switch3 which is then again connected to switch1.
Alls connections are trunks carrying multiple VLANS.

If only One of such connections fails then traffic can still go anywhere because there are redundant links.
Now if there is a broadcast packet you can will see that all switches will forward to packet to all other ports ... causing what is known as a broadcast storm.  all switches are only busy sending the same packet round and round. Other traffic will pass slowly.

To prevent this behaviour you need to remove one line., STP takes care of this blocking of one link so there is no loop. (logically the physical loop stais there ).
STP polls all systems every 30 seconds to build a new tree, as seen from the root switch all loops get an order to break it. It can take on avarage 45 seconds to recover from a broken link.
RSTP or Rappid STP does the same, but also at every topology changes, every time an interface comes up or goes down. Greatly enhancing the speed of convergention.
Both STP/RSTP do this  per VLAN, if you have 10 VLAN's you also have 10 trees.
Both RSTP/STP can work together.

MVSTP does one tree for ALL VLANS, but is somewhere between STP/RSTP for convergence, it should probably be considered if all vlans are available everywhere.
It also is NON-standard w.r.t. (R)TSP.

Please not that your drawing is from an old topology network.. where the devices were called bridges. not swithes with different cable technology. (Coax v.s. UTP).
Most Valuable Expert 2011

Commented:
Your drwaing only doesn't contain double links or loops.
Correct.  It was not drawn up special for this case and wasn't intended to address all parts of the question.  It is intended to show the "segments" (VLANs) and how in some places more than one runs over the same wire but is yet logically separated.