I've been trying to work my way through STP. It's been slow going since it seems to be mostly theory. I think I've finished STP and almost finished RSTP - the only thing I'm kindof getting stuck on is part of the synchronization process.
I've got most of it - how the root sends the proposal bpdu & the receiving switch receives it, blocks the other (nonedge) ports, sends agreement back and both ports immediately go forwarding (as designated & root ports), then the process repeating itself with the 'receiving' switch becoming the sending switch for the next 'pulse' of synchronization.
Where I'm getting stuck is when an
inferior BPDU is received (or sent since we can see the big picture and know ahead of time where it will be). None of the examples I've read or looked up online go into the inevitable conclusion where a switch sends what will be an inferior BPDU for the receiving switch.
I eventually just threw together a 3-switch lab and brought up debugging (spanning-tree events seems most useful). I configured the priority on 2 of the switches to be certain which would be primary and secondary roots, then started wiring them together. I expected to see when I put the 3rd link up (between highest and lowest priority) for the highest priority to get a new superior BPDU over the new link (which it did), and once it synced to send a BPDU over it's other link that would be inferior - but that's not what happened.
F0/2 is to the root and is the new link, F0/1 is to secondary root (and was best path before hooking up 0/2)
Jan 12 06:51:46: RSTP(1): initializing port Fa0/2
Jan 12 06:51:46: RSTP(1): Fa0/2 is now designated
Jan 12 06:51:46: RSTP(1): transmitting a proposal on Fa0/2
Jan 12 06:51:46: RSTP(1): updt roles, superior bpdu on Fa0/2 (synced=0)
Jan 12 06:51:46: RSTP(1): Fa0/2 is now root port
Jan 12 06:51:46: RSTP(1): Fa0/1 blocked by re-root
Jan 12 06:51:46: RSTP(1): Fa0/1 not in sync
Jan 12 06:51:46: RSTP(1): Fa0/1 is now alternate
Jan 12 06:51:46: RSTP(1): synced Fa0/2
Jan 12 06:51:46: RSTP(1): synced Fa0/2
Jan 12 06:51:46: RSTP(1): transmitting an agreement on Fa0/2 as a response to a proposal
I'm not quite sure why it didn't send a BPDU out 0/1 to see if the switch on the other end would use it as a better path. I was expecting that, so I could see what happened when it was rejected. Does anyone know how this switch was able to determine it's neighbor would NOT have considered it's BPDU as better?