[OpenSER-Users] UDP/TCP failover in OpenSER

Klaus Darilion klaus.mailinglists at pernau.at
Tue Apr 22 19:02:34 CEST 2008



Antoine Fressancourt schrieb:
> Hello Klaus, Iñaki,
> 
> I have done some tests after your answers, and here are the results :
> 
> - I have tried to register a user with multiple Contact headers, for
> the same Address of Record in a single REGISTER, specifying the
> transport used in each Contact Header field, and I only see one entry
> for each client doing "openserctl ul show". For each entry, the
> Socket:: value show that the transport layer taken in account is the
> transport layer used to send the REGISTER message.
> 
> - I tried to add "transport=tcp" as a R-URI parameter but
> unfortunately the message is still sent over UDP from OpenSER to
> client B.
> 
> - About Klaus's remark, I also thought that you could only send SIP
> messages in UDP to a client registered inUDP but when I went through
> the 18th paragraph of RFC 3261 ("Transport"), I understood that it was
> mandatory for a SIP client to listen on the same port in UDP and TCP.

Yes, RFC 3261 requires support of UDP and TCP. I think the important 
part is 18.2.1 Receiving Requests:

    A server SHOULD be prepared to receive requests on any IP address,
    port and transport combination that can be the result of a DNS lookup
    on a SIP or SIPS URI [4] that is handed out for the purposes of
    communicating with that server.  In this context, "handing out"
    includes placing a URI in a Contact header field in a REGISTER
    request or a redirect response, or in a Record-Route header field in
    a request or response.

Thus, if the URI in the REGISTER contains an IP address, [4=RFC3263] 
will resolve only to 1 socket.

    It is also RECOMMENDED that a server
    listen for requests on the default SIP ports (5060 for TCP and UDP,
    5061 for TLS over TCP) on all public interfaces.

Now it depends on your scenario. If the SIP UAs are behind NAT then:
- UA registers a UDP URI: Even if the UA would listen on the same port 
on TCP it can't be reached from outside due to the NAT -> switching from 
UDP makes things worse! (I never had any issues with IP fragmentation yet)
- UA registers a TCP URI: There is no need to listen on the same UDP 
port too as the client wants to receive incoming requests via TCP.

If the UAs are not behind NAT then it may be useful to listen to TCP 
too, but IMO the automatic UDP/TCP translation in a proxy towards a UA 
is crap. Either clients and NAT should handle IP fragments or should use 
TCP.

regards
klaus




More information about the Users mailing list