Re: [aqm] Questioning each PIE heuristic - moving averages and rate measurement

Bob Briscoe <ietf@bobbriscoe.net> Fri, 26 May 2017 17:26 UTC

Return-Path: <ietf@bobbriscoe.net>
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 723D1129459; Fri, 26 May 2017 10:26:05 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: 0.7
X-Spam-Level:
X-Spam-Status: No, score=0.7 tagged_above=-999 required=5 tests=[BAYES_50=0.8, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=bobbriscoe.net
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 5hg1kJRXCQzc; Fri, 26 May 2017 10:26:02 -0700 (PDT)
Received: from server.dnsblock1.com (server.dnsblock1.com [85.13.236.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 19C3F129329; Fri, 26 May 2017 10:26:02 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=bobbriscoe.net; s=default; h=Content-Transfer-Encoding:Content-Type: In-Reply-To:MIME-Version:Date:Message-ID:From:References:Cc:To:Subject:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=ZufaqL8ZdoT9KPu9divz2I/6rT7leMQEWBXqbxnnG/o=; b=B7C7NUnUVOqrDAcBNZDjbgS5kE LGDCZED4nwUX4uHn8EVg00o2Dnl7s3TbQWQdKfveEQtt1OVgaO52nv7Gh4isYXrGwKHUhaRn6WZow JIIe5jEuxQl1gnlgEwE6/wO+f9DGILTbjT1Y7C4qQn6T7/6iEn7xe4zP4FORChDu7dU6TX+W6UOkl hI39b6JWD2gqNkfAYyyqkCSp+twEEiZX172vN4CbzjKXmzo8FBa3eDGJ4oCO+99NN0mJMDPh1vBZN yHYBHimgMgVA9HRoCqhkvf/jC2hDIOzz+/2h6LkIBevfT+U56KC9Olw1gUF3hHex2E7a6EqtLOGwb FiQb6b2w==;
Received: from 197.74.9.51.dyn.plus.net ([51.9.74.197]:37116 helo=[192.168.0.2]) by server.dnsblock1.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.89) (envelope-from <ietf@bobbriscoe.net>) id 1dEIzv-0003Pt-Vg; Fri, 26 May 2017 18:26:00 +0100
To: Michael Menth <menth@uni-tuebingen.de>
Cc: "Rong Pan (ropan)" <ropan@cisco.com>, tsvwg IETF list <tsvwg@ietf.org>, AQM IETF list <aqm@ietf.org>
References: <9ddba389-e368-9050-3b14-aa235c99fcb8@bobbriscoe.net> <D4FDD717.2636D%ropan@cisco.com> <77D4FC66-C99F-49D0-BB73-27A0CEF70F31@gmail.com> <99a7b737-fc3c-efd0-b6c8-d71a089b7de8@bobbriscoe.net> <FB0F3D38-63E2-441E-BAB4-2541D7E9FE94@gmail.com> <471e91b1-c469-3d36-9af1-0411e5661286@uni-tuebingen.de> <abadc87c-49f2-46e2-ae43-0853ac81e794@bobbriscoe.net> <da895a48-6b9c-c67f-1f52-d9eb52844ad6@uni-tuebingen.de>
From: Bob Briscoe <ietf@bobbriscoe.net>
Message-ID: <404874be-32a9-4425-b2ff-5fbff804b5ee@bobbriscoe.net>
Date: Fri, 26 May 2017 18:25:59 +0100
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1
MIME-Version: 1.0
In-Reply-To: <da895a48-6b9c-c67f-1f52-d9eb52844ad6@uni-tuebingen.de>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Content-Language: en-GB
X-AntiAbuse: This header was added to track abuse, please include it with any abuse report
X-AntiAbuse: Primary Hostname - server.dnsblock1.com
X-AntiAbuse: Original Domain - ietf.org
X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12]
X-AntiAbuse: Sender Address Domain - bobbriscoe.net
X-Get-Message-Sender-Via: server.dnsblock1.com: authenticated_id: in@bobbriscoe.net
X-Authenticated-Sender: server.dnsblock1.com: in@bobbriscoe.net
Archived-At: <https://mailarchive.ietf.org/arch/msg/aqm/BS9kYD4kVwpEHfWdseWR9oTrn5I>
Subject: Re: [aqm] Questioning each PIE heuristic - moving averages and rate measurement
X-BeenThere: aqm@ietf.org
X-Mailman-Version: 2.1.22
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: <https://mailarchive.ietf.org/arch/browse/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: Fri, 26 May 2017 17:26:05 -0000

Michael,

Yes, I should have said that the most useful aspect of your paper is the 
model that ties all the different algos together allowing comparison.


Bob

On 25/05/17 08:55, Michael Menth wrote:
> Hi Bob, hi Rong,
>
> Am 25.05.2017 um 00:34 schrieb Bob Briscoe:
>> Michael,
>>
>> I just started reading your paper. Two comments so far:
>>
>> *1) PIE rate averaging is an unfortunate example**
>> *In related work, you mention PIE's measurement of the link rate as an
>> example of use of moving averages. This is an unfortunate example,
>> because the PIE code screws up the calculation. It averages a fraction
>> by averaging the denominator, which I pointed out is wrong in Section
>> 5.3.2 of my PIE review <http://bobbriscoe.net/pubs.html#piervw_tr>.
>> Quoting...
>>
>> "The [PIE] pseudocode continually measures the sequence of dequeue
>> times, t1, t2, t3,... that it takes to transmit constant amounts of
>> bytes (DQ_THRESHOLD). Then the exponentially weighted moving average
>> (EWMA) of the rate should be:
>>
>>      ewma(depart_rate) = DQ_THRESHOLD ∗ ewma(1/t1,1/t2,1/t3,...)
>>                       != DQ_THRESHOLD / ewma(t1,t2,t3,...)
>> "
>> PIE uses the second (incorrect) formula. In the review, I discuss how
>> wrong this could be, with an example.
> Thanks, Bob, for pointing this out to me.
>
> Rong, is PIE doing this by intent (if so, what's the reason?) or is this
> a flaw?
>
>> *2) Exponential Moving Average is an Approximation**
>> *In your moving averages paper, you compare your unbiased exponential
>> moving average (UEMA) algorithm with this commonly used exponential
>> moving average (EMA) algorithm:
>>      ewma(X) <- (1-a)*X + a*ewma(X)
>>
>> A few years ago I wondered about this comparison, and wrote a 2-page
>> memo for myself to record the proof. I've temporarily uploaded it here:
>> Moving Averages <http://bobbriscoe.net/tmp/ewma.pdf>.
>>
>> I used a Taylor series expansion to show that the iterative formula
>> tends to the exact formula (what you call the unbiased EMA or UEMA) as
>> the number of readings (n) becomes large.
>>
>> When n is not large, you could use the formula at the top of my p2 (just
>> before the Taylor series approximation) to calculate the ratio between
>> the actual (unbiased) UEMA and my regular iterative EMA (REMA). This
>> ratio can be pre-calculated, because its independent of the readings:
>>      REMA/UEMA = (1-a)*(Sum_{j=0}^{n-1} a^j)
>>
>> where
>>    "theta" in my formula is "a" in yours
>>    "Sum_{j=0}^{n-1}" means "the sum from j=0 to j=n-1"
>>    Your iterative formula (EMA) starts with an exception, whereas I use
>> an iterative formula that just starts the same as it carries on. To
>> distinguish between them, I have called mine "regular EMA" or REMA.
>>
>> For instance, if a = 0.75 as in your Fig 1(c), then the correction
>> factors for various small numbers of readings, n, are:
>>
>> n       UEMA/REMA
>> _____________________
>> 1            2.29
>> 2            1.73
>> 3            1.46
>> 4            1.31
>> 5            1.22
>> 6            1.15
>> 7            1.11
>> 8            1.08
>> 9            1.06
>> 10            1.04
>> 11            1.03
>> 12            1.02
>> 13            1.02
>> 14            1.01
>> 15            1.01
>> 16            1.01
>> 17            1.01
>> 18            1.00
>> 19            1.00
>> 20            1.00
> Yes, the bias of E(W)MA is caused by the first sample and vanishes over
> time. If EMA runs continuously, it has no impact. If EMA is continuously
> restarted, it may have an impact. However, this is only a minor aspect
> of the paper.
> https://atlas.informatik.uni-tuebingen.de/~menth/papers/Menth17c.pdf
>
> The major contribution of the paper is a framework that brings together
> various types of moving averages, moving histograms and rate measurement
> methods. In particular, it relates E(W)MA's "magic weight parameter" to
> a memory which is also implemented by other methods (with other
> parameters). The concept of a memory simplifies many engineering problems.
>
> Regards,
>
> Michael
>
>>
>> Cheers
>>
>>
>> Bob
>>
>> On 30/03/17 10:57, Michael Menth wrote:
>>> Hi all,
>>>
>>> Am 30.03.2017 um 11:08 schrieb Jonathan Morton:
>>>>> On 30 Mar, 2017, at 10:46, Bob Briscoe <ietf@bobbriscoe.net> wrote:
>>>>>
>>>>> For PI2 we removed all but 2 and it worked the same or better than PIE in all our tests. I have been assessing each of the other 7 one by one for reinstatement. So far I've rejected 6. I think I can reject this last one by making the sampling time of the base PI algo dependent on the max link rate. Then when the queue goes idle, the base PI algo will decay drop down to zero no slower than the queue drains, without needing this extra heuristic.
>>>> That’s fair enough.
>>>>
>>>> It sounds like the fairly coarsely discrete time intervals in PIE are the main justification for this particular heuristic, so it might be sufficient to document that WRT PIE itself.  Using finer time intervals is clearly a better choice for the future.
>>> PIE uses time intervals for measurement purposes and several parameters
>>> contribute. We've recently done some basic work on measurement
>>> methodology that facilitates a comparison of different measurement
>>> approaches and better-informed parametrization by introduction of the
>>> "memory" concept.
>>> https://atlas.informatik.uni-tuebingen.de/~menth/papers/Menth17c.pdf
>>> PIE essentially implements TDRM-DTWMA-UEMA illustrated in Fig. 6d.
>>>
>>> The concept of "memory" can also be applied to moving averages which are
>>> also used in PIE for several purposes. Configuration via a "memory" can
>>> make some heuristics more intuitive.
>>>
>>> Best wishes,
>>>
>>> Michael
>>>
>>>
>>>
>>>>   - Jonathan Morton
>>>>
>> -- 
>> ________________________________________________________________
>> Bob Briscoe                               http://bobbriscoe.net/
>>

-- 
________________________________________________________________
Bob Briscoe                               http://bobbriscoe.net/