How to Handle Segmented Packets in a Private Game Server: Issue with MTU Limit and Packet Reception

40 Views Asked by At

I am working on creating a private server (running on the Python Twisted library) for a game and I am trying to rework the dataReceived() function to be able to handle when packets are segmented (when they exceed the 1500 MTU Ethernet limit).

I am currently testing this on a local server, and I am confused as to why a large packet (>1500 bytes) is being completely received by the server, despite Wireshark confirming that the entire packet was sent as one packet and not fragmented. I changed the MTU on the Loopback Pseudo-Interface to be 1480, but it's still only being sent as one packet. Here is the output of netsh int ip show int:

Idx     Met         MTU          State                Name
---  ----------  ----------  ------------  ---------------------------
  8          45        1500  connected     Wi-Fi
 13          35        1500  disconnected  Tunngle
  1          75        1480  connected     Loopback Pseudo-Interface 1
 21           5        1500  disconnected  Ethernet
  9          35        1500  disconnected  Ethernet 2
 38          15        1500  connected     vEthernet (WSL)

Packet info from Wireshark:

No.     Time          Source      Destination  Protocol   Length   Info    
41173   2129.639797   127.0.0.1   127.0.0.1    TCP        20293    57894 → 13337 [PSH, ACK] Seq=1 Ack=1 Win=65535 Len=20249
010. .... = Flags: 0x2, Don't fragment
    0... .... = Reserved bit: Not set
    .1.. .... = Don't fragment: Set
    ..0. .... = More fragments: Not set

I am wondering if there is something else I am missing or if anyone has any suggestions for how to proceed. Thank you in advance for any help or suggestions you can provide.

I attempted to send a large packet to my server from my client (running on the same PC). I expect to see fragmented packets, but instead the entire 20k byte payload was transferred in one packet (as confirmed by Wireshark).

0

There are 0 best solutions below