1. A switch, comprising: one or more ports; processing circuitry; a storage device coupled to the processing circuitry and storing instructions which when executed by the processing circuitry cause the processing circuitry to perform a process of: extracting a first path cost to a root switch of a spanning tree from a first message received via a local edge port of the one or more ports; extracting a second path cost to the root switch from a second message from a second switch via an inter-switch port of the one or more ports, wherein the second message is encapsulated in an encapsulation header, and wherein the switch and the second switch participate in the spanning tree using a same source identifier associated with a network of interconnected switches; assigning a state of the local edge port based on the first and second path costs.