This happens with multiple players in all different countries, but the higher the latency the worse the problem is
The symptoms are a player will start connecting but then get instantly dropped.
From the player's perspective they get the password prompt, joining game loading bar, but fails at the downloading map stage.
If the host implements outbound UDP ratelimiting everything works fine. Changing the hosting server doesn't appear to help.
Outbound UDP shaping script:
While there is a global bandwidth limit in factorio, this is not per player. Tuning the global download required determining the slowest player's connection which is troublesome and error prone. And appears to require a server restart to apply.#!/usr/bin/env zsh
DEV=external
IPS=(XXX.YYY.ZZZ.1 XXX.YYY.ZZZ.2 XXX.YYY.ZZZ.3)
BANDWIDTH=20mbit
# Reinit
sudo tc qdisc del dev $DEV root handle 1
sudo tc qdisc add dev $DEV root handle 1: htb default 9999
# Create the new default class
sudo tc class add dev $DEV parent 1: classid 1:9999 htb rate 10000mbit
# Control bandwidth per ip
mark=0
for ip in $IPS; do
mark=$((mark+1))
# Traffic shaping rule
sudo tc class add dev $DEV parent 1:0 classid 1:$mark htb rate $BANDWIDTH ceil $BANDWIDTH
sudo tc qdisc add dev $DEV parent 1:$mark sfq perturb 10
# Filter rule
sudo tc filter add dev $DEV parent 1:0 protocol ip prio $mark u32 match ip dst $ip flowid 1:$mark
done
This may be a buffer bloat problem as once both the client and server have timed out, the host can still receive UDP packets 5-10 seconds later.