[0.12.24] [waiting for 0.13] Multiplayer: Excessive UDP-packets?

This subforum contains all the issues which we already resolved.
Post Reply
canidae
Long Handed Inserter
Long Handed Inserter
Posts: 72
Joined: Thu Feb 18, 2016 6:24 pm
Contact:

[0.12.24] [waiting for 0.13] Multiplayer: Excessive UDP-packets?

Post by canidae »

My apologies if this has already been brought up, I could not find any discussion related to this issue on the forum.

I'm playing with a friend who's on ADSL, and we're experiencing some issues. When connecting to a dedicated server, his "multiplayer_waiting_statistics" quickly goes into the hundreds, and the game for both of us becomes incredibly sluggish. If I host the server the same happens. When he hosts the server, then my "multiplayer_waiting_statistics" sometimes goes up quite a bit and the game becomes sluggish (but playable), and eventually it manages to bring it back down. Even though the game was sluggish, we could move structures around on the surface quite fine (someone else talked about a similar problem some time ago, he/she made a video displaying the issue: https://www.youtube.com/watch?v=lQYaVHiFf0I).
Do take note that this does not happen with another friend who has a better internet connection, and when the friend on ADSL used his 4G cell phone connection instead the game ran much smoother with just minor and occasional lag.

While my friend was connected to the dedicated server he tried to ping other servers (like google.com), and he told me his ping time went from milliseconds to seconds as long as he was connected to the server. This makes me suspect that somehow the game effectively DoS-attack his own router.

I've understood it as the multiplayer network code is somewhat quickly implemented. I used wireshark to take a look at the packets being sent (to the dedicated server) and noticed that about 60 UDP packets are sent every second (and 60 received from the server every second). It seemed like this was connected to the "updates per second" of the game, so I wondered what would happen if I changed game.speed to 0.1 instead. This resulted in a several UDP packets being clustered and sent at a time with a longer interval between each bulk instead of one packet sent/received every 1/60th second. It didn't reduce the amount of UDP packets sent to and received from the server every second, only clustered the packets.

I'm assuming you're considering a new implementation for networking, but until then, perhaps it's possible to make the current protocol slightly more friendly for those with not so good internet connection? Is it feasible to reduce the amount of UDP packets?

sillyfly
Smart Inserter
Smart Inserter
Posts: 1099
Joined: Sun May 04, 2014 11:29 am
Contact:

Re: Multiplayer: Excessive UDP-packets?

Post by sillyfly »

That Factorio sometimes DoS's it's user is an issue to itself.

But as to the phenomenon described in the beginning of the post - moving the structure before placing is only done locally, and not sent to other peers, so it is no wonder this is not bound to multiplayer lag. As for the lag itself - as unintuitive as it may sound - try increasing the latency setting - it may allow more leeway for the lag-hiding in Factorio to give a smoother feeling, without throttling the gameplay constantly.

canidae
Long Handed Inserter
Long Handed Inserter
Posts: 72
Joined: Thu Feb 18, 2016 6:24 pm
Contact:

Re: Multiplayer: Excessive UDP-packets?

Post by canidae »

sillyfly wrote:As for the lag itself - as unintuitive as it may sound - try increasing the latency setting
Thanks for your input, but we've tried this and it makes no difference whether we set it to 50ms or 500ms. The same amount of UDP packets are sent/received and much points to that his router/connection simply can't handle it.

kovarex
Factorio Staff
Factorio Staff
Posts: 8078
Joined: Wed Feb 06, 2013 12:00 am
Contact:

Re: Multiplayer: Excessive UDP-packets?

Post by kovarex »

We are aware of this problem, and we plan to do something about it.
If we were sending packets less often, it would result into higher latency, but with higher latency settings they could probably by grouped by 2, 3 or more ticks together. This change could potentially break a lot of stuff, so it will have to wait for 0.13 to be solved.

Zeblote
Filter Inserter
Filter Inserter
Posts: 973
Joined: Fri Oct 31, 2014 11:55 am
Contact:

Re: [0.12.24] [waiting for 0.13] Multiplayer: Excessive UDP-packets?

Post by Zeblote »

Your router can't handle 60 small packets a second ...? Sounds like you should get a better one.

canidae
Long Handed Inserter
Long Handed Inserter
Posts: 72
Joined: Thu Feb 18, 2016 6:24 pm
Contact:

Re: Multiplayer: Excessive UDP-packets?

Post by canidae »

kovarex wrote:We are aware of this problem, and we plan to do something about it.
If we were sending packets less often, it would result into higher latency, but with higher latency settings they could probably by grouped by 2, 3 or more ticks together. This change could potentially break a lot of stuff, so it will have to wait for 0.13 to be solved.
Thanks for your response. On the roadmap for 0.13 it says "Multiplayer production polish", but it wasn't clear if you were aware of this actual issue. As noted, I was unable to find any discussions about the amount of UDP packets clogging the tubes. Unfortunately for us, there are limited other options for my friend to improve his internet connection, so we'll be looking forward to 0.13 and hope this version will solve our problems.

kovarex
Factorio Staff
Factorio Staff
Posts: 8078
Joined: Wed Feb 06, 2013 12:00 am
Contact:

Re: [0.12.24] [waiting for 0.13] Multiplayer: Excessive UDP-packets?

Post by kovarex »

Zeblote wrote:Your router can't handle 60 small packets a second ...? Sounds like you should get a better one.
But imagine 10 player game, the server has to receive and send 600 pocket per second.

Zeblote
Filter Inserter
Filter Inserter
Posts: 973
Joined: Fri Oct 31, 2014 11:55 am
Contact:

Re: [0.12.24] [waiting for 0.13] Multiplayer: Excessive UDP-packets?

Post by Zeblote »

kovarex wrote:
Zeblote wrote:Your router can't handle 60 small packets a second ...? Sounds like you should get a better one.
But imagine 10 player game, the server has to receive and send 600 pocket per second.
They're playing with 2 people, though.

User avatar
yngndrw
Burner Inserter
Burner Inserter
Posts: 17
Joined: Tue Mar 01, 2016 12:14 pm
Contact:

Re: [0.12.24] [waiting for 0.13] Multiplayer: Excessive UDP-packets?

Post by yngndrw »

kovarex wrote:
Zeblote wrote:Your router can't handle 60 small packets a second ...? Sounds like you should get a better one.
But imagine 10 player game, the server has to receive and send 600 pocket per second.
I just wanted to try and put some perspective behind the numbers being mentioned here. There are many factors so any numbers should be used as a guide.

Mikrotik are a router company who specify the performance of their routers on their site, so I'll use them as a guide. Please take this as an example:
http://routerboard.com/RB750r2
This router has an 850MHz CPU and can, at worse case with ip filtering rules, route 40,600 packets per second.

A common router provided for free by BT in the UK is the Home Hub. It's a poor router, but will have a modern CPU. The current Home Hub is the Home Hub 5 which was released at the end of 2013, but even the ancient the Home Hub 3 had a 400MHz CPU. Essentially what I'm trying to show is that the RB750r2 is not an unreasonable guide for the kind of router that most people would have even if they are using their ISP's standard router and that can support enough packets for over 650 players assuming 60 per second per player.

The point I'm trying to get to here is that it's very unlikely to be his router - I'd suspect the cause to within either the game or the OS. (Or possibly excessive packet loss)

Koub
Global Moderator
Global Moderator
Posts: 7227
Joined: Fri May 30, 2014 8:54 am
Contact:

Re: [0.12.24] [waiting for 0.13] Multiplayer: Excessive UDP-packets?

Post by Koub »

kovarex wrote:the server has to receive and send 600 pocket per second.
Pockets everywhere
Sorry, that was totally useless, but I lol'd when I saw it :)
Koub - Please consider English is not my native language.

canidae
Long Handed Inserter
Long Handed Inserter
Posts: 72
Joined: Thu Feb 18, 2016 6:24 pm
Contact:

Re: [0.12.24] [waiting for 0.13] Multiplayer: Excessive UDP-packets?

Post by canidae »

yngndrw wrote:I just wanted to try and put some perspective behind the numbers being mentioned here. There are many factors so any numbers should be used as a guide.

Mikrotik are a router company who specify the performance of their routers on their site, so I'll use them as a guide. Please take this as an example:
http://routerboard.com/RB750r2
This router has an 850MHz CPU and can, at worse case with ip filtering rules, route 40,600 packets per second.
...
The point I'm trying to get to here is that it's very unlikely to be his router - I'd suspect the cause to within either the game or the OS. (Or possibly excessive packet loss)
Interesting find. While it may not be the router, I'm still fairly sure the issue is within his connection (whether it be router, switch, modem, cables, network interface) as even browsing the web while he was connected to the server became incredibly slow. Further, I suspect his router and switch are integral parts of his ADSL-modem, so it may not be fair to compare the router with a 100Mbit router as he has something like 1500/100Kbit connection and technically no need for a 100Mbit router. Even so, I do not disagree with your suspicion that the problem lies somewhere else as handling 60 packets/sec shouldn't be an issue for most routers.
If they're revising the network protocol for 0.13 this discussion may be moot, though.

User avatar
MasterBuilder
Filter Inserter
Filter Inserter
Posts: 348
Joined: Sun Nov 23, 2014 1:22 am
Contact:

Re: [0.12.24] [waiting for 0.13] Multiplayer: Excessive UDP-packets?

Post by MasterBuilder »

Almost all packet sizes are bound by the standard MTU of 1500 bytes.
60 packets/s [* 1500B] is 90kB/s. You probably received more than 90kB/s just by viewing this web page.

I don't know what your friend's ADSL bandwidth cap is but going by this.
The lowest DL speed there is 1.5mb/s, aka 187.5kB/s.
True to it's name, the paired upload speed is 0.5mb/s. An abysmal 62.5kB/s

Let's assume that Factorio uses 90kB/s per player. With the worst ADSL speed you wouldn't even be able to upload fast enough to for MP at all.

ADSL sucks; not your router. Even a 10$ bargain bin router would scoff at those speeds.

4G cell speeds ave vastly superior to ADSL. Your friend is most likely exceeding his ADSL UL/DL bandwidth.

NOTE: I'm assuming Factorio is sending 60p/s, each [packet] at their theoretical max size limit (MTU). I imagine this is much smaller in practice.
NOTE2: None of this takes any sort of VoiP you might be using to communicate with into account. Just Factorio MP speeds.
Give a man fire and he'll be warm for a day. Set a man on fire and he'll be warm for the rest of his life.

kovarex
Factorio Staff
Factorio Staff
Posts: 8078
Joined: Wed Feb 06, 2013 12:00 am
Contact:

Re: [0.12.24] [waiting for 0.13] Multiplayer: Excessive UDP-packets?

Post by kovarex »

As most of the multiplayer has been rewritten for 0.14, I will move this to resolved.

Post Reply

Return to “Resolved Problems and Bugs”