public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: Vincent Li <vincent.mc.li@gmail.com>
Cc: netdev@vger.kernel.org
Subject: Re: Piggyback the final ACK of the three way TCP connection establishment with the data
Date: Thu, 22 Mar 2012 16:13:57 -0700	[thread overview]
Message-ID: <1332458037.6521.12.camel@edumazet-glaptop> (raw)
In-Reply-To: <CAK3+h2ydKQ15U1_2dqWsHAL_LKYm-1xbJvUbeaMJShoOCU_TsA@mail.gmail.com>

On Thu, 2012-03-22 at 16:02 -0700, Vincent Li wrote:
> >
> > No kernel patch is needed, you already can do this on linux.
> >
> > Check file net/ipv4/tcp_input.c lines around 5722
> >
> >
> 
> is this code snippet in tcp_rcv_synsent_state_process that you refer to?
> 
> 5676                 if (sk->sk_write_pending ||
> 5677                     icsk->icsk_accept_queue.rskq_defer_accept ||
> 5678                     icsk->icsk_ack.pingpong) {
> 5679                         /* Save one ACK. Data will be ready after
> 5680                          * several ticks, if write_pending is set.
> 5681                          *
> 5682                          * It may be deleted, but with this
> feature tcpdumps
> 5683                          * look so _wonderfully_ clever, that I
> was not able
> 5684                          * to stand against the temptation 8)     --ANK
> 5685                          */
> 5686                         inet_csk_schedule_ack(sk);
> 5687                         icsk->icsk_ack.lrcvtime = tcp_time_stamp;
> 5688                         icsk->icsk_ack.ato       = TCP_ATO_MIN;
> 5689                         tcp_incr_quickack(sk);
> 5690                         tcp_enter_quickack_mode(sk);
> 5691                         inet_csk_reset_xmit_timer(sk, ICSK_TIME_DACK,
> 5692                                                   TCP_DELACK_MAX,
> TCP_RTO_MAX);
> 5693
> 5694 discard:
> 5695                         __kfree_skb(skb);
> 5696                         return 0;
> 5697                 } else {
> 5698                         tcp_send_ack(sk);
> 5699                 }
> 
> if I understand it correct on linux, the application code need to set
> socket option with TCP_DEFER_ACCEPT or TCP_QUICKACK in order to
> trigger it, correct?
> 
> We have user running wu-ftpd on HP Unix with tcp tunable
> tcp_delay_final_twh_ack on. so in active FTP situation, when wu-ftpd
> open up data connection to client, it sends SYN, client SYN/ACK, then
> ACK/PUSH with data. so on HU UNIX, it appears just turn on tcp tunable
> tcp_delay_final_twh_ack would make it happen.
> 
> but on Linux, do I need to change wu-ftpd code and modify the socket
> option with TCP_DEFER_ACCEPT or TCP_QUICKACK in order to trigger the
> code snippet in tcp_rcv_synsent_state_process?

Yes.

A third possibility (reading the code) if you use non blocking IO, is to
send() a message right after connect()

  parent reply	other threads:[~2012-03-22 23:13 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-21 23:38 Piggyback the final ACK of the three way TCP connection establishment with the data Vincent Li
2012-03-21 23:52 ` Rick Jones
2012-03-22  0:00 ` Eric Dumazet
2012-03-22 23:02   ` Vincent Li
2012-03-22 23:07     ` David Miller
2012-03-22 23:13     ` Eric Dumazet [this message]
2012-03-22 23:17       ` Eric Dumazet
2012-03-23 15:38         ` Vincent Li
2012-03-23 19:03           ` Yuchung Cheng
2012-03-23 19:11             ` Eric Dumazet
2012-03-22 23:44     ` Rick Jones

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1332458037.6521.12.camel@edumazet-glaptop \
    --to=eric.dumazet@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=vincent.mc.li@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox