什么是UDP数据包的大小,如果我在C#0发送有效载荷数据? [英] What is the size of udp packets if i send 0 payload data in c#?

查看:406
本文介绍了什么是UDP数据包的大小,如果我在C#0发送有效载荷数据?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经碎裂之前想通了最大数据使用UDP是1472(其它端点可能有所不同)2端点之间。这说明MTU为1500bytes和头开销每包是28bytes.is它是安全的假设,如果我发送0字节的数据(有效载荷),传输的实际数据是28bytes? IM做一些bencchmark,所以它的重要,我知道在渠道发生了什么。谢谢。

I have figured out the maximum data before fragmentation between 2 endpoints using udp is 1472(other endpoints may vary). this states that mtu is 1500bytes and header overhead per packet is 28bytes.is it safe to assume that if i send 0 bytes data(payload), the actual data being transferred is 28bytes? im doing some bencchmark, so its crucial for me to know what happens in the channel. thanks.

推荐答案


  • MTU是一个IP数据包,可以的最大大小无碎片传输。

  • The MTU is the maximum size of an IP packet that can be transmitted without fragmentation.

    IPv4委托的路径至少576个字节的MTU,至少1280字节的IPv6转发功能。

    IPv4 mandates a path MTU of at least 576 bytes, IPv6 of at least 1280 bytes.

    以太网具有1500字节的MTU

    Ethernet has an MTU of 1500 bytes.

    这是IP包被由两部分组成:分组报头和有效载荷

    An IP packet is composed of two parts: the packet header and the payload.

    IPv4报头的大小为的至少的20个字节,IPv6报文头的至少的40个字节。

    The size of an IPv4 header is at least 20 bytes, the size of an IPv6 header at least 40 bytes.

    IP数据包的有效载荷是一个典型的TCP段或UDP数据报。

    The payload of an IP packet is typically a TCP segment or a UDP datagram.

    一个UDP数据报由一UDP标头和所传送的数据。

    A UDP datagram consists of a UDP header and the transported data.

    UDP报头的大小是8个字节。

    The size of a UDP header is 8 bytes.

    这意味着一个空的UDP数据报的IP数据包有效负载需要的至少 28(IPv4)的或48(IPv6)的字节,但可能需要多个字节。

    This means an IP packet with an empty UDP datagram as payload takes at least 28 (IPv4) or 48 (IPv6) bytes, but may take more bytes.

    另外请注意,在以太网的情况下,该IP包会额外地在一个MAC包裹(14字节头+ 4字节的CRC),其将被嵌入的以太网框架(8字节前导序列)。这增加了26个字节的数据到IP数据包,但不计算在MTU。

    Also note that in the case of Ethernet, the IP packet will additionally be wrapped in a MAC packet (14 byte header + 4 byte CRC) which will be embedded in an Ethernet frame (8 byte preamble sequence). This adds 26 bytes of data to the IP packet, but doesn't count against the MTU.

    所以,你不能假定一个UDP数据报将导致字节的具体数量要发送

    So you cannot assume that a UDP datagram will cause a specific number of bytes to be transmitted.

    这篇关于什么是UDP数据包的大小,如果我在C#0发送有效载荷数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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