以太网设备 MTU 设置对数据包入口路径的影响
数据包入口路径中以太网设备的行为是什么?
如果发送方正在发送大于 MTU 的帧,则:
1) 接收方设备是否直接将其丢弃在硬件中,
2) 或接受它并将其发送给内核的 IP 堆栈来处理它?
3)什么时候发送ICMP frag-required?
4)如果以太网设备位于中间路由器与终端主机上,会有什么不同吗?
What is the behavior of an ethernet device in the packet ingress path?
If the sender is sending a larger-than-MTU frame, then:
1) does the receiver's device drop it directly in hardware,
2) or accept it and send it up for the kernel's IP stack to handle it?
3) when is ICMP frag-required sent?
4) does it make a difference if the ethernet device is say on a intermediate router vs a end host?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
对于所有设备和网络堆栈来说,不可能明确回答 1)、2)。以太网标准定义了 1500 字节的 MTU,因此这是您可以信赖的全部,并且通常您应该预期 MTU 较大的帧会被丢弃。
然而实际上,在终端主机中,如果网络接口硬件不丢弃超大帧(通常称为巨型帧),那么它很可能会沿着软件堆栈向上进行处理。即使堆栈可能不会因为超过 MTU 而丢弃过大的帧,但它仍可能因其他原因而被丢弃,例如由于内部队列耗尽。
尽管以太网帧的最大 MTU 保持不变,但以太网帧的最大大小随着时间的推移而增长,以包含 802.1Q VLAN 单标签和双标签等功能。 MPLS 进一步增加了帧大小以包含标签堆栈。这意味着中间交换机通常可以容忍超出接口 MTU 一定量的帧。一家主要供应商在其当前交换机中默认默认允许最大 MTU 为 2000 字节。较旧的交换机的耐受性可能较差。
要获得明确的答案,您需要对您关心的特定硬件和软件进行一些研究。
It is impossible to answer 1), 2) definitively for all devices and networking stacks. The Ethernet standard defines an MTU of 1500 bytes so that is all you can rely on and in general you should expect frames with larger MTUs to be dropped.
However in reality it is likely in an end host that if the network interface hardware doesn't drop the oversized frame (which is typically referred to as giant) then it will make it's way up the software stack and be processed. Even though the stack may not drop the oversized frame due to it being over the MTU it may still get dropped for other reasons, e.g. due to an internal queue exhaustion.
Although the maximum MTU of an Ethernet frame has remained constant the maximum size of an Ethernet frame has grown over time to encompass features like 802.1Q VLAN single and double tags. MPLS further increases the frame size to include label stacks. This means intermediate switches are usually tolerant of frames that exceed the interface MTU by some amount. One major vendor effectively tolerates a max MTU of 2000 bytes by default in their current switches. Older switches may be less tolerant.
To get a definitive answer you'll need to do some research into the specific hardware and software that you care about.