[aqm] A Diffserv primer

Jonathan Morton <chromatix99@gmail.com> Mon, 25 May 2015 05:39 UTC

Return-Path: <chromatix99@gmail.com>
X-Original-To: aqm@ietfa.amsl.com
Delivered-To: aqm@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id C09BA1A1B15 for <aqm@ietfa.amsl.com>; Sun, 24 May 2015 22:39:30 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.15
X-Spam-Level:
X-Spam-Status: No, score=-1.15 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, J_CHICKENPOX_21=0.6, SPF_PASS=-0.001] autolearn=no
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 3H0Nd5SqH_bU for <aqm@ietfa.amsl.com>; Sun, 24 May 2015 22:39:29 -0700 (PDT)
Received: from mail-lb0-x229.google.com (mail-lb0-x229.google.com [IPv6:2a00:1450:4010:c04::229]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id CFAB51A1ADC for <aqm@ietf.org>; Sun, 24 May 2015 22:39:28 -0700 (PDT)
Received: by lbcmx3 with SMTP id mx3so45272979lbc.1 for <aqm@ietf.org>; Sun, 24 May 2015 22:39:27 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=IrkeH8f0IR3LWplnJafgkqoA6fepqbmxFB9Gd7HDeks=; b=g3Wo2jZXxW2jBLwUZzz7UcNCxaH0Uh4gttQMj7nYP0YX3dNHo39sX+N+yOptCZeRJL p1tTxvZY6h1ktbwJpdhTjy281fIQ8bJTCfIZye+vjjLImBsfnYzPNllpwfbhvAIIE2Fk onqv1ZJbvT0I7kRH8bDQ1fkIgt9x/QOVaS624EiK6WRx0Ysele0W4RX26vKw185UgCTg uiuklvah9/NYG1eBOjGNlukv3iX0AWbbGLJIotZapD0LkLgalVlpSL5sVKXGoncYxSs8 yIL635vzH11iBHFRQcYtyMf/3kUrdLTMgRHC0p4PVJlEqO7vx+1INSeaLXepJMoeWUnZ 1m+A==
X-Received: by 10.112.140.9 with SMTP id rc9mr17006896lbb.14.1432532367215; Sun, 24 May 2015 22:39:27 -0700 (PDT)
Received: from bass.home.chromatix.fi (37-136-70-24.rev.dnainternet.fi. [37.136.70.24]) by mx.google.com with ESMTPSA id p7sm2157842lae.47.2015.05.24.22.39.21 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 24 May 2015 22:39:26 -0700 (PDT)
Content-Type: text/plain; charset="utf-8"
Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2098\))
From: Jonathan Morton <chromatix99@gmail.com>
In-Reply-To: <alpine.DEB.2.02.1505250631200.9487@uplift.swm.pp.se>
Date: Mon, 25 May 2015 08:39:16 +0300
Content-Transfer-Encoding: quoted-printable
Message-Id: <11C6B679-B05D-46B1-98C8-667DA2E1A748@gmail.com>
References: <20140514180039.16149.79444.idtracker@ietfa.amsl.com> <554D8240.7050809@superduper.net> <20150510015811.GB53172@verdi> <5552CDA8.3040305@superduper.net> <3F128D69-8283-4EEC-93E6-D9B980AE44C1@cisco.com> <555A0ACA.3010903@kit.edu> <5562121C.2050801@superduper.net> <alpine.DEB.2.02.1505242031260.9487@uplift.swm.pp.se> <55621B52.1030109@superduper.net> <alpine.DEB.2.02.1505250631200.9487@uplift.swm.pp.se>
To: Mikael Abrahamsson <swmike@swm.pp.se>
X-Mailer: Apple Mail (2.2098)
Archived-At: <http://mailarchive.ietf.org/arch/msg/aqm/Um4BZwWMYsOyNYdTQUioArHNUNE>
Cc: Simon Barber <simon@superduper.net>, "aqm@ietf.org" <aqm@ietf.org>
Subject: [aqm] A Diffserv primer
X-BeenThere: aqm@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: "Discussion list for active queue management and flow isolation." <aqm.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/aqm>, <mailto:aqm-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/aqm/>
List-Post: <mailto:aqm@ietf.org>
List-Help: <mailto:aqm-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/aqm>, <mailto:aqm-request@ietf.org?subject=subscribe>
X-List-Received-Date: Mon, 25 May 2015 05:39:30 -0000

> On 25 May, 2015, at 07:31, Mikael Abrahamsson <swmike@swm.pp.se> wrote:
> 
> I don't understand the difference between AF1 and CS1. Please elaborate.


> On Sun, 24 May 2015, Simon Barber wrote:
> 
> I can't find reference to DSCP 000010 or 000110, where are they defined?


It’s important to remember that the DSCP field and, to a lesser extent, the ECN bits (which both reside in the IP-header TOS byte) overlap with the legacy Precedence and Type-Of-Service fields, and are only partly backwards-compatible with them.  Probably a lot of network (and network hardware) engineers still think in terms of the legacy definitions, even though DSCP and ECN together have been around for almost 15 years now.

Precedence and TOS used to be orthogonal concepts.  Precedence meant “priority”, and TOS was meant to influence routing decisions; the example given was satellite (high delay, high bandwidth) versus leased-line (low delay, low bandwidth), which just goes to show how assumptions about technology go obsolete over time.

CS0, CS1, CS2 … CS7 are DSCPs which correspond to the legacy Precedence field set to the given value, and the TOS field (not to be confused with the TOS *byte*) set to zero.  The legacy interpretation of these is that CS7 is highest priority, and CS0 is lowest priority; each was given military-style names which are mostly forgotten (and better so).  It is an unfortunate but understandable historical artefact that the default setting was the lowest priority.

AF1x and CS1 both set the legacy Precedence field to 001, which is all that many hardware priority systems look at.  However, a DSCP is a homogeneous field with all six bits significant, and they differ in the fourth and fifth bits (001xx0).  According to my cheat-sheet compiled from RFC4594, AF1x corresponds to “high throughput data” with three different “drop priority” levels (in common with the other three Assured Forwarding groups: AF2x, AF3x, AF4x).

DSCP 000010 has the shorthand TOS2, because it corresponds to the legacy Precedence 000, TOS 010.  It was the legacy method of specifying “high throughput”.

TOS1 (000001) meant “maximum reliability”, which doesn’t really correspond to any modern DSCP, and TOS4 (000100) meant “minimum delay”, which best corresponds to EF (101110).

AFAIK, there is no standardised meaning for DSCP 000110.  It also has ambiguous meaning in the legacy scheme, and is unlikely to have been used by well-behaved applications.  I would consider it an available spare.

All DSCPs matching xxxx11 are reserved for local and experimental use.  They do escape their environments on occasion.

There was also a fourth TOS bit which was meant to specify “minimum cost”.  However, I understand it was specified rather late in the Precedence/TOS lifecycle, and in any case it overlaps with the ECN bits.  It sure would have been useful to still have that available - but having ECN is worth the trouble.

To me, it’s somewhat ambiguous whether “high throughput” should mean “low priority”.  It strikes me that many application developers would seize on it as meaning “faster”.  If they found that it actually made things slower (in a magical future where functional Diffserv support was ubiquitous), they might give up on Diffserv entirely as a bad job.

Nevertheless, when I worked out an eight-class Diffserv scheme as a modest simplification of the 12 classes described in RFC4594, I classed TOS2 / AF1x “high throughput” as lower than best-effort, but just above CS1 “background”.  This was on the basis that throughput had to be traded off against latency, and Cake’s priority scheme thus gave “higher” classes more priority but less throughput.  In the four-class scheme that’s now the default in Cake, however, I lumped the “high throughput” classes in with “best effort”, with only CS1 being distinct as “background".

Here’s my cheat-sheet, covering the 25 well-known DSCPs:

/*	List of traffic classes in RFC 4594:
		(roughly descending order of contended priority)
		(roughly ascending order of uncontended throughput)

	Network Control (CS6,CS7)      - routing traffic
	Telephony (EF,VA)         - aka. VoIP streams
	Signalling (CS5)               - VoIP setup
	Multimedia Conferencing (AF4x) - aka. video calls
	Realtime Interactive (CS4)     - eg. games
	Multimedia Streaming (AF3x)    - eg. YouTube, NetFlix, Twitch
	Broadcast Video (CS3)
	Low Latency Data (AF2x,TOS4)      - eg. database
	Ops, Admin, Management (CS2,TOS1) - eg. ssh
	Standard Service (CS0 & unrecognised codepoints)
	High Throughput Data (AF1x,TOS2)  - eg. web traffic
	Low Priority Data (CS1)           - eg. BitTorrent

	Total 12 traffic classes.
 */

It’s a mess, isn’t it?

 - Jonathan Morton