5.2 STP Processes
5.2.4 Electing designated ports
The loop-prevention part of STP becomes apparent during the third step of initial STP convergence: electing designated ports. Each segment in a bridged network has one designated port. This port functions as the single bridge port that both sends and receives traffic to and from that segment and the root bridge. The idea behind this is that if only one port handles traffic for each link, all the loops have been broken. The bridge containing the designated port for a given segment is referred to as the designated bridge for that segment.

As with the root-port selection, the designated ports are chosen based on cumulative root path cost to the root bridge, as shown in the Figure. In the Figure, locate the designated ports and look at each segment in turn. First look at Segment 1, the link between Cat-A and Cat-B. There are two bridge ports on the segment: Cat-A Port-1/1 and Cat-B Port-1/1. Cat-A Port-1/1 has a root path cost of 0 (after all, it is the root bridge), whereas Cat-B Port-1/1 has a root path cost of 19 (the value 0 received in BPDUs from Cat-A plus the path cost of 19 assigned to Cat-B Port-1/1). Because Cat-A Port-1/1 has the lower root path cost, it becomes the designated port for this link.

For Segment 2 (Cat-A to Cat-C link), a similar election takes place. Cat-A Port-1/2 has a root path cost of 0, whereas Cat-C Port-1/1 has a root path cost of 19. Cat-A Port-1/2 has the lower cost and becomes the designated port. Notice that every active port on the root bridge becomes a designated port. The only exception to this rule is a Layer 1 physical loop to the root bridge.  Examples of this occur when two ports on the root bridge are connected to the same hub or two ports are connected via a crossover cable.

Now look at Segment 3 (Cat-B to Cat-C): both Cat-B Port-1/2 and Cat-C Port-1/2 have a root path cost of 19. There is a tie. When faced with a tie (or any other determination), STP always uses the four-step decision sequence discussed earlier in the section "Four-Step STP Decision Sequence." Recall that the four steps are as follows:

  • Lowest root BID
  • Lowest path cost to root bridge
  • Lowest sender BID
  • Lowest port ID

In the example shown in the Figure, all three bridges agree that Cat-A is the root bridge, causing root path cost to be evaluated next. However, as pointed out in the previous paragraph, both Cat-B and Cat-C have a cost of 19. This causes BID, the third decision criterion, to be the deciding factor. Because the Cat-B BID (32,768.BB-BB-BB-BB-BB-BB) is lower than the Cat-C BID (32,768.CC-CC-CC-CC-CC-CC), Cat-B Port-1/2 becomes the designated port for Segment 3. Cat-C Port-1/2, therefore, becomes a nondesignated port.