cgl.narada.service.time.ntptime
Class NTP

java.lang.Object
  extended by cgl.narada.service.time.ntptime.NTP

public class NTP
extends Object

This class implements NTP algorithms described in rfc 1305. Algorithms implemented are combine, filter and select. It also describes static values that can be used or set in the NTP protocol v3 implementation.


Field Summary
static double FILTER
          filter weight
static int FMAX
          max filter size
static int HZ
          clock rate
static int MAXAGE
          Max Clock Age
static int MAXCLOCK
          Max Select Clocks
static int MAXDISP
          Max Dispersion
static int MAXDISTANCE
          Max Distance
static int MAXPOLL
          Max Polling Interval
static int MAXSKEW
          Max Skew error per MAXAGE
static int MAXSTRATUM
          Max Stratum
static int MINCLOCK
          Min Select Clocks
static double MINDISP
          Max Dispersion
static int MINPOLL
          Min Polling Interval
static int NMAX
          max clocks
static int PORT
          NTP Port
static double SELECT
          select weight
static int SHIFT
          Filter Size
static int VERSION
          Version Number
static int WINDOW
          Reachability Reg Size
 
Constructor Summary
NTP()
           
 
Method Summary
 double combine(int m)
          Computes weighted ensemble average.
 double dist(int n)
          Computes synchronization distance.
 void dts()
          Computes interval intersection, that is bot and top values.
 void filter(NtpInfo ntpInfo)
          It filters the NtpInfo object, which contains NTP time information received from a server
 double getTheta()
          Gets offset
 void initialize()
          Initializes the vairbales used in this class.
 void select()
          Selects best subset of clocks in candidate list
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VERSION

public static final int VERSION
Version Number

See Also:
Constant Field Values

PORT

public static final int PORT
NTP Port

See Also:
Constant Field Values

NMAX

public static int NMAX
max clocks


FMAX

public static int FMAX
max filter size


HZ

public static final int HZ
clock rate

See Also:
Constant Field Values

MAXSTRATUM

public static final int MAXSTRATUM
Max Stratum

See Also:
Constant Field Values

MAXSKEW

public static final int MAXSKEW
Max Skew error per MAXAGE

See Also:
Constant Field Values

MAXAGE

public static final int MAXAGE
Max Clock Age

See Also:
Constant Field Values

MAXDISTANCE

public static final int MAXDISTANCE
Max Distance

See Also:
Constant Field Values

MINPOLL

public static final int MINPOLL
Min Polling Interval

See Also:
Constant Field Values

MAXPOLL

public static final int MAXPOLL
Max Polling Interval

See Also:
Constant Field Values

MAXDISP

public static final int MAXDISP
Max Dispersion

See Also:
Constant Field Values

MINDISP

public static final double MINDISP
Max Dispersion

See Also:
Constant Field Values

WINDOW

public static final int WINDOW
Reachability Reg Size

See Also:
Constant Field Values

SHIFT

public static final int SHIFT
Filter Size

See Also:
Constant Field Values

MINCLOCK

public static final int MINCLOCK
Min Select Clocks

See Also:
Constant Field Values

MAXCLOCK

public static final int MAXCLOCK
Max Select Clocks

See Also:
Constant Field Values

FILTER

public static final double FILTER
filter weight

See Also:
Constant Field Values

SELECT

public static final double SELECT
select weight

See Also:
Constant Field Values
Constructor Detail

NTP

public NTP()
Method Detail

getTheta

public double getTheta()
Gets offset

Returns:
double - offset value

combine

public double combine(int m)
Computes weighted ensemble average.

Parameters:
m - int - number of candidates to be weighted
Returns:
double - combined clock offset

dist

public double dist(int n)
Computes synchronization distance.

Parameters:
n - int - peer id
Returns:
double - synchronization distance

dts

public void dts()
Computes interval intersection, that is bot and top values.


filter

public void filter(NtpInfo ntpInfo)
It filters the NtpInfo object, which contains NTP time information received from a server

Parameters:
ntpInfo - NtpInfo - NtpInfo object related to a received NTPDatagramPacket

initialize

public void initialize()
Initializes the vairbales used in this class.


select

public void select()
Selects best subset of clocks in candidate list



For comments and suggestions please send e-mail to The NaradaBrokering Project