Sync usage with man page.
[netbsd-mini2440.git] / dist / ntp / html / ntpdsim_new.html
blob7954c7c3c70ff22980f073b1e8560ff9fad4df41
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
3 <html>
5 <head>
6 <meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
7 <meta name="generator" content="HTML Tidy, see www.w3.org">
8 <title>ntpdsim - Network Time Protocol (NTP) simulator</title>
9 <link href="scripts/style.css" type="text/css" rel="stylesheet">
10 </head>
12 <body>
13 <h3><tt>ntpdsim</tt> - Network Time Protocol (NTP) simulator</h3>
14 <p>The mushroom knows all the command line options.</p>
15 <p>Last update: <csobj format="ShortTime" h="25" locale="00000409" region="0" t="DateTime" w="61">21:32</csobj> UTC <csobj format="LongDate" h="25" locale="00000409" region="0" t="DateTime" w="223">Friday, June 16, 2006</csobj></p>
16 <br clear="left">
17 <h4>Related Links</h4>
18 <script type="text/javascript" language="javascript" src="scripts/links7.txt"></script>
19 <h4>Table of Contents</h4>
20 <ul>
21 <li><a href="#description">Description</a><br>
22 <li><a href="#configuration">Configuration</a>
23 <li><a href="#sample">Sample Configuration File</a>
24 </ul>
25 <h4 id="description">Description</h4>
26 <p>The ntpdsim program is used to simulate and study the behavior of an NTP daemon that derives its time from a number of different simulated time sources (servers). Each simulated server can be configured to have a different time offset, frequency offset, propagation delay, processing delay, network jitter and oscillator wander.</p>
27 <p>The ntpdsim program runs all the same selection, mitigation, and discipline algorithms as the actual ntpd daemon at the client. (It actually uses the same code). However, the input/output routines and servers are simulated. That is, instead of sending the client messages over the network to the actual servers, the client messages are intercepted by the ntpdsim program, which then generates the replies to those messages. The reply messages are carefully "inserted" into the input queue of the client at the right time according to the specified server properties (like propagation delay).</p>
28 <p>Each simulated server runs according to a specified script that describes the server properties at a particular time. Each script consists of a series of consecutive acts. Each act runs for a particular duration and specifies the frequency offset, propagation delay, processing delay, network jitter and oscillator wander of the server for that duration. Once the duration of an act expires, the simulated server reconfigures itself according to the properties specified in the next act.</p>
29 <h4 id="configuration">Configuration</h4>
30 <p>The ntpdsim program is configured by providing a configuration file at startup. The crux of the simulator configuration is specified using a <tt>simulate</tt> command, the syntax of which is given below. Note that all time quantities are in seconds and all frequency quantities are in parts per million (PPM):</p>
31 <p>&lt;<i>simulate_command</i>&gt; ::= <tt>simulate</tt> { &lt;<i>init_statement_list</i>&gt; &lt;<i>server_list</i>&gt; }<br>
32 &lt;<i>init_statement_list</i>&gt; ::= &lt;init_statement_list&gt; &lt;init_statement&gt; | &lt;init_statement&gt;<br>
33 &lt;<i>init_statement</i>&gt; ::= <tt>beep_delay</tt> = &lt;number&gt; | <tt>simulation_duration</tt> = &lt;number&gt;<br>
34 &lt;<i>server_list</i>&gt; ::= &lt;<i>server_list</i>&gt; &lt;server&gt; | &lt;server&gt;<br>
35 &lt;<i>server_list</i>&gt; ::= <tt>server</tt> = &lt;address&gt; { <tt>server_offset</tt> = &lt;number&gt; &lt;act_list&gt; }<br>
36 &lt;<i>act_list</i>&gt; ::= &lt;<i>act_list</i>&gt; &lt;<i>act</i>&gt; | &lt;<i>act</i>&gt;<br>
37 &lt;<i>act</i>&gt; ::= <tt>duration</tt> = &lt;number&gt; { &lt;<i>act_stmt_list</i>&gt; }<br>
38 &lt;<i>act_stmt_list</i>&gt; ::= &lt;<i>act_stmt_list</i>&gt; &lt;<i>act_stmt</i>&gt; | &lt;<i>act_stmt</i>&gt;<br>
39 &lt;<i>act_stmt</i>&gt; ::= <tt>freq_offset</tt> = &lt;number&gt; | <tt>wander</tt> = &lt;number&gt; | <tt>jitter</tt> = &lt;number&gt; | <tt>prop_delay</tt> = &lt;number&gt; | <tt>proc_delay</tt> = &lt;number&gt;</p>
40 <p>In addition to the simulate command, other standard NTP configuration commands can be specified. These commands have the same meaning as in the ntpd configuration. Note that newlines are <b>not</b> significant within the simulate command even though they are used to mark the end of a normal NTP configuration command.</p>
41 <h4 id="sample">Sample Configuration File</h4>
42 <p>A sample ntpdsim configuration file is given below. It specifies two simulated servers, each of which has two acts.</p>
43 <pre>
44 # Client configuration
45 disable kernel
46 server pogo
47 driftfile ./ntp.drift
48 statsdir ./ntpstats/
49 filegen loopstats type day enable
50 filegen peerstats type day enable
52 # Simulation configuration
53 simulate {
54 simulation_duration = 86400
55 beep_delay = 3600
57 # Server 1
58 server = louie.udel.edu {
59 server_offset = 0
60 duration = 50000 {
61 freq_offset = 400
62 wander = 1.0
63 jitter = 0.001
64 prop_delay = 0.001
65 proc_delay = 0.001
67 duration = 6400 {
68 freq_offset = 200
69 wander = 1.0
70 jitter = 0.001
71 prop_delay = 0.001
72 proc_delay = 0.001
76 # Server 2
77 server = baldwin.udel.edu {
78 server_offset = 0.02
79 duration = 10000 {
80 freq_offset = 400
81 wander = 1.0
82 jitter = 0.001
83 prop_delay = 0.5
84 proc_delay = 0.001
86 duration = 60000 {
87 freq_offset = 200
88 wander = 1.0
89 jitter = 0.05
90 prop_delay = 0.005
91 proc_delay = 0.001
95 </pre>
96 <hr>
97 <address><a href="mailto:skamboj@udel.edu">Sachin Kamboj</a></address>
98 <script type="text/javascript" language="javascript" src="scripts/footer.txt"></script>
99 </body>
101 </html>