aboutsummaryrefslogtreecommitdiffstats
path: root/src/libbsc/bsc_init.c
diff options
context:
space:
mode:
authorStefan Sperling <ssperling@sysmocom.de>2018-02-06 14:44:54 +0100
committerHarald Welte <laforge@gnumonks.org>2018-02-27 14:29:39 +0000
commit6442e4327b1100ecfed7a242e397ac37b7529bea (patch)
tree1e8a746b0dab435768834e256a6054dc04191308 /src/libbsc/bsc_init.c
parent5d22458169a39be6afa993a4c09899a72822cc84 (diff)
Add support for Access Control Class ramping.
Access Control Class (ACC) ramping is used to slowly make the cell available to an increasing number of MS. This avoids overload at startup time in cases where a lot of MS would discover the new cell and try to connect to it all at once. Ramping behaviour can be configured with new VTY commands: [no] access-control-class-ramping access-control-class-ramping-step-interval (<30-600>|dynamic) access-control-class-ramping-step-size (<1-10>) (The minimum and maximum values for these parameters are hard-coded, but could be changed if they are found to be inadequate.) The VTY command 'show bts' has been extended to display the current ACC ramping configuration. By default, ACC ramping is disabled. When enabled, the default behaviour is to enable one ACC per ramping step with a 'dynamic' step interval. This means the ramping interval (time between steps) is scaled to the channel load average of the BTS, i.e. the number of used vs. available channels measured over a certain amount of time. Below is an example of debug log output with ACC ramping enabled, while many 'mobile' programs are concurrently trying to connect to the network via an osmo-bts-virtual BTS. Initially, all ACCs are barred, and then only one class is allowed. Then the current BTS channel load average is consulted for scheduling the next ramping step. While the channel load average is low, ramping proceeds faster, and while it is is high, ramping proceeds slower: (bts=0) ACC RAMP: barring Access Control Class 0 (bts=0) ACC RAMP: barring Access Control Class 1 (bts=0) ACC RAMP: barring Access Control Class 2 (bts=0) ACC RAMP: barring Access Control Class 3 (bts=0) ACC RAMP: barring Access Control Class 4 (bts=0) ACC RAMP: barring Access Control Class 5 (bts=0) ACC RAMP: barring Access Control Class 6 (bts=0) ACC RAMP: barring Access Control Class 7 (bts=0) ACC RAMP: barring Access Control Class 8 (bts=0) ACC RAMP: barring Access Control Class 9 (bts=0) ACC RAMP: allowing Access Control Class 0 (bts=0) ACC RAMP: step interval set to 30 seconds based on 0% channel load average (bts=0) ACC RAMP: allowing Access Control Class 1 (bts=0) ACC RAMP: step interval set to 354 seconds based on 59% channel load average (bts=0) ACC RAMP: allowing Access Control Class 2 (bts=0) ACC RAMP: step interval set to 30 seconds based on 0% channel load average (bts=0) ACC RAMP: allowing Access Control Class 3 (bts=0) ACC RAMP: step interval set to 30 seconds based on 0% channel load average Change-Id: I0a5ac3a08f992f326435944f17e0a9171911afb0 Related: OS#2591
Diffstat (limited to 'src/libbsc/bsc_init.c')
-rw-r--r--src/libbsc/bsc_init.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/libbsc/bsc_init.c b/src/libbsc/bsc_init.c
index 2b1d53bbb..2fddc80e1 100644
--- a/src/libbsc/bsc_init.c
+++ b/src/libbsc/bsc_init.c
@@ -331,6 +331,12 @@ static void bootstrap_rsl(struct gsm_bts_trx *trx)
bsc_gsmnet->network_code, trx->bts->location_area_code,
trx->bts->cell_identity, trx->bts->bsic);
+ /*
+ * Re-initialize ACC ramping to ensure ACCs are barred/allowed
+ * according to our current VTY configuration.
+ */
+ acc_ramp_init(&trx->bts->acc_ramp, acc_ramp_is_enabled(&trx->bts->acc_ramp), trx->bts);
+
if (trx->bts->type == GSM_BTS_TYPE_NOKIA_SITE) {
rsl_nokia_si_begin(trx);
}
@@ -345,6 +351,9 @@ static void bootstrap_rsl(struct gsm_bts_trx *trx)
for (i = 0; i < ARRAY_SIZE(trx->ts); i++)
generate_ma_for_ts(&trx->ts[i]);
+
+ if (acc_ramp_is_enabled(&trx->bts->acc_ramp))
+ acc_ramp_start(&trx->bts->acc_ramp);
}
/* Callback function to be called every time we receive a signal from INPUT */
@@ -400,8 +409,10 @@ static int inp_sig_cb(unsigned int subsys, unsigned int signal,
if (isd->link_type == E1INP_SIGN_OML)
rate_ctr_inc(&trx->bts->bts_ctrs->ctr[BTS_CTR_BTS_OML_FAIL]);
- else if (isd->link_type == E1INP_SIGN_RSL)
+ else if (isd->link_type == E1INP_SIGN_RSL) {
rate_ctr_inc(&trx->bts->bts_ctrs->ctr[BTS_CTR_BTS_RSL_FAIL]);
+ acc_ramp_abort(&trx->bts->acc_ramp);
+ }
/*
* free all allocated channels. change the nm_state so the
@@ -525,6 +536,8 @@ static int bootstrap_bts(struct gsm_bts *bts)
bts->chan_load_samples_idx = 0;
+ acc_ramp_init(&bts->acc_ramp, false, bts);
+
/* Initialize the BTS state */
gsm_bts_mo_reset(bts);