TCP/IP Protocol---ICMP protocol and Ping, traceroute

Source: Internet
Author: User

ICMP Internet Control Message Protocol
is generally considered an integral part of the IP layer and is generally used by the IP layer or higher (TCP, UDP).
The ICMP message is transmitted inside the IP datagram.

The format of the ICMP message is as follows:


The first 4 bytes of the message are the same: 8bit type, 8bit code, 16bit test and.
The ICMP packets have different message types, and the different types are determined by the 8bit type and the 8bit code together. There may be more than one code under a type.
For example: type 0 indicates echo response (ping answer), type 1 means unreachable, where code 0 indicates that the network is unreachable, code 1 indicates that the host is unreachable, code 2 indicates that the protocol is unreachable, code 3 indicates that the port is unreachable, and so on ...

The message is also divided into query type or error type. Because the error message is sometimes specially processed, such as responding to ICMP error messages, no more ICMP error messages are generated ...
When a error message occurs, the message always contains the first 8 bytes of the original IP header and data portion that caused the ICMP error message to be generated (such as UDP or TCP for the transport layer, which contains the port number). Here the original IP header of the Protocol field and the first 8 bytes of the port number, you can determine which protocol and which user process.
In addition to the ICMP error message above, the ICMP error message is no longer generated, the general purpose address is the broadcast datagram will no longer produce ICMP error messages, so as to prevent the broadcast storm ...

ICMP address mask request and reply
ICMP timestamp request and reply
ICMP Port Unreachable Error:
If the message is sent to the destination host's non-listening port, then the destination host will return a Port unreachable ICMP error message. Traceroute took advantage of this.

You can see the data portion of the ICMP packet, which contains the header of the original IP and the first 8 bytes of the IP data portion (this is the UDP header).

TCP/IP Protocol---ICMP protocol and Ping, traceroute

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.