Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 16 Dec 1998 07:00:57 -0800
From:      David Greenman <dg@root.com>
To:        Guido van Rooij <guido@gvr.org>
Cc:        freebsd-hackers@FreeBSD.ORG
Subject:   Re: tcp bug on reeBSD 
Message-ID:  <199812161500.HAA09803@root.com>
In-Reply-To: Your message of "Wed, 16 Dec 1998 14:02:44 %2B0100." <19981216140244.A5966@gvr.org> 

next in thread | previous in thread | raw e-mail | index | archive | help
>Underneath a log of a connection between my system and wcarchive.
>
>03:00:04.014342 194.151.74.97.4871 > 209.155.82.18.21: S 3641921983:3641921983(0
>) win 16384 <mss 1460,nop,wscale 0,nop,nop,timestamp[|tcp]> (DF)
>03:00:04.552606 209.155.82.18.21 > 194.151.74.97.4871: S 3383878865:3383878865(0
>) ack 3641921984 win 17520 <mss 1460>
>03:00:04.554559 194.151.74.97.4871 > 209.155.82.18.21: . ack 3383878866 win 1752
>0 (DF)
>03:00:09.621134 209.155.82.18.21 > 194.151.74.97.4871: P 3383878866:3383878957(9
>1) ack 3641921984 win 17520 [tos 0x10]
>03:00:09.625468 194.151.74.97.4871 > 209.155.82.18.21: P 3641921984:3641922000(1
>6) ack 3383878957 win 17520 (DF)
>03:00:10.696185 209.155.82.18.21 > 194.151.74.97.4871: . ack 3641922000 win 1750
>4 [tos 0x10]
>03:00:10.789549 209.155.82.18.21 > 194.151.74.97.4871: F 3383879419:3383879419(0
>) ack 3641922000 win 17520 [tos 0x10]
>03:00:10.791439 194.151.74.97.4871 > 209.155.82.18.21: . ack 3383878957 win 1752
>0 (DF)
>03:00:10.865450 209.155.82.18.21 > 194.151.74.97.4871: P 3383878957:3383879419(4
>62) ack 3641922000 win 17520 [tos 0x10]
>03:00:10.868537 194.151.74.97.4871 > 209.155.82.18.21: . ack 3383879420 win 1705
>8 (DF)
>03:00:10.874507 194.151.74.97.4871 > 209.155.82.18.21: P 3641922000:3641922006(6
>) ack 3383879420 win 17520 (DF)
>03:00:10.893632 194.151.74.97.4871 > 209.155.82.18.21: F 3641922006:3641922006(0
>) ack 3383879420 win 17520 (DF)
>03:00:11.381719 209.155.82.18.21 > 194.151.74.97.4871: R 3383879420:3383879420(0
>) win 0
>
>I think wcarchive is not behaving okay by sending the RST. Wcarchive is
>in the FIN-WAIT-1 or FIN-WAIT-2 state and from what I see in the rfc,
>wcarchive may only send an RST if:
>    3.  If the connection is in a synchronized state (ESTABLISHED,
>    FIN-WAIT-1, FIN-WAIT-2, CLOSE-WAIT, CLOSING, LAST-ACK, TIME-WAIT),
>    any unacceptable segment (out of window sequence number or
>    unacceptible acknowledgment number) must elicit only an empty
>    acknowledgment segment containing the current send-sequence number
>    and an acknowledgment indicating the next sequence number expected
>    to be received, and the connection remains in the same state.
>
>But the RST did not ack anything. But besides, the segment
>(3641922000:3641922006) is not an unacceptable segment accoriding
>to what thr RFC says. A half-close is a perfectly valid mechanism
>and my host is allowed to send additional segments to wcarchive.
>However, from looking at the RFC I can not discover how wcarchive
>should act. I think it should just ack 3641922000 again and have
>my host discover that the other end closed the connection.
>
>What do you guys think?

   Well, the above shows that the port involved is the FTP control channel,
which gets closed at the end of the session. I think the RST was in response
to your 6 byte PUSHed packet, not your FIN packet. Since the application on
wcarchive already closed it's end of the connection (as evidenced by the
FIN that it sent), there is no longer a recipient of any data that might be
sent to it. It seems to me that the appropriate response in a situation like
this would be to send an RST in response to that data.
   Yes, a half-close is a valid mechanism, but you can only send to the side
that hasn't closed yet.

-DG

David Greenman
Co-founder/Principal Architect, The FreeBSD Project

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199812161500.HAA09803>