This preview shows page 1. Sign up to view the full content.
Unformatted text preview: erates a clock interrupt at some frequency. For Sun SPARCs and Intel
80386s the interrupts occur every 10 ms.
It should be noted that most computers use an uncompensated crystal oscillator to
generate these interrupts. As noted in Table 7 of RFC 1305 [Mills 1992], you don't want
to ask what the drift per day of such an oscillator is. This means few computers keep
accurate time (i.e., the interrupts don't occur exactly every 10 ms). A 0.01% tolerance
gives an error of 8.64 seconds per day. To keep better time requires (1) a better oscillator,
(2) an external time source with greater precision (e.g., the time source supplied by the
Global Positioning Satellites), or (3) access across the Internet to systems with more
precise clocks. The latter is provided by the Network Time Protocol, as described in
detail in RFC 1305, which is beyond the scope of this book.
Another common source of time errors in Unix systems is that the 10-ms clock interrupts
only cause the kernel to increment a variable that keeps track of the time. If the kernel
loses an interrupt (i.e., it's too busy for the 10 ms between two consecutive interrupts),
the clock will lose 10 ms. Lost interrupts of this type often cause Unix systems to lose
Even though the clock interrupts arrive approximately every 10 ms, newer systems such
as SPARCs provide a higher resolution timer to measure time differences. tcpdump,
through the NIT driver (described in Appendix A) has access to this higher resolution
timer. On SPARCs this timer provides microsecond resolution. Access to this higher
resolution timer is also provided for user processes through the gettimeofday(2)
The author ran the following experiment. A program was run that called the
gettimeofday function 10,000 times in a loop, saving each return value in an array.
At the end of the loop the 9,999 differences were printed out. For a SPARC ELC the
distribution of the differences are shown in Figure B.1.
Microseconds Count file:///D|/Documents%20and%20Settings/bigini/Do...
View Full Document
This test prep was uploaded on 04/04/2014 for the course ECE EL5373 taught by Professor Guoyang during the Spring '12 term at NYU Poly.
- Spring '12