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
[-- Attachment #1 --]
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,
case TCPS_SYN_RECEIVED:
.....
if (tp->t_flags & TF_NEEDFIN) {
tp->t_state = TCPS_FIN_WAIT_1;
tp->t_flags &= ~TF_NEEDFIN;
} else {
tp->t_state = TCPS_ESTABLISHED;
callout_reset(tp->tt_keep, tcp_keepidle,
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 = tcp_drop(tp, ECONNRESET);
rstreason = BANDLIM_UNLIMITED;
goto dropwithreset;
}
drops a packet with SYN bit set in SYN_RCVD state. I think this would break TCP's simultaneous open.
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.
Am I correct?
David.
[-- Attachment #2 --]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=big5" http-equiv=Content-Type>
<META content="MSHTML 5.00.3315.2870" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT size=2>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, e</FONT><FONT size=2>ven though code near line #1750,
</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>case TCPS_SYN_RECEIVED:</FONT></DIV>
<DIV><FONT size=2> .....</FONT></DIV>
<DIV><FONT size=2> if (tp->t_flags & TF_NEEDFIN)
{<BR> tp->t_state =
TCPS_FIN_WAIT_1;<BR> tp->t_flags &=
~TF_NEEDFIN;<BR> } else {<BR> tp->t_state =
TCPS_ESTABLISHED;<BR> callout_reset(tp->tt_keep,
tcp_keepidle, <BR>
tcp_timer_keep, tp);<BR> }</FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=2>do change state from SYN_RCVD state to ESTABLISHED, however,
near line 1700 , the code fragment
<DIV> </DIV>
<DIV><FONT size=2>if (thflags & TH_SYN) {<BR> tp = tcp_drop(tp,
ECONNRESET);<BR> rstreason = BANDLIM_UNLIMITED;<BR> goto
dropwithreset;<BR> }<BR></FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2> drops a packet with SYN bit set in SYN_RCVD state. I
think this would break TCP's simultaneous open. </FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>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. </FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>Am I correct?</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV>David.</DIV>
<DIV> </DIV></FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2> </DIV></FONT></BODY></HTML>
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?002801c1788b$b2dc3dd0$a22314ac>
