[MERGED] openbsc[master]: Add support for Access Control Class ramping.

2018-03-15 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: Add support for Access Control Class ramping.
..


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

Port of osmo-bsc commit a5c1e8727c391bc56847a00b2ecc08787573b91f

Change-Id: Idd5c4fd7ea2e10086d9b26deee3a71f9469d1280
Related: OS#2591
---
M openbsc/include/openbsc/Makefile.am
A openbsc/include/openbsc/acc_ramp.h
M openbsc/include/openbsc/gsm_data_shared.h
M openbsc/src/libbsc/Makefile.am
A openbsc/src/libbsc/acc_ramp.c
M openbsc/src/libbsc/bsc_init.c
M openbsc/src/libbsc/bsc_vty.c
M openbsc/src/libbsc/chan_alloc.c
M openbsc/src/libbsc/system_information.c
M openbsc/src/libcommon/gsm_data_shared.c
10 files changed, 536 insertions(+), 3 deletions(-)

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



diff --git a/openbsc/include/openbsc/Makefile.am 
b/openbsc/include/openbsc/Makefile.am
index 126b115..1fa30d5 100644
--- a/openbsc/include/openbsc/Makefile.am
+++ b/openbsc/include/openbsc/Makefile.am
@@ -2,6 +2,7 @@
abis_nm.h \
abis_om2000.h \
abis_rsl.h \
+   acc_ramp.h \
arfcn_range_encode.h \
auth.h \
bsc_msc.h \
diff --git a/openbsc/include/openbsc/acc_ramp.h 
b/openbsc/include/openbsc/acc_ramp.h
new file mode 100644
index 000..cb063bf
--- /dev/null
+++ b/openbsc/include/openbsc/acc_ramp.h
@@ -0,0 +1,149 @@
+/* (C) 2018 by sysmocom s.f.m.c. GmbH 
+ *
+ * Author: Stefan Sperling 
+ *
+ * All Rights Reserved
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see .
+ *
+ */
+
+#pragma once
+
+#include 
+#include 
+
+#include 
+#include 
+
+/*!
+ * Access control class (ACC) ramping is used to slowly make the cell 
available to
+ * an increasing number of MS. This avoids overload at 

openbsc[master]: Add support for Access Control Class ramping.

2018-03-14 Thread Harald Welte

Patch Set 1: Code-Review+2

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

Gerrit-MessageType: comment
Gerrit-Change-Id: Idd5c4fd7ea2e10086d9b26deee3a71f9469d1280
Gerrit-PatchSet: 1
Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-Owner: Stefan Sperling 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-HasComments: No


[PATCH] openbsc[master]: Add support for Access Control Class ramping.

2018-03-14 Thread Stefan Sperling

Review at  https://gerrit.osmocom.org/7295

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

Port of osmo-bsc commit a5c1e8727c391bc56847a00b2ecc08787573b91f

Change-Id: Idd5c4fd7ea2e10086d9b26deee3a71f9469d1280
Related: OS#2591
---
M openbsc/include/openbsc/Makefile.am
A openbsc/include/openbsc/acc_ramp.h
M openbsc/include/openbsc/gsm_data_shared.h
M openbsc/src/libbsc/Makefile.am
A openbsc/src/libbsc/acc_ramp.c
M openbsc/src/libbsc/bsc_init.c
M openbsc/src/libbsc/bsc_vty.c
M openbsc/src/libbsc/chan_alloc.c
M openbsc/src/libbsc/system_information.c
M openbsc/src/libcommon/gsm_data_shared.c
10 files changed, 536 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/95/7295/1

diff --git a/openbsc/include/openbsc/Makefile.am 
b/openbsc/include/openbsc/Makefile.am
index 126b115..1fa30d5 100644
--- a/openbsc/include/openbsc/Makefile.am
+++ b/openbsc/include/openbsc/Makefile.am
@@ -2,6 +2,7 @@
abis_nm.h \
abis_om2000.h \
abis_rsl.h \
+   acc_ramp.h \
arfcn_range_encode.h \
auth.h \
bsc_msc.h \
diff --git a/openbsc/include/openbsc/acc_ramp.h 
b/openbsc/include/openbsc/acc_ramp.h
new file mode 100644
index 000..cb063bf
--- /dev/null
+++ b/openbsc/include/openbsc/acc_ramp.h
@@ -0,0 +1,149 @@
+/* (C) 2018 by sysmocom s.f.m.c. GmbH 
+ *
+ * Author: Stefan Sperling 
+ *
+ * All Rights Reserved
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see .
+ *
+ */
+
+#pragma once
+
+#include 
+#include 
+
+#include 
+#include 
+
+/*!
+ * 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.
+ */
+
+#define ACC_RAMP_STEP_SIZE_MIN 1 /* allow at