From patchwork Wed Oct 28 11:04:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nick Lowe X-Patchwork-Id: 1389240 X-Patchwork-Delegate: mail@david-bauer.net Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.openwrt.org (client-ip=2001:8b0:10b:1231::1; helo=merlin.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=merlin.20170209 header.b=GYskv/5c; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=goxMTzJQ; dkim-atps=neutral Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CLm5n5gg7z9sVv for ; Wed, 28 Oct 2020 22:08:28 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=Ckw93pm0IBaCfF80wkAXUg0FhkHfbYrXzU/UsidFNZo=; b=GYskv/5ccmdL3+09XCO0j6ege nI3IlAtnbzADi+bypYBrUKGpr8RWc/5P+aMjXqGfs7kVnR6Ob6cBvKV3PXBBotBp658H1Wet9ZEmy VLiHbDnW8jLVsOAiqdZ2u/BbkN45Ly/zvbh2NIs8VZDB7326KrJ07cGeAMicAKw9h+j9W+SGI2xaS i6mfFmSfNb43EuXdj7jgGMgnnbJTJ8FiRIX6Sf4h0W7EqpWWrDYg70sdTwVy6FEvdBNeJVc7hP+dg 7nCXEuMCKVxfWghDXXuDpH5ynhX8RxJ7I/lrVYC+RCEtESKwza9M2uy1cjfG55aTOqAJKgy2IW4Th y1lR63UTA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kXjHV-00041u-BW; Wed, 28 Oct 2020 11:06:17 +0000 Received: from mail-oi1-x22d.google.com ([2607:f8b0:4864:20::22d]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kXjHS-000416-E4 for openwrt-devel@lists.openwrt.org; Wed, 28 Oct 2020 11:06:15 +0000 Received: by mail-oi1-x22d.google.com with SMTP id k27so4520862oij.11 for ; Wed, 28 Oct 2020 04:06:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=OSVlsFIww/zg/sXun3T5hKPzLHIsMu1TBVx3NxLJrz0=; b=goxMTzJQktHWk312QKeNE6FpMOCcTukuAIKrenWDfPNwJQQKvt8jSngRaGZSchFHEI GfrO4XZTRka2TObt6onrniNiNjvEGvtcZ1pvhIqS44LHY12Fy377RUacEKI3Bro8UULN CwHIG4xz7dupioa+bnUQUApwNGipl9dkBRP9VYW6XLRBuBVLa/cv/CGl/onRyqnsP1oG Cjmt9+SOLPmKj982Wgd1Jy2zl4VW5RsoHOQx8O+sv/lxSPhvVIc7wI1EfqiBGbBbSWRI OPjQzu9Q8h+bHiY7gT6DMqEWxat54CViT0QPr0QM/oJOfqSSUt+rhSMfpYWnXb0JIMl9 Y25A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=OSVlsFIww/zg/sXun3T5hKPzLHIsMu1TBVx3NxLJrz0=; b=oHNGP8eVxuNFqnDq2hhTsdPqXetF2ZeB7Q/U11oy2k42Qt9mVGYtXqb+mAVIwehQEH O+06lZMTXbi4c9Q7UhzzT9NrhqsMtxycxdqDZDu4U1j/ceErgN89lZYxKvJkqqFBLue/ aq7x+lrUkYcUimsn5stZ1ufNO3LuzO+J60lNaAphokptpMqB8mTFD28rw75wtspBsLfd TUc+zqRC106yL/POKIKual1u4LznI/oM/fwmMcB7DqRpes/hyAXTkrjkZrUDO7x+KpZl 5++jGngvZFi0YAY9SZvpEiiQFNGSpcQaovdWlC1sEQbkGqQhErVXLW3iXelm2tOvwl/9 /0Rw== X-Gm-Message-State: AOAM533OvF94oRA1rnHsIwyWgdntHVPFpqPMuJ0I1bC4+IlSfnhM6OvW BI1niMn8WbGh9Sj8Hl9s+ciWZcJQPUHVQA== X-Google-Smtp-Source: ABdhPJwt6SIk7w16Gfq6yUrE4k5mKsYF445qDuNHYFwGSOcTLu/Z6u2i37m3jlh7LL7cbb6enRmqzw== X-Received: by 2002:aca:b644:: with SMTP id g65mr4646993oif.164.1603883170206; Wed, 28 Oct 2020 04:06:10 -0700 (PDT) Received: from P02MY3L8Y.corp.extremenetworks.com ([137.220.95.74]) by smtp.gmail.com with ESMTPSA id j3sm2540029oij.9.2020.10.28.04.06.08 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 28 Oct 2020 04:06:09 -0700 (PDT) From: Nick Lowe To: openwrt-devel@lists.openwrt.org Subject: [PATCH] hostapd: Add cell_density data rates option Date: Wed, 28 Oct 2020 11:04:32 +0000 Message-Id: <20201028110432.27394-1-nick.lowe@gmail.com> X-Mailer: git-send-email 2.24.3 (Apple Git-128) In-Reply-To: References: MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201028_070614_541608_4890CFA7 X-CRM114-Status: GOOD ( 17.25 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [nick.lowe[at]gmail.com] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:22d listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Nick Lowe Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org Add a cell_density option to configure data rates for normal, high and very high cell density wireless deployments. The purpose of using a minimum basic/mandatory data rate that is higher than 6 Mb/s, or 5.5 Mb/s (802.11b compatible), in high cell density environments is to transmit broadcast/multicast data frames using less airtime or to reduce management overheads where significant co-channel interference (CCI) exists and cannot be avoided. Caution: Without careful design and validation, configuration of a too high minimum basic/mandatory data rate can sacrifice connection stability or disrupt the ability to reliably connect and authenticate for little to no capacity benefit. This is because this configuration affects the ability of clients to hear and demodulate management, control and broadcast/multicast data frames. Deployments that have not been specifically designed and validated are usually best suited to use 6, 12 and 24 Mb/s as basic/mandatory data rates. Only usually seek to configure a 12 Mb/s, or 11 Mb/s (802.11b compatible), minimum basic/mandatory rate in high cell density deployments that have been designed and validated for this. For many deployments, the minimum basic/mandatory data rate should not be configured above 12 Mb/s to 18 Mb/s, 24 Mb/s or higher. Such a configuration is only appropriate for use in very high cell density deployment scenarios. A cell_density of Very High (3) should only be used where a deployment has a valid use case and has been designed and validated specifically for this use, nearly always with highly directional antennas - an example would be stadium deployments. For example, with a 24 Mb/s OFDM minimum basic/mandatory data rate, approximately a -73 dBm RSSI is required to decode frames. Many clients will not have roamed elsewhere by the time that they experience -73 dBm and, where they do, they frequently may not hear and be able to demodulate beacon, control or broadcast/multicast data frames causing connectivity issues. There is a myth that disabling lower basic/mandatory data rates will improve roaming and avoid sticky clients. For 802.11n, 802.11ac and 802.11ax clients this is not correct as clients will shift to and use lower MCS rates and not to the 802.11b or 802.11g/802.11a rates that are able to be used as basic/mandatory data rates. There is a myth that disabling lower basic/mandatory data rates will ensure that clients only use higher data rates and that better performance is assured. For 802.11n, 802.11ac and 802.11ax clients this is not correct as clients will shift around and use MCS rates and not the 802.11b or 802.11g/802.11a rates that able to be used as basic/mandatory data rates. Cell Density 0 - Disabled (Default) Setting cell_density to 0 does not configure data rates. This is the default. 1 - Normal Cell Density Setting cell_density to 1 configures the basic/mandatory rates to 6, 12 and 24 Mb/s OFDM rates where legacy_rates is 0. Supported rates lower than the minimum basic/mandatory rate are not offered. Setting cell_density to 1 configures the basic/mandatory rates to the 5.5 and 11 Mb/s DSSS rates where legacy_rates is 1. Supported rates lower than the minimum basic/mandatory rate are not offered. 2 - High Cell Density Setting the cell_density to 2 configures the basic/mandatory rates to the 12 and 24 Mb/s OFDM rates where legacy_rates is 0. Supported rates lower than the minimum basic/mandatory rate are not offered. Setting the cell_density to 2 configures the basic/mandatory rates to the 11 Mb/s DSSS rate where legacy_rates is 1. Supported rates lower than the minimum basic/mandatory rate are not offered. 3 - Very High Cell Density Setting the cell_density to 3 configures the basic/mandatory rates to the 24 Mb/s OFDM rate where legacy_rates is 0. Supported rates lower than the minimum basic/mandatory rate are not offered. Setting the cell_density to 3 only has effect where legacy_rates is 0, else this has the same effect as being configured with a cell_density of 2. Where specified, the basic_rate and supported_rates options continue to override both the cell_density and legacy_rates options. Signed-off-by: Nick Lowe --- .../network/services/hostapd/files/hostapd.sh | 67 +++++++++++++++---- 1 file changed, 54 insertions(+), 13 deletions(-) diff --git a/package/network/services/hostapd/files/hostapd.sh b/package/network/services/hostapd/files/hostapd.sh index b33e8e1edc..9ff10a8a32 100644 --- a/package/network/services/hostapd/files/hostapd.sh +++ b/package/network/services/hostapd/files/hostapd.sh @@ -98,6 +98,7 @@ hostapd_common_add_device_config() { config_add_int local_pwr_constraint config_add_string require_mode config_add_boolean legacy_rates + config_add_int cell_density config_add_string acs_chan_bias config_add_array hostapd_options @@ -113,7 +114,7 @@ hostapd_prepare_device_config() { local base_cfg= json_get_vars country country_ie beacon_int:100 dtim_period:2 doth require_mode legacy_rates \ - acs_chan_bias local_pwr_constraint spectrum_mgmt_required airtime_mode + acs_chan_bias local_pwr_constraint spectrum_mgmt_required airtime_mode cell_density hostapd_set_log_options base_cfg @@ -122,8 +123,7 @@ hostapd_prepare_device_config() { set_default doth 1 set_default legacy_rates 1 set_default airtime_mode 0 - - [ "$hwmode" = "b" ] && legacy_rates=1 + set_default cell_density 0 [ -n "$country" ] && { append base_cfg "country_code=$country" "$N" @@ -144,16 +144,57 @@ hostapd_prepare_device_config() { json_get_values rate_list supported_rates [ -n "$hwmode" ] && append base_cfg "hw_mode=$hwmode" "$N" - [ "$legacy_rates" -eq 0 ] && set_default require_mode g - - [ "$hwmode" = "g" ] && { - [ "$legacy_rates" -eq 0 ] && set_default rate_list "6000 9000 12000 18000 24000 36000 48000 54000" - [ -n "$require_mode" ] && set_default basic_rate_list "6000 12000 24000" - } - - case "$require_mode" in - n) append base_cfg "require_ht=1" "$N";; - ac) append base_cfg "require_vht=1" "$N";; + if [ "$hwmode" = "g" ] || [ "$hwmode" = "a" ]; then + [ -n "$require_mode" ] && legacy_rates=0 + case "$require_mode" in + n) append base_cfg "require_ht=1" "$N";; + ac) append base_cfg "require_vht=1" "$N";; + esac + fi + case "$hwmode" in + b) + if [ "$cell_density" -eq 1 ]; then + set_default rate_list "5500 11000" + set_default basic_rate_list "5500 11000" + elif [ "$cell_density" -ge 2 ]; then + set_default rate_list "11000" + set_default basic_rate_list "11000" + fi + ;; + g) + if [ "$cell_density" -eq 0 ] || [ "$cell_density" -eq 1 ]; then + if [ "$legacy_rates" -eq 0 ]; then + set_default rate_list "6000 9000 12000 18000 24000 36000 48000 54000" + set_default basic_rate_list "6000 12000 24000" + elif [ "$cell_density" -eq 1 ]; then + set_default rate_list "5500 6000 9000 11000 12000 18000 24000 36000 48000 54000" + set_default basic_rate_list "5500 11000" + fi + elif [ "$cell_density" -ge 3 ] && [ "$legacy_rates" -ne 0 ] || [ "$cell_density" -eq 2 ]; then + if [ "$legacy_rates" -eq 0 ]; then + set_default rate_list "12000 18000 24000 36000 48000 54000" + set_default basic_rate_list "12000 24000" + else + set_default rate_list "11000 12000 18000 24000 36000 48000 54000" + set_default basic_rate_list "11000" + fi + elif [ "$cell_density" -ge 3 ]; then + set_default rate_list "24000 36000 48000 54000" + set_default basic_rate_list "24000" + fi + ;; + a) + if [ "$cell_density" -eq 1 ]; then + set_default rate_list "6000 9000 12000 18000 24000 36000 48000 54000" + set_default basic_rate_list "6000 12000 24000" + elif [ "$cell_density" -eq 2 ]; then + set_default rate_list "12000 18000 24000 36000 48000 54000" + set_default basic_rate_list "12000 24000" + elif [ "$cell_density" -ge 3 ]; then + set_default rate_list "24000 36000 48000 54000" + set_default basic_rate_list "24000" + fi + ;; esac for r in $rate_list; do