Change in osmo-bsc[master]: power_control: implement BCCH carrier power reduction operation

fixeria gerrit-no-reply at lists.osmocom.org
Mon Jul 5 12:17:59 UTC 2021


fixeria has submitted this change. ( https://gerrit.osmocom.org/c/osmo-bsc/+/24777 )

Change subject: power_control: implement BCCH carrier power reduction operation
......................................................................

power_control: implement BCCH carrier power reduction operation

The BCCH carrier (sometimes called C0) of a BTS shall maintain
discontinuous Downlink transmission at full power in order to
stay 'visible' to the mobile stations.  Because of that, early
versions of 3GPP TS 45.008 prohibited BS power reduction on C0.

However, starting from version 13.0.0 (2015-11) there is a feature
called 'BCCH carrier power reduction operation'.  This is a special
mode of operation, where the variation of RF level for some
timeslots is relaxed for the purpose of energy saving.

In BCCH carrier power reduction operation, for timeslots on the
C0 carrier, except timeslots carrying BCCH/CCCH, the output power
may be lower than the output power used for timeslots carrying
BCCH/CCCH.  In this case the maximum allowed difference in output
power actually transmitted by the BTS is 6 dB.

Introduce a VTY command to turn on and off the BCCH carrier power
reduction operation.  Also introduce a CTRL command.  On the
A-bis/RSL, abuse the BS POWER CONTROL message by setting
the Channel Number IE to 0x80 (RSL_CHAN_BCCH).

Currently, only osmo-bts-trx is supported.  A value greater than
zero makes it reduce the power on *inactive* timeslots of the
BCCH carrier.  Sending zero disables the BCCH power reduction
mode completely.

For more details, see 3GPP TS 45.008, section 7.1, and 3GPP TR 45.926.

Change-Id: I047fce33d4d3e4c569dd006ba17858467a2f4783
Related: SYS#4919
---
M doc/manuals/chapters/power_control.adoc
M include/osmocom/bsc/bts.h
M src/osmo-bsc/bsc_ctrl_commands.c
M src/osmo-bsc/bsc_vty.c
M src/osmo-bsc/bts.c
M src/osmo-bsc/bts_osmobts.c
M tests/osmo-bsc.vty
7 files changed, 235 insertions(+), 1 deletion(-)

Approvals:
  laforge: Looks good to me, but someone else must approve
  fixeria: Looks good to me, approved
  Hoernchen: Looks good to me, but someone else must approve
  Jenkins Builder: Verified



diff --git a/doc/manuals/chapters/power_control.adoc b/doc/manuals/chapters/power_control.adoc
index 4c1a275..bb87c85 100644
--- a/doc/manuals/chapters/power_control.adoc
+++ b/doc/manuals/chapters/power_control.adoc
@@ -327,3 +327,84 @@
 // TODO: Document other power control parameters:
 //		OsmoBSC(config-net-bts)# ms max power <0-40>
 //		OsmoBSC(config-net-bts-trx)# max_power_red <0-100>
+
+=== BCCH carrier power reduction operation
+
+According to 3GPP TS 45.008, section 7.1, the BCCH carrier (sometimes called C0) of
+a BTS shall maintain continuous Downlink transmission at full power in order to
+stay "visible" to the mobile stations.  Because of that, early versions of this 3GPP
+document prohibited BS power reduction on C0.  However, a new feature was introduced
+in version 13.0.0 (2015-11) - "BCCH carrier power reduction operation".
+
+This is a special mode of operation, in which the variation of RF power level for
+some timeslots is relaxed for the purpose of energy saving.  In other words, the
+output power on some timeslots, except the timeslot(s) carrying BCCH/CCCH, can be
+lower than the full power.  In this case the maximum allowed difference is 6 dB.
+
+Of course, energy saving comes at a price and has impacts to the network KPI.  In
+particular, it does negatively affect cell reselection performance and does increase
+handover failure and call drop rates.  This is why BCCH carrier power reduction
+operation mode is not enabled by default.  More information on potential impact
+and the simulation results can be found in 3GPP TR 45.926.
+
+==== Supported BTS models
+
+At the time of writing this manual, the only BTS model that can be instructed to
+enter or leave the BCCH power reduction mode is osmo-bts-trx.  Support for other
+BTS vendors/models may be added in the future.
+
+TIP: If you're using OsmoBTS, make sure that it reports feature #021 "BCCH carrier
+power reduction mode" in the feature vector.  This can be checked by issuing
+`show bts` command in OsmoBSC's VTY interface.
+
+==== Managing BCCH carrier power reduction
+
+The BCCH carrier power reduction can be controlled via the CTRL and VTY interfaces.
+There is currently no logic in OsmoBSC for automatic activation and deactivation
+of this mode, so it's up to the network operator (or an external monitoring suite)
+when and depending on which factors to toggle it.  Setting a value greater than
+zero enables the BCCH power reduction mode;  setting zero disables it completely.
+
+.Example: Activating BCCH carrier power reduction via the VTY
+----
+OsmoBSC> enable
+OsmoBSC# bts 0 <1> c0-power-reduction ?
+  <0-6>  Power reduction value (in dB, even numbers only)
+OsmoBSC# bts 0 <1> c0-power-reduction 4 <2>
+----
+<1> BTS number for which to activate BCCH carrier power reduction
+<2> Maximum BCCH carrier power reduction (in 2 dB steps, 4 dB in this example)
+
+.Example: Activating BCCH carrier power reduction via the CTRL
+----
+$ osmo_ctrl.py \
+	--host 127.0.0.1 <1> -p 4249 \
+	--set "bts.0.c0-power-reduction" 4 <2>
+----
+<1> Remote address of the host running osmo-bsc (localhost in this example)
+<2> Maximum BCCH carrier power reduction (in 2 dB steps, 4 dB in this example)
+
+Once activated, it's possible to introspect the current maximum reduction value:
+
+.Example: Checking BCCH carrier power reduction state via the VTY
+----
+OsmoBSC> enable
+OsmoBSC# show bts 0 <1>
+BTS 0 is of osmo-bts type in band DCS1800, has CI 0 LAC 1, BSIC 63 (NCC=7, BCC=7) and 2 TRX
+  Description: (null)
+  ARFCNs: 751 753
+  BCCH carrier power reduction (maximum): 4 dB <2>
+  ...
+----
+<1> BTS number for which to show BCCH carrier power reduction state
+<2> Maximum BCCH carrier power reduction currently applied
+
+.Example: Checking BCCH carrier power reduction state via the CTRL
+----
+$ osmo_ctrl.py \
+	--host 127.0.0.1 <1> -p 4249 \
+	--get "bts.0.c0-power-reduction"
+Got message: b'GET_REPLY 3652121201381481804 bts.0.c0-power-reduction 4 <2>'
+----
+<1> Remote address of the host running osmo-bsc (localhost in this example)
+<2> Maximum BCCH carrier power reduction currently applied
diff --git a/include/osmocom/bsc/bts.h b/include/osmocom/bsc/bts.h
index 49691e0..65c3be5 100644
--- a/include/osmocom/bsc/bts.h
+++ b/include/osmocom/bsc/bts.h
@@ -236,6 +236,8 @@
 	int (*power_ctrl_enc_rsl_params)(struct msgb *msg, const struct gsm_power_ctrl_params *cp);
 	/* (Optional) function for sending default MS/BS Power Control paramaters */
 	int (*power_ctrl_send_def_params)(const struct gsm_bts_trx *trx);
+	/* (Optional) function for toggling BCCH carrier power reduction operation */
+	int (*power_ctrl_set_c0_power_red)(const struct gsm_bts *bts, const uint8_t red);
 
 	void (*config_write_bts)(struct vty *vty, struct gsm_bts *bts);
 	void (*config_write_trx)(struct vty *vty, struct gsm_bts_trx *trx);
@@ -543,6 +545,9 @@
 	struct gsm_power_ctrl_params ms_power_ctrl;
 	struct gsm_power_ctrl_params bs_power_ctrl;
 
+	/* Maximum BCCH carrier power reduction */
+	uint8_t c0_max_power_red_db;
+
 	/* Interference Measurement Parameters */
 	struct gsm_interf_meas_params interf_meas_params;
 
@@ -691,6 +696,8 @@
 
 int gsm_bts_set_system_infos(struct gsm_bts *bts);
 
+int gsm_bts_set_c0_power_red(struct gsm_bts *bts, const uint8_t red);
+
 int gsm_bts_model_register(struct gsm_bts_model *model);
 struct gsm_bts_model *bts_model_find(enum gsm_bts_type type);
 
diff --git a/src/osmo-bsc/bsc_ctrl_commands.c b/src/osmo-bsc/bsc_ctrl_commands.c
index 15f5536..be83b1b 100644
--- a/src/osmo-bsc/bsc_ctrl_commands.c
+++ b/src/osmo-bsc/bsc_ctrl_commands.c
@@ -550,6 +550,54 @@
 }
 CTRL_CMD_DEFINE(trx_max_power, "max-power-reduction");
 
+static int verify_bts_c0_power_red(struct ctrl_cmd *cmd, const char *value, void *_data)
+{
+	const int red = atoi(value);
+
+	if (red < 0 || red > 6) {
+		cmd->reply = "Value is out of range";
+		return 1;
+	} else if (red % 2 != 0) {
+		cmd->reply = "Value must be even";
+		return 1;
+	}
+
+	return 0;
+}
+
+static int get_bts_c0_power_red(struct ctrl_cmd *cmd, void *data)
+{
+	const struct gsm_bts *bts = cmd->node;
+
+	cmd->reply = talloc_asprintf(cmd, "%u", bts->c0_max_power_red_db);
+	if (!cmd->reply) {
+		cmd->reply = "OOM.";
+		return CTRL_CMD_ERROR;
+	}
+
+	return CTRL_CMD_REPLY;
+}
+
+static int set_bts_c0_power_red(struct ctrl_cmd *cmd, void *data)
+{
+	struct gsm_bts *bts = cmd->node;
+	const int red = atoi(cmd->value);
+	int rc;
+
+	rc = gsm_bts_set_c0_power_red(bts, red);
+	if (rc == -ENOTSUP) {
+		cmd->reply = "BCCH carrier power reduction is not supported";
+		return CTRL_CMD_ERROR;
+	} else if (rc != 0) {
+		cmd->reply = "Failed to enable BCCH carrier power reduction";
+		return CTRL_CMD_ERROR;
+	}
+
+	return get_bts_c0_power_red(cmd, data);
+}
+
+CTRL_CMD_DEFINE(bts_c0_power_red, "c0-power-reduction");
+
 int bsc_base_ctrl_cmds_install(void)
 {
 	int rc = 0;
@@ -571,6 +619,7 @@
 	rc |= ctrl_cmd_install(CTRL_NODE_BTS, &cmd_bts_oml_up);
 	rc |= ctrl_cmd_install(CTRL_NODE_BTS, &cmd_bts_gprs_mode);
 	rc |= ctrl_cmd_install(CTRL_NODE_BTS, &cmd_bts_rf_state);
+	rc |= ctrl_cmd_install(CTRL_NODE_BTS, &cmd_bts_c0_power_red);
 
 	rc |= ctrl_cmd_install(CTRL_NODE_TRX, &cmd_trx_max_power);
 	rc |= ctrl_cmd_install(CTRL_NODE_TRX, &cmd_trx_arfcn);
diff --git a/src/osmo-bsc/bsc_vty.c b/src/osmo-bsc/bsc_vty.c
index 7207341..efa59d3 100644
--- a/src/osmo-bsc/bsc_vty.c
+++ b/src/osmo-bsc/bsc_vty.c
@@ -444,6 +444,8 @@
 	if (strnlen(bts->pcu_version, MAX_VERSION_LENGTH))
 		vty_out(vty, "  PCU version %s connected%s", bts->pcu_version,
 			VTY_NEWLINE);
+	vty_out(vty, "  BCCH carrier power reduction (maximum): %u dB%s",
+		bts->c0_max_power_red_db, VTY_NEWLINE);
 	vty_out(vty, "  MS Max power: %u dBm%s", bts->ms_max_power, VTY_NEWLINE);
 	vty_out(vty, "  Minimum Rx Level for Access: %i dBm%s",
 		rxlev2dbm(bts->si_common.cell_sel_par.rxlev_acc_min),
@@ -6020,6 +6022,45 @@
 	return CMD_SUCCESS;
 }
 
+DEFUN(bts_c0_power_red,
+      bts_c0_power_red_cmd,
+      "bts <0-255> c0-power-reduction <0-6>",
+      "BTS Specific Commands\n" BTS_NR_STR
+      "BCCH carrier power reduction operation\n"
+      "Power reduction value (in dB, even numbers only)\n")
+{
+	int bts_nr = atoi(argv[0]);
+	int red = atoi(argv[1]);
+	struct gsm_bts *bts;
+	int rc;
+
+	bts = gsm_bts_num(gsmnet_from_vty(vty), bts_nr);
+	if (!bts) {
+		vty_out(vty, "%% No such BTS (%d)%s", bts_nr, VTY_NEWLINE);
+		return CMD_WARNING;
+	}
+
+	if (red % 2 != 0) {
+		vty_out(vty, "%% Incorrect BCCH power reduction value, "
+			"an even number is expected%s", VTY_NEWLINE);
+		return CMD_WARNING;
+	}
+
+	rc = gsm_bts_set_c0_power_red(bts, red);
+	if (rc == -ENOTSUP) {
+		vty_out(vty, "%% BCCH carrier power reduction operation mode "
+			"is not supported for BTS%u%s", bts_nr, VTY_NEWLINE);
+		return CMD_WARNING;
+	} else if (rc != 0) {
+		vty_out(vty, "%% Failed to %sable BCCH carrier power reduction "
+			"operation mode for BTS%u%s", red ? "en" : "dis",
+			bts_nr, VTY_NEWLINE);
+		return CMD_WARNING;
+	}
+
+	return CMD_SUCCESS;
+}
+
 /* this command is now hidden, as it's a low-level debug hack, and people should
  * instead use osmo-cbc these days */
 DEFUN_HIDDEN(smscb_cmd, smscb_cmd_cmd,
@@ -8172,6 +8213,7 @@
 	install_element(ENABLE_NODE, &restart_bts_cmd);
 	install_element(ENABLE_NODE, &bts_resend_sysinfo_cmd);
 	install_element(ENABLE_NODE, &bts_resend_power_ctrl_params_cmd);
+	install_element(ENABLE_NODE, &bts_c0_power_red_cmd);
 	install_element(ENABLE_NODE, &pdch_act_cmd);
 	install_element(ENABLE_NODE, &lchan_act_cmd);
 	install_element(ENABLE_NODE, &lchan_act_all_cmd);
diff --git a/src/osmo-bsc/bts.c b/src/osmo-bsc/bts.c
index b64890f..c1f09ff 100644
--- a/src/osmo-bsc/bts.c
+++ b/src/osmo-bsc/bts.c
@@ -1,5 +1,5 @@
 /* (C) 2008-2018 by Harald Welte <laforge at gnumonks.org>
- * (C) 2020 by sysmocom s.f.m.c. GmbH <info at sysmocom.de>
+ * (C) 2021 by sysmocom s.f.m.c. GmbH <info at sysmocom.de>
  *
  * All Rights Reserved
  *
@@ -747,6 +747,24 @@
 	return 0;
 }
 
+int gsm_bts_set_c0_power_red(struct gsm_bts *bts, const uint8_t red)
+{
+	int rc;
+
+	if (!osmo_bts_has_feature(&bts->features, BTS_FEAT_BCCH_POWER_RED))
+		return -ENOTSUP;
+	if (bts->model->power_ctrl_set_c0_power_red == NULL)
+		return -ENOTSUP;
+
+	rc = bts->model->power_ctrl_set_c0_power_red(bts, red);
+	if (rc != 0)
+		return rc;
+
+	bts->c0_max_power_red_db = red;
+
+	return 0;
+}
+
 const struct rate_ctr_desc bts_ctr_description[] = {
 	[BTS_CTR_CHREQ_TOTAL] = \
 		{ "chreq:total",
diff --git a/src/osmo-bsc/bts_osmobts.c b/src/osmo-bsc/bts_osmobts.c
index 1814ada..9813a26 100644
--- a/src/osmo-bsc/bts_osmobts.c
+++ b/src/osmo-bsc/bts_osmobts.c
@@ -1,6 +1,7 @@
 /* Osmocom OsmoBTS specific code */
 
 /* (C) 2010-2012 by Harald Welte <laforge at gnumonks.org>
+ * (C) 2021 by sysmocom - s.m.f.c. GmbH <info at sysmocom.de>
  *
  * All Rights Reserved
  *
@@ -43,6 +44,35 @@
 
 static struct gsm_bts_model model_osmobts;
 
+static int power_ctrl_set_c0_power_red(const struct gsm_bts *bts,
+				       const uint8_t red)
+{
+	struct abis_rsl_dchan_hdr *dh;
+	struct msgb *msg;
+
+	msg = rsl_msgb_alloc();
+	if (msg == NULL)
+		return -ENOMEM;
+
+	LOGP(DRSL, LOGL_NOTICE, "%sabling BCCH carrier power reduction "
+	     "operation mode for BTS%u (maximum %u dB)\n",
+	     red ? "En" : "Dis", bts->nr, red);
+
+	/* Abuse the standard BS POWER CONTROL message by specifying 'Common Channel'
+	 * in the Protocol Discriminator field and 'BCCH' in the Channel Number IE. */
+	dh = (struct abis_rsl_dchan_hdr *) msgb_put(msg, sizeof(*dh));
+	dh->c.msg_discr = ABIS_RSL_MDISC_COM_CHAN;
+	dh->c.msg_type = RSL_MT_BS_POWER_CONTROL;
+	dh->ie_chan = RSL_IE_CHAN_NR;
+	dh->chan_nr = RSL_CHAN_BCCH;
+
+	msgb_tv_put(msg, RSL_IE_BS_POWER, red / 2);
+
+	msg->dst = bts->c0->rsl_link_primary;
+
+	return abis_rsl_sendmsg(msg);
+}
+
 int bts_model_osmobts_init(void)
 {
 	model_osmobts = bts_model_nanobts;
@@ -52,6 +82,9 @@
 	/* Unlike nanoBTS, osmo-bts does support SI2bis and SI2ter fine */
 	model_osmobts.force_combined_si = false;
 
+	/* Power control API */
+	model_osmobts.power_ctrl_set_c0_power_red = &power_ctrl_set_c0_power_red;
+
 	model_osmobts.features.data = &model_osmobts._features_data[0];
 	model_osmobts.features.data_len =
 				sizeof(model_osmobts._features_data);
diff --git a/tests/osmo-bsc.vty b/tests/osmo-bsc.vty
index 48f3f0b..22e2a06 100644
--- a/tests/osmo-bsc.vty
+++ b/tests/osmo-bsc.vty
@@ -46,10 +46,14 @@
 OsmoBSC# bts 0 ?
   resend-system-information      Re-generate + re-send BCCH SYSTEM INFORMATION
   resend-power-control-defaults  Re-generate + re-send default MS/BS Power control parameters
+  c0-power-reduction             BCCH carrier power reduction operation
   trx                            TRX for manual command
   oml                            Manipulate the OML managed objects
   om2000                         Manipulate the OM2000 managed objects
 
+OsmoBSC# bts 0 c0-power-reduction ?
+  <0-6>  Power reduction value (in dB, even numbers only)
+
 OsmoBSC# bts 0 trx ?
   <0-255>  TRX Number
 

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/24777
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I047fce33d4d3e4c569dd006ba17858467a2f4783
Gerrit-Change-Number: 24777
Gerrit-PatchSet: 5
Gerrit-Owner: fixeria <vyanitskiy at sysmocom.de>
Gerrit-Reviewer: Hoernchen <ewild at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy at sysmocom.de>
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-Reviewer: neels <nhofmeyr at sysmocom.de>
Gerrit-CC: pespin <pespin at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210705/0cee422a/attachment.htm>


More information about the gerrit-log mailing list