Lab - Multiple Spanning Tree

Multiple Spanning Tree

Topology

Objective

Obsrve te behavior of Multiple Spanning Tree(MST)

Background

Four switches have just been installed. The distribution Layer switches are Catalyst 3660s, and the access layer switches are Catalyst 2960. There are redundant uplinks between the access layer and distribution layer. Because of the possibility of bridging loops, spanning tree logically removes any redundant links. In this lab, we will group VLANs using MST so that we can have fewer spanning tree instances running at once to minimize switch CPU load.

Step 1: Prepare the switches for the lab.

  1. Delete vlan.dat file, erase the startup config, and reload the switches.
  2. Give each switch a hostname according to the topology diagram.
  3. Configure ports f0/7 through f0/12 on all switches to be trunks. On the 3560, first set the trunk encapsulation to dot1q. On the 2960s, only dot1q is supported, therefore the switchport trunk encapsulation command is unavailable, but the mode stll needs to be changed to trunk. If you do not set the mode of the ports to trunk, they will negotiate the operational mode according to their default DTP settings.
All Switches:
interface range f0/7-12
switchport trunk encapsulation dot1q
switchport mode trunk

Step 2: Configure VTP and VLANs

a. Configure all switches with VTP mode transparent and VTP domain CISCO. Add VLANs 10,20,30,40,50,60,70,80,90,100 to all of them.

All Switch:
vtp mode transparent
vtp domain CISCO
vlan 10,20,30,40,50,60,70,80,90,100

b. Issue the show vlan brief command to view the VLAN configurations.

DLS1#show vlan brief

VLAN Name                             Status    Ports
---- -------------------------------- --------- -------------------------------
1    default                          active    Et1/2, Et1/3, Et2/0, Et2/1
                                                Et2/2, Et2/3, Et3/0, Et3/1
                                                Et3/2, Et3/3
10   VLAN0010                         active    
20   VLAN0020                         active    
30   VLAN0030                         active    
40   VLAN0040                         active    
50   VLAN0050                         active    
60   VLAN0060                         active    
70   VLAN0070                         active    
80   VLAN0080                         active    
90   VLAN0090                         active    
100  VLAN0100                         active    
1002 fddi-default                     act/unsup
1003 token-ring-default               act/unsup
1004 fddinet-default                  act/unsup
1005 trnet-default                    act/unsup

Step 3: Display spanning-tree information

issue the show spanning-tree command on one of the switches. How many spanning tree instances are running?

DLS1#show spanning-tree

VLAN0001
  Spanning tree enabled protocol ieee
  Root ID    Priority    32769
             Address     aabb.cc00.0100
             Cost        100
             Port        1 (Ethernet0/0)
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

Bridge ID  Priority    32769  (priority 32768 sys-id-ext 1)
             Address     aabb.cc00.0500
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time  300 sec

Interface           Role Sts Cost      Prio.Nbr Type
------------------- ---- --- --------- -------- --------------------------------
Et0/0               Root FWD 100       128.1    Shr
Et0/1               Altn BLK 100       128.2    Shr
Et0/2               Altn BLK 100       128.3    Shr
Et0/3               Altn BLK 100       128.4    Shr
Et1/0               Altn BLK 100       128.5    Shr
Et1/1               Altn BLK 100       128.6    Shr
Et1/2               Desg FWD 100       128.7    Shr
Et1/3               Desg FWD 100       128.8    Shr
Et2/0               Desg FWD 100       128.9    Shr
Et2/1               Desg FWD 100       128.10   Shr
Et2/2               Desg FWD 100       128.11   Shr
Et2/3               Desg FWD 100       128.12   Shr
Et3/0               Desg FWD 100       128.13   Shr
Et3/1               Desg FWD 100       128.14   Shr
Et3/2               Desg FWD 100       128.15   Shr
Et3/3               Desg FWD 100       128.16   Shr

VLAN0010
  Spanning tree enabled protocol ieee
  Root ID    Priority    32778
             Address     aabb.cc00.0100
             Cost        100
             Port        1 (Ethernet0/0)
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

Bridge ID  Priority    32778  (priority 32768 sys-id-ext 10)
             Address     aabb.cc00.0500
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time  300 sec

Interface           Role Sts Cost      Prio.Nbr Type
------------------- ---- --- --------- -------- --------------------------------
Et0/0               Root FWD 100       128.1    Shr
Et0/1               Altn BLK 100       128.2    Shr
Et0/2               Altn BLK 100       128.3    Shr
Et0/3               Altn BLK 100       128.4    Shr
Et1/0               Altn BLK 100       128.5    Shr
Et1/1               Altn BLK 100       128.6    Shr

VLAN0020
  Spanning tree enabled protocol ieee
  Root ID    Priority    32788
             Address     aabb.cc00.0100
             Cost        100
             Port        1 (Ethernet0/0)
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

Bridge ID  Priority    32788  (priority 32768 sys-id-ext 20)
             Address     aabb.cc00.0500
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time  300 sec

Interface           Role Sts Cost      Prio.Nbr Type
------------------- ---- --- --------- -------- --------------------------------
Et0/0               Root FWD 100       128.1    Shr
Et0/1               Altn BLK 100       128.2    Shr
Et0/2               Altn BLK 100       128.3    Shr
Et0/3               Altn BLK 100       128.4    Shr
Et1/0               Altn BLK 100       128.5    Shr
Et1/1               Altn BLK 100       128.6    Shr

VLAN0030
  Spanning tree enabled protocol ieee
  Root ID    Priority    32798
             Address     aabb.cc00.0100
             Cost        100
             Port        1 (Ethernet0/0)
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

Bridge ID  Priority    32798  (priority 32768 sys-id-ext 30)
             Address     aabb.cc00.0500
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time  300 sec

Interface           Role Sts Cost      Prio.Nbr Type
------------------- ---- --- --------- -------- --------------------------------
Et0/0               Root FWD 100       128.1    Shr
Et0/1               Altn BLK 100       128.2    Shr
Et0/2               Altn BLK 100       128.3    Shr
Et0/3               Altn BLK 100       128.4    Shr
Et1/0               Altn BLK 100       128.5    Shr
Et1/1               Altn BLK 100       128.6    Shr

VLAN0040
  Spanning tree enabled protocol ieee
  Root ID    Priority    32808
             Address     aabb.cc00.0100
             Cost        100
             Port        1 (Ethernet0/0)
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

Bridge ID  Priority    32808  (priority 32768 sys-id-ext 40)
             Address     aabb.cc00.0500
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time  300 sec

Interface           Role Sts Cost      Prio.Nbr Type
------------------- ---- --- --------- -------- --------------------------------
Et0/0               Root FWD 100       128.1    Shr
Et0/1               Altn BLK 100       128.2    Shr
Et0/2               Altn BLK 100       128.3    Shr
Et0/3               Altn BLK 100       128.4    Shr
Et1/0               Altn BLK 100       128.5    Shr
Et1/1               Altn BLK 100       128.6    Shr

VLAN0050
  Spanning tree enabled protocol ieee
  Root ID    Priority    32818
             Address     aabb.cc00.0100
             Cost        100
             Port        1 (Ethernet0/0)
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

Bridge ID  Priority    32818  (priority 32768 sys-id-ext 50)
             Address     aabb.cc00.0500
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time  300 sec

Interface           Role Sts Cost      Prio.Nbr Type
------------------- ---- --- --------- -------- --------------------------------
Et0/0               Root FWD 100       128.1    Shr
Et0/1               Altn BLK 100       128.2    Shr
Et0/2               Altn BLK 100       128.3    Shr
Et0/3               Altn BLK 100       128.4    Shr
Et1/0               Altn BLK 100       128.5    Shr
Et1/1               Altn BLK 100       128.6    Shr

VLAN0060
  Spanning tree enabled protocol ieee
  Root ID    Priority    32828
             Address     aabb.cc00.0100
             Cost        100
             Port        1 (Ethernet0/0)
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

Bridge ID  Priority    32828  (priority 32768 sys-id-ext 60)
             Address     aabb.cc00.0500
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time  300 sec

Interface           Role Sts Cost      Prio.Nbr Type
------------------- ---- --- --------- -------- --------------------------------
Et0/0               Root FWD 100       128.1    Shr
Et0/1               Altn BLK 100       128.2    Shr
Et0/2               Altn BLK 100       128.3    Shr
Et0/3               Altn BLK 100       128.4    Shr
Et1/0               Altn BLK 100       128.5    Shr
Et1/1               Altn BLK 100       128.6    Shr

VLAN0070
  Spanning tree enabled protocol ieee
  Root ID    Priority    32838
             Address     aabb.cc00.0100
             Cost        100
             Port        1 (Ethernet0/0)
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

Bridge ID  Priority    32838  (priority 32768 sys-id-ext 70)
             Address     aabb.cc00.0500
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time  300 sec

Interface           Role Sts Cost      Prio.Nbr Type
------------------- ---- --- --------- -------- --------------------------------
Et0/0               Root FWD 100       128.1    Shr
Et0/1               Altn BLK 100       128.2    Shr
Et0/2               Altn BLK 100       128.3    Shr
Et0/3               Altn BLK 100       128.4    Shr
Et1/0               Altn BLK 100       128.5    Shr
Et1/1               Altn BLK 100       128.6    Shr

VLAN0080
  Spanning tree enabled protocol ieee
  Root ID    Priority    32848
             Address     aabb.cc00.0100
             Cost        100
             Port        1 (Ethernet0/0)
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

Bridge ID  Priority    32848  (priority 32768 sys-id-ext 80)
             Address     aabb.cc00.0500
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time  300 sec

Interface           Role Sts Cost      Prio.Nbr Type
------------------- ---- --- --------- -------- --------------------------------
Et0/0               Root FWD 100       128.1    Shr
Et0/1               Altn BLK 100       128.2    Shr
Et0/2               Altn BLK 100       128.3    Shr
Et0/3               Altn BLK 100       128.4    Shr
Et1/0               Altn BLK 100       128.5    Shr
Et1/1               Altn BLK 100       128.6    Shr

VLAN0090
  Spanning tree enabled protocol ieee
  Root ID    Priority    32858
             Address     aabb.cc00.0100
             Cost        100
             Port        1 (Ethernet0/0)
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

Bridge ID  Priority    32858  (priority 32768 sys-id-ext 90)
             Address     aabb.cc00.0500
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time  300 sec

Interface           Role Sts Cost      Prio.Nbr Type
------------------- ---- --- --------- -------- --------------------------------
Et0/0               Root FWD 100       128.1    Shr
Et0/1               Altn BLK 100       128.2    Shr
Et0/2               Altn BLK 100       128.3    Shr
Et0/3               Altn BLK 100       128.4    Shr
Et1/0               Altn BLK 100       128.5    Shr
Et1/1               Altn BLK 100       128.6    Shr

VLAN0100
  Spanning tree enabled protocol ieee
  Root ID    Priority    32868
             Address     aabb.cc00.0100
             Cost        100
             Port        1 (Ethernet0/0)
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

Bridge ID  Priority    32868  (priority 32768 sys-id-ext 100)
             Address     aabb.cc00.0500
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time  300 sec

Interface           Role Sts Cost      Prio.Nbr Type
------------------- ---- --- --------- -------- --------------------------------
Et0/0               Root FWD 100       128.1    Shr
Et0/1               Altn BLK 100       128.2    Shr
Et0/2               Altn BLK 100       128.3    Shr
Et0/3               Altn BLK 100       128.4    Shr
Et1/0               Altn BLK 100       128.5    Shr
Et1/1               Altn BLK 100       128.6    Shr

Spanning tree is running a separate spanning tree instance for each VLAN created, plus VLAN1. This method assumes that each VLAN could be runnning on a differently shaped topology. However, in many networks, multiple VLAN follow the same physical topology, so multiple spanning-tree calculations for the same topologies can get redundant. MST lets you configure different spanning tree instances. Each instance can hold a group of VLANs and manages its own spanning tree calculation.

MST is convenient in that it is backward compatible with PVST and RPVST+. Two switches only run MST with each other if they are in the same MST region. An MST region is defined by switches having identical regioin names, revision numbers, and VLAN-to-instance assignments. If they differ by any single attribute, they are considered different MST regions and fall back to RPVST+.

Step 4: Configure MST globally.

a. To configure MST, first use the global configuration command spanning-tree mode mst on all four switches.

Note: By default, all VLANs are assigned to instance 0, but can be moved around to different instances when MST is configured.

b. issue the show spanning-tree command and observe that there is only one spanning tree(instance 0) coming up. Also notice that the mode is listed as MSTP.

DLS1(config)#do show spanning-tree

MST0
  Spanning tree enabled protocol mstp
  Root ID    Priority    32768
             Address     aabb.cc00.0100
             Cost        0
             Port        1 (Ethernet0/0)
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

Bridge ID  Priority    32768  (priority 32768 sys-id-ext 0)
             Address     aabb.cc00.0500
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

Interface           Role Sts Cost      Prio.Nbr Type
------------------- ---- --- --------- -------- --------------------------------
Et0/0               Root FWD 2000000   128.1    Shr
Et0/1               Altn BLK 2000000   128.2    Shr
Et0/2               Altn BLK 2000000   128.3    Shr
Et0/3               Altn BLK 2000000   128.4    Shr
Et1/0               Altn BLK 2000000   128.5    Shr
Et1/1               Altn BLK 2000000   128.6    Shr
Et1/2               Desg LRN 2000000   128.7    Shr
Et1/3               Desg LRN 2000000   128.8    Shr
          
Interface           Role Sts Cost      Prio.Nbr Type
------------------- ---- --- --------- -------- --------------------------------

Et2/0               Desg LRN 2000000   128.9    Shr
Et2/1               Desg FWD 2000000   128.10   Shr
Et2/2               Desg FWD 2000000   128.11   Shr
Et2/3               Desg FWD 2000000   128.12   Shr
Et3/0               Desg FWD 2000000   128.13   Shr
Et3/1               Desg FWD 2000000   128.14   Shr
Et3/2               Desg FWD 2000000   128.15   Shr
Et3/3               Desg FWD 2000000   128.16   Shr

c. if you use the show spanning-tree mst configuration command, you can see a switch‘s current MST configuration. Because you have not configured any MST region settings, the switch shows the default settings.

DLS1(config)#do show spanning-tree mst configuration
Name      []
Revision  0     Instances configured 1

Instance  Vlans mapped
--------  ---------------------------------------------------------------------
0         1-4094
-------------------------------------------------------------------------------

Step 5: Configure the MST region and instance.

Now that MST has been enabled, we can configure the MST region setting to group VLANs, We use the region name CISCO and revision number of 1. We put VLAN 20 through 50 into instance 1, and 80 and 100 into instance 2. The rest of the VLANs remain in instance 0, the default.

a. To begin modifying the MST configuration, type the global configuration command spanning-tree mst configuration. Configuring MST is deifferent from other switch configurations, because changes are not applied until you are finished (similar to the deprecated VLAN database mode), and you can abort changes if you wish.

Note: you must apply identical configurations on each switch for MST to work propely.

DLS1(config)#spanning-tree mst configuration
DLS1(config-mst)# 

b. When you are in MST configuration mode, you can view the current configuration using the show current command. You do not need to leave configuration mode to execute this command. Notice that the output is identical to show spanning-tree mst configuration.

change the region name by typing name name. Change the revision number by typing revison number.

DLS1(config)#spanning-tree mst configuration
DLS1(config-mst)#name CISCO
DLS1(config-mst)#revision 1

Note: The MST revision number is not like the configuration revision number used with VTP. It does not increment when changes are made. Along with the region name, the revisoin number identifies the MST domain and must be the same on all systems in the MST region.

c. The last configuration change you have to make is putting VLANs into instances. Use the command instance number vlan vlan_range. The instance number can be between 0 and 15. Remember that 0 is the default instance number.

DLS1(config)#spanning-tree mst configuration
DLS1(config-mst)#name CISCO
DLS1(config-mst)#revision 1
DLS1(config-mst)#instance 1 vlan 20-50DLS1(config-mst)#instance 2 vlan 80,100
DLS1(config-mst)#show current
Current MST configuration
Name      []
Revision  0     Instances configured 1

Instance  Vlans mapped
--------  ---------------------------------------------------------------------
0         1-4094
-------------------------------------------------------------------------------

d. You can verify the changes you are about to make with show pending command. Remember that the changes that you just entered are not committed until you type exit, end or Ctrl + C, if you do not like the changes you made, you can leave the prompt without committing them by typing abort.

DLS1(config-mst)#show pending
Pending MST configuration
Name      [CISCO]
Revision  1     Instances configured 3

Instance  Vlans mapped
--------  ---------------------------------------------------------------------
0         1-19,51-79,81-99,101-4094
1         20-50
2         80,100
-------------------------------------------------------------------------------

Why do the switches wait until you are finished making changes to MST to commit them, rather than changing MST as you enter commands(like most switch commands)?

f. Verify that separate instances of spanning tree are running.

DLS2#show spanning-tree

MST0
  Spanning tree enabled protocol mstp
  Root ID    Priority    32768
             Address     aabb.cc00.0100
             This bridge is the root
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

  Bridge ID  Priority    32768  (priority 32768 sys-id-ext 0)
             Address     aabb.cc00.0100
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

Interface           Role Sts Cost      Prio.Nbr Type
------------------- ---- --- --------- -------- --------------------------------
Et0/0               Desg FWD 2000000   128.1    Shr
Et0/1               Desg FWD 2000000   128.2    Shr
Et0/2               Desg FWD 2000000   128.3    Shr
Et0/3               Desg FWD 2000000   128.4    Shr
Et1/0               Desg FWD 2000000   128.5    Shr
Et1/1               Desg FWD 2000000   128.6    Shr
Et1/2               Desg FWD 2000000   128.7    Shr
Et1/3               Desg FWD 2000000   128.8    Shr
Et2/0               Desg FWD 2000000   128.9    Shr
Et2/1               Desg FWD 2000000   128.10   Shr
Et2/2               Desg FWD 2000000   128.11   Shr
Et2/3               Desg FWD 2000000   128.12   Shr
Et3/0               Desg FWD 2000000   128.13   Shr
Et3/1               Desg FWD 2000000   128.14   Shr
Et3/2               Desg FWD 2000000   128.15   Shr
Et3/3               Desg FWD 2000000   128.16   Shr 

MST1
  Spanning tree enabled protocol mstp
  Root ID    Priority    32769
             Address     aabb.cc00.0100
             This bridge is the root
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

  Bridge ID  Priority    32769  (priority 32768 sys-id-ext 1)
             Address     aabb.cc00.0100
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

Interface           Role Sts Cost      Prio.Nbr Type
------------------- ---- --- --------- -------- --------------------------------
Et0/0               Desg FWD 2000000   128.1    Shr
Et0/1               Desg FWD 2000000   128.2    Shr
Et0/2               Desg FWD 2000000   128.3    Shr
Et2/0               Desg FWD 2000000   128.9    Shr
Et2/1               Desg FWD 2000000   128.10   Shr
Et2/2               Desg FWD 2000000   128.11   Shr
Et2/3               Desg FWD 2000000   128.12   Shr 

MST2
  Spanning tree enabled protocol mstp
  Root ID    Priority    32770
             Address     aabb.cc00.0100
             This bridge is the root
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

  Bridge ID  Priority    32770  (priority 32768 sys-id-ext 2)
             Address     aabb.cc00.0100
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

Interface           Role Sts Cost      Prio.Nbr Type
------------------- ---- --- --------- -------- --------------------------------
Et0/0               Desg FWD 2000000   128.1    Shr
Et0/1               Desg FWD 2000000   128.2    Shr
Et0/2               Desg FWD 2000000   128.3    Shr
Et2/0               Desg FWD 2000000   128.9    Shr
Et2/1               Desg FWD 2000000   128.10   Shr
Et2/2               Desg FWD 2000000   128.11   Shr
Et2/3               Desg FWD 2000000   128.12   Shr 

Challenge:

You can modify per-instance MST spanning tree attributes the same way you can modify per-VLAN attributes.

Make DLS1 the root of instance 1 and DLS2 the root of instance 2.

HINT: Use the question mark on the global configuration command spanning-tree mst ?

DLS1(config)#spanning-tree mst 1 root primary

DLS2(config)#spanning-tree mst 2 root primary  
时间: 2024-10-19 05:54:45

Lab - Multiple Spanning Tree的相关文章

Lab - Per-VLAN Spanning Tree Behavior

Per-VLAN Spanning Tree Behavior Topology Objectives: Observe the behavior of a separate spanning tree instance per VLAN. Change spanning tree mode to rapid spanning tree. Background: Four switches have just been installed. The distribution layer swit

Lab - Modify Default Spanning Tree Behavior

Modify Default Spanning Tree Behavior Topology Objective observe what happens when the default spanning tree behavior is modified. Background Four switches have just been installed. The distribution layer switches are Catalyst 3560s, and the access l

【HDU 4408】Minimum Spanning Tree(最小生成树计数)

Problem Description XXX is very interested in algorithm. After learning the Prim algorithm and Kruskal algorithm of minimum spanning tree, XXX finds that there might be multiple solutions. Given an undirected weighted graph with n (1<=n<=100) vertex

HDOJ 题目4408 Minimum Spanning Tree(Kruskal+Matrix_Tree)

Minimum Spanning Tree Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 1408    Accepted Submission(s): 450 Problem Description XXX is very interested in algorithm. After learning the Prim algori

HDU 4408 Minimum Spanning Tree 最小生成树计数

Minimum Spanning Tree Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) [Problem Description] XXX is very interested in algorithm. After learning the Prim algorithm and Kruskal algorithm of minimum spanning tree, XXX

hdu 4896 Minimal Spanning Tree

Minimal Spanning Tree Time Limit: 12000/6000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 144    Accepted Submission(s): 44 Problem Description Given a connected, undirected, weight graph G, your task is to select

Minimum spanning tree for each edge

Connected undirected weighted graph without self-loops and multiple edges is given. Graph contains n vertices and m edges. For each edge (u,?v) find the minimal possible weight of the spanning tree that contains the edge (u,?v). The weight of the spa

CF609E. Minimum spanning tree for each edge

题解:随便构造一颗最小生成树 然后对于其他不在树上的边  考虑到 删除这条链上的最大值在把这条边加上去 能得到这条边所在的最小生成树 可以LCT维护 但是明显这个题是静态的树就没必要LCT 当然我觉得最优的是树剖以后ST nlogn的的复杂度 也可以树剖+线段树nlog^2的复杂度 #include <bits/stdc++.h> const int MAXN=2e5+10; #define ll long long using namespace std; ll read(){ ll x=0

Project 2 - Spanning Tree Protocol

Project 2 - Spanning Tree ProtocolIn the lectures, you learned about Spanning Trees, which can be used to prevent forwardingloops on a layer 2 network. In this project, you will develop a simplified distributed version ofthe Spanning Tree Protocol th