On Fri, Feb 23, 2001 at 05:20:13AM +0100, Jesper Skriver wrote:
> On Fri, Feb 23, 2001 at 04:34:05AM +0100, Jesper Skriver wrote:
> > On Thu, Feb 22, 2001 at 09:20:44PM -0600, Jonathan Lemon wrote:
> > > On Fri, Feb 23, 2001 at 03:49:52AM +0100, Jesper Skriver wrote:
> > > >
> > > > I still think we should react to the following as a minimum
> > > > - type 3 code 0 net unreachable
> > > > - type 3 code 1 host unreachable
> > >
> > > RFC 1122, Section 4.2.3.9 says:
> > >
> > > o Destination Unreachable -- codes 0, 1, 5
> > > Since these Unreachable messages indicate soft error
> > > conditions, TCP MUST NOT abort the connection, and it
> > > SHOULD make the information available to the
> > > application.
> > >
> > > I think that these should be transients.
> >
> > As discussed on IRC I suggest adding the ability (under control of a
> > sysctl, disabled by default) to treat 0/1 (perhaps even 5) like 2,3,9 &
> > 10.
>
> Forget this, as discussed on IRC, it would be better to have a code 0/1
> trigger a immediate retransmit of the SYN, this would also give us
> timeouts < 10 secs ...
>
> If jlemon doesn't beat me to it, I'll try to look at this in the weekend
> ... as a possible "take III"
23:53:42.440817 193.162.74.6.1059 > 193.162.153.164.53: 36307+ PTR?
1.23.41.195.in-addr.arpa. (42)
23:53:42.458868 193.162.153.164.53 > 193.162.74.6.1059: 36307 NXDomain 0/1/0 (92)
23:53:42.460135 193.162.74.6.1165 > 195.41.23.1.23: S 1847740321:1847740321(0) win
16384 <mss 1460> (DF) [tos 0x10]
23:53:42.511069 195.249.6.93 > 193.162.74.6: icmp: host 195.41.23.1 unreachable (DF)
23:53:42.511161 193.162.74.6.1165 > 195.41.23.1.23: S 1847740321:1847740321(0) win
16384 <mss 1460> (DF) [tos 0x10]
23:53:42.516799 195.249.6.93 > 193.162.74.6: icmp: host 195.41.23.1 unreachable (DF)
23:53:42.516836 193.162.74.6.1165 > 195.41.23.1.23: S 1847740321:1847740321(0) win
16384 <mss 1460> (DF) [tos 0x10]
23:53:42.521763 195.249.6.93 > 193.162.74.6: icmp: host 195.41.23.1 unreachable (DF)
23:53:42.521796 193.162.74.6.1165 > 195.41.23.1.23: S 1847740321:1847740321(0) win
16384 <mss 1460> (DF) [tos 0x10]
23:53:42.526749 195.249.6.93 > 193.162.74.6: icmp: host 195.41.23.1 unreachable (DF)
23:53:42.526793 193.162.74.6.1165 > 195.41.23.1.23: S 1847740321:1847740321(0) win
16384 <mss 1460> (DF) [tos 0x10]
23:53:42.531753 195.249.6.93 > 193.162.74.6: icmp: host 195.41.23.1 unreachable (DF)
jesper@tam% time telnet 195.41.23.1
Trying 195.41.23.1...
telnet: connect to address 195.41.23.1: No route to host
telnet: Unable to connect to remote host
0.000u 0.020s 0:00.70 2.8% 88+164k 0+0io 12pf+0w
But that is probably too fast, what if we delay the retransmit by say
100ms efter recieving the host unreachable ?
Diff below
Index: tcp_subr.c
===================================================================
RCS file: /home/ncvs/src/sys/netinet/tcp_subr.c,v
retrieving revision 1.93
diff -u -r1.93 tcp_subr.c
--- tcp_subr.c 2001/02/23 21:07:06 1.93
+++ tcp_subr.c 2001/02/24 21:30:30
@@ -138,6 +138,11 @@
SYSCTL_INT(_net_inet_tcp, OID_AUTO, icmp_may_rst, CTLFLAG_RW, &icmp_may_rst, 0,
"Certain ICMP unreachable messages may abort connections in SYN_SENT");
+static int icmp_trigger_retransmit = 1;
+SYSCTL_INT(_net_inet_tcp, OID_AUTO, icmp_trigger_retransmit, CTLFLAG_RW,
+ &icmp_trigger_retransmit, 0,
+ "Certain ICMP unreachable messages trigger retransmit when in SYN_SENT");
+
static void tcp_cleartaocache __P((void));
static void tcp_notify __P((struct inpcb *, int));
@@ -777,7 +782,25 @@
} else if (tp->t_state < TCPS_ESTABLISHED && tp->t_rxtshift > 3 &&
tp->t_softerror)
tcp_drop(tp, error);
- else
+ else if (tp->t_state == TCPS_SYN_SENT && icmp_trigger_retransmit) {
+ tp->t_softerror = error;
+ tp->t_rxtshift++;
+ tp->snd_nxt = tp->snd_una;
+ /*
+ * Note: We overload snd_recover to function also as the
+ * snd_last variable described in RFC 2582
+ */
+ tp->snd_recover = tp->snd_max;
+ /*
+ * Force a segment to be sent.
+ */
+ tp->t_flags |= TF_ACKNOW;
+ /*
+ * If timing a segment in this window, stop the timer.
+ */
+ tp->t_rtttime = 0;
+ (void) tcp_output(tp);
+ } else
tp->t_softerror = error;
#if 0
wakeup((caddr_t) &so->so_timeo);
/Jesper
--
Jesper Skriver, jesper(at)skriver(dot)dk - CCIE #5456
Work: Network manager @ AS3292 (Tele Danmark DataNetworks)
Private: FreeBSD committer @ AS2109 (A much smaller network ;-)
One Unix to rule them all, One Resolver to find them,
One IP to bring them all and in the zone to bind them.
To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-net" in the body of the message