Home | History | Annotate | Line # | Download | only in html
ntpdsim_new.html revision 1.1
      1  1.1  kardel <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
      2  1.1  kardel 
      3  1.1  kardel <html>
      4  1.1  kardel 
      5  1.1  kardel 	<head>
      6  1.1  kardel 		<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
      7  1.1  kardel 		<meta name="generator" content="HTML Tidy, see www.w3.org">
      8  1.1  kardel 		<title>ntpdsim - Network Time Protocol (NTP) Simulator</title>
      9  1.1  kardel 		<link href="scripts/style.css" type="text/css" rel="stylesheet">
     10  1.1  kardel 	</head>
     11  1.1  kardel 
     12  1.1  kardel 	<body>
     13  1.1  kardel 		<h3><tt>ntpdsim</tt> - Network Time Protocol (NTP) Simulator</h3>
     14  1.1  kardel 		<img src="pic/oz2.gif" alt="gif" align="left"><a href="http://www.eecis.udel.edu/%7emills/pictures.html">from <i>The Wizard of Oz</i>, L. Frank Baum</a>
     15  1.1  kardel 		<p>All in a row.</p>
     16  1.1  kardel 		<p>Last update: <csobj format="ShortTime" h="25" locale="00000409" region="0" t="DateTime" w="61">15:56</csobj> UTC <csobj format="LongDate" h="25" locale="00000409" region="0" t="DateTime" w="250">Sunday, March 02, 2008</csobj></p>
     17  1.1  kardel 		<br clear="left">
     18  1.1  kardel 		<h4>Related Links</h4>
     19  1.1  kardel 		<script type="text/javascript" language="javascript" src="scripts/manual.txt"></script>
     20  1.1  kardel 		<h4>Table of Contents</h4>
     21  1.1  kardel 		<ul>
     22  1.1  kardel 			<li><a href="#description">Description</a><br>
     23  1.1  kardel 			<li><a href="#configuration">Configuration</a>
     24  1.1  kardel 			<li><a href="#sample">Sample Configuration File</a>
     25  1.1  kardel 		</ul>
     26  1.1  kardel 		<h4 id="description">Description</h4>
     27  1.1  kardel 		<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>
     28  1.1  kardel 		<p>The ntpdsim program runs all the same selection, mitigation, and discipline
     29  1.1  kardel 			algorithms as the actual ntpd daemon at the client. (It actually
     30  1.1  kardel 			uses the same code). However, the input/output routines and servers are simulated.
     31  1.1  kardel 			That is, instead of sending the client messages over the network
     32  1.1  kardel 			to the actual servers, the client messages are intercepted by the ntpdsim
     33  1.1  kardel 			program, which then generates the replies to those messages. The reply messages
     34  1.1  kardel 			are carefully &quot;inserted&quot; into the input queue of the client at the right time
     35  1.1  kardel 			according to the specified server properties (like propagation delay).</p>
     36  1.1  kardel 		<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>
     37  1.1  kardel 		<h4 id="configuration">Configuration</h4>
     38  1.1  kardel 		<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>
     39  1.1  kardel 		<p>&lt;<i>simulate_command</i>&gt; ::= <tt>simulate</tt> { &lt;<i>init_statement_list</i>&gt; &lt;<i>server_list</i>&gt; }<br>
     40  1.1  kardel 		&lt;<i>init_statement_list</i>&gt; ::= &lt;init_statement_list&gt; &lt;init_statement&gt; | &lt;init_statement&gt;<br>
     41  1.1  kardel 		&lt;<i>init_statement</i>&gt; ::= <tt>beep_delay</tt> = &lt;number&gt; | <tt>simulation_duration</tt> = &lt;number&gt;<br>
     42  1.1  kardel 		&lt;<i>server_list</i>&gt; ::= &lt;<i>server_list</i>&gt; &lt;server&gt; | &lt;server&gt;<br>
     43  1.1  kardel 		&lt;<i>server_list</i>&gt; ::= <tt>server</tt> = &lt;address&gt; { <tt>server_offset</tt> = &lt;number&gt; &lt;act_list&gt; }<br>
     44  1.1  kardel 		&lt;<i>act_list</i>&gt; ::= &lt;<i>act_list</i>&gt; &lt;<i>act</i>&gt; | &lt;<i>act</i>&gt;<br>
     45  1.1  kardel 		&lt;<i>act</i>&gt; ::= <tt>duration</tt> = &lt;number&gt; { &lt;<i>act_stmt_list</i>&gt; }<br>
     46  1.1  kardel 		&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>
     47  1.1  kardel 		&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>
     48  1.1  kardel 		<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>
     49  1.1  kardel 		<h4 id="sample">Sample Configuration File</h4>
     50  1.1  kardel 		<p>A sample ntpdsim configuration file is given below. It specifies two simulated servers, each of which has two acts.</p>
     51  1.1  kardel 	<pre>
     52  1.1  kardel     # Client configuration 
     53  1.1  kardel     disable kernel
     54  1.1  kardel     server pogo
     55  1.1  kardel     driftfile ./ntp.drift
     56  1.1  kardel     statsdir ./ntpstats/
     57  1.1  kardel     filegen loopstats type day enable
     58  1.1  kardel     filegen peerstats type day enable
     59  1.1  kardel 
     60  1.1  kardel     # Simulation configuration
     61  1.1  kardel     simulate {
     62  1.1  kardel         simulation_duration = 86400
     63  1.1  kardel         beep_delay = 3600
     64  1.1  kardel 
     65  1.1  kardel         # Server 1
     66  1.1  kardel 	server = louie.udel.edu {
     67  1.1  kardel 	    server_offset = 0 
     68  1.1  kardel             duration = 50000 {
     69  1.1  kardel 		freq_offset = 400
     70  1.1  kardel 		wander = 1.0
     71  1.1  kardel 		jitter = 0.001
     72  1.1  kardel 		prop_delay = 0.001
     73  1.1  kardel 		proc_delay = 0.001
     74  1.1  kardel 	    }
     75  1.1  kardel             duration = 6400 {
     76  1.1  kardel 		freq_offset = 200
     77  1.1  kardel 		wander = 1.0
     78  1.1  kardel 		jitter = 0.001
     79  1.1  kardel 		prop_delay = 0.001
     80  1.1  kardel 		proc_delay = 0.001
     81  1.1  kardel 	    }
     82  1.1  kardel 	}
     83  1.1  kardel 
     84  1.1  kardel         # Server 2
     85  1.1  kardel 	server = baldwin.udel.edu {
     86  1.1  kardel 	    server_offset = 0.02
     87  1.1  kardel 	    duration = 10000 {
     88  1.1  kardel 		freq_offset = 400
     89  1.1  kardel 		wander = 1.0
     90  1.1  kardel 		jitter = 0.001
     91  1.1  kardel 		prop_delay = 0.5
     92  1.1  kardel 		proc_delay = 0.001
     93  1.1  kardel 	    }
     94  1.1  kardel 	    duration = 60000 {
     95  1.1  kardel 		freq_offset = 200
     96  1.1  kardel 		wander = 1.0
     97  1.1  kardel 		jitter = 0.05
     98  1.1  kardel 		prop_delay = 0.005
     99  1.1  kardel 		proc_delay = 0.001
    100  1.1  kardel 	    }
    101  1.1  kardel 	}
    102  1.1  kardel     }
    103  1.1  kardel   </pre>
    104  1.1  kardel 		<hr>
    105  1.1  kardel 		<address><a href="mailto:skamboj (a] udel.edu">Sachin Kamboj</a></address>
    106  1.1  kardel 		<script type="text/javascript" language="javascript" src="scripts/footer.txt"></script>
    107  1.1  kardel 	</body>
    108  1.1  kardel 
    109  1.1  kardel </html>
    110