Click here to Skip to main content
6,295,667 members and growing! (12,000 online)
Email Password   helpLost your password?
General Programming » Internet / Network » General     Intermediate

SNTP Client in C#

By Valer BOCAN

Implementation of the Simple Network Time Protocol (RFC 2030) in C#
C#, VC7, Windows, .NET 1.0, Dev
Posted:13 Mar 2001
Updated:27 Aug 2001
Views:127,411
Bookmarked:64 times
Announcements
Loading...
 
Search    
Advanced Search
printPrint   Broken Article?Report       add Share
  Discuss Discuss   Recommend Article Email
58 votes for this article.
Popularity: 8.24 Rating: 4.68 out of 5

1
1 vote, 3.6%
2

3
4 votes, 14.3%
4
23 votes, 82.1%
5
  • Download source files - 12 Kb
  • Download demo project - 5 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

  • License

    This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

    A list of licenses authors might use can be found here

    About the Author

    Valer BOCAN


    Member
    I am currently doing graduate work to get a Ph.D. degree at the Technical University of Timisoara, Romania.
    Occupation: Web Developer
    Location: Romania Romania

    Other popular Internet / Network articles:

    Article Top
    You must Sign In to use this message board.
    FAQ FAQ 
     
    Noise Tolerance  Layout  Per page   
     Msgs 1 to 25 of 41 (Total in Forum: 41) (Refresh)FirstPrevNext
    Generalthanx PinmemberMurat DOGANCAY3:55 21 Feb '09  
    Generalhangs if no ip Pinmemberwihe200820:27 18 Jul '08  
    GeneralRe: hangs if no ip Pinmemberwihe200820:31 18 Jul '08  
    GeneralRe: hangs if no ip Pinmemberwihe200821:55 18 Jul '08  
    Generalcommercial use Pinmemberharmjonker7:19 14 Jul '08  
    GeneralRe: commercial use PinmemberValer BOCAN23:47 14 Jul '08  
    QuestionDaylight Time saving PinmemberXadhoomGrglblstr23:47 6 Apr '08  
    AnswerRe: Daylight Time saving [modified] PinmemberGeoff Low (NZ)16:56 5 Jun '08  
    GeneralThe program block PinmemberNanakiFire4:34 2 Apr '08  
    GeneralNTP in Compact Framework PinmemberIowaEric6:56 8 Jun '07  
    GeneralRe: NTP in Compact Framework PinmemberIowaEric16:51 24 Oct '07  
    GeneralNIce article PinmemberVikas Salvi3:21 3 Mar '07  
    AnswerRe: NIce article PinmemberNetDave7:48 25 Apr '07  
    GeneralExecution on Pocket PC Emulator PinmemberRashmi C2:16 13 Dec '06  
    GeneralGet Server time Pinmembertry.kret18:14 8 Oct '06  
    AnswerRe: Get Server time PinmemberValer BOCAN18:23 8 Oct '06  
    GeneralRe: Get Server time Pinmembertry.kret18:49 8 Oct '06  
    GeneralRe: Get Server time Pinmembertry.kret16:32 9 Oct '06  
    QuestionUrgent:- Implementation of the Network Time protocol (RFC 13905) in C++ PinmemberKulkarni Abhijit1:49 27 Jul '06  
    GeneralThanks!! PinmemberMicah Wedemeyer5:24 23 Dec '05  
    GeneralUsing IP addresses rather than hostnames PinmemberMrEyes6:46 27 May '05  
    GeneralNeed urgent Help PinmemberPShweta0:59 7 Oct '04  
    GeneralRe: Need urgent Help PinmemberValer BOCAN1:53 7 Oct '04  
    Generalminor bug : Peer clock precision calculation PinmemberEzekielDA12:40 10 Jun '04  
    GeneralRe: minor bug : Peer clock precision calculation PinmemberValer BOCAN7:02 14 Jun '04  

    General General    News News    Question Question    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

    PermaLink | Privacy | Terms of Use
    Last Updated: 27 Aug 2001
    Editor: Chris Maunder
    Copyright 2001 by Valer BOCAN
    Everything else Copyright © CodeProject, 1999-2009
    Web12 | Advertise on the Code Project