How is path cost calculated?

The uplink to the root switch is port 25 and is a 1gb link. All other ports are 100mb.

Just confusing that there are so many similar terms.

cost of root path is 4
Port path cost 19
designated path cost 4
designated path cost 0
Port path cost 4

Can someone walk me through receiving a bpdu on port 25 then going out of port 1?
How and when the path costs are added?
Why the switch needs a designated path cost, a port path cost and a root path cost?

#sh spanning-tree detail

 VLANAAAA is executing the ieee compatible Spanning Tree protocol
  Bridge Identifier has priority 32768, sysid 609, address xxxx.be3e.02c0
  Configured hello time 2, max age 20, forward delay 15
  Current root has priority 4096, address xxxx.44d6.e260
  Root port is 25 (GigabitEthernet0/1), cost of root path is 4
  Topology change flag not set, detected flag not set
  Number of topology changes 848 last change occurred 2d09h ago
          from FastEthernet0/2
  Times:  hold 1, topology change 35, notification 2
          hello 2, max age 20, forward delay 15
  Timers: hello 0, topology change 0, notification 0, aging 300

 Port 1 (FastEthernet0/1) of VLANAAAA is forwarding
   Port path cost 19, Port priority 128, Port Identifier 128.1.
   Designated root has priority 4096, address xxxx.44d6.e260
   Designated bridge has priority 33377, address xxxx.be3e.02c0
   Designated port id is 128.1, designated path cost 4
   Timers: message age 0, forward delay 0, hold 0
   Number of transitions to forwarding state: 1
   Link type is point-to-point by default
   BPDU: sent 2119782, received 0

 Port 2 (FastEthernet0/2) of VLANAAAA is forwarding
   Port path cost 19, Port priority 128, Port Identifier 128.2.
   Designated root has priority 4096, address xxxx.44d6.e260
   Designated bridge has priority 33377, address xxxx.be3e.02c0
   Designated port id is 128.2, designated path cost 4
   Timers: message age 0, forward delay 0, hold 0
   Number of transitions to forwarding state: 1
   Link type is point-to-point by default
   BPDU: sent 102753, received 0

 Port 3 (FastEthernet0/3) of VLANAAAA is forwarding
   Port path cost 19, Port priority 128, Port Identifier 128.3.
   Designated root has priority 4096, address xxxx.44d6.e260
   Designated bridge has priority 33377, address xxxx.be3e.02c0
   Designated port id is 128.3, designated path cost 4
   Timers: message age 0, forward delay 0, hold 0
   Number of transitions to forwarding state: 1
   Link type is point-to-point by default
   BPDU: sent 2119781, received 0

###some ports deleted for brevity


 Port 25 (GigabitEthernet0/1) of VLANAAAA is forwarding
   Port path cost 4, Port priority 128, Port Identifier 128.25.
   Designated root has priority 4096, address xxxx.44d6.e260
   Designated bridge has priority 4096, address xxxx.44d6.e260
   Designated port id is 32.386, designated path cost 0
   Timers: message age 1, forward delay 0, hold 0
   Number of transitions to forwarding state: 1
   Link type is point-to-point by default
   BPDU: sent 44, received 986850
Dragon0x40Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

surbabu140977Commented:
Preface: (trying to cover in a nutshell)
the spanning tree algorithm chooses a reference point in the network and calculates the redundant paths to that reference point.After all the links in the network are found 1 path is chosen by spanning tree algorithm for data transfer and the rest are shut down to prevent loops.it is done by a root bridge election that decide on network topology.


Ports that are determined to have the lowest cost path to the root bridge are called designated ports.

Switches or bridges running STP uses BPDU to exchange information.The bridge id is use to determine the root bridge and to determine the root port.

To determine root bridge priority,  the bridgeID and mac address are combined. Priority is 32768 by default.if 2 devices have the same priority, mac address is used to determine the lowest id.

Now, to determine the port that will be used to communicate with the root bridgew, path cost is determined. the STP cost is an accumulated total path cost based on bandwidth of the link.

1--mb values 10 or 19
1 gig values 4 or 1

once the cost is determined for all links to the root bridge, the switch will decide which port has the lowest cost. If there are equal cost paths the port with the lowest port ID will be used.

Best,


0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Otto_NCommented:
Let's first clarify a couple of terms:

Designated root - The bridge in the entire LAN infrastructure that was selected root bridge (bridge with the lowest bridge priority)
Designated bridge - The bridge on a specific LAN segment (note that this is only relevant on a LAN segment) that has the designated port (i.e the bridge that have the lowest root path cost)
Designated path cost - The root path cost advertised by the designated bridge
Root path cost - The designated path cost on the root port
Port path cost - The cost value applicable to each port of a bridge, based on bandwidth (the higher the bandwidth, the lower the cost)

One thing you need to remember with STP: There are some values (like bridge priority) that is valid for all ports on a bridge, but other values (like designated bridge and designated path cost) that is only valid on a specific LAN segment (i.e. usually one port on a bridge).

So, let's run through the example: Gi0/1 is directly connected to the root bridge, i.e the bridge with the lowest priority.  The root bridge advertises BPDU's with his own BID as the designated root, and path cost as 0.  So Gi0/1 receives these BPDU's, accepts them as the lowest, and record these values in the 'designated bridge' and 'designated path cost' values (for the interface).

However, the switch also elects Gi0/1 as the route port (since it has the lowest value in 'designated path cost').  It will then advertise BPDU's with a 'cost of path'-value (a field in the BPDU) of 4 ('path cost' on the 'root port' plus the 'cost of root path').  If this 'cost of path' is the lowest on the respective segments (such as Fa0/1), this bridge's BID is recorded in the 'designated bridge' register on the interface (with designated path cost of 4).
0
Otto_NCommented:
See, even I confused the variables.  The last paragraph should read:

"However, the switch also elects Gi0/1 as the route port (since it has the lowest value in 'designated path cost').  It will then advertise BPDU's with 'cost of root path'-value (a field in the BPDU) of 4 ('path cost' on the 'root port' plus the 'port path cost' ).  If this 'cost of route path' is the lowest on the respective segments (such as Fa0/1), this bridge's BID is recorded in the 'designated bridge' register on the interface (with designated path cost of 4)."

Sorry for the confusion!
0
Powerful Yet Easy-to-Use Network Monitoring

Identify excessive bandwidth utilization or unexpected application traffic with SolarWinds Bandwidth Analyzer Pack.

Dragon0x40Author Commented:
thanks surbabu140977 and Otto N,

Route port is the same as what I call a root port?

Very good explanations.
0
surbabu140977Commented:
No, routed port is different.

Sometimes the ISP gives you ethernet handoffs, then you put that cable into a layer 3 switch and put an ip address to that very port. Then that port is routed port that means data gets routed through that port and ip address.

Otherwise, generally we put ip address in a switch, not on individual ports.

Routed port is a layer3 osi model concept, but root port is STP propery, works in Layer2.

Best,
0
Dragon0x40Author Commented:
I was trying to clarify the 5th paragraph in Otto N's first post.

>>However, the switch also elects Gi0/1 as the route port (since it has the lowest value in 'designated path cost')

Is this a typo and should say root?
0
surbabu140977Commented:
ah ok,  yep typo.....:) ROOT PORT........

0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Switches / Hubs

From novice to tech pro — start learning today.