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.
 
 
 

Reply via email to