< Home

(Optional) Setting the Path Cost for a Port

Context

A path cost is port-specific and is used by VBST to select a link. A port in different VLANs may have different path costs on a network running VBST. Traffic from different VLANs is forwarded through different physical links by setting a proper path cost enable, therefore implementing VLAN-based load balancing.

The path cost value range is determined by the calculation method. The following calculation methods are used:
  • dot1d-1998: IEEE 802.1d standard is used to calculate the path cost.
  • dot1t: IEEE 802.1T standard is used to calculate the path cost.
  • legacy: Huawei calculation method is used to calculate the path cost.

After the calculation method is determined, the path cost of a port can be set. Generally, a higher path cost indicates higher probability of a port to be blocked. If the link rate of a port is small, you are advised to set a large path cost so that the port is selected as the blocking port during spanning tree calculation and its link is blocked.

The default path cost varies according to the interface rate. Huawei calculation method is used as an example. Table 1 shows the mapping between link rates and path costs.
Table 1 Mappings between link rates and path costs

Interface Rate

Default Value

Recommended Value Range

Path Cost Range

10 Mbit/s

2000

200-20000

1-200000

100 Mbit/s

200

20-2000

1-200000

1 Gbit/s

20

2-200

1-200000

10 Gbit/s

2

2-20

1-200000

Over 10 Gbit/s

1

1-2

1-200000

Procedure

  1. Run system-view

    The system view is displayed.

  2. Run stp pathcost-standard { dot1d-1998 | dot1t | legacy }

    A path cost calculation method is configured.

    By default, IEEE 802.1T standard is used to calculate the path cost.

    All switches on the same network must use the same path cost calculation method.

  3. Run interface interface-type interface-number

    The view of the Ethernet interface that participates in spanning tree calculation is displayed.

  4. Run stp vlan { vlan-id1 [ to vlan-id2 ] } &<1-10> cost cost

    The path cost of the port in each VLAN is set.

    • If Huawei calculation method is used, the path cost ranges from 1 to 200000.
    • If IEEE 802.1D standard is used, the path cost ranges from 1 to 65535.
    • If IEEE 802.1T standard is used, the path cost ranges from 1 to 200000000.

Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >