Welcome to Community Server Sign in | Join | Help

To UDP, or not to UDP, that is the question…

Generically, SIP can use (at least) 3 types of transport. Office Communications Server supports TCP and TLS, with the latter being the default (actually, TLS runs on TCP).

Various interactions with some partners and customers of late of have posed the question: "Why doesn’t OCS support SIP over UDP?" Their belief is that UDP is the ‘lowest common denominator’ SIP transport that is supported by "everyone" and that, by not supporting it, OCS is out of step with the mainstream of SIP implementation and interoperability.

Let’s evaluate that proposition on its merits.

Why doesn’t OCS support UDP?

There are three issues with UDP:

1) It is not encrypted, so you can’t ensure end to end security of SIP messages. There is no shortage of opinions on the security, or the lack thereof, of SIP (e.g. Cert® Advisory, ). As a text based protocol that is human readable (if ‘readable’ is the right word…it is not exactly prose…) there are privacy/security issues of sending SIP ‘in clear’. Furthermore, UDP allows for easier spoofing of packets since connection state doesn’t need to be maintained (remember Slammer?....UDP). This is why OCS customers are strongly recommended to accept TLS over TCP as the default SIP transport within the OCS network.

2) UDP has a fundamental flaw for large SIP messages: the size of the UDP datagram is limited to 1500 bytes, so a SIP message larger than that will be broken into two or more packets. The application layer (client or server) can receive the fragments out of order or a fragment could be lost (see 3 below). Since OCS SIP messages tend to contain various XML bodies, machine generated unique IDs (e.g. GRUUs), ICE candidate attributes, (etc.) they will normally span multiple packets.

3) UDP is a "fire and forget" protocol: this is to say that the transport layer does not consider lost or delayed packets. The onus of tracking messages for which no response has been received (and the generation of new requests) is left to the application layer: this leaves the application (the client or the server) vulnerable to overload situations. In bad network conditions, the best case scenario is a call setup delay. The worst case scenario is that the SIP network can reach a tipping point where the session timers are tripping for every transaction because the network elements are busy generating, or responding to, "retries" – a so-called "retry storm".

A commercially deployable enterprise communications solution must, at the very least, be secure, reliable and scalable. UDP presents challenges in all of these areas and the SIP RFCs (see below) allow us to choose from alternative SIP transports. Within the OCS network we use TLS, and at the edge of the network we can interoperate over TCP.

Why do people object to TCP or TLS as a SIP transport?

The fundamental objection to SIP over TCP or TLS is that it they are computationally expensive relative to UDP. There are several parameters at the transport, session and application layers that affect transaction performance:

· Stateful vs. Stateless

· Authentication vs. no Authentication

· Encryption vs. no Encryption

An IBM Research article "Evaluating SIP Proxy Server Performance" examined, among other things, the impact of the choice of SIP transport protocol on SIP transaction throughput. The authors found clear evidence that stateless UDP with no authentication (and therefore no encryption) has, by far, the highest throughput. However, this modality is completely incompatible with a reliable and secure commercial communications service. Stateful transaction processing with authentication yielded a 43% transaction degradation when using TCP compared with UDP. However, the authors were using an open source proxy server and brought to light various performance issues that were implementation specific.

An IEEE Article "SIP Security Issues: The SIP Authentication Procedure and its Processing Load" further examines the security and authentication overhead issue and found only a 5.5% overhead to TCP vs. UDP. Their summary includes the comment:

Another interesting finding is that the TCP processing introduces a small increase [in processing overhead] with respect to UDP and that the additional increase due to TLS is almost negligible.

Therefore, if you compare UDP to TCP and TLS in a commercially deployable solution, it is hard to defend the argument that the overhead of TCP and TLS outweigh the reliability and security advantages that they provide.

The debate regarding whether or not TCP is inefficient/expensive has been going on for many years. An IEEE Landmark Article "An Analysis of TCP Processing Overhead" published in June 1989 disproves the notion that TCP (by then a 15 year old protocol) is an inefficient protocol. The fact that it is still in use nearly 20 years later suggests that the authors were correct and that current anti-TCP sentiment is based upon "techno-urban legend", rather than scientific analysis.

Is UDP more standard than TCP or TLS?

There is a belief among certain constituencies that UDP is "more standard" than TCP or TLS.

From a historical perspective, the original SIP spec, RFC 2543 (published in March 1999), states:

User agents SHOULD implement both UDP and TCP transport. Proxy, registrar, and redirect servers MUST implement both UDP and TCP transport.

Note that equal priority was given to TCP and UDP. If you take a look at the current SIP spec, RFC 3261 (published in June 2002), you will see in section 18 the following statements related to SIP transport:

All SIP elements MUST implement UDP and TCP. SIP elements MAY implement other protocols.

Making TCP mandatory for the UA is a substantial change from RFC 2543. It has arisen out of the need to handle larger messages, which MUST use TCP, as discussed below. Thus, even if an element never sends large messages, it may receive one and needs to be able to handle them.

While it is true that OCS does not comply with RFC 3261 by not offering or accepting UDP, the assumption that all SIP messages will exceed the UDP datagram size limit provides an implied waiver on this requirement. Furthermore, TCP is the base transport for TLS, which we strongly recommend for security reasons; note that TLS does not run on UDP. Therefore, the conjunction of the security, fragmentation and reliability/scalability issues has lead us to the conclusion that UDP is not a useful transport for the transmission of SIP messages.

Is UDP the preferred SIP transport?

In order to verify the notion that SIP over UDP is supported by everyone, and yet TCP/TLS is supported by no-one, let’s examine the SIP offerings of the (overwhelming) majority market share vendors:

Vendor

UDP

TCP

TLS

Reference

Microsoft

N

Y

Y

http://download.microsoft.com/download/d/b/6/db641148-427b-41d3-9f20-7ffbddaf65b8/OCS_VoIP_Guide.doc

Cisco

Y

Y

Y

http://www.cisco.com/en/US/docs/ios/12_4t/12_4t11/FeatTLS.html#wp1092137

IBM

N

Y

Y

http://download.boulder.ibm.com/ibmdl/pub/software/dw/lotus/sametime-sip.pdf

Nortel

Y

Y

Y

http://www142.nortelnetworks.com/techdocs/CS1K_5_0/pdf/NN43001-564_01.05_NRS.pdf

Avaya

Y

Y

Y

http://www.avaya.com/gcm/master-usa/en-us/products/offers/sip_enablement_services.htm&View=ProdTechSpec

Alcatel-Lucent

Y

Y

N

http://www1.alcatel-lucent.com/doctypes/articlepaperlibrary/pdf/ATR2002Q4/T0212-SIP_Technology-EN.pdf

Siemens

Y

Y

Y

http://www.enterprise-communications.siemens.com/Products/Phones%20Clients/Desktop%20Phones/~/media/6DAA007008EB4A5CA0212A6D12A49770.ashx

AudioCodes

Y

Y

Y

http://www.audiocodes.com/objects/sbc/nCite_4000.pdf

Nextpoint

Y

Y

Y

http://www.nextpointnetworks.com/files/NextPoint_SBC_USLTR_2008_hirez.pdf

Acme Packet

Y

Y

Y

http://www.acmepacket.com/html/page.asp?PageID={06E4AEBC-24E2-46CC-BA95-7C74288FA45B}

Covergence

Y

Y

Y

http://www.covergence.com/stuff/contentmgr/files/4adf40f79f81482fff714c46d8e06832/misc/ssesb.pdf

Based on this small, but statistically significant sample – there is a strong argument that TCP is actually the lowest common denominator SIP transport. Certainly, the notion that vendors do not support, and customers can not deploy, SIP over TCP is thoroughly debunked.

Conclusion

We have examined the myth that UDP is the best choice SIP transport:

· We have evaluated whether or not UDP is a good protocol for a commercially reliable, secure and scalable communications service

· We have examined the evidence that TCP, with stateful transaction processing and authentication, is significantly less performant than UDP

· We have determined whether there is any basis for a bias towards UDP in the SIP standards

· We have also examined the support of UDP, TCP and TLS in the majority of enterprise and service provider SIP deployments

As Adam and Jamie say on the Discovery Channel’s ‘Mythbusters’: I think we are ready to make a call on this myth….and it is definitely ‘busted’.

Russell Bennett

Lead Program Manager

Published Friday, May 23, 2008 5:15 PM by ocsteam
Filed Under:

Comments

 

Ahlewis53 said:

Great article Russell. I knew some of them but others were a surprise. Are there any plans for the OCS team to implement SIP over UDP as an option, even if not the preferred option, to comply with the RFC and ensure compatability with solutions like Asterisk that currently only support SIP over UDP?
May 25, 2008 1:54 PM
 

ram said:

Well... After going through the article it seems SIP over UDP is not a good idea at all.
I wont like any product to implement something really not good just to comply with an RFC.
We have seen few of the customers who will have loose stand to be rigid at what is recommended by Microsoft. They would rather say that since something has been given as an option they should be able to use it!!!
Just my opinion!!!
May 27, 2008 12:30 PM
 

Russell Bennett said:

Alex,

Regarding OCS implementing UDP - to misquote Forrest Gump, there is nothing left to say on that subject.

Regarding Asterisk not supporting TCP.  I believe that the whole idea of open source is that missing features can be implemented by the community - and sure enough, someone has, see:  http://blog.brickaloch.com/index.php/2007/10/19/sip-tcp-support-in-asterisk/

Russell
May 27, 2008 7:51 PM
 

jesup said:

Interesting article, but...

From the point of view of an endpoint manufacturer, who has to interoperate with many different endpoints, I'd note that you glossed over some major issues:

First, your survey of Lowest Common Denominator was almost entirely focused on other server manufacturer.  Given the requirement even back in RFC 2543 that servers support both TCP and UDP, it isn't surprising that all major commercial servers support both (except Microsoft and IBM, and IBM's server is not a general-purpose SIP server).

If you were to do the same survey of endpoints, you'd find that many, probably the majority, of consumer endpoints (both softclients and hard SIP IP phones) do not support TCP at all.  None of those endpoints or softclients can be used with OCS.

Second, the major argument against TCP for SIP is not computational overhead (though that argument might be made for TLS in some cases).  The argument against TCP is based around call setup time and handling of lost packets.

Call setup time involves a TCP connection creation when not using an outbound proxy (and perhaps when using one).  In the "normal" case this ends up requiring several more RTTs.  The issue with SIP and other realtime communication protocols is more related to the number of handshakes required and the associated RTTs.  Microsoft OCS might not care as much about number of handshakes for call setup, since most of the communication is on high-bandwidth, low-loss, very-low-RTT internal corporate networks.  But SIP is designed to work when your server is 1/2 a world away - if your RTT is (say) 150ms, then a few extra handshakes can move call setup time from around 200ms to easily over 1/2 second, or more.  This can get even worse when 802.11 bridges are involved (added delay).  Remember - delay and throughput are two different things.

TCP's response to lost packets can also involve considerable delay (if you have to wait for timers) and reduction in transport rate.  The same loss of packets in UDP SIP requires waiting for the SIP retry to fire, but it still will generally have a considerable advantage in call setup time.

Third, you absolutely can encrypt SIP messages over UDP if you wish (including end-to-end), and it's common to authenticate without encryption (Digest Auth).  I'll agree it's not commonly done.  Note also that TLS only provides link-level guarantees; unless you trust every server in the entire transaction you need to use something like end-to-end encryption, or at least use SIPS uris.

Fourth, the strongest argument (and it is strong) is the 1500ish byte limit to UDP SIP messages.  Note that you invoke RFC 2543 - that RFC allows for fragmented UDP messages, and both RFCs mandate that all implementations allow incoming fragmented UDP.  RFC 3261 says you shouldn't send fragmented UDP SIP messages, mostly because fragmented UDP is less reliable due to retransmission requiring sending all the sub-packets again, and so increasing exposure to repeated loss.

Perhaps Microsoft OCS packets are large enough for this to be an issue.  Note also that many/most consumer endpoints fragment UDP SIP even though RFC 3261 says not to.


In conclusion, your arguments seem to mostly consist of setting up strawmen and knocking them over.  You make some good points, but they're poisoned by the proximity to disingenuous or slanted arguments.
June 8, 2008 1:08 AM
 

Dmitry Polzin said:

In fact OCS's inplemetation of SIP is quite strict and well done. This question was pointed by me to the Microsoft technical specialist during the first meeting in Moscow office in 2007 in a week after I first saw OCS running on my server.

The sky is blue, water is wet, OCS does not support UDP.
 
Now we have OCS as the only telephony system in our office, provider is strict UDP SIP provider, interoperability between them is made by Communigate Pro and everything is working perfectly (exept one point in OCS Mediation service  - manual fix worked).

Still planning to finish writing .NET SIP UDP-To-TCP - more for fun than for production.
June 20, 2008 9:22 AM
 

DFrank said:

I understand the reasons why TCP/TLS is better and more secure for SIP transport, but that is a reason to disable UDP by default, not a reason to completely remove it from the product options. The RFC even states TCP & UDP as a requirement but MS developers "know better" than the rest of us I suppose.
June 26, 2008 11:25 PM
 

long said:

Hello Guys,
sorry for asking a question here, but i can find an answer on MSDN (http://forums.microsoft.com/msdn/ShowPost.aspx?PostID=3563309&SiteID=1).

So, question is:
"Does anybody know what is the max length of this attribute? I did not find this information in the documentation, just tried to set different RCC SIP URIs(msRTCSIP-LineServer) through Active Directory Users and Computers snap-in and received that in some cases, the maximum length is 211 characters, but in other cases it is more than this number.

Can anyone advise me on this attribute?"

Also I asked here - http://directoryprogramming.net/forums/thread/4090.aspx
Joe suppose to check rangeUpper for this attribute, but in scheme for LCS 2005, there is no such property for msRTCSIP-LineServer. I checked it with ADSI Edit.

May be LCS\OCS team can help me? ;)
July 3, 2008 7:24 AM
 

jesup said:

no response, I see.

too bad...  I was hoping for a discussion.

BTW, I'm an IETF reviewer and am also involved in writing a number of current drafts and RFCs.
July 18, 2008 6:04 PM
 

erock said:

As an engineer for a hosted PBX and SIP trunking service provider I have to completely agree with jesup.

First I want address your first 3 issues with UDP:

1.) " It is not encrypted, so you can’t ensure end to end security of SIP messages."

Assuming we're talking about SIP for VoIP (vs. IM) then other than your username/password auth credentials (which - as jesup mentioned - can be secured with SIP digest auth) - which packets are crucial in your SIP signaling to be encrypted?  Your media, the RTP stream, is more likely what people want encrypted and that can be done at the endpoints.

2.) "UDP has a fundamental flaw for large SIP messages: the size of the UDP datagram is limited to 1500 bytes"

True, but again for VoIP over SIP the packets are relatively tiny.  Some of the only packets we've seen to break this limit are SIP NOTIFYs used for presence.  However, common VoIP functionality will work perfectly fine under this 1500 byte ceiling.  For example... here is a normal SIP invite with it's SDP body:

INVITE sip:bob@example.com;user=phone SIP/2.0.
Via: SIP/2.0/UDP 192.168.0.150;branch=z3kG4bKc765287d81159534.
From: "Alice" <sip:alice@example.com>;tag=E53E11C9-E57FA9E9.
To: <sip:bob@example.com;user=phone>.
CSeq: 1 INVITE.
Call-ID: 4fed5875-1af87d8f-cef6bc7e@192.168.0.150.
Contact: <sip:alice@192.168.0.150>.
Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, INFO, MESSAGE, SUBSCRIBE, NOTIFY, PRACK, UPDATE, REFER.
User-Agent: Foobar-UA-string-xyz.
Supported: 100rel,replaces.
Allow-Events: talk,hold,conference.
Max-Forwards: 70.
Content-Type: application/sdp.
Content-Length: 251.
.
v=0.
o=- 1216822295 1216822295 IN IP4 192.168.0.150.
s=Foobar Phone.
c=IN IP4 192.168.0.150.
t=0 0.
m=audio 2222 RTP/AVP 0 8 18 101.
a=sendrecv.
a=rtpmap:0 PCMU/8000.
a=rtpmap:8 PCMA/8000.
a=rtpmap:18 G729/8000.
a=rtpmap:101 telephone-event/8000.

a mere 826 characters... well under the 1500 byte ceiling and one of the largest (if not the largest) packet you will see in a normal call flow.  The remaining responses ACKs, REFERs, and BYEs of a normal dialog are all well under the ceiling.

3) "UDP is a "fire and forget" protocol"

Well this is just a silly argument... if you have packet loss/latency/jitter on your VoIP network then your experience hearing the media will be horrendous, it won't matter what transport protocol your signaling uses. UDP, TCP, SCTP... none of them will make a lick of difference when your RTP packets are dropping.  Losing only 1% of your packets can create a very poor user experience in VoIP land.

OK... now on to possibly the most egregious statement made in this blog post:

"While it is true that OCS does not comply with RFC 3261 by not offering or accepting UDP, the assumption that all SIP messages will exceed the UDP datagram size limit provides an implied waiver on this requirement."

WHOA!!!! That is one sweeping assumption... well I've already shown that this assumption is gravely mistaken with a normal SIP invite packet (see above)... so that must mean your primary reason for disobeying a requirement of the RFC is invalid... Were any SIP packets actually examined before making this assumption?

Finally let me ask this... the Microsoft Response Point that just released it's SP1 last month supports SIP over UDP by default (http://www.microsoft.com.nsatc.net/responsepoint/resources-whitepapers-sbsintegration.aspx)... does that come as a surprise to the author of this article? And do you disagree with their decision to support UDP?  If you do disagree - why does Microsoft offer 2 VoIP products with vastly different philosophies as to the way VoIP over SIP should work? However, if  you do agree (with Response Point's support of UDP) - then why again doesn't OCS support it? Whatever your answer is... I would love to hear it.

-----

curious
July 23, 2008 7:14 PM
 

Russell Bennett said:

Hmmm....this is quite an emotive topic, I see.

I will attempt to respond objectively to some of the comments made above:

First of all, we are *not* saying that UDP should not be used as a SIP transport by anyone.  In fact, we acknowledge the RFC's requirement to support it by quoting the RFCs directly.  What we are saying is that we choose not to support it for the reasons stated above.  There are many implementations, including the one created by Jesup (Ojophone) and those of many SIP Trunk service providers (Erock) that don't support TCP.  This is the implementer's choice - customers aren't compelled to buy something that doesn't addresss their requirements.

Of course you can encrypt SIP over UDP: you can encrypt anything.  The only RFC-endorsed encrypted SIP transport is TLS, and that runs on TCP, as stated.

Erock and Jesup seem to concede the UDP datagram limit issue.  However, Erock provides an example of an 826 byte SIP INVITE as evidence that this is all that is required.  However, the fact is that our implementation generates longer SIP INVITES, for the reasons stated in my article.  I recently sent a trace of a 3700 byte SIP INVITE (OCS TO PSTN GW) to someone who couldn't accept this assertion.  That person responded that I had either padded the file or our implementation was flawed.  I didn't bother to respond.

Regarding Erock's claim that the packet loss argument is invalidated by the impact of packet loss on the audio user experience.  That would be correct, if it were not for the fact that we have 3rd party validation, and have demonstrated in public, our audio healing capabilities matching or exceeding PSTN fidelity in a 10% packet loss situation.  If we could apply forward error correction to SIP messages, I suppose we would.

Please note that we haven't 'disabled' UDP - it never actually existed in our SIP stack.  This is not a competitive ploy - it is a conscious engineering choice as discussed above.

As for ResponsePoint - it is a different product, addressing a different market.  Microsoft is not an organic entity, but a collection of business units each doing their best to address the requirements of their respective markets.  So the use of UDP by Response Point falls under my "implementer's choice" arguement.

You can debate the relative merits of UDP and TCP all day long.  In the end, it is all about what works for you.  We find that UDP doesn't work for us, but TCP does (TLS even better).  We have a broad ecosystem of partners that interoperate with us and lack of support for UDP has rarely been an issue.

I have attempted to present objective arguments supporting our choice backed up by independent evidence.  Hopefully, these arguments have some merit.  Beyond that, I have nothing more to say.
July 25, 2008 6:58 PM
Anonymous comments are disabled
Powered by Community Server, by Telligent Systems