computer network design

34
Computer Network Design EEL 6785 Dr. Janusz Zalewski University of Central Florida

Upload: sharla

Post on 14-Jan-2016

38 views

Category:

Documents


0 download

DESCRIPTION

Computer Network Design. EEL 6785 Dr. Janusz Zalewski University of Central Florida. Network Time Protocol NTP stands for Network Time Protocol , and it is an Internet protocol used to synchronize the clocks of computers to some time reference. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Computer Network Design

Computer Network Design

EEL 6785

Dr. Janusz Zalewski

University of Central Florida

Page 2: Computer Network Design

Network Time Protocol

• NTP stands for Network Time Protocol, and it is an Internet protocol used to synchronize the clocks of computers to some time reference.

• SNTP (Simple Network Time Protocol) is basically also NTP, but lacks some internal algorithms that are not needed for all types of servers.

Page 3: Computer Network Design

Supported Operating Systems

•The implementation works for most popular Unix operating systems. Among these are: Aix, Hp-Ux, Iris, Linux, Sco Unix, Osf/1, Solaris, and Windows.

Page 4: Computer Network Design

Basic Concepts

• The smallest possible increase of time the clock model allows is called resolution. If your clock increments its value only once per second, your resolution is also one second.

• A high resolution does not help you anything if you can't read the clock. Therefore the smallest possible increase of time that can be experienced by a program is called precision.

• When repeatedly reading the time, the difference may vary almost randomly. The difference of these differences (second derivation) is called jitter.

Page 5: Computer Network Design

• A clock not only needs to be read, it must be set, too. The accuracy determines how close the clock is to an official time reference like UTC.

• Even if the systematic error of some clock model is known, the clock will never be perfect. This is because the frequency varies over time, mostly influenced by temperature, but it could also be air pressure or magnetic fields, etc. Reliability determines the time a clock can keep the time within a specified accuracy.

Page 6: Computer Network Design

Network Protocols used by NTP:

• NTP uses UDP packets for data transfer because of the fast connection setup and response times.

• The official port number for the NTP (that ntpd and ntpdate listen and talk to) is 123.

Page 7: Computer Network Design

NTP Configuration (“Stratum”)

S3 S3 S3 S2 S2 S2 S2

S4 S3 S3* *

Workstation(a)

S1 S1 S1 S1

S2* *

S1 S1

*

* to buddy (S2)S2 S2

Clients(c)

Clients(b)

Page 8: Computer Network Design

NTP Configuration (“Stratum”)

(a) Workstations use multicast mode with multiple department servers

(b) Department servers use client/server modes with multiple campus servers

and symmetric modes with each other

(c) Campus servers use client/server modes with up to six different external

primary servers and symmetric modes with each other and external

secondary (buddy) servers

Page 9: Computer Network Design

• The stratum is a measure for synchronization distance. Opposed to jitter or delay, the stratum is a more static measure. Basically (and from the perspective of a client) it is the number of servers to a reference clock. So a reference clock itself appears at stratum 0, while the closest servers are at stratum 1.

Page 10: Computer Network Design

• A server operating at stratum 1 is the best NTP server available, because it has a reference clock attached to it. As accurate reference clocks are expensive, only rather few of these servers are publically available.

Page 11: Computer Network Design

• Time can be passed from one time source to another, typically starting from a reference clock connected to a stratum 1 server. Servers synchronized to a stratum 1 server will be stratum 2 . Generally the stratum of a server will be one more than the stratum of its reference.

Page 12: Computer Network Design

NTP/Reference Clock

• A reference clock is some device or machinery that provides the current time. Its special property is high accuracy. Reference clocks must be accurately following some time standard.

Page 13: Computer Network Design

• A reference clock provides the current time. NTP computes some additional statistical values that describe the quality of time it sees: offset, jitter (or dispersion), frequency error, and stability.

Page 14: Computer Network Design

• Thus each NTP server will maintain an estimate of the quality of its reference clocks and of itself.

Page 15: Computer Network Design

Basic Features:

• NTP needs some reference clock that defines the true time to operate. All clocks are set towards that true time.

Page 16: Computer Network Design

• NTP uses UTC as reference time. UTC ( Universal Time Coordinated, “Temps Universel Coordonne” ) is an official standard for the current time.

Page 17: Computer Network Design

• NTP is a fault-tolerant protocol that will automatically select the best of several available time sources to synchronize to. Multiple candidates can be combined to minimize the accumulated error. Temporarily or permanently insane time sources will be detected and avoided.

Page 18: Computer Network Design

• NTP is highly scalable: A synchronization network may consist of several reference clock. Each node of such a network can exchange time information either bi-directional or unidirectional.

Page 19: Computer Network Design

• Having available several time sources, NTP can select the best candidates to build its estimate of the current time. The protocol is highly accurate, using a resolution of less than a nanosecond.

Page 20: Computer Network Design

• Even when a network connection is temporarily unavailable, NTP can use measurements from the past to estimate current time and error.

Page 21: Computer Network Design

• For formal reasons NTP will also maintain estimates for the accuracy of the local time.

Page 22: Computer Network Design

How NTP Works?

NTP Messages

Peer 1

Peer 2

Filter 1

Peer 3

Filter 2

Filter 3

Intersectionand

ClusteringAlgorithms

CombiningAlgorithm

Loop Filter

VFOTimestamps

P/F-Lock Loop

Page 23: Computer Network Design

• Multiple synchronization peers provide redundancy and diversity.

• Clock filters select best from a window of eight clock offset samples.

• Intersection and clustering algorithms pick best subset of servers believed to be accurate and fault-free.

Page 24: Computer Network Design

• Combining algorithm computes weighted average of offsets for best accuracy.

• Phase/frequency-lock feedback loop disciplines local clock time and frequency to maximize accuracy and stability.

Page 25: Computer Network Design

Implementations on NTP/Unix :

The software is available as C source and consists of the following components:• ntpd:

A daemon process that is both, client and server.• ntpdate:

A utility to set the time once, similar to the popular rdate command.• ntpq, ntpdc:

Monitoring and control programs that communicate via UDP with ntpd.

• ntptrace: A utility to back-trace the current system time, starting from the local server.

Page 26: Computer Network Design

How will NTP discipline the Clock?

• ntpd: The ntpd program is an operating system daemon which sets and maintains the system time of day in synchronism with Internet standard time servers.

• xntpd: running xntpd will learn and remember the clock drift and it will correct it autonomously, even if there is no reachable server. Therefore large clock steps can be avoided while the machine is synchronized to some reference clock. In addition xntpd will maintain error estimates and statistics, and finally it can offer NTP service for other machines.

Page 27: Computer Network Design

• In order to keep the right time, xntpd must make adjustments to the system clock.

• There are four mechanisms ( system calls ) an NTP implementation can use to discipline the system clock: settimeofday( ), adjtime( ), ntp_adjtime( ), hardpps( ).

Page 28: Computer Network Design

1) settimeofday( ) to step (set) the time. This method is used if the time if off by more than 128ms.

2) adjtime( ) to slew (gradually change) the time. Slewing the time means to change the virtual frequency of the software clock to make the clock go faster or slower until the requested correction is achieved. Slewing the clock for a larger amount of time may require some time, too.

Page 29: Computer Network Design

3) ntp_adjtime( ) to control several parameters of the software clock.

4) hardpps( ) is a function that is only called from an interrupt service routine inside the operating system. If enabled, hardpps( ) will update the frequency and offset correction of the kernel clock.

Page 30: Computer Network Design

Is more than one clock needed?

• NTP likes to estimate the errors of all clocks. Therefore all NTP servers return the time together with an estimate of the current error.

• When using multiple time servers, NTP also wants these servers to agree on some time, meaning there must be one error interval where the correct time must be.

Page 31: Computer Network Design

• Not all NTP servers work as designed in theory. Time sources that are reachable and have a dispersion smaller than the maximum become candidates for time synchronization, thus contributing an error interval.

Page 32: Computer Network Design

• If these candidates pass another validation test, they become survivors. Basically all values must lie within the error interval the majority of candidates defines. All other time sources are called falsetickers subsequently.

Page 33: Computer Network Design

• Among the survivors those with significant high dispersion are removed and tagged as outlyers.The final synchronization source is the survivor with the smallest dispersion.

Page 34: Computer Network Design

• Just one time source will always be trusted

• Two time sources cannot be split into two parties where one has a majority.

• For a three-server configuration a failing server will cause the two-server problem to appear.