Commit Graph

7495 Commits

Author SHA1 Message Date
Pau Espin Pedrol 0597745ac7 Use rest_octets functionalities from libosmocore
libosmocore > 1.4.0 is required (master, not yet released) since some
fixes done in osmo-bsc code where not cherry-picked to libosmocore APIs.

Depends: libosmocore.git I2bf5635b8536b11d69774d17ac1908019633e3af
Change-Id: I7d5e5ddd174463c2a3d957c8245d2911ce013681
2020-12-15 19:21:44 +00:00
Vadim Yanitskiy 027b506c27 vty: add new attribute for vendor-specific commands
Change-Id: I2254cdf8c4be85c89819d0f831102ee71349b188
Related: SYS#4918
2020-12-15 06:54:34 +00:00
Vadim Yanitskiy 626b7a0be2 NM FSMs: fix DISABLED_NOTINSTALLED -> DISABLED_NOTINSTALLED
This state transaction does not make sense, let's avoid it.

Change-Id: I24a78905bb684f8501dc5ade0605662ec283febc
Related: OS#4901
2020-12-13 12:08:45 +00:00
Pau Espin Pedrol 7c5b7ad633 gsm_lchan_name: assert on NULL lchan
Steve Langasek <steve.langasek@ubuntu.com> submitted some patches
against downstream osmo-bsc 1.3.0 because some possible null derefences
were detected by the compiler on Ubuntu s390x. Code has eveolved since
then and patch doesn't apply directly anymore, since related code
changed (we now use osmo_count in bsc_subscr_get).
The compiled allegedly claimed some null dereference in gsm_lchan_name.
In general code using that function seems to be doing checks for
existing lchan before calling it, or assuming the lchan pointer is not
null, so I couldn't find any major issue.
However, let's add a OSMO_ASSERT to make sure we can easily identify the
issue if an issue ever happens there, since the gsm_lchan_name should
clearly only be called on non null pointers.

Change-Id: If4d12cb1d95ee2a89244bb8f27df839871667387
2020-12-10 15:28:05 +00:00
Neels Hofmeyr ef65d3ddb4 hodec 2: prefer moving TCH/H from half-used dyn TS
Change-Id: I427dc9faa3790c24119127ae227d8cc802dd50e6
2020-12-09 11:35:16 +00:00
Pau Espin Pedrol 44a0e0fc08 oml: Delay configuring NSVC until BTS features are negotiated
This is needed in order to to proper feature support verification for
IPv6 when configuring the NSVC.
Before this patch, there could be a race condition where NSVC FSM
checked for BTS feature BTS_FEAT_IPV6_NSVC before it was negotiated
through BTS Get Attributes (Ack).

Fixes: OS#4870
Change-Id: I7c207eee0e331995ae04acec014fbd13d4d16280
2020-12-04 15:54:34 +01:00
Pau Espin Pedrol 396eb76fcd Fix typo in function nanobts_attr_nsvc_get
Change-Id: I50235ba7b045ab7fba2112e61191d2756a67dfdc
2020-12-04 14:44:43 +01:00
Pau Espin 10364c8999 Handle BTS/BBTRANSC Get Attributes (Ack) in NM FSMs
Before this patch, Get Attributes was sent quicklyafter the OML link
became up, even if the BTS/BB_TRANSC objects were still powered off,
which is wrong since attributes should only be available after the
objects transition out of the Power off state.

Furthermore, information about get attr response already received will
be required in future patches to delay NSVC setting.

Related: OS#4870
Change-Id: I8ec39c7e1f956ffce9aecd58a5590c43200ba086
2020-12-04 14:44:43 +01:00
Pau Espin dd6af77e44 abis_nm: Simplify param passing to abis_nm_rx_get_attr_resp()
There's no real need to retrieve the trx before passing it to the
function, we can do that in the function itself and hence also simplify
the function itself.

Related: OS#4870
Change-Id: I7181510c5021ff2712c09ebc6ec8b13fdd8e8dc2
2020-12-04 14:44:43 +01:00
Alexander Couzens d74bb1e3b0 Introduce NM GPRS NSVC FSM
Related: OS#4870
Change-Id: I381472532c2622a8dba7c81ae00ea873c2e58ae1
2020-12-04 14:44:40 +01:00
Pau Espin aab54b44e4 Introduce NM GPRS CELL FSM
Related: OS#4870
Change-Id: I074f4496aa153b5f84e6ce85f413754efe64d831
2020-12-03 19:56:19 +01:00
Pau Espin ee9f02f2df Introduce NM GPRS NSE FSM
Related: OS#4870
Change-Id: I91a5f40324d5373eac885032295690cec97214a6
2020-12-03 18:46:27 +01:00
Pau Espin dd9abff60b nm_bts_sm_fsm: Fix peer_has_no_avstate_offline not applied for nanobts
The condition was set in st_op_disabled_notinstalled_on_enter():
"""
site_mgr->peer_has_no_avstate_offline = (bts->type == GSM_BTS_TYPE_NANOBTS);
"""

However, at startup of the FSM the oneneter func of the default initial
state is not called. In any case, if called it would be too early since
the type is not known yet (because its parsed later on at the VTY with
the "type" command, that's after the "bts X" node is called and the
bts_sm is allocated.
So we need to make sure to always enable it, also for nanobts.

Change-Id: Ic6049a44ae3fca1b8e968fe800c268f579e7cad4
2020-12-03 16:31:36 +01:00
Pau Espin 64c422858d Store GPRS MOs directly under BTS SiteMgr object
The only real 1-1 relationship between BTS NM objects is the one between
GPRS Cell and BTS (which is actually a BTS cell).
In our current osmo-bts implementation we don't care much since we only
handle 1-cell BTSses, but let's make the data structure organization
more generic.

Implementation notes:
The gsm_bts_sm is moved to its own file, APIs to allocate are added and
the new public object is hooked correctly in the allocation process of
osmo-bsc.

Change-Id: I06461b7784fa2a78de37383406e35beae85fbad8
2020-12-03 16:31:36 +01:00
Vadim Yanitskiy 8c03bf3f3c gsm_08_08: fix NULL pointer dereference in bsc_cm_update()
MS Classmark 3 is optional, and thus can be NULL.

Change-Id: I4f1455a3db4972ea9843564b590e405c51083b47
Fixes: I39ae439d05562b35b2e47774dc92f8789fea1a57
Fixes: CID#215593 "Explicit null dereferenced"
2020-12-02 11:45:51 +01:00
Neels Hofmeyr 18aff1fc46 ctrl_test_runner.py: remove per-test startup delay
The CTRL connect already includes 30 retries with .1 seconds delay each, so
there is no point in adding a fixed two second delay that unnecessarily drags
out test duration for each test.

Change-Id: I830fabbd037d6e945956a99aa3f5e4d4015ea165
2020-12-01 12:09:26 +00:00
Philipp Maier 0eb479e283 abis_rsl: parse cm3 and indicate ACCH repetition cap to BTS
In order to activate FACCH/SACCH repetition on the BTS, the classmark 3
IE in the CLASSMARK CHANGE message must be parsed and depending on the
Repeated ACCH Capability bit the RSL_IE_OSMO_REP_ACCH_CAP is added to
the RSL CHAN ACT und RSL CHAN MODE MODIFY. Since
RSL_IE_OSMO_REP_ACCH_CAP is a propritary IE, it may only be added for
BTS type osmo-bts.

Change-Id: I39ae439d05562b35b2e47774dc92f8789fea1a57
Related: OS#4796 SYS#5114
2020-12-01 11:58:24 +00:00
Philipp Maier ca878ff4df bts: add repeated acch mode flags + vty config
To be able to control the FACCH/SACCH repetition behavior inside the
BTS a one byte flag is sent to the BTS together with the
RSL_IE_OSMO_REP_ACCH_CAP IE. This patch adds the necessary VTY commands.
The sending of the flag is implemented in a follow-up patch.

See also: I39ae439d05562b35b2e47774dc92f8789fea1a57

Related: SYS#5114, OS#4796, OS#4794, OS#4795
Depends: libosmocore I6dda239e9cd7033297bed1deb5eb1d9f87b8433f
Change-Id: I083eaa2c30478912426e9c24a506f0b88836e190
2020-12-01 11:58:24 +00:00
Neels Hofmeyr c93b2a2640 AMR start-mode auto: send smod bits as zero
When ICMI becomes zero for 'start-mode auto', the smod bits will remain
whatever start-mode was set in the previous osmo-bsc config. Instead, osmo-bsc
should clear the smod bits for 'start-mode auto' so that its MultiRate Config
does not vary depending on what was previously configured.

Change-Id: I1ec5bad0bce01cc425ee05ecf70c83ec662a226a
2020-11-30 15:49:46 +00:00
Neels Hofmeyr 2e8ddb44ed AMR start-mode: send proper smod bits
So far, the smod bits reflecting the start mode never made it to the
MultiRate Config IE: gsm48_mr_cfg_from_gsm0808_sc_cfg() always sets them
to zero, and the mode filtering fails to carry the BTS set bits.

Set smod bits according to BTS config after the filtering of available
modes.

Change-Id: I49691df01745a7c485bf165e897872c35fc4b147
2020-11-30 15:49:46 +00:00
Neels Hofmeyr 551cec4086 fix AMR start-mode auto: reflect proper ICMI in MultiRate Config IE
Send the proper ICMI value, instead of always sending ICMI=1 regardless
of the AMR start-mode setting.

To avoid test fallout from the fix, we should first merge
osmo-ttcn3-hacks I4cff01c37d5c7e301e9a01f773b7e009a789519b

Change-Id: I577ff590d7588fd7e3ee4846c7955ab8f84cf2b1
2020-11-30 15:49:46 +00:00
Pau Espin 9402d1eeb7 ipaccess-proxy: generate coredump and exit upon SIGABRT received
Previous code relied on abort() switching sigaction to SIG_FDL +
retriggering SIGABRT in case the signal handler returns, which would
then generate the coredump + terminate the process.
However, if a SIGABRT is received from somewhere else (kill -SIGABRT),
then the process would print the talloc report and continue running,
which is not desired.

Change-Id: Iff920ff3dbeb48bd871b7578470f27fe9d0f9516
Fixes: OS#4865
2020-11-30 14:32:32 +00:00
Alexander Couzens f81c4bd681 sysmobts: expect feature IPV6_NSVC
The IPV6_NSVC feature is required to use IPv6 NSVC to connect
to the SGSN. The features in general should be dynamic discovered for
the BTS which support this.

Workaround for OS#4870
Related: SYS#4915, OS#4870

Change-Id: I711efca931012b8e66516f2721390e9dbdbb72a8
2020-11-28 11:25:46 +00:00
Alexander Couzens 60e3280372 bts_ipaccess_nanobts: check if msgb_alloc fails
Change-Id: Ib7867fa29d62eeea2cbc5603b28e5b00d0f62222
2020-11-28 01:03:38 +01:00
Pau Espin 55d7ee57cf main: generate coredump and exit upon SIGABRT received
Previous code relied on abort() switching sigaction to SIG_FDL +
retriggering SIGABRT in case the signal handler returns, which would
then generate the coredump + terminate the process.
However, if a SIGABRT is received from somewhere else (killall -SIGABRT
osmo-bsc), then the process would print the talloc report and continue
running, which is not desired.

Change-Id: I125288283af630efa20d64505e319636964a0982
Fixes: OS#4865
2020-11-25 20:46:46 +00:00
Harald Welte baa25b0d80 update aoip-mgw-options document with reality of 2020
This was started in 2017 before the NITB split.  Let's align it with
reality, mostly in terms of naming and making explicit what was
implemented.

Change-Id: Ib4e66b565a1edfc5ea8c1446f911011bfd4b1642
2020-11-20 20:58:54 +01:00
Harald Welte 6a6db09c7e fix some size-t format string characters
(shows up on 32bit builds)

Change-Id: Idd588761d537f3fbff89d99c87738e3dc81c3527
2020-11-20 13:44:55 +00:00
Neels Hofmeyr 2978e746b3 handover_test: add test 32: half used TCH/H on dyn TS
Shows undesired behavior of moving a TCH/H from a fully used dyn TS
leading to two half-used dyn TS, rather than moving the half-used dyn TS
that would lead to completely freeing a dyn TS.

Change-Id: I3beaa95d12ca0a19d4d1a732f3e22558e68ee29c
2020-11-18 15:28:15 +01:00
Neels Hofmeyr e0792fd342 handover test 30: play through filling up all lchans
Change-Id: I938ef9ebf77a4e72fc525f4f764daf34f17167ef
2020-11-18 14:50:25 +01:00
Neels Hofmeyr dc69da17ad hodec 2: favor moving dyn TS
When a used timeslot gets moved to another timeslot for load balancing, prefer
moving a dynamic timeslot, as illustrated by handover_test.c test 30.

Rationale: freeing up a dynamic timeslot is better for PDCH availability, as
well as for flexibility in timeslots. Test 30 shows that when freeing a static
TCH/F even though a dynamic one with identical ratings is in use, later
handovers to a TCH/H may become impossible, because no more dynamic timeslots
are available to switch to TCH/H. A freed dynamic timeslot allows congestion
resolution to continue and reduce more TCH/F to TCH/H.

The scope of this preference is per-TRX, where the RXLEV ratings used for
picking a target lchan are the same by definition. In other words, this never
overrules picking another lchan that has better RXLEV.

Among lchans on dynamic timeslots that could be moved, this code favors moving
later lchans; mainly because it makes for a simpler condition in the code.

Change-Id: Ic221b8d2687cdec0bf94410c84a4da43853f0900
2020-11-18 14:50:25 +01:00
Neels Hofmeyr 829db22eeb hodec 2: prep: common pick_better_lchan_to_move() function
There are four places deciding which of 2 lchans to move, depending on average
db ratings. Upcoming patches will enrich that decision for better handling of
dynamic timeslots, so have one common function for these to avoid code dup.

Change-Id: I745dc95cf564dd330295cecb4d64dccebf55163f
2020-11-18 14:50:11 +01:00
Neels Hofmeyr dad4e7c3f7 fix TCH/H allocation: use half occupied dyn TS instead of switching more dyn TS
Change-Id: I5a8d943f31774af00664d037550be14e767d312a
2020-11-17 03:32:17 +01:00
Neels Hofmeyr b08ec40282 handover_test: add test 31: TCH/H: re-use dyn TS
Show undesired behavior of opening up another TCH/H timeslot even though
another TCH/H timeslot still has room for a second lchan. This is particularly
bad for dynamic timeslots, reducing PDCH as well as TCH/F resources.

Change-Id: If222835af92d832b848824e5466bdcaf9af8a614
2020-11-17 03:32:17 +01:00
Neels Hofmeyr 25e8f76116 handover test: add test 30: de-congest TCH/F by moving to dyn TS TCH/H
In the test, show the undesired behavior of moving non-dynamic timeslots first,
because they are the first to be considered in the congestion resolution loop.
The behavior will be fixed in Ic221b8d2687cdec0bf94410c84a4da43853f0900.

Change-Id: I09ab9f2f79fa434c7279cb4d09899f69b047aa55
2020-11-17 03:32:17 +01:00
Neels Hofmeyr 7424bd2973 handover_test: drop secondary array of lchans
Change-Id: I7c80a16324d764969f279a5e1d6f55b0dbe9c17b
2020-11-17 03:32:17 +01:00
Neels Hofmeyr 90d4b98322 handover_test: change 'meas-rep' params to bts-trx-ts-ss nr
So far the 'meas-rep' expects the index of the MS in order of appearance, to
send a measurement report for that MS. That may seem like a simplification for
human readability, but in fact, it is confusing for a human to keep track which
MS has which index, and to which timeslot it has been handovered. When reading
the tests, it is much easier to read exactly which timeslot the measurement
report is being sent to; which MS came first is inherently not as interesting
as which lchans are currently occupied.

Change-Id: I7ab2ef604196cfe96112dfefb9aa930368bf4812
2020-11-17 03:32:17 +01:00
Neels Hofmeyr 5531fae5da handover_test: add 'set-ts-use'
When a test wants to use N lchans, so far it has to issue N 'create-ms'
commands. Many lchan distributions cannot be easily obtained by this, because
'crate-ms' always takes the first free lchan. To shorten test setup and easily
allow arbitrary lchan distributions, this command sets specific lchans to
specific usage states in one line.

Change-Id: I6e90679bf22609fb72e53e3d11748a4070a38159
2020-11-17 03:32:17 +01:00
Neels Hofmeyr 43666544e7 handover test: add 'expect-ts-use' to clarify tests
In handover tests, it can be hard to follow which lchans are currently
occupied. The expect-ts-use command is like an assertion for a specific
distribution of used lchans, and helps understanding test intentions.

Change-Id: I6f4b573de7faace2d6bfe4f58b568e69c74dd07d
2020-11-17 03:32:17 +01:00
Neels Hofmeyr fb6d9dc508 handover test: fix dyn ts: set pchan_is on act / rel
Before this, handover_test channel activation and release on dynamic timeslots
failed to reflect the correct pchan type that osmo-bsc uses.

Change-Id: I3284b4565ad2c3b124442f4373243da1518206ce
2020-11-17 03:32:17 +01:00
Neels Hofmeyr cfbf11f8ef handover_test: allow arbitrary timeslot config and multiple TRX
Adjust 'create-bts' command so that it allows multiple TRX and arbitrary
timeslot configurations. It is now possible to write tests for dynamic
timeslots and multiple TRX.

Change-Id: Ic645cea671aa4798804666b8886f11bab5351e11
2020-11-17 03:32:17 +01:00
Neels Hofmeyr b5a107d8c9 handover_test cosmetic: eliminate bts array and bts_num from main()
This "global" array shadows the bsc_gsmnet state and is not needed. Look up the
BTS in bsc_gsmnet like all of osmo-bsc does.

Change-Id: Ieb27403b97124771e4d28b9c69bf7c36288f396d
2020-11-17 03:32:17 +01:00
Neels Hofmeyr 4942da8c2e handover_test prep: rename 'create-bts' to 'create-n-bts'
I will add a command to create a single BTS with arbitrary timeslot
configurations.

To limit amount of editing of the current tests, keep the current 'create-bts'
command, which creates N identically configured BTS, but rename it to
'create-n-bts'.

Thus allow the upcoming single-BTS command to take the name 'create-bts'.

Change-Id: I4853771cf23b509b7f278d04c57883332ede786d
2020-11-17 03:32:17 +01:00
Neels Hofmeyr dd7b710cf7 handover_test prep: allow configuring several trx in create_bts()
Preparation for Ic645cea671aa4798804666b8886f11bab5351e11 to allow arbitrary
timeslot configurations in the tests.

Change-Id: Ie0d0c85552ba24802392423b60cfa3919e87563f
2020-11-17 03:32:17 +01:00
Neels Hofmeyr e3eb67ccf7 handover_test prep: allow arbitrary timeslots in create_bts() code
Allow passing timeslot config to create_bts().

Preparation for Ic645cea671aa4798804666b8886f11bab5351e11 to allow arbitrary
timeslot configurations in the tests.

Change-Id: I3ae898be4a503060c6bf30ae89115a75461ffc27
2020-11-17 03:32:17 +01:00
Neels Hofmeyr 780f028a79 handover_test prep: move generate_si() into create_bts()
Preparation for Ic645cea671aa4798804666b8886f11bab5351e11 to allow arbitrary
timeslot configurations in the tests.

Change-Id: I8ed468da53f7b0e5ba8125d1bebafebe8c5becbb
2020-11-17 03:32:17 +01:00
Neels Hofmeyr 2f58de5b30 handover_test prep: move arfcn into create_bts()
Preparation for Ic645cea671aa4798804666b8886f11bab5351e11 to allow arbitrary
timeslot configurations in the tests.

Change-Id: I6eb11e9f98c827cfcd819990db38b6848bf18b27
2020-11-17 03:32:17 +01:00
Neels Hofmeyr 72d64e7227 handover_test: fix comment
Change-Id: Ice7932aae8b57bedf8bfc98eb77e73ad039a7e82
2020-11-17 03:32:17 +01:00
Neels Hofmeyr 4d8a469cd4 handover vty doc: explain rxqual values
Change-Id: I4f9d6b59c4f4a0550fb6a386342be55dcd777de8
2020-11-17 03:32:14 +01:00
Harald Welte eb77a2971b Use osmo_fd_*_{disable,enable}
Depends: libosmocore.git Idb89ba7bc7c129a6304a76900d17f47daf54d17d
Change-Id: I4e228399d21098cc9a99b9cc1aa42b24ec609159
2020-11-11 20:15:22 +00:00
Philipp Maier 98439edd85 osmo_bsc_bssap: actually check for lchan
The function bssmap_handle_cipher_mode() suggests to check if an lchan
is actually present when it gets called, but it only checks for conn.
This might lead to a segfault later in the execution path.

Change-Id: I3103ec89cd6dce1a11ea8e9f8187373e4114e852
2020-11-09 16:55:47 +01:00