From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-il1-x143.google.com (mail-il1-x143.google.com [IPv6:2607:f8b0:4864:20::143]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.bufferbloat.net (Postfix) with ESMTPS id 561333B29E for ; Wed, 22 Apr 2020 12:15:42 -0400 (EDT) Received: by mail-il1-x143.google.com with SMTP id e8so2465437ilm.7 for ; Wed, 22 Apr 2020 09:15:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=H0NyYBIYVKc6eQcVKymmlI/Rn5DIPL6JhMBtgYtORqo=; b=mIq7DBEsgtriQ+0BpYXAfEs7UY37B+lxl0Lej2g5iisyLMT0/HAM2iAMb44GIN9wDL Xp+7hGhzGDJjYpAp8KUurHJL/oQwH5PnBDZZ1OvlewvxiBrbDGbofZ8feF7/hCZ8LeZe xnJiFPL2fvVW+c4w87xSg/knrHWVfKawxj8D+byC1yHOPczpqG09HYoDTrcOEBK9j8mn nIqfWIm+XAun+Ey2v0+xWmtd/ehVdGhHwmzCpl5lUDV5Y2dEhL1oculeW2NMAqw9wmw4 GnLHQgGrDCOcaKtaLuR0oHEvxdTOPDItvskVRsl7SetT5BFDgyfgyd6BfLirS9fo/u6M Dc5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=H0NyYBIYVKc6eQcVKymmlI/Rn5DIPL6JhMBtgYtORqo=; b=kA/1yJ4Fe3JJRMli6x0pplPE9oVXLG6XVhp7cpiufXBC7IDr3yn4KmZkNc1fi4nlSW 7MdOSVEovDbuZzAf8NypIUUnhP90zTFQ5wolw8bgdJADMnFRenxofB4+sDnpgnciQO2E WoWxQJzkoPouDLHEKvEvfwUby4mYjB/DyZpXERFD8P4HABHTif23ytzDrabVGc11xTun aG9JujjdTgh0yvf5MScFfWqqdfr4CdDq/786Z/c6bXU3LRYnDtRmj0f9/fIWwsLiTlyi XNsBtD8xxzyTFgZyOTMpMt1wHfDgzlxyMXvy499oJZIYIrrK6SIxqF0xpx6kGoAg8tDr 7TtA== X-Gm-Message-State: AGi0PuaVmjj5DV8MC/up5F5ggY2txKBY+ZvY1ZrghRpIIgP3j7Avo/a7 eHzIj/tfJEPIM6W90CeB1zwEZ1LQPpZWjWzhuWY= X-Google-Smtp-Source: APiQypLYXNlx7WrFbwAN7qvqNd/VigEtLu90Q70Vniq+zhZNwnvpni+A2hPvbd2yssbxYD8flXbd7xeGUKLrrdBtm5U= X-Received: by 2002:a92:dc0d:: with SMTP id t13mr2519358iln.287.1587572141654; Wed, 22 Apr 2020 09:15:41 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Dave Taht Date: Wed, 22 Apr 2020 09:15:29 -0700 Message-ID: To: Kevin Darbyshire-Bryant Cc: Cake List Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Subject: Re: [Cake] DSCP ramblings X-BeenThere: cake@lists.bufferbloat.net X-Mailman-Version: 2.1.20 Precedence: list List-Id: Cake - FQ_codel the next generation List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Apr 2020 16:15:42 -0000 On Wed, Apr 22, 2020 at 8:58 AM Kevin Darbyshire-Bryant wrote: > > During these strange times of lockdown I=E2=80=99ve been trying to keep m= yself occupied/entertained/sane(???) by =E2=80=98fiddling with stuff=E2=80= =99 and improving my coding. This started with an idea of learning Python = which was great until the on-line bit of it ran out and someone posted an i= dea on the Openwrt forum about graphing Cake stats. > > That had nothing to do with Python and involved (new to me) technologies = such as =E2=80=98collectd=E2=80=99, =E2=80=98JSON=E2=80=99, a bit of javasc= ript and my usual level of cobbling something together in =E2=80=98ash=E2= =80=99=E2=80=A6. So that course was well spent :-) > > Anyway, data was collected and graphs produced in a very small household.= What=E2=80=99s immediately apparent from those graphs and cake in =E2=80= =98diffserv4=E2=80=99 mode is that very, very few applications are using DS= CP at all. Most things are to port 443. > > I was also a little surprised to see that my DNS over foo proxies such as= stubby & https-dns-proxy don=E2=80=99t use DSCP coding. It surprised me e= ven more to see RFC recommendations that DNS be treated as =E2=80=98Best Ef= fort=E2=80=99. Now in the days of udp only and no dnssec (with fallback to= tcp) this may be good enough, but I wonder if this is realistic these days= ? > > So putting aside the discussion of what codepoint should be used, I then = wondered how hard it would be to actually set a dscp in these applications.= And this is where I had another surprise. For example https-dns-proxy us= es libcurl. libcurl has no standard =E2=80=98in-library=E2=80=99 method fo= r setting a socket=E2=80=99s dscp. I cobbled a workaround in the applicati= on https://github.com/aarond10/https_dns_proxy/pull/83 - it works. > > Next I attacked stubby, which uses getdns. getdns doesn=E2=80=99t even h= ave a callback or parameters passing so you can set a dscp on the socket fr= om a client application, pure =E2=80=98hack the library=E2=80=99 stuff. > > To be blunt and on a small sample of 2 libraries/applications, it seems t= hat DSCP is completely ignored. Applications signalling =E2=80=99this is/i= snt latency sensitive/bulk=E2=80=99 isn=E2=80=99t going to happen if it isn= =E2=80=99t easy to do. > > Apple should be marking facetime calls as being =E2=80=98video conference= =E2=80=99 or whatever. BBC iplayer Radio apps should be marking =E2=80=98a= udio streaming=E2=80=99. But every f*ing thing is CS0 port 443. And I=E2= =80=99m wondering how much of this is because library support is simply mis= sing. Maybe gaming apps are better? (I don=E2=80=99t game) > > Right, I=E2=80=99m off for a lie down. Sorry for the rant. Welcome to my explorations... in 2011. Diffserv is rather underused, isn't = it? I took a survey of every (500+) gaming console at a convention. nearly zero diffserv usage and it was all over the map, and I think, mostly, from osx. windows requires admin privs to set the tos bits at all webrtc has an api to set the bits, but it doesn't work on windows. ssh will set the imm bit for interactive, I forget what it sets for bulk bgp sets cs6. so does babel. Arguably both usages are wrong. some windows stuff sets cs1 for things like ping I got the mosh folk to use AF42 as a (worldwide) test, for nearly a year. they had one user with a problem and they turned it off. It was funny, keith thought I was making an expert recommendation rather than a test and just copy pasted my code into the tree and shipped it. linux implements a strict priority queue in pfifo_fast. You can dos it if you hit it by setting the bits. irtt and netperf let you set the bits. iperf also. I produced a patch for rsync in particular (since I use it heavily) sqm at least used to mark dns and ntp as some elivated prio, but I forget which and for all I know the cake qos system doesn't implement those filters. A few multi-queue ethernet devices actually do interpret the bits. Undocumented as to which one.. and lets not get started on ecn. > > > Hack for getdns/stubby > > diff --git a/src/stub.c b/src/stub.c > index 2547d10f..7e47aba5 100644 > --- a/src/stub.c > +++ b/src/stub.c > @@ -52,6 +52,7 @@ > #include "platform.h" > #include "general.h" > #include "pubkey-pinning.h" > +#include > > /* WSA TODO: > * STUB_TCP_RETRY added to deal with edge triggered event loops (versus > @@ -381,6 +382,9 @@ tcp_connect(getdns_upstream *upstream, getdns_transpo= rt_list_t transport) > # else > static const int enable =3D 1; > # endif > +#endif > +#if defined(IP_TOS) > + int dscp =3D IPTOS_CLASS_CS4; > #endif > int fd =3D -1; > > @@ -390,6 +394,12 @@ tcp_connect(getdns_upstream *upstream, getdns_transp= ort_list_t transport) > __FUNC__, (void*)upstream); > if ((fd =3D socket(upstream->addr.ss_family, SOCK_STREAM, IPPROTO= _TCP)) =3D=3D -1) > return -1; > +#if defined(IP_TOS) > + if (upstream->addr.ss_family =3D=3D AF_INET6) > + (void)setsockopt(fd, IPPROTO_IPV6, IP_TOS, &dscp, sizeof(= dscp)); > + else if (upstream->addr.ss_family =3D=3D AF_INET) > + (void)setsockopt(fd, IPPROTO_IP, IP_TOS, &dscp, sizeof(ds= cp)); > +#endif > > > Cheers, > > Kevin D-B > > gpg: 012C ACB2 28C6 C53E 9775 9123 B3A2 389B 9DE2 334A > > _______________________________________________ > Cake mailing list > Cake@lists.bufferbloat.net > https://lists.bufferbloat.net/listinfo/cake --=20 Make Music, Not War Dave T=C3=A4ht CTO, TekLibre, LLC http://www.teklibre.com Tel: 1-831-435-0729