netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mihai Maruseac <mihai.maruseac@gmail.com>
To: kernelnewbies@kernelnewbies.org
Cc: netdev@vger.kernel.org
Subject: TCP_CORK questions
Date: Wed, 2 Nov 2011 11:43:06 +0200	[thread overview]
Message-ID: <CAOMsUML9ijO3WQetPLyo9nbfLNKUVuN5aanL_dCbJuKZUUwsmQ@mail.gmail.com> (raw)

Hi,

We are using TCP_CORK with TCP_NODELAY. We are setting TCP_NODELAY
first and then setting TCP_CORK before sending a bunch of data
buffers. After sending all the buffers we are clearing TCP_CORK. The
expectation -- as per manpage -- is that when TCP_CORK is set small
data packets will not be sent. When TCP_CORK is removed it will
immediately send out the remaining data even if the remaining amount
is very small.

However, this is not the observed behavior. Small packets are sent at
an approximatively constant rate. Digging further into the manpage for
tcp we saw that there is a 200ms ceiling on the time for which the
output is corked. Can we change this limit somehow? Ideally, in our
case we would like to have userspace mark a socket such that it will
only send full packets as long as it is marked, even if the completion
comes after a long time.

Digging into tcp.c when the socket options are set, we found that if
when setting TCP_NAGLE_CORK we also disable TCP_NAGLE_PUSH the code
works as intended. Is this the right way to solve it? Code comments
suggest that disabling this flag there has no effect.

Thanks,
Mihai

                 reply	other threads:[~2011-11-02  9:43 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=CAOMsUML9ijO3WQetPLyo9nbfLNKUVuN5aanL_dCbJuKZUUwsmQ@mail.gmail.com \
    --to=mihai.maruseac@gmail.com \
    --cc=kernelnewbies@kernelnewbies.org \
    --cc=netdev@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).