From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qt1-x836.google.com (mail-qt1-x836.google.com [IPv6:2607:f8b0:4864:20::836]) (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 DDFE73B29D for ; Fri, 3 Apr 2020 17:37:44 -0400 (EDT) Received: by mail-qt1-x836.google.com with SMTP id g7so7736893qtj.13 for ; Fri, 03 Apr 2020 14:37:44 -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=no8qZyQroyK0sNI3GpxCgbAGoBXGTYXqhDfW2fjbLEE=; b=PrvnOePTlt6ZYBytplrq8k7RlXmiVDSUBn+RrW8Ivf6T/ZaWkMPsZe6LXxIkSN69R5 BtjmtbyRl6XvBnB4hnkaMSKYkGUHBpTpJyXqvE5Jr7rulw6T/CjzmwHyjxk6Zk3LW4kU fFL7JzOo/eSTfNNOoOQ/XL0C2KCaHQEl/qr3pT93ASeAwgC8Q3fk2Iy1LYcXnoAcCvGv G4fGuTlWy3nYZGrpvTZ3s4kzHNm8AGcc4KEyErb9RgLra7PnWX1x8HQvvl2eyS88rWvd Kdb8fZYHnvKhdPFYAQIMazTzaVX6OQsC9bRnqI7JjKFsGxr2UTux9k5iLg+bPcZqYlwW w9sw== 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=no8qZyQroyK0sNI3GpxCgbAGoBXGTYXqhDfW2fjbLEE=; b=We0KsIZrwPOE98Jr/+B7dRY3W3wUEZTm8hzQ1PaqUugZs3RD2/BCCk7PyrbA2rVf88 ENotcqLuLI3JJNr/KFPiJIs0t/4mKJhQenkIY3ZTrPw1odv3O+L6g27+O6jzV5ccSNhb UX4OSBQux12TSc2KT2vyi9GKuc0mrxYtUfB9xSxOklDiNQB08bHLa3QSIxgsXzjbLVXa rSJWMZ7SzXZXM3xdjd8nHzbCTB/3ac5jJsoQQ+gqa4VVjrZNlhyOLgi93BPY9xQUbxM0 xHrapMuvk474IpxDjcw+PJJnQGXOmK2XEc7FzByPPUYxI+x0CsNb1nFPmjdkcttY66WP koOw== X-Gm-Message-State: AGi0PubPjw4Ck4BrW5LBTdSo4gGmpjU6dC4jvB1X65m9sJ9zuhtgaBaB q8YKy6n2puNmcCg8iSvMCJHlFSOBMpoLqjc1sjI= X-Google-Smtp-Source: APiQypK/jPvWv4dJc8DpAf4WzmTSkKNLXkNlCOMyiJ2UckqlbLcxXKb9meQUB6BdaLk7r0Vu1O9MEvvc7+EQ9AXiNZ8= X-Received: by 2002:ac8:191d:: with SMTP id t29mr10674051qtj.40.1585949864344; Fri, 03 Apr 2020 14:37:44 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: "Alexander E. Patrakov" Date: Sat, 4 Apr 2020 02:37:33 +0500 Message-ID: To: Sebastian Moeller Cc: =?UTF-8?Q?Dave_T=C3=A4ht?= , Cake List Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Mailman-Approved-At: Fri, 03 Apr 2020 19:25:01 -0400 Subject: Re: [Cake] tc-cake(8) needs to explain a common mistake 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: Fri, 03 Apr 2020 21:37:44 -0000 On Sat, Apr 4, 2020 at 1:44 AM Sebastian Moeller wrote: > >> > >> Example 1: the ADSL modem connects at 18 Mbit/s, but the ISP further > >> throttles the speed to 15 Mbit/s because that's what the user pays > >> for, and does so with a shaper that has bufferbloat. Then, the "adsl" > >> keyword is likely not appropriate, because the ISP's shaper operates > >> on the IP level. The bandwidth needs to be set slightly below 15 > >> Mbit/s. > > Let's run the number shall we? I simply make a few assumptions he= re to get things started, but the exact numbers really do not matter too mu= ch. With that said, let's assume TCP/IPv4 and ATM/AAL5, PPPoE, LLC/SNAP, RF= C-2684; > Overhead (bytes): PPP (2), PPPoE (6), Ethernet Header (14), Ethernet PAD = [8] (0), ATM LLC (3), ATM SNAP (5), ATM pad (2), ATM AAL5 SAR (8) : Total 4= 0 > > Let's see what the link will be able to deliver for "full" MTU 1500 packe= ts (quotes as the MTU1500 will only carry to the PPPoE endpoint, internet M= TU is going to be 1492) > gross-rate * ((payload size) / (on the wire size)) =3D net speedtest resu= lt (let's use this as proxy as this is what people can easily verify/check) > > MTU1500: 18.000 * ((1500-20-20-8) / (ceil((1500-8+40)/48)*53)) =3D 15.410 > MTU150: 18.000 * ((150-20-20-8) / (ceil((150-8+40)/48)*53)) =3D 8.6603773= 5849 > MTU75: 18.000 * ((75-20-20-8) / (ceil((75-8+40)/48)*53)) =3D 3.0566037735= 8 > > > Now the IP-level shaper at ~80% of the link-speed, if it does not account= for the ATM/AAL5 "celling" even if it gets the overhead correctly will giv= e the following: > > MTU1500: 15.000 * ((1500-20-20-8) / (ceil((1500-8+40)/1)*1)) =3D 14.21671= 01828 > MTU150: 15.000 * ((150-20-20-8) / (ceil((150-8+40)/1)*1)) =3D 8.406593406= 59 > MTU75: 15.000 * ((75-20-20-8) / (ceil((75-8+40)/1)*1)) =3D 3.78504672897 > > So for large enough packets static accounting for ATM/AAL5 works reasonab= ly well, but for small packets it fails. > That is why most ISP-grade equipment allows not only to configure the per= -packet-overhead for end-user links but also can deal with ATM/AAL5. And as= far as I understand most competent ISPs actually configure their traffic-s= hapers for ADSL links to do this, because DSLAMs are really more like L2-sw= itches with fancy media-converters attached and deal not terribly well with= overload and queueing into the switch fabric. > > That in turn leads to the following situation: > MTU1500: 15.000 * ((1500-20-20-8) / (ceil((1500-8+40)/48)*53)) =3D 12.842 > MTU150: 15.000 * ((150-20-20-8) / (ceil((150-8+40)/48)*53)) =3D 7.217 > MTU75: 15.000 * ((75-20-20-8) / (ceil((75-8+40)/48)*53)) =3D 2.547 > > which will obviously not cause packet buffering in the DSLAM for any pack= et size mix the link might encounter. AND that in turn means that the actua= l bottleneck link (the ISP's traffic shaper) still behaves like it would em= ploy ATM/AAL5 encapsulation, and hence the end-user's SQM instance should d= o as well. OK, bad (marginal) example, let's adjust it so that the user pays for 10 Mbit/s. Or replace with a 100BASE-TX link shaped (badly) to 50 Mbit/s by the ISP. The point is that sometimes the ISP shaper is what matters, and ISPs like to sell bandwidth in packages with round numbers. And, is the accounting for ATM/AAL5 the default on equipment that ISPs use for ADSL? P.S. The example actually comes from my experience with the "Globe" ISP in the Philippines during my trip there - I had to specifically ask to increase the speed limit, it was initially 10 Mbit/s and then upgraded to 15 Mbit/s. The modem always connected at 18 - 19 Mbit/s, and there was a 21 Mbit/s value once (when I connected the modem to the powerbank during power outage). And I am not sure that we are always talking about competent ISPs. > P.S.: I am of the opinion, that https://openwrt.org/docs/guide-user/netwo= rk/traffic-shaping/sqm-details had very sane and un-cargo-culty advice abou= t the overhead topic: > "Getting [overhead and link layer accounting] exactly right is less impor= tant than getting it close, and over-estimating by a few bytes is generally= better at keeping bufferbloat down than underestimating. With this in mind= , to get started, set the Link Layer Adaptation options based on your conne= ction to the Internet. " > > I am less sure about the paragraph you added recently, as it does not see= m to consider all the applicable subtleties. Should I undo it? --=20 Alexander E. Patrakov CV: http://pc.cd/PLz7