ntpdsim_new.html revision 280849
12706Swollman<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 22706Swollman<html> 32706Swollman<head> 42706Swollman<meta http-equiv="content-type" content="text/html;charset=iso-8859-1"> 52706Swollman<meta name="generator" content="HTML Tidy, see www.w3.org"> 62706Swollman<title>ntpdsim - Network Time Protocol (NTP) Simulator</title> 72706Swollman<link href="scripts/style.css" type="text/css" rel="stylesheet"> 82706Swollman</head> 92706Swollman<body> 102706Swollman<h3><tt>ntpdsim</tt> - Network Time Protocol (NTP) Simulator</h3> 112706Swollman<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> 122706Swollman<p>All in a row.</p> 132706Swollman<p>Last update: 14 <!-- #BeginDate format:En2m -->31-Jan-2014 06:54<!-- #EndDate --> 15 UTC</p> 16<br clear="left"> 17<h4>Related Links</h4> 18<script type="text/javascript" language="javascript" src="scripts/manual.txt"></script> 19<h4>Table of Contents</h4> 20<ul> 21 <li><a href="#description">Description</a></li> 22 <li><a href="#configuration">Configuration</a></li> 23 <li><a href="#sample">Sample Configuration File</a></li> 24</ul> 25<hr> 26<h4 id="description">Description</h4> 27<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<p>The ntpdsim program runs all the same selection, mitigation, and discipline 29 algorithms as the actual ntpd daemon at the client. (It actually 30 uses the same code). However, the input/output routines and servers are simulated. 31 That is, instead of sending the client messages over the network 32 to the actual servers, the client messages are intercepted by the ntpdsim 33 program, which then generates the replies to those messages. The reply messages 34 are carefully "inserted" into the input queue of the client at the right time 35 according to the specified server properties (like propagation delay).</p> 36<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<h4 id="configuration">Configuration</h4> 38<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<p><<i>simulate_command</i>> ::= <tt>simulate</tt> { <<i>init_statement_list</i>> <<i>server_list</i>> }<br> 40 <<i>init_statement_list</i>> ::= <init_statement_list> <init_statement> ; | <init_statement> ;<br> 41 <<i>init_statement</i>> ::= <tt>beep_delay</tt> = <number> | <tt>simulation_duration</tt> = <number><br> 42 <<i>server_list</i>> ::= <<i>server_list</i>> <server> | <server><br> 43 <<i>server_list</i>> ::= <tt>server</tt> = <address> { <tt>server_offset</tt> = <number> ; <act_list> }<br> 44 <<i>act_list</i>> ::= <<i>act_list</i>> <<i>act</i>> | <<i>act</i>><br> 45 <<i>act</i>> ::= <tt>duration</tt> = <number> { <<i>act_stmt_list</i>> }<br> 46 <<i>act_stmt_list</i>> ::= <<i>act_stmt_list</i>> <<i>act_stmt</i>> ; | <<i>act_stmt</i>> ;<br> 47 <<i>act_stmt</i>> ::= <tt>freq_offset</tt> = <number> | <tt>wander</tt> = <number> | <tt>jitter</tt> = <number> | <tt>prop_delay</tt> = <number> | <tt>proc_delay</tt> = <number></p> 48<p>In addition to the <tt>simulate</tt> 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 <tt>simulate</tt> command even though they are used to mark the end of a normal NTP configuration command. While a newline is an "end of command" terminator for other configuration commands, in the <tt>simulate</tt> stanza <tt>;</tt> (the semicolon) is the "end of command" terminator.</p> 49<h4 id="sample">Sample Configuration File</h4> 50<p>A sample ntpdsim configuration file is given below. It specifies two simulated servers, each of which has two acts.</p> 51<pre> 52 # Client configuration 53 disable kernel 54 server pogo 55 driftfile ./ntp.drift 56 statsdir ./ntpstats/ 57 filegen loopstats type day enable 58 filegen peerstats type day enable 59 60 # Simulation configuration 61 simulate { 62 simulation_duration = 86400; 63 beep_delay = 3600; 64 65 # Server 1 66 server = louie.udel.edu { 67 server_offset = 0; 68 duration = 50000 { 69 freq_offset = 400; 70 wander = 1.0; 71 jitter = 0.001; 72 prop_delay = 0.001; 73 proc_delay = 0.001; 74 } 75 duration = 6400 { 76 freq_offset = 200; 77 wander = 1.0; 78 jitter = 0.001; 79 prop_delay = 0.001; 80 proc_delay = 0.001; 81 } 82 } 83 84 # Server 2 85 server = baldwin.udel.edu { 86 server_offset = 0.02; 87 duration = 10000 { 88 freq_offset = 400; 89 wander = 1.0; 90 jitter = 0.001; 91 prop_delay = 0.5; 92 proc_delay = 0.001; 93 } 94 duration = 60000 { 95 freq_offset = 200; 96 wander = 1.0; 97 jitter = 0.05; 98 prop_delay = 0.005; 99 proc_delay = 0.001; 100 } 101 } 102 } 103 </pre> 104<hr> 105<address> 106<a href="mailto:skamboj@udel.edu">Sachin Kamboj</a> 107</address> 108<script type="text/javascript" language="javascript" src="scripts/footer.txt"></script> 109</body> 110</html> 111