Re: [PATCH] batman-adv: Use wifi rx/tx as fallback throughput

Кирилл Луконин
2019-06-12T20:50:44Z

ср, 12 июн. 2019 г. в 11:39, Marek Lindner <mareklindner@neomailbox.ch>:
>
> Hi,
>
> > I have a working solution for this problem. It is not batman-related,
> > but I decided to share it with you right here.
> > Please let me clarify some details.
> >
> > 1) Some ath10k firmwares (10.2) do not export tx bitrate. So we can't
> > rely on it.
> > 2) Throughput estimation is better to inject from userspace, rather
> > than make batman estimate it from unreliable sources.
> > 3) Here is the patch for mac80211 We made for ath10k and such drivers
> > that do not export expected throughput value.
>
> you are very right about those issues. However, your patch only provides a
> quick way to push an arbitrary throughput metric into the batman-adv kernel
> module. The current discussion is about how such metric could be best derived
> in an automated fashion.
>
> Would you mind sharing your approach to obtaining such a metric that addresses
> the problems mentioned above ?
>
> Thanks,
> Marek
>

Yes, sure.

I can't share a source code because it partially belongs to one
commercial company.
But I want and I can share my ideas with empirical evidence.
Also I will be very glad to help Batman-avd mesh community and become
a part of it.

So here is the algorithm. It has a structure we call matryoshka.
ET - Expected_throughput.

1) ET = TX_bitrate * Transmit_probability * Overhead_coefficient
Transmit_probability is always less than 1 so Expected throughput
can't be equal to the TX_bitrate. Overhead_coefficient is also should
be less than 1

2) Transmit_probability = 1 - Retry_probability - Error_probability

3) Retry_probability = TX_retries / TX_packets

4) Error_probability = TX_errors / TX_packets

5) Overhead_coefficient for 802.11 is fair enough to be 0.65, but can
be changed after additional testing.

ET = TX_bitrate * (1 - (TX_retries + TX_errors) / TX_packets) * 0.65
Such technique has very large hysteresis which is good to avoid
flapping between different nodes.
In my MESH lab this formula works quite well.
Please ask any questions and feel free to criticize.

Also please note that ath10k tx_bitrate can be fetched from ath10k
firmware debugfs statistics. Even with 10.2 firmware.

Best Regards,
Lukonin Kirill