[sr-dev] tcp problem

Andrei Pelinescu-Onciul andrei at iptel.org
Fri Oct 30 17:23:24 CET 2009


On Oct 30, 2009 at 15:15, Klaus Darilion <klaus.mailinglists at pernau.at> wrote:
> 
> 
> Andrei Pelinescu-Onciul schrieb:
> >On Oct 29, 2009 at 08:16, Klaus Darilion <klaus.mailinglists at pernau.at> 
> >wrote:
> >>Long time ago, ser always used the OS default interface for new TCP 
> >>connections. In Openser this was changed to the first listening TCP 
> >>address, and further could be specified by force_send_socket.
> >>
> >>I know there were some changes in ser/sr too, but do not know exactly 
> >>what was changed.
> >
> >In ser/sr the default ip for outgoing TCP connections can be forced
> >using:
> >tcp_source_ipv4="ip" and 
> >tcp_source_ipv6="ip".
> >
> >By default the OS chooses the src ip (e.g. according to the routing
> >table) and ser/sr tries to match with the list of IPs it is listening
> >on. The default behaviour along with either listening on all the IPs or
> >making sure your routing table uses the src ip you want, it's more error
> >proof (automatic multi-homing) and a little bit faster (avoids an extra
> >bind()).
> >
> >I could add a config option to always use the msg send_socket, but what
> >would probably be best would be to force a src_ip only if a send_socket
> >was forced and if not use the OS one or tcp_source_ipv4 if set.
> 
> This is IMO a good option - I guess this also would allow usage of 
> force_send_socket, e.g. force_send_socket("tcp:1.2.3.4").
> 
> btw: does this imply that the current documentation (copied from 
> Kamailio) is wrong as it does not work with outgoing TCP messages?
> http://sip-router.org/wiki/cookbooks/core-cookbook/devel#force_send_socket
> 

The via, rr a.s.o will use the information in the force_socket, however
the src_ip of the tcp connection is independent of it.


I can add the force_send_socket() sets src. for tcp new connection
feature quite easily, the question is whether or not to do it on sr_3.0.
One difference from k would be that in k (and older ser) a connection
from IP1->X is equivalent to IP2->x (only the destination is used, if
for example you do force_send_socket(IP2); forward...(X) and a connection
from IP1 -> X already exists, this connection will be used and no new
connection will be created) while in sr the connections will be
different (both the source and the destinations are used => in the above
example a new IP2 -> X connection will be opened even if IP1 -> X
already exists which IMHO is the correct thing to do).


Andrei



More information about the sr-dev mailing list