Super Sparrow: Global Load Balancing Solution for Linux [Sparrow]
| English | Japanese || Main | Code | Installation | Configuration | Paper | Contacts |

Sample Configuration

Network Topology

Network Diagram

As an example setup involving three Networks A, B and C and two Points Of Presence, POPs X and Y. Each Network and POP has a single router, a Linux box acting as a router running either GNU Zebra or Gated. Networks A and B each have an additional Linux box running as DNS servers. For the purposes of this discussion a router is used to refer to a Linux Box that communicates routes using BGP. These hosts may also run other software as permitted by the versatility of Linux.

192.168.198/23 is considered to be part of Network B, although the Network A and B routers have interfaces in this network. 192.168.192/24 is considered to be part of Network A and the POP X router has an interface in this network. Similarly 192.168.193/24 is considered to be part of Network C and the POP Y router has an interface in this network. All addresses are inside 192.168/16 a network reserved for private use as per RFC 1918.

Both Networks A and C are directly connected to Network B. There is no direct link between Networks A and C. POP X is directly connected to Network A. POP Y is directly connected to Network C. All the directly connected Networks and POPs have BGP sessions running between their routers. There is also a multi-hop BGP session running between POP X and POP Y. The AS numbers for Networks A, B and C are 64600, 64601 and 64602 respectively. POP X and Y have 64700 and 64701 as their AS numbers. All AS numbers have been chosen from the range 64512 to 65535 which are reserved for private use as per RFC 1930.

mod_supersparrow with Dents

The Network A and B DNS servers run ISC BIND and are authorative for the fictitious top level domain supersparrow. These DNS servers delegate the test.supersparrow domain to the Routers in POP X and Y which are running Dents with mod_supersparrow.

mod_supersparrow with Dents: Configuration

mod_supersparrow with Dents: Testing

For testing purposes the Network A and C DNS servers will be used as clients. Both of these hosts should be set to use themselves for DNS lookups by using the following /etc/resolv.conf.

search apache-test.supersparrow
nameserver 0.0.0.0

Using nslookup it is possible to verify that the IP address of the POP Y router is returned when a query for www.test.supersparrow is made.

$ nslookup www.test.supersparrow
Server:  stenchie.supersparrow
Address:  0.0.0.0

Non-authoritative answer:
Name:    www.test.supersparrow
Address:  192.168.193.11

The same test run on a client in Network A should yield the address of the POP X router. The Network A DNS server is used for this test:

$ nslookup www.test.supersparrow
Server:  sarah.supersparrow
Address:  0.0.0.0

Non-authoritative answer:
Name:    www.test.supersparrow
Address:  192.168.192.13

The following HTML was placed in supersparrow_test.shtml in the document root for Apache running on the POP X and Y routers. The page makes use of server-parsed HTML, as provided by mod_include to display the server name of the host serving the page.

<html>
<head> <title>Super Sparrow Test Page</title> </head>

<body bgcolor="#ffffff" text="#000030" link="#023266" vlink="#326296"
  alink="#326296" >

<h1>Super Sparrow Test Page</h1>

<p>
  This page is for testing of Super Sparrow, and was served by the
  host named below:
  
<p> 
  [ <tt><!--#echo var="SERVER_NAME" --></tt> ]

<p>
  For more information please see 
  <a href="http://www.supersparrow.org/">
  http://www.supersparrow.org/</a>

</body>
</html>

Using lynx on the Client in Network C (the Network C DNS Server), an HTTP request can be made. Observe that the result comes from roger.test.supersparrow. Thus the request is handled by POP Y, by inspection of the Network Diagram this is the network-wise closest POP to Network C and, hence, the client.

$ lynx -dump http://www.test.supersparrow/supersparrow_test.shtml

                            Super Sparrow Test Page
                                       
   This page is for testing of Super Sparrow, and was served by the host
   named below:
   
   [ roger.test.supersparrow ]
   
   For more information please see
   [1]http://www.supersparrow.org/

References

   1. http://www.supersparrow.org/

nslookup may be used to verify that the address of roger.test.supersparrow is from POP X.

nslookup roger.test.supersparrow                                      
Server:  stenchie.supersparrow
Address:  192.168.193.16

Non-authoritative answer:
Name:    roger.test.supersparrow
Address:  192.168.193.11

Running a the same test from a client in Network A should yield the same page, served by jasmine.test.supersparrow, the POP Y router. For details of failure characteristics of this setup and the possible path that responses can take please see Dents Driver Module: mod_supersparrow.

mod_supersparrow with Dents: Files

For reference a full set of configuration files are provided.







supersparrow with Apache and Apache's mod_rewrite

The example setup above uses Dents and mod_supersparrow to communicate the best available POP to a client. It is possible to use the standalone supersarrow programme to integrate Supersparrow Sparrow with other applications. An example of this is to use supersparrow and Apache's mod_rewrite to tie Super Sparrow directly into Apache. The really nice thing about this approach is that is enables a much finer granularity on what will be handled by Super Sparrow. The DNS based approach using Dents allows granularity down to a single hostname, whereas mod_rewrite will allow granularity down to any specific URL.

supersparrow with Apache and Apache's mod_rewrite: Configuration

supersparrow with Apache and Apache's mod_rewrite: Testing

For testing purposes the Network A and C DNS servers will be used as clients. Both of these hosts should be set to use themselves for DNS lookups by using the following /etc/resolv.conf.

search apache-test.supersparrow
nameserver 0.0.0.0

The following HTML was placed in supersparrow_test.shtml in the document root for Apache running on the POP X and Y routers. The page makes use of server-parsed HTML, as provided by mod_include to display the server name of the host serving the page.

<html>
<head> <title>Super Sparrow Test Page</title> </head>

<body bgcolor="#ffffff" text="#000030" link="#023266" vlink="#326296"
  alink="#326296" >

<h1>Super Sparrow Test Page</h1>

<p>
  This page is for testing of Super Sparrow, and was served by the
  host named below:
  
<p> 
  [ <tt><!--#echo var="SERVER_NAME" --></tt> ]

<p>
  For more information please see 
  <a href="http://www.supersparrow.org/">
  http://www.supersparrow.org/</a>

</body>
</html>

Using lynx on the Client in Network A (the Network A DNS Server), an HTTP request can be made. Observe that the result comes from www.x.apache-test.supersparrow. Thus the request is handled by POP X, by inspection of the Network Diagram this is the network-wise closest POP to Network A and, hence, the client.

$ lynx -dump http://www.apache-test.supersparrow/supersparrow_test.shtml

                            Super Sparrow Test Page
                                       
   This page is for testing of Super Sparrow, and was served by the host
   named below:
   
   [ www.x.apache-test.supersparrow ]
   
   For more information please see
   [1]http://www.supersparrow.org/

References

   1. http://www.supersparrow.org/

A slight delay in processing the request is caused by lynx, and not the Apache server. lynx pauses momentarily if an HTTP redirect is received. Running a the same test from a client in Network C should yield the same page, served by www.y.apache-test.supersparrow. For details of failure characteristics of this setup and the possible path that responses can take please see Using supersparrow with Apache.

supersparrow with Apache and Apache's mod_rewrite: Files

For reference a full set of configuration files are provided.

References

Please see references.

Notes on Commands

Commands shown in paragraphs of preformated text are prefixed by the shell prompt $ to avoid confusion between commands and their output. An instruction to run the command echo flim is formated as:
$ echo flim
flim



Copyright © 2000 Horms

Last Updated: Tue May 17 17:37:17 2005