In general, each switch needs to know which port to forward the information on, or which port to set up a virtual channel on.
Some routing algorithms (e.g. link-state) give each switch or host enough information to do source routing.
Possible exercise: build an in-class network (using masking tape), distribute messages (paper slips), build routing tables. Route a message through from one end to the other.
Host | Distance | Port |
A | 1 | 1 |
B | 1 | 4 |
X | 1 | 2 |
Y | 1 | 3 |
Host | Distance | Port |
A | 1 | 1 |
B | 1 | 4 |
X | 1 | 2 |
Y | 1 | 3 |
E | 2 | 2 |
F | 2 | 2 |
C | 2 | 3 |
Z | 2 | 3 |
Host | Distance | Port |
... | ... | ... |
E | 2 | 2 |
F | 2 | 2 |
C | 2 | 3 |
Z | 2 | 3 |
D | 3 | 3 |
Variant: have each neighbor give you its map of the network. Merge it in with your own map. In case of conflicts, use some metric (such as "time-since-creation-of-information") to decide whether to use your or your neighbor's information.
LS must exchange more information overall, and each host must compute a route based on the resulting topology information. With DV, computation of the route is automatic.
LS requires some notion of the "age" of information. A reliable DV also needs a way to make information obsolete.
This only works if there is no danger of re-ordering.
If you have Link-State information, and if all switches are running the same algorithm, you can build a spanning tree back to the sender of a broadcast message. Then, only forward the message to the nodes that are "below" you on this spanning tree.
This algorithm doesn't need sequence numbers or anything other than the source address.
Routing is based on a metric for each link, and a distributed computation of reachability information.
For link-state routing, this computation requires a broadcast of link information from each switch. Broadcast over packet-switched networks can also be useful for Address Resolution (ARP/RARP), multicast, etc.