-
Notifications
You must be signed in to change notification settings - Fork 324
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gluon-core: make wifi rates configurable #810
Conversation
Just like the other pull requests, the idea looks very interesting and tempting :-). I'd be very excited to see some statistics showing how much things get improved by this (for instance reduced airtime or increased overall throughput on a couple of real-world example nodes, vs. number of clients connected to a node). Also, what kind of devices (including operating system + wifi driver) have you tested this with? Just to make sure it does not introduce any compatibility issues. |
👍 for having at least the possibility to turn 802.11b off, we discussed that today at the Freifunk Karlsruhe meeting and decided to investigate how this could be achieved. ✨ For reference, some numbers can be found in this article, Cisco recommends turning of 802.11b since 2014:
|
@@ -103,3 +103,26 @@ function need_string_array(varname, required) | |||
return assert(pcall(need_array, varname, function(e) assert_type(e, 'string') end, required), | |||
"site.conf error: expected `" .. varname .. "' to be a string array") | |||
end | |||
|
|||
function need_var_in_array(varname, array, required) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Most of this function could be replaced by a call to need_array
, similar to the way need_string_array
is defined. I think it would make sense to split this function into two - one that just checks if a value is one of list of possible values (maybe need_one_of
), and one that works like need_string_array
and calls need_array
with need_one_of
(could be called need_array_of
).
The rate given are are missing 802.11n rates and thus I understand that this limited speed to ancient 54Mbit. (I admit that this may cover most of the freifunk use cases). Anyway I think if something like that is included, this should also include the 802.11n rates / MCS indices. OpenWrt "bitrate" knows mixed notation for this
However I am not qualified to assess whether this works for basic_rate / supported_rates as well. The documentation does not say so. |
@kgbvax, I was confused by this at first, too, but it was explained to me that basic_rate / supported_rates doesn't affect 11n rates (which are so-called "extended rates"). |
How does the availability of |
|
||
function need_array_of(varname, array, required) | ||
return assert(pcall(need_array, varname, need_one_of(e, array),required), | ||
"site.conf error: expacted `" .. varname .. "' to be a subset of given array") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo, should be "expected" instead of "expacted"
function need_string_array(varname, required) | ||
return assert(pcall(need_array, varname, function(e) assert_type(e, 'string') end, required), | ||
"site.conf error: expected `" .. varname .. "' to be a string array") | ||
end | ||
|
||
function need_array_of(varname, array, required) | ||
return assert(pcall(need_array, varname, need_one_of(e, array),required), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This call is wrong - you need to wrap the need_one_of
into an anonymous function like it is done in need_string_array
846c516
to
b5c14aa
Compare
just adding a note, so @neoraider knows something was done here and his label "changes requested" is obsolete |
Thanks, already noticed, I'm a bit busy this week though... |
just a sidenode, [i'd love to see this default in gluon] |
|
@viisauksena first of all the "usage of channel airtime" stats of horst cannot be trusted: Secondly if you used the following:
... it won't work because it's just wrong. There are still some B-Rates and there are some non-existing ones. I guess it will just ignored by the driver. |
@viisauksena in the End, your conclusion is wrong, becons are sent with 6 mbits after this patch: @NeoRaider
Beacons are sent with the lowest supported rate, since this are all the hotspot supports ... ;) |
@NeoRaider based on my observation youre right for beacon rate in ibss0 - this seems based on mcast rate, but against @RubenKelevra mentioning i observe 1 Mbit beacons for client0 AP half the time ... see esp. here i should also have mentioned that i use ure supported list rates and not my blind guessings in the beginning.
|
mcast_rate 24000 is insane. 12000 like used in luebeck is somewhat high, I guess. I would recommend 6 mbit for this. Else, your setup is broken, since this works as I've said: Which gluon-commit did you compile? |
@RubenKelevra this is somehow offtopic , and should be discussed somewhere else - i guess, edit wrote an email and go on to discuss it in Freifunk Forum |
could you please take this discussion elsewhere? |
@@ -133,8 +133,9 @@ function need_one_of(varname, array, required) | |||
end | |||
|
|||
function need_string_array(varname, required) | |||
return assert(pcall(need_array, varname, function(e) assert_type(e, 'string') end, required), | |||
"site.conf error: expected `" .. varname .. "' to be a string array") | |||
assert(pcall(need_array, varname, function(e) assert_type(e, 'string') end, required), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, the pcall
should return two values, a true/false value and the original return value of need_array
, we're just discarding the second one by passing it to assert. I think we could do without the extra loadvar
like this (untested):
local ok, var = pcall(need_array, varname, function(e) assert_type(e, 'string') end, required)
assert(ok, "site.conf error: expected `" .. varname .. "' to be a string array")
return var
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that works
…b.lua need_one_of(varname, array, required) checks weather the value of the specified variable is part of given array. need_array_of(varname, array, required) is similar to need_one_of() but assume that varname points to an array.
-- Example removes 802.11b compatibility for better performance | ||
supported_rates = {6000, 9000, 12000, 18000, 24000, 36000, 48000, 54000}, | ||
|
||
-- List of basic wifi rates (optional, recommended if supported_rates is set) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment doesn't match the check_site script: the script makes basic_rate
mandatory if supported_rates
is set, not just recommended.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That should be required. I updated docs/user/site.rst
, too, to sound the same.
|
||
local rates = {1000, 2000, 5500, 6000, 9000, 11000, 12000, 18000, 24000, 36000, 48000, 54000} | ||
local supported_rates = need_array_of(config .. '.supported_rates', rates, false) | ||
if supported_rates then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@NeoRaider: I don't like this if
, but I think it is more clear than:
need_array_of(config .. '.basic_rate', supported_rates or rates, supported_rates and true or false)
for others searching for this, I add the examples from http://gluon.readthedocs.io/en/v2016.2/user/site.html?highlight=basic_rate
the question is how to configure this if you DONT want to disable 802.11b? |
I'd assume adding |
or dont configure this optional feature at all |
And does this interact with the |
@rubo77: mcast_rate should be part of supported_rates (if supported_rates is set) |
As far as I understand, if you set I would like to configure it, so our mesh sends minimum 12000 but also faster, if the link is good. Is that possible with those three options see also: https://forum.freifunk.net/t/moegliche-werte-fuer-mcast-rate/11785/13 |
The unicast rate is completely independent of this and is negotiated for each peer and client independently. It may be higher or lower than the multicast rate.
|
This should be added in the docs here: http://gluon.readthedocs.io/en/latest/user/site.html I see the hint to use something like 12MBit is new, but there should be some more explained:
does that mean, that all traffic between nodes is limited to 12MBit? |
@rubo77 it is not "limited" - it is set fixed - thus making throughput in achain of meshing nodes realy horrible |
Why is this set fixed? Isn't there a way to get the maximum speed possible of each mesh connection? |
@rubo77 it's fixed because this is how wifi works, so no. |
It is not all set fixed, Unicast is not. NeoRaider said:
(So a speedtest from a node that's connected to a fast offloaded only via mesh nodes should be much faster, or did you observe a different behaviour?) Maybe we should add the second Paragraph to the manual, so this common misunderstanding gets wiped out. |
The setting is called mcast rate, why should unicast be fixed than? Your concerns makes absolutely no sense. |
Look in the forum. Many Admins think this would Set Both fixed |
Because of the lack of statistics I'm still a little sceptical regarding the general applicability of this feature. For instance while in your 300 nodes mesh there might be ten nodes with too many clients, where this feature is needed to make the node usable at least for the clients in closer range. But there might also be ten other nodes with less clients where clients a little more far away are kicked even though they do no harm. However, why I'm writing now is actually this patch which I think could put this feature on steroids, if someone were adding another patch to have it available not only for AP, but also IBSS/802.11s interfaces: https://patchwork.ozlabs.org/patch/697637/ For instance we could have a required basic rate of maybe 6 or 12MBit/s for all interfaces. And then safely disable wifi broadcasts all together with this mac80211 multicast-to-unicast patch. PS: Disabling broadcasts on IBSS/802.11s is only applicable for routing protocols using a throughput instead of packetloss based metric (currently this is OLSRv2 or BATMAN V). |
Couldn't we make the configuration depending on the nr of connected clients somehow? |
First commit adds a new function to check_site_lib.lua, to check whether a value is included in a given array. This is needed, to check that the list of wifi rates only contains unprohibited values.
Second commit adds the functionality to specify a list of allowed wifi rates within site.conf, which was already discussed in #467. Additionally this should fix all issues mentioned by @NeoRaider in #808.
Thanks to:
@RubenKelevra
@Brother-Lal
@rotanid