[reSIProcate] TCP Transport question.

Shypytiak Taras p-aladin at yandex.ru
Thu Jul 30 03:59:31 CDT 2015


Dear resip devels,
could you please advise with next issue:
resiprocate 1.9.9

when sip stack has to send outgoing sip message through tcp transport TcpBaseTrasnport does next steps:
1) makes lookup for the suitable connection by destination.( TcpBaseTransport.cxx:300 )
2) if no connection exists - tcp connection for destination is being created.( TcpBaseTransport.cxx:311 )
3) mapping looks like destination => Connection

The problem arrises during next scenario:

1) sip stack sends outgoing sip message trough tcp connection C1, C1 was created by TcpBaseTransport, because it was not found. C1 is a Tuple [ V4 dest_host:5060 TCP ]
2) remote peer does not answer into C1. But it tries to create new incoming conection  C2  to this_proxy_host:5060. TcpBaseTransport produces an error "TcpBaseTransport.cxx:183:Someone probably sent a reciprocal SYN at us." and rejects it.

As I understand remote peer violates https://tools.ietf.org/html/rfc3261#section-18.2.2 (paragraph 1, in particular  "the response MUST be sent using  the existing connection to the source of the original request" statement).
But at the same time there is http://tools.ietf.org/html/rfc3261#section-18.1.1, paragraph 8

==========================================
Under error conditions, the
   server may attempt to open a new connection to send the response.  To
   handle this case, the transport layer MUST also be prepared to
   receive an incoming connection on the source IP address from which
   the request was sent and port number in the "sent-by" field.
==========================================


So the questions are: 
1) does TcpTransportBase violate 18.1.1, when rejecting such incoming connection?
2) could you please adwise how this issue might be improved?
3) May be it is worth to extend ConnectionManager  interface to something like

void addClientConnection(Connection* connection);
void removeClientConnection(Connection* connection);
void addServerConnection(Connection* connection);
void removeServerConnection(Connection* connection);

Sincerely, Taras.



More information about the resiprocate-devel mailing list