pvst question

marcusaureliusbrutusmarcusaureliusbrutus Member Posts: 73 ■■□□□□□□□□
Hi. Given a network setup where switch A and switch B is connected via a gigabit interface and another switch, switch Z is connected to both switch A and switch B via int f0/1 and f0/2 respectively, if all three switches have ports configured for vlans 1, 2, 3, and 4, and Switch A is the root switch for vlans 1 and 2 while switch B is the root switch for vlans 3 and 4, is there a way for me to configure it that int f0/1 of switch Z forwards vlan 1 and 2 traffic to switch A and vlan 3 and 4 to switch B? Hence, avoiding stp from blocking f0/2.
I read from somewhere that you can do this by configuring stp port priority on an interface. But from what i remember the setup was quite different and am not sure if i can do so with my setup.
I would appreciate you expert opinion on this.

Thanks in advance.

Comments

  • szmarcekszmarcek Member Posts: 33 ■■□□□□□□□□
    From what I read I understood that you want switch Z to forward all traffic (vlan1,2,3,4) via int fas 0/1? is this correct? If it is, I am not an expert but maybe this

    Switch-Z(config)# interface FastEthernet 0/2
    Switch-Z(config-if)# spanning-tree vlan 3 cost 10000
    Switch-Z(config-if)# spanning-tree vlan 4 cost 10000

    This should cause switch Z to forward all traffic (vlan1,2,3,4) via int fas 0/1
    What do you think of it?
  • marcusaureliusbrutusmarcusaureliusbrutus Member Posts: 73 ■■□□□□□□□□
    Hi szmarcek,

    Thanks for taking the time to reply. The thing is, if both switches A and B are already my root bridges then switch Z will elect int f0/1 since it is the lowest int number, considering priorities and cost being equal. I actually want to avoid this and somehow load balance between interface f0/1 and f0/2 of switch Z. Hence, f0/1 will forward vlan 1 and 2 to switch A which is the root bridge for vlan 1 and 2, and f0/2 will forward vlan 2 and 3 to switch B which in turn is the root bridge for vlan 3 and 4. Alternately, f0/1 will block vlan 3 and 4 and f0/2 will block vlan 1 and 2. You are right in suggesting configuring stp cost on an interface on switch Z. But i was actually thinking what if i just set up f0/1 as a trunk allowing only vlan 1 and 2 and f0/2 also as a trunk allowing only vlan 3 and 4. Wouldn't this prevent routing loops at the same time effectively load balance between both interfaces?
  • szmarcekszmarcek Member Posts: 33 ■■□□□□□□□□
    if both switches A and B are already my root bridges then switch Z will elect int f0/1 since it is the lowest int number, considering priorities and cost being equal. I actually want to avoid this and somehow load balance between interface f0/1 and f0/2 of switch

    I think that the costs will be different. For example, let's consider vlan 1 and 2. When switch Z receives a configuration BPDU for those vlans it adds the root path cost advertised in the BPDU to the cost of the port that the BPDU was received upon. So for vlan 1,2 traffic switch Z will receive bpdus on int fas 0/1 and 0/2. Then switch Z will try to find the best path for vlan 1 ,2 traffic to switch A (since it is the root). Becasue it has two paths to the switch A (via fas int 0/1 & 0/2) it will compare the path cost of each and choose the lower one. Now I think that the root path cost in vlan1,2 bpdu received on Switch Z fa0/1 will be 19, whereas the root cost for vlan1,2 bpdu received on Switch Z fa 0/2 will be 23 (to get to switch A via fa 0/2 switch Z has to go via fastethernet link and gigabit link).



    Maybe I am missing something :) Let me know what you think.
  • marcusaureliusbrutusmarcusaureliusbrutus Member Posts: 73 ■■□□□□□□□□
    I think i understand your point. So basically int f0/1 will have a lower cost through switch A for vlans 1 and 2 and f0/2 will have a lower cost through switch B for vlans 3 and 4. Does this mean that switch Z will automatically elect f0/1 to forward traffic for vlans 1 and 2 and f0/2 for vlans 3 and 4? I was under the impression that given two trunk ports from a particular switch, where routing loops are present, one int would be forwarding and another blocking. Or is this principle on a per vlan traffic?
  • szmarcekszmarcek Member Posts: 33 ■■□□□□□□□□
    I was under the impression that given two trunk ports from a particular switch, where routing loops are present, one int would be forwarding and another blocking.

    That would be the case if you used original stp, where there was one instance of spanning tree for all vlans. In pvstp, each vlan will get its own instance of spanning tree protocol which will allow for load balancing.

    In you topology I think the following would happen

    if you power on switch Z, it will think that it is the root for vlan 1,2,3,4. After bpdua from switch A (which is the real root for vlan 1,2), switch Z will decide that it is not the root for vlan 1 ,2 but the switch A is. Then switch Z will try to find the best path for vlan 1 ,2 traffic to switch A (since it is the root). Because it has two paths to the switch A (via fas int 0/1 & 0/2) it will compare the path cost of each and choose the lower one (fa 0/1 will have the lower cost - 19 because, whereas fa0/2 will have a higher cost, probably 23 but I maybe wrong).
    Switch Z will decide to forward all the traffic for vlan 1 ,2 using fa0/1.

    For vlan 3,4 the similar process should occur - after switch Z has received bpdus for vlan 3,4, it will decide that switch B is the root and then switch Z will have to decide which interface it should use for vlan 3,4 traffic (either int 0/1 or 0/2, to do this it will calculate the cost of each. fa 0/2 will have the lower cost to switch B than the fa/01) and hence switch Z will forward vlan3,4 traffic using int fas 0/2.
  • marcusaureliusbrutusmarcusaureliusbrutus Member Posts: 73 ■■□□□□□□□□
    Excellent explanation Szmarcek. I appreciate it. By the way, what will happen if i configure one switch for rstp or mst, while the other switches are on pvst+?

    Thanks in advance.
  • szmarcekszmarcek Member Posts: 33 ■■□□□□□□□□
    To use rstp or mst all switches have to be set to this mode. If one switch is not capable of using rstp or mst and uses pvstp, all switches will start using pvstp.:)
  • kpjunglekpjungle Member Posts: 426
    szmarcek wrote: »
    To use rstp or mst all switches have to be set to this mode. If one switch is not capable of using rstp or mst and uses pvstp, all switches will start using pvstp.:)

    Not nessecarily. If a non-RSTP switch is hooked up to the RSTP switch, the RSTP switch will detect it, and not use RSTP to that switch, but that wont make your entire network be non-RSTP.
    Studying for CCNP (All done)
  • szmarcekszmarcek Member Posts: 33 ■■□□□□□□□□
    kpjungle wrote: »
    Not nessecarily. If a non-RSTP switch is hooked up to the RSTP switch, the RSTP switch will detect it, and not use RSTP to that switch, but that wont make your entire network be non-RSTP.

    Ok, so if in our example only two switches (let's say A, B are set to use RSTP) and switch Z is set to use PVSTP, our spanning tree would be using RSTP on one link and PVSTP on two remaing, namely connection between switches A and B would have RSTP working and connections between A&Z and B&Z would have PVSTP working?
  • kpjunglekpjungle Member Posts: 426
    szmarcek wrote: »
    Ok, so if in our example only two switches (let's say A, B are set to use RSTP) and switch Z is set to use PVSTP, our spanning tree would be using RSTP on one link and PVSTP on two remaing, namely connection between switches A and B would have RSTP working and connections between A&Z and B&Z would have PVSTP working?

    That is correct:
    You can verify this on one of the RPVST switches by looking for:
    Fa0/1 Desg FWD 19 128.3 P2p Peer(STP)

    I just created your example with 3 switches. Two of them running RPVST between them, and then running PVST to the third one. (Switch1 and Switch2 is the ones with the RPVST, each has their f0/1 port to the third switch in port 1 and 2 respectively), also Switch 1 is root for vlan 1, and switch 2 is root for vlan 2: (sorry for the long output)

    Switch 1:

    VLAN0001
    Spanning tree enabled protocol rstp
    Root ID Priority 20481
    Address 0016.9d94.4900
    This bridge is the root
    Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec

    Bridge ID Priority 20481 (priority 20480 sys-id-ext 1)
    Address 0016.9d94.4900
    Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
    Aging Time 300

    Interface Role Sts Cost Prio.Nbr Type
    ---- ---


    Gi0/1 Desg FWD 4 128.1 P2p
    Fa0/1 Desg FWD 19 128.3 P2p Peer(STP)


    VLAN0002
    Spanning tree enabled protocol rstp
    Root ID Priority 24578
    Address 0016.9d94.8e80
    Cost 4
    Port 1 (GigabitEthernet0/1)
    Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec

    Bridge ID Priority 32770 (priority 32768 sys-id-ext 2)
    Address 0016.9d94.4900
    Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
    Aging Time 300

    Interface Role Sts Cost Prio.Nbr Type
    ---- ---


    Gi0/1 Root FWD 4 128.1 P2p
    Fa0/1 Desg FWD 19 128.3 P2p Peer(STP)


    Switch 2:

    Switch2(config)#do sh span

    VLAN0001
    Spanning tree enabled protocol rstp
    Root ID Priority 20481
    Address 0016.9d94.4900
    Cost 4
    Port 1 (GigabitEthernet0/1)
    Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec

    Bridge ID Priority 32769 (priority 32768 sys-id-ext 1)
    Address 0016.9d94.8e80
    Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
    Aging Time 300

    Interface Role Sts Cost Prio.Nbr Type
    ---- ---


    Gi0/1 Root FWD 4 128.1 P2p
    Fa0/1 Desg FWD 19 128.3 P2p Peer(STP)


    VLAN0002
    Spanning tree enabled protocol rstp
    Root ID Priority 24578
    Address 0016.9d94.8e80
    This bridge is the root
    Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec

    Bridge ID Priority 24578 (priority 24576 sys-id-ext 2)
    Address 0016.9d94.8e80
    Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
    Aging Time 300

    Interface Role Sts Cost Prio.Nbr Type
    ---- ---


    Gi0/1 Desg FWD 4 128.1 P2p
    Fa0/1 Desg FWD 19 128.3 P2p Peer(STP)

    And finally switch 3 (non-rpvst):
    VLAN0001
    Spanning tree enabled protocol ieee
    Root ID Priority 20481
    Address 0016.9d94.4900
    Cost 19
    Port 1 (FastEthernet0/1)
    Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec

    Bridge ID Priority 32769 (priority 32768 sys-id-ext 1)
    Address 0012.01fa.8e00
    Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
    Aging Time 300

    Interface Role Sts Cost Prio.Nbr Type
    ---- ---


    Fa0/1 Root FWD 19 128.1 P2p
    Fa0/2 Altn BLK 19 128.2 P2p


    VLAN0002
    Spanning tree enabled protocol ieee
    Root ID Priority 24578
    Address 0016.9d94.8e80
    Cost 19
    Port 2 (FastEthernet0/2)
    Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec

    Bridge ID Priority 32770 (priority 32768 sys-id-ext 2)
    Address 0012.01fa.8e00
    Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
    Aging Time 300

    Interface Role Sts Cost Prio.Nbr Type
    ---- ---


    Fa0/1 Altn BLK 19 128.1 P2p
    Fa0/2 Root FWD 19 128.2 P2p


    Hope that helps.
    Studying for CCNP (All done)
  • szmarcekszmarcek Member Posts: 33 ■■□□□□□□□□
    Thanks kpjungle for explanation, I will try it out on my home lab this evening.
Sign In or Register to comment.