Commit Graph

7624 Commits

Author SHA1 Message Date
Vadim Yanitskiy df1affded8 vty: use 'const' for *nsvc in config_write_bts_gprs()
Change-Id: I869944cc692c7954b2862ecff32c6034d20babef
2021-01-14 12:29:26 +00:00
Neels Hofmeyr 65dd82cb99 handover_test: enhance test_balance_congestion_by_percentage.ho_vty
Related: SYS#5259
Change-Id: I2664dd0857965c4dbf1f91e57c6324d9cf330423
2021-01-14 06:24:57 +00:00
Neels Hofmeyr 8e830dd136 hodec2: to balance congestion, use overload percent
For balancing load across congested cells and across congested TCH/*
kinds, instead of comparing the number of lchans above the configured
congestion threshold, compare the percent of lchans of overload.

In short, using a percentage prevents cells with less min-free-slots to
fill up 100% while neighbor cells still may have several free lchans
available.

An obvious example of why this is desirable is illustrated by
test_balance_congestion_by_percentage.ho_vty:

Cell A has min-free-slots 2, and has all slots occupied.
Cell B has min-free-slots 4, and has 2 slots remaining free.

If we count congested lchans as in current master: cell A has a
congestion count of 2: two more lchans in use than "allowed". If we move
one lchan over to cell B, it ends up with a congestion count of 3, which
is worse than 2. So when counting lchans, we decide that cell A should
remain full.

Instead, when comparing percentage of remaining lchans, we would see
that cell A is loaded 100% above congestion (2 of 2 remaining lchans in
use), but when moving one lchan to cell B, that would only be 75% loaded
above its treshold (3 of 4 remaining lchans in use). So a percentage
comparison would cause a handover to cell B.

Related: SYS#5259
Change-Id: I55234c6c99eb02ceee52be0d7388bea14304930f
2021-01-14 06:24:57 +00:00
Pau Espin Pedrol 55a015dddf Introduce Neighbor Resolution Service
This new CTRL interface allows users of this BSC (such as attached PCU)
to gather neighbor information.

This interface is needed for PCU to translate ARFCN+BSIC keys provided
by MS in the Um side into CGI + RAC keys used to identify target cells
in RIM procedures against SGSNs on the Gb interface.

This patch extends the already existing neighbor information storage in
the VTY by allowing storage of CGI + RAC (RAC couldn't be stored
beforehand).

Related: SYS#4909
Depends: libosmocore.git Change-Id If48f412c32e8e5a3e604a78d12b74787a4786374
Change-Id: Ib07c9d23026332a207d4b7a0f7b4e76c0094e379
2021-01-13 17:14:09 +01:00
Pau Espin 63f98f22a0 doc: handover: Fix malformed table
Change-Id: I197598e8dba719ef7e0f5a1727aa3cc82b5b5c9a
2021-01-13 17:08:05 +01:00
Neels Hofmeyr f95d0ab909 handover_test: add test_balance_congestion_by_percentage.ho_vty
Considering feedback by a customer, we prefer congestion balancing by
using percentage of overload instead of number of lchans of overload.
This test is intended to illustrate the change in behavior.

Change-Id: I314915718f66aec50e8dcf94569b0a52ca34b96f
2021-01-12 09:36:12 +01:00
Neels Hofmeyr 0096f27b61 hodec2: fix congestion oscillation bug
When evenly distributing congestion across cells, count the number of
occupied lchans surpassing congestion, and not the overall number of
free lchans -- which disregards congestion thresholds.

Fix the bugs shown by
 test_congestion_no_oscillation.ho_vty
 test_balance_congestion_tchf_tchh.ho_vty

This implements a simple calculation for congestion load by counting
lchans in use above congestion. An improvement of this calculation
using percent follows in I55234c6c99eb02ceee52be0d7388bea14304930f.

Related: SYS#5259
Change-Id: Icb373dc6bfc9819446db5e96f71921781fe2026d
2021-01-12 09:36:12 +01:00
Neels Hofmeyr db52370c2e handover_test: show bug: add test_balance_congestion_tchf_tchh.ho_vty
Change-Id: I78fd146fb9b9f9e5d61234065abecbedb9f30a3a
2021-01-12 09:36:12 +01:00
Neels Hofmeyr b3f982fd91 handover_test: add lchan wildcards to meas-rep cmd
With 'set-ts-use', it is convenient to build a scenario of lchan usage,
but still inconvenient to send measurement reports to all lchans.

I need this for testing congestion-check, because each lchan needs to
have at least one measurement report, or congestion check is skipped.

Example:

 set-ts-use trx 0 0 states * TCH/F TCH/F - - TCH/HH TCH/HH TCH/H-
 meas-rep lchan * * * * rxlev 10 rxqual 0 ta 0

This patch adds the '*' for the lchan arguments, usually being bts idx,
trx idx, timeslot idx and subslot idx.

Use lchan wildcards at the appropriate places to shorten some tests.

Change-Id: I441f92348508d45e1069a3dfa1ff3842dbba97d6
2021-01-12 09:36:12 +01:00
Neels Hofmeyr d946e5b280 hodec2: add ho_candidate.{current,target}.free_tch
Store the number of free lchans and the min-free-slots settings in
ho_candidate, instead of figuring those out in various places, to make
it easier to read.

Prepare for upcoming patch which also requires these values to fix a
bug.

Change-Id: Ie6ca5af5e8d0ebb8deaaaa637e2728008ecba517
2021-01-12 08:30:15 +00:00
Neels Hofmeyr 1dc9a7f53d hodec2: reduce check_requirements() args
Instead of passing single args, pass the ho_candidate struct.

No functional change.

Change-Id: I086aef9cc47ad8a5376f18179024c486f6f8b779
2021-01-12 08:30:15 +00:00
Neels Hofmeyr d4f8a8bca1 hodec2: cosmetic: clarify ho_candidate.{current,target}
So far it is often confusing which cell a specific member refers to.
Clarify lchan, bts, ... to current.lchan, target.bts, ...

Also move the rxlev_{current,target} to {current,target}.rxlev.

Eliminate numerous local variables to make it easier to read which side
is being used (e.g. "c->target.bts" instead of just "bts").

No functional change.

Change-Id: I06898eb745a5be548df0b76fa760ce790cfab3ed
2021-01-12 08:30:15 +00:00
Vadim Yanitskiy 0a2541c3c3 power_control: add increase / reduce step size recommendations
Change-Id: I82e762c0c2b5e0dd739850ee494ab0a798e353de
Related: SYS#4918
2021-01-12 08:27:52 +00:00
Vadim Yanitskiy c52a1b7d80 power_control: cosmetic changes and fixes to the documentation
Change-Id: I744d09fb22d8b07ed433a34a958ef384fd3d62da
Related: SYS#4918
2021-01-11 19:17:36 +00:00
Vadim Yanitskiy 7f6a69e25e manuals: fix a typo: s/DTS/DTX/
Change-Id: I5bef0eca101859e4f757e17ce3e4e3cd56b0b5eb
2021-01-11 16:02:50 +01:00
Vadim Yanitskiy f7c5859aa3 manuals: fix a duplicate line in the description of DTXu
Change-Id: Iedb7c2b7cc1dc3833271eb94f7eafc79cea3fd06
2021-01-11 15:53:54 +01:00
Neels Hofmeyr d3ade57dcf handover_test: show a bug: add test_congestion_no_oscillation.ho_vty
Also add test_congestion_no_oscillation2.ho_vty which is an almost
identical scenario that does not show the bug -- because it has two more
TCH/H available in BTS 1, showing the strange behavior of the algorithm.

Related: SYS#5259
Change-Id: Idf88b4cf3d2f92f5560d73dae9e59af39d0494c0
2021-01-11 14:35:34 +00:00
Neels Hofmeyr 83952a7f71 handover_test: vty echo
Echo each handover_test command on the test output, to help with
understanding the exact point of a test failure.

Even nicer would be a general echo of all VTY commands, but the VTY
currently does not support that feature. Refraining from a libosmocore
patch just for these test scripts...

Change-Id: Ifc307a7d0b7e3caa355f8cee88778762b529ad71
2021-01-11 14:35:34 +00:00
Neels Hofmeyr b8f00fac4b handover_test: saner ho request handling
Similar to chan act handling, clarify and safeguard HO Request handling.
Ensure that each HO Request is handled by the test script.

Place unhandled HO Requests in new_ho_req pointer, moving to last_ho_req
upon handling it. Instead of the got_ho_req flag and additional
ho_req_lchan pointer, just keep a last_ho_req pointer.

Drop a bunch of utterly useless RSL message parsing code.

Fix unhandled HO Request in test_max_handovers.ho_vty.

Change-Id: I0a664f24d7dd3d7b254b29675fdc49cd70a1a480
2021-01-11 14:35:34 +00:00
Neels Hofmeyr 1a16580a39 handover_test: saner chan act handling
Do not clear pending chan act requests when sending a measurement report
or starting congestion check. This potentially left channel activations
unnoticed and dangling, e.g. for repeated meas-rep.

A typical test should indeed handle pending channel activation requests
before potentially triggering more, safeguard against this by asserting
that only one channel activation is pending.

Place unhandled channel activations in new_chan_req pointer, moving to
last_chan_req upon handling it. Instead of the got_chan_req flag and
additional chan_req_lchan pointer, just keep a last_chan_req pointer.

Change-Id: If06587058798d96afca86358030dc0c1c3c6df39
2021-01-11 14:35:34 +00:00
Neels Hofmeyr ba9d45badb handover_test: safeguard against unhandled chan req
Change-Id: Ib0d5c4647af23e6729cc19e98b1870cdde2fe994
2021-01-11 14:35:34 +00:00
Neels Hofmeyr 351e0f1002 handover_test: include ack-chan in expect-chan
Change-Id: Ic9f1e94b12334fed6bdce35beef94d8e2968f3ad
2021-01-11 14:35:34 +00:00
Neels Hofmeyr 3f1c43e74b hodec2: fix candidate choices in congestion check
Fix flaws in picking a candidate for congestion resolution, shown in
recently added tests.

- For TCH/H->TCH/F upgrading, do not favor moving to a weaker neighbor
  cell.

- When comparing dynamic timeslots on the same cell, favor a dynamic
  timeslot that frees an entire dyn TS even though the target rxlev
  differs.

Do not separate the passes for inter-cell and intra-cell candidates:
before, the inter-cell pass would already pick a candidate and start
handover, even though the subsequent intra-cell pass would have revealed
a better candidate. Join the intra-cell considerations into
pick_better_lchan_to_move().

The intra-cell pass was separate, because it would find the *weakest*
current rxlev, to give a TCH/H to TCH/F upgrade to the currently weakest
lchan.

Instead of the separate pass for weakest rxlev, in addition to the
target cell's rxlev, also consider the rxlev *change* in
pick_better_lchan_to_move(): For candidates that do not change the rxlev
(usually those that stay in the same cell) and that upgrade to TCH/F,
favor a candidate with weaker current rxlev.

Completely revisit the conditions in pick_better_lchan_to_move() to
yield the desired prioritization of candidate preferences.

In three handover tests, remove the "FAIL" comments and adjust to now
expect the actually desired behavior.

Related: SYS#5032
Change-Id: I2704899c85c35dfd4eba43468452483f40016ca2
2021-01-11 14:35:34 +00:00
Vadim Yanitskiy f447c4f3e3 power_control: add documentation on available configuration params
Change-Id: Ib65d33f0f1dd24d39e3be581e4e072a310bc906a
Related: SYS#4918
2021-01-11 13:42:19 +00:00
Pau Espin 44c4ded02c gitignore: Ignore *~
They seem to be generated by newer versions of autofoo.

Change-Id: I739d072c2ef443404e58a49c96d148ed545baedb
2021-01-07 18:33:36 +01:00
Neels Hofmeyr 305f21f9dc hodec2: cosmetic: clarify afs_bias, simplify pick_better_lchan_to_move()
Instead of passing the TCH/H -> TCH/F bias (AFS bias) in local
variables, rather store it in the ho_candidate struct next to the other
rxlev related values.

Add the AFS bias to the compared rxlev in pick_better_lchan_to_move().

Modify pick_better_lchan_to_move() to simpler semantics of returning
either a or b.

No functional change.

Change-Id: I73860abdf2a77270ca4851ad58c09767d1bb08f1
2021-01-05 23:27:26 +01:00
Neels Hofmeyr 0c01ab6cbb hodec2: clarify current and target rxlev per candidate
Store the rxlev of the current lchan and the target BTS in the
ho_candidate, to clarify the code.

No functional change, cosmetically prepare for
I2704899c85c35dfd4eba43468452483f40016ca2.

Change-Id: Ie6c165e17bb3c99eebc967a6bb02529db8bdfc98
2021-01-05 23:27:26 +01:00
Neels Hofmeyr 90175e6987 handover_test: add test_congestion_intra_vs_inter_cell.ho_vty
Related: SYS#5032
Change-Id: Ib5d7047328e1dadeae42b604a2f71771f0ac3152
2021-01-05 23:27:26 +01:00
Neels Hofmeyr fe7b21bbe7 handover_test: show ineffective intra-cell choice
In handover decision 2, choosing an lchan to move so far takes into
account only the absolute current rxlev, and it fails to look at the
*difference* in rxlev between source and target cell.

My recent feature to favor freeing half-used TCH/H does in fact not work
well. The main reason why the test for that feature passes is that all
lchans in the test get identical measurements -- which is unrealistic.

A test with differing ratings uncovers the flaw in comparing intra-cell
candidates.

Related: SYS#5032
Change-Id: Iabce1ab44b496833c19d999fc3f2903d835c357f
2021-01-05 23:27:26 +01:00
Neels Hofmeyr 68495ecc19 handover_test: add AMR TCH/H->/F tests, showing a bug
Related: SYS#5032
Change-Id: Ib785ce8990beede603ba57171a60a531f0f396c9
2021-01-05 23:27:26 +01:00
Neels Hofmeyr 69d219a3ec handover_test: add test_congestion_favor_best_target_rxlev.ho_vty
The aim is to pin the current basic behavior of handover decision 2,
before modifying the algorithm conditions to fix some bugs in upcoming
patches -- so far no test ensures this particular detail.

Change-Id: I68cdda21ef59c464f0af3c2eee356623e58ea1cd
2021-01-05 23:27:26 +01:00
Neels Hofmeyr 5fb6b64732 handover_test: add 'meas-rep repeat N'
Some tests want to repeat the same measurement report, typically 10
times to fill the averaging window. Instead of 10 lines saying
'meas-rep ...', allow 'meas-rep repeat 10 ...'.

Change-Id: Ib2fa81a449fb73ec7c458b0e6877d6561c79a846
2021-01-05 23:27:26 +01:00
Neels Hofmeyr d15d672427 hodec2: code dup / cosmetics
In handover_decision_2.c, instead of repeating a similar loop four
times, put that loop in a function and parameterize it.

Prepare for a fix of two problems in handover decision 2, see
I2704899c85c35dfd4eba43468452483f40016ca2.

Change-Id: I7c32d08e490a88a7f044b0a71dc4b07d748dd572
2021-01-05 23:27:26 +01:00
Neels Hofmeyr 23da99ddda hodec2: cosmetic: add dBm unit to rxval logging
Change-Id: I58a5ae721b674576339360b1f03e91b015a1bf46
2021-01-05 23:27:26 +01:00
Neels Hofmeyr 58eceb06b5 handover_test.c: properly release lchans in set-ts-use
An upcoming test that uses set-ts-use to release used lchans uncovered
an incomplete release, keeping the lchans occupied due to a missing
release ack. Always ack the release.

Change-Id: Ia22906bfbfcc48b7bd08473a2b17f6b0554687d3
2021-01-05 23:27:26 +01:00
Neels Hofmeyr 05da6c1f36 handover_test: fix test_congestion.ho_vty meas-rep
Three BTS means two neighbors -- the '1' is a leftover from legacy.

Change-Id: Ie823c0f371d180b961af38fbea8b01cb3922d038
2021-01-05 23:27:26 +01:00
Neels Hofmeyr d6bfbe8cb6 handover_test: cosmetic cfg simplifications in 5 tests
Change-Id: Iecc77bfde12ed7d788dd2bad626971efb0327fe7
2021-01-05 23:27:26 +01:00
Neels Hofmeyr 69ce88bced tweak handover_tests.sh
We decided not to keep the handover_test script expected outputs
(osmo-bsc's logging output) in the source tree. Hence do not fail the
handover_tests when the output differs, just show a diff (if at all).

Change-Id: I3e9e123b41be71d1fcd9576b0bd38d2fd32353b4
2021-01-05 23:27:26 +01:00
Neels Hofmeyr 71425f5eab handover_test: gitignore
We decided not to keep the handover_test script expected outputs
(osmo-bsc's logging output) in the source tree. For manual comparison,
they are still produced by 'handover_tests.sh -u', ignore them.

Change-Id: I5dda03f21b568e07cf26501ba2e0683108d408b6
2021-01-05 23:26:34 +01:00
Vadim Yanitskiy c137152947 ericsson_rbs2000: fix unreachable code in inp_sig_cb()
Change-Id: I20674945ddb80ceb1a1917e1be8572595764b370
Fixes: CID#215885
2021-01-05 12:20:13 +01:00
Harald Welte 71a21477fd smscb: Fix adding of SMSCB messages when no message with lower period exists
Adding SMSCB messages to a BTS so far only worked if there were
existing messages with a lower scheduling period than the new message.

Before this patch, it fails for new messages if they are of equal or
lower scheduling period than the existing messages.

Change-Id: I69a05b22200b3a1ee406b0673553e135603d723b
2021-01-04 21:48:03 +00:00
Vadim Yanitskiy a95a1e6783 vty: fix wrong attributes for UL/DL ACCH repetition commands
None of those commands apply immediately, they only affect newly
established logical channels.  The reason is that the related
IEs are only getting sent on channel activation / assignment.

Change-Id: I06c7851115fb31d1eb92c400d9724f4f051bd171
Related: SYS#5114
2021-01-04 11:53:13 +01:00
Vadim Yanitskiy e9bf271806 vty: join UL/DL SACCH repetition commands together
Both commands are basically doing the same thing, so we can merge
them into a single command by adding a parameter to the command
string.  The VTY syntax remains the same:

  do-something foo
  do-something bar

becomes:

  do-something (foo|bar)

This change reduces code duplication.

Change-Id: Ibe98718d8f4933926eed0e622109c9c82537f526
Related: SYS#5114
2021-01-04 11:48:04 +01:00
Vadim Yanitskiy c01c58db7e power_control: vty: do not print 'no (rxlev-avg|rxqual-avg)'
Presence of these lines in the config file does not necessarily mean
that the BTS will not perform measurement pre-processing.  It actually
means that the BSC would not include the optional IEs related to the
measurement pre-processing, so the BTS may still apply its default
averaging algorythm with default parameters.

In order to avoid potential confusion, let's avoid printing them.

Change-Id: I585b5bf4fde93d66e47666e0fa9903f21a268b51
Related: SYS#4918
2021-01-03 22:10:56 +00:00
Harald Welte 6d46677a4e smscb: Avoid scheduler array overflow
This fixes the following heap overflow in the SMSCB scheduler:

==109051==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x60d00003a9a0 at pc 0x55d77e4bedf1 bp 0x7fff8cdc4240 sp 0x7fff8cdc4238
READ of size 8 at 0x60d00003a9a0 thread T0
    #0 0x55d77e4bedf0 in bts_smscb_sched_add_before /space/home/laforge/projects/git/osmo-bsc/src/osmo-bsc/cbch_scheduler.c:64

Change-Id: If529aa905336a1b9e7a36e931c165df0ba9899ad
2021-01-03 22:09:40 +00:00
Harald Welte ae449f32b7 abis_om2000: Handle DP object in get_om2k_mo()
This was somehow forgotten for the DP MO...

Change-Id: Ie2ef736eb712e01a3c657ae30c8422c9aa32062a
2021-01-02 22:47:18 +00:00
Harald Welte 15911eb6e6 om2000: Add "show bts 0 om2k-mo" command
Change-Id: Ib81c717bf29aa29c8ac634a959abd12accd1046e
2021-01-02 22:47:18 +00:00
Harald Welte c77cea43ee abis_om2000: keep OM2K FSMs around, don't terminate
The existing code uses short-lived FSMs which are allocated straight
before START, and which are free'd after DONE state is reached.

While that works, it makes state introspection a bit hard, as one
cannot show the FSM states, etc.

Let's change to a different model where the per-OM2k-MO FSMs are
always around (in state INIT after object creation).  While at it,
also introduce a RESET event that can reset each FSM instance back
to INIT state, i.e. in case of OML link failure.

Change-Id: Ia37cffff5c451e1d79a52ccae41ab5718b4661d4
2021-01-02 22:47:18 +00:00
Vadim Yanitskiy cde3d1f29c vty: fix NULL-pointer dereference in cfg_bts_rep_dl_facch()
There is only one parameter in command:

  repeat dl-facch (command|all)

so indeed argv[0] must be used instead of argv[1].

Change-Id: I01efff109a33791e13b0149fc47c792d3266da71
Related: SYS#5114
2020-12-30 19:06:35 +01:00
Vadim Yanitskiy c5f51ee49b power_control: vty: some commands are not vendor specific
Change-Id: I43cad92ea50f819ee56101d131d0060c2f8e174f
Related: SYS#4918
2020-12-29 17:32:10 +00:00