top | item 39976226

(no title)

jbernsteiniv | 1 year ago

I feel like STP is basically magic when you first learn it in a course (usually sponsored by Cisco) but the illusion is broken when you learn computer science principles like a graph data structure and how to build an acyclic graph.

STP handles this through sending little messages with every node receiving the message appending themselves after whoever sent it. Then a node just checks if it sees itself in the message. If I DO see myself in the chain, I know now I need to not send information to the previous node that sent me the message.

The message just needs to be something that'll never succeed but flow through the network. If I have three nodes labeled "A", "B", and "C" then I could send a message intended for "D" (which does not exist in my network). A has a path to B and A has a path to C. B has a path to C and vice versa. Each node can talk to another.

A send to B. B checks if its in the chain and if not, it appends itself in the chain. A -> B. B knows it received the message from A so it will ignore this connection and send the message to all of its neighbors. C receives the message from B. C checks if its in the chain and if not, it appends itself in the chain. A > B -> C. C got the message from B so it ignores this path and sends the message to all of its other neighbors (in this case, A).

A receives the message and checks if its in the chain (it is). A knows it received the message from C. A now knows that a cycle has been detected, so A disables its connection to C.

Congrats! You've designed a tree! Its a graph that contains no cycles. All we had to do was send a message and check if we see ourselves in the chain. If we do, we disable our path to the last node that sent us a message.

Of course STP gets more complicated from here as we factor in path costs as weights to measure the decision to axe a connection. Maybe A -> B is a 1G connection and A -> C is a 10G connection, in this case A may disable the path to B.

I do agree that reducing reconvergence time is magic. I don't understand that one.

discuss

order

No comments yet.