Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 29 Nov 2001 12:09:53 +0800
From:      "¼B¾JÂ×" <cfliu@realtek.com.tw>
To:        <freebsd-net@freebsd.org>
Subject:   Does 4.4 kernel supports TCP simultaneous open?
Message-ID:  <002801c1788b$b2dc3dd0$a22314ac@RTCN3848>

next in thread | raw e-mail | index | archive | help
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"

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=3D"text/html; charset=3Dbig5" http-equiv=3DContent-Type>
<META content=3D"MSHTML 5.00.3315.2870" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT size=3D2>Hi, I am tracing the FreeBSD 4.4 kernel and I found =
that its=20
TCP seems NOT be able to do simultaneous open&nbsp;according to the =
source code.=20
In tcp_input.c,&nbsp; e</FONT><FONT size=3D2>ven though code near line =
#1750,=20
</FONT></DIV>
<DIV><FONT size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT size=3D2>case TCPS_SYN_RECEIVED:</FONT></DIV>
<DIV><FONT size=3D2>&nbsp;&nbsp; .....</FONT></DIV>
<DIV><FONT size=3D2>&nbsp;&nbsp;if (tp-&gt;t_flags &amp; TF_NEEDFIN)=20
{<BR>&nbsp;&nbsp;&nbsp;tp-&gt;t_state =3D=20
TCPS_FIN_WAIT_1;<BR>&nbsp;&nbsp;&nbsp;tp-&gt;t_flags &amp;=3D=20
~TF_NEEDFIN;<BR>&nbsp;&nbsp;} else {<BR>&nbsp;&nbsp;&nbsp;tp-&gt;t_state =
=3D=20
TCPS_ESTABLISHED;<BR>&nbsp;&nbsp;&nbsp;callout_reset(tp-&gt;tt_keep,=20
tcp_keepidle, <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =

tcp_timer_keep, tp);<BR>&nbsp;&nbsp;}</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT size=3D2>do change state from SYN_RCVD state to ESTABLISHED, =
however,=20
near line 1700 , the code fragment
<DIV>&nbsp;</DIV>
<DIV><FONT size=3D2>if (thflags &amp; TH_SYN) {<BR>&nbsp;&nbsp;tp =3D =
tcp_drop(tp,=20
ECONNRESET);<BR>&nbsp;&nbsp;rstreason =3D =
BANDLIM_UNLIMITED;<BR>&nbsp;&nbsp;goto=20
dropwithreset;<BR>&nbsp;}<BR></FONT></DIV>
<DIV><FONT size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT size=3D2>&nbsp;drops a packet with SYN bit set in SYN_RCVD =
state. I=20
think this would break TCP's simultaneous open. </FONT></DIV>
<DIV><FONT size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT size=3D2>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. </FONT></DIV>
<DIV><FONT size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT size=3D2>Am I correct?</FONT></DIV>
<DIV><FONT size=3D2></FONT>&nbsp;</DIV>
<DIV>David.</DIV>
<DIV>&nbsp;</DIV></FONT></DIV>
<DIV><FONT size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT size=3D2>&nbsp;</DIV></FONT></BODY></HTML>

------=_NextPart_000_0025_01C178CE.C0E0D240--


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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?002801c1788b$b2dc3dd0$a22314ac>