Commit Graph

8224 Commits

Author SHA1 Message Date
Oliver Smith 88c13cf4cc contrib/osmo-bsc.spec.in: fix 4trx example paths
The paths were wrong in my previous attempt, add the proper paths now.
I've verified that this file builds, and adjusted the current nightly
rpm spec uploaded to OBS with this change manually this time so it
doesn't block.

Fix for:
  File not found: /home/abuild/rpmbuild/BUILDROOT/osmo-bsc-1.8.0.90.e0187.202204061142-1.1.x86_64/etc/osmocom/osmo-bsc-4trx-fh.confmerge
  File not found: /home/abuild/rpmbuild/BUILDROOT/osmo-bsc-1.8.0.90.e0187.202204061142-1.1.x86_64/etc/osmocom/osmo-bsc-4trx.cfg

Fixes: e0187bc3 ("contrib/osmo-bsc.spec.in: add new config files")
Change-Id: I92a7d85b64a9659db7ef71af5b00110b582dc4d9
2022-04-06 14:48:22 +02:00
Oliver Smith e0187bc3bb contrib/osmo-bsc.spec.in: add new config files
Fix for:
  Installed (but unpackaged) file(s) found:
  /usr/share/doc/osmo-bsc/examples/osmo-bsc/osmo-bsc-4trx-fh.confmerge
  /usr/share/doc/osmo-bsc/examples/osmo-bsc/osmo-bsc-4trx.cfg

Change-Id: Ie6c68681e5e68f4aa071fe4cee8f49040a4463e6
2022-04-06 11:28:39 +02:00
Vadim Yanitskiy a41573994c doc/examples: add a confmerge file with example hopping parameters
This file was taken from docker-playground.git, and this is basically
what we use when running the ttcn3-bts-test with hopping enabled.

Change-Id: I205eb53901e06ee52dc64e050cfe2374cb9c771e
2022-04-01 06:33:42 +03:00
Vadim Yanitskiy caf091f465 doc/examples: add a multi-trx config config example
So far we had no multi-trx config examples at all.  Let's add one.
Use unique 'RSL TEI' for each TRX, as this simplifies analyzing the
Abis protocol traces.  Also use the new 'TCH/F_TCH/H_SDCCH8_PDCH'.

Change-Id: I20f86fa74dc4bd71538627ec59c5d2cd3678a089
Fixes: OS#4748
2022-04-01 06:05:36 +03:00
Vadim Yanitskiy 97ea5cb506 doc/examples: avoid using deprecated configuration commands
Change-Id: Id29fae10ec17eb3d0ac8534d8aebd7251a17577d
2022-04-01 06:05:36 +03:00
Vadim Yanitskiy 108d5dee74 abis_rsl: always check return value of rsl_tlv_parse()
Change-Id: Id022628934e7d51ce66cb255baa88f24bf5c918a
Related: SYS#5905
2022-03-31 21:29:17 +03:00
Harald Welte 9dfe6cb3d5 abis_rsl: Ensure message length is sufficient for respective header
Change-Id: I63b64f1f241de3a76f9b66ed2cf524cc88933062
2022-03-31 21:29:17 +03:00
Vadim Yanitskiy 041411cb70 fix gsm_bts_get_cbch(): CBCH can be allocated on Cn
According to 3GPP TS 45.002, table 3, unlike the CCCH+SDCCH/4+CBCH
combination, which can only be allocated on C0/TS0, the SDCCH/8+CBCH
can be allocated on C0..n/TS0..3.  In other words, having CBCH on
e.g. TRX1/C1 is perfectly legal.  This is why in gsm_bts_get_cbch()
we should check all transceivers, not just the C0.

Change-Id: Ie79ccff4f8f0f1134757ec0c35e18b58081cc158
Related: SYS#5905
2022-03-31 17:37:31 +00:00
Vadim Yanitskiy 79d2af9b31 cbch_scheduler: cosmetic: s/bts_cbch_timer/bts_cbch_timer_cb/
Change-Id: Ibff3045d8066b644b437e46330848ebadfb373fd
2022-03-31 17:37:31 +00:00
Neels Hofmeyr a0c4a06371 hodec2: add penalty-time low-rxqual-ho
When bad RxQual causes handover to a cell with weaker RxLev, then
handover oscillation *will* happen, as shown in test_rxqual.ho_vty.
Introduce a penalty timer for a cell where we had bad RxQual.

This delays handover back to the cell with stronger RxLev by the penalty
timeout; hopefully the interference is gone after the timeout.

Usually, we set new configuration elements so that osmo-bsc behaves the
same as before the config item was added. In this instance, this makes
no sense, because no-one ever wants handover oscillation from bad
RxQual, which is guaranteed to happen without the new penalty timer. Set
it to 60 seconds by default, same as other penalty timers.

Related: SYS#5911
Change-Id: I057b156604a104a26a7ce45d1c7adadbf452c932
2022-03-31 14:43:48 +00:00
Neels Hofmeyr 9f691dfdb8 hodec2: show reported ho oscillation from bad rxqual
First show the problem.

Related: SYS#5911
Change-Id: I51f3101901492ae742d8e56d6eed2725408216cb
2022-03-31 14:43:48 +00:00
Harald Welte 968367caec CBSP: implement MESSAGE STATUS QUERY
This add support for handling inbound MESSAGE STATUS QUERY from the CBC,
and responding with MESSAGE STATUS QUERY COMPLETE or MESSAGE STATUS
QUERY FAILURE, as applicable.

Change-Id: I3b738dc29d0ead4f735abeeb6960d3675cb05ae2
Related: SYS#5909
2022-03-29 14:25:15 +00:00
Vadim Yanitskiy 7fb4817b78 struct gsm_encr: store alg_id in human-readable format
I find it weird that we store the A5 algorithm ID in a format that
is used on the wire: N + 1 (valid for both A-bis and A interfaces).
What confused me even more is that in some functions we print it
as if it was in a normal, human-readable format.  And this is
also why one can see weird constructions like:

  if (lchan->encr.alg_id > ALG_A5_NR_TO_RSL(0)) { ... }

Let's ensure that our internal structures use the A5/N format:

  alg_id=0: A5/0   (0x01 on the A-bis/A interface)
  alg_id=1: A5/1   (0x02 on the A-bis/A interface)
  alg_id=2: A5/2   (0x03 on the A-bis/A interface)
  ...
  alg_id=7: A5/7   (0x08 on the A-bis/A interface)

so that we can print and compare the value of alg_id without using
additional arithmetics.  Let's also rename 'alg_id' to 'alg_a5_n'
as it most clearly indicates which representation it is storing.

This is how the above code snippet would look like:

  if (lchan->encr.alg_a5_n > 0) { ... }

Change-Id: Ieb50c9a352cfa5481aebac2379e0a461663543ec
2022-03-29 11:50:12 +00:00
Harald Welte eba0a02017 SMSCB: Preserve padding at end of page in CBSP -> RSL conversion
When copying the CBS page content from CBSP to RSL data structures, we
use the User Information Length as length argument in the memcpy.  The
logic for that is that only this part of the message contains valid
data.

However, as the user information length is not passed on via RSL or
transmitted over the air, the receiving MS will get a  page with
zero-initialized padding, rather than whatever the originator of the
message has specified.  As zero bytes in the 8bit domain might get
translated into @-characters in the 7bit domain, this creates problems.

So instead, let's always copy the entire page (82 bytes) to ensure
transparency when passing on information from CBSP to RSL.

Change-Id: Iffcf1f6a7d41a08a2feffc6f2ac5634d940b63aa
Closes: SYS#5904
2022-03-28 18:48:08 +02:00
Vadim Yanitskiy 0d327979ee BSSMAP LE: handle optional LCS {Client Type, QoS} IEs
On receipt of the Perform Location Request message, the BSC needs
to forward it to the SMLC.  If the abovementioned IEs are present
in the original message, they must be delivered to the SMLC too.

Change-Id: Ifeb359b0468845da0b4fed9e2e4b79256067fa81
Depends: libosmocore.git I8775a93cf4089b1752d040e43d2cba6b8997f955
Related: SYS#5891
2022-03-22 19:17:44 +03:00
Vadim Yanitskiy b7f6623f60 BSSMAP LE: fix handling of LCS Client Type IE
On receipt of the Perform Location Request message, the BSC needs
to forward it to the SMLC.  If the LCS Client Type IE is present
in the original message, it must be delivered to the SMLC too.

Change-Id: Id3262e67c3dc25cb93fbd52a40689c5529ca2d41
Related: SYS#5891
2022-03-22 19:16:07 +03:00
Vadim Yanitskiy bd4a7dafd5 parse_bssmap_perf_loc_req(): make 'struct tlv_p_entry' pointer const
Change-Id: Ieba7f65667c5a1f9c0d7d2a350ec736994b1866e
2022-03-22 16:17:07 +03:00
Pau Espin 36fe6e4421 SI13: Get rid of si13_default
It's really confusing having a "default" struct whose inner values are
changing based on previous state. Furthermore, it's only used in
generate_si13() so there's no need to keep it outside the function.

Let's move it inside the function and rename it to avoid confusion.

Change-Id: I3ae4dd017dd4dad10c0365d21727666dd8e9fd41
2022-03-19 22:52:23 +01:00
Pau Espin 3ec2b8349c system_information: Move all si13 specific val update to generate_si13()
Change-Id: I6e920d1c8d8e1673194c88929586e8a1f22e09c5
2022-03-18 20:11:22 +01:00
Pau Espin 07fba2b629 SI13: Avoid enabling use_egprs_p_ch_req if egprs not supported
It makes no sense to enable that field if the ext_info.egprs_supported
field marks EGPRS as disabled.

From TS 44.060 11.2.5a:
"""
This message may be sent by an EGPRS capable mobile station
*in a cell supporting EGPRS* and where the EGPRS_PACKET_CHANNEL_REQUEST
parameter indicates that this message shall be used.
"""

Related: SYS#5891
Change-Id: I5ac173116f8681d7340b75b2baff110158fab9fd
2022-03-18 20:11:22 +01:00
Pau Espin 4501ed413c SI13: Make sure egprs_supported field is always updated
If "bts->gprs.mode" was changed dynamically at runtime (VTY or CTRL), it
could happen that the egprs_supported was kept as "1" if the dynamic
change was EGPRS->GPRS.

In summary, if EGPRS support was set, it couldn't be unset until BSC was
restarted.

Related: SYS#5894
Change-Id: Id2c2319044da474642c4cc710baa27cfee4fb592
2022-03-18 20:11:22 +01:00
Pau Espin 6dec88682f SI13: Always send ext_info
Values in ext_info are modified in several places, so it's difficult
validating whether we deviate from default. Let's always send it so that
we always have a clear view on what the MS uses.

This fixes a bug where paging_coordination or ccn_active would not be
announced if GPRS was not enabled.

Related: SYS#5894
Change-Id: If96de3e0d77503cf6344dfbc611f9260ac3281aa
2022-03-18 20:11:14 +01:00
Pau Espin 789d4e92c3 bts_vty.c: Fix typo in comment
Change-Id: Id4c49e93fe5b4eaa4efdac116df34853f359dd98
2022-03-18 20:00:25 +01:00
Vadim Yanitskiy c1f7452c16 System Information Type 3: allow updating T3212 at run-time
The value in bts->si_common.chan_desc may get out of sync with the
actual value in net->T_defs (e.g. after changing it via the VTY),
so we need to sync it in generate_si3().

Note that synchronizing the values in cfg_net_per_loc_upd_cmd is
a bad idea, because the value of T3212 may also be changed using
generic timer management commands.

Change-Id: Iee291623c2825505eeb5175adcedadfe35375b9e
Related: SYS#5888
2022-03-16 22:33:55 +03:00
Vadim Yanitskiy a76c9dcc3b gsm_bts_trx_set_system_infos(): cosmetic: improve readability
Change-Id: Ic63ee79c7509ec57ad72f85442b5756ae31c0a52
Related: SYS#5888
2022-03-16 22:33:04 +03:00
Vadim Yanitskiy 7c14a12a78 fixup: gsm48_make_ho_cmd(): optionally add Synchronization Indication IE
This was overlooked during the code review.  GCC does not complain
because internally both 'enum handover_scope' and 'bool' are
interpreted as 'int'.  Found this while running my WIP testcase
TC_srvcc_eutran_to_geran_a5_3.  This change makes it pass.

Change-Id: I807fd4a0e700e54c67ca3547d9c0c1b442dd1c54
Fixes: I4e5b1163a71443d706f14ce4bfd5c2294c320432
Related: SYS#5838
2022-03-14 17:26:16 +03:00
Vadim Yanitskiy 53d05951a5 gsm48_make_ho_cmd(): optionally add Synchronization Indication IE
Change-Id: I4e5b1163a71443d706f14ce4bfd5c2294c320432
Related: SYS#5838
2022-03-14 14:07:39 +03:00
Vadim Yanitskiy 2902d91d69 gsm48_make_ho_cmd(): optionally add Cipher Mode Setting IE
According to 3GPP TS 44.018, section 9.1.15, the RR Handover Command
message may optionally contain the Cipher Mode Setting IE (10.5.2.9).
Section 9.1.15.10 states that this IE may be omitted in case of the
intra-RAT GERAN-to-GERAN handover, however in case of the inter-RAT
handover (e.g. EUTRAN-to-GERAN), this IE *shall* always be included.

Change-Id: I1d270e82d0a9b12897fc94dae4e8999aa132a22f
Related: SYS#5838
2022-03-13 18:20:40 +03:00
Vadim Yanitskiy 798a71eb30 gsm48_make_ho_cmd(): make 'struct gsm_lchan' pointer const
Change-Id: I731179bf7f5d711ca114e36af661faccf0caa19f
2022-03-13 17:50:19 +03:00
Vadim Yanitskiy a0033f5da7 gsm48_make_ho_cmd(): cosmetic: use existing BTS pointer
Change-Id: I98abe2e43af1f8fa7e70fcf7155478b39751fced
2022-03-13 14:15:39 +03:00
Vadim Yanitskiy 0a01573bc1 gsm48_send_ho_cmd(): this function is not used, remove it
Change-Id: I9771d7e1f2073ebf6d900c067885485e54790bca
2022-03-13 14:15:39 +03:00
Vadim Yanitskiy 663d6fed0c system_information: fix DCS/PCS band indicator in generate_si6()
Change-Id: Iaa8377919a144e7f3799b76249f579c8f3874145
2022-03-10 15:54:29 +00:00
Vadim Yanitskiy be5a6c949e system_information: use is_ipaccess_bts() helper
Change-Id: Id14f39f50a6d7644f81b21c0b89e10f44901348b
2022-03-10 15:54:29 +00:00
Vadim Yanitskiy ef919cb8c1 fix inp_sig_cb(): dispatch TS_EV_OML_DOWN to all transceivers
When running a multi-trx setup, upon stopping osmo-bts one can see:

  DCHAN ERROR lchan_fsm.c:80 lchan(0-1-7-TCH_F-0)[0x612000010120]{UNUSED}:
              (type=NONE) lchan allocation failed in state UNUSED: LCHAN_EV_TS_ERROR
  DCHAN ERROR lchan_fsm.c:144 lchan(0-1-7-TCH_F-0)[0x612000010120]{UNUSED}:
              (type=NONE) lchan activation failed
              (lchan allocation failed in state UNUSED: LCHAN_EV_TS_ERROR)

These messages show up when the following conditions are met:

  * BTS model speaks A-bis over IP (ip.access, e.g. nanoBTS), and
  * BTS has more than one transceiver configured.

The problem is that unlike traditional E1 based BTS models, ip.access
ones have a single global A-bis/OML link for all transceivers.  Thus
when it goes down, in inp_sig_cb() we need to notify all timeslots
*of all TRXes*, not just TRX0.

Change-Id: I3dc657ac5a2c5334747bd4f4db1a658acb323942
Fixes: OS#5479
2022-03-09 08:30:40 +00:00
Neels Hofmeyr 9d0af34fc5 fix typo in name of BSS_MAP_MSG_ASSIGNMENT_RQST
Historically, we first only had
  BSS_MAP_MSG_ASSIGMENT_RQST
                   ^
with missing N. libosmocore has this renamed a long time ago and
provides a shim #define that makes the typo version still work.
Having the typo is bad for grepping, so rather use the non-typo name.

Also rename the constant for the ass req counter which so far has a
similar typo, and fix the same typo in the counter description.

The counter name exposed on CTRL luckily doesn't have this typo in it.

Change-Id: Ieaa4f4e6e6f7e1563b1bd15a83f0c1a9112d2312
2022-03-09 07:15:51 +00:00
Neels Hofmeyr c60fabb62b fix extraneous newlines in ho_fail() invocations
The ho_fail() macro includes a newline, so the callers should not add
one. Fix these cases where the extra '\n' fragments the logged message.

Related: SYS#5839
Change-Id: Ifdbce98be70c1aa127ae008d7a77b9795fd250d3
2022-03-09 07:15:51 +00:00
Neels Hofmeyr 826ec9ff75 inter-BSC incoming HO: store Codec List (MSC Preferred)
So far we completely ignore the codec list from the MSC in Handover
Request messages. This leads to error messages in subsequent handovers
because there is no Codec List stored on the conn:

  DHODEC ERROR handover_decision_2.c:390 [...] No Speech Codec List present, accepting all codecs

Besides the error log, in hodec2 we may subsequently take bogus or
unexpected codec decisions, ignoring the MSC's choice of codecs, or in
the worst case picking an unsupported codec.

This also has implications on what type of lchan we choose for handover
target in hodec2: say, if no half rate codec is supported as per the
MSC's request, we normally avoid handover to a TCH/H, etc.

Intra-BSC HO after an Inter-BSC incoming HO is the only case where this
problem occurs, in every other scenario there is an Assignment Request
from the MSC, from which we properly store the MSC's codec list.

3GPP TS 48.008 does indicate that on AoIP this codec list shall be
included. So reject HO Request with missing Codec List, as we already do
for Assignment Request on AoIP.

This makes TTCN3 BSC_Tests for inter-BSC incoming HO fail, because our
tests so far omit the Codec List (MSC Preferred) on AoIP. The related
fix of the tests is If06de9c9b43d79f749447a4e2a340176eef75c79.

Related: SYS#5839
Depends: If06de9c9b43d79f749447a4e2a340176eef75c79 (osmo-ttcn3-hacks)
Change-Id: I117cc29d6d11db77d160de654f43f5993db6ee21
2022-03-09 07:15:51 +00:00
Neels Hofmeyr 49a4820fc6 tweak error msg: s/inter-BSC MT/inter-BSC incoming
"inter-BSC MT" was the terminology of an early development stage of
inter-BSC handover, code review requested "incoming" instead. This one
was missed when applying code review.

Same in a code comment.

Related: SYS#5864
Change-Id: I1ca810542e89980ffda11876fd30626467e452d1
2022-03-09 00:01:06 +01:00
Neels Hofmeyr 908f014f09 support "empty" SCCP N-Connect from MSC
Teach osmo-bsc to handle empty N-Connect. So far we were always
expecting user data in an SCCP N-Connect from an MSC. However, it is
perfectly valid for an initial BSSMAP request to follow later.

This is relevant for:
- Handover Request (incoming inter-BSC handover)
- Perform Location Request (query physical location of the MS)

Add state WAIT_INITIAL_USER_DATA with new timeout net X25. Always enter
this state so that we don't have two separate code paths for handling
initial user data.

Related: SYS#5864
Change-Id: I535c791fa01e99a2226392eb05f676ba6c3cc16e
2022-03-09 00:01:06 +01:00
Neels Hofmeyr bdead6e87a add counter for inter-BSC incoming Handover Request
Related: SYS#5864
Change-Id: Icdde2bb339a5e367a4d297802214a1ef3f36eefa
2022-03-09 00:01:06 +01:00
Neels Hofmeyr d10d07b6e3 add missing counter increment for Perform Location Request
Also increment message counter for the case that a Perform Location
Request came in the initial SCCP N-Connect message.

Related: SYS#5864
Change-Id: I3f78ce73eb16fdff1f19359963405b2235000fc4
2022-03-08 23:00:21 +00:00
Vadim Yanitskiy 66a46ffa6a Fix description of BTS_CTR_BTS_RSL_FAIL: s/OML/RSL/
Change-Id: Icc3e603b08ab81869955ffa5b16ddfb458e83c78
Related: OS#4848
2022-03-06 20:20:47 +03:00
Neels Hofmeyr 1f089842a8 silence bogus error: event not permitted: READY_TO_SWITCH_RTP
During inter-BSC incoming handover, there is no previous lchan to be
switched, so this event always comes in the READY state of
lchan_rtp_fsm. No need to complain about that and confuse log readers.

Related: SYS#5864
Change-Id: I96fd53b8c8da621a40bd65f85070eabd030cc875
2022-03-03 23:19:46 +00:00
Neels Hofmeyr e761affc6a tweak logl to ERROR for invalid initial BSSMAP
Related: SYS#5864
Change-Id: Idd7d763129a5acdf19cd0ae86e82b77ee0073f2f
2022-03-03 22:22:12 +00:00
Vadim Yanitskiy df58a69bde bitvec2freq_list(): fix handling of E-GSM ARFCNs
According to 3GPP TS 44.018, section 10.5.2.1b.2, only ARFCN values
in range 1..124 can be encoded using the 'bit map 0' format.  Before
this patch, ARFCN values belonging to E-GSM band (0, 975..1023) were
ignored in bitvec2freq_list(), and thus not present in the resulting
Cell Channel Description IE.

Change-Id: I17739e6845cd84e2a81bc406dd532541f7c52cb6
Related: SYS#5854
2022-03-03 09:43:27 +00:00
Vadim Yanitskiy d1cacced51 bitvec2freq_list(): determine empty set by checking the ARFCN count
I find it cleaner to relay on the counter ('arfcns' in this case) to
check if the set is empty, rather than checking one of the resulting
values ('max').  There is just a cosmetic change.

Change-Id: I29ca51461beec053bcb8b8210f0ad24bb8c7765f
Related: SYS#5854
2022-03-03 09:43:27 +00:00
Vadim Yanitskiy 20c6d07bf2 tests/gsm0408: add testing coverage for generate_cell_chan_list()
This commit demonstrates what happens when a cell has channels in
both P-GSM and E-GSM bands (case 'c').  As can be seen from:

  Case a) only the BCCH carrier: 10
  Case b) more carriers from P-GSM band: 1 3 10 64 99 124
  Case c) more carriers from E-GSM band: 1 3 10 64 99 124

in both cases 'b' and 'c' we have the same set of ARFCNs.  Carriers
from the E-GSM band are not present at all.  This is wrong and will
be fixed in the follow up change(s).

Change-Id: Ied0519c70501f105673a9b36657101063d275058
Related: SYS#5854
2022-03-03 09:43:27 +00:00
Vadim Yanitskiy 82aebfeacf system_information: fix unused 'mask' parameter in list_arfcn()
The callers of this function do pass different mask values, which
should be passed to gsm48_decode_freq_list().  Instead, 0xce was
passed regardless of the given mask value.

Change-Id: I47f2eab54ef8487b14992fd7a69d5c9ccbb3f5cf
2022-03-03 09:43:27 +00:00
Pau Espin 8f1597135d ipa oml: Fix encoding of T3105
As the comment above the fix suggest, the encoding is in 10ms units.
osmo-bts is also doing the proper:
"""
uint8_t t3105 = *TLVP_VAL(&tp, NM_ATT_BTS_AIR_TIMER);
bts->t3105_ms = t3105 * 10;
"""

Related: SYS#5838
Change-Id: Ie190514ee35d1ca81b70e9180bf7393b973d3504
2022-03-02 17:34:43 +01:00
Pau Espin 10edefe68b tests: nanobts_omlattr_test: Use msgb_eq_data_print() helper
Change-Id: I1c96305839e6627a36655c2e64da64f0a6704896
2022-03-02 17:34:43 +01:00