Network ports are an essential component of the Spanning Tree Protocol (STP) used to determine the network topology and maintain a loop-free environment. So the rundown of how ports are handled from an STP perspective goes a little something like:
- Root Port:
Root Port – DefinitionThe Root Port on a non-root switch is the port that has the lowest path cost to the Root Bridge. This is the port on which the switch will communicate with the root bridge in the cheapest method (least path cost). A non-root switch will have only one Root Port.
Path Cost Calculation
The path cost is based on the network links speed. In general, lower path costs are present on faster links. The following path cost value is based on the link speed.
10 Mbps Ethernet: Cost = 100
100 Mbps Fast Ethernet: Cost = 19
1 Gbps Gigabit Ethernet: Cost = 4
10 Gbps Ten Gigabit Ethernet: Cost = 2
The cost of the path from a switch to Root Bridge, is the answer of the applied costs on all the links along this path.
How to Find the Root Port
BPDU Exchange: Switches exchange Bridge Protocol Data Units (BPDUs) that include path costs, bridge IDs and port IDs.
First Root Bridge SelectionThe Root Bridge is chosen with the lowest bridge ID.
Path Cost Calculation: Every switch calculates the path cost to the Root Bridge from each of its ports.
Root Port Selection: The Root Port is the port with the lowest path cost to the Root Bridge. If several equal-cost paths are available, then the port connected to the switch with the smallest bridge ID will be selected. If there is still a tie, the port with the lowest port ID is chosen.
- Designated Port:
Designated Port: Finding the Designated Port is a two-level decision and is the port on a network segment that has the lowest path cost to the Root Bridge. It help in forwarding of frames to / from that segment. Designated Port – On each network segment (collision domain), only one Designated Port is allowed, and this ensures only one active path for traffic on that segment.
SelectDesignated Port
Designated Port by using a): 1. b) Read through the following descriptions, the selection goes from the first match to the last 1. 2. 3. 4. 5.
The switch connected to the port leading to the root bridge with the least cost is elected as the Designated Port for that LAN.
Lowest Bridge ID: If multiple switches have the same path cost to the Root Bridge, the switch with the lowest Bridge ID takes the crown.
If still there is a tie, the Designated Port is the port with the lowest Port ID.
Purpose and Benefits
Prevents Loops: By ensuring only one Designated Port per network segment, Spanning Tree Protocol (STP) is capable of preventing topology loops within that segment.
Fast Frame Forwarding: Designated are like blockers because they are managing traffic on their segment and make sure the frames are forwarded in a efficient manor to help performance on the network.
Predictable Network Topology : By maintaining the predominant flow of traffic within their segments, Designated Ports also contribute to stability, as connected ports do not flood traffic one another.
- Non-Designated Port:
Non-Designated Port: A Non-Designated Port is a port on a switch that has not been selected as the Root Port or Designated Port. In simpler terms, it is a block port to avoid network loops. Non-Designated Ports stop forwarding frames and learning MAC addresses under regular conditions, yet still form part of the STP topology in order to provide alternate paths in case of topology changes.
Purpose and Benefits
Preventing Loops: STP prevents loops on the network by putting certain ports in a blocking state. Non-Designated Ports also help in preventing loops in the topology, by not forwarding frames.
Redundancy and Failure: While Non-Designated Ports do not typically forward frames, they are part of the STP topology and can transition to a forwarding state should the network topology alters (e.g. Fails Active). This gives us the inherent redundancy to make the network reliable and robust.