Jump to content
  • Advertisement

Archived

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

zackriggle

UDP packet question

This topic is 5480 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I need to know if (hoping that it exists) what is the most amount of data that you could send over a UDP session WITHOUT that data being borken up into smaller packets. I am hoping that this is at LEAST 256-512 bytes. Thx XtaC

Share this post


Link to post
Share on other sites
Advertisement
256-512 should be usually safe, UNLESS your machine is set to have a really low UDP MTU. It''s unfortunately configurable on some protocol stacks.

If we''re talking windows boxes, ~1500 is the upper limit that might safely travel through a home NAT (1536 being ethernet MTU). Bigger packets will be broken up on the IP level, and some NATs are not too happy about reassembling them. Some routers drop them outright, even.

So, as long as you stay below that, you are AOK.

- Robert

Share this post


Link to post
Share on other sites
LAN: <= 1472 bytes of user data will be fine.
Internet: <=548 bytes of user data will be fine.

Chances are you can get by with larger packets on the Internet, but 576 is guaranteed to not be fragmented by IP. subtract the headers (20+8) leaves you with 548. Keep in mind the IP header can be longer than 20 bytes, but probably won''t be unless you are twiddling with it explicitly.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!