Each port has a cost based on its speed. Faster links have lower costs. The original costs were: Mbps = , Mbps = , Gbps = , Gbps = . Modern networks use revised costs where Gbps = and Gbps = . A switch calculates its root path cost by adding the port cost to the cost advertised in the received BPDU. The port with the lowest total cost to the root becomes the root port.
##### ###### ##### ### # # ### # # ###### ## ## ## ## ## ## ## # # # # # ## ##### #### ##### # # # # # # # #### ## # ## ## ## ## # # # # # ## ## # ###### ## ### # ### # ######
$ curl repovive.com/roadmaps/network-design/spanning-tree-and-link-aggregation/path-cost-calculation
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░████████████████████████████████████████████████████████████████████████████████████████████████████