Brief Analysis of ICMP (RFC792) Network Information

Source: Internet
Author: User

ICMP (RFC792) Network Information Analysis directory 1. introduction 22. message format 23. destination inaccessible information 34. timeout information 35. parameter question Message 46. source congestion message 57. redirect Message 68. response Message 79. the timestamp and timestamp respond to message 810. summary of message types 911. references 10 1. this section describes how to use the IP protocol in a system called Catenet as the datagram service from a host to a host. A network connection device is called a gateway. These gateways exchange information for control through the gateway-to-Gateway Protocol (GGP. Generally, the gateway or target host will communicate with the source host, for example, to report errors during the datagram process. For this purpose, ICMP is used. It uses IP as the underlying support, as if it is a high-level protocol, but in fact it is part of the IP, and each IP module must implement ICMP. ICMP messages are sent in the following situations: when the datagram cannot reach the destination, when the gateway has lost the cache function, when the gateway can direct the host to send on a shorter route. The IP address is not designed to be absolutely reliable. The protocol is designed to return control information when a network problem occurs, rather than making the IP protocol absolutely reliable, and does not guarantee that data packets or control information can be returned. Some data packets will still be lost without any report. The upper-layer protocol must use its own error control program to determine whether the communication is correct. ICMP information usually reports errors in the process of handling data packets. To avoid unlimited return of information, ICMP messages are not sent into packets separately, and ICMP messages are sent only when the datagram offset is 0. 2. The ICMP message is sent in the basic IP address header. The first byte of the data is an ICMP domain. The value of this domain determines the format of the remaining data. Any domain marked as "not used" is reserved for future extensions and must all be 0 during transmission. Unless in a specific format, the header is in the following format: Version: 4. IHL: the length of the Internet header is in 32 characters. · Service type: 0 · total length: Header Length and Data Length. · Identification, Flags, and segment offset: used for segmentation. · Life Cycle: in seconds, this domain is reduced when each machine processes data reports. This value must be greater than the time consumed by the gateway to transmit it. · Protocol: ICMP = 1-packet header Verification Code: The 16-Bit Data reverse code is obtained and then retrieved. Is the calculation verification code, this field should be 0. This domain can be replaced in the future. · Source Address: the gateway or host address for creating ICMP information. It can be any gateway address unless specified. · Destination Address: the gateway or host address to be sent. 3. destination inaccessible Information 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +- +-+ | Type | Code | Checksum | +- +- +-+ | unused | +- +- +-+ | Internet Header + 64 bits of Original Data datasync | +- +- +-+ Figure 1IP domain: destination Address: The network address for sending the original datagram data. ICMP domain: · type: 3 · code: 0 = inaccessible network; 1 = inaccessible host; 2 = unavailable protocol; 3 = inaccessible ports; 4 = required segments and DF settings; 5 = source route failure; · Verification Code: The 16-bit data (starting from the ICMP type) is obtained and obtained. To calculate the verification code, the verification code field should be zero. These Zeros will be replaced by verification codes in the future. · Internet header + Source datagram: the header of the Internet header plus the source data is 64-bit. This data is used to match information on the host to the corresponding process. If the High-level protocol uses the port number, it should be assumed that it is the first 64 bytes of the source data. · Description: The route table corresponding to the Gateway. If the network specified in the target domain is inaccessible, if the network distance is infinitely long, the gateway will send a destination inaccessible message to the host that sends the source data. In addition, in some networks, the gateway can determine whether the target host is accessible. If the destination is inaccessible, it will send an inaccessible message to the host that sends the source data. On the target host, if the IP module cannot submit a datagram because the specified protocol module and process port are unavailable, the target host will send an inaccessible message to the host that sends the source data. In another case, when the datagram must be transmitted in segments and the "not segmented" bit is enabled, the gateway must discard the datagram, and sends inaccessible information to the host that sends the source data. Codes 0, 1, 4, and 5 are sent by the gateway, while codes 2 and 3 are sent by the host. 4. timeout Information 0 1 2 3 0 1 2 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 4 5 6 7 8 9 0 1 +- +- +-+ | Type | Code | Checksum | +- +- +-+ | unused | +- +- +-+ | Internet Header + 64 bits of Original Data datasync | +- +-+ -+ Figure 2IP domain: destination Address: obtained from the source datagram data. ICMP domain: Type: 11 code: 0 = Transfer timeout; 1 = multipart loading timeout. · Verification Code: The 16-bit data (starting from the ICMP type) is obtained based on the reverse code and the reverse code. To calculate the verification code, the verification code field should be zero. These Zeros will be replaced by verification codes in the future. · Internet header + 64-bit source datagram data: the Internet header is added with the 64-bit header of the source data. This data is used to match information on the host to the corresponding process. If the High-level protocol uses the port number, it should be assumed that it is the first 64 bytes of the source data. · Note: If the gateway finds that the TTL domain is zero when processing the data report, the datagram must be discarded. The gateway must also notify the source host through timeout information. This datagram must be discarded if the host fails to assemble data within the specified time period due to the loss of the segment when assembling the data report. The timeout message sent by the gateway. If the segment is unavailable, no timeout information is required. Code 0 is sent by the gateway, and code 1 is sent by the host. 5. parameter issue message 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 + -+ -+ | Type | Code | Checksum | +-+ -+ -+ | Pointer | unused | +-+ -+ -+ | Internet Header + 64 bits of Original Data datasync | +-+ -+ -+ Figure 3 IP domain: destination Address: obtained from the source data. ICMP domain: · type: 12 · code: 0 = pointer pointing error. · Verification Code: The 16-bit data (starting from the ICMP type) is obtained based on the reverse code and the reverse code. To calculate the verification code, the verification code field should be zero. These Zeros will be replaced by verification codes in the future. · Pointer: If code = 0, it points to the problematic byte. · Internet Baotou + 64-bit source datagram data: Internet Baotou + 64-bit source datagram data: Internet Baotou and the 64-bit header of source data. This data is used to match information on the host to the corresponding process. If the High-level protocol uses the port number, it should be assumed that it is the first 64 bytes of the source data. · Note: If the gateway or host finds a packet header parameter error during data reporting and cannot complete the task, it must discard the datagram. A potential cause can be a variable error. The gateway or host will notify the source host through the parameter question message. This message is sent only when the message is discarded. The Pointer Points to the packet header byte (which may be in the middle of the option ). For example, 1 indicates that the service type has an error. If there is an option, 20 indicates that the type of the first option has an error. Code 0 may be received from the host or gateway. 6. source congestion message 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 + -+ -+ | Type | Code | Checksum | +-+ -+ -+ | unused | +-+ -+ -+ | Internet Header + 64 bits of Original Data datasync | +-+ -+- +-+ Figure 4 IP domain: destination Address: the address and source network of the source datagram data. ICMP domain: Type: 4-code: 0-check code: 16-bit data (starting from the ICMP type. To calculate the verification code, the verification code field should be zero. These Zeros will be replaced by verification codes in the future. · Internet Baotou + 64-bit source datagram data: Internet Baotou + 64-bit source datagram data: Internet Baotou and the 64-bit header of source data. This data is used to match information on the host to the corresponding process. If the High-level protocol uses the port number, it should be assumed that it is the first 64 bytes of the source data. · Note: If there is no buffer capacity, the gateway will discard the datagram. If the gateway does this, it will send the source congestion message to the sending host. If too many received data packets cannot be processed, the target host will also send the corresponding message to the sending host. This message requires sending and sending to reduce the sending rate. The gateway will return the source congestion message to each discarded message. After receiving this message, the sending host should reduce the sending rate, until the source congestion messages sent by the gateway are no longer received. After that, the source host can increase the sending rate until it receives the source congestion message from the target host. The gateway or host does not wait until the message reaches the upper limit, but sends the message close to its processing limit. This means that the datagram of the source congestion message can still be processed. Code 0 may be received from the host or gateway. 7. redirect Message 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +- +- +-+ | Type | Code | Checksum | +- +- +-+ | Gateway Internet Address | +- +- +-+ | Internet Header + 64 bits of Original Data datasync | +-+ -+ -+ Figure 5 IP domain: destination Address: the address and source network of the source datagram data. ICMP domain: · type: 5 · code: 0 = redirection network datagram; 1 = redirection host datagram; 2 = redirection network and service type datagram; 3 = redirect network and host type data packets. · Verification Code: The 16-bit data (starting from the ICMP type) is obtained based on the reverse code and the reverse code. To calculate the verification code, the verification code field should be zero. These Zeros will be replaced by verification codes in the future. · Gateway Internet address: it should be the gateway address (which is specified in the internet destination network domain of the source datagram data ). · Internet header + 64-bit source datagram data: the Internet header is added with the 64-bit header of the source data. This data is used to match information on the host to the corresponding process. If the High-level protocol uses the port number, it should be assumed that it is the first 64 bytes of the source data. · Note: The Gateway sends a redirection message in the following circumstances. The Gateway (G1) receives the datagram from the network connected to the Gateway. It checks the route table to obtain the address (X) of the next Gateway (G2 ). If G2 and the specified receiving host are on the same network and the redirection message is sent, it is recommended that the sending host directly send the datagram to the gateway G2 because it is closer, at the same time, the gateway G1. Because the IP source route and destination address domain in the datagram are optional, even better routes cannot be found. Codes 0, 1, 2, and 3 may be sent from the gateway. 8. send back or send back Response Message 0 1 2 3 0 1 2 4 5 6 7 8 9 0 1 2 3 5 6 7 8 9 0 1 2 4 5 6 7 8 9 0 2 4 5 6 7 8 9 0 1 +-+ -+ | Type | Code | Checksum | +-+ -+ -+ | Identifier | Sequence Number | +- +- +-+ | Data... +--Figure 6 IP domain: Address: the source address of the send-back message is the destination address of the send-back Response Message. To form a return response message, you should exchange the source and target addresses, change the type code to 0, and re-calculate the verification code. ICMP domain: · type: 8 indicates the return message; 0 indicates the return response message. Code: 0-check code: the inverse code of the 16-bit data (starting from the ICMP type) and the opposite result. To calculate the verification code, the verification code field should be zero. These Zeros will be replaced by verification codes in the future. · Identifier: if the code is 0, the code that helps match the response can be 0. · Sequence code: if the code is 0, the sequence code that helps match the return and return responses can be 0. · Note: the messages received in the return message should be returned in the return response message. The identifier and serial code are used by the sender to help match the response of the send-back request. Code 0 may be received from the host or gateway. 9. timestamp and timestamp Response Message 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+ -+ | Type | Code | Checksum | +-+ -+ -+ | Identifier | Sequence Number | +- +- +-+ | Originate Timestamp | +-+ -+ -+ | Receive Timestamp | +- +- +-+ | Transmit Timestamp | +-+ -+ -+ figure 7 IP domain: address: the source address of the timestamp message is the destination address of the timestamp Response Message. To form a timestamp response message, you should exchange the source and target addresses, change the type code to 14, and re-calculate the verification code. ICMP domain: · type: 13 indicates a timestamp message; 14 indicates a timestamp Response Message. · Code: 0 · Verification Code: The 16-bit data (starting from the ICMP type) reverse code and then get it. To calculate the verification code, the verification code field should be zero. These Zeros will be replaced by verification codes in the future. · Identifier: if the code is 0, the code that helps match the timestamp and timestamp response can be 0. · Sequence code: if the code is 0, the code that helps match the timestamp and timestamp response can be 0. · Note: The received timestamp is appended to the response and returned. The time is calculated in the unit of one thousandth, and the time starts at midnight when the standard is used. The original timestamp is the time before the sender sends the message. The receipt timestamp is the time when the sender receives the message, and the transfer time is the time when the sender sends the message. If the time is counted as one thousandth of a second, or cannot be provided as standard, you can fill in the data in the high byte of the timestamp to indicate that this is not the standard data. The identifier and serial number are the responses to the request matched by the sender. Code 0 may be received from the host or gateway. Information request or response message 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 4 5 6 7 8 9 0 1 +- +-+ | Type | Code | Checksum | +- +- +-+ | Identifier | Sequence Number | +-+ -+ -+ figure 8 IP domain: address: the source address of the information request message is the destination address of the Information Response Message. To form an information response message, you should exchange the source and target addresses, change the type code to 16, and re-calculate the verification code. ICMP domain: · type: 15 indicates the information request message; 16 indicates the Information Response Message. · Code: 0 · Verification Code: The 16-bit data (starting from the ICMP type) reverse code and then get it. To calculate the verification code, the verification code field should be zero. These Zeros will be replaced by verification codes in the future. · Identifier: if the code is 0, the code that helps match the information request and response can be 0. · Sequence code: if the code is 0, the code that helps match the information request and response can be 0. · Note: the message can be sent from the source network address in the IP Address Header, but the destination address is 0 (this indicates that the message is in the network ). The response IP module should send a response with the specified address completely. Sending this message is a method for the host to find its network number. The identifier and serial number are the responses to the request matched by the sender. Code 0 may be received from the host or gateway. 10. Message Type summary 0 return response 3 destination not reachable 4 source congestion 5 redirection 8 return 11 timeout 12 Parameter Problem 13 timestamp 14 timestamp response 15 Information Request 16 Information Response

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.