Routing
Routing Goals
-
Stability -- Each packet should experience the same latency and bandwidth.
But what if a better route is *sometimes* available.
-
Convergence -- In a static network, the algorithm should reach a final
decision.
-
Fairness -- Users should receive "fair" treatment. Often bandwidth
can be maximized by shutting out long distance users in favor if short
distance users.
-
Throughput -- Bandwidth should be maximized.
-
Quickness -- Latency should be minimized.
-
Robustness -- The network should work in the face of partial failure.
-
Cheap -- in terms of both memory and CPU speed.
When to Route
Nonadaptive routing computes all possible routes at once, and then download
them where needed (generally at night). If need be, this can be done
by a central host with a global view. But this works poorly if equipment
fails or congestion changes. Adaptive routing computes routes as
needed. This requires the computation to be very fast, and requires
routers to notice when distant parts of the network fail or become congested.
What to route
There are two choices. You can route each packet individually, or
you can route only the first packet, and have all other packets follow
the same route, called session routing. If you use session routing,
you may or may not use the same route reversed for return traffic. IP routes
independently.
Route each
-
If the network topology changes.
-
If your network should maintain connectivity despite failure.
-
If the routers will have MANY connections going through them at one time,
and cannot easily remember them all.
-
If you need lots of datagrams, and few reliable streams.
Session Routing
-
If each exchange will involve many packets
-
If routers become CPU bound.
-
If you need to make bandwidth reservations.
-
Want repeatable latencies and bandwidths
Where to route
Again there are two choices. You can have each source do the entire
routing, or have each router make there "next hop" decision.
Source routing
-
Requires very smart hosts!!!
-
Relieves routers of work
Next Hop routing
-
Requires each router to have a non-conflicting idea of "next hop".
-
Allows for dumb hosts
Routing Algorithms
Cost Functions
All of the routing functions are going to look at the network as a graph,
with each host a vertex and each link an edge. They will then try
and minimize the "cost" of a route. But what is "cost".
-
Minimize latency (great for an HTTP or FTP request)
-
Maximize bandwidth (great for an FTP or HTTP download)
-
Minimize telco payments (eek!!)
-
Maximize reliability
-
Minimize physical distance.
-
Minimize time needed to send a sample test packet.
-
Minimize number of hops (This tends to achieve the rest, but a T1 and a
modem are not really the same thing, even if each is just one "hop").
Optimality Principal
A route between A and B is optimal only if for every host Q on that route
the routes A -> Q and Q -> B are optimal.
Shortest Path
demo applet
Djikstra's Algorithm set to music.
For each node
Set PATH to "", DIST to inf, and STATE to "temporary".
Set the source node DIST to 0.
While (1)
Call the temporary node with the minimum DIST A.
if A is the destination, exit with success
For every link L from A, and the node at the end
of that link N
If (A.DIST+ distance(A,N)
< N.DIST)
N.DIST = A.DIST + distance(A, N)
N.PATH = A
A.STATE = "permenant"
Note on shortest path.
If the length of the path is L, and the fanout is F, the runtime
cost is about L^F
Often it is quicker to search from both ends at the same time.
If ever there is a set of permenent nodes connecting the source and dest,
the shortest path can be found. The runtime cost can be 2*(L/2)^F.
The computation can be distributed, with each node simply querrying
the neighbors. This takes rounds equal to the diameter of the network.
Flooding
The algorithm is simple. Send every incoming packet out every link,
yet find a way to avoid infinity. If a packet can be deliviered,
it will (probably multiple times. This is seriously costly in terms
of wasted bandwidth, but sometimes that's OK (nuclear power plants, aircraft
control systems, etc). Interestingly, since it chooses every path,
it also chooses the shortest path and therefore minimizes latency.
How to stop duplicated circulating forever. 1) Put a hopcount
on each packet (start at the diameter of the network or so). 2) Have
each node keep track, and only forward each packet exactly one time.
Flow Based Routing
Assume you have a known set of links and known stable traffic. Put
everything into a matrix, and optimize the global cost function (which
unless carefully chosen might cause some traffic to see infinite delays).
Note that the algorithms above only optimize the local cost functions.
Also note that either there is central decision maker with all the data,
or that data is replicated to every router. Compare to flooding which
requires no data at each node, or to shortest path which requires each
node to only know about it's immediate neighbors.
How to do the math: First, note that this can be done off-line.
However, this is an NP-complete problem. However, it is entirely
possible to try every choice for small nets, and to use VERY good heuristics
for large nets. You should get 95% or more of the possible with even
simple heuristics.
Distance Vector
This was used until 1979 by the ARPANET. Have each router keep, for
every other router, a tuple (distance, outgoing-line). Once every
so often, adjacent routers exchange tables. Further, assume that
each router knowns the cost to reach adjacent routers (ping packets, etc).
Suppose A learns that B can get to C in m milliseconds. If m plus
the time from A to B is less that the previous entry A had to reach C,
then update the entry for A -> C with this smaller time, and set the outgoing
line from A to B.
This is guarenteed to converge to the same answer that shortest-path
did, and do so in time equal to the diameter of the network.
But this can result in a count by ones to infinity, if a link fails.
There is no known solution(!!!), just hacks that help sometimes.
For example, split-horizon. If the best path from A to C goes thru
B, then A tells B the distance to C is infinite. This often works,
but on some networks does not. If C -> D goes down this network counts
to infinity.
Link State Routing
This is growing in popularity. OSPF, and Novell Netware. When
finished, every routers has for every other router a 'shortest path'.
Also note that it uses flooding internally. Question: How many
packets does this algorithm have to send to stabalize? How big are
the run-time memory requirements.
There are five basic steps.
Discover Neighbors, generally by sending a special 'hello'
packet and seeing who responds.
Measure Line Costs, often by either using the known line bandwidth
or by measuring a 'ping time'. But any line cost including queuing
delay, like ping time, can cause wild routing fluxuations, as large groups
of routers aim traffic at links that were congestion free and therefore
low cost.
Build Link State Packets, generally containing for each link
the cost. The whole packet should have an 'age' field.
Distribute Packets. Note that if some routers have new
data and others old data, routing error can occure. Generally, the
packets are flooded thru the network. All data from packets that
are to old are discarded, and such links are unusable.
Compute Routes. All routers now know the complete state
of the net. If they all use the same algorithm to compute routes
(shortest path?) then they will all use the same, correct routes.
Heirarchical Routing
What the internet as a whole actually does.
The internet is divided into 'autonomus zones', each one of which is
responsible for it's own routing problems. Outsiders don't know the
internal structure of each zone, but only how to reach a single contact
point with in the zone. For example,
My House sends all outside traffic to nmu.edu
NMU sends all external traffic to the merit router in cohodas.
Merit sends all external traffic to MCI.
MCI sends all external traffic to one of three to ten or so 'interchange
points' to reach ATT.
ATT knows how to send it to AOL.COM
AOL knows how to get it to their particular host used for IMing.
The cost is that path length is no longer minimal. Routes might be
possible but unused because they don't corespond to the administarive setup.
BUT no router is overburdened with too much knowledge, and so the system
does work.
Routing for Mobile Hosts
There is no internet standard for this. In fact, there are yet no
good ways to do this. Here's two approaches.
Compatable with Internet standard software:
For each mobile host, have a fixed 'home'.
For all possible networks you might connect to, have some free addresses
for mobile hosts (dhcp??).
Every time the mobile host moves, it must contact the 'home', including
verification information (which better be timestamped). From then
on the home will forward all packets.
Problems: Packets (both to and fro) take stupid routes, no one
can connect to a mobile host until the mobile host announces it's location.
Incompatable with Internet standard software:
For each mobile host, have a 'home' and register with it as before.
This time, when a connection arrives at the home station, have
it send a redirect packet the sender, telling that sender how to reach
the new location.
Problems: TCP/IP doesn't have a redirect packet. How
do you verify a redirect packet in an anonymous internet?
Links
Map of the internets.
Another map of the internet.
Old NSF backbone map.
Internet map.
Ocean cables.
Picture of growth of the internet.
Internet exchange point.
Indiana Gigapop.
Tier one networks
Peering
Braess's Paradox.
Hubble project.