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

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

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