From patchwork Wed Aug 1 19:56:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Iyad Qumei X-Patchwork-Id: 952386 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=quarantine dis=none) header.from=verizon.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="ZqAsk9iV"; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=verizon.com header.i=@verizon.com header.b="YDMR2jMb"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=verizon-com.20150623.gappssmtp.com header.i=@verizon-com.20150623.gappssmtp.com header.b="EGBjiJtT"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41glrX4rdJz9s2g for ; Thu, 2 Aug 2018 06:53:16 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type:To:Subject: Message-ID:Date:From:MIME-Version:Reply-To:Cc:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=lbAQzvIZdAvGaINGdGIKX9kSspFmbkodknfMfgea+dM=; b=ZqAsk9iVLifwA03emGhiAJFmkO lzOffnCBLxwxTz/47+TJdLOQVfhAyLnDV/OYccTDtEMQMlD3n0Qstug2f+rZw0ehQ6ZZUPhWEegJ+ lxyBWWUd7Mq0bmDiLPEY1+ZZf6+dQDaprby0OzDA58gxFXQP61VSz82Kckt3mz8f5Ed76Jb+po4Uz H8AwabbLbwdM2e8AdtIM7zaSrdugBdTYnw9CmxUKtTfZ/YkoC6BPqsDV8ZSsMgQQ+ApavCt0BJ45G 3dY99kR0PjgGd297GszXrGY/77HVyRL6Oc1nNYGPiq9qnszqex94reZr8RbRkWArmAeHE8Wf/e/UB 00WTQT8Q==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fky77-0007pp-Jy; Wed, 01 Aug 2018 20:52:57 +0000 Received: from mx0a-0024a201.pphosted.com ([148.163.149.93]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fkxEg-0001cX-QK for hostap@lists.infradead.org; Wed, 01 Aug 2018 19:56:44 +0000 Received: from pps.filterd (m0102825.ppops.net [127.0.0.1]) by mx0a-0024a201.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w71JtbCZ069028 for ; Wed, 1 Aug 2018 15:56:29 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=verizon.com; h=mime-version : from : date : message-id : subject : to : content-type; s=corp; bh=pjs+ZRWz8g17eyOMTDKFkRGi55CtGNR/hHCbUmOWNbA=; b=YDMR2jMbstVuqdoFyNBkpv64OFb9GdI+Q/kgHX1+j0OjUalLzgGKX+WBx57FkIB13ece XFVv57h596ddz6AR1WOqKodIkAT0jJiJhlKB3lKVjzPCsDfAhh/r1cheYii5PH7sA61b BIcdC+VHi6JDpOsGpZZqQEll6eN2ceW82wY= Received: from mail-lj1-f199.google.com (mail-lj1-f199.google.com [209.85.208.199]) by mx0a-0024a201.pphosted.com with ESMTP id 2kkjyq8a7q-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Wed, 01 Aug 2018 15:56:29 -0400 Received: by mail-lj1-f199.google.com with SMTP id t10-v6so4449260lji.12 for ; Wed, 01 Aug 2018 12:56:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=verizon-com.20150623.gappssmtp.com; s=20150623; h=mime-version:from:date:message-id:subject:to; bh=pjs+ZRWz8g17eyOMTDKFkRGi55CtGNR/hHCbUmOWNbA=; b=EGBjiJtTj7tP3KNBazBS+y6SCqFKofRmATXKJ+B9gfN4uZw01ZL7XrJUBYEr+Or6mW wsac5E1+N6Mkqox3DHsLVHhRwtak6oR8O6F5xyw5TiU2ZenhRoSeI0dSfQYau90O9qrG PvTNCvG+UV3PzV2OcX8zPd+9boAvmEVlRD6lKaotTFfHN/VjQ9BlpxW1ZxacPH3k7c6u bMfzwfMhevH0i/8SWu+ICDmjbIHkfPGSTWS1BZh/J8IHOCl7xlKE0zMEqhsis7vVLCXc tC6w6Ebzo2G6sCX42k3Xhl6j360ffHqD7VEsPipoBImJbm/BzwQzMvEfbtceHYhq7y2s nR4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=pjs+ZRWz8g17eyOMTDKFkRGi55CtGNR/hHCbUmOWNbA=; b=CFwhYcdKwZMAz0rZhwzV55Zn+fwJLviMF5kn5WqEDqtpRcM1nXUC8p1ejX98zmAHjI cIXvVCNSU1egCDAmOXin5On5y52TA+Cg91EF7lZ/KeW3AeTVyh895laDMgeyNaJHb3Uk xQK2JBGPBoEAKzlk/C6rnZAyMOfPurtkqAlngR4VFxsj/+GEeI8UmEcV5+2EHZNEjJiT zVotsmD555dfWTHybHIr/EM4uiy9taIY5uz/fepYy80z68rKhprV1rNWfz/N5cb5dKQQ 3D1RkZ5r51laH55SJPB62svdMNkv3gqngKGtyJmpo2r9cMS+0t0zmryLI2XqGM7G9lSy ZAsg== X-Gm-Message-State: AOUpUlHLyqSmUH0sj2gBdI09m5LPMSV9i9XSO9bVNcrPJT++T0zuEO/N wHXCG6yZk1rIJLyDDXR+LVf9wCignwOC+D0+42ZjYgWXQl2mxm2Ve93gpbZoH9s0rmS9lh7cYoj 3u9+nYE6hsVDaNkajSBi3gwf8YuHs6pgAkVKHsw== X-Received: by 2002:a19:988f:: with SMTP id a137-v6mr17876591lfe.128.1533153386546; Wed, 01 Aug 2018 12:56:26 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfw7ZQqgt44hb4EOL0W2Xp1JXcrbjvzvF//Fs3MG94voSol32HMY4iKKgKD/S1AtmObcXpTz9sHAAIDVSmTs10= X-Received: by 2002:a19:988f:: with SMTP id a137-v6mr17876583lfe.128.1533153386379; Wed, 01 Aug 2018 12:56:26 -0700 (PDT) MIME-Version: 1.0 From: Iyad Qumei Date: Wed, 1 Aug 2018 12:56:15 -0700 Message-ID: Subject: wpa_supplicant roaming algorithm To: hostap@lists.infradead.org X-mailroute: internal X-Proofpoint-Spam-Details: rule=out_spam_notspam policy=out_spam score=0 priorityscore=1501 malwarescore=0 suspectscore=3 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1806210000 definitions=main-1808010201 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180801_125643_012553_ED9301D1 X-CRM114-Status: GOOD ( 19.64 ) X-Spam-Score: -0.8 (/) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-0.8 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [148.163.149.93 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -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.0 T_DKIMWL_WL_MED DKIMwl.org - Whitelisted Medium sender X-Mailman-Approved-At: Wed, 01 Aug 2018 13:52:43 -0700 X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Greetings, The current roaming algorithm appears incorrect. I would like your opinion on the following proposed change. I understand the patch is for the 2.6 release. I checked the master branch the RSSI roaming criteria are still the same. Will update the patch for the master branch once I hear your opinion. There are roaming gaps, identified for specific current signal levels. In these gaps, no roaming occurs. However, outside of these gaps which include worse selected signals roaming occurs. Also, I don't believe the operating condition current_bss->level > 0 is physically possible. All values in the tables are in dBm. Proposed alternative: ===================== (standard) ---------- Current Level < -85 selected - current >= 1 min_diff = 1 -85 < Current Level < -80 selected - current >= 2 min_diff = 2 -80 < Current Level < -75 selected - current >= 3 min_diff = 3 -75 < Current Level < -70 selected - current >= 4 min_diff = 4 Current Level > -70 selected - current >= 5 min_diff = 5 2.4 to 5.0 GHz -------------- Current Level < -85 selected - current >= -2 min_diff = -2 -85 < Current Level < -80 selected - current >= -2 min_diff = -2 -80 < Current Level < -75 selected - current >= 1 min_diff = 1 -75 < Current Level < -70 selected - current >= 2 min_diff = 2 Current Level > -70 selected - current >= 3 min_diff = 3 Current implementation ====================== (standard) ---------- Current Level < -85 selected - current >= 1 min_diff = 1 -85 < Current Level < -80 selected - current >= 2 min_diff = 2 -80 < Current Level < -75 selected - current >= 3 min_diff = 3 -75 < Current Level < -70 selected - current >= 4 min_diff = 4 -70 < Current Level < 0 selected - current >= 5 min_diff = 5 Current Level > 0 selected - current >= 2 min_diff = 2 (Roaming gap < -2, > 2) 2.4 to 5.0 GHz -------------- Current Level < -85 selected - current >= -2 min_diff = 0 -85 < Current Level < -80 selected - current >= -2 min_diff = 0 -80 < Current Level < -75 selected - current >= 1 min_diff = 1 (Roaming gap -2,-1, > 1) -75 < Current Level < -70 selected - current >= 2 min_diff = 2 (Roaming gap -2,-1, > 2) -70 < Current Level < 0 selected - current >= 3 min_diff = 3 Current Level > 0 selected - current >= any min_diff = 0 Regards, From 0f6f3d777ae2a8712ff4374cd482fe1c99a66fee Mon Sep 17 00:00:00 2001 From: Iyad Qumei Date: Wed, 1 Aug 2018 12:24:07 -0700 Subject: [PATCH] wpa: fix roaming algorithm The current roaming algorithm is incorrect. There are roaming gaps, identified for specific current signal levels. In these gaps no roaming occurs. However, outside of these gaps which include worse selected signals roaming occurs. All values in the tables are in dBm. Proposed alternative: ===================== (standard) ---------- Current Level < -85 selected - current >= 1 min_diff = 1 -85 < Current Level < -80 selected - current >= 2 min_diff = 2 -80 < Current Level < -75 selected - current >= 3 min_diff = 3 -75 < Current Level < -70 selected - current >= 4 min_diff = 4 Current Level > -70 selected - current >= 5 min_diff = 5 2.4 to 5.0 GHz -------------- Current Level < -85 selected - current >= -2 min_diff = -2 -85 < Current Level < -80 selected - current >= -2 min_diff = -2 -80 < Current Level < -75 selected - current >= 1 min_diff = 1 -75 < Current Level < -70 selected - current >= 2 min_diff = 2 Current Level > -70 selected - current >= 3 min_diff = 3 Current implementation ====================== (standard) ---------- Current Level < -85 selected - current >= 1 min_diff = 1 -85 < Current Level < -80 selected - current >= 2 min_diff = 2 -80 < Current Level < -75 selected - current >= 3 min_diff = 3 -75 < Current Level < -70 selected - current >= 4 min_diff = 4 -70 < Current Level < 0 selected - current >= 5 min_diff = 5 Current Level > 0 selected - current >= 2 min_diff = 2 (Roaming gap < -2, > 2) 2.4 to 5.0 GHz -------------- Current Level < -85 selected - current >= -2 min_diff = 0 -85 < Current Level < -80 selected - current >= -2 min_diff = 0 -80 < Current Level < -75 selected - current >= 1 min_diff = 1 (Roaming gap -2,-1, > 1) -75 < Current Level < -70 selected - current >= 2 min_diff = 2 (Roaming gap -2,-1, > 2) -70 < Current Level < 0 selected - current >= 3 min_diff = 3 Current Level > 0 selected - current >= any min_diff = 0 --- .pc/applied-patches | 1 + wpa_supplicant/events.c | 27 +++++++++++++-------------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/.pc/applied-patches b/.pc/applied-patches index e5913f2..72f582c 100644 --- a/.pc/applied-patches +++ b/.pc/applied-patches @@ -2,3 +2,4 @@ key-replay-cve-multiple.patch allow-wpa-cli-with-dbus.patch wpa_supplicant_ap_selection.patch wpa-ptk-error-code.patch +wpa-correct-roaming-algorithm.patch diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c index 41057cc..962d81f 100644 --- a/wpa_supplicant/events.c +++ b/wpa_supplicant/events.c @@ -1470,26 +1470,25 @@ static int wpa_supplicant_need_to_roam(struct wpa_supplicant *wpa_s, } min_diff = 2; - if (current_bss->level < 0) { - if (current_bss->level < -85) - min_diff = 1; - else if (current_bss->level < -80) - min_diff = 2; - else if (current_bss->level < -75) - min_diff = 3; - else if (current_bss->level < -70) - min_diff = 4; - else - min_diff = 5; - } + if (current_bss->level < -85) + min_diff = 1; + else if (current_bss->level < -80) + min_diff = 2; + else if (current_bss->level < -75) + min_diff = 3; + else if (current_bss->level < -70) + min_diff = 4; + else + min_diff = 5; + if (to_5ghz) { /* Make it easier to move to 5 GHz band */ if (min_diff > 2) min_diff -= 2; else - min_diff = 0; + min_diff = -2; } - if (abs(current_bss->level - selected->level) < min_diff) { + if ((selected->level -current_bss->level) < min_diff) { wpa_dbg(wpa_s, MSG_INFO, "Skip roam - too small difference " "in signal level"); return 0; -- 2.7.4