The Code Project View our sponsorsClick here for Dundas Software's TCP/IP Development KitAdvertise on the CodeProject
Home >> Date / Time handling >> Unedited Reader Contributions

SNTP Client in C#
By Valer BOCAN

Implementation of the Simple Network Time Protocol (RFC 2030) in C# 
 VC7, .NET
 Posted 14 Mar 2001
Articles by this author
Send to a friend
Printer friendly version
[This is an unedited reader contribution] [Modify this article] [Delete this article]
Lounge New Articles Sign in Forums Contribute
Broken links? Email us!
21 users have rated this article. result:
4.81 out of 5.

  • Download source files - 5 Kb
  • Download demo project - 13 Kb
  • Sample Image - ntpclient.jpg

    Introduction

    Though not obvious, time synchronization is sometimes important. The best example is the Kerberos authentication protocol, which requires the resources to be synchronized within minutes or even seconds, but there are other situations as well. The Network Time Protocol (NTP) and its simplified form (SNTP) are widely used to synchronize network resources, due to their simplicity and effectiveness. There are many programs available that synchronize your PC's clock with that of a time server. Dimension 4 is my favorite.

    In case you need time synchronization embedded into your software, here is the C# alternative. It's simple, fast and integrates seamlessly with the .NET platform. There is a Java implementation of a NTP client by Michel Van den Bergh, but I don't have the URL anymore. Maybe Michel reads this and will send me a note.

    There are several time severs on the Internet and the list below contains those operated by NIST. If you need more, use a search engine.

    Name IP Address Location
    time-a.nist.gov 129.6.15.28 NIST, Gaithersburg, Maryland
    time-b.nist.gov 129.6.15.29 NIST, Gaithersburg, Maryland
    time-a.timefreq.bldrdoc.gov 132.163.4.101 NIST, Boulder, Colorado
    time-b.timefreq.bldrdoc.gov 132.163.4.102 NIST, Boulder, Colorado
    time-c.timefreq.bldrdoc.gov 132.163.4.103 NIST, Boulder, Colorado
    utcnist.colorado.edu 128.138.140.44 University of Colorado, Boulder
    time.nist.gov 192.43.244.18 NCAR, Boulder, Colorado
    time-nw.nist.gov 131.107.1.10 Microsoft, Redmond, Washington
    nist1.datum.com 209.0.72.7 Datum, San Jose, California
    nist1.dc.certifiedtime.com 216.200.93.8 Abovnet, Virginia
    nist1.nyc.certifiedtime.com 208.184.49.9 Abovnet, New York City
    nist1.sjc.certifiedtime.com 208.185.146.41 Abovnet, San Jose, California

    About Valer BOCAN

    I am currently doing graduate work to get a Ph.D. degree at the Technical University of Timisoara, Romania.

    I am employed by an obscure company in Chicago, but I live in Romania.

    If you want to contact me, write to vbocan@usa.net or - when my ISP is dear enough not to be down - write to vbocan@dataman.ro and visit www.dataman.ro

    Click here to visit Valer BOCAN's homepage.

    [Top] Sign in to vote for this article:     PoorExcellent  
    Hint: For improved responsiveness, use Internet Explorer 4 (or above) with Javascript enabled, choose 'Use DHTML' from the View dropdown and hit 'Set Options'.
     Keyword Filter
     View   Per page   Messages since
    New threadTotal Messages for this article: 0 
    Subject 
    Author 
    Date 
    -- No entries present --

    Home >> Date / Time handling >> Unedited Reader Contributions
    last updated 14 Mar 2001
    Article content copyright Valer BOCAN, 2001
    everything else © CodeProject, 1999-2001.
    The Code Project View our sponsorsGet your new domain name now!Advertise on the CodeProject