Re: [aqm] [tsvwg] Immediate ECN: Autotuning AQM for RTT

"Fred Baker (fred)" <fred@cisco.com> Wed, 13 November 2013 18:49 UTC

Return-Path: <fred@cisco.com>
X-Original-To: aqm@ietfa.amsl.com
Delivered-To: aqm@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 633C011E8120; Wed, 13 Nov 2013 10:49:05 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -110.033
X-Spam-Level:
X-Spam-Status: No, score=-110.033 tagged_above=-999 required=5 tests=[AWL=-0.261, BAYES_00=-2.599, J_CHICKENPOX_16=0.6, RCVD_IN_DNSWL_HI=-8, SARE_SUB_OBFU_Q1=0.227, USER_IN_WHITELIST=-100]
Received: from mail.ietf.org ([12.22.58.30]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id YesKSumrdCJu; Wed, 13 Nov 2013 10:48:59 -0800 (PST)
Received: from rcdn-iport-1.cisco.com (rcdn-iport-1.cisco.com [173.37.86.72]) by ietfa.amsl.com (Postfix) with ESMTP id 36F8221F9D7C; Wed, 13 Nov 2013 10:48:59 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=4521; q=dns/txt; s=iport; t=1384368539; x=1385578139; h=from:to:cc:subject:date:message-id:references: in-reply-to:mime-version; bh=FU2+omyjlRJJaO4P0SSQ56FmlEMzHm8t5qjGEDM+PVQ=; b=JgyKBja1fL/ftJWu0FJSM06olEX2gAYtnkg+wxMtql4Dk1kqRzjcNHL6 ILAd2ZogKa8Iy6/73kxrFmvTh1LxWNokHHmEow+osR310uUh/PNp6t+An POBfVIUioaPmBXpPnQUhGOq0AiHtHF490lteGM0mqVmckNrMKTtq9usNm 0=;
X-Files: signature.asc : 195
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: AgsFAD7Ig1KtJV2b/2dsb2JhbABbgwc4U78rgScWdIIlAQEBAwF5BQsCAQhGMiUCBA4FDguHYgYNwBePXweDIIERA5AwgTCGMJILgyiCKg
X-IronPort-AV: E=Sophos; i="4.93,693,1378857600"; d="asc'?scan'208"; a="284191058"
Received: from rcdn-core-4.cisco.com ([173.37.93.155]) by rcdn-iport-1.cisco.com with ESMTP; 13 Nov 2013 18:48:57 +0000
Received: from xhc-aln-x07.cisco.com (xhc-aln-x07.cisco.com [173.36.12.81]) by rcdn-core-4.cisco.com (8.14.5/8.14.5) with ESMTP id rADImuWx002728 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=FAIL); Wed, 13 Nov 2013 18:48:56 GMT
Received: from xmb-rcd-x09.cisco.com ([169.254.9.122]) by xhc-aln-x07.cisco.com ([173.36.12.81]) with mapi id 14.03.0123.003; Wed, 13 Nov 2013 12:48:56 -0600
From: "Fred Baker (fred)" <fred@cisco.com>
To: "Scheffenegger, Richard" <rs@netapp.com>
Thread-Topic: [tsvwg] Immediate ECN: Autotuning AQM for RTT
Thread-Index: AQHO4KEBV7BAWUD5Q0OJOx469YFWCQ==
Date: Wed, 13 Nov 2013 18:48:56 +0000
Message-ID: <E7D77F29-36BD-45FD-AE22-D90F2A687964@cisco.com>
References: <201311111618.rABGILbC031136@bagheera.jungle.bt.co.uk> <CEA65B19.21ED5%g.white@cablelabs.com> <012C3117EDDB3C4781FD802A8C27DD4F25E8908F@SACEXCMBX02-PRD.hq.netapp.com>
In-Reply-To: <012C3117EDDB3C4781FD802A8C27DD4F25E8908F@SACEXCMBX02-PRD.hq.netapp.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: yes
X-MS-TNEF-Correlator:
x-originating-ip: [10.19.64.121]
Content-Type: multipart/signed; boundary="Apple-Mail=_3DBFD422-2C1D-4CE8-A19B-BE57478A0706"; protocol="application/pgp-signature"; micalg="pgp-sha1"
MIME-Version: 1.0
Cc: Greg White <g.white@CableLabs.com>, tsvwg IETF list <tsvwg@ietf.org>, tsv-area IETF list <tsv-area@ietf.org>, Bob Briscoe <bob.briscoe@bt.com>, AQM IETF list <aqm@ietf.org>
Subject: Re: [aqm] [tsvwg] Immediate ECN: Autotuning AQM for RTT
X-BeenThere: aqm@ietf.org
X-Mailman-Version: 2.1.12
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: Wed, 13 Nov 2013 18:49:05 -0000

On Nov 12, 2013, at 5:18 AM, "Scheffenegger, Richard" <rs@netapp.com> wrote:

> So, as I am not a HW guy, how many gates does one need for (W)RED, PIE, CoDel?

I'm not a hardware guy either, but I think a predictor would be the registers and calculations implied in the data path (a supporting software/firmware process can use RISC approaches to implement non-data-path components). The calculations of importance are multiplies, divides, and square roots, each of which can take an interesting amount of silicon if literally implemented in hardware. 

For the hardware engineer, there are a number of analogs that can be used to simplify life. For example, where an algorithm calls for some number of milliseconds, s/he can divide down the clock rate of the chip and consider that to be a stated number of clock ticks rather than implementing a millisecond clock. Where an algorithm calls for a random number, there are ways the engineer can use noise to create it (http://en.wikipedia.org/wiki/Hardware_random_number_generator).

With RED, there are two basic calculations: maintaining the mean queue depth, which might mean an exponentially-weighted moving average with samples taken on events or at times, and determining the mark/drop probability as max(0, (mean_queue_depth-min_threshold)/(max_threshold-min_threshold)). An EWMA can be implemented using adds and shifts, so it's not a big deal. I'm not the guy that has done our chips, so I'm speaking out of turn, but I would expect that the divide in the mark/drop probability can be simplified to not require an actual division circuit. We need a random number; that comes down to a register.

With PIE, the data path calculation is "once per interval, pick up a random number, compare it to a threshold, and possibly mark/drop a packet". That comes down to a register for the random number generator. The math in the background process is "interesting", but - it's in the background process. Use RISC approaches.

With CoDel, the key issue is the sqrt. As the algorithm is described, it happens in the data path - upon interval expiration, a packet is dropped, and a new interval is calculated in inverse proportion to the square root of the number of drops since the dropping state was entered. I'll argue that the actual value could be calculated in the background and placed into a register to be copied to the interval register the next time a packet is actually dropped. The square root calculation itself can be pretty simple. Most chips these days have an instruction to tell you the bit number of the most significant "one" in a register, and have barrel shifters. OK, pick up the number, determine its most significant bit number, shift that right one bit (divide by two), shift the argument of the sqrt right the resulting number of bits, and then do one or two Newton-Raphston iterations. So a reasonable approximation to the sqrt can be implemented using RISC approaches.

My take is that one can use silicon real estate if there is another reason to have the circuits, but the algorithms on the table can be implemented in microcode given the ability to run a supporting background process on a RISC computer.



Appendix on EWMAs using adds and shifts:

An EWMA calculates
    new_mean = W*sample + (1-W)*old_mean, 0 <= W <= 1
in successive steps, calculating the mean of a set of samples.

Let's constrain W to 2^(-N) for some value of N.

Now, store the mean shifted left N bits.

The calculation becomes 
    mean := sample + mean - (mean shifted right N bits).

Any time you need to use the mean, either you shift it right N bits, or you shift the rest of the calculation left N bits.