TCP IP Illustrated

72 ping program we call the ping program that sends

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

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. LAN Output ping output on a LAN normally looks like the following: bsdi % ping svr4 PING svr4 ( 56 data bytes 64 bytes from icmp_seq=0 ttl=255 time=0 ms 64 bytes from icmp_seq=l ttl=255 time=0 ms 64 bytes from 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.

Ask a homework question - tutors are online