next up previous contents
Next: Remote Administration Interfaces Up: Server Classes Previous: Server Classes   Contents

GossipServer

This class has two main methods. The constructor initialises the server by reading the configuration file, instantiating the UserDatabase and ServerMeasure classes and setting up a connection to a known server. The run() method consists solely of an infinite loop that listens for new incoming connections and then spawns a new thread to handle the new connection. When a connection is dropped, the thread asks ServerMeasure to recalculate the minimum spanning tree and tell it which new connections it should form.

In addition to the main program, a server also requires a binary executable TCPechod which is run by the server at startup on a specified port to allow other servers to measure the RTT between them and this server. TCPechod is just an implementation of the TCP ECHO server code from [CS96].

One of the biggest problems encountered while writing the server was how to detect the difference between server failure and network link failure. In the latter case, the instant messaging server network becomes partitioned: both sides think the other side has gone down and in the first implementation, never attempt to reconnect to each other.

One solution to the partitioning problem would be to not delete a server that has gone down straight away, but instead continue to try to reconnect at increasing3.2 intervals, only giving up and deleting the server after a fixed number of retries. While this system works well for short interruptions in network connectivity, loss of network connectivity is expected to be a much less frequent occurrence than a host simply going down, so the server is retaining unnecessary state and making many unnecessary retries. The other problem is that a network connectivity interruption may not be short. For example, the recent air conditioning and power supply work in the Cambridge Computing Service machine room resulted in loss of connectivity to JANET (and therefore the Internet) for an entire day. When the connectivity is restored, ideally the server should be reconnected to the main network as soon as possible, but in this system it might be several hours before the server tries again.

A better solution would therefore be to allow the owner of the server to manually instruct the server to attempt to connect to one or more specified servers. This is a less effective solution for short interruptions since the restoration of service is not automatic, but since any loss of network connectivity is likely to be a fairly big event, it should not be too much of a problem (especially if the server can be monitored and controlled remotely, say via a web browser).


next up previous contents
Next: Remote Administration Interfaces Up: Server Classes Previous: Server Classes   Contents
Nathan Dimmock 2001-06-20