Discussion:
[Freeswitch-users] TCP vs UDP SIP
Spencer Thomason
2013-05-08 15:30:59 UTC
Permalink
Hello all,
In our deployments, Freeswitch is on a public IP with most user endpoints
behind NAT. As the demand for BLFs has grown I've been forced to go to TCP
due the NOTIFYs exceeding MTU. I've been reluctant to use TCP for SIP due to
the increased overhead. Currently I force a registration expiry of 600
seconds and ping all NATed endpoints. I'm exploring the idea of switching
all endpoints to TCP where available, ditching the options pings and
dropping the registration expiration to 300 secs which should exceed the TCP
connection timeout of almost every router I've seen. I was currious if
anyone had an experience or could point out any caveats I might run into.

Thanks in advance,
Spencer

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20130508/7541b40a/attachment.html
Jeff Leung
2013-05-08 15:37:53 UTC
Permalink
On a Linux system there is a limit of how many open TCP connections you have. Unless you have a crazy amount of endpoints you have to serve, TCP probably isn?t really worth it in my opinion.

Also did I also mention that TCP connections don?t really fix NAT issues?



From: freeswitch-users-bounces at lists.freeswitch.org [mailto:freeswitch-users-bounces at lists.freeswitch.org] On Behalf Of Spencer Thomason
Sent: Wednesday, May 8, 2013 8:31 AM
To: FreeSWITCH Users Help
Subject: [Freeswitch-users] TCP vs UDP SIP



Hello all,
In our deployments, Freeswitch is on a public IP with most user endpoints behind NAT. As the demand for BLFs has grown I've been forced to go to TCP due the NOTIFYs exceeding MTU. I've been reluctant to use TCP for SIP due to the increased overhead. Currently I force a registration expiry of 600 seconds and ping all NATed endpoints. I'm exploring the idea of switching all endpoints to TCP where available, ditching the options pings and dropping the registration expiration to 300 secs which should exceed the TCP connection timeout of almost every router I've seen. I was currious if anyone had an experience or could point out any caveats I might run into.

Thanks in advance,
Spencer

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20130508/ed5bbc7b/attachment.html
Vik Killa
2013-05-08 16:17:57 UTC
Permalink
In my opinion, TCP seems better than UDP as you know all the SIP packets
are making to their destination.
Post by Jeff Leung
On a Linux system there is a limit of how many open TCP connections you
have.
I never heard this before...where and how it this limit defined?
Post by Jeff Leung
Unless you have a crazy amount of endpoints you have to serve, TCP
probably isn?t really worth it in my opinion.
How many endpoints?
Post by Jeff Leung
Also did I also mention that TCP connections don?t really fix NAT issues?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20130508/136581b9/attachment.html
Jeff Leung
2013-05-08 16:51:02 UTC
Permalink
-----Original Message-----
From: freeswitch-users-bounces at lists.freeswitch.org [mailto:freeswitch-
users-bounces at lists.freeswitch.org] On Behalf Of Vik Killa
Sent: Wednesday, May 8, 2013 9:18 AM
To: FreeSWITCH Users Help
Subject: Re: [Freeswitch-users] TCP vs UDP SIP
That I would agree with, but the thing is you lose the capability of
failover in the unlikely event that a node in a FreeSWITCH cluster fail.
In my opinion, TCP seems better than UDP as you know all the SIP packets
are making to their destination.
On a Linux system there is a limit of how many open TCP connections
you have.
If I can remember correctly, I think Darren from 2600hz did discuss about
the limit of open TCP connections you can have on a Linux system. Correct me
if I'm wrong on this, but that seems to be the case. And I have seen
instances of that happening on a misconfigured Squid Proxy
I never heard this before...where and how it this limit defined?
Unless you have a crazy amount of endpoints you have to serve, TCP
probably isn't really worth it in my opinion.
Assuming it's one Open TCP connection per endpoint, you'd probably need
more endpoints than the maximum amount of open TCP connections to hit that
problem
How many endpoints?
Also did I also mention that TCP connections don't really fix NAT
issues?
Spencer Thomason
2013-05-08 17:13:10 UTC
Permalink
Hi Jeff,
Thanks for the insight. Forgive my ignorance but if I have two Identical Freeswitch servers with SRV records and endpoints that properly support SRVs, why do I loose the ability to failover if one host is not reachable?

Also as many of these end points are Polycoms behind NAT, I can't see any reason I'd still need NDLB-force-rport on the profile?

Since these are application servers, handling conferences, presence, etc., I'd imagine I would hit other bottlenecks before I hit the TCP connection limit.
Post by Jeff Leung
-----Original Message-----
From: freeswitch-users-bounces at lists.freeswitch.org [mailto:freeswitch-
users-bounces at lists.freeswitch.org] On Behalf Of Vik Killa
Sent: Wednesday, May 8, 2013 9:18 AM
To: FreeSWITCH Users Help
Subject: Re: [Freeswitch-users] TCP vs UDP SIP
That I would agree with, but the thing is you lose the capability of
failover in the unlikely event that a node in a FreeSWITCH cluster fail.
In my opinion, TCP seems better than UDP as you know all the SIP packets
are making to their destination.
On a Linux system there is a limit of how many open TCP connections
you have.
If I can remember correctly, I think Darren from 2600hz did discuss about
the limit of open TCP connections you can have on a Linux system. Correct me
if I'm wrong on this, but that seems to be the case. And I have seen
instances of that happening on a misconfigured Squid Proxy
I never heard this before...where and how it this limit defined?
Unless you have a crazy amount of endpoints you have to serve, TCP
probably isn't really worth it in my opinion.
Assuming it's one Open TCP connection per endpoint, you'd probably need
more endpoints than the maximum amount of open TCP connections to hit that
problem
How many endpoints?
Also did I also mention that TCP connections don't really fix NAT
issues?
_________________________________________________________________________
consulting at freeswitch.org
http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server
http://www.cudatel.com
Official FreeSWITCH Sites
http://www.freeswitch.org
http://wiki.freeswitch.org
http://www.cluecon.com
FreeSWITCH-users mailing list
FreeSWITCH-users at lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org
Jeff Leung
2013-05-08 17:20:43 UTC
Permalink
Post by Spencer Thomason
Hi Jeff,
Thanks for the insight. Forgive my ignorance but if I have two Identical
Freeswitch servers with SRV records and endpoints that properly support
SRVs, why do I loose the ability to failover if one host is not reachable?
TCP is a stateful protocol. On the other hand UDP isn't, it's stateless.
It's just easier to failover with UDP than with TCP if you understand the
difference between the two protocols. I'm not saying that it's not possible
to do so with TCP, but with the way how SIP works, you'd want to use UDP if
you want failover capabilities without the headache.
Post by Spencer Thomason
Also as many of these end points are Polycoms behind NAT, I can't see any
reason I'd still need NDLB-force-rport on the profile?
Unfortunately, I don't work with Polycom phones. Brian West over here can
comment on that issue.
Post by Spencer Thomason
Since these are application servers, handling conferences, presence, etc.,
I'd
Post by Spencer Thomason
imagine I would hit other bottlenecks before I hit the TCP connection
limit.

Yes that's true, but if you had a FreeSWITCH box that purely handled SIP
messages and no media, you'd probably hit that TCP Open connection limit.
Post by Spencer Thomason
Post by Jeff Leung
-----Original Message-----
From: freeswitch-users-bounces at lists.freeswitch.org
[mailto:freeswitch- users-bounces at lists.freeswitch.org] On Behalf Of
Vik Killa
Sent: Wednesday, May 8, 2013 9:18 AM
To: FreeSWITCH Users Help
Subject: Re: [Freeswitch-users] TCP vs UDP SIP
That I would agree with, but the thing is you lose the capability of
failover in the unlikely event that a node in a FreeSWITCH cluster fail.
In my opinion, TCP seems better than UDP as you know all the SIP
packets are making to their destination.
On a Linux system there is a limit of how many open TCP
connections you have.
If I can remember correctly, I think Darren from 2600hz did discuss
about the limit of open TCP connections you can have on a Linux
system. Correct me if I'm wrong on this, but that seems to be the
case. And I have seen instances of that happening on a misconfigured
Squid Proxy
I never heard this before...where and how it this limit defined?
Unless you have a crazy amount of endpoints you have to serve, TCP
probably isn't really worth it in my opinion.
Assuming it's one Open TCP connection per endpoint, you'd probably
need more endpoints than the maximum amount of open TCP connections
to
Post by Jeff Leung
hit that problem
How many endpoints?
Also did I also mention that TCP connections don't really fix NAT
issues?
__________________________________________________________
____________
Post by Jeff Leung
consulting at freeswitch.org
http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server
http://www.cudatel.com
Official FreeSWITCH Sites
http://www.freeswitch.org
http://wiki.freeswitch.org
http://www.cluecon.com
FreeSWITCH-users mailing list
FreeSWITCH-users at lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-use
rs
http://www.freeswitch.org
__________________________________________________________
_______________
consulting at freeswitch.org
http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server
http://www.cudatel.com
Official FreeSWITCH Sites
http://www.freeswitch.org
http://wiki.freeswitch.org
http://www.cluecon.com
FreeSWITCH-users mailing list
FreeSWITCH-users at lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org
Spencer Thomason
2013-05-08 18:13:10 UTC
Permalink
Understood. My plan is to use UDP for all "trunking" type endpoints at TCP for desk phones as they will likely receive more NOTIFYs and in most cases being behind NAT where the longer connection timeout comes in handy. I also found a good paper on the subject:
http://www.cs.columbia.edu/~kumiko/publish/IPTComm08_paper.pdf

In regard to connection timeout how does Freeswitch handle this? I noticed the new Sofia parameters and I was curious if the connection lifetime was configurable as well.

BR,
Spencer
Post by Jeff Leung
Post by Spencer Thomason
Hi Jeff,
Thanks for the insight. Forgive my ignorance but if I have two Identical
Freeswitch servers with SRV records and endpoints that properly support
SRVs, why do I loose the ability to failover if one host is not reachable?
TCP is a stateful protocol. On the other hand UDP isn't, it's stateless.
It's just easier to failover with UDP than with TCP if you understand the
difference between the two protocols. I'm not saying that it's not possible
to do so with TCP, but with the way how SIP works, you'd want to use UDP if
you want failover capabilities without the headache.
Post by Spencer Thomason
Also as many of these end points are Polycoms behind NAT, I can't see any
reason I'd still need NDLB-force-rport on the profile?
Unfortunately, I don't work with Polycom phones. Brian West over here can
comment on that issue.
Post by Spencer Thomason
Since these are application servers, handling conferences, presence, etc.,
I'd
Post by Spencer Thomason
imagine I would hit other bottlenecks before I hit the TCP connection
limit.
Yes that's true, but if you had a FreeSWITCH box that purely handled SIP
messages and no media, you'd probably hit that TCP Open connection limit.
Post by Spencer Thomason
Post by Jeff Leung
-----Original Message-----
From: freeswitch-users-bounces at lists.freeswitch.org
[mailto:freeswitch- users-bounces at lists.freeswitch.org] On Behalf Of
Vik Killa
Sent: Wednesday, May 8, 2013 9:18 AM
To: FreeSWITCH Users Help
Subject: Re: [Freeswitch-users] TCP vs UDP SIP
That I would agree with, but the thing is you lose the capability of
failover in the unlikely event that a node in a FreeSWITCH cluster fail.
In my opinion, TCP seems better than UDP as you know all the SIP
packets are making to their destination.
On a Linux system there is a limit of how many open TCP
connections you have.
If I can remember correctly, I think Darren from 2600hz did discuss
about the limit of open TCP connections you can have on a Linux
system. Correct me if I'm wrong on this, but that seems to be the
case. And I have seen instances of that happening on a misconfigured
Squid Proxy
I never heard this before...where and how it this limit defined?
Unless you have a crazy amount of endpoints you have to serve, TCP
probably isn't really worth it in my opinion.
Assuming it's one Open TCP connection per endpoint, you'd probably
need more endpoints than the maximum amount of open TCP connections
to
Post by Jeff Leung
hit that problem
How many endpoints?
Also did I also mention that TCP connections don't really fix NAT
issues?
__________________________________________________________
____________
Post by Jeff Leung
consulting at freeswitch.org
http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server
http://www.cudatel.com
Official FreeSWITCH Sites
http://www.freeswitch.org
http://wiki.freeswitch.org
http://www.cluecon.com
FreeSWITCH-users mailing list
FreeSWITCH-users at lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-use
rs
http://www.freeswitch.org
__________________________________________________________
_______________
consulting at freeswitch.org
http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server
http://www.cudatel.com
Official FreeSWITCH Sites
http://www.freeswitch.org
http://wiki.freeswitch.org
http://www.cluecon.com
FreeSWITCH-users mailing list
FreeSWITCH-users at lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org
_________________________________________________________________________
consulting at freeswitch.org
http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server
http://www.cudatel.com
Official FreeSWITCH Sites
http://www.freeswitch.org
http://wiki.freeswitch.org
http://www.cluecon.com
FreeSWITCH-users mailing list
FreeSWITCH-users at lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20130508/11803035/attachment-0001.html
Andrew Cassidy
2013-05-09 08:45:00 UTC
Permalink
I've come across difficulties with TCP and NAT. Some NAT implementations do
not allow new connections from the PBX to the phone through the NAT and
there's no requirement to reuse and existing, long-lived TCP connection.
Some notifications and invites can get blocked unnecessarily.
Post by Spencer Thomason
Understood. My plan is to use UDP for all "trunking" type endpoints at
TCP for desk phones as they will likely receive more NOTIFYs and in most
cases being behind NAT where the longer connection timeout comes in handy.
http://www.cs.columbia.edu/~kumiko/publish/IPTComm08_paper.pdf
In regard to connection timeout how does Freeswitch handle this? I
noticed the new Sofia parameters and I was curious if the connection
lifetime was configurable as well.
BR,
Spencer
Hi Jeff,
Thanks for the insight. Forgive my ignorance but if I have two Identical
Freeswitch servers with SRV records and endpoints that properly support
SRVs, why do I loose the ability to failover if one host is not reachable?
TCP is a stateful protocol. On the other hand UDP isn't, it's stateless.
It's just easier to failover with UDP than with TCP if you understand the
difference between the two protocols. I'm not saying that it's not possible
to do so with TCP, but with the way how SIP works, you'd want to use UDP if
you want failover capabilities without the headache.
Also as many of these end points are Polycoms behind NAT, I can't see any
reason I'd still need NDLB-force-rport on the profile?
Unfortunately, I don't work with Polycom phones. Brian West over here can
comment on that issue.
Since these are application servers, handling conferences, presence, etc.,
I'd
imagine I would hit other bottlenecks before I hit the TCP connection
limit.
Yes that's true, but if you had a FreeSWITCH box that purely handled SIP
messages and no media, you'd probably hit that TCP Open connection limit.
-----Original Message-----
From: freeswitch-users-bounces at lists.freeswitch.org
[mailto:freeswitch- users-bounces at lists.freeswitch.org] On Behalf Of
Vik Killa
Sent: Wednesday, May 8, 2013 9:18 AM
To: FreeSWITCH Users Help
Subject: Re: [Freeswitch-users] TCP vs UDP SIP
That I would agree with, but the thing is you lose the capability of
failover in the unlikely event that a node in a FreeSWITCH cluster fail.
In my opinion, TCP seems better than UDP as you know all the SIP
packets are making to their destination.
On Wed, May 8, 2013 at 11:37 AM, Jeff Leung <jleung at v10networks.ca>
On a Linux system there is a limit of how many open TCP
connections you have.
If I can remember correctly, I think Darren from 2600hz did discuss
about the limit of open TCP connections you can have on a Linux
system. Correct me if I'm wrong on this, but that seems to be the
case. And I have seen instances of that happening on a misconfigured
Squid Proxy
I never heard this before...where and how it this limit defined?
Unless you have a crazy amount of endpoints you have to serve, TCP
probably isn't really worth it in my opinion.
Assuming it's one Open TCP connection per endpoint, you'd probably
need more endpoints than the maximum amount of open TCP connections
to
hit that problem
How many endpoints?
Also did I also mention that TCP connections don't really fix NAT
issues?
__________________________________________________________
____________
consulting at freeswitch.org
http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server
http://www.cudatel.com
Official FreeSWITCH Sites
http://www.freeswitch.org
http://wiki.freeswitch.org
http://www.cluecon.com
FreeSWITCH-users mailing list
FreeSWITCH-users at lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-use
rs
http://www.freeswitch.org
__________________________________________________________
_______________
consulting at freeswitch.org
http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server
http://www.cudatel.com
Official FreeSWITCH Sites
http://www.freeswitch.org
http://wiki.freeswitch.org
http://www.cluecon.com
FreeSWITCH-users mailing list
FreeSWITCH-users at lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org
_________________________________________________________________________
consulting at freeswitch.org
http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server
http://www.cudatel.com
Official FreeSWITCH Sites
http://www.freeswitch.org
http://wiki.freeswitch.org
http://www.cluecon.com
FreeSWITCH-users mailing list
FreeSWITCH-users at lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org
_________________________________________________________________________
consulting at freeswitch.org
http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server
http://www.cudatel.com
Official FreeSWITCH Sites
http://www.freeswitch.org
http://wiki.freeswitch.org
http://www.cluecon.com
FreeSWITCH-users mailing list
FreeSWITCH-users at lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org
--
*Andrew Cassidy BSc (Hons) MBCS SSCA*
Managing Director


*T <info at cassidywebservices.co.uk> *03300 100 960
*F<info at cassidywebservices.co.uk>
*03300 100 961
*E <info at cassidywebservices.co.uk> *andrew at cassidywebservices.co.uk
*W <info at cassidywebservices.co.uk> *www.cassidywebservices.co.uk
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20130509/9a6bf687/attachment-0001.html
Loading...