With Spanning Tree Protocol, messages from a connected device always takes the least cost path to the Root Bridge. The least cost path also called as Link Cost or Port cost is the lowest cost path of the one or more paths available from the device to the root bridge. Each link type has its own default costs which is used by the Spanning Tree Protocol (STP) to calculate the least cost path.
Here we see a list of various Costs associated with link types based on the bandwidth:
Bandwidth Cost
===================
4 Mbit/s 250
10 Mbit/s 100
16 Mbit/s 62
45 Mbit/s 39
100 Mbit/s 19
155 Mbit/s 14
200 Mbit/s 12
622 Mbit/s 6
1 Gbit/s 4
2 Gbit/s 3
10 Gbit/s 2
20 Gbit/s 1
[EtherChannel]