Re: tcp_notify() and the connection establishment timer

From: Andre Oppermann (andre_at_freebsd.org)
Date: 10/21/04

  • Next message: Andre Oppermann: "Removing T/TCP and replacing it with something simpler"
    Date: Thu, 21 Oct 2004 15:40:25 +0200
    To: Fernando Gont <fernando@gont.com.ar>
    
    

    Fernando Gont wrote:
    >
    > Folks,
    >
    > I was trying to figure out what the BSD policy for aborting
    > connection-establishment attempts was.
    >
    > According to Stevens' TCPv2, when TCP sends the first SYN for establishing
    > a connection, a 75-seconds timer is initialized. If the connection cannot
    > be established before that 75-second period is over, the conenction will be
    > aborted.
    >
    > However, looking at the tcp_notify() function, I see the following code:
    >
    > static struct inpcb *
    > tcp_notify(inp, error)
    > struct inpcb *inp;
    > int error;
    > {
    > struct tcpcb *tp = (struct tcpcb *)inp->inp_ppcb;
    >
    > /*
    > * Ignore some errors if we are hooked up.
    > * If connection hasn't completed, has retransmitted several times,
    > * and receives a second error, give up now. This is better
    > * than waiting a long time to establish a connection that
    > * can never complete.
    > */
    > if (tp->t_state == TCPS_ESTABLISHED &&
    > (error == EHOSTUNREACH || error == ENETUNREACH ||
    > error == EHOSTDOWN)) {
    > return inp;
    > } else if (tp->t_state < TCPS_ESTABLISHED && tp->t_rxtshift > 3 &&
    > tp->t_softerror) {
    > tcp_drop(tp, error);
    > return (struct inpcb *)0;
    > } else {
    > tp->t_softerror = error;
    > return inp;
    > }
    > #if 0
    > wakeup( &so->so_timeo);
    > sorwakeup(so);
    > sowwakeup(so);
    > #endif
    > }
    >
    > Maybe I'm missing something, but I get the impression that, considering the
    > value (six seconds) to which the RTO is initialized, that part that says
    >
    > } else if (tp->t_state < TCPS_ESTABLISHED && tp->t_rxtshift > 3 &&
    > tp->t_softerror) {
    > tcp_drop(tp, error);
    > return (struct inpcb *)0;
    >
    > will never be executed, as the connection-establishment timer will always
    > timeout before the evaluated condition becomes true.
    >
    > Am I missing something? Or is it that this code is there just in case the
    > initial RTO is reduced to such a value that, in that case, this code would
    > kick in before the 75-seconds tconnection-establishment timer?

    Yes, tcp_notify() gets called from icmp_input() when ICMP unreachable or
    related error messages from the network are received. In those cases
    you don't want to wait the full 75 seconds because the network tells
    you that a connection cannot be established to that destination. It
    doesn't do that the first time the network tells us that to avoid too
    fast reaction on spurious network problems, outages or re-routings.

    -- 
    Andre
    _______________________________________________
    freebsd-net@freebsd.org mailing list
    http://lists.freebsd.org/mailman/listinfo/freebsd-net
    To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org"
    

  • Next message: Andre Oppermann: "Removing T/TCP and replacing it with something simpler"

    Relevant Pages

    • RE: Problems with Permissions
      ... And SBS server is only take ... the role of an internal server. ... they are all configured to connected to internal network. ... g. Run the Configure Email and Internet Connection Wizard on SBS server. ...
      (microsoft.public.windows.server.sbs)
    • Re: Outgoing POP3 email missing/lost/not received
      ... Funny thing is that I have had this ISP for 8 years and it has always been ... It looks like when you last ran CEICW, you set the ISP's mail server to: ... Internet Connection Wizard. ... After the wizard completes, the following network connection ...
      (microsoft.public.windows.server.sbs)
    • Re: server disconnection - very often
      ... Often get the redirected folders working offline prompt on some client ... VMware virtual network interface cause network issue. ... On the Connection Type page, click Broadband, and then click Next. ... |> re-initialize the offline files cache and database on client computers: ...
      (microsoft.public.windows.server.sbs)
    • Re: OT By a mile in parts comments on Viet Nam
      ... check bank accouts etc etc whilst away but is safe to do so over wireless and using the hotel network.. ... you should regard your connection as insecure and use some ... form of encryption to protect your passwords and privacy. ... My recommendation would be to set up a VPN endpoint in the UK that you ...
      (uk.comp.sys.mac)
    • Re: "Invalid Connection Data" Message XBOX 360 acting as an MCE
      ... Read my blog for the latest in Media Center topics ... I've tried direct connection of Xbox 360 to PC and also via my network ... The network trace is reporting TCP checksum issues when attempting ...
      (microsoft.public.windows.mediacenter)