Click to See Complete Forum and Search --> : UDP Socket Receive Buffer Size


bjizzle34
July 1st, 2007, 11:21 AM
I have a UDP socket receiving bursty multicast data and I am experiencing packet loss. The service time for each packet has been profiled and is very short. I beleive I am am overrunning the receive buffer which defaults to 8K (Win XP, C#).

In increasing the receive side buffer size to address the packet loss, I have seen degraded performance from my reads (longer timespans between send timestamps contained in packet and receive timestamps).

Are there any known limitations to the size of windows socket receive buffers? Has anyone experienced performance degredation when increasing the size of this buffer? Is it possible that the managed memory environment is having an adverse effect on my ability to ask the socket to work with a large receive side buffer?

dog_pig_baby
July 2nd, 2007, 09:48 AM
Both UDP send buffer and recv buffer are simply an upper limit on the maximum-sized UDP datagram that can be written to the socket or got data from socket,

The kernel buffer does not exsit and is invalid

MikeAThon
July 2nd, 2007, 11:18 AM
For UDP under Windows, there is a definite performance degradation above 1024 bytes. The step from 1024 to 1025 is remarkable, and some have reported that they can send three 1024 byte datagrams faster than one single 1025 byte datagram.

The threshold is caused by a registry entry whose default value is 1024: FastSendDatagramThreshold

For explanation of the issue see these NG articles:
http://groups.google.com/group/microsoft.public.win32.programmer.networks/browse_thread/thread/78580d2882c227cc/
http://groups.google.com/group/microsoft.public.development.device.drivers/browse_thread/thread/a78a4cdf090735df/

The registry parameter is described here: http://technet2.microsoft.com/windowsserver/en/library/94d21089-411b-4bce-a823-49a77a46e7661033.mspx

Mike