<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html;
      charset=windows-1252">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <p><tt>Hi Steve,</tt></p>
    <p><tt><tt><tt>I've opened a G<tt>itHub issue for this report so <tt>we
              </tt>can better keep track of it [1]<tt>, and will li<tt>k<tt>ely
                    be next on my priority list</tt></tt></tt>.<tt><tt></tt></tt>
              I will try to find some time to <tt>attempt <tt>to
                  reproduce it asap. In the meanwhile, would you be as
                  kin<tt>d as to supply <tt>some debug logs while the <tt>async
                        TCP reads are <tt>piling up</tt><tt></tt></tt></tt><tt></tt>?
                    <tt>You may <tt>ship them</tt><tt></tt> to <tt>liviu</tt>@opensips.org.</tt></tt></tt></tt></tt></tt></tt></tt></p>
    <p><tt><tt><tt><tt><tt><tt><tt><tt><tt>Best regards,</tt></tt></tt></tt></tt><br>
            </tt></tt></tt></tt></p>
    <p><tt><tt><tt><tt><tt>[1]:
                <a class="moz-txt-link-freetext" href="https://github.com/OpenSIPS/opensips/issues/1259">https://github.com/OpenSIPS/opensips/issues/1259</a></tt></tt></tt></tt></tt><br>
    </p>
    <pre class="moz-signature" cols="72">Liviu Chircu
OpenSIPS Developer
<a class="moz-txt-link-freetext" href="http://www.opensips-solutions.com">http://www.opensips-solutions.com</a></pre>
    <div class="moz-cite-prefix">On 18.01.2018 18:35, Steve Brisson
      wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:1D7B55AB4979E6498B3AC325C40E84360102C14C22@ORD2MBX02F.mex05.mlsrvr.com">
      <meta http-equiv="Content-Type" content="text/html;
        charset=windows-1252">
      <meta name="Generator" content="Microsoft Word 15 (filtered
        medium)">
      <style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        color:black;
        mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
p
        {mso-style-priority:99;
        mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        color:black;
        mso-fareast-language:EN-US;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";
        color:black;
        mso-fareast-language:EN-CA;}
tt
        {mso-style-priority:99;
        font-family:"Courier New";}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:Consolas;
        color:black;}
span.EmailStyle21
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
span.EmailStyle22
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
span.EmailStyle23
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
span.EmailStyle24
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
      <div class="WordSection1">
        <p class="MsoNormal"><span style="color:#1F497D">Hi, just
            wondering if this issue is still being considered.<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D">Thanks,<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D">steve<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
        <div>
          <div style="border:none;border-top:solid #E1E1E1
            1.0pt;padding:3.0pt 0in 0in 0in">
            <p class="MsoNormal"><b><span
                  style="color:windowtext;mso-fareast-language:EN-CA"
                  lang="EN-US">From:</span></b><span
                style="color:windowtext;mso-fareast-language:EN-CA"
                lang="EN-US"> Users
                [<a class="moz-txt-link-freetext" href="mailto:users-bounces@lists.opensips.org">mailto:users-bounces@lists.opensips.org</a>]
                <b>On Behalf Of </b>Steve Brisson<br>
                <b>Sent:</b> Thursday, January 11, 2018 11:56 AM<br>
                <b>To:</b> OpenSIPS users mailling list
                <a class="moz-txt-link-rfc2396E" href="mailto:users@lists.opensips.org"><users@lists.opensips.org></a><br>
                <b>Subject:</b> Re: [OpenSIPS-Users] tcp_async timeouts
                confusion<o:p></o:p></span></p>
          </div>
        </div>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal"><span style="color:#1F497D">TCP scenario:<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D">Yes that is
            exactly correct. If I have tcp_connect_timeout=3000 and
            tcp_async=1 configured then calls to the vcs fail. If I then
            make the single change to disable tcp_async, calls to my vcs
            endpoints will work.<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D">TLS scenario:<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D">Thanks for the
            clarification, makes sense. Unfortunately the online
            documentation doesn't describe the parameters and lists an
            incorrect scaling factor (it's defined in milliseconds, not
            seconds).<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D">steve<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
        <div>
          <div style="border:none;border-top:solid #E1E1E1
            1.0pt;padding:3.0pt 0in 0in 0in">
            <p class="MsoNormal"><b><span
                  style="color:windowtext;mso-fareast-language:EN-CA"
                  lang="EN-US">From:</span></b><span
                style="color:windowtext;mso-fareast-language:EN-CA"
                lang="EN-US"> Users [<a
                  href="mailto:users-bounces@lists.opensips.org"
                  moz-do-not-send="true">mailto:users-bounces@lists.opensips.org</a>]
                <b>On Behalf Of </b>Liviu Chircu<br>
                <b>Sent:</b> Thursday, January 11, 2018 3:39 AM<br>
                <b>To:</b> <a href="mailto:users@lists.opensips.org"
                  moz-do-not-send="true">users@lists.opensips.org</a><br>
                <b>Subject:</b> Re: [OpenSIPS-Users] tcp_async timeouts
                confusion<o:p></o:p></span></p>
          </div>
        </div>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p><tt><span style="font-size:10.0pt">Answers below,</span></tt><span
            style="font-size:12.0pt;mso-fareast-language:EN-CA"><o:p></o:p></span></p>
        <pre><o:p> </o:p></pre>
        <div>
          <p class="MsoNormal">On 09.01.2018 22:25, Steve Brisson wrote:<o:p></o:p></p>
        </div>
        <blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
          <p class="MsoNormal"><span style="color:#1F497D"> </span><o:p></o:p></p>
          <p class="MsoNormal"><span style="color:#1F497D">*** Using TCP
              ***</span><o:p></o:p></p>
          <p class="MsoNormal"><span style="color:#1F497D"> </span><o:p></o:p></p>
          <p class="MsoNormal"><span style="color:#1F497D">After the
              invite is sent to the vcs, tcpdump at the opensips server
              showed 100, 180, and 200 OK responses from the vcs
              arriving and ACK'd correctly at the opensips server. The
              100 response arrived 185ms after the invite is sent. But,
              I don't see these responses in the branch's onreply_route,
              the global onreply_route, or in the log at DBG level.
              netstat -t shows the connection with the data in the
              recv-q that never reaches 0. This implies to me that
              opensips is not polling that connection correctly for recv
              data.</span><o:p></o:p></p>
          <p class="MsoNormal"><span style="color:#1F497D"> </span><o:p></o:p></p>
          <p class="MsoNormal"><span style="color:#1F497D">If I disable
              tcp_async then the call is completed successfully. So in
              the case that works, I have tcp_connect_timeout=3000 and
              tcp_async=0.</span><o:p></o:p></p>
        </blockquote>
        <p class="MsoNormal" style="margin-bottom:12.0pt"><span
            style="font-size:12.0pt;font-family:"Times New
            Roman",serif;mso-fareast-language:EN-CA">Just to
            confirm the scenario: So the signaling is broken with
            "tcp_connect_timeout=3000 and tcp_async=1" (reply routes do
            not get triggered / recv-q keeps on growing), however once
            you switch to "tcp_async=0", everything is back to working?<o:p></o:p></span></p>
        <blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
          <p class="MsoNormal"><span style="color:#1F497D"> </span><o:p></o:p></p>
          <p class="MsoNormal"><span style="color:#1F497D">*** Using TLS
              ***</span><o:p></o:p></p>
          <p class="MsoNormal"><span style="color:#1F497D"> </span><o:p></o:p></p>
          <p class="MsoNormal"><span style="color:#1F497D">Running
              tcpdump, I see the opensips server send a Client Hello
              then a FIN packet 100ms later. The vcs responds with a
              Server Hello 200ms after the Client Hello and this gets
              RST.</span><o:p></o:p></p>
          <p class="MsoNormal"><span style="color:#1F497D"> </span><o:p></o:p></p>
          <p class="MsoNormal"><span style="color:#1F497D">To workaround
              this case, I set tls_handshake_timeout=3000 and
              tls_send_timeout=1000. Maybe this is the correct behavior,
              I'm still not 100% sure how the tls parameters function.</span><o:p></o:p></p>
        </blockquote>
        <p class="MsoNormal" style="margin-bottom:12.0pt"><span
            style="font-size:12.0pt;font-family:"Times New
            Roman",serif;mso-fareast-language:EN-CA">This time,
            it's behaving as expected. Maybe there should be a diagram
            somewhere with how these parameters work together. For
            example, each TLS connection will roughly follow the below
            steps along with their corresponding parameterized timeouts:<br>
            <br>
            1. TCP connect (tcp_connect_timeout)<br>
            2. TLS connect/accept handshake (tls_handshake_timeout)<br>
            3. TLS write (tls_send_timeout)<br>
            4. TLS write (tls_send_timeout)<br>
            <br>
            <o:p></o:p></span></p>
        <pre>Liviu Chircu<o:p></o:p></pre>
        <pre>OpenSIPS Developer<o:p></o:p></pre>
        <pre><a href="http://www.opensips-solutions.com" moz-do-not-send="true">http://www.opensips-solutions.com</a><span style="color:#1F497D"><o:p></o:p></span></pre>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
Users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a>
<a class="moz-txt-link-freetext" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>