%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Globally Distributed Content (Using BGP to Take Over the World)
% Paper based on work on Super Sparrow - http://superpsparrow.org/
%
% November 2000
% Copyright (C) 2000 Horms <horms@vergenet.net>
% 
% This program is free software; you can redistribute it and/or
% modify it under the terms of the GNU General Public License as
% published by the Free Software Foundation; either version 2 of the
% License, or (at your option) any later version.
% 
% This program is distributed in the hope that it will be useful, but
% WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
% General Public License for more details.
% 
% You should have received a copy of the GNU General Public License
% along with this program; if not, write to the Free Software
% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
% 02111-1307  USA
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\section {Selecting Servers}

An important component of global load balancing traffic is to determine which 
POP\footnote{POP: Point Of Presance: A host or group of hosts connected
to the Internet, usually in a single physical location.}
should handle an incoming connection. There are many criteria that
can be taken into account including: Relative Capacity of different POPs;
Relative Load of different POPs; Latency between POPs and client; Network
distance between POPs and client.

It is important that when a new connection is received, allocating the
connection to the apropiate POP is done quickly. A long and involved
process to determine which POP to allocate a connection to will, at best,
cause the connection establishment time for the client to be slow. At
worst the client may time-out.

\subsection{Load and Capacity}

Information on the relative capacity and load of different POPs may be
collected and stored locally and used to quickly determine the best site
for an incoming connection based on these criteria.  However, the
internal load of a POP doesn't necessarily correlate to its apropriateness.
An underloaded POP, 23 hops away may well provide inferior service to a more
loaded POP, 2 hops away. It is certainly not accurate to say that communicating
to all POPs is of equal cost for a given client.  This is in contrast to
load balancing over a LAN where communication to all servers can  ---
reasonably be expected to be equal.


\subsection{Network Latency}

It would seem that information about the state of the network may
provide a valuable means for determining the best POP to handle a client's
connection. A readily available network metric is ping-time, a meausre of
the round trip time for a packet from one host to another and back again.
Unfortunately, ping-times are not a good measure of network performance. It
is quite possible for a high latency link to be a high bandwidth link.
Satellite and DSL are good examples of this. It is of note that much
Internet traffic, including HTTP, SMTP, FTP and streaming media are bandwidth,
rather than latency sensitive. The usefulness of ping-times is further
compromised if asymetric routing is being used, as the ping-time will not
provide information on any differences in the forward and return trip
times.

The collection of ping-times is also problematic as having POPs ping a
client is inherently slow. It is possible to cache the results but avoiding
a delay when a client first connects is difficult.  A ping may also be
blocked by a packet filter for some reason.  If ping packets are being
blocked, at best the ping-time data will be unavailable and at worst the
ping may time-out, adding to the delay in establishing a connection for the
client.


\subsection{Network Address Allocations}

APNIC\footnote{APNIC: Asia Pacific Network Information Centre:
\tt{http://www.apnic.net/}}, ARIN\footnote{ARIN: American Registry for
Internet Numbers: \texttt{http://www.arin.net/}} and RIPE\footnote{RIPE:
R\'eseaux IP Europ\'eens: \texttt{http://www.ripe.net/}} are responsible
for, amongst other things, allocating IP addresses to network providers and
the like. If assumptions are made about the location of different providers
then it is possible to  construct a loose map of the Internet with some
creative use of the \texttt{whois} command and trawling of online
documents provided by these organisations. This map may
be used as a heuristic to determine which POP is closest to a given client. 

While simple, this method has many drawbacks. Constucting such a map is only
pratcical if POPs are on very distinct networks. Another problem is that
static maps are not adaptive to network changes and failures. It is also
true to say that such a map may not accurately reflect network topology ---
geographic locality is no gaurantee of netowrk-wise closeness. Furthermore,
to reduce the complexity and size of the map it may be neccessary to make
generalisations about networks by aggregating small allocations into one
larger allocation --- this may reduce the accuracy of the map. 

It may be possible to suplement the map by inspecting the hostname. For
instance, while a \texttt{.com} may be located anywhere, it is reasonable to
assume that a \texttt{.au} is located in Australia. However, doing a
reverse lookup on the IP addresses of connecting clients may create a
significant performance problem.

Though the approach of manually mapping the Internet is somewhat cumbersome
it is simple once set up.  No special information or services are required
from upstream providers. And the map is static, so lookups should be fast.
The map aproach certainly has its merits, but a more dynamic and automated
mechanism would be a significant improvement.

\subsection{Routing Information}

Routing information determines the path that packets will take.  This
information changes as network topology changes.  It would seem that this
may provide useful information in determining the best POP for a client.
BGP is the protocol that is used to determine routes on the Internet.  The
following section discusses how BGP works and how it may be used to find
the network-wise closest POP for a given client.
