Page 1 of 1

Packet fragmentation (Factorio)

Posted: Fri May 05, 2017 5:46 pm
by impetus maximus
how does Factorio handle fragmented packets? let's say a firewall blocks them.
will blocking/dropping the fragmented packets cause any issues?

was going to put this in technical help, but i'm not having a problem. just curious.

cheers

Re: Packet fragmentation (Factorio)

Posted: Fri May 05, 2017 6:02 pm
by ledow
Nice homework question.

Re: Packet fragmentation (Factorio)

Posted: Sun May 07, 2017 5:34 pm
by impetus maximus
homework? are you going to school for networking?

Re: Packet fragmentation (Factorio)

Posted: Sun May 07, 2017 8:27 pm
by Daid
Factorio uses UDP, and one of the basics of UDP is that packets cannot be fragmented. A whole packet arrives or not. Maximum packet size is set by the lowest MTU of the whole link. But generally is more then 1400 bytes.

As for dropped packets, if you are using UDP, it's common knowledge to account for dropped packets. Even if packet loss is less then 1% these days. Factorio does, or people would be complaining a lot in network games. As the only other result would be people to desync from the game.

Re: Packet fragmentation (Factorio)

Posted: Sun May 07, 2017 9:36 pm
by Engimage
UDP packets CAN be fragmented. And it can easily happen if you got some routers with MTU lower than 1500 on your path.
However the path MTU discovery can easily fail and the best way to avoid this is setting your network adapter MTU to say 1400. This will most likely terminate all fragmentation issues.
Below is an article which will help you change and test a bit your fragmentation issues.
https://support.purevpn.com/how-to-chan ... ta-7-and-8

Re: Packet fragmentation (Factorio)

Posted: Sun May 07, 2017 10:20 pm
by impetus maximus
thanks for the help Daid, PacifyerGrey. :)

Re: Packet fragmentation (Factorio)

Posted: Mon May 08, 2017 10:55 am
by Daid
PacifyerGrey wrote:UDP packets CAN be fragmented. And it can easily happen if you got some routers with MTU lower than 1500 on your path.
I stand corrected. UDP indeed can be fragmented. However, if it's fragmented, it is also reassembled before it arrives at your application. And thus you will not notice this fragmentation except for a higher chance of dropped packets.

Re: Packet fragmentation (Factorio)

Posted: Tue May 09, 2017 6:02 am
by eX_ploit
In some networks udp packet of a size bigger than a certain number can be completely dropped instead of being fragmented. And if you just resend, it will get dropped again. So if you want to work with udp you need some kind of "test the waters" functionality which can find this number by trial, and not just assume a hardcoded mtu size.