aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorarehbein <arehbein@sysmocom.de>2022-12-12 19:56:59 +0100
committerpespin <pespin@sysmocom.de>2023-01-23 09:59:36 +0000
commit9ff26123b3d6055fd124934d0a2bbecc70a9a24a (patch)
tree5d045493143187054554bb26ba1ba71812416ffb
parent8c8905302fddbdd9583762ac53e865558ae42fbc (diff)
vty: Add support for Ny1 configuration
-rw-r--r--include/osmocom/bsc/gsm_data.h11
-rw-r--r--src/osmo-bsc/bts_ipaccess_nanobts_omlattr.c4
-rw-r--r--src/osmo-bsc/net_init.c4
-rw-r--r--tests/nanobts_omlattr/nanobts_omlattr_test.c40
-rw-r--r--tests/nanobts_omlattr/nanobts_omlattr_test.ok4
-rw-r--r--tests/timer.vty2
6 files changed, 50 insertions, 15 deletions
diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h
index 9300dfa70..44a9d5e05 100644
--- a/include/osmocom/bsc/gsm_data.h
+++ b/include/osmocom/bsc/gsm_data.h
@@ -40,6 +40,17 @@
#define GSM_T3122_DEFAULT 10
+#define GSM_T3105_DEFAULT 100UL
+#define GSM_T3124_SDCCH 675UL
+#define GSM_T3124_OTHER_CH 320UL
+#define GSM_T3124_MAX GSM_T3124_SDCCH
+
+/* Some guess for delta (see comment below) */
+#define GSM_NY1_REQ_DELTA 1000UL
+/* Requirements: We want Ny1 to be as low as possible, while respecting T3105 * Ny1 > T3124 + delta
+ * with delta = time between expiration of T3124 and receiving HANDOVER FAILURE by the serving BSC. */
+#define GSM_NY1_DEFAULT ((unsigned long)((GSM_T3124_MAX + GSM_NY1_REQ_DELTA)/GSM_T3105_DEFAULT + 1))
+
struct mgcp_client_conf;
struct mgcp_client;
struct gsm0808_cell_id;
diff --git a/src/osmo-bsc/bts_ipaccess_nanobts_omlattr.c b/src/osmo-bsc/bts_ipaccess_nanobts_omlattr.c
index 4fa69fb2a..14451f8f4 100644
--- a/src/osmo-bsc/bts_ipaccess_nanobts_omlattr.c
+++ b/src/osmo-bsc/bts_ipaccess_nanobts_omlattr.c
@@ -91,8 +91,8 @@ struct msgb *nanobts_gen_set_bts_attr(struct gsm_bts *bts)
/* BTS Air Timer (3GPP TS 12.21 sec 9.4.10), 10 milliseconds */
msgb_tv_put(msgb, NM_ATT_BTS_AIR_TIMER, osmo_tdef_get(bts->network->T_defs, 3105, OSMO_TDEF_MS, -1)/10);
- /* NY1 (3GPP TS 12.21 sec 9.4.37), 10 retransmissions of physical config */
- msgb_tv_put(msgb, NM_ATT_NY1, 10);
+ /* NY1 (3GPP TS 12.21 sec 9.4.37), number of retransmissions of physical config */
+ msgb_tv_put(msgb, NM_ATT_NY1, osmo_tdef_get(bts->network->T_defs, -3105, OSMO_TDEF_CUSTOM, -1));
/* BCCH ARFCN (3GPP TS 12.21 sec 9.4.8) */
buf[0] = (bts->c0->arfcn >> 8) & 0x0f;
diff --git a/src/osmo-bsc/net_init.c b/src/osmo-bsc/net_init.c
index ad2f8c412..8a508dd61 100644
--- a/src/osmo-bsc/net_init.c
+++ b/src/osmo-bsc/net_init.c
@@ -36,7 +36,7 @@ static struct osmo_tdef gsm_network_T_defs[] = {
{ .T = 101, .default_val = 10, .desc = "inter-BSC/MSC Handover incoming, BSSMAP HO Request to HO Accept" },
{ .T = 3101, .default_val = 3, .desc = "RR Immediate Assignment" },
{ .T = 3103, .default_val = 5, .desc = "Handover" },
- { .T = 3105, .default_val = 100, .unit = OSMO_TDEF_MS, .desc = "Physical Information" },
+ { .T = 3105, .default_val = GSM_T3105_DEFAULT, .unit = OSMO_TDEF_MS, .desc = "Physical Information" },
{ .T = 3107, .default_val = 5, .desc = "(unused)" },
{ .T = 3109, .default_val = 5, .desc = "RSL SACCH deactivation" },
{ .T = 3111, .default_val = 2, .desc = "Wait time before RSL RF Channel Release" },
@@ -74,6 +74,8 @@ static struct osmo_tdef gsm_network_T_defs[] = {
" after this amount of idle time, forget internally cumulated time remainders. Zero to always"
" keep remainders. See also X16, X17." },
{ .T = -25, .default_val = 5, .desc = "Timeout for initial user data after an MSC initiated an SCCP connection to the BSS" },
+ { .T = -3105, .default_val = GSM_NY1_DEFAULT, .unit = OSMO_TDEF_CUSTOM,
+ .desc = "Ny1: Maximum number of Physical Information (re)transmissions" },
{ .T = -3111, .default_val = 4, .desc = "Wait time after lchan was released in error (should be T3111 + 2s)" },
{ .T = -3113, .default_val = PAGING_THRESHOLD_X3113_DEFAULT_SEC,
.desc = "Maximum Paging Request Transmit Delay Threshold: " \
diff --git a/tests/nanobts_omlattr/nanobts_omlattr_test.c b/tests/nanobts_omlattr/nanobts_omlattr_test.c
index 356932782..ba58e45ad 100644
--- a/tests/nanobts_omlattr/nanobts_omlattr_test.c
+++ b/tests/nanobts_omlattr/nanobts_omlattr_test.c
@@ -25,6 +25,7 @@
#include <osmocom/bsc/bts.h>
#include <osmocom/core/talloc.h>
+#include <osmocom/core/tdef.h>
#include <osmocom/core/utils.h>
#include <osmocom/core/application.h>
#include <osmocom/core/sockaddr_str.h>
@@ -125,9 +126,11 @@ static const struct log_info log_info = {
};
static struct osmo_tdef gsm_network_T_defs[] = {
- { .T = 3105, .default_val = 100, .val = 13, .unit = OSMO_TDEF_MS, .desc = "Physical Information" },
- { .T = 3212, .default_val = 5, .unit = OSMO_TDEF_CUSTOM,
+ { .T = 3105, .default_val = GSM_T3105_DEFAULT, .val = GSM_T3105_DEFAULT, .min_val = 0, .max_val = UINT8_MAX, .unit = OSMO_TDEF_MS, .desc = "Physical Information" },
+ { .T = 3212, .default_val = 5, .unit = OSMO_TDEF_CUSTOM, .min_val = 0, .max_val = UINT8_MAX,
.desc = "Periodic Location Update timer, sent to MS (1 = 6 minutes)" },
+ { .T = -3105, .default_val = GSM_NY1_DEFAULT, .val = GSM_NY1_DEFAULT, .min_val = 0, .max_val = UINT8_MAX, .unit = OSMO_TDEF_CUSTOM,
+ .desc = "Ny1: Maximum number of Physical Information (re)transmissions" },
{}
};
@@ -163,14 +166,31 @@ int main(int argc, char **argv)
bts->location_area_code = 0x0001;
bts->gprs.rac = 0;
uint8_t attr_bts_expected[] =
- { 0x19, 0x73, 0x6d, 0x67, 0x61, 0x5b, 0x55, 0x18, 0x06, 0x0e, 0x00,
- 0x02, 0x01, 0x20, 0x33, 0x1e, 0x24, 0x24, 0xa8, 0x34, 0x21,
- 0xa8, 0x1f, 0x3f, 0x25,
- 0x00, 0x01, 0x0a, 0x0c, 0x0a, 0x0b, 0x01, 0x2a, 0x5a, 0x2b,
- 0x03, 0xe8, 0x0a, 0x01,
- 0x23, 0x0a, 0x08, 0x03, 0x62, 0x09, 0x3f, 0x99, 0x00, 0x07,
- 0x00, 0xf1, 0x10, 0x00,
- 0x01, 0x05, 0x39
+ { 0x19, 0x73, 0x6d, 0x67, 0x61, 0x5b, 0x55,
+ /* 0x18 Intave Parameter */
+ 0x18, 0x06,
+ /* 0x0e: Connection Failure Criterion, rlt == 0x20 */
+ 0x0e, 0x00, 0x02, 0x01, 0x20,
+ /* 0x33: T200 */
+ 0x33, 0x1e, 0x24, 0x24, 0xa8, 0x34, 0x21, 0xa8,
+ /* 0x1f: Max Timing Advance */
+ 0x1f, 0x3f,
+ /* 0x25: Overload Period */
+ 0x25, 0x00, 0x01, 0x0a,
+ /* 0x0c CCCH Load Threshold */
+ 0x0c, 0x0a,
+ /* 0x0b CCCH Load Indication Period */
+ 0x0b, 0x01,
+ /* 0x2a: RACH Busy Threshold */
+ 0x2a, 0x5a,
+ /* 0x2b: RACH Load Averaging Slots */
+ 0x2b, 0x03, 0xe8,
+ /* 0x0a: BTS Air Timer */
+ 0x0a, 0x0a,
+ /* Ny1 */
+ 0x23, 0x11,
+ 0x08, 0x03, 0x62, 0x09, 0x3f, 0x99, 0x00, 0x07,
+ 0x00, 0xf1, 0x10, 0x00, 0x01, 0x05, 0x39
};
/* Parameters needed to test nanobts_gen_set_nse_attr() */
diff --git a/tests/nanobts_omlattr/nanobts_omlattr_test.ok b/tests/nanobts_omlattr/nanobts_omlattr_test.ok
index b011ed462..5f907691e 100644
--- a/tests/nanobts_omlattr/nanobts_omlattr_test.ok
+++ b/tests/nanobts_omlattr/nanobts_omlattr_test.ok
@@ -1,6 +1,6 @@
Testing nanobts_gen_set_bts_attr()...
-result= 19736d67615b5518060e00020120331e2424a83421a81f3f2500010a0c0a0b012a5a2b03e80a01230a080362093f99000700f11000010539
-expected=19736d67615b5518060e00020120331e2424a83421a81f3f2500010a0c0a0b012a5a2b03e80a01230a080362093f99000700f11000010539
+result= 19736d67615b5518060e00020120331e2424a83421a81f3f2500010a0c0a0b012a5a2b03e80a0a2311080362093f99000700f11000010539
+expected=19736d67615b5518060e00020120331e2424a83421a81f3f2500010a0c0a0b012a5a2b03e80a0a2311080362093f99000700f11000010539
ok.
Testing nanobts_gen_set_nse_attr()...
diff --git a/tests/timer.vty b/tests/timer.vty
index 9573a0922..6d6efe824 100644
--- a/tests/timer.vty
+++ b/tests/timer.vty
@@ -34,6 +34,7 @@ net: X16 = 1000 ms Granularity for all_allocated:* rate counters: amount of mill
net: X17 = 0 ms Rounding threshold for all_allocated:* rate counters: round up to the next counter increment after this many milliseconds. If set to half of X16 (or 0), employ the usual round() behavior: round up after half of a granularity period. If set to 1, behave like ceil(): already increment the counter immediately when all channels are allocated. If set >= X16, behave like floor(): only increment after a full X16 period of all channels being occupied. See also X16, X18 (default: 0 ms)
net: X18 = 60000 ms Forget-sum period for all_allocated:* rate counters: after this amount of idle time, forget internally cumulated time remainders. Zero to always keep remainders. See also X16, X17. (default: 60000 ms)
net: X25 = 5 s Timeout for initial user data after an MSC initiated an SCCP connection to the BSS (default: 5 s)
+net: X3105 = 17 Ny1: Maximum number of Physical Information (re)transmissions (default: 17)
net: X3111 = 4 s Wait time after lchan was released in error (should be T3111 + 2s) (default: 4 s)
net: X3113 = 60 s Maximum Paging Request Transmit Delay Threshold: If the estimated transmit delay of the messages in the paging queue surpasses this threshold, then new incoming paging requests will if possible replace a request in retransmission state from the queue or otherwise be discarded, hence limiting the size of the queue and maximum delay of its scheduled requests. X3113 also serves as the upper boundary for dynamic T3113 when estimating the expected maximum delay to get a response (default: 60 s)
net: X3210 = 20 s After L3 Complete, wait for MSC to confirm (default: 20 s)
@@ -89,6 +90,7 @@ net: X16 = 1000 ms Granularity for all_allocated:* rate counters: amount of mill
net: X17 = 0 ms Rounding threshold for all_allocated:* rate counters: round up to the next counter increment after this many milliseconds. If set to half of X16 (or 0), employ the usual round() behavior: round up after half of a granularity period. If set to 1, behave like ceil(): already increment the counter immediately when all channels are allocated. If set >= X16, behave like floor(): only increment after a full X16 period of all channels being occupied. See also X16, X18 (default: 0 ms)
net: X18 = 60000 ms Forget-sum period for all_allocated:* rate counters: after this amount of idle time, forget internally cumulated time remainders. Zero to always keep remainders. See also X16, X17. (default: 60000 ms)
net: X25 = 5 s Timeout for initial user data after an MSC initiated an SCCP connection to the BSS (default: 5 s)
+net: X3105 = 17 Ny1: Maximum number of Physical Information (re)transmissions (default: 17)
net: X3111 = 4 s Wait time after lchan was released in error (should be T3111 + 2s) (default: 4 s)
net: X3113 = 60 s Maximum Paging Request Transmit Delay Threshold: If the estimated transmit delay of the messages in the paging queue surpasses this threshold, then new incoming paging requests will if possible replace a request in retransmission state from the queue or otherwise be discarded, hence limiting the size of the queue and maximum delay of its scheduled requests. X3113 also serves as the upper boundary for dynamic T3113 when estimating the expected maximum delay to get a response (default: 60 s)
net: X3210 = 20 s After L3 Complete, wait for MSC to confirm (default: 20 s)