Commit Graph

6592 Commits

Author SHA1 Message Date
Pau Espin f8cf5263f9 debian: Move meas related binaries into new package osmo-bsc-meas-utils
Only meas_json is added so far, since the other related ones are
conditionally built.

Change-Id: I35ba3c19fcdfb5663691a67c9876537765963c5d
2018-06-25 19:22:16 +00:00
Neels Hofmeyr d0d204aaa2 cosmetic / linking: move str_to_imsi() out of abis_rsl.c
Move to gsm_04_08_utils.c so that it's possible to use it without
linking/stubbing all of RSL.

Change-Id: I6e90831d7e618ce3c8e7417082a82c97f6681668
2018-06-18 07:53:03 +02:00
Neels Hofmeyr f0ff9a6711 fix dyn TS init: properly identify BTS on OML OPSTART ACK
Commit "dyn ts, bts_ipaccess_nanobts.c: init PDCH on Chan OPSTART ACK"
bf7099262a Icf6e25ff068e8a2600562d52726ead65e864ec02
introduced signal S_NM_OPSTART_ACK and passed the FOM header to identify the BTS
by. But the FOM header's BTS number is zero on each Abis/IP link, and the BTS
and TRX are actually identified by msgb->dst == e1inp_sign_link, member trx. So
the initial implementation associated *all* Channel OPSTART ACKs with BTS 0.

Pass the entire msgb as S_NM_OPSTART_ACK signal argument, implement a
abis_nm_get_ts() to retrieve the proper timeslot and use that during timeslot
init.

Related: OS#3351 OS#3205
Change-Id: I45ce5c24cb62d00f350df1af1be6c11104d74193
2018-06-15 21:00:31 +02:00
Pau Espin e7d29e34e4 osmo-bsc: Add -V param to print version
Change-Id: I74e0e40ee6b2ce66d76f151528d9a958683944c7
2018-06-15 16:34:00 +02:00
Pau Espin d05d5e6afd osmo-bsc: Clean help description of cmd line parameters
Change-Id: I2ce242e97445785c3f1d965d89e3f1b6ca6a37ab
2018-06-15 15:48:50 +02:00
Pau Espin 41da945848 pcu_sock: Log event pcu_sock created
Change-Id: If5691d8e8bae7166e06382db589850ce94c20a30
2018-06-15 11:43:34 +00:00
Harald Welte cc2fb61a16 absi_rsl: Fix segfault in rsl_rx_conn_fail()
When we receive a RSL CONN FAIL IND, it may be that this happens
before any RLL is established (and hence a lchan->conn exists),
or after the RLLs have been shut down (and hence a lchan->conn doesn't
exist anymore).

So in this function, it is not legal to unconditionally dereference
lchan->conn.

Change-Id: I6380f5d2cd9364560ce3947517c84247cf4af0d4
Closes: OS#3182
2018-06-14 14:27:21 +02:00
Harald Welte 3f5716ce5d bsc_subscr_conn_fsm: BSC must not release SCCP connection
3GPP TS 48.006 section 9.2 states clearly that any SCCP connection
release must be initiated by the MSC.

for bsc_subscr_conn_fsm, this means that even after sending the
BSSMAP CLEAR COMPLETE, we must not terminate the FSM, as this would
cause a N-DISCONNET.req to be sent to the stack for the associated
SCCP connection.

The bsc_subscr_conn_fsm instances will hence stay alive until the MSC
eventually decises to release them.

Change-Id: Iaaca220b598609b77b600fcfc2f9a78b221c1fbb
Closes: OS#3331
2018-06-11 13:57:29 +02:00
Harald Welte 422260d7a2 Add missing event string name for GSCON_EV_LCLS_FAIL
Change-Id: Ia8c8303a87412ce6456c38ae29e3c55de9522ac0
2018-06-11 13:57:29 +02:00
Harald Welte aefcb75d56 remove traces of osmo-bsc_nat in python test (osmoappdesc/test_runner)
Change-Id: I9127ddb7b29eb82defd3a8afac9c1dbfd424fb72
2018-06-10 22:13:47 +02:00
Harald Welte 7325d9379d Remove unused logging subsystems DCC and DMGCP
We use the newly-introduced logging_vty_add_deprecated_subsys() from
libosmovty to make sure old config files will still parse even after
this change.

Change-Id: Ib4f67bb00e1d5460e643717b53f6a4d81278dc5d
2018-06-09 17:44:12 +02:00
Harald Welte cd326b3c20 Explicitly register CTRL-over-IPA callback with libosmo-sigtran
In Change-Id OSI6b7354f3b23a26bb4eab12213ca3d3b614c8154f we introduced
a function called osmo_ss7_asp_rx_unknown() which was supposed ot
override a weak symbol in libosmo-sigtran.  However, the related change
in libosmo-sigtran (I8616f914192000df0ec6547ff4ada80e0f9042a2) was
modified later on to use explicit registration of a call-back function
instead of weak symbol override.

Let's adopt the osmo-bsc code to make use of this explict call-back
registration.

Change-Id: Id5880ec90dfa00b29cbb0ffea8c8dd50e24742bd
Related: OS#2012
2018-06-08 20:35:35 +02:00
Harald Welte bc4f542d1d Ignore "dest" command in MSC node
In Change-Id I6b7354f3b23a26bb4eab12213ca3d3b614c8154f we removed
the "dest" vty command, but we should simply ignore it and print
a related warning during start.

Change-Id: I531825061031918bbb1380e1b485b711e81bcd75
2018-06-08 18:53:52 +02:00
Neels Hofmeyr 0c1ac9f010 make T10 configurable like the rest of them
Change-Id: I112c0db17d355d57eb08bc67121ccf49fbf53943
2018-06-08 16:16:42 +00:00
Neels Hofmeyr fc622c7241 drop dead code: conn->T10, handled by gscon instead
Change-Id: Ief20cb0f46dd93f46dd765dca307724dc2b3487c
2018-06-08 16:16:42 +00:00
Neels Hofmeyr 0abe84e679 HO: introduce T7, T8, T101 timers
Will be used in upcoming inter-BSC handover.

Change-Id: If9ecccc793426d214019f299b19d6ffa5a186546
2018-06-08 16:16:42 +00:00
Neels Hofmeyr 76739a7109 cosmetic: gscon: drop odd use of OSMO_STRINGIFY
Do not invoke OSMO_STRINGIFY() with arbitrary names, just quote instead.

The idea was that OSMO_STRINGIFY() avoids typos by ensuring well-defined names
are stringified, but this highlights that OSMO_STRINGIFY() is in fact usable
with completely arbitrary arguments and actually lacks the validation part :/

Change-Id: I458cd2cd0d6ddb0e6db3bb8d546a20336ae8c5f1
2018-06-08 16:16:42 +00:00
Neels Hofmeyr 44fcc9f11e doc: charts: illustrate new plan for ts and lchans
Add lchan and timeslot FSM charts to illustrate planning of how osmo-bsc should
handle lchan assignment and release.

Modify assignment, handover, lchan-release charts according to the new plan.

Change-Id: I18d60de5ee932c962aad0a532965a55d570bb936
2018-06-08 16:16:42 +00:00
Neels Hofmeyr c4bb31dcad doc: add ms-channel-request.msc
Change-Id: Iab22b8ae85a1a54d2f4002733e6068356368101b
2018-06-08 16:16:42 +00:00
Neels Hofmeyr 9d8d0c6731 doc: add lchan-release.msc
Change-Id: Ibcf2326cbc5a5f3f249ae15564825c83b5a063c8
2018-06-08 16:16:42 +00:00
Neels Hofmeyr c8658ac06e doc: tweak msc charts on Assignment/Handover: act_timer
Change-Id: I6205e43c227652432548c5c99bed5a197c095da2
2018-06-08 16:16:42 +00:00
Neels Hofmeyr bb6c13b862 cosmetic: handover_test: add IMSI to subscr for logging
Change-Id: I52fa8f3183c93ed362d8252d20daf00c60a117c8
2018-06-08 16:16:42 +00:00
Neels Hofmeyr 7c68e9048f store subscriber identity on paging
Another small step towards being aware of the subscriber identity.

Any connection initiated by paging will subsequently log the subscriber's
identity -- of course not necessarily the IMSI, if paging was done by TMSI.

This is only for Paging, not the Paging Response; for that see, L3 Complete.

Related: OS#2969
Change-Id: I0ab7bedfe693bb4e42a04fb0585b94a730ff2d9b
2018-06-08 16:16:42 +00:00
Neels Hofmeyr 81e912fa78 try to pick up subsrc IMSI on l3-compl
This is a tiny step towards being aware of a connection's subscriber identity.
Iff the Layer 3 Complete message contains an IMSI, associate a bsc_subscr with
the conn, so that subsequent logging and possibly meas_feed contains the IMSI.

For any L3 Complete using TMSI, this has no effect whatsoever.

Related: OS#2969
Change-Id: I3b696a0c0932e3abcb682ba231db65755d8c27a6
2018-06-08 16:16:42 +00:00
Neels Hofmeyr 8d6f444191 gscon: put subscriber a little later
Keep the bsc_subscr associated with the conn as long as possible, to benefit
logging, which then contains the subscriber identity (if any).

Change-Id: Ifa528b58842a02509bfe0af6915c64bd67058bcd
2018-06-08 16:16:42 +00:00
Neels Hofmeyr d3fff6f532 cosmetic: bsc_subscr_alloc: log initial get
Instead of silently setting the use count to 1, instead increment with an
explicit bsc_subsct_get(), which then logs the event along with the place that
created the subscriber.

Change-Id: Ia72f8010b7b2e1ca44e3b005c0f2c05f3eeae8d5
2018-06-08 16:16:42 +00:00
Neels Hofmeyr fb75d109a1 cosmetic: penalty timers: constify, tweak doc
Change-Id: I28addc9a16a4c81978290303d368f630a8334228
2018-06-08 16:16:42 +00:00
Neels Hofmeyr dd24cd39c0 use libosmocore's gsm0808_permitted_speech(), gsm0808_chosen_channel()
The guts of bssap_speech_from_lchan() and lchan_to_chosen_channel() have been
moved to libosmocore; call those instead.

The return value of bssap_speech_from_lchan() used to be -1 on error, now the
error value is 0. The only caller did not handle -1 properly, but fed it
directly to a uint8_t.

On gsm0808_chosen_channel() error, log the error. Proper handling is missing.

Fixing the error handling in send_ass_compl() is a separate issue: currently it
is limited to logging, there is no way to return an error yet, nor any actions
to take on error.

Depends: Icca23940791f97fa64dbc3f2734270b99f9550c1 (libosmocore)
Change-Id: Ib5c940a9dae11c5e26d4b47fa9d95fef889ad2f6
2018-06-08 16:16:42 +00:00
Neels Hofmeyr 8cb570cd06 log: assignment: add two logs on unexpected lchan release
Change-Id: Ib61125ebc41e55dc4a6595db8c8559c62b3ed2c0
2018-06-08 16:16:42 +00:00
Neels Hofmeyr 57f32626e3 log: fix logging in rsl_rx_chan_act_nack()
In each code path within rsl_rx_chan_act_nack(), do separate logging of the
NACK to ensure proper termination of each log line.

When receiving a Chan Act NACK, we possibly mixed a LOGP() within an
unterminated other LOGP() that had not been ended with a LOGPC() yet.

Change-Id: Icd2772b21ef3a2ff5af11b7c92dff0ecb4d87ff0
2018-06-08 16:16:42 +00:00
Neels Hofmeyr 0935546b2b assignment: signal assignment failure on chan act nack
When the BTS responds with a Chan Act NACK, i.e. the lchan could not be
activated, immediately signal Assignment Failure to the MSC (in
handle_chan_nack()).

In handle_chan_nack(), adjust log: instead of waiting for timeout, we now
signal Assignment Failure.

Drop misleading logging from bsc_assign_fail(): instead of transmitting the
Assignment Failure message, it actually signals an FSM event. Leave logging of
that to the FSM logging.

Change-Id: Ib204b4a5272f9b7b60ca5f932cd8a4c857316270
2018-06-08 05:47:54 +02:00
Neels Hofmeyr 13269b0f9b cosmetic: gscon: undup code: add common assignment_failed()
Call one common function to signal Assignment Failure and transition back to
ST_ACTIVE.

Change-Id: I1ce10a3ead286cdb6ad529fc293b6cecd151cc9a
2018-06-07 19:09:06 +02:00
Neels Hofmeyr 74c07c7b9c cosmetic: magic number: use RSL_ACT_ constant for chan act
Change-Id: I64ac2a17634f18322828ee2aa2284b0513130488
2018-06-07 19:09:06 +02:00
Neels Hofmeyr c19581f268 remove struct bsc_api
struct bsc_api was used to provide an abstract API for both osmo-bsc and
osmo-msc, between BSC and MSC. That's no longer needed, so get rid of it, to
prevent code turbulences it creates for no reason.

Change-Id: I3fd5888c63a0b4f95520a498320aa105a6d60579
2018-06-07 19:09:06 +02:00
Neels Hofmeyr 958f259f95 dissolve libbsc: move all to src/osmo-bsc, link .o files
Move all of libbsc/ into osmo-bsc/, and separate/move some implementations to
allow linking from utils/* and ipaccess/* without pulling in unccessary
dependencies.

Some utilities use gsm_network and gsm_bts structs, which already include data
structures for fairly advanced uses. Move initialization that only osmo-bsc
needs into new bsc_network_init() and bsc_bts_alloc_register() functions, so
that the leaner tools can use the old gsm_* versions without the need to link
everything (e.g. handover and lchan alloc code).

In some instances, there need to be stubs if to cut off linking "just before
the RSL level" and prevent dependencies from creeping in.
- abis_rsl_rcvmsg(): the only program currently interpreting RSL messages is
  osmo-bsc, the utils are merely concerned with OML, if at all.
- paging_flush_bts(): ip.access nanobts models call this when the RSL link is
  dropped. Only osmo-bsc actually needs to do anything there.
- on_gsm_ts_init(): the mechanism to trigger timeslot initialization is related
  to OML, while this action to take on init would pull in RSL dependencies.
utils/ and ipaccess/ each have a stubs.c file to implement these stubs. Tests
implement stubs inline where required.

From src/utils/, src/ipaccess/ and tests/*/, link in .o files from osmo-bsc/.
In order for this to work, the osmo-bsc subdir must be built before the other
source trees. (An alternative would be to include the .c files as sources, but
that would re-compile them in every source tree. Not a large burden really, but
unless linking .o files gives problems, let's have the quicker build.)

Minor obvious cleanups creep in with this patch, I will not bother to name them
individually now unless code review asks me to.

Rationale:

1) libbsc has been separate to use it for osmo-nitb and osmo-bsc in the old
openbsc.git. This is no longer required, and spreading over libbsc and osmo-bsc
is distracting.

2) Recently, ridiculous linking requirements have made adding new functions
cumbersome, because libbsc has started depending on osmo-bsc/*.c
implementations: on gscon FSM and bssap functions. For example, neither
bs11_config nor ipaccess-config nor bts_test need handover_cfg or BSSMAP
message composition. It makes no sense to link the entire osmo-bsc to it, nor
do we want to keep adding stubs to each linking realm.

Change-Id: I36a586726f5818121abe54d25654819fc451d3bf
2018-06-07 19:09:06 +02:00
Neels Hofmeyr 8f2aaf47c9 bsc_test: drop "scan to MSC" code path
The TEST_SCAN_TO_MSC is completely unused, but still the code linked
bsc_scan_bts_msg() for the unused code path. This is unlikely to ever be
expanded. Remove TEST_SCAN_TO_MSC and reduce linking requirements.

(I am this close to dropping the test entirely to avoid continuous linking
annoyance, but ok, since nothing else tests timezones AFAIK, keeping it.)

Change-Id: I27521950432e412f919cde811c9473557d0ec25e
2018-06-07 17:05:41 +00:00
Neels Hofmeyr 2583b62205 tests: remove channel_test
Rationale: channel_test is trivial and useless, probably only exists as a
legacy from openbsc.git.

- it tests two printf()s of "(bts=45,trx=0,ts=3,ss=4)", hardly useful.
- it tests ts_subslots() behavior for dyn ts, which will soon be replaced by a
  most trivial mapping that does no longer need complex dyn ts state
  evaluation (when introducing the new timeslot FSM to handle dyn TS switchover).

Change-Id: Ib2232da8e7fa964b92492d7b778320401dc97703
2018-06-07 17:05:41 +00:00
Neels Hofmeyr 5cb01655c5 tests: remove bssap_test
Rationale:

- All it does is compose four Paging Requests and feed it into the osmo-bsc
  bssap_udt, and expects the cell identifier to be decoded properly.
- To do so it employs a comparatively huge linking effort. This linking effort
  is becoming annoying in my ongoing work and is just not worth it.
- We have comprehensive cell identifier tests in ttcn3, verifying that the
  proper cells are paged, and that actually for *all* cell identifier types.

Change-Id: I07cf23b66de36cfa1142a11b9f85e9c0190ee314
2018-06-07 17:05:41 +00:00
Stefan Sperling 39a1d10c11 increment 'paging responded' counter for active paging only
Only count paging responses which can be mapped to an active paging.

Unsolicited paging responses which do not correspond to an active paging
would increment the 'paging response' counter. This means the number of
paging attempts could be smaller than the number of paging responses,
which can look confusing in the 'show statistics' VTY command.

Change-Id: I7cfc7c29fb7570d41e3ac23cca17f5b98b303506
Related: OS#66
2018-06-07 17:14:16 +02:00
Harald Welte b5f81b9fbd Reject ASSIGNMENT REQ with CIC but no AoIP transp addr in AoIP case
If we receive a BSSMAP ASSIGNMENT REQ for a speech channel
containing only a CIC but no AoIP transport layer address, then that's
illegal and must be rejected.

In Change-Id If362a0084de452727cd063063dfb645eca2f9beb we re-introduced
accepting CIC-only ASSIGNMENT REQ, but we failed to verify that this
actually only happens over a SCCPlite A interface.

This fixes the BSC_Tests.TC_assignment_cic_only testcase.

Change-Id: Ia6e3897edca48b9f838ea69939d9b8be7185abf8
2018-06-05 21:57:54 +02:00
Harald Welte 1f1c56c622 LCLS: add VTY config to enable/disable LCLS on per-MSC basis
The user might not want to enable LCLS support for administrative
reasons.  So let's keep it disabled by default, until somebody
explicitly enables it with "lcls-mode mgw-loop".

In the future, we may want to introduce a "lcls-mode bts-loop" where we
don't loop at the BSC-colocated MGW, but where we instruct the BTSs to
feed the RTP directly to each other.  This would require a
falt/transparent IP routing between the BTSs in the RAN.

Change-Id: Ied7985056c8cd182bf16119007a08cc5be14459b
Related: OS#1602
2018-06-03 12:26:42 +02:00
Harald Welte c997ceb750 Add initial 3GPP LCLS support to OsmoBSC
This code contains the following code:
* receive/parse/interpret LCLS specific BSSMAP IEs and PDUs
* osmo_fsm handling the various states and their transitions
* call leg correlation (finding the other subscr_conn with same GCR)
* communication between the two call-leg LCLS FSMs
* detection of supported / unsupported LCLS configurations
* display of GCR / LCLS information in "show conns"
* switch the media streams locally using MDCX to the MGW

Closes: OS#1602
Change-Id: I614fade62834def5cafc94c4d2578cd747a3f9f7
2018-06-02 20:56:17 +02:00
Harald Welte 00965dca2b VTY: Print some more information in "show conns"
We now print information such as
* SCCP connection ID
* MSC number
* handover decision2 fail count
* channel mode (SIGN/SPEECH)
* MGW endpoint
* secondary lchan (if any, e.g. during assignment)
* don't crash if conn->lchan == NULL

Change-Id: I2f8000844afc9da93ca39976399e5f76a45530de
2018-06-02 20:56:17 +02:00
Pau Espin 8bf8142dba abis_rsl: rsl_rx_chan_rqd: Format bts log string as in everywhere else
Change-Id: I7928d78e2ce3e6eca545455d08bc89ca67e01f9f
2018-05-30 14:32:59 +00:00
Pau Espin fe82012b01 abis_rsl.c: Fix whitespace
Change-Id: I67659275beda1b6a89bdf11eb0231438b0c8b912
2018-05-30 14:32:59 +00:00
Pau Espin 18a4ae818f chan_alloc: Print bts nr on chan alloc failure
Also change format of related debug message to match similar format than
gsm_ts_and_pchan_name().

Change-Id: Id4f875944c40fd862fc63feec82216c45d2e41c2
2018-05-30 14:32:59 +00:00
Neels Hofmeyr 71e5a827ef doc: add msc charts on Assignment/Handover internals
In doc/, add two message sequence charts with lots of implementation specifics,
to clarify the current code state. Mark various problems in red notes.

This chart and others should help to illustrate future code changes as I go
along refactoring handover, lchan allocation and adding inter-BSC handover.

Change-Id: I20999e938441d4fed2d37462b262b74a696f616d
2018-05-28 14:30:23 +02:00
Pau Espin 67f20bc356 acc_ramp: Increase log level of some messages
Right now, it's impossible to see any ACC Ramping information unless RSL
category is set to DEBUG. Barring and Allowing Access Control Class is
an important event which should be printed in most cases.

Increase log levels of messages printed during some error conditions to
be handled as errors.

Change-Id: I5404e91fe7c0b3209e8033594e659387bbc924d6
2018-05-28 11:58:06 +00:00
Harald Welte 1876c3108c move 'extern struct gsm_network *bsc_gsmnet" to header file
It's not a good idea to keep extern declarations copied over
half a dozen C files.  Let's move it to a header.

Change-Id: I6f643f1393ba0955d9c0cf1cf78d5c604e7b9451
2018-05-27 20:17:06 +02:00
Harald Welte 68e4be9c84 Remove 'struct bsc_msc_connection' + fix IPA-encapsulated CTRL
The bsc_msc_connection dates back to the old pre-libosmo-sigtran
days, and 90% of the field members weren't used at all (even the
new sigtran specific ones!).  Let's merge what remains into struct
bsc_msc_data.

As a side effect, the already dysfunctional "dest A.B.C.D" VTY
command has been removed from the MSC node.

There's quite a bit of fall-out in the CTRL interface, which was
the code with strongest ties to bsc_msc_connection.  This was
resolved by properly porting CTRL handling over to libosmo-sigtran,
meaning that an IPA/SCCPlite connected MSC can now again send CTRL
GET/SET commands, and can also receive those selective few TRAPs
that old osmo-bsc-sccplite also sent to its MSC[s].

Change-Id: I6b7354f3b23a26bb4eab12213ca3d3b614c8154f
Related: OS#2012
2018-05-27 20:17:02 +02:00