[SIPForum-discussion] SIP over TCP

Gast, Jim jim.gast at tdstelecom.com
Tue Aug 9 20:57:48 UTC 2011

Hi, Raghul -

The choice of UDP (best effort) versus TCP (reliable) is a classic choice that has been around for years:

-          TCP does a much more timely job of retransmissions (and it does them as part of TCP) if the underlying infrastructure loses packets.  If you use SIP over UDP, discovering the fact that a packet was lost happens when SIP times out.

-          TCP numbers each packet and presents each of them exactly once and exactly in order (asking for TCP-level retransmissions, if needed).  At the SIP level, it will appear that no packets were lost.  All packets are delivered to SIP in the order the sender sent them.  Although SIP can timeout, it is much less likely to take THAT long.

-          TCP handles packets larger than an unfragmented UDP packet (typically 1500 bytes) and it is a natural part of TCP.  In UDP, if you need big packets, you have to make sure all the devices properly handle UDP fragmentation.

-          Because TCP acknowledges each packet, there are more packets and more round-trip delays than just using UDP.

Take a look at REGISTER, NOTIFY and INVITE packets (any packets that can get potentially big).  If your SIP packets are larger than 1,300 bytes, you may have trouble with certain SBCs that want to reserve 200 bytes to do header manipulation.  Those SBCs reject large UDP packets because they are afraid that they might not have enough room to do the "header manipulation rules".

If you do lots of call forking (e.g. Shared Call Appearances) or have large packets for things like Busy Lamp Fields . . . do a packet capture.  Compare the packet leaving the phone to the packet arriving at your registrar or server (and the reverse).  If, using UDP, you see packet losses or packets getting truncated or discarded . . . switch to TCP.   SIP ladder diagrams can be surprisingly hard to follow if a significant fraction of UDP packets are randomly lost.  And it isn't just you that gets confused . . . SIP phones, SIP proxies and SIP registrars are easily confused if lots of packets are lost.

I hope that helps,

Jim Gast
TDS Telecom

From: discussion-bounces at sipforum.org [mailto:discussion-bounces at sipforum.org] On Behalf Of senthil k
Sent: Monday, August 08, 2011 11:06 AM
To: Raghul Prasanna
Cc: discussion at sipforum.org
Subject: Re: [SIPForum-discussion] SIP over TCP


TCP needs to ack all the SIP messages like INVITE to BYE... other than that its similar to UDP.

if u want i can send u the logs taken
On Fri, Aug 5, 2011 at 2:28 PM, Raghul Prasanna <raghul82 at yahoo.co.uk<mailto:raghul82 at yahoo.co.uk>> wrote:
Hello All,

Has anyone in this forum got experience working on SIP over TCP please?

Because I posted a question sometime ago, there was no response, I updated again to see if  someone can respond, but my update never appeared on this forum at all.


This is the SIP Forum discussion mailing list
TO UNSUBSCRIBE, or edit your delivery options, please visit http://sipforum.org/mailman/listinfo/discussion
Post to the list at discussion at sipforum.org<mailto:discussion at sipforum.org>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://sipforum.org/pipermail/discussion/attachments/20110809/a8b7a7ee/attachment-0002.html>

More information about the discussion mailing list