[sr-dev] About TCP connection failure (reject and timeout)

Andrei Pelinescu-Onciul andrei at iptel.org
Thu Jun 23 20:32:53 CEST 2011


On Jun 15, 2011 at 19:06, Iñaki Baz Castillo <ibc at aliax.net> wrote:
> 2011/6/15 Iñaki Baz Castillo <ibc at aliax.net>:
> > Hi, I've opened an issue in the tracker since it seems that sip-router
> > (today's master branch) does not properly react upon TCP rejection or
> > TCP timeout (in outgoing transactions):
> >
> >  http://sip-router.org/tracker/index.php?do=details&task_id=136
> >
> > Could somebody attemp these two calls?
> >
> >
> > 1) sip:lalala at 91.121.79.216:7777;transport=tcp
> >
> > The server will reject (iptables REJECT action) so sip-router should
> > inmediately generate a 503 for the transaction (but instead it
> > generates a local 408 after fr_timer, usually 32 seconds).
> >
> >
> > 2) sip:lalala at 1.2.3.4:5060;transport=tcp
> >
> > The server will not respond as 1.2.3.4 is not reachable, so sip-router
> > should wait for "tcp_connect_timeout" value (10 seconds by default)
> > and then generate a local 408 (but instead it generates a local 408
> > after fr_timer, usually 32 seconds).
> 
> 
> The issue just occurs when tcp_async=yes.

Yes, it's a known limitation. Basically when async it's own, tm has no
way of knowing that a connect() has failed and would have to rely on sip
timeout.
Of course these could be changed, but it would have both performance and
memory usage impact and it would be very hard to integrate with tls.
I would rather not do it in the near future.

The tcp_connect_timeout refers to how long the tcp connect will be
attempted, but it's not linked to tm. The value is not 100% exact,
the tcp timers are executed on a best effort basis, at most at 5s
intervals and at minimum 1/16 seconds, so you should expect a 5s error
If it's too much for you, change TCP_MAIN_SELECT_TIMEOUT and
TCP_CHILD_SELECT_TIMEOUT in tcp_conn.h (btw. we don't use select()
anymore, the names where not updated when we switched to
epoll/kqueue/dev_poll).


Andrei

> 
> 
> -- 
> Iñaki Baz Castillo
> <ibc at aliax.net>
> 
> _______________________________________________
> sr-dev mailing list
> sr-dev at lists.sip-router.org
> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev



More information about the sr-dev mailing list