Project 2: Clock Synchronization

Start date 15 February, Due beginning of class March 1.

Implement an NTP Client.

Basic solution: Three points

Write a program that takes an NTP server IP address as input, queries that server for the time, and returns the current time based on the query from the NTP server (i.e., you should correct for message delay as best as possible.) Up to three points for a correct, documented, and tested solution.

Advanced: Fault tolerant multi-server (one point)

Augment the above program to take a list of up to four servers. Query the servers, and ignore any with obviously bad time (remember that you can use the information in the message to compute a range for possible ``real time'' for each server.) Average the rest to obtain the time to report.

Advanced: Class Library (one point)

Build a class library that supports the following:

Note that get_time should return quickly - it must not hold things up while it queries servers.

Pointers to helpful information

You will find pointers to documentation at ntp.org. I'm sure you can find everything up to completed NTP clients on the web. You are free to use documentation, and even header files that contain structures for NTP messages. If you find something helpful, feel free to share it with me - I'll share it with the class if appropriate.

Some suggested NTP servers for testing (a full list is available at ntp.org:

gilbreth.ecn.purdue.edu, molecule.ecn.purdue.edu, harbor.ecn.purdue.edu

Public use stratum 2 servers

darkcity.cerias.purdue.edu

Public use stratum 1 server. Use this, or any other stratum 1 server, only after you are sure your system is working, and then very sparingly.

jackstraw.cs.purdue.edu

Server that seems to be giving a bad time.

Part of the learning experience is for you to learn how to find existing solutions to problems that you can reuse. So don't feel like you have to do everything from reading only the NTP specification / RFC. Please talk with me if you have any questions about how much reuse is too much.

Turning in files

While email is accepted, the turnin command is preferred (e.g., turnin -c cs603 directoryname).


Valid XHTML 1.1!