通过UDP连接丢失数据包 [英] Packet loss via UDP connection

查看:145
本文介绍了通过UDP连接丢失数据包的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我应该使用交叉电缆通过直接连接来管理速率为64 mb/s的UDP流.当我收到数据包时,我看到数据包丢失了.我在Visual c ++ .net 2008中使用"winsock"功能.我的项目类型是ATL,创建的UDP套接字是同步的,流的内容是一个简单的16位计数器.有没有人遇到这个问题?请帮我.

解决方案

UDP不保证任何可靠性,数据包在传输过程中可能会丢失,重复或重新排序.如果您的应用程序无法处理数据包丢失,请改用TCP.


您在计算传输速率时是否考虑了数据包头?在数据包中发送16位将产生大量开销.尝试基本的方法:安装winsock,但使用WSA功能调整Windows套接字.另外,还有很多BIOS和IOCTL功能.

之后,如果您的GUI正确,您将看到它是实时工作.

否则,您可以在注册数据库中调整很多参数:请参见Microsoft开发人员网络(MSDN).

对于更高的比特率,我认为您应该使用用户模式驱动程序来接收? (请参阅KMD/UMD框架模型).


I should manage a UDP stream with 64 mb/s rate through direct connection using a cross cable. When I receive packets, I see packet lost occurs. I use "winsock" facilities in visual c++ .net 2008. My project type is ATL, the created UDP socket is synchronous and the content of stream is a simple 16 bits counter. Does any body encounter this problem? Pls help me.

解决方案

UDP doesn''t guarantee any reliability, packets may be lost, duplicated or reordered during transmission. If your application can''t deal with packet loss, use TCP instead.


Are you accounting for packet headers when calculating the transfer rate? Sending 16 bits in a packet will yield quite a lot of overhead.


I developp UDP transfer/reception at High Bit rates (12 Mbits/s) without any loss : but without CWinsock Class : try the basic : install winsock but use the WSA functions to tune windows sockets. Also there is a lot of BIOS and IOCTL functions.

After that, if your GUI is correct you will see that it works in real time.

Otherwise you can tune a lot of parameters in the register database : see Microsoft Developer Network (MSDN).

For Higher bit rate I think you should use a User Mode Driver to receive ? (see KMD/UMD framework model).


这篇关于通过UDP连接丢失数据包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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