[MERGED] openbsc[master]: Add vty command "radio-link-timeout infinite" for uplink rx ...

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Harald Welte gerrit-no-reply at lists.osmocom.org
Sun Jun 18 10:08:52 UTC 2017


Harald Welte has submitted this change and it was merged.

Change subject: Add vty command "radio-link-timeout infinite" for uplink rx testing
......................................................................


Add vty command "radio-link-timeout infinite" for uplink rx testing

When we are performing Rx sensitivity testing on a BTS, we want to
deactivate the connection failure criterion / radio link timeout, i.e.
no matter how many SACCH frames in uplink are failed to decode, the BTS
should never close the channel.

OsmoBTS Change-Id I736f21f6528db5c16fa80cdb905af20673797be5 covers a way
how this behavior can be requested from the BTS via an OML attribute.
This patch adds support to the BSC to actually set that attribute.

Do not use this in production networks, as the BTS will keep open radio
channels indefinitely even if the phone is gone and no longer
transmitting anything.  This is a pure testing feature.

Change-Id: I6cb94e0f024934f7baeeb728ca9ed3042fbf16d2
---
M openbsc/include/openbsc/gsm_04_08.h
M openbsc/include/openbsc/gsm_data.h
M openbsc/include/openbsc/gsm_data_shared.h
M openbsc/src/libbsc/bsc_vty.c
M openbsc/src/libbsc/bts_ipaccess_nanobts_omlattr.c
M openbsc/src/libcommon/gsm_data.c
6 files changed, 79 insertions(+), 23 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/openbsc/include/openbsc/gsm_04_08.h b/openbsc/include/openbsc/gsm_04_08.h
index fe19ff4..a8b2de9 100644
--- a/openbsc/include/openbsc/gsm_04_08.h
+++ b/openbsc/include/openbsc/gsm_04_08.h
@@ -26,20 +26,6 @@
 				   name);
 }
 
-static inline int get_radio_link_timeout(struct gsm48_cell_options *cell_options)
-{
-	return (cell_options->radio_link_timeout + 1) << 2;
-}
-
-static inline void set_radio_link_timeout(struct gsm48_cell_options *cell_options, int value)
-{
-	if (value < 4)
-		value = 4;
-	if (value > 64)
-		value = 64;
-	cell_options->radio_link_timeout = (value >> 2) - 1;
-}
-
 /* config options controlling the behaviour of the lower leves */
 void gsm0408_allow_everyone(int allow);
 void gsm0408_clear_request(struct gsm_subscriber_connection *conn, uint32_t cause);
diff --git a/openbsc/include/openbsc/gsm_data.h b/openbsc/include/openbsc/gsm_data.h
index 5ab7c3f..a974051 100644
--- a/openbsc/include/openbsc/gsm_data.h
+++ b/openbsc/include/openbsc/gsm_data.h
@@ -590,4 +590,7 @@
 int bts_depend_check(struct gsm_bts *bts);
 int bts_depend_is_depedency(struct gsm_bts *base, struct gsm_bts *other);
 
+int gsm_bts_get_radio_link_timeout(const struct gsm_bts *bts);
+void gsm_bts_set_radio_link_timeout(struct gsm_bts *bts, int value);
+
 #endif /* _GSM_DATA_H */
diff --git a/openbsc/include/openbsc/gsm_data_shared.h b/openbsc/include/openbsc/gsm_data_shared.h
index d3fd757..4c71a07 100644
--- a/openbsc/include/openbsc/gsm_data_shared.h
+++ b/openbsc/include/openbsc/gsm_data_shared.h
@@ -872,6 +872,8 @@
 		} data;
 	} si_common;
 	bool early_classmark_allowed;
+	/* for testing only: Have an infinitely long radio link timeout */
+	bool infinite_radio_link_timeout;
 
 	/* do we use static (user-defined) system information messages? (bitmask) */
 	uint32_t si_mode_static;
diff --git a/openbsc/src/libbsc/bsc_vty.c b/openbsc/src/libbsc/bsc_vty.c
index 2fc39ab..9fc2895 100644
--- a/openbsc/src/libbsc/bsc_vty.c
+++ b/openbsc/src/libbsc/bsc_vty.c
@@ -604,9 +604,11 @@
 		vty_out(vty, "  periodic location update %u%s",
 			bts->si_common.chan_desc.t3212 * 6, VTY_NEWLINE);
 
-	vty_out(vty, "  radio-link-timeout %d%s",
-		get_radio_link_timeout(&bts->si_common.cell_options),
-		VTY_NEWLINE);
+	if (gsm_bts_get_radio_link_timeout(bts) < 0)
+		vty_out(vty, "  radio-link-timeout infinite%s", VTY_NEWLINE);
+	else
+		vty_out(vty, "  radio-link-timeout %d%s",
+			gsm_bts_get_radio_link_timeout(bts), VTY_NEWLINE);
 	vty_out(vty, "  channel allocator %s%s",
 		bts->chan_alloc_reverse ? "descending" : "ascending",
 		VTY_NEWLINE);
@@ -2299,7 +2301,25 @@
 {
 	struct gsm_bts *bts = vty->index;
 
-	set_radio_link_timeout(&bts->si_common.cell_options, atoi(argv[0]));
+	gsm_bts_set_radio_link_timeout(bts, atoi(argv[0]));
+
+	return CMD_SUCCESS;
+}
+
+DEFUN(cfg_bts_radio_link_timeout_inf, cfg_bts_radio_link_timeout_inf_cmd,
+	"radio-link-timeout infinite",
+	"Radio link timeout criterion (BTS side)\n"
+	"Infinite Radio link timeout value (use only for BTS RF testing)\n")
+{
+	struct gsm_bts *bts = vty->index;
+
+	if (bts->type != GSM_BTS_TYPE_OSMOBTS) {
+		vty_out(vty, "%% infinite radio link timeout not supported by this BTS%s", VTY_NEWLINE);
+		return CMD_WARNING;
+	}
+
+	vty_out(vty, "%% INFINITE RADIO LINK TIMEOUT, USE ONLY FOR BTS RF TESTING%s", VTY_NEWLINE);
+	gsm_bts_set_radio_link_timeout(bts, -1);
 
 	return CMD_SUCCESS;
 }
@@ -4180,6 +4200,7 @@
 	install_element(BTS_NODE, &cfg_bts_penalty_time_cmd);
 	install_element(BTS_NODE, &cfg_bts_penalty_time_rsvd_cmd);
 	install_element(BTS_NODE, &cfg_bts_radio_link_timeout_cmd);
+	install_element(BTS_NODE, &cfg_bts_radio_link_timeout_inf_cmd);
 	install_element(BTS_NODE, &cfg_bts_gprs_mode_cmd);
 	install_element(BTS_NODE, &cfg_bts_gprs_11bit_rach_support_for_egprs_cmd);
 	install_element(BTS_NODE, &cfg_bts_gprs_ns_timer_cmd);
diff --git a/openbsc/src/libbsc/bts_ipaccess_nanobts_omlattr.c b/openbsc/src/libbsc/bts_ipaccess_nanobts_omlattr.c
index 0291129..473e1ca 100644
--- a/openbsc/src/libbsc/bts_ipaccess_nanobts_omlattr.c
+++ b/openbsc/src/libbsc/bts_ipaccess_nanobts_omlattr.c
@@ -38,6 +38,7 @@
 {
 	struct msgb *msgb;
 	uint8_t buf[256];
+	int rlt;
 	msgb = msgb_alloc(1024, "nanobts_attr_bts");
 
 	memcpy(buf, "\x55\x5b\x61\x67\x6d\x73", 6);
@@ -46,9 +47,16 @@
 	/* interference avg. period in numbers of SACCH multifr */
 	msgb_tv_put(msgb, NM_ATT_INTAVE_PARAM, 0x06);
 
-	/* conn fail based on SACCH error rate */
-	buf[0] = 0x01;
-	buf[1] = get_radio_link_timeout(&bts->si_common.cell_options);
+	rlt = gsm_bts_get_radio_link_timeout(bts);
+	if (rlt == -1) {
+		/* Osmocom extension: Use infinite radio link timeout */
+		buf[0] = 0xFF;
+		buf[1] = 0x00;
+	} else {
+		/* conn fail based on SACCH error rate */
+		buf[0] = 0x01;
+		buf[1] = rlt;
+	}
 	msgb_tl16v_put(msgb, NM_ATT_CONN_FAIL_CRIT, 2, buf);
 
 	memcpy(buf, "\x1e\x24\x24\xa8\x34\x21\xa8", 7);
diff --git a/openbsc/src/libcommon/gsm_data.c b/openbsc/src/libcommon/gsm_data.c
index 8830ce1..db7de08 100644
--- a/openbsc/src/libcommon/gsm_data.c
+++ b/openbsc/src/libcommon/gsm_data.c
@@ -323,8 +323,7 @@
 	bts->si_common.chan_desc.bs_pa_mfrms = RSL_BS_PA_MFRMS_5; /* paging frames */
 	bts->si_common.chan_desc.bs_ag_blks_res = 1; /* reserved AGCH blocks */
 	bts->si_common.chan_desc.t3212 = 5; /* Use 30 min periodic update interval as sane default */
-	set_radio_link_timeout(&bts->si_common.cell_options, 32);
-				/* Use RADIO LINK TIMEOUT of 32 seconds */
+	gsm_bts_set_radio_link_timeout(bts, 32); /* Use RADIO LINK TIMEOUT of 32 */
 
 	llist_add_tail(&bts->list, &net->bts_list);
 
@@ -435,3 +434,40 @@
 	}
 	return 1;
 }
+
+/* get the radio link timeout (based on SACCH decode errors, according
+ * to algorithm specified in TS 05.08 section 5.2.  A value of -1
+ * indicates we should use an infinitely long timeout, which only works
+ * with OsmoBTS as the BTS implementation */
+int gsm_bts_get_radio_link_timeout(const struct gsm_bts *bts)
+{
+	const struct gsm48_cell_options *cell_options = &bts->si_common.cell_options;
+
+	if (bts->infinite_radio_link_timeout)
+		return -1;
+	else {
+		/* Encoding as per Table 10.5.21 of TS 04.08 */
+		return (cell_options->radio_link_timeout + 1) << 2;
+	}
+}
+
+/* set the radio link timeout (based on SACCH decode errors, according
+ * to algorithm specified in TS 05.08 Section 5.2.  A value of -1
+ * indicates we should use an infinitely long timeout, which only works
+ * with OsmoBTS as the BTS implementation */
+void gsm_bts_set_radio_link_timeout(struct gsm_bts *bts, int value)
+{
+	struct gsm48_cell_options *cell_options = &bts->si_common.cell_options;
+
+	if (value < 0)
+		bts->infinite_radio_link_timeout = true;
+	else {
+		bts->infinite_radio_link_timeout = false;
+		/* Encoding as per Table 10.5.21 of TS 04.08 */
+		if (value < 4)
+			value = 4;
+		if (value > 64)
+			value = 64;
+		cell_options->radio_link_timeout = (value >> 2) - 1;
+	}
+}

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I6cb94e0f024934f7baeeb728ca9ed3042fbf16d2
Gerrit-PatchSet: 2
Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-Owner: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder



More information about the gerrit-log mailing list