Commit Graph

7623 Commits

Author SHA1 Message Date
Neels Hofmeyr dbe59f69a4 add {BTS,BSC}_CTR_INTER_BSC_HO_OUT_FAILED for RR HO Failure
So far, during inter-BSC outgoing handover, when receiving an RR Handover
Failure from the MS, it would be counted as 'error'. Instead, add the 'failed'
counter like for all other HO types.

It may make sense to omit the 'failed' counter for inter-BSC *incoming*
handover, because then we won't receive an RR Handover Failure message. I
probably got those two mixed up during initial development.

Related: OS#4736
Change-Id: I9a61d5cc7273a830ba4e66e43e4aac6cdb707471
2020-08-31 18:01:17 +02:00
Neels Hofmeyr e6142d0e25 fix HO inter-BSC-IN target bts for counters
Related: OS#4736
Change-Id: Id38c69695c4ab93733571c0c288a2d5c10624ace
2020-08-31 18:01:17 +02:00
Neels Hofmeyr 01c06a9163 fix 'handover:*' counters: remove bogus increments
To handle cases of unknown handover type (like failure to find the target
cell), return -1 as counter code; treat -1 as skipping in ho_count_bsc() and
ho_count_bts().

The handover:* counters indicate overall counts, without knowing whether inter-
or intra-BSC, or whether the target ARFCN even exists. So they need to be
counted separately, and must not serve as fallback category in
result_counter_bsc() and result_counter_bts().

Related: OS#4736
Change-Id: Ie311e599d7bd35d33cf471c6c63e649246e8396a
2020-08-31 18:01:07 +02:00
Neels Hofmeyr c859ef646c fix 'handover:*' counters: add missing / move increments
Move initial 'handover:attempted' counts from bsc_subscr_conn_fsm.c to
handover_fsm.c, where all the other counters are handled.

Add missing increments for the overall 'handover:*' counts.

Related: OS#4736
Change-Id: I783bdedafc0eb8f2df9ea100792846fecc7ccbf7
2020-08-30 00:32:28 +00:00
Neels Hofmeyr 5a7d01792c ho counters: count invalid target cell as 'error', not 'no_channel'
Related: OS#4736
Change-Id: If6d6b7262536831ebb2b638efe521dd5a8153cdb
2020-08-30 00:19:42 +00:00
Neels Hofmeyr 8a3b507dea cosmetic: dissolve error-goto with single source in handover_start()
Change-Id: I9c7d10c36f3f868100c1aa2d0433ceed74161175
2020-08-30 00:02:14 +00:00
Neels Hofmeyr 09ea10d30d cosmetic: use local var in handover_start_intra_bsc()
Change-Id: I3ae079a2aa9ff3980acd5a212cb287a96a1dc0ed
2020-08-30 00:02:09 +00:00
Vadim Yanitskiy 22826ffb6b abis_rsl: fix IAR Rest Octets in rsl_send_imm_ass_rej()
Currently osmo-bsc encodes the IAR Rest Octets as follows:

  IAR Rest Octets
    0... .... = Extended RA: Not Present
    .0.. .... = Extended RA: Not Present
    ..1. .... = Extended RA: Present
    ...0 1011 = Extended_RA: 11
    0... .... = Extended RA: Not Present
    .L.. .... = Additions in Rel-13: Not Present
    Padding Bits: default padding

This is not really critical, but still may look confusing as this
is only relevant for the PS domain (11-bit RA), while osmo-bsc is
responding to a CHANNEL REQUEST in the CS domain.

Change-Id: I30a43efc70345a4bb0571127c239a24422b7fd2c
2020-08-29 16:39:53 +07:00
Neels Hofmeyr d41247d4cf CBSP: add local bind to client mode
Add the ability to set a local bind address for the CBSP client mode.

Change-Id: I56a420d204a9a487b27dd460f4cc52e0b4093d69
2020-08-29 07:57:59 +00:00
Neels Hofmeyr 641f7f0845 CBSP: rewrite the CBSP link setup and 'cbc' VTY section
Firstly, make CBSP server and client mutually exclusive: Do not allow osmo-bsc
to be configured as CBC client *and* CBC server at the same time.
cbsp_link.c expects at most one CBSP link to be established, and, upon sending
CBSP messages, probes whether to send the message to a CBSP server or client
link. When both listen-port and remote-ip are configured (regardless of an
actual CBSP connection), osmo-bsc gets confused about where to send CBSP
messages.

One solution would be more accurate probing for an actual established TCP
connection. But the simpler and less confusing solution is to force the user to
configure only server or only client mode, never both.

Introduce 'cbc' / 'mode (server|client|disabled)'.

Secondly, clarify the 'cbc' config structure into distinct 'server' and
'client' subnodes. Refactor the 'cbc' VTY node in such a way that the IP
addresses for server and client mode can remain configured when the CBSP link
is switched between server/client/disabled modes.

To implement the above, switch the struct bsc_cbc_link to use osmo_sockaddr_str
for address configuration.

Related: OS#4702
Related: I7eea0dd39de50ed80af79e0f10c836b8685d8644 (osmo-ttcn3-hacks)
Related: I9e9760121265b3661f1c179610e975cf7a0873f1 (docker-playground)
Change-Id: Icaa2775cc20a99227dabe38a775ff808b374cf98
2020-08-29 07:57:59 +00:00
Pau Espin 657f3109dc Allow storing IPv6 address strings in BSSAP structs
Related: SYS#4915
Change-Id: I95601f24e3c658aab328e1c55dc514f553c297b8
2020-08-28 19:11:18 +02:00
Pau Espin c8ec051bde tests: acc_test: Test more rotating scenarios
Change-Id: I8ac8ef362af8222e6b7e302e3763811ba093db62
2020-08-27 14:24:03 +02:00
Pau Espin 88cef63e85 acc: Fix ACC rotate barring highest ACCs too quickly during wraparound
Expected steps (size=4):
6 7 8 9 -> 0 7 8 9 -> 0 1 8 9 -> 0 1 2 9 -> 0 1 2 3 -> 1 2 3 4 -> ...

Befre this patch, for size>2 we got:
6 7 8 9 -> 0 6 7 8 -> 0 1 6 7 -> 0 1 2 6 -> 0 1 2 3 -> 1 2 3 4 -> ...

Which means highest ACCs were barred during more time than others.

Change-Id: I03c298ecb29c4fc5f4c361773f2666588e423ffe
2020-08-27 14:05:14 +02:00
Pau Espin c7b85d3a64 acc_test: Print allowed ACC from t2 and t3
Change-Id: If41e8e41310e2b9e27aaa5fe9d04ea39d7272703
2020-08-27 13:07:44 +02:00
Vadim Yanitskiy 6a26e2cf50 bsc_subscr_conn_fsm: use proper cause values in SAPI N REJECT
As 3GPP TS 48.058 clearly states, an RLL RELease INDication is only
sent if the datalink is released by the MS.  Thre's no cause value
giving further diagnostics, but if the MS releases the link, it is
clearly not the BSS's fault, and hence "BSS not equipped" is wrong.

Change-Id: I38222e60071841abcd06046a472ddb35907164a4
Related: OS#4728
2020-08-26 19:05:59 +00:00
Vadim Yanitskiy e76de16ff6 bsc_subscr_conn_fsm: fix a memleak in rll_ind_cb()
Change-Id: I9ce35c1e446b0dfdb5b01651466ccaafc23c9318
2020-08-26 19:05:59 +00:00
Vadim Yanitskiy f1339dfece fix bsc_sapi_n_reject(): dlci is unsigned, use uint8_t
Change-Id: I5f04f16caecb58a28e119512267999fdc18ff172
2020-08-26 19:05:59 +00:00
Pau Espin bfc85e4300 ctrl: Fix CTRL TRAP for {msc.X,msc_)connection_status not sent
The tx TRAP callback is triggered through a signal which is never sent in
osmo-bsc code, and never was as far as I can tell going quite far in the
logs.
In the meanwhile, the msc_connection_status was left in favour of
multi-msc msc.X.connection_status CTRL variable, so let's prepre the cb
function to work for that onei too, dropping global variables which may lead
to wrong output in multi-msc environments, and simply use msc->nr==0 for
the old variable "msc_connection_status".

The signal is now triggered in a_reset when the A conn becomes connected
or disconnected. As a result, a user waiting for the disconnect event
may notice that the status may be changed with a noticeable delay, since
the A conn may be reset only due to high layer timeouts after several
repeated failures (T4, BAD_CONNECTION_THRESOLD).

Related: OS#2623
Related: OS#4701
Related: SYS#5046
Change-Id: I645d198e8e1acd0aba09d05cb3ae90443946acf8
2020-08-25 19:04:24 +02:00
Pau Espin 551321ec72 Change default SCTP conn NULL->127.0.0.1 to localhost->localhost
"127.0.0.1" is changed to "localhost" to let local NSS decide whether to
use IPv4 or IPv6. In newish systems, IPv6 ::1 will be selected since
IPv6 takes precedence over IPv4.

Similarly, the default source addr needs to be changed from NULL to "localhost"
since for some yet unknwon reason, getaddrinfo(AF_UNSPEC, NULL) returns
first IPv4 "0.0.0.0" and later "::", which is inconsistent with
getaddrinfo("localhost") result, resulting in src=IPv4(0.0.0.0) and
dst=IPv6(::1), which is incompatible and will fail. In any case, since
the default remote address is a local one and it's the client side,
there's no real logical change since the kernel would anyway should have
taken a local address anyway.

Change-Id: Ic93be6c47403e65b7c338604728570f23bc3de12
2020-08-25 13:50:06 +00:00
Neels Hofmeyr 6adb24693b CBSP: log CBSP RESET on NOTICE
Change-Id: Id3913914e3ab06dab5a986c2aac4439e6cb4737a
2020-08-25 11:42:23 +00:00
Neels Hofmeyr 13011f62d1 CBSP: on RESET, also clear the etws_timer, and stop ETWS PN broadcast
Normally, each ETWS CMD instructing to broadcast triggers a five second
etws_timer to send a zero-payload ETWS CMD that stops broadcasting, five
seconds later. Before this patch, this lingered past an ETWS RESET instruction.

Instead, clear the etws_timer on ETWS RESET, and make sure that all ETWS PN
broadcast is stopped by sending a zero payload ETWS CMD to the BTSes
immediately.

This will cause all CBSP ttcn3 tests to fail unless
Ifee313369a433a6a638c5fffdedee5363b8e47c2 is merged to osmo-ttcn3-hacks at the
same time.

Related: Ifee313369a433a6a638c5fffdedee5363b8e47c2 (osmo-ttcn3-hacks)
Change-Id: I925a041936c6163483d70fe6d158af368ec8c444
2020-08-25 11:20:21 +00:00
Philipp Maier eb1306d781 lchan_fsm: make internal functions static.
The functions lchan_fsm_allstate_action, lchan_fsm_allstate_action and
lchan_fsm_cleanup are only used internally in lchan_fsm.c, lets make
them static

Change-Id: If1ceb69d14a7840e1f753b0dd911726257125e99
2020-08-25 08:49:55 +00:00
Philipp Maier fce7e29ccf lchan_fsm: merge lchan_mr_config()
There are some preperations and checks done before calling
lchan_mr_config(), those checks could also be done from inside
lchan_mr_config(), so lets merge them into lchan_mr_config()

Change-Id: I068aadda53b2c3a85ed4fb1e513b17bf9870bd50
2020-08-25 08:49:55 +00:00
Daniel Willmann aa420cec14 Add bts counters to count BTS events where we don't have a bts
In some (error-) cases we might be unable to determine which BTS to use
when counting handover events. We don't want to loose these events
because then ctr(bsc) == sum(ctr(bsc->bts)) would not be true anymore.

Those events are now counted by a counter in struct gsm_network which
uses an index that is out of range for regular BTS (65536).

Change-Id: Ic0f3edd5dc014c4eac5e8423133633a3e5d4c13e
Related: SYS#4877
2020-08-24 07:41:43 +00:00
Daniel Willmann bf2a4b69d8 Count intra-cell and intra-bsc handover separately
Currently the counters don't distinguish between intra-cell and
intra-bsc handover.

Add _CTR_INTRA_CELL_HO_ and _CTR_INTRA_BSC_HO_ counters to track
intra-cell/bsc handover separately.

Change-Id: I3a1195640b99813036c9f1426ee5f07548e26547
Related: SYS#4877
2020-08-24 07:41:43 +00:00
Daniel Willmann 02f0b30cda Count handover per BTS as well as per BSC
Our current handover counters only count success/failures per BSC. It
would be nice to also count which BTS is part of a (successful/failed)
handover.

This patch duplicates the BSC counters for the BTS and changes the
ho_count and related macros to also count per BTS. If a BTS is NULL
(when conn->lchan is NULL) counting for the BTS is ignored.

Change-Id: I025ef14e2cfd2eea8880212c9406372ce0bf9296
Related: SYS#4877
2020-08-24 07:41:43 +00:00
Harald Welte 893e688ea8 osmo_bsc_sigtran.c: Remove unused #defines
Change-Id: Ic21f27f67815190020f3860a9fbb5f4f1fd78a57
2020-08-24 07:39:34 +00:00
Neels Hofmeyr 90717c03a2 mscpool: fix refcount leak for unusual case of no bts
by reading the code, I notice that a refcount on the subscr would be leaked if
there were no bts. That is not realistically happening, but nevertheless rather
rejigger so that no leak is possible, ever.

Change-Id: I0b804b8136cd78a777ca02667f696cdefa90c4a9
2020-08-21 14:55:55 +02:00
Daniel Willmann 45062b42ce Remove punctuation in counter description
Change-Id: I304dcc9e88afc5e607d5b010df3e95f40fb8c49b
2020-08-20 18:44:46 +02:00
Pau Espin da5b2f8094 Support setting rt-prio and cpu-affinity mask through VTY
Depends: libosmocore.git Change-Id If76a4bd2cc7b3c7adf5d84790a944d78be70e10a
Depends: osmo-gsm-masnuals.git Change-Id Icd75769ef630c3fa985fc5e2154d5521689cdd3c
Related: SYS#4986
Change-Id: Ie68883666657fc8faa76e2422335c0ceb98c5a88
2020-08-20 08:40:17 +00:00
Vadim Yanitskiy 6624c22d83 vty: fix copy-pasted 'no gprs control-ack-type-rach' description
Change-Id: If2538ab88d551da5167344e1a86d3a41c5d2dfdd
2020-08-18 11:50:11 +00:00
Harald Welte 210aa95d49 Implement support for receiving BSSMAP CommonID from MSC
The MSC may at any time send a BSSMAP CommonID message via a
SCCP connection to inform us of the IMSI of the subscriber.  Let's
make use of that information by associating a related bsc_subscr
and updating the identity of the bsc_subscr_conn_fsm for improved
logging / filtering.

Closes: OS#2969
Change-Id: I52c43fb940f0db796adf4c0adb2260321c721c39
2020-08-17 13:04:03 +02:00
Vadim Yanitskiy fe12b70ce5 debian/control: change maintainer to the Osmocom team / mailing list
Change-Id: I82a5e175c6d70af1ee07521a0e17f9f5cbf300dc
2020-08-13 15:00:02 +00:00
Neels Hofmeyr 59da48609c info, error log: show MSC nr for new conn
Change-Id: I0a7e0a638515f48d49e2d2e1d905d9e574994fd5
2020-08-13 12:54:08 +00:00
Neels Hofmeyr 4829015b55 debug log: add RR Release cause code to the log
Change-Id: I53d524b5521804d80463079fa2e20221ee1b15f1
2020-08-13 12:54:08 +00:00
Neels Hofmeyr e8ec9e5e79 gscon timeout: use proper cause code for lchan release
Since we verify the cause code of the RSL channel release in ttcn3-bsc-tests,
BSC_Tests.TC_chan_act_ack_est_ind_noreply shows an invalid release cause code
of 127. Fix that.

On gscon timeout, don't send the unrelated RSL code RSL_ERR_INTERWORKING, but a
proper RR cause code. GSM48_RR_CAUSE_ABNORMAL_TIMER is defined as the proper
cause for an expired timer (3GPP TS 44.018 10.5.2.31).

Should fix this error in BSC_Tests.TC_chan_act_ack_est_ind_noreply:

  BSC_Tests.ttcn:1590 Dynamic test case error: Assigning invalid numeric value 127 to a variable of enumerated type @GSM_RR_Types.RR_Cause.

Change-Id: Ic2e4b692e78f7b134fe57d1077a08adb48398e06
2020-08-13 12:31:51 +00:00
Neels Hofmeyr 6a67fa589c cosmetic: bscon: use GSM48_RR_CAUSE_NORMAL instead of 0
Change-Id: Ia0e23bbc5506e9be3e0682c4dab5b9ecb91cf477
2020-08-13 12:31:51 +00:00
Philipp Maier f954e35464 abis_rsl.c: make sure emergency calls are rejected early
If a CHAN RQD indicates an emergency call on a BTS that does not allow
emergency calls, then respond with an IMMEDIAGE ASSIGNMENT REJECT
message to deny the emergency call early.

Related: OS#4548
Change-Id: I148c540269bffd703f38233a1e689e863c175e97
2020-08-12 19:02:11 +00:00
Alexander Chemeris abf03a1d64 timeslot_fsm: Name TS FSM instances on allocation.
Before this patch FSM instances of configured but not connected BTS's
look like this:
FSM Instance Name: 'timeslot[0x612000004a20]', ID: '(null)'
 Log-Level: 'DEBUG', State: 'NOT_INITIALIZED'

Now they look like this:
FSM Instance Name: 'timeslot(0-0-7-NONE)[0x612000004a20]', ID: '0-0-7-NONE'
 Log-Level: 'DEBUG', State: 'NOT_INITIALIZED'

which makes it possible to attribute them to where they belong.
Otherwise, they look like lingering or leaking unattributed FSM
instances.

Change-Id: Idc74ea142b96323b48826f8a52e13e45d535512a
2020-08-12 18:38:18 +00:00
Alexander Chemeris 29993a9138 chan_alloc: Fix typo in a comment.
Change-Id: Iaed3fcd99ec8c08faa75e23af5b50a1d0e0905eb
2020-08-12 18:38:06 +00:00
Alexander Chemeris ca3b18c4c7 paging: Remove obsolete comment.
I beleive MSC split is finished a long time ago and everything is
already re-wired for the A-interface.

Change-Id: If2a0b15e360c44abc92fdeb9004be7ccc0537cdd
2020-08-12 18:37:55 +00:00
Philipp Maier e8296d285b gsm_04_08_rr: block EMERGENCY SETUP when EMERGENCY CALLS are denied
If the BSC configuration is set up to deny emergency calls, make sure
that an EMERGENCY SETUP will not be passed to the MSC, instead ensure
that the call is released.

Change-Id: Ia6eb38370ce4165d221d2ffbe1cd105c0628313c
Related: OS#4548
2020-08-12 18:07:33 +00:00
Philipp Maier a7f02c6899 e1: encode line number as trunk number in MGCP endpoint
The MGCP endpoint name, that is generated when an E1 endpoint is
selected does have a hardcoded trunk id number, which is permanantly set
to 1. Lets use the E1 line number instead.

Related: OS#2547
Change-Id: Ic5447bb4426e31d119667bdfddfd2c91fd591fc6
2020-08-12 10:21:29 +00:00
Vadim Yanitskiy 6728085988 vty: allow enabling freq. hopping regardless of the feature vector
The hard-coded per-BTS feature vector for osmo-bts currently lacks
BTS_FEAT_HOPPING, and this is unlikely to change, because only the
recent osmo-bts-trx does support freq. hopping, while the other
(DSP based) back-ends do not seem to be capable of doing it.

Let's allow enabling freq. hopping regardless of the feature vector,
so either it would work if it's supported, or the BTS would reject
Set Channel Attributes message by sending NACK on the A-bis/OML.

Change-Id: Iff23109cacb5d314f7bcbf34b25e89af9281ce40
Related: SYS#4868, OS#4546
2020-08-11 06:33:28 +00:00
Vadim Yanitskiy f1d4f366d6 vty: introduce and use GPRS_CHECK_ENABLED() macro
Change-Id: I39907a569e80344fc73596bea32a1b474ec720e0
2020-08-11 06:33:28 +00:00
Vadim Yanitskiy 5e465d52cf vty: fix missing comma in a warning message
Change-Id: I4219bff4286ddff3339d5da40b11ee360c239358
2020-08-11 06:33:28 +00:00
Vadim Yanitskiy 9c0b6ba73a vty: ensure that all warning messages are prefixed with '%%'
Change-Id: I6f2348c481ed43904d05b42fd7d5ce04dedbf46b
2020-08-11 06:33:28 +00:00
Neels Hofmeyr bd6a4c3e40 hodec2: log requirements of best candidate, log rxlev in dBm
Instead of logging a hex value for the met requirements, fully expand the "ABC"
flags for both TCH/F and TCH/H.

From HO_CANDIDATE_FMT/_ARGS, split off into REQUIREMENTS_FMT/_ARGS and use that
when logging the chosen HO candidates.

Also change the RX level to dBm, to match general logging and reduce confusion
between rxlev number variants in the log.

Change-Id: I1b30a6e98bdb4bd92e72864fafdd2f4f3ae3134c
2020-08-10 21:25:57 +02:00
Neels Hofmeyr 9ed0d17d53 hodec2: do not keep candidates with zero requirements met
When check_requirements() returns zero, do not keep such an entry in the
candidates list at all. This removes logging confusion, where some "candidates"
are still listed even though not meeting any handover requirements.

Change-Id: I12e48292d5731cb601165c870b9570003bc488ec
2020-08-10 21:25:57 +02:00
Neels Hofmeyr f5dab9a2c8 hodec2 congestion: consider only congested pchan types
If no TCH/H need to be moved, then don't collect TCH/H candidates.
Same for TCH/F.

Examining a specific congestion scenario, I realized that ho decision 2
collects candidates of pchan types that are not actually considered congested:

- handover decision 2 wants to move 2 TCH/F only; TCH/H is fine.
- still it collects active TCH/H lchans as candidates.

  (BTS 0) Congestion check: (free/want-free) TCH/F=0/2 TCH/H=12/0
  (BTS 0) Attempting to resolve congestion...
  (BTS 0) congested: 2 TCH/F and 0 TCH/H should be moved
  [...]
  (BTS 0) Considering 8 candidates to solve congestion:
  (lchan 0.020 TCH_F SPEECH_V1)->(BTS 0) (subscr unknown) #0: req=0x0 avg-rxlev=42
  (lchan 0.030 TCH_F SPEECH_V1)->(BTS 0) (subscr unknown) #1: req=0x0 avg-rxlev=42
  (lchan 0.040 TCH_F SPEECH_V1)->(BTS 0) (subscr unknown) #2: req=0x0 avg-rxlev=42
  (lchan 0.050 TCH_F SPEECH_V1)->(BTS 0) (subscr unknown) #3: req=0x0 avg-rxlev=42
  (lchan 0.160 TCH_H SPEECH_V1)->(BTS 0) (subscr IMSI:9017000000xxxxx) #4: req=0x0 avg-rxlev=42
  (lchan 0.161 TCH_H SPEECH_V1)->(BTS 0) (subscr IMSI:9017000000xxxxx) #5: req=0x0 avg-rxlev=42
  (lchan 0.170 TCH_H SPEECH_V1)->(BTS 0) (subscr IMSI:9017000000xxxxx) #6: req=0x0 avg-rxlev=42
  (lchan 0.171 TCH_H SPEECH_V1)->(BTS 0) (subscr IMSI:9017000000xxxxx) #7: req=0x0 avg-rxlev=42

Change-Id: I5077a62c6d77838513eecf3f0e4810c3d3d3a247
2020-08-10 21:25:57 +02:00