next up previous contents
Next: Security Up: Problems to be addressed Previous: Server-Database Synchronisation   Contents

Creating New User Accounts

The other problem requiring server synchronisation is the creation of a new user account. Here there is a concurrency problem, since if two users attempt to sign up for a new account at the same time on two different servers, they might be assigned the same unique identifier.

There are a number of options here. Generating an incrementatal userID is impossible as collisions due to multiple users attempting to sign up at the same time would be too likely. A better method of producing a userID would be to take some piece of semi-unique data about the user and hashing it to form a numeric userID. To make the probability of collisions as low as possible, the userID will be 64-bits in length and the user's e-mail address used as the input to the hash function. While a person's e-mail address is theoretically unique, people may not always enter their correct e-mail address and there is the possibility that two e-mail addresses will hash to the same value so collisions are still possible.

To minimise the number of collisions a good hash function is essential. Secure cryptographic hash functions were investigated[Sch96], but these were very complex and seemed a little like overkill when all was that needed was a function that produces relatively collision free results and allows for some sort of fallback if a collision does occur. A hash function that has these properties is also required for the implementation of a hash table and so an open addressing, double hash function described in [CLR90] was chosen.

However, even if there is no collision within the local database, if two (or more users) attempt to create an account at the same time, there still might be a concurrency issue within the network. A procedure to deal with this would be as follows: the server that the user is using to create the new account generates the userID and checks it does not exist in its local database; the server then contacts all the other servers it can currently reach.

There are then two options:

  1. Optimistic concurrency control[Bac97]. Create the user on each server that we contact. In the event of finding a collision, abort all the creations. This is quite hard to implement as there is no facility for deleting users (because of the security problems it would cause) and since a clash would indicate that two creation processes are in progress, who would get to use that particular ID?
  2. Pessimistic concurrency control[Bac97]. Take out a lock on each server to prevent them adding a new user. Once all the servers have been locked, create the user on all the servers. This has problems in the event of the initiating server crashing and creates a vunerability to a denial of service attack2.3.
Since optimistic concurrency control is not feasible and pessimistic control has definite problems, a better solution was required.

It was observed that if the generated ID can be guaranteed to be unique then there is no need for complex concurrency control. Therefore instead of using a hash function to generate the userID, the least significent 32 bits are taken to be the client's IP address and the most significent 32 bits are the number of seconds since Midnight 1 January 2000 UTC according to the server's clock. While the server's clock may not be accurate, the use of the IP address should prevent collisions since two clients could not be using the same IP address at the same time2.4.


next up previous contents
Next: Security Up: Problems to be addressed Previous: Server-Database Synchronisation   Contents
Nathan Dimmock 2001-06-20