Harald Welte has submitted this change and it was merged.

Change subject: RACH decoding: Use BER threshold for RACH ghost detection
......................................................................


RACH decoding: Use BER threshold for RACH ghost detection

When decoding RACH bursts, we should use a BER threshold in order to
help distinguish 'ghost' RACH bursts from real RACH bursts.

The theoretical ideal threshold according to some papers is 7 out of 41
bits qhich aquals to Eb/N0 of 0 dB = 0.1707 (17.07%)

We add a new 'ber10k' parameter to the RACH indication l1sap primitive
(needs separate change for libosmocore), and then fill this value from
osmo-bts-{sysmo,lc15,trx,octphy}.  The common part above L1SAP then
applies the threshold, which can be changed from vty using the
        "max-ber10k-rach <0-10000>"
command available at the BTS node.  The unit is BER in 1/10000, i.e. a
value of 100 equals 1% bit error rate.

Change-Id: Ic41c11f6312a36baa2738547e8dcec80829457f8
---
M include/osmo-bts/gsm_data.h
M src/common/bts.c
M src/common/l1sap.c
M src/common/vty.c
4 files changed, 24 insertions(+), 1 deletion(-)

Approvals:
  Vadim Yanitskiy: Looks good to me, but someone else must approve
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/include/osmo-bts/gsm_data.h b/include/osmo-bts/gsm_data.h
index f2574b1..10c9d04 100644
--- a/include/osmo-bts/gsm_data.h
+++ b/include/osmo-bts/gsm_data.h
@@ -111,6 +111,7 @@
 
        float min_qual_rach;    /* minimum quality for RACH bursts */
        float min_qual_norm;    /* minimum quality for normal daata */
+       uint16_t max_ber10k_rach;       /* Maximum permitted RACH BER in 0.01% 
*/
 
        struct {
                char *sock_path;
diff --git a/src/common/bts.c b/src/common/bts.c
index b10d7f2..15b92d7 100644
--- a/src/common/bts.c
+++ b/src/common/bts.c
@@ -149,6 +149,7 @@
        btsb->t3105_ms = 300;
        btsb->min_qual_rach = MIN_QUAL_RACH;
        btsb->min_qual_norm = MIN_QUAL_NORM;
+       btsb->max_ber10k_rach = 1707; /* 7 of 41 bits is Eb/N0 of 0 dB = 0.1707 
*/
        btsb->pcu.sock_path = talloc_strdup(btsb, PCU_SOCK_DEFAULT);
        for (i = 0; i < ARRAY_SIZE(btsb->t200_ms); i++)
                btsb->t200_ms[i] = oml_default_t200_ms[i];
diff --git a/src/common/l1sap.c b/src/common/l1sap.c
index 90f045a..50bd612 100644
--- a/src/common/l1sap.c
+++ b/src/common/l1sap.c
@@ -1203,7 +1203,12 @@
        if (rach_ind->rssi >= btsb->load.rach.busy_thresh)
                btsb->load.rach.busy++;
 
-       /* FIXME: RACH filtering due to BER limit */
+       /* check for RACH exceeding BER threshold (ghost RACH) */
+       if (rach_ind->ber10k > btsb->max_ber10k_rach) {
+               DEBUGPFN(DL1C, rach_ind->fn, "ignoring RACH request: %u > %u 
(max BER)\n",
+                       rach_ind->ber10k, btsb->max_ber10k_rach);
+               return 0;
+       }
 
        /* increment number of RACH slots with valid non-handover RACH burst */
        btsb->load.rach.access++;
diff --git a/src/common/vty.c b/src/common/vty.c
index a1cb2fe..3938de5 100644
--- a/src/common/vty.c
+++ b/src/common/vty.c
@@ -291,6 +291,8 @@
                VTY_NEWLINE);
        vty_out(vty, " min-qual-norm %.0f%s", btsb->min_qual_norm * 10.0f,
                VTY_NEWLINE);
+       vty_out(vty, " max-ber10k-rach %u%s", btsb->max_ber10k_rach,
+               VTY_NEWLINE);
        if (strcmp(btsb->pcu.sock_path, PCU_SOCK_DEFAULT))
                vty_out(vty, " pcu-socket %s%s", btsb->pcu.sock_path, 
VTY_NEWLINE);
 
@@ -588,6 +590,19 @@
        struct gsm_bts_role_bts *btsb = bts_role_bts(bts);
 
        btsb->min_qual_norm = strtof(argv[0], NULL) / 10.0f;
+
+       return CMD_SUCCESS;
+}
+
+DEFUN(cfg_bts_max_ber_rach, cfg_bts_max_ber_rach_cmd,
+       "max-ber10k-rach <0-10000>",
+       "Set the maximum BER for valid RACH requests\n"
+       "BER in 1/10000 units (0=no BER; 100=1% BER)\n")
+{
+       struct gsm_bts *bts = vty->index;
+       struct gsm_bts_role_bts *btsb = bts_role_bts(bts);
+
+       btsb->max_ber10k_rach = strtoul(argv[0], NULL, 10);
 
        return CMD_SUCCESS;
 }
@@ -1542,6 +1557,7 @@
        install_element(BTS_NODE, &cfg_bts_ul_power_target_cmd);
        install_element(BTS_NODE, &cfg_bts_min_qual_rach_cmd);
        install_element(BTS_NODE, &cfg_bts_min_qual_norm_cmd);
+       install_element(BTS_NODE, &cfg_bts_max_ber_rach_cmd);
        install_element(BTS_NODE, &cfg_bts_pcu_sock_cmd);
 
        install_element(BTS_NODE, &cfg_trx_gsmtap_sapi_cmd);

-- 
To view, visit https://gerrit.osmocom.org/6933
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ic41c11f6312a36baa2738547e8dcec80829457f8
Gerrit-PatchSet: 4
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Harald Welte <lafo...@gnumonks.org>
Gerrit-Reviewer: Harald Welte <lafo...@gnumonks.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Vadim Yanitskiy <axilira...@gmail.com>

Reply via email to