使用UDP时路由器无响应 [英] Router gets unresponsive when using UDP

查看:157
本文介绍了使用UDP时路由器无响应的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发多人游戏.原理很简单,两个播放器中的每个播放器每隔50毫秒周期性地互相发送512字节.

I'm working on a multiplayer game. The principle is simple, each of the two players sends each other periodically 512 bytes every 50 milliseconds.

问题在于,大约每20-30秒,玩家就会停止接收数据,有时会持续一秒,有时甚至会长达20秒(尽管发送并未中断).

The problem is that about every 20-30 seconds players stop receiving data for sometimes one but sometimes even up to 20 seconds (though, sending had not been interrupted).

起初,我认为这是由于我或用于调试的远程PC一侧的网络连接速度慢所致.

At first I thought that this is caused by a slow network connection on either my side or on the side of my remote PC which I use for debugging.

但是后来我注意到,在游戏停止接收数据的同时,我这一边的所有网络流量都变慢了.

But then I noticed that all network traffic on my side slows down at the same times when the game stops receiving data.

所以我开始了ping <my-local-router>,这就是给我看的:

So I started ping <my-local-router> and this is what it shows me:


When the game isn't running:
...
64 bytes from 192.168.1.1: icmp_req=4520 ttl=64 time=4.89 ms
64 bytes from 192.168.1.1: icmp_req=4521 ttl=64 time=7.96 ms
64 bytes from 192.168.1.1: icmp_req=4522 ttl=64 time=10.5 ms
64 bytes from 192.168.1.1: icmp_req=4523 ttl=64 time=7.21 ms
64 bytes from 192.168.1.1: icmp_req=4524 ttl=64 time=8.10 ms
64 bytes from 192.168.1.1: icmp_req=4525 ttl=64 time=3.37 ms
64 bytes from 192.168.1.1: icmp_req=4526 ttl=64 time=5.12 ms
64 bytes from 192.168.1.1: icmp_req=4527 ttl=64 time=3.29 ms
...


When the game is running:
...
64 bytes from 192.168.1.1: icmp_req=47 ttl=64 time=6.99 ms
64 bytes from 192.168.1.1: icmp_req=48 ttl=64 time=1.69 ms
64 bytes from 192.168.1.1: icmp_req=49 ttl=64 time=2.60 ms
64 bytes from 192.168.1.1: icmp_req=50 ttl=64 time=2.88 ms
64 bytes from 192.168.1.1: icmp_req=52 ttl=64 time=9210 ms
64 bytes from 192.168.1.1: icmp_req=53 ttl=64 time=17144 ms
64 bytes from 192.168.1.1: icmp_req=54 ttl=64 time=16214 ms
64 bytes from 192.168.1.1: icmp_req=55 ttl=64 time=15372 ms
64 bytes from 192.168.1.1: icmp_req=56 ttl=64 time=14482 ms
64 bytes from 192.168.1.1: icmp_req=57 ttl=64 time=13486 ms
64 bytes from 192.168.1.1: icmp_req=58 ttl=64 time=12511 ms
64 bytes from 192.168.1.1: icmp_req=59 ttl=64 time=11546 ms
64 bytes from 192.168.1.1: icmp_req=60 ttl=64 time=10591 ms
64 bytes from 192.168.1.1: icmp_req=61 ttl=64 time=9626 ms
64 bytes from 192.168.1.1: icmp_req=62 ttl=64 time=1.34 ms
64 bytes from 192.168.1.1: icmp_req=63 ttl=64 time=3.33 ms
...

似乎游戏正在导致路由器无响应.

It seems that the game is causing the router to become unresponsive.

我的本​​地PC上没有运行任何P2P,但这听起来似乎没有任何意义,因为在游戏不运行时我没有遇到后备状态.

I don't have any P2P running on my local PC, but that doesn't even sound relevant since I don't experience the slowback when the game isn't running.

我是UDP编程的新手,对此我一无所知,尤其是因为每50毫秒512字节对我来说似乎是一个很小的带宽(当我运行P2P时,它很容易以1.5MB/s的速度运行).

I'm new to UDP programming and I'm getting clueless with this, especially since the 512 bytes every 50ms seems like quite a small bandwidth to me (when I do run P2P, it easily runs 1.5MB/s).

推荐答案

这可能是我的路由器快要死了,需要替换或无线驱动程序中有些杂物,因为我发现最近有更多的网络死机,甚至在应用程序未运行.

This might have been my router dying and needing a replacement or something fishy in my wireless drivers, as I've noticed more network freezes lately even at times when the application wasn't running.

这篇关于使用UDP时路由器无响应的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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