icmp消息类型报告传输
ICMP shares error reporting and devices status by messages. Messages created by ICMP are divided into 2 categories:
ICMP通过消息共享错误报告和设备状态。 ICMP创建的消息分为两类:
1) Error Reporting Messages
1)错误报告消息
These are messages from which the ICMP reports to errors. The list of common error reporting messages is being given below.
这些是ICMP从中报告错误的消息。 常见错误报告消息的列表如下。
Destination Unreachable (Code 3):
无法到达目的地(代码3):
If a router cannot locate the path for a packet, then in such an event the packet is discarded and the destination is sent to the destination unreachable message.
如果路由器无法找到数据包的路径,则在这种情况下,数据包将被丢弃,并且将目标发送到目标不可达消息。
Source Quench (Code 4):
源猝灭(代码4):
As you know the IP does not have the flow control. The Sending device does not have any information about whether the speed forwarded by the data forwarded by the router forwarding and processing host is according to the host. The IP discards some packets when sending speed is high. In this situation ICMP provides flow control and sends source quench messages to source device.
如您所知,IP没有流量控制。 发送设备没有有关路由器转发和处理主机转发的数据的转发速度是否符合主机的任何信息。 发送速度较高时,IP会丢弃某些数据包。 在这种情况下,ICMP提供流控制并将源淬灭消息发送到源设备。
Redirect (Code 5):
重定向(代码5):
Because routing is a dynamic process and only routers participate in it, so a host has information about only one router (gateway). So when this host sends a data, then the data will go through that router to the correct router. In this situation, gateway router redirection message will send so that the host's routing information can be updated and the host can send data directly to the correct router.
因为路由是一个动态过程,并且只有路由器参与,所以主机仅具有有关一个路由器(网关)的信息。 因此,当该主机发送数据时,数据将通过该路由器到达正确的路由器。 在这种情况下,将发送网关路由器重定向消息,以便可以更新主机的路由信息,并且主机可以将数据直接发送到正确的路由器。
Time Exceeded (Code 11):
超过时间(代码11):
A router uses the routing table to forward any packet. If the routing table is not correct and there are errors, then in such an event, the packet roaps only in the loop. To avoid this situation, every packet contains a time to live field. The value of this field decreases on every router. As soon as the value of this field is zero, this packet is discarded by the router. In this situation, the Time Exceeded message is sent to the router source.
路由器使用路由表转发任何数据包。 如果路由表不正确并且有错误,则在这种情况下,数据包仅在循环中漫游。 为了避免这种情况,每个数据包都包含一个生存时间字段。 该字段的值在每个路由器上都减小。 一旦该字段的值为零,路由器便会丢弃此数据包。 在这种情况下,“超时”消息将发送到路由器源。
Parameter Unintelligible (Code 12):
参数无法理解(代码12):
If a router or a destination host packet finds a field empty, then discards that packet and sends the parameter unintelligible message to the source.
如果路由器或目标主机数据包发现字段为空,则丢弃该数据包并将参数“无法理解”消息发送到源。
2) Query Messages
2)查询讯息
These are the messages from which the ICMP queries for the status of a host. The list of common query messages is being given below with their code.
这些是ICMP从中查询主机状态的消息。 常见查询消息的列表及其代码在下面给出。
Echo Request (Code 8) & Echo reply (code 0):
回音请求(代码8)和回音(代码0):
This pair of Query Messages is used to diagnose problems in the network. Both of these messages determine whether two hosts can communicate with each other or not.
这对查询消息用于诊断网络中的问题。 这两个消息都确定两个主机是否可以相互通信。
Time-stamp Request (Code 13) & Time stamp Reply (Code 14):
时间戳记请求(代码13)和时间戳回复(代码14):
The time it takes to travel a host from one host to another host is detected by time stamp request & reply messages.
通过时间戳请求和答复消息检测将主机从一台主机传输到另一台主机所花费的时间。
Address Mask Request (Code 17) & Address Mask Reply (Code 18):
地址掩码请求(代码17)和地址掩码回复(代码18):
A host may be aware of its own IP address but it is not necessary that it is aware of its own subnet mask. To know your subnet mask sends the address mask request to the host router and the router sends this host's subnet mask address as the mask reply message. If the host is aware of the router's address, then he sends the request directly to the router, otherwise this request is broadcast.
主机可能知道其自己的IP地址,但不必知道其自己的子网掩码。 要知道您的子网掩码将地址掩码请求发送到主机路由器,并且路由器会将该主机的子网掩码地址作为掩码回复消息发送。 如果主机知道路由器的地址,则他将请求直接发送到路由器,否则将广播该请求。
So far you learned about 2 types of messages sent by ICMP. Let's now try to know the format of ICMP messages. The format of the lower ICMP message is being showcased below:
到目前为止,您了解了ICMP发送的两种消息。 现在,让我们尝试了解ICMP消息的格式。 下层ICMP消息的格式如下所示:
Although ICMP header is different for each message type, 3 fields of the beginning are similar in all messages. The total size of these 3 fields is 4 byte. These fields are being given in detail.
尽管每种消息类型的ICMP头均不同,但是所有消息中开头的3个字段都相似。 这3个字段的总大小为4个字节。 这些字段正在详细说明。
Type:
类型:
This defines the type of field message. For example, when doing any type of error report, the code related to that error is defined in this field. Similarly if there is a query message then this field will come in that query's code.
这定义了字段消息的类型。 例如,执行任何类型的错误报告时,都在此字段中定义了与该错误相关的代码。 同样,如果有查询消息,则该字段将出现在该查询的代码中。
Code:
码:
For error messages, this defines the sub type of field error. For example, if the destination unreachable error has occurred, then the code field will indicate what type of destination is unreachable error such as network unreachable (code 0), host unreachable (code 1) or protocol unreachable (code 2) error etc. These sub types of Errors are also defined by codes.
对于错误消息,这定义了字段错误的子类型。 例如,如果发生了目的地不可达错误,则代码字段将指示什么类型的目的地不可达错误,例如网络不可达(代码0),主机不可达(代码1)或协议不可达(代码2)错误等。这些错误的子类型也由代码定义。
Checksum:
校验和:
The checksum is calculated by the header and the data that is used to detect the errors.
校验和由标头和用于检测错误的数据计算。
Rest of the Header:
标题的其余部分:
As you know the ICMP message is encapsulated in the IP datagram. Rest of the header section in the ICMP message shows the remaining IP header.
如您所知,ICMP消息封装在IP数据报中。 ICMP消息中标头部分的其余部分显示了剩余的IP标头。
Data:
数据:
In the context of error messages, the packet in this section contains the complete information of the packet.
在错误消息的上下文中,此部分中的数据包包含该数据包的完整信息。
翻译自: https://www.includehelp.com/computer-networks/types-of-icmp-messages-and-icmp-message-format.aspx
icmp消息类型报告传输