linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stefano Brivio <stefano.brivio@polimi.it>
To: Luis Carlos Cobo <luisca@cozybit.com>
Cc: linux-wireless@vger.kernel.org,
	Johannes Berg <johannes@sipsolutions.net>,
	Mattias Nissler <mattias.nissler@gmx.de>
Subject: Re: [PATCH 08/13 v2] o11s: other changes in mac80211 for mesh interface support
Date: Tue, 26 Feb 2008 21:36:42 +0100	[thread overview]
Message-ID: <20080226213642.6af22561@morte> (raw)
In-Reply-To: <1203974113.6929.93.camel@localhost>

On Mon, 25 Feb 2008 13:15:13 -0800
Luis Carlos Cobo <luisca@cozybit.com> wrote:

> > >  		pf <<= RC_PID_ARITH_SHIFT;
> > > +		sta->fail_avg = ((pf + (spinfo->last_pf << 3)) / 9)
> > > +					>> RC_PID_ARITH_SHIFT;
> > >  	}
> > 
> > What do you need fail_avg for? Please note that we have better estimates of
> > the frame failure trends (e.g., err_avg). What these magic values are?
> 
> It's supposed to be an estimation of the probability of a frame
> transmission failure. The magic numbers just express the formula
> 
> fail_avg = (8 * old_fail_avg + 1 * fail_avg) / 9
> 
> a simple smoothing, there is nothing special to the exact numbers.
> 
> If you think err_avg is a good candidate (is it also 0-100?) I'd be
> happy to use that instead.

In short: no, it's not 0-100. And probably it's not what you expect it to
be. But you may consider to use it.

Boring explanation: in the algorithm, we define the error(T), which is a
function of time T (jiffies in the code), as the difference between the
failed frames rate f (pf) and a given value we use to call "target", t
(target_pf), at some time T.

Currently, t can be set through debugfs only, but it's meant to be tunable
by iw (the mac80211-ish replacement for wireless-tools) in a near future.
Other parameters will be tunable, such as s (>> smoothing_shift), which
stands for "smoothing".

Hence, err_avg is an exponential moving average of error(T), such that:
	err_avg = error(T - 1) / s + ... + error(T - n) / (s * n).

Now, I'm not sure about what you need for mesh networks, but from this
algorithm you can quickly and cheaply get a proportional, integral or
derivative error ("error" as in difference between the failed frame rate and
the allowance for packet loss) or even get them all. The first one is just
linearly based upon the current behaviour, the second is about weighed
behaviour in the past, and the third emphasizes the current trend. We
actually use them all to adjust rates we use in "regular" 802.11 networks,
so I think they may suit your needs as well. If they don't, I'm fine with
this fail_avg thing you introduced.


--
Ciao
Stefano

  reply	other threads:[~2008-02-26 20:48 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-22  4:17 [PATCH 08/13 v2] o11s: other changes in mac80211 for mesh interface support Luis Carlos Cobo
2008-02-22 16:16 ` Johannes Berg
2008-02-25 19:32   ` Luis Carlos Cobo
2008-02-25 19:32     ` Johannes Berg
2008-02-23  6:41 ` Stefano Brivio
2008-02-25 21:15   ` Luis Carlos Cobo
2008-02-26 20:36     ` Stefano Brivio [this message]
2008-02-29 20:56   ` Luis Carlos Cobo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080226213642.6af22561@morte \
    --to=stefano.brivio@polimi.it \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    --cc=luisca@cozybit.com \
    --cc=mattias.nissler@gmx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).