From patchwork Sun Oct 18 23:56:25 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nick Lowe X-Patchwork-Id: 1383921 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=uULCJ3J4; 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=m3l7OxZI; 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 4CDxgC2YS0z9sS8 for ; Mon, 19 Oct 2020 10:58:47 +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=NEtm54gTqZrgR2nfgeh74PWSbMzlkZ64O8pi/AeXyoQ=; b=uULCJ3J4cBU6pK+8mX2GxTtyV NcMN/yOa+/V4cmGK68f3X8p361VMqmbGFD6VvjeYmkRYm7X6pck1Pb5CfkjsEcV3qJT7q8Ut8naEk iaXwRqHGEjv18fzDH6rAvowuPNCLN2hKiM5R9XaEr1q4hQVzCTftQw79IRSa0EIc6S+pqLMlmZS0r pET6VMn9bEhCsE25KXHNFwaYUHCqAT083zE4cnTMA/DRkChTTI9Ew5PNT5VMwDtce3HZn4XQqGuEV 3AW5hybFPahID3Sw1vxjkQPvputgJxeEeves2r84nLegmyDSBMAnmsgW7QLvUDuiRlekZlK1kLpTf hffuCER3g==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kUIXV-0003FI-TO; Sun, 18 Oct 2020 23:56:38 +0000 Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kUIXT-0003Eo-1c for openwrt-devel@lists.openwrt.org; Sun, 18 Oct 2020 23:56:36 +0000 Received: by mail-wr1-x431.google.com with SMTP id y12so9412894wrp.6 for ; Sun, 18 Oct 2020 16:56:32 -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=qFSTRjG0YWONMEmOLBHSPkpd0007h3m/NSjvn4ndfeo=; b=m3l7OxZIXNw9Garnt7ecGaGx9aT5LTONfxu8GA3ChGH2M1umKB7M4p47VjuioEtFID ZEBD5mbpct5RIBhhxn/FASgHqSDdXfMmL9/IVhpwFh+w2/2R8rPYNXuRBAWFNvDrAWaJ 0ztPoSAKB7/M7RH31WTHVF3ynfYlqaCuHoIXdfK9d8ODJJyZMI3TUH3QWi9qxRVWuU4U zPYhJoh7VBLl6Pr2XmFCJlQOd/gEI4EdIGslK323lzBmpNvN9vglaggDaDzqxmT6njqg dXNPaMBs3ILawqyHTPUGLMM+HCmZgVDMbEbD/YNl/PaKSCsARg/OzT3ViLObwsuOazMc jsTQ== 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=qFSTRjG0YWONMEmOLBHSPkpd0007h3m/NSjvn4ndfeo=; b=i1wFqfls9YODJr3PdR+PGIDO6Q/8Bil5Tt5Sek19Lx0Inp7hpLak+iRPy7sGEax6ox MkFURRD9dMGgLDwnjZY4AiBbxE17YC48C0Ozph5grN0A8o4v04r2AKmgJg9H5b50kxw2 O8EHZB5WsHx0OvH8P/j2MvDG9I24A7fWIQjhCJYaPDrU+lOQ53APEPW9hTBRIe5Map0s fJ4/yVVOrawLGchDbqqw6iGESghDhHkbU5iKl9gNMrFHbOw7qRmt51TlaETRRilalpPK Si+rZ5k9ieUmaQz4EhJ4fSKAZO8uYiZaUq5uflQOj8lSfHpfZtBLnLUYRsQeMtvikMNt U+YQ== X-Gm-Message-State: AOAM532b17V07MOfTNlO/qud65pQ9EFgvKTxkmH25SvxAXEFs8+w2s96 zP8SrDVYj+RXERo7dYtVs3sjHtK/EWi2Ow== X-Google-Smtp-Source: ABdhPJwoRsf884TWBfztUr6/bBT/Wtr3hff/f85ANxJhGL6RYF4BvMjgFtJabv+/pEbm3D2BwQH5KA== X-Received: by 2002:a05:6000:1005:: with SMTP id a5mr9256336wrx.360.1603065391651; Sun, 18 Oct 2020 16:56:31 -0700 (PDT) Received: from P02MY3L8Y.lan ([137.220.95.74]) by smtp.gmail.com with ESMTPSA id y10sm15222633wrq.73.2020.10.18.16.56.31 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 18 Oct 2020 16:56:31 -0700 (PDT) From: Nick Lowe To: openwrt-devel@lists.openwrt.org Subject: [PATCH] hostapd: Add cell_density data rates option Date: Mon, 19 Oct 2020 00:56:25 +0100 Message-Id: <20201018235625.42472-1-nick.lowe@gmail.com> X-Mailer: git-send-email 2.24.3 (Apple Git-128) In-Reply-To: <20200926150623.42441-1-nick.lowe@gmail.com> References: <20200926150623.42441-1-nick.lowe@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201018_195635_192820_C36ACD83 X-CRM114-Status: GOOD ( 17.35 ) 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 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [nick.lowe[at]gmail.com] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:431 listed in] [list.dnswl.org] 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 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 | 70 +++++++++++++++---- 1 file changed, 57 insertions(+), 13 deletions(-) diff --git a/package/network/services/hostapd/files/hostapd.sh b/package/network/services/hostapd/files/hostapd.sh index b33e8e1edc..2bf67601c5 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,60 @@ 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 ] && [ "$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 + 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" + else + 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" -eq 2 ] || [ "$legacy_rates" -ne 0 ]; 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