TCP/IP Chapter 7th Ping Program

Source: Internet
Author: User
TCP/IP Chapter 7th Ping Program

The ping program is one of the ICMP messages in the format shown above. Identifier: The ID number that is placed into the sending process. This allows the PING program to recognize the returned information even if multiple ping programs are running concurrently on the same host computer.
Serial number: Starting from 0, each time a new echo request is sent, add 1. The ping program prints out the serial number of each packet that is returned, allowing us to see if there are groups missing, out of sequence, or duplicated.
Of course, the PING program also provides the-R and-T, respectively providing routing options and timestamp options, but not practical, because the IP header length is 4 bit, so the entire IP header can only be up to 15 characters long, that is, 60 bytes, remove the head 20 bytes, The RR option uses 3 bytes (which we'll discuss later) so that only 37 bytes (60-20-3) are left to hold the IP address list, which means that only 9 I-P addresses can be stored.

Code: A byte that indicates the type of the I P option. For RR options, it has a value of 7. Len: Is the total byte length of the RR option, in this case 3 9 (although the RR option can be set to a length smaller than the maximum length, the p i n g program
An option field of 3 9 bytes is always provided, and a maximum of 9 I p addresses can be recorded. It is generally set to the maximum length, since the space left for the option is limited in the I P header. P T R is called a pointer field. It is a pointer based on 1, pointing to the location where the next I p address is stored. Its minimum value is 4, which points to the location where the first IP address is stored. With each IP address stored in the list, the PTR values are 8,12,16, up to 3 6, respectively. When the 9 I P addresses are recorded, the value of P t R is 4 0, indicating that the manifest is full.
When the router sets the IP address, it is the ingress or egress address. For this reason, the RFC 791 [Postel 1981a] Specifies that the router records the egress IP address. We
As you'll see later, when the original host (the host running the ping program) receives an ICMP echo response with the RR option, it also puts its entry I p address into the list.


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.