UDP数据包可以分为几个较小的数据包吗 [英] Can UDP packet be fragmented to several smaller ones

查看:86
本文介绍了UDP数据包可以分为几个较小的数据包吗的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果UDP数据包超过MTU,是否可以将其分割为几个较小的数据包?看来MTU碎片与IP层有关,所以我认为可以.

Can UDP packet be fragmented to several smaller ones if it exceeds MTU? It seems that MTU fragmentation is about IP layer so I think it can.

如果是,建议的最高通过UDP发送以防止分段的数据包大小,为什么?

If so, what is the recommended max. packet size to send over UDP to avoid fragmentation and why?

推荐答案

如果IP数据报大于MTU,则可以对其进行分段.是否包含UDP,TCP,ICMP等都没有关系.

Any IP datagram can be fragmented if it is larger than the MTU. Whether it contains UDP, TCP, ICMP, etc. does not matter.

大多数以太网网络都支持1500字节的MTU.在IPv4标头为20个字节而UDP标头为8个字节的情况下,UDP数据包的有效载荷应不大于1500-20-8 = 1472字节,以避免分段.

Most Ethernet networks support a 1500 byte MTU. With the IPv4 header being 20 bytes and the UDP header being 8 bytes, the payload of a UDP packet should be no larger than 1500 - 20 - 8 = 1472 bytes to avoid fragmentation.

这是假设数据包中不存在IP选项.如果是这样,则有效载荷将需要小于该载荷以解决该问题.

This is assuming no IP options exist in the packet. If so, the payload will need to be smaller than that to account for it.

这仅适用于IPv4. IPv6不支持分段.

This applies to IPv4 only. IPv6 does not support fragmentation.

您还可以看到有关UDP的MTU的问题.

这篇关于UDP数据包可以分为几个较小的数据包吗的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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