STP question

Atmosphere1991Atmosphere1991 Member Posts: 29 ■□□□□□□□□□
Hey guys, I'm kinda confused with STP and I have a question I was hoping you could help me with. I'm having trouble understanding how ports are given roles. I understand that the ports with the lowest cost path to the root are going to be root ports. But when it comes to deciding which port is going to be a designated port and which is alternate port on a redundant link I'm lost. Like this picture, why is port f0/2 the root port and not port f0/3? Also why is g1/1 on s3 the Alternate port and not the DP? Any help would be greatly appreciated.

Comments

  • GngoghGngogh Member Posts: 165 ■■■□□□□□□□
    hi,

    if im not wrong ...

    On S1 there is no Alternate port.
    S1 is the root bridge. Why??? because on the root bridge all ports are designated ports.

    On S4 f0/2 is the root port because has the lowest port id .. ex: port f0/2 and f0/3 have the same cost to the root bridge, so there is a tie, in the event of a tie the switch will chose the port with the lowest id, f0/2 is lower then f0/3.

    In STP the lowest always win.

    http://www.routeralley.com/ra/docs/stp.pdf <-- some reading will help to understand better.
  • Jon_CiscoJon_Cisco Member Posts: 1,772 ■■■■■■■■□□
    I did that same exercise today and I just guessed about the link between SW2 and SW3.

    I had no idea how it decided which side would be the designated port and which was the alternate. I thought maybe it was because SW2 had a lower bridge ID (from MAC address) that maybe that was the deciding factor on the path.

    There was only one page that I recall discussed the port priority and it did not explain it very well. I do believe on an individual switch the port number is part of the determination.
  • late_collisionlate_collision Member Posts: 146
    This was a lot to type, so I hope it's clear and helps you out.

    First, you need to determine which switch is the Root Bridge. The Root Bridge election is decided on which switch has the lowest Bridge ID. The Bridge ID consists of the priority and MAC Address of the switch. Since the Priority is not displayed on the diagram, we assume they are all equal, the default value of 32,768. Since, they all tie on priority, we then look for the switch with the lowest MAC Address. Switch1 wins with the lowest MAC Address, it is the Root Bridge and all connected links are designated. Root Bridges may only have designated ports (unless you do something dumb like connecting one interface to another on the same switch, in which case, one of the ends of the link will need to be blocked to prevent a loop).


    It's important to know the STP cost of the link, which is (unless manually set by an administrator) 4 for Gig links and 19 for Fast Ethernet.


    Moving on to Switch2. Switch2 can get to the Root Bridge out any interface, however, we are looking for the interface with the lowest cost to the Root Bridge. In this case, the shortest path (by link cost) is out G1/1 with a value of 4. This means G1/1 is the Root Port. Sure, you can get to the Root Bridge out any other interface, but the cost will be higher.

    We can make the same decision on Switch3. G1/2 on Switch 3 will be the Root Port, it is nearest the Root Bridge with a cost of 4.

    Switch4, which port is root? Lets start by adding up the cost to the Root Bridge for each interface:

    Fa0/1: 19 + 4 = 23 (Fast Ethernet to Gig out SW3)
    Fa0/2: 19 + 4 = 23 (Fast Ethernet to Gig out SW2)
    Fa0/3: 19 + 4 = 23 (Fast Ethernet to Gig out SW2)

    Ok, we have a tie. In the event of a tie, we compare Bridge ID's from our directly connected neighbors (the switches that we received BPDU's from).

    SW2 MAC Address: 000A00222222
    SW3 MAC Address: 000A00333333

    Switch2 has the lower (better) Bridge ID, we will go that way. But there are 2 paths to Switch2, so we tie.

    In the event of a tie, we will look at the port priority of the interfaces on the neighboring switch (switch2). Since the interface port priority isnt shown, we assume both are set to the default value of 128, so again, we tie.

    To break this tie, we look at the port id of each interface on the neighboring switch (switch2). Since Fa0/1 is numerically lower (better) than Fa0/2, we choose the path using Switch2's Fa0/1 interface, making Switch4's Fa0/2 Switch4's Root Port.


    Ok, now we know our Root Bridge and Root Ports. Let's find the designated ports.

    Lets start with the diagonal link between Switch2 and Switch3. If this link were not put into a blocking state, there would be a loop in the network. So one end will be put into blocking and the the other will be designated.

    I like to imagine that I am a sitting at a PC in the middle of the link, trying to decide which route I should take to the Root Bridge, should I head towards Switch2 or Switch3? To decide, I compare the cost to the Root Bridge, in this case, we have a tie again, either direction has the same cost to the Root Bridge. Next, I will compare Bridge ID's to see who has the lower (better) Bridge ID. In this case, Switch2's MAC Address is lower (better), so I will go that way. Switch2's G1/2 will become the designated (forwarding) port, and Switch3's G1/1 will become blocking, or in this case, an alternate port. An alternate port is in the blocking state, but has a role of alternate, which means I can get to the Root Bridge out this port, if my Root Port were to fail.

    Now, lets look at the link between Switch3 and Switch4. This should be pretty obvious at this point. Imaging I was in the middle of the link, I could head towards Switch3 or Switch4. Which has the lowest cost to the Root Bridge? I hope you said through Switch3! This makes Switch3's Fa0/1 the Designated port and Switch4's Fa0/1 blocking, or Alternate, for that segment.

    Lastly, the redundant link between Switch2 and Switch4. Whats my cost to the Root Bridge? It is lower if I head towards Switch2 as compared to the route through Switch4, right? This makes the Switch2 side of the link the Designated Port and the Switch4 side, blocking, or Alternate.


    These are the steps and tie breakers to manually map out the STP converged state of a network.

    Step 1: Find the Root Bridge
    - Lowest Bridge ID

    Step 2: Find your Root Ports
    - Lowest Cost the the Root Bridge
    - Lowest Bridge ID of your directly connected neighbors
    - Lowest Port Priority of your directly connected neighbor
    - Lowest Port ID of your directly connected neighbor

    Step 3: Find your Designated Ports (There's one on every segment)
    - Lowest Cost the the Root Bridge
    - Lowest Bridge ID of your directly connected neighbors
    - Lowest Port Priority of your directly connected neighbor
    - Lowest Port ID of your directly connected neighbor

    Step 4: Block anything left over
  • Atmosphere1991Atmosphere1991 Member Posts: 29 ■□□□□□□□□□
    @late_collison
    Thank you so much omg!! My netacad text did not explain that all!!! You are the man seriously. That was so frustrating lol.
  • Jon_CiscoJon_Cisco Member Posts: 1,772 ■■■■■■■■□□
    That was a great post and cleared up a lot. Atmosphere1991 is right the Netacad pretty much skipped all of the details about how to work through the tie breakers.

    All of the answers make perfect sense now where this afternoon I was guessing.

    thanks,
    Jon
  • Jon_CiscoJon_Cisco Member Posts: 1,772 ■■■■■■■■□□
    I don't usually bump posts but I was using this for review today and it's still the best quick explanation I have come across.
    For anyone taking the Netacad Networking 3 class this post will save you hours of head scratching because they just didn't cover the information in the chapter.
  • Codeman6669Codeman6669 Member Posts: 227
    great post late_collision

    why isnt this a sticky?
  • SurfriderSurfrider Member Posts: 13 ■□□□□□□□□□
    Shame you are getting shafted on the Netacad info. That was a great post.

    I just started my CCNA book studies and I wanted to post and mention that Lammle's book covers all those points made.

    Moral of the story, do not rely on only 1 source of study material!!
Sign In or Register to comment.