From owner-freebsd-net Wed Nov 28 20:37:48 2001 Delivered-To: freebsd-net@freebsd.org Received: from mail.realtek.com.tw (ms1.realtek.com.tw [203.69.112.3]) by hub.freebsd.org (Postfix) with ESMTP id E956337B405 for ; Wed, 28 Nov 2001 20:37:38 -0800 (PST) Received: from RTCN3848 ([172.20.35.162]) by mail.realtek.com.tw (Lotus Domino Release 5.0.8) with SMTP id 2001112912020428:13125 ; Thu, 29 Nov 2001 12:02:04 +0800 Message-ID: <002801c1788b$b2dc3dd0$a22314ac@RTCN3848> From: "¼B¾JÂ×" To: Subject: Does 4.4 kernel supports TCP simultaneous open? Date: Thu, 29 Nov 2001 12:09:53 +0800 MIME-Version: 1.0 X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 X-MIMETrack: Itemize by SMTP Server on ms1/Realtek(Release 5.0.8 |June 18, 2001) at 11/29/2001 12:02:04 PM, Serialize by Router on ms1/Realtek(Release 5.0.8 |June 18, 2001) at 11/29/2001 12:35:05 PM, Serialize complete at 11/29/2001 12:35:05 PM Content-Type: multipart/alternative; boundary="----=_NextPart_000_0025_01C178CE.C0E0D240" Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org This is a multi-part message in MIME format. ------=_NextPart_000_0025_01C178CE.C0E0D240 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="big5" Hi, I am tracing the FreeBSD 4.4 kernel and I found that its TCP seems = NOT be able to do simultaneous open according to the source code. In = tcp_input.c, even though code near line #1750,=20 case TCPS_SYN_RECEIVED: ..... if (tp->t_flags & TF_NEEDFIN) { tp->t_state =3D TCPS_FIN_WAIT_1; tp->t_flags &=3D ~TF_NEEDFIN; } else { tp->t_state =3D TCPS_ESTABLISHED; callout_reset(tp->tt_keep, tcp_keepidle,=20 tcp_timer_keep, tp); } do change state from SYN_RCVD state to ESTABLISHED, however, near line = 1700 , the code fragment if (thflags & TH_SYN) { tp =3D tcp_drop(tp, ECONNRESET); rstreason =3D BANDLIM_UNLIMITED; goto dropwithreset; } drops a packet with SYN bit set in SYN_RCVD state. I think this would = break TCP's simultaneous open.=20 Since upon receiving a SYN segment in SYN_SENT state, TCP switches to = SYN_RCVD state and sends a (ACK,SYN) segment to the peer, if the peer = drops segments with SYN bit set during SYN_RCVD state, the simultaneous = open mechanism of TCP would break.=20 Am I correct? David. ------=_NextPart_000_0025_01C178CE.C0E0D240 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset="big5"
Hi, I am tracing the FreeBSD 4.4 kernel and I found = that its=20 TCP seems NOT be able to do simultaneous open according to the = source code.=20 In tcp_input.c,  even though code near line = #1750,=20
 
case TCPS_SYN_RECEIVED:
   .....
  if (tp->t_flags & TF_NEEDFIN)=20 {
   tp->t_state =3D=20 TCPS_FIN_WAIT_1;
   tp->t_flags &=3D=20 ~TF_NEEDFIN;
  } else {
   tp->t_state = =3D=20 TCPS_ESTABLISHED;
   callout_reset(tp->tt_keep,=20 tcp_keepidle,
          = tcp_timer_keep, tp);
  }
 
do change state from SYN_RCVD state to ESTABLISHED, = however,=20 near line 1700 , the code fragment
 
if (thflags & TH_SYN) {
  tp =3D = tcp_drop(tp,=20 ECONNRESET);
  rstreason =3D = BANDLIM_UNLIMITED;
  goto=20 dropwithreset;
 }
 
 drops a packet with SYN bit set in SYN_RCVD = state. I=20 think this would break TCP's simultaneous open.
 
Since upon receiving a SYN segment in SYN_SENT = state, TCP=20 switches to SYN_RCVD state and sends a (ACK,SYN) segment to the peer, if = the=20 peer drops segments with SYN bit set during SYN_RCVD state, the = simultaneous=20 open mechanism of TCP would break.
 
Am I correct?
 
David.
 
 
 
------=_NextPart_000_0025_01C178CE.C0E0D240-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message