ICMP(ping)请求中包含哪些数据? [英] What data is included in ICMP (ping) request?

查看:797
本文介绍了ICMP(ping)请求中包含哪些数据?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道ICMP请求包含IP地址.客户端MAC地址是否包含在ICMP请求中? ping请求中还包含哪些其他信息(如果有)?

I know the ICMP request contains the IP address. Is the client MAC address included in an ICMP request? What other info (if any) is included in a ping request?

推荐答案

ICMP请求是通过互联网发送的分层数据包.它包含以太层,其中有目标MAC地址和源MAC地址.它还包含IP层,该IP层具有源IP和目标IP,还包括几个标志.最后,它包含ICMP数据.其中包含一个类型,一个子类型,一个校验和以及标头的其余部分,这些信息可能因类型和子类型而异(例如,echo的代码为8,reply为0).

An ICMP request is a layered packet which is sent over the internet. It contains the Ether layer, which has the target and source MAC address in it. It also contains the IP layer, which has the source and target IP and also a couple of flags included. And at last it contains the ICMP data. This contains a type, a subtype, then a checksum and the rest of the header, which can vary from type and subtype (E.g. The code for echo is 8 and reply is 0).

网络数据包中有很多信息.另请注意,ICMP是IPv4协议的一部分,因此它不能正式由其他协议携带.尽管IP协议可以使用与以太网协议不同的协议.

There is a lot of information in a network packet. Also note that ICMP is an part of the IPv4 protocol, so it cannot officially be carried by other protocols. Although the IP protocol can be carried on a different protocol than the ethernet protocol.

每次通过路由器后,MAC地址都会更改.因此,这绝不是Internet上源IP地址的MAC地址.但是IP地址是绝对包含的,并且在本地网络上,客户端的mac地址仍然在Ether层的数据包中.

The MAC address will be changed after each passing of a router. So this is never the MAC address of the source IP address on the internet. But the IP address is definitely included and on a local network, the mac address of the client is still in the packet in the Ether layer.

维基百科上有一些有关ICMP数据包的可读文章: icmp消息以及带有可读图的不同协议.

Wikipedia has some readable article about ICMP packets: icmp message and different protocols with readable diagrams.

如果您想查看一些实时请求,可以安装 wireshark ,它将显示和分析所有网络流量为你.这是一个非常方便和酷的工具.

If you want to see some live requests, you can install wireshark, which will show and dissect all network traffic for you. It is a very convenient and cool tool.

这篇关于ICMP(ping)请求中包含哪些数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆