5,695,118 members and growing! (15,334 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, C++, Windows, .NET, .NET 1.0VS.NET2002, Visual Studio, Dev

Posted: 13 Mar 2001
Updated: 27 Aug 2001
Views: 114,938
Bookmarked: 58 times
Announcements
Loading...



Search    
Advanced Search
Sitemap
55 votes for this Article.
Popularity: 8.14 Rating: 4.68 out of 5
0 votes, 0.0%
1
1 vote, 4.0%
2
0 votes, 0.0%
3
3 votes, 12.0%
4
21 votes, 84.0%
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


    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
    Sign Up to vote for this article
    You must Sign In to use this message board.
    FAQ FAQ Noise ToleranceSearch Search Messages 
     Layout  Per page   
     Msgs 1 to 25 of 38 (Total in Forum: 38) (Refresh)FirstPrevNext
    Generalhangs if no ipmemberwihe200820:27 18 Jul '08  
    GeneralRe: hangs if no ipmemberwihe200820:31 18 Jul '08  
    GeneralRe: hangs if no ipmemberwihe200821:55 18 Jul '08  
    Generalcommercial usememberharmjonker7:19 14 Jul '08  
    GeneralRe: commercial usememberValer BOCAN23:47 14 Jul '08  
    QuestionDaylight Time savingmemberXadhoomGrglblstr23:47 6 Apr '08  
    AnswerRe: Daylight Time saving [modified]memberGeoff Low (NZ)16:56 5 Jun '08  
    GeneralThe program blockmemberNanakiFire4:34 2 Apr '08  
    GeneralNTP in Compact FrameworkmemberIowaEric6:56 8 Jun '07  
    GeneralRe: NTP in Compact FrameworkmemberIowaEric16:51 24 Oct '07  
    GeneralNIce articlememberVikas Salvi3:21 3 Mar '07  
    AnswerRe: NIce articlememberNetDave7:48 25 Apr '07  
    GeneralExecution on Pocket PC EmulatormemberRashmi C2:16 13 Dec '06  
    GeneralGet Server timemembertry.kret18:14 8 Oct '06  
    AnswerRe: Get Server timememberValer BOCAN18:23 8 Oct '06  
    GeneralRe: Get Server timemembertry.kret18:49 8 Oct '06  
    GeneralRe: Get Server timemembertry.kret16:32 9 Oct '06  
    QuestionUrgent:- Implementation of the Network Time protocol (RFC 13905) in C++memberKulkarni Abhijit1:49 27 Jul '06  
    GeneralThanks!!memberMicah Wedemeyer5:24 23 Dec '05  
    GeneralUsing IP addresses rather than hostnamesmemberMrEyes6:46 27 May '05  
    GeneralNeed urgent HelpmemberPShweta0:59 7 Oct '04  
    GeneralRe: Need urgent HelpmemberValer BOCAN1:53 7 Oct '04  
    Generalminor bug : Peer clock precision calculationmemberEzekielDA12:40 10 Jun '04  
    GeneralRe: minor bug : Peer clock precision calculationmemberValer BOCAN7:02 14 Jun '04  
    GeneralDoesn't Run on WinXP Promembersandman_max3:36 4 May '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-2008
    Web18 | Advertise on the Code Project