UDP/TCP 中使用的 Pseudo Header 的意义是什么 [英] What is the Significance of Pseudo Header used in UDP/TCP

查看:28
本文介绍了UDP/TCP 中使用的 Pseudo Header 的意义是什么的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为什么 伪标头被添加到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 中使用的 Pseudo Header 的意义是什么的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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