Archived

This topic is now archived and is closed to further replies.

mepem

Optimal Packet Size?

Recommended Posts

I''ve read up a bit on optimal packet sizes. I am so far under the impression that it varies. Additionally, "Long packets reduce overhead, but shorter packets make efficient forward error correction (FEC) codes". Bigger packets can lead to greater packet loss (due to high error probability). Smaller packets have increased overhead (due to header sizes). Also, I read the Maximum Transfer Unit (MTU) size is 1500 bytes, yet I''ve seen sources suggesting 512 bytes. Any ideas on this descrepency? Any ideas on what packet sizes I should be trying to create? Thanks

Share this post


Link to post
Share on other sites
For maximum size consider the following:
ethernet MTU is typically 1500. subtract your udp header and ip header, that leaves you with 1472 bytes for LAN games.

IP can have a variable MTU across a wide variety of networks/routers. However, packets of 576 bytes or less are guaranteed to traverse the IP network without getting fragmented (which means you will have fewer dropped packets). I believe that leaves you with 548 data bytes, unless you want consider a 60 byte IP max header length, which would leave you with 508 data bytes.

Going larger on either of these numbers could have significant affect on the responsiveness of your game. If your game doesn''t need good response times, then disregard these numbers...

Share this post


Link to post
Share on other sites