[Serusers] reuse of existing tcp connection

Andrei Pelinescu-Onciul pelinescu-onciul at fokus.fraunhofer.de
Thu Oct 16 18:01:32 CEST 2003


On Oct 16, 2003 at 17:09, Juha Heinanen <jh at tutpro.com> wrote:

[...]
> 
>    transport layer creates an alias, such that any requests going to
>    the "advertised address" (foo port 5060) are instead sent over
>    the existing connection (to the "target" of the alias) which is
>    coming from port 33001. 
> 
> how difficult it would be to implement this in ser?  we can very easily
> add 'alias' parameter to via sent by kphone.

The alias authorization is the big problem. In the tcp case only 
 contact comparisons can be used and this would be quite difficult in
 ser since the transport layer and the user location part live in
 separate modules (transport is part of the core).
Another problem would be aliasing hostnames. This would need to
interfere with the resolver.

> 
>  > Also all tcp connection will be closed (by ser) after some inactivity
>  > period (3 min).
> 
> the same i-d says:
> 
>    This sharing continues as long as the target
>    connection stays up.  The SIP community recommends that servers keep
>    connections up unless they need to reclaim resources, and that
>    clients keep connections up as long as they are needed. Connection
>    reuse works best when the client and the server maintain their
>    connections for long periods of time.  SIP entities therefore SHOULD
>    NOT drop connections on completion of a transaction or termination of
>    a dialog.
> 
> i.e., it might make sense to have a configurable max number of tcp
> connections and then start closing them based on longest inactivity when
> the limit is exceeded.

Finding the connections with the longest inactivity period could have a great
 performance impact when the max number is reached.

On linux/32 bit you cannot have more then 1024 open tcp connections
(select will fail for fds >1024) so a proxy with a lot of clients will
reach this limit soon and will have to start closing connections.

However this could be implemented quite easily, maybe as a compilation
option at first.

Andrei




More information about the sr-users mailing list