Outline: Routing



Routing Problem

Give each switch the information needed to reach any host.

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.



Distance Vector

Have each switch tell you how far it is from every host it knows about. If a neighbor has a shorter path to a host than I do, I will route packets or circuits to that host through that neighbor. In case of ties, I pick one at random.

Notes:


Some of the responses to the exercise looked a lot like distance vector.





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.



Distance Vector example

Switch W starts with the following table:
Host Distance Port
A 1 1
B 1 4
X 1 2
Y 1 3

Notes:


Switch W knows distance 1 to these hosts because it is directly connected.



DV Step 2

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

Notes:


Switch W receives messages from X saying it is distance 1 from F, E, Y, and from Y saying it is distance 1 from X, C, Z. Since the new distance to X and Y would be greater than 1 (by the two messages from Y and X), these are ignored, the rest are added.



DV Step 3

Host Distance Port
... ... ...
E 2 2
F 2 2
C 2 3
Z 2 3
D 3 3

Notes:


Switch W receives message from X saying it is distance 1 from F, E, Y, distance 2 from Z. Also message from Y saying it is distance 1 from X, C, Z, distance 2 from D.



Link-State Routing

Have each switch in the network broadcast the state of its links. Merge the pieces of the puzzle to create a map of the entire network. Broadcast the information again whenever the state of a link changes.

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.



Link-State -- Distance Vector

LS routing allows the exchange of much more precise information than DV does (DV exchanges a single "distance" metric).

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.



Link-State Step 1



Link-State Step 2



Link-State Step 3



Broadcasting:Flooding Algorithm

  1. Keep track of all packets received
  2. On receipt of a packet from port i:



More Practical Flooding

Each sender numbers all broadcast packets sequentially. Then, each switch only needs to remember the most recent sequence number from each host.

This only works if there is no danger of re-ordering.



Another Flooding Algorithm

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.


Notes:


Talk about spanning trees, about how they are not unique, but with the graph info provided by Link-State you can compute one and if everyone is using the same algorithm and the same LS information, the broadcast should reach everyone.



Summary

Routing allows us to either forward a datagram, establish a (virtual) connection, or source-route data.

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.