Unformatted text preview: gram that sends the echo requests the client, and the host being pinged the
server. Most TCP/IP implementations support the Ping server directly in the kernel-the server is
not a user process. (The two ICMP query services that we described in Chapter 6, the address
mask and timestamp requests, are also handled directly by the kernel.) Figure 7.1 Format of ICMP message for echo request and echo reply.
As with other ICMP query messages, the server must echo the identifier and sequence number file:///D|/Documents%20and%20Settings/bigini/Docu...homenet2run/tcpip/tcp-ip-illustrated/pingprog.htm (1 of 13) [12/09/2001 14.46.45] Chapter 7. Ping Program fields. Also, any optional data sent by the client must be echoed. These are presumably of
interest to the client.
Unix implementations of ping set the identifier field in the ICMP message to the process ID of
the sending process. This allows ping to identify the returned responses if there are multiple
instances of ping running at the same time on the same host.
The sequence number starts at 0 and is incremented every time a new echo request is sent. ping
prints the sequence number of each returned packet, allowing us to see if packets are missing,
reordered, or duplicated. IP is a best effort datagram delivery service, so any of these three
conditions can occur.
Historically the ping program has operated in a mode where it sends an echo request once a
second, printing each echo reply that is returned. Newer implementations, however, require the s option to operate this way. By default, these newer implementations send only a single echo
request and output "host is alive" if an echo reply is received, or "no answer" if no reply is
received within 20 seconds.
ping output on a LAN normally looks like the following:
bsdi % ping svr4
PING svr4 (220.127.116.11): 56 data bytes
64 bytes from 18.104.22.168: icmp_seq=0 ttl=255 time=0 ms
64 bytes from 22.214.171.124: icmp_seq=l ttl=255 time=0 ms
64 bytes from 126.96.36.199: icmp_seq=2 t...
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