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 according to the = source code.=20 In tcp_input.c, e</FONT><FONT size=3D2>ven though code near line = #1750,=20 </FONT></DIV> <DIV><FONT size=3D2></FONT> </DIV> <DIV><FONT size=3D2>case TCPS_SYN_RECEIVED:</FONT></DIV> <DIV><FONT size=3D2> .....</FONT></DIV> <DIV><FONT size=3D2> if (tp->t_flags & TF_NEEDFIN)=20 {<BR> tp->t_state =3D=20 TCPS_FIN_WAIT_1;<BR> tp->t_flags &=3D=20 ~TF_NEEDFIN;<BR> } else {<BR> tp->t_state = =3D=20 TCPS_ESTABLISHED;<BR> callout_reset(tp->tt_keep,=20 tcp_keepidle, <BR> = tcp_timer_keep, tp);<BR> }</FONT></DIV> <DIV> </DIV> <DIV><FONT size=3D2>do change state from SYN_RCVD state to ESTABLISHED, = however,=20 near line 1700 , the code fragment <DIV> </DIV> <DIV><FONT size=3D2>if (thflags & TH_SYN) {<BR> tp =3D = tcp_drop(tp,=20 ECONNRESET);<BR> rstreason =3D = BANDLIM_UNLIMITED;<BR> goto=20 dropwithreset;<BR> }<BR></FONT></DIV> <DIV><FONT size=3D2></FONT> </DIV> <DIV><FONT size=3D2> 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> </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> </DIV> <DIV><FONT size=3D2>Am I correct?</FONT></DIV> <DIV><FONT size=3D2></FONT> </DIV> <DIV>David.</DIV> <DIV> </DIV></FONT></DIV> <DIV><FONT size=3D2></FONT> </DIV> <DIV><FONT size=3D2> </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>