What’s new in WCF 4.5? UDP transport support

added by idof
2/16/2012 9:43:17 AM

2 Kicks, 327 Views

This is the tenth post in the WCF 4.5 series. I’ve started this series of posts 4 months ago when .NET 4.5 developer preview was announced; The Beta/RC/RTM version is still to come, but hopefully it will be available soon, and you will be able to use the new WCF 4.5 features in your projects. Until now, I’ve shown new features in configuration easiness and hosting improvements. In this post and the next one I will cover new transport features, starting with the support for UDP transport.


2/16/2012 9:45:16 AM
I wonder what sort of recovery/retransmission logic it's using when UDP transport is active, if any. Is the assumption that if you're using UDP, you don't care about packet loss?

2/16/2012 10:38:49 AM
As far as I know UDP means uni-directional, meaning you don't know of packet losses.
(backed up by wikipedia: Protocols such as UDP provide no recovery for lost packets. Applications that use UDP are expected to define their own mechanisms for handling packet loss.)

Regarding to how WCF handles this situation I don't know, but I will try to find out.

2/16/2012 10:46:39 AM
Sorry, I know that UDP doesn't know about packet loss, but at the application level it's common to have some mechanism in place to detect when transmission errors have occurred.

For instance, let's pretend I'm going to multicast a file to several clients, I might send a checksum first so that the applications can check that the download completely successfully and request retransmission if it doesn't match. As a trade-off, I might send an expected content-length and send the file in chunks so that if I need to retransmit I only need to retransmit that chunk, rather than the whole file. This avoids the amount of overhead present in TCP, but still provides some failure recovery.

I was curious if WCF implements any sort of similar mechanism to detect transmission errors. Thanks for looking into it.

2/18/2012 10:03:49 AM
According to my sources at MS, the implementation of the UDP binding uses the transport "as-is" without handling packet loss.
My assumption is if there is a packet loss your service will have some sort of an encoder/serializer internal exception.