How the host knows how to form a path:
- The host uses its known path to the
destination if it has one that is not old.
- Otherwise, the host sends a probe message.
- The probe will be forwarded by every bridge
that sees it, on every LAN to which the bridge is attached
(except the one the probe came in on).
- If the bridge sees its own id already in the
path the probe is accumulating, it will drop the probe
without forwarding (preventing a loop).
- The probe will eventually get to the
destination by every possible path, including the shortest.
- The destination will return the probe to the
sender, using the best discovered route as its source
routing path.
- The source will then send its "real" message
using the newly discovered route.
Spanning Tree Algorithm
Spanning Tree Algorithm
For a graph, G=(V,E), a spanning tree is a subgraph, T=(v,E) where T is a
tree and v are selected from V. The spanning tree connects all
the vertices of the graph.
The Dijkstra/Prim algorithm finds a minimum spanning tree by
starting at an arbitrary vertex and branching out, picking up new
vertices as it goes. Think of the vertices as partitioned into three
sets:
- Tree vertices: in the tree constructed so far
- Fringe vertices: not in the tree but adjacent to a vertex that is
in the tree
- Unseen vertices: all others
The Dijkstra/Prim algorithm constructs a minimum weight spanning tree.
In the algorithm used in Spanning Tree bridges, there is no concept of
weight. The task is somewhat simpler.
Here is the algorithm:
Select an arbitrary vertex to start the tree (the bridge with the
lowest serial number)
While there are fringe vertices do
select an edge between a tree vertex and a fringe vertex and add
the selected edge and vertex to the tree
end
We assume a connected graph. There cannot be a spanning tree if
the graph is not connected. Assuming a connected graph, the algorithm
above will find a spanning tree.
In the implementation of the spanning tree, all the bridges participate. The
bridges send messages and receive replies to determine which bridge is
the root. Once the root is identified, each bridge sends a message to
the root from each port. The root replies to each of these messages.
Each bridge determines which of its ports is "closest" to the root.