This preview shows page 1. Sign up to view the full content.
Unformatted text preview: for each interface), and in both cases the request is received from the loopback interface. 6.4 ICMP Timestamp Request and Reply
The ICMP timestamp request allows a system to query another for the current time. The
recommended value to be returned is the number of milliseconds since midnight,
Coordinated Universal Time (UTC). (Older manuals refer to UTC as Greenwich Mean
Time.) The nice feature of this ICMP message is that it provides millisecond resolution,
whereas some other methods for obtaining the time from another host (such as the rdate
command provided by some Unix systems) provide a resolution of seconds. The drawback
is that only the time since midnight is returned-the caller must know the date from some
other means. Figure 6.6 shows the format of the ICMP timestamp request and reply
messages. Figure 6.6 ICMP timestamp request and reply messages.
The requestor fills in the originate timestamp and sends the request. The replying system
fills in the receive timestamp when it receives the request, and the transmit time-stamp
when it sends the reply. In actuality, however, most implementations set the latter two fields
to the same value. (The reason for providing the three fields is to let the sender compute the
time for the request to be sent, and separately compute the time for the reply to be sent.)
We can write a simple program (named icmptime) that sends an ICMP timestamp request file:///D|/Documents%20and%20Settings/bigini/Docu...homenet2run/tcpip/tcp-ip-illustrated/icmp_int.htm (6 of 16) [12/09/2001 14.46.42] Chapter 6. ICMP: Internet Control Message Protocol to a host and prints the returned reply. We try it first on our small internet:
sun % icmptime bsdi
orig = 83573336, recv = 83573330, xmit = 83573330, rtt = 2
difference = -6 ms
sun % icmptime bsdi
orig = 83577987, recv = 83577980, xmit = 83577980, rtt = 2
difference = -7 ms
The program prints the three timestamps in the ICMP message: the originate (orig),
receive (recv), and transmit (xmit) timestamps. As we can see in this and the following
examples, all the hosts set the receive and transmit timestamps to the same value.
We also calculate the round-trip time (rtt), which is the time the reply is received minus
the time the request was sent....
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