Zulfiqar's weblog

Architecture, security & random .Net

WCF Reliable Messaging Retransmission Algorithm

Posted by zamd on October 13, 2010

When configuring WS-Reliable messaging, you would notice that even though number of retries (MaxRetryCount) is configurable but the interval in which retries are attempted is NOT configurable.  This is because WCF uses an exponential back-off congestion control algorithm to calculate the retry timeout.  This algorithm is internal to WCF and is NOT configurable.

The initial retry time is calculated based on the “session initiation time” (Time difference between the CreateSequence and CreateSequenceResponse). The algorithm doubles the retransmission delay with every attempt until MaxRetryCount reached.

If you try to send large messages inside a reliable session you might see additional retransmission fairly quickly. As the RM implementation calculates its initial retransmission timeout based on the “session initiation time” which remains quite small value (< 50ms ) in most cases. Now if the second message is a large one – the retry timeout expires and message is retransmitted.  This behaviour is by design as Reliable messaging is not intended to be used for large messages – this is why it doesn’t support streaming. If your goal is to send large messages and survive broken connections, then you should look at ReliableSessions along with the ChunckingChannel.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: