why cipango close the TCP connection after 64s?

49 views
Skip to first unread message

Mirror Xu

unread,
Oct 17, 2013, 4:16:42 AM10/17/13
to cipan...@googlegroups.com
Hello,

Now I am using cipango as a sip server 1, in my networking, there is another sip server 2.

To communicate between sip server 1 and sip server 2, I established a TCP connection between them.

To establish the connection, cipango act as a tcp client and send request to the sip server 2 which act as a tcp server.

After the connection is established, I can transport sip message over this connection and establish the sip session normally.

Unexpectedly, every time, 64 seconds after the sip session has been established, cipango send a [FIN/ACK] to the sip server 2 to close the Tcp connection.

Because the tcp connection was closed, the sip server2 ended the sip session.

I'm curious about why cipango close the tcp connection, and the time is 64 seconds.

Thanks,

Mirror


Nicolas Trangosi

unread,
Oct 17, 2013, 4:33:05 AM10/17/13
to cipan...@googlegroups.com
Hi Mirror,
According to RFC 3261 §18:

It is RECOMMENDED that connections be kept open for some
implementation-defined duration after the last message was sent or
received over that connection. This duration SHOULD at least equal
the longest amount of time the element would need in order to bring a
transaction from instantiation to the terminated state. This is to
make it likely that transactions are completed over the same
connection on which they are initiated (for example, request,
response, and in the case of INVITE, ACK for non-2xx responses).
This usually means at least 64*T1 (see
Section 17.1.1.1 for a
definition of T1). However, it could be larger in an element that
has a TU using a large value for timer C (bullet 11 of
Section 16.6),
for example.


and as Cipango is mainly used as a server,  active connections should be limited, so by default TCP idle time is limited 2 * 64 * T1. This parameter can be configured in etc/cipango.xml:

<New class="org.cipango.server.nio.SelectChannelConnector">
          <Arg name="sipServer"><Ref id="SipServer" /></Arg>
          <Set name="port"><Property default="5060" name="sip.port"/></Set>
          <Set name="host"><Property name="sip.host"/></Set>
          <Set name="idleTimeout">64000</Set>
</New>

Regards,
Nicolas
--
You received this message because you are subscribed to the Google Groups "cipango-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cipango-dev...@googlegroups.com.
To post to this group, send email to cipan...@googlegroups.com.
Visit this group at http://groups.google.com/group/cipango-dev.
For more options, visit https://groups.google.com/groups/opt_out.

Mirror Xu

unread,
Oct 19, 2013, 10:45:45 PM10/19/13
to cipan...@googlegroups.com, nicolas....@nexcom.fr
Hi Nicolas,

I have tried the configuration item you told me, and it works.

Thanks very much!

However, I have another question: when cipango receive a call to the sip user registered in the sip server 2 I described above, cipango establish a connection 1 with the sip server 2, and receive another call will establish another connection 2.
I want to know whether there is any way to reuse the connection 1 established before. In this case, No matter how many calls from cipango to sip server 2, there is only one connection between them.

Thanks very much.
Regards,
Mirror


在 2013年10月17日星期四UTC+8下午4时33分05秒,Nicolas Trangosi写道:
Reply all
Reply to author
Forward
0 new messages