问题描述
为什么伪标头放在UDP数据报中UDP校验和的计算?这背后的原因是什么?
Why is the Pseudo header prepended to the UDP datagram for the computation of the UDP checksum? What's the rational behind this?
推荐答案
从TCP或UDP的角度来看,数据包不包含IP地址. (IP是它们下面的层.)
From the TCP or UDP point of view, the packet does not contain IP addresses. (IP being the layer beneath them.)
因此,为了进行正确的校验和,包括了伪头".它是伪"的,因为它实际上不是UDP数据报的一部分.它包含IP标头的最重要部分,即源和目标地址,协议号和数据长度.
Thus, to do a proper checksum, a "pseudo header" is included. It's "pseudo", because it is not actaully part of the UDP datagram. It contains the most important parts of the IP header, that is, source and destination address, protocol number and data length.
这是为了确保UDP校验和将这些字段考虑在内.
This is to ensure that the UDP checksum takes into account these fields.
这篇关于UDP/TCP中使用的伪标头的意义是什么的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!