📄 ntp.html
字号:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html><head> <title></title> <link rel="stylesheet" media="screen" type="text/css" href="./style.css" /> <link rel="stylesheet" media="screen" type="text/css" href="./design.css" /> <link rel="stylesheet" media="print" type="text/css" href="./print.css" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /></head><body><a href=start.html>start</a></br><div class="toc"><div class="tocheader toctoggle" id="toc__header">Table of Contents</div><div id="toc__inside"><ul class="toc"><li class="level1"><div class="li"><span class="li"><a href="#network_time_protocol" class="toc">Network Time Protocol</a></span></div><ul class="toc"><li class="level2"><div class="li"><span class="li"><a href="#what_is_ntp" class="toc">What is NTP?</a></span></div></li><li class="level2"><div class="li"><span class="li"><a href="#ntp_on_uclinux" class="toc">NTP on uClinux</a></span></div></li><li class="level2"><div class="li"><span class="li"><a href="#more_information" class="toc">More Information</a></span></div></li></ul></li></ul></div></div><h1><a name="network_time_protocol" id="network_time_protocol">Network Time Protocol</a></h1><div class="level1"></div><!-- SECTION [1-37] --><h2><a name="what_is_ntp" id="what_is_ntp">What is NTP?</a></h2><div class="level2"><p>The purpose of NTP is to synchronize the clocks of computers on a network. According to the <a href="http://ntp.org" class="urlextern" title="http://ntp.org" rel="nofollow"> NTP.org website</a>, “NTP is a protocol designed to synchronize the clocks of computers over a network. NTP version 3 is an internet draft standard, formalized in <a href="http://www.faqs.org/rfcs/rfc1305.html" class="urlextern" title="http://www.faqs.org/rfcs/rfc1305.html" rel="nofollow">RFC 1305</a>. NTP version 4 is a significant revision of the NTP standard, and is the current development version, but has not been formalized in an RFC. Simple NTP (SNTP) version 4 is described in <a href="http://www.faqs.org/rfcs/rfc2030.html" class="urlextern" title="http://www.faqs.org/rfcs/rfc2030.html" rel="nofollow">RFC 2030</a>.” </p></div><!-- SECTION [38-624] --><h2><a name="ntp_on_uclinux" id="ntp_on_uclinux">NTP on uClinux</a></h2><div class="level2"><p>The NTP programs you want to use need to be compiled and loaded on the target (e.g., if you get <code><strong>ntpdate: not found</strong></code> in uClinux running on the target). To use <code><strong>ntpdate</strong></code> you would need to first select <em><strong>Kernel/Library/Defaults Selection → Custom Vendor/User Settings</strong></em> when you run <code><strong>make menuconfig</strong></code> for the uClinux distro. To build <code><strong>ntpdate</strong></code>, you then select <em><strong>Network Applications→ntpdate</strong></em>. Once you run <code><strong>make</strong></code> and finish loading/booting the new image, you should be able to use <code><strong>ntpdate</strong></code>.</p><p>To test NTP, we will use the <a href="date.html" class="wikilink1" title="date.html">date</a> command. In order for <code><strong>date</strong></code> to get the correct timezone, we need to compile uClibc to support timezones (otherwise, the timezone will always be <a href="http://en.wikipedia.org/wiki/UTC" class="interwiki iw_wp" title="http://en.wikipedia.org/wiki/UTC">UTC</a>); and you should also rebuild the applications affected by the change (e.g., <strong>busybox</strong> and <strong>ntp</strong>).</p><p> <strong>date</strong><strong>dhcpcd &</strong><strong>ntpdate time.nist.gov</strong><strong>date</strong></p></div><!-- SECTION [625-1859] --><h2><a name="more_information" id="more_information">More Information</a></h2><div class="level2"><p><a href="http://www.eecis.udel.edu/~mills/ntp/html/index.html" class="urlextern" title="http://www.eecis.udel.edu/~mills/ntp/html/index.html" rel="nofollow">Implementation documentation</a> is provided by Dr. David Mills at the University of Delaware. The <a href="http://www.eecis.udel.edu/~mills/ntp/html/copyright.html" class="urlextern" title="http://www.eecis.udel.edu/~mills/ntp/html/copyright.html" rel="nofollow"> copyright</a> for NTP is also provided on his site.</p></div><h4><a name="client" id="client">Client</a></h4><div class="level4"><ul><li class="level1"><div class="li"><a href="http://www.eecis.udel.edu/~mills/ntp/html/ntpdate.html" class="urlextern" title="http://www.eecis.udel.edu/~mills/ntp/html/ntpdate.html" rel="nofollow"> ntpdate </a> - sets local date and time using NTP (e.g., ntpdate time.nist.gov)</div></li><li class="level1"><div class="li"><a href="http://www.eecis.udel.edu/~mills/ntp/html/ntptrace.html" class="urlextern" title="http://www.eecis.udel.edu/~mills/ntp/html/ntptrace.html" rel="nofollow"> ntptrace </a> - trace a chain of NTP servers to original source</div></li><li class="level1"><div class="li"><a href="http://www.eecis.udel.edu/~mills/ntp/html/ntpdc.html" class="urlextern" title="http://www.eecis.udel.edu/~mills/ntp/html/ntpdc.html" rel="nofollow"> ntpdc </a> - special program to query ntpd about current state and changes</div></li><li class="level1"><div class="li"><a href="http://www.eecis.udel.edu/~mills/ntp/html/ntpq.html" class="urlextern" title="http://www.eecis.udel.edu/~mills/ntp/html/ntpq.html" rel="nofollow"> ntpq </a> - standard program to query ntpd about current state and changes</div></li><li class="level1"><div class="li"><a href="http://www.eecis.udel.edu/~mills/ntp/html/ntptime.html" class="urlextern" title="http://www.eecis.udel.edu/~mills/ntp/html/ntptime.html" rel="nofollow"> ntptime </a> - reads precision-time kernel time variables</div></li><li class="level1"><div class="li"><a href="http://www.eecis.udel.edu/~mills/ntp/html/tickadj.html" class="urlextern" title="http://www.eecis.udel.edu/~mills/ntp/html/tickadj.html" rel="nofollow"> tickadj </a> - sets precision-time kernel time variables</div></li></ul></div><h4><a name="server" id="server">Server</a></h4><div class="level4"><ul><li class="level1"><div class="li"><a href="http://www.eecis.udel.edu/~mills/ntp/html/ntpd.html" class="urlextern" title="http://www.eecis.udel.edu/~mills/ntp/html/ntpd.html" rel="nofollow"> ntpd </a> - NTP operating system daemon</div></li><li class="level1"><div class="li"><a href="http://www.eecis.udel.edu/~mills/ntp/html/keygen.html" class="urlextern" title="http://www.eecis.udel.edu/~mills/ntp/html/keygen.html" rel="nofollow"> keygen </a> - generate public and private keys for the NTPv4 authentication and identification schemes </div></li><li class="level1"><div class="li"><a href="http://www.eecis.udel.edu/~mills/ntp/html/ntpdsim.html" class="urlextern" title="http://www.eecis.udel.edu/~mills/ntp/html/ntpdsim.html" rel="nofollow"> ntpdsim </a> - ntpd simulator </div></li></ul></div><!-- SECTION [1860-] --></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -