[prev in list] [next in list] [prev in thread] [next in thread] 

List:       serdev
Subject:    Re: [Serdev] TCP connection reuse
From:       Klaus Darilion <klaus.mailinglists () pernau ! at>
Date:       2006-12-15 13:33:23
Message-ID: 4582A423.6000807 () pernau ! at
[Download RAW message or body]

John Bildøy wrote:
> Hi,
> 
> I'm currently using SER 0.10 (Ottendorf) for SIP/TCP transport.
> 
> In my configuration I added the line tcp_accept_aliases=yes, to reuse tcp
> connections from UA to the proxy.

Hi!

Be aware that forcing alias does not always work. I think there is a 
scenario which can cause problems, as ser only uses the port from VIa, 
not eh IP address to prevent hijacking.

If 2 clients are behind same NAT, and both use the same local port then 
I think there is a problem.

I suggest not to use the tcp aliases, but the same tricks you use for 
UDP. rport, fix_nated_register and fix_nated_contact

regards
klaus


> 
> ---ser.cfg---------
> tcp_accept_aliases=yes
>                 if (method=="REGISTER") {
>                         force_tcp_alias();
>                 };
> 
> -------------------
> 
> This works until a UA reboots/re-registers using a new TCP connection.
> Until the first TCP connection times out at SER (~120 seconds), SER will
> not re-use the second TCP connection. My work around for this, is to
> reduce the TCP connection timeout to ~20 seconds at SER.
> 
> ----My patch------
> 
> Index: tcp_conn.h
> ===================================================================
> RCS file: /cvsroot/ser/sip_router/tcp_conn.h,v
> retrieving revision 1.29
> diff -u -1 -r1.29 tcp_conn.h
> --- tcp_conn.h        2 Nov 2006 22:55:56 -0000        1.29
> +++ tcp_conn.h        11 Dec 2006 07:53:22 -0000
> @@ -48,3 +48,3 @@
>  #define TCP_BUF_SIZE        4096
> -#define DEFAULT_TCP_CONNECTION_LIFETIME 120 /* in  seconds */
> +#define DEFAULT_TCP_CONNECTION_LIFETIME 20 /* in  seconds */
>  #define DEFAULT_TCP_SEND_TIMEOUT 10 /* if a send can't write for more
> then 10s,
> 
> --------------------
> 
> Does anyone have any experience using SIP/TCP with SER and made any other
> solutions for this issue?
> 
> 
> Regards,
> John Bildøy
> 
> _______________________________________________
> Serdev mailing list
> Serdev@lists.iptel.org
> http://lists.iptel.org/mailman/listinfo/serdev


-- 
Klaus Darilion
nic.at

_______________________________________________
Serdev mailing list
Serdev@lists.iptel.org
http://lists.iptel.org/mailman/listinfo/serdev
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic