Sign in to follow this  

[.net] Large Network Packets

This topic is 4036 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'm trying to send a large packet (>10kb) over a LAN connection, and the simple Socket.SendTo() Socket.Receive() system I'm using can't handle it. Actually, it craps out a lot sooner than that (<2kb). Is there some easy way of doing this in .NET, without splitting the data into smaller packets?

Share this post


Link to post
Share on other sites
Using UDP? I think there is a limit on packet size that's in the network system not .Net. It might be better to open a TCP connection for downloading large files; I think you're going to have to split and reassemble if you want to use UDP.

This might be better off in Multiplayer and Networking?

Share this post


Link to post
Share on other sites
The maximum size of a UDP packet (including framing overhead) is 64 kilobytes. However, the MTU of underlying transport will typically be smaller (in the range of 1500 bytes for Ethernet), so sending larger packets will generate IP fragmentation and re-assembly on the other end. This should all be transparently handled by the network stack, though -- when you say it doesn't work, what is the actual problem you're seeing? Are you setting some "do not fragment" flag, and getting an error, perhaps?

Also, with fragmented IP packets, your packet will have a larger chance of getting dropped, because if any one fragment is dropped, the entire packet will be lost.

Share this post


Link to post
Share on other sites
By "not working", I mean the network packet gets dropped completely. AFAIK, I'm not setting any "do not fragment" flags. I don't know much about TCP, which is why I went with UDP first, but I'll probably end up using TCP anyway.

Hadn't thought about the Multiplayer/Networking forum. [imwithstupid]

Share this post


Link to post
Share on other sites

This topic is 4036 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this