发送/接收tcp数据包时16毫秒量化
我有一个在 windows xp 32 系统上运行的 C++ 应用程序,发送和接收短 tcp/ip 数据包。
通过(准确地)测量到达时间,我发现到达时间被量化为 16 毫秒时间单位。 (意味着所有到达的数据包彼此间隔 (16 )xN 毫秒)
为了避免数据包聚合,我尝试通过将套接字变量中的 IPPROTO_TCP 选项设置为 TCP_NODELAY 来禁用 NAGLE 算法,但这没有帮助
我怀疑问题是与 Windows 时间表相关,它也有一个 16 毫秒的时钟。 有解决这个问题的想法吗? 谢谢
I have a C++ application running on windows xp 32 system sending and receiving short tcp/ip packets.
Measuring (accurately) the arrival time I see a quantization of the arrival time to 16 millisecond time units. (Meaning all packets arriving are at (16 )xN milliseconds separated from each other)
To avoid packet aggregation I tried to disable the NAGLE algorithm by setting the IPPROTO_TCP option to TCP_NODELAY in the socket variables but it did not help
I suspect that the problem is related to the windows schedular which also have a 16 millisecond clock..
Any idea of a solution to this problem ?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用更高分辨率的计时器,例如 QueryPerformanceTimer() 或 __rdtsc() 意识到他们的失败。
同样请注意,如果您使用等待函数,您可能需要调用 timeBeginPeriod() 用于 1ms 分辨率,甚至实现围绕更高分辨率计时器的繁忙路延迟函数。
Use a higher resolution timer such as QueryPerformanceTimer() or __rdtsc() being aware of their downfalls.
Similarly note if you are using wait functions you may want to call timeBeginPeriod() for 1ms resolution or even implement a busy-way delay function wrapped around a higher resolution timer.