Commit Graph

6910 Commits

Author SHA1 Message Date
Oliver Smith 8d8d710a28 vty: add 'show rejected-bts'
Print IDs and IPs of recently rejected BTS devices. Example output:

OsmoBSC> show rejected-bts
Date                Site ID BTS ID IP
------------------- ------- ------ ---------------
2018-10-25 09:36:28    1234      0    192.168.1.37

Related: OS#2841
Change-Id: Iba3bfe8fc9432b7ae8f819df8bd71b35b3ec507e
2018-10-30 16:25:29 +01:00
Neels Hofmeyr a5ff9741bd fix build: revert bad neighbor_ident.vty change
The commit acd29192de
Change-Id Ifb9212fede2333ad68db94188b5cda4fcabe02f8
introduced a bad change to neighbor_ident.vty. Revert that bit.

Change-Id: I8b80be6daef73f5864ba9f294bf2134c8a76ddb5
2018-10-30 16:01:10 +01:00
Neels Hofmeyr 9c295257a0 handover_fsm: fix failure logging of uninitialized chan mode
The chan mode is figured out per-BTS, but may remain uninitialized. Rather log
info about the channel request, like further above.

Change-Id: I07b89b6101879fb7c070c87be9bd38cc05ffa0b1
2018-10-29 18:39:46 +01:00
Neels Hofmeyr 258d12f188 handover_fsm: fix missing newline for log statement
Change-Id: I41c04cfedaae4da69a2bc7d50b1f7fe0e467e0fa
2018-10-29 18:39:46 +01:00
Neels Hofmeyr 8821db2628 abis_rsl.c: fix uninitialized RSL cause issues
Separate the cause value passed to further functions from the log string.

The code tried to be nice by composing the RSL cause string and returning the
RSL cause at the same time, which falls on its face when the string composition
happens only within conditional logging.

Change-Id: Ibadd06102f162bca9182c39b77b0651568d3e6f8
2018-10-29 18:39:46 +01:00
Oliver Smith 75f038ddd3 cipher mode reject: send proper cause codes
bssmap_handle_cipher_mode() had code paths doing "goto reject" without
setting a meaningful cause value.

Related: OS#3186
Change-Id: Ia608fa34a6a2d3035a66d05fbc38553ac5186804
2018-10-25 10:15:33 +02:00
Oliver Smith dadd4055c3 cosmetic: fix spec ref for gsm0808_cipher_mode()
Change-Id: I359caf1dd30f033c0b606040ccf27aa4c5a9d2c6
2018-10-25 10:15:23 +02:00
Philipp Maier 9108d47f4a lchan_fsm: generate proper multirate configuration IE on RSL
During the generation of the multirate configuration IE in the channel
activation message that is sent over RSL, all AMR rates except the
highest one are trimmed. This was to ensure that the multirate
configuration IE only contains one codec rate per active set. Lets fix
that and generate a proper IE with threshold and hysteresis values.

- extend lchan_mr_config so that it can generate a full multirate
  configuration IE

Change-Id: I7f9f8e8d9e2724cbe3ce2f3599bc0e5185fd8453
Related: OS#3529
2018-10-24 09:22:41 +02:00
Philipp Maier e4faf59dfd bsc_vty: check amr mode parameters
The vty already has a well working interface to configure the AMR
mode, threshold and hysteresis parameters. However there are no checks
yet to prevent against misconfiguration.

- Use gsm48_multirate_config() to perform a global check of the overall
  configuration

- Add check AMR modes during input (order, duplicates)

Change-Id: I8b9f69b89a39bbf4800d9790f7abe43ce66aeb71
Related: OS#3529
2018-10-24 09:22:41 +02:00
Philipp Maier 3b9dcb3fc1 gsm_04_08: improve gsm48_multirate_config()
The function gsm48_multirate_config() generates the multirate
configuration IE, that is sent via RSL to configure the active set of
AMR codecs inside the BTS. The function already works, but it does not
check the input data for consistancy. Lets add some consistancy check to
make sure that inconsistant parameters are rejected. Also allow the
output pointer to be NULL, so that the function can be used to perform
a dry run to be able to verify parameters.

- Check for invalid / inconsistant configuration parameters
- Perform a dry-run when lv pointer is set to NULL

Change-Id: I06beb7dd7236c81c3a91af4d09c31891f4b910a4
Related: OS#3529
2018-10-24 09:22:41 +02:00
Philipp Maier bca82edab7 codec_pref: also check amr codec rates in check_codec_pref()
The function check_codec_pref() currently only does a basic check over
the general codec configuration of bts and msc. However, it does not yet
check if the amr codec rate settings for the BTSs contradict the
allowed/forbidden amr codec rates of the MSC. When the two settings do
contradict AMR would not work, even when everything else is correctly
configured. We need to check this on startup to spot configuration
problems quickly.

- Add function to calculate intersections of struct
  gsm48_multi_rate_conf variables.
- Calculate the intersection between the multi rate config of
  each BTS with the one of the MSC

Change-Id: I3537d1c89e2520d35cc0e150ba8e6d3693e06710
Related: OS#3529
2018-10-23 18:23:27 +00:00
Philipp Maier 5a63cd62aa gsm_data: set meaningful default values for amr modes
The function gsm_bts_alloc() does set default values for the amr rates
for a newly allocated bts, but it does not populate the ms_mode and
bts_mode flags which contain hysteresis and threshold. Those values are
currently set to 0 by default, which does not make much sense. Lets
popluate some appropriate default values.

- Make sure that .mode .hysteresis and .threshold are populated for
  MS and BTS in full and halfrate

Change-Id: If14843feeeea6584e5991d5c0abb765611dfaa57
Related: OS#3529
2018-10-23 09:50:11 +02:00
Neels Hofmeyr bcbc537e75 handover_decision_2.c: implement HO to remote BSS
Implement basic support for inter-BSC HO from handover_decision_2: do inter-BSC
handover only when rxlev / rxqual / ta drop below the minimum requirements.

I considered adding a vty config flag to disable/enable remote-BSS handover,
but to avoid inter-BSC HO the user can simply refrain from configuring
neighbors for a particular cell.

In collect_assignment_candidate(), it is important to clear out any new
candidate entry. Hence adopt the same pattern as below: first compose a new
(cleared) candidate, then write the entry into the list.

Related: OS#3638
Change-Id: Id78ac1b2016998a2931a23d62ec7a3f37bb764c6
2018-10-21 12:33:13 +00:00
Neels Hofmeyr f646451e8f handover_decision_2.c: refactor trigger_*()
a) Prepare for triggering handover for any candidate, remote or local.

b) drop redundant arguments.

Change-Id: I5ba8b556703010c8e232b516285a837c999f87ef
2018-10-21 12:33:13 +00:00
Harald Welte b0177b2dfc ipaccess-proxy: Add error handling to IAP CCM ID RESP parsing
Change-Id: I56ec149979572486b904fc1409cf3cd096b6eb34
Fixes: Coverity CID#188867
2018-10-21 12:20:02 +00:00
Harald Welte 7f2e8512cc acc_ramp: An unsigned int is always >= 0
Change-Id: I653ae9ede578370b4d7b1a150e9ec3c0702bbb31
Fixes: Coverity CID#188862
2018-10-21 12:19:56 +00:00
Harald Welte a52eed1d16 subscr_conn_fsm: Fix null-pointer deref / N-CONNECT.ind from unknown MSC
Change-Id: Id0eca3dd729d2e4c8c6ff83f05efde00b42c16f1
Fixes: Coverity CID#188860
2018-10-21 12:19:50 +00:00
Harald Welte 3c4661b5c8 bssmap_handle_cipher_mode(): Don't sent reject if !conn
We can only send a reject response if we have a valid conn.

Change-Id: I0ea535f494173ad4996c70dc82d7f69455e4e15e
Fixes: Coverity CID#188824
2018-10-21 12:19:45 +00:00
Harald Welte 60f08b57ef ipaccess-config: Fix open() return value checking
open() returning 0 is valid, but negative values indicate errors.

Change-Id: Id7e62116bfee550ef9906e78a0fce6f28af27a97
Fixes: Coverity CID#57865
2018-10-21 12:19:35 +00:00
Philipp Maier b1f66fe106 gsm_08_08: do not include zero length speech codec list.
When COMPLETE LAYER 3 INFORMATION is generated, it may include a speech
codec list that contains 0 elements (which is legal). The specification
requires the speech to be include if the network supports an IP based
user plane interface. It could be argumented that if no codecs are
available, the ip based user plane interface is not supported and
therefore the spec does not require the speech codec list IE to be
included for those cases. Lets check if the speech codec list has 0
elements and if its zero length, lets omit it completely.

- check for zero length speech codec list.
- omit speech codec list if it has zero elements

Change-Id: I07339322a71376e986a2d75b7bc1f552eafd02b5
Related: OS#3657
2018-10-21 12:15:03 +00:00
Harald Welte 298da0aeec handover_start_inter_bsc_in(): Uninitialized variable
This only afffects a log statement, so not really an issue.

Change-Id: I8e5b164194855f78a266c1a4441730cc6c378d11
Fixes: Coverity CID#188829
2018-10-21 11:17:11 +02:00
Harald Welte d4c391eab0 range_enc_determine_range(): Don't dereference array on size=0
Change-Id: I5bbb10af8b8e8ebc22bf79f5468e71a41b5e74b3
Fixes: Coverity CID#182710
2018-10-21 11:10:23 +02:00
Philipp Maier 7656f5f90a gsm_08_08: allow zero length speech codec lists in compl l3 info.
The COMPLETE LAYER 3 INFORMATION message contains a an Codec List (BSS
Supported). When generating the compl l3 info msg, we check if the
speech codec list that we have generated before has at least one
element. If it has 0 elements we abort immediately. However, speech
codec lists with 0 elements are permitted by the spec, so we should
remove the checks as there are corner cases where voice support is
intentionally unavailable.

- Remove check for zero length speech codec lists.

Change-Id: Id7332e5273ff0efb85043dd1e1bb804cfe2db944
Depends: libosmocore I1eb1f4466b98bdd26d765b0e4cc690b5e89e9dd6
Related: OS#3657
2018-10-17 09:44:10 +02:00
Oliver Smith f105190cc6 vty 'show bts'/'show trx': display IPs and ports
This quickly allows knowing which IP a BTS is using in order to SSH
into it. Example output:

OsmoBSC> show trx
...
  Baseband Transceiver NM State: Oper 'Enabled', Admin 'Unlocked', Avail 'OK'
  ip.access stream ID: 0x00 (r=192.168.1.178:34090<->l=192.168.1.37:3003)
...

OsmoBSC> show bts
...
  Paging: 0 pending requests, 50 free slots
  OML Link: (r=192.168.1.178:57692<->l=192.168.1.37:3002)
  OML Link state: connected 0 days 0 hours 0 min. 17 sec.
...

Related: OS#3145
Change-Id: I37f020fcdb68cafcdbdb621808483d1dd996354f
2018-10-16 13:55:10 +00:00
Neels Hofmeyr acd29192de remote-BSS neighbors: allow only one cell ID
I believe I have initially misinterpreted the idea behind sending a Cell
Identifier List in BSSMAP Handover Required messages. Instead of associating N
Cell Identifiers with one ARFCN+BSIC, the idea is to add up N separate
ARFCN+BSIC's Cell Identifiers into a list. To keep the door open for future
code simplification, make sure to allow only one Cell Identifier per remote
ARFCN+BSIC on the VTY UI.

Related: OS#3656
Change-Id: Ifb9212fede2333ad68db94188b5cda4fcabe02f8
2018-10-16 15:07:57 +02:00
Neels Hofmeyr b0479496e3 handover_fsm: adjust inter-BSC HO failure handling to spec
Inter-BSC outgoing lacked the required BSSMAP HO Failure dispatch.

Not all cases should send BSSMAP HO Failure, name the relevant spec paragraphs
in comments and adjust handling.

Related: osmo-ttcn3-hacks If772dbbc5f9790d3f911465e1303dd0a99811154
Change-Id: I0980cacb9713e41a1eef3a0a7f6cc892e8a20da5
2018-10-12 12:42:26 +02:00
Neels Hofmeyr 6fe125294b lchan_fsm: notify conn of released lchan upon RF Release
Related: osmo-ttcn3-hacks If772dbbc5f9790d3f911465e1303dd0a99811154
Change-Id: I7621616c24588c2db15ad1ae7ca68cfa0fb76f66
2018-10-12 12:42:26 +02:00
Neels Hofmeyr cd46adb915 handover_decision_2.c: drop redundant debug_candidate() args
No functional change.

Change-Id: Ida186946f40d30f4d9ed94d9c1ff9bdb70048626
2018-10-12 06:26:10 +00:00
Neels Hofmeyr ffa49cfffd handover_decision_2.c: find_alternative_lchan: drop goto
Don't goto the function end just to log something. Rather log right away and
exit early.

Change-Id: I6558a6948e8973cc91dae240375af074a5f5547e
2018-10-12 06:26:10 +00:00
Neels Hofmeyr d72c126f8b handover_decision_2.c: tweak ho candidate logging
Use a common LOGPHOCAND() to transparently log both local and remote
candidates.

Change-Id: I694e3832c55b4e972e05422e5e4508a74a222a71
2018-10-12 06:26:10 +00:00
Neels Hofmeyr bc6bc0a4ab handover_decision_2.c: tweak comments
Change-Id: I8bae3431dfaf23301e72f8f572286753b63a99b9
2018-10-12 06:26:10 +00:00
Neels Hofmeyr 0d91fb5ed1 lchan_fsm: fix failure handling: notify conn when released
Usually, conn->lchan is set to NULL before/upon releasing it. However, if the
lchan is still associated with a conn upon/after release, make sure the conn
realizes it has no lchan and sends a BSSMAP Clear Request to the MSC.

lchan_reset() is the last step before an lchan is fully unused. In there, make
sure to notify any conn that might still be associated, with
gscon_forget_lchan().

lchan_cleanup() does the same, but in fact this is only called when an lchan is
*deallocated*, but instead it usually merely goes to the UNUSED state.

It may make sense to call gscon_forget_lchan() sooner, e.g. when entering a
releasing state. This here nevertheless is a final safeguard.

Related: osmo-ttcn3-hacks If772dbbc5f9790d3f911465e1303dd0a99811154
Change-Id: I88337a18246c44ba48da64bb611a3cbb647a750e
2018-10-12 06:21:35 +00:00
Neels Hofmeyr 8b818a01b0 subscr conn: properly forget lchan before release
Clear all lchan->conn pointers when the subscr conn code is choosing to release
an lchan, with gscon_release_lchan().

Rationale: when an lchan releases in error, it should trigger the conn to be
notified and cause a BSSMAP Clear. However, if the conn is actively requesting
for an lchan release, it is already taking care of the situation.

Related: osmo-ttcn3-hacks If772dbbc5f9790d3f911465e1303dd0a99811154
Change-Id: I4fd582b41ba4599af704d670af83651d2450b1db
2018-10-12 06:21:35 +00:00
Neels Hofmeyr 6c5f5efa37 gscon_forget_lchan(): Clear Request iff no lchans remain
Send a BSSMAP Clear Request only if absolutely no lchan remains associated to
the conn, anywhere (Assignment, Handover as well as primary lchan).

Conceivable would be a situation where e.g. we're in handover and a new lchan
is ready, when just at a time where it doesn't matter anymore the old lchan
fails. We could just carry on with the new one then.

Change-Id: Ibd8e38ccf7759b8834efdedf742c46c227b26e91
2018-10-12 06:21:35 +00:00
Neels Hofmeyr 83ca9edfd1 gscon_forget_lchan(): no Clear Request after Clear Command
Send a BSSMAP Clear Request only if we are not already in ST_CLEARING, i.e.
haven't received a BSSMAP Clear Command yet.

Related: osmo-ttcn3-hacks If772dbbc5f9790d3f911465e1303dd0a99811154
Change-Id: Idc749068580da45e821e0af04cfa14cc7ce5c432
2018-10-12 06:21:35 +00:00
Neels Hofmeyr 30ca2a6515 fix counters for inter-BSC outgoing
Fix copy-paste error that resulted in counting outgoing inter-BSC HOs as
incoming ones.

Change-Id: I188b5db9e98c76153fdfb6f864d2cbfaea77bd5d
2018-10-12 06:19:29 +00:00
Daniel Willmann 54a80ab7e4 debian: Require libcdk and install meas_vis osmo-bsc-meas-utils
Change-Id: Ibe977a92acb93a78e323a40f53d653059b07bc0f
2018-10-12 00:38:35 +02:00
Philipp Maier b15af63ae9 codec_pref: also check physical channels
At the moment codec_pref only checks the codec configuration, but it
does not check if there is actually a matching physical channel
available. This should be checked too we must make sure that the codec
we select fits the physical channels available on the BTS.

Change-Id: I2d29dfed450e5ef93c26ed5ec9fdc0730eb3d7dd
Related: OS#3503
2018-10-10 11:58:02 +02:00
Philipp Maier bf3eb8f6eb codec_pref: cosmetic: seperate half/full rate determination
The function match_codec_pref determines whether a permitted speech
value belongs to a half-rate or full-rate codec. Lets seperate this into
a separate function.

Change-Id: Iec1db4621ba5a09bc0e3fc40b66f3a3bc5f54add
Related: OS#3503
2018-10-10 10:42:43 +02:00
Philipp Maier b5208d45b1 codec_pref: check codec configuration before start
In networks with a couple of different BTSs it may be likely that one
accidently sets up a codec configuration (codec-support)) that will be
mutually exclusive towards the codec configuration for the MSC
(codec-list). We need a check that validates the configuration before
start to catch such configuration flaws quickly.

- Add a check that checks each MSC codec-list against each BTS
  codec-support setting.

Change-Id: Ice827896bab1a2330741e0fccc731a04f1a07d38
Related: OS#3625
2018-10-08 09:50:12 +00:00
Harald Welte d4d4f918a8 nanoBTS: Allow BCCH with CBCH on TS0
Change-Id: I111c7f14e5f70ecbf6c660c1de24c6a5796b2eef
Closes: OS#3630
2018-10-06 23:12:05 +02:00
Philipp Maier 524a2d24b4 osmo_bsc_msc: Set reasonable codec list defaults
When the user sets no codec-list in the msc node, the configuration will
end up with an empty codec list. This is a useless configuration. There
should be a sane default setting.

- Set all possible codecs as default for codec-list

Change-Id: I3749a65828c788f38c22f0a5314533f4516da3ed
Related: OS#3625
2018-10-05 15:20:51 +02:00
Philipp Maier b9d3c71af3 gsm_08_08: abort complete L3 3 msg gen when no codecs are set
The COMPLETE LAYER 3 INFORMATION message should contain a Codec List
(BSS Supported) IE. The contents of this list depend on the BTS
capabilities and of the MSC configuration (allowed codecs). There may
be cases where (due to miss-configuration) the list is empty. In those
cases the BSC hits an assertion because the encoding of the overall
message fails when the codec list is empty. A check is needed.

- Check codec list before message generation, abort if the coded
  list is empty.

Change-Id: I119607047a132b75b3077bbe56c97936d8ae6c96
Related: OS#3625
2018-10-05 15:20:51 +02:00
Philipp Maier c9a4f697d3 codec_pref: handle S0-S15 in ASSIGNMENT REQUEST
Opposed to all other codecs that are common in GSM, AMR requires a codec
configuration that is expressed by a bitmask (S0 to S15) in the speech
codec list in the ASSIGNMENT REQUEST. Also the BSC acknowledges those
configuration in the ASSIGNMENT COMPLETE message.

At the moment osmo-bsc ignores all incoming configuration bits. The bits
in the ASSIGNMENT COMPLETE speech codec (choosen) field are hardcoded.

- Store the configuration bits while parsing the ASSIGNMENT COMPLETE
- Create an intersection with the configuration that is actually
  supported by the BSS
- Return the resulting (chosen) configuration bits with the assignment
  complete message.
- Use the (highest of the) agreed codec rates in RSL channel activation.

Change-Id: I2d8ded51b3eb4c003fe2da6f2d6f48d001b73737
Related: OS#3529
2018-10-05 07:58:22 +00:00
Oliver Smith 2043db0236 osmo_bsc_main.c: initialize rate counters
main() was missing a call to rate_ctr_init(). Without it, the counters
increased properly, but the times per second / minute / hour etc. values
would always stay at zero.

Change-Id: I4466a7aec51673c79b67614c9dde987633e379e0
Related: OS#3579
2018-10-04 14:07:05 +02:00
Pau Espin 6e141b1b8d abis_nm_get_ts: Return TS of correct TRX, not always TRX0
Seen while operating a setup with 2 TRX (2 nanobts):
DNM <0004> abis_nm.c:703 OC=CHANNEL(03) INST=(00,01,04): bts=0 trx=0 Opstart ACK
DTS <0011> bts_ipaccess_nanobts.c:308 timeslot(0-0-4-TCH_F)[0x612000008aa0]{UNUSED}: Received Event TS_EV_OML_READY
DTS <0011> bts_ipaccess_nanobts.c:308 timeslot(0-0-4-TCH_F)[0x612000008aa0]{UNUSED}: Event TS_EV_OML_READY not permitte

As it can be seen, OML log header state correctly it comes from TRX1,
but later content in line expresses TRX0, and that failure is forwarded
up the stack and channels for TRX different than TRX0 are never
initialized.

Related: OS#3560
Fixes: f0ff9a6711
Change-Id: I27e992e419422051247777b048175b724c05323e
2018-10-03 19:46:34 +02:00
Pau Espin ba68fe40bf osmo-bsc: Add default case for switch(enum)
After commit https://gerrit.osmocom.org/#/c/libosmo-abis/+/11207/
(Iaa33b793f89f2d16c9d949503c5ecc195bbcd2a4),
input_signal_data->link_type exposes proper enum type, and compiler can
warn about missing cases:

osmo-bsc/bts_ericsson_rbs2000.c: In function ‘inp_sig_cb’:
osmo-bsc/bts_ericsson_rbs2000.c:124:3: error: enumeration value ‘E1INP_SIGN_NONE’ not handled in switch [-Werror=switch]
   switch (isd->link_type) {
   ^~~~~~

Change-Id: Ia407a5072896377b68e914e2a05b5e01292ee8ee
2018-10-03 19:39:10 +02:00
Martin Hauke a82fc599b7 cosmetics: Fix typo in bsc_vty.c
Change-Id: I65d3e6c6dc252fd60d2dd6b6687ceef4d75034ed
2018-09-30 20:51:43 +02:00
Stefan Sperling 0cdd712be3 fix unaligned access in abis_nm_rx_ipacc()
Related: OS#3496
Change-Id: Ia9bdce39472719bfebec29e0a55a021ef45c8ea6
2018-09-28 23:18:24 +00:00
Neels Hofmeyr 8afdeee22e vty: write local neighbors by bts nr, not lac-ci
Change-Id: I35783f9624eacbdffccdb59a0179ffda54a26990
2018-09-27 03:32:35 +02:00