Ping (networking utility)

Ping is a computer network administration software utility used to test the reachability of a host on an Internet Protocol (IP) network. It measures the round-trip time for messages sent from the originating host to a destination computer that are echoed back to the source.

Ping operates by sending Internet Control Message Protocol (ICMP) Echo Request packets to the target host and waiting for an ICMP Echo Reply. The program reports errors, packet loss, and a statistical summary of the results, typically including the minimum, maximum, the mean round-trip times, and standard deviation of the mean.


ICMP packet

IP Datagram
Bits 0–7Bits 8–15Bits 16–23Bits 24–31
IP Header
(20 bytes)
Version/IHLType of serviceLength
Identificationflags and offset
Time To Live (TTL)ProtocolChecksum
Source IP address
Destination IP address
ICMP Header
(8 bytes)
Type of messageCodeChecksum
Header Data
ICMP Payload
(optional)
Payload Data























Generic composition of an ICMP 32-byte packet:

  • IP Header (in blue): protocol set to 1 (ICMP) and Type of Service set to 0.

  • ICMP Header (in red):
  • Type of ICMP message (8 bits)
  • Code (8 bits)
  • Checksum (16 bits), calculated with the ICMP part of the packet (the IP header is not used). It is the 16-bit one's complement of the one's complement sum of the ICMP message starting with the Type field[8]
  • Header Data (32 bits) field, which in this case (ICMP echo request and replies), will be composed of identifier (16 bits) and sequence number (16 bits).
ICMP Payload: payload for the different kind of answers; can be an arbitrary length, left to implementation detail. 















评论

此博客中的热门博文

openflow switch(I)

YANG Tools:YANG to Java Mapping

OpenDaylight架构简介