本文介绍了UDP为什么具有字段"UDP Length"(UDP长度)?包里有两次?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为什么UDP在其数据包中两次出现"UDP Length"字段?这不是多余的吗?如果需要某种错误检查,请提供示例.

Why does UDP have the field "UDP Length" twice in its packet? Isn't it redundant? If it is required for some kind of error checking, please provide an example.

推荐答案

来自 RFC 768 :

概念上以UDP头为前缀的伪头包含 源地址,目的地址,协议和 UDP长度. 此信息可防止路由错误 数据报.此校验和过程与TCP中使用的过程相同.

The pseudo header conceptually prefixed to the UDP header contains the source address, the destination address, the protocol, and the UDP length. This information gives protection against misrouted datagrams. This checksum procedure is the same as is used in TCP.

              0      7 8     15 16    23 24    31
             +--------+--------+--------+--------+
             |          source address           |
             +--------+--------+--------+--------+
             |        destination address        |
             +--------+--------+--------+--------+
             |  zero  |protocol|   UDP length    |
             +--------+--------+--------+--------+

真正的答案是,这是一个伪头"-即,它用于计算校验和,但实际上并未发送.至少那是我从中得出的结论. UDP/TCP中使用的伪标头的重要性

The REAL answer is that this is a "pseudo header" - that is, it is used for calculating the checksum, but not actually sent. at least that is what I conclude from What is the Significance of Pseudo Header used in UDP/TCP

这篇关于UDP为什么具有字段"UDP Length"(UDP长度)?包里有两次?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-25 21:18