Hi, I am using FreeBsd 8.2 and the behavior I am trying to understand is why there is no final ACK being sent by the client if net.inet.tcp.nolocaltimewait is set. Due to this server side communication need to rely upon receiving the RST for clean-up. Especially in the cases where client port is reused soon after the the connection being closed, additional resets are triggered.
198 <http://fxr.watson.org/fxr/source/netinet/source/netinet/tcp_timewait.c?v=FREEBSD82#L198> void 199 <http://fxr.watson.org/fxr/source/netinet/source/netinet/tcp_timewait.c?v=FREEBSD82#L199> tcp_twstart <http://fxr.watson.org/fxr/source/netinet/ident?v=FREEBSD82;i=tcp_twstart>(struct tcpcb <http://fxr.watson.org/fxr/source/netinet/ident?v=FREEBSD82;i=tcpcb> *tp <http://fxr.watson.org/fxr/source/netinet/ident?v=FREEBSD82;i=tp>) 200 <http://fxr.watson.org/fxr/source/netinet/source/netinet/tcp_timewait.c?v=FREEBSD82#L200> { 201 <http://fxr.watson.org/fxr/source/netinet/source/netinet/tcp_timewait.c?v=FREEBSD82#L201> struct tcptw <http://fxr.watson.org/fxr/source/netinet/ident?v=FREEBSD82;i=tcptw> *tw; 202 <http://fxr.watson.org/fxr/source/netinet/source/netinet/tcp_timewait.c?v=FREEBSD82#L202> struct inpcb <http://fxr.watson.org/fxr/source/netinet/ident?v=FREEBSD82;i=inpcb> *inp <http://fxr.watson.org/fxr/source/netinet/ident?v=FREEBSD82;i=inp> = tp <http://fxr.watson.org/fxr/source/netinet/ident?v=FREEBSD82;i=tp>->t_inpcb; 203 <http://fxr.watson.org/fxr/source/netinet/source/netinet/tcp_timewait.c?v=FREEBSD82#L203> int acknow; 204 <http://fxr.watson.org/fxr/source/netinet/source/netinet/tcp_timewait.c?v=FREEBSD82#L204> struct socket <http://fxr.watson.org/fxr/source/netinet/ident?v=FREEBSD82;i=socket> *so <http://fxr.watson.org/fxr/source/netinet/ident?v=FREEBSD82;i=so>; 205 <http://fxr.watson.org/fxr/source/netinet/source/netinet/tcp_timewait.c?v=FREEBSD82#L205> 206 <http://fxr.watson.org/fxr/source/netinet/source/netinet/tcp_timewait.c?v=FREEBSD82#L206> INP_INFO_WLOCK_ASSERT <http://fxr.watson.org/fxr/source/netinet/ident?v=FREEBSD82;i=INP_INFO_WLOCK_ASSERT>(&V_tcbinfo <http://fxr.watson.org/fxr/source/netinet/ident?v=FREEBSD82;i=V_tcbinfo>); */* tcp_tw_2msl_reset(). */* 207 <http://fxr.watson.org/fxr/source/netinet/source/netinet/tcp_timewait.c?v=FREEBSD82#L207> INP_WLOCK_ASSERT <http://fxr.watson.org/fxr/source/netinet/ident?v=FREEBSD82;i=INP_WLOCK_ASSERT>(inp <http://fxr.watson.org/fxr/source/netinet/ident?v=FREEBSD82;i=inp>); 208 <http://fxr.watson.org/fxr/source/netinet/source/netinet/tcp_timewait.c?v=FREEBSD82#L208> 209 <http://fxr.watson.org/fxr/source/netinet/source/netinet/tcp_timewait.c?v=FREEBSD82#L209> if (V_nolocaltimewait <http://fxr.watson.org/fxr/source/netinet/ident?v=FREEBSD82;i=V_nolocaltimewait> && in_localip <http://fxr.watson.org/fxr/source/netinet/ident?v=FREEBSD82;i=in_localip>(inp <http://fxr.watson.org/fxr/source/netinet/ident?v=FREEBSD82;i=inp>->inp_faddr <http://fxr.watson.org/fxr/source/netinet/ident?v=FREEBSD82;i=inp_faddr>)) { 210 <http://fxr.watson.org/fxr/source/netinet/source/netinet/tcp_timewait.c?v=FREEBSD82#L210> tp <http://fxr.watson.org/fxr/source/netinet/ident?v=FREEBSD82;i=tp> = tcp_close <http://fxr.watson.org/fxr/source/netinet/ident?v=FREEBSD82;i=tcp_close>(tp <http://fxr.watson.org/fxr/source/netinet/ident?v=FREEBSD82;i=tp>);<==== Closing the connection without sending Final ACK. 211 <http://fxr.watson.org/fxr/source/netinet/source/netinet/tcp_timewait.c?v=FREEBSD82#L211> if (tp <http://fxr.watson.org/fxr/source/netinet/ident?v=FREEBSD82;i=tp> != NULL <http://fxr.watson.org/fxr/source/netinet/ident?v=FREEBSD82;i=NULL>) 212 <http://fxr.watson.org/fxr/source/netinet/source/netinet/tcp_timewait.c?v=FREEBSD82#L212> INP_WUNLOCK <http://fxr.watson.org/fxr/source/netinet/ident?v=FREEBSD82;i=INP_WUNLOCK>(inp <http://fxr.watson.org/fxr/source/netinet/ident?v=FREEBSD82;i=inp>); 213 <http://fxr.watson.org/fxr/source/netinet/source/netinet/tcp_timewait.c?v=FREEBSD82#L213> return; 214 <http://fxr.watson.org/fxr/source/netinet/source/netinet/tcp_timewait.c?v=FREEBSD82#L214> } ... ... I will really appreciate any feedback on it. -Suraj _______________________________________________ freebsd-net@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-net To unsubscribe, send any mail to "freebsd-net-unsubscr...@freebsd.org"