CoDel AQM discussions
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: Stuart Cheshire <cheshire@apple.com>,
	Bob McMahon <bob.mcmahon@broadcom.com>
Cc: starlink@lists.bufferbloat.net,
	"Valdis Klētnieks" <valdis.kletnieks@vt.edu>,
	Make-Wifi-fast <make-wifi-fast@lists.bufferbloat.net>,
	"David P. Reed" <dpreed@deepplum.com>,
	"Cake List" <cake@lists.bufferbloat.net>,
	codel <codel@lists.bufferbloat.net>,
	cerowrt-devel <cerowrt-devel@lists.bufferbloat.net>,
	bloat <bloat@lists.bufferbloat.net>,
	"Steve Crocker" <steve@shinkuro.com>,
	"Vint Cerf" <vint@google.com>
Subject: Re: [Codel] [Bloat] [Make-wifi-fast] TCP_NOTSENT_LOWAT applied to e2e TCP msg latency
Date: Mon, 25 Oct 2021 21:24:00 -0700	[thread overview]
Message-ID: <0e29e225-9f55-4392-640a-2d27c4c26116@gmail.com> (raw)
In-Reply-To: <E3373586-EF4C-40DF-885B-0D6134E6EAF1@apple.com>



On 10/25/21 8:11 PM, Stuart Cheshire via Bloat wrote:
> On 21 Oct 2021, at 17:51, Bob McMahon via Make-wifi-fast <make-wifi-fast@lists.bufferbloat.net> wrote:
> 
>> Hi All,
>>
>> Sorry for the spam. I'm trying to support a meaningful TCP message latency w/iperf 2 from the sender side w/o requiring e2e clock synchronization. I thought I'd try to use the TCP_NOTSENT_LOWAT event to help with this. It seems that this event goes off when the bytes are in flight vs have reached the destination network stack. If that's the case, then iperf 2 client (sender) may be able to produce the message latency by adding the drain time (write start to TCP_NOTSENT_LOWAT) and the sampled RTT.
>>
>> Does this seem reasonable?
> 
> I’m not 100% sure what you’re asking, but I will try to help.
> 
> When you set TCP_NOTSENT_LOWAT, the TCP implementation won’t report your endpoint as writable (e.g., via kqueue or epoll) until less than that threshold of data remains unsent. It won’t stop you writing more bytes if you want to, up to the socket send buffer size, but it won’t *ask* you for more data until the TCP_NOTSENT_LOWAT threshold is reached.


When I implemented TCP_NOTSENT_LOWAT back in 2013 [1], I made sure that sendmsg() would actually
stop feeding more bytes in TCP transmit queue if the current amount of unsent bytes
was above the threshold.

So it looks like Apple implementation is different, based on your description ?

[1] https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git/commit/?id=c9bee3b7fdecb0c1d070c7b54113b3bdfb9a3d36

netperf does not use epoll(), but rather a loop over sendmsg().

One of the point of TCP_NOTSENT_LOWAT for Google was to be able to considerably increase
max number of bytes in transmit queues (3rd column of /proc/sys/net/ipv4/tcp_wmem)
by 10x, allowing for autotune to increase BDP for big RTT flows, this without
increasing memory needs for flows with small RTT.

 In other words, the TCP implementation attempts to keep BDP bytes in flight + TCP_NOTSENT_LOWAT bytes buffered and ready to go. The BDP of bytes in flight is necessary to fill the network pipe and get good throughput. The TCP_NOTSENT_LOWAT of bytes buffered and ready to go is provided to give the source software some advance notice that the TCP implementation will soon be looking for more bytes to send, so that the buffer doesn’t run dry, thereby lowering throughput. (The old SO_SNDBUF option conflates both “bytes in flight” and “bytes buffered and ready to go” into the same number.)
> 
> If you wait for the TCP_NOTSENT_LOWAT notification, write a chunk of n bytes of data, and then wait for the next TCP_NOTSENT_LOWAT notification, that will tell you roughly how long it took n bytes to depart the machine. You won’t know why, though. The bytes could depart the machine in response for acks indicating that the same number of bytes have been accepted at the receiver. But the bytes can also depart the machine because CWND is growing. Of course, both of those things are usually happening at the same time.
> 
> How to use TCP_NOTSENT_LOWAT is explained in this video:
> 
> <https://developer.apple.com/videos/play/wwdc2015/719/?time=2199>
> 
> Later in the same video is a two-minute demo (time offset 42:00 to time offset 44:00) showing a “before and after” demo illustrating the dramatic difference this makes for screen sharing responsiveness.
> 
> <https://developer.apple.com/videos/play/wwdc2015/719/?time=2520>
> 
> Stuart Cheshire
> _______________________________________________
> Bloat mailing list
> Bloat@lists.bufferbloat.net
> https://lists.bufferbloat.net/listinfo/bloat
> 

  parent reply	other threads:[~2021-10-26  4:24 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-01  0:12 [Codel] Due Aug 2: Internet Quality workshop CFP for the internet architecture board Dave Taht
     [not found] ` <1625188609.32718319@apps.rackspace.com>
2021-07-02 17:07   ` [Codel] [Cerowrt-devel] " Dave Taht
     [not found]     ` <CAHb6LvrjgKnfe_jaGgx7_B1VDTkZfTmP0OyTmxL9ojWoxogrsA@mail.gmail.com>
2021-07-06 13:46       ` [Codel] [Starlink] [Make-wifi-fast] " Ben Greear
     [not found]         ` <CAHb6LvqSkcGZBZ+iHY-g0vSunqe1sFHmvoFXGjWSoYvtwHeHaA@mail.gmail.com>
2021-07-06 21:24           ` Ben Greear
     [not found]             ` <CAHb6LvodW0WNeHAfRHLB6NhDT6+maWVnoR14+setpzCWnwiPTQ@mail.gmail.com>
2021-07-07 13:34               ` Ben Greear
     [not found]         ` <1625773080.94974089@apps.rackspace.com>
     [not found]           ` <FDF5C7A7-47A6-4123-A948-352C07C35F02@cs.ucla.edu>
2021-07-09 10:05             ` [Codel] [Make-wifi-fast] [Starlink] " Luca Muscariello
     [not found]               ` <CAHb6LvqsZFDDkC1qjr9ccXNjFtq1qnAevQpccNFydP4BOVVL1Q@mail.gmail.com>
2021-08-02 23:16                 ` [Codel] [Cake] " David Lang
2021-08-02 23:55                   ` Ben Greear
     [not found]                     ` <CAHb6Lvp851pVCt+zUv1PZgpHafCG4RPXEwMn6=CJFXhVf9fK8w@mail.gmail.com>
2021-08-03  3:12                       ` David Lang
     [not found]                         ` <CAHb6LvqfRxKU0BW04ypRcPDpCcWymnS6qzb3gneQSbBrAbRhHQ@mail.gmail.com>
2021-08-03  4:30                           ` David Lang
     [not found]                             ` <CAHb6LvpcawqCvgt5MmhXADYG=oaY5rbdaC=7ETwOVzpHXak2kQ@mail.gmail.com>
2021-08-03  4:44                               ` David Lang
     [not found]                           ` <202108101410.17AEAR4w075939@gndrsh.dnsmgr.net>
     [not found]                             ` <5AF5551E2A7041168E7071FDA0F6B8EC@SRA6>
     [not found]                               ` <CAHb6LvpAmUKgsMAoZGrbAvS01DF=yWyJj56ox+FrDM_tEc=0Ng@mail.gmail.com>
     [not found]                                 ` <03CA2CDA3EC5415DA229F835BE039994@SRA6>
     [not found]                                   ` <CAHb6LvoiVZq91m-C3iJFC95fYLPHCY3zQo6O0XTUDAJquu5KbQ@mail.gmail.com>
     [not found]                                     ` <92A399A23FEE4C52ADFC1734E6840756@SRA6>
     [not found]                                       ` <CACw=56K_Sj24FAO17cY4vDYhe1-gAXW_fQKLSBKSMqSE0kCRmA@mail.gmail.com>
2021-08-10 20:44                                         ` [Codel] [Starlink] Anhyone have a spare couple a hundred million ... Elon may need to start a go-fund-me page! David Lang
     [not found]                   ` <CAHb6LvpK48u+8coP1pWJVjva_jYaQa-bGuArAGnf8ku-=xoSBw@mail.gmail.com>
2021-08-03  3:06                     ` [Codel] [Cake] [Make-wifi-fast] [Starlink] [Cerowrt-devel] Due Aug 2: Internet Quality workshop CFP for the internet architecture board David Lang
     [not found]                   ` <8677F5C4-1893-4A61-A13C-3C8BE17CB789@cs.ucla.edu>
     [not found]                     ` <CAHb6LvpQP_jCiHeNJAD9qt+wB-HqUAW7N6aGJ+6-PXg+KE5Z2Q@mail.gmail.com>
     [not found]                       ` <4F6EFB347C08475A9F53B24E0D8BEAE2@SRA6>
     [not found]                         ` <CAHb6LvqUctN5SMcqgZNh5u7=nJhtWOuXEmh59PPYag2g+xVrtw@mail.gmail.com>
2021-08-08 18:36                           ` [Codel] [Make-wifi-fast] [Starlink] [Cake] " Aaron Wood
2021-08-08 18:48                             ` [Codel] [Bloat] " Jonathan Morton
     [not found]               ` <1625859083.09751240@apps.rackspace.com>
     [not found]                 ` <BCD9F979-341F-4292-9D11-FAE91FC3967E@akamai.com>
2021-07-09 23:37                   ` [Codel] [Bloat] Little's Law mea culpa, but not invalidating my main point Toke Høiland-Jørgensen
     [not found]                 ` <8C38E940-8B97-4767-A39B-25F043AE0856@cs.ucla.edu>
2021-07-09 23:56                   ` Jonathan Morton
2021-07-17 23:56                     ` [Codel] [Make-wifi-fast] " Aaron Wood
     [not found]                 ` <EF8D7620-438A-4F65-94D9-B35FDB76FBBD@cable.comcast.com>
     [not found]                   ` <1626111630.69692379@apps.rackspace.com>
     [not found]                     ` <CAHb6LvoD+ACc+17WhTVmS8HYnYyboJrCg5zQF8uXtzrmqqKfPA@mail.gmail.com>
2021-07-12 19:07                       ` [Codel] " Ben Greear
     [not found]                         ` <CAHb6LvpyQtGg3sMF2RV_gMpEcaY32A70VaEwtsnoeq4DHtv7EA@mail.gmail.com>
2021-07-12 20:32                           ` Ben Greear
2021-07-12 20:36                             ` [Codel] [Cake] " David Lang
2021-07-17 23:29                             ` [Codel] " Aaron Wood
2021-07-12 21:54                           ` [Codel] [Make-wifi-fast] " Jonathan Morton
2021-09-20  1:21                 ` [Codel] " Dave Taht
     [not found]                   ` <257851.1632110422@turing-police>
2021-09-20  4:09                     ` [Codel] [Bloat] [Cerowrt-devel] " David Lang
     [not found]                     ` <CABf5zv+yq_oJ7O7YqVeSbZ2Qns3C4hESzNA2V0zNb0L1Zg-mgw@mail.gmail.com>
     [not found]                       ` <CAHxHggd-4rZ5Nc4raaoRUjjL17MVh8UsNu_5eL8eiLJ=R_68wA@mail.gmail.com>
     [not found]                         ` <CAHb6Lvp86iw=DQMN8Z+f7yUJu-5pmVUxsM1_1Jw8RJb2XRcMcg@mail.gmail.com>
     [not found]                           ` <1632680642.869711321@apps.rackspace.com>
     [not found]                             ` <CAHb6Lvp1dxnbuCNiE5FKC-yRyD6HGkb0H1ZQAm_nSxANwJg2pA@mail.gmail.com>
     [not found]                               ` <E3373586-EF4C-40DF-885B-0D6134E6EAF1@apple.com>
2021-10-26  4:24                                 ` Eric Dumazet [this message]
     [not found]                                 ` <CAHb6Lvomc+2y++qOm9v3OzYCdmWDUEROJb+unybj0Mir0faXQQ@mail.gmail.com>
     [not found]                                   ` <CAKf5G6JpeaxRkbwhuNE5zUb7tX3H4eo0HOuX+C0DCSrcg4Byhg@mail.gmail.com>
     [not found]                                     ` <CAHb6LvpUBKFGUTnuafGxQAJBfNEO=zS20SvxTJ88e6VJAP54=g@mail.gmail.com>
2021-10-27 14:29                                       ` [Codel] [Make-wifi-fast] [Starlink] TCP_NOTSENT_LOWAT applied to e2e TCP msg latency Sebastian Moeller
     [not found] <CAHb6LvosV921NSpYXpzgRScuJDFNemCsUGqLfOm5NsOyt+TOVA@mail.gmail.com>
     [not found] ` <6D6492CF-BD6D-45BF-BD40-FA49166F6DA4@apple.com>
2021-10-27  1:12   ` [Codel] [Bloat] [Make-wifi-fast] " Eric Dumazet
     [not found]     ` <CAHb6LvraLJO8jHJ3RMbTxyrfs+bM05QvGB_JWpOZx9E2nAo89Q@mail.gmail.com>
2021-10-27  5:40       ` Eric Dumazet

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

  List information: https://lists.bufferbloat.net/postorius/lists/codel.lists.bufferbloat.net/

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

  git send-email \
    --in-reply-to=0e29e225-9f55-4392-640a-2d27c4c26116@gmail.com \
    --to=eric.dumazet@gmail.com \
    --cc=bloat@lists.bufferbloat.net \
    --cc=bob.mcmahon@broadcom.com \
    --cc=cake@lists.bufferbloat.net \
    --cc=cerowrt-devel@lists.bufferbloat.net \
    --cc=cheshire@apple.com \
    --cc=codel@lists.bufferbloat.net \
    --cc=dpreed@deepplum.com \
    --cc=make-wifi-fast@lists.bufferbloat.net \
    --cc=starlink@lists.bufferbloat.net \
    --cc=steve@shinkuro.com \
    --cc=valdis.kletnieks@vt.edu \
    --cc=vint@google.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