ICMP Control Packet Protocol

Source: Internet
Author: User

The main control functions of the IP layer of the ICMP Control Packet protocol include error control, congestion control, and route control. If an error occurs during IP packet transmission, the IP protocol does not have an internal mechanism to obtain error information and control the error. For example, the IP protocol itself cannot answer the following questions: (1) Does the datagram arrive at the receiving end correctly? (2) If the datagram cannot reach the receiver, what is the cause? For this reason, the ICMP protocol is designed in TCP/IP to handle errors in packet transmission. ICMP is an integral part of the IP layer. The details are as follows: (1) When an error occurs during the transmission of data packets on the intermediate router or the target host and cannot reach the receiving end, the ICMP module of the host or router will be triggered, and generates an ICMP packet to report the error to the source machine. (2) In practice, ICMP is used not only to transmit packets reporting errors, but also to transmit control packets. (3) ICMP does not improve the reliability of the IP protocol, but when the IP datagram cannot reach the receiving end, it is used to notify the IP layer of the sending end of why the datagram has not reached the receiving end, so that the IP layer of the sender can control errors and handle errors. (4) The current ICMP protocol has become a dedicated protocol for IP layer error and control packet transmission. Under what circumstances will ICMP messages not be sent (1) ICMP error messages (ICMP query messages may generate ICMP error messages) (2) the destination address is the IP datagram of the broadcast address or multicast address (3) as the datagram of The Link Layer broadcast (4) Not the first IP segment (5) source Address is not a single host datagram (6) datagram ICMP application with a special address (such as 127.0.0.0 or 0.0.0.0) (1) source host extinction: the source host receives the extinction of the source host (Suppression) after the message is sent, the information must be sent to the high-level process for processing. (2) Timeout (3) parameter problem (4) redirection (5) Send and reply requests are a query packet used to test whether communication can be achieved between two machines (host or router. (6) A Query packet is returned between a timestamp request and a timestamp, which is used to determine the time required for the round-trip between the source and destination IP data packets, it can also be used for clock synchronization between the source and target machines. (7) An Address Mask Request and an address mask response are a query packet used to obtain the subnet mask of the network where a host is located. (8) A router announcement and a router request are a pair of Query Packets used to exchange information between the host and the router. (9) information requests and information responses are a query packet used by the host to find the address of the connected network. (10) Route tracing ICMP encapsulation ICMP is encapsulated in IP packets for transmission. The ICMP packet is encapsulated in the data area of the IP datagram, And the IP datagram is encapsulated in the frame data. Set the Protocol field in the IP datagram header to 1, indicating that the data is an ICMP packet. Here, ICMP packets include: ICMP header (8 bytes) + the IP address header that generates an error + 8 bytes after the IP address header. For example, the reason why the IP packet header is to be sent back is that the IP header contains the protocol field, so that ICMP can know how to explain the next 8 bytes. The eight bytes after the IP header (UDP header or TCP Header, UDP and TCP Header contain 16-bit destination port numbers and source port numbers respectively ), the error message can be associated with a specific user process based on the source port number. The ICMP packet header: An ICMP packet consists of eight-byte headers and variable-length data segments. For different packet types, the Header Format is generally different, but the first three fields (4 bytes) are the same for all ICMP packets. (1) Type field, which is 1 byte in length and is used to define the message Type. (2) The Code field is 1 byte in length, indicating the reason for sending this specific message type. (3) Checksum field, which consists of 2 bytes and is used for Error Control During data transmission. Similar to the calculation method of IP header checksum, the difference is that it verifies the entire ICMP packet. (4) The content of the rest of the header varies with different packets. (5) data fields whose content varies with different packets. For the Error Report Message type, the data fields include ICMP error information and the entire original datagram that triggers ICMP. The length of the data fields cannot exceed 576 bytes. Conclusion (1) the IP protocol is an unreliable and connectionless protocol with no error reporting and error correction mechanisms, it must rely on the ICMP protocol to report errors during the transmission of an IP datagram and provide management and status information (2) ICMP is the Internet Control Packet protocol, which is part of the IP protocol. When an error occurs during data transmission, the ICMP module of the host or router is triggered and generates an ICMP packet (3). There are two types of ICMP packets: error Report and query message. Among them, error report packets include: inaccessibility of the target, extinction of the source host, timeout, parameter problems, and redirection. Query Packets include: response and response, information request and Response (Deprecated), timestamp and timestamp response, Address Mask Request and response, router notice and request (4) ICMP packets are encapsulated into IP data packets for transmission. ICMP packets include 1-byte type fields, 1-byte code fields, 2-byte checksum fields, and variable-length data fields.

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.