UDP 标头校验和不正确时是否会丢弃 UDP 数据包? [英] Are UDP Packets dropped when UDP header checksum is incorrect?

查看:17
本文介绍了UDP 标头校验和不正确时是否会丢弃 UDP 数据包?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我打开一个原始套接字,并发送带有错误校验和的 udp 数据包,这些数据包会被 tcp/ip 堆栈丢弃吗?

If i open a raw socket, and send udp packets with a wrong checksum, would the packets be dropped other side by the tcp/ip stack?

推荐答案

是的,他们会被删除.如果您需要更可靠的通信,最好使用 TCP.

Yes they would be dropped. If you need more reliable communication you're much better off using TCP.

有关更多信息,请查看以下内容:http://www.diffen.com/difference/TCP_vs_UDP

for more information, take a look at this: http://www.diffen.com/difference/TCP_vs_UDP

UDP 不能保证数据包会被发送,更不用说接收了.但是,如果它们实际上已收到,则会对其进行检查.如果它们校验和失败,它们将被丢弃.

UDP there's no guarantee that the packets will even be sent, let alone received. If they are in fact received though, they are checked. If they fail checksum they are dropped.

另外补充一点,默认情况下,udp 不会在发送数据包时对其进行排序,这必须在应用程序级别完成.如果您仍打算使用 UDP,请记住这一点.

also to add to that, udp does not by default order the packets as they are sent, that has to be done at the application level. Bear this in mind if you still intend on using UDP.

这篇关于UDP 标头校验和不正确时是否会丢弃 UDP 数据包?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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