aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2018-07-16prevent ARFCN+BSIC collisions in configneels/inter_bsc_ho_saved2Neels Hofmeyr3-0/+36
If multiple BTS are configured with identical ARFCN+BSIC, handover cannot possibly work. Add warn_on_arfcn_bsic_collisions() and when collisions are detected: - exit right away on program startup. - warn on vty bts node-exit (go_parent_cb()), i.e. when ARFCN+BSIC collide implicitly from default values. - warn on vty bts/base_station_id_code cmd coming from telnet vty, i.e. when the user actively configures colliding BSIC. - warn on vty trx/arfcn cmd coming from telnet vty, i.e. when the user actively configures colliding ARFCN. When warning, warn on all of: - DHO log, - stderr, - vty_out() in case a vty instance is passed (i.e. from interactive vty). It's better to log this once too often than let the user miss it. Rationale: when I started to implement ttcn3 tests for inter-bsc HO, I saw that the new code based on ARFCN+BSIC would cause a handover request intended to go from BTS 0 to BTS 1 to instead go from BTS 0 to back to BTS 0 -- because of identical ARFCN+BSIC in the config of ttcn3-bsc-tests. Such a config badly confuses handover: measurement reports interpreted to come from the wrong cell, all handovers attempted to go to the first BTS (sometimes correctly, sometimes wrongly), in short, non-obvious failure across the handover board. The network would appear to work well, but occasionally a handover would kill a call without apparent reason. It seems worthwhile to prevent such misconfiguration as early as possible, and even allow previous ARFCN+BSIC misconfiguration that used to work to instead break now (only upon reading config during program startup, to not cause program exit just because a user introduces a temporary collision in an interactive vty session). Change-Id: Ia7c38188ccbad5d8b7398e3e5220015e62c08c8b
2018-07-16allocate larger lchans if no SDCCH are availableNeels Hofmeyr1-0/+16
Related: OS#3332 Change-Id: I2fcf9e9baa7d03974a367763f3f52f59dfc2cc51
2018-07-16lchan_fsm: split off lchan_rtp_fsm, establish RTP a bit earlierNeels Hofmeyr13-501/+1057
Change-Id: Id7a4407d9b63be05ce63f5f2768b7d7e3d5c86fb
2018-07-16jenkins.sh: simpler invocation of verify_value_str...Neels Hofmeyr1-1/+1
Change-Id: I518c45838ca1631970bef526bf6a3251d69fb6ba
2018-07-16doc: copy current charts to doc/old/ for later referenceNeels Hofmeyr7-0/+587
Change-Id: Iac18f12529d5961a66e4853dc3a93636eb499127
2018-07-16create separate logging categories for lchan,ts,as FSMsNeels Hofmeyr6-3/+42
Change-Id: Ie889b8860a4a63c7c22ef65025f690d64cd7330c
2018-07-16vty: 'handover any': pick more random chans, use select_lchan()Neels Hofmeyr1-50/+46
Change-Id: I50b70e02d665b967e401db65581e110bc83101e7
2018-07-16cosmetic: constify gsm_bts_num() net argNeels Hofmeyr2-2/+2
2018-07-16fix BSC_CTR_ASSIGNMENT doc stringsNeels Hofmeyr1-7/+7
Change-Id: I9de0c16a14edd8bf4f02b7781ccfd211e0a79463
2018-07-16cosmetics: allow ignorable eventsNeels Hofmeyr3-7/+62
In various FSMs, some events may appear later or earlier without need of action. Do not indicate these as 'ERROR' (event not permitted), but allow and ignore them. Debug-log about some of those. From the old code, we've taken over the habit to change into WAIT_BEFORE_RF_RELEASE even before SAPI[0] is released. Hence we may still receive a SAPI[0] REL_IND in WAIT_BEFORE_RF_RELEASE. Don't show this as error message, just silently accept it. Change-Id: Ie320c7c6a1436184aaf2ec5a1843e04f4b3414ab
2018-07-16vty: fix 'show lchan'Neels Hofmeyr2-5/+5
In the vty, do not show lchan info for uninitialized lchans. For lchan->fi == NULL, lchan_state_is(UNUSED) returned false, and hence the vty interpreted all lchans as interesting. Change-Id: Iec855f1bbecfe5600fc943d815623e73dd70ff6a
2018-07-16handover_fsm: don't imply EST_INDNeels Hofmeyr2-4/+23
Change-Id: I030d7b5338deda05dd612e079753234874f6482e
2018-07-16fix RTP: remember port info from CRCX, not MDCXNeels Hofmeyr1-6/+0
On MDCX, we tell the endpoint where the MGW should send RTP. In rtp_info we want to remember what the MGW's own ip and port are, so we must only store the CRCX response, not the MDCX verb_info. Change-Id: Iddea6fd2c6a5974a029736075fdb25d49fcbba35
2018-07-16fix RTP: keep old lchan MGW CI on handover failureNeels Hofmeyr2-6/+30
When handover fails, do not tear down the old lchan's MGW endpoint ci. Change-Id: Id590c2b4e8cffbf2635b9af340ec2832f7f49ebd
2018-07-16fix RTP: send to MGW's IP:port, not back to the BTS itselfNeels Hofmeyr1-12/+6
Change-Id: I277908b451ef2d3b34ba1cccd24d884898f6425a
2018-07-16fix assignment FSM: allow early EV_LCHAN_ESTABLISHEDNeels Hofmeyr1-7/+20
Change-Id: Ia03d7b503f7425df038718be35a9ac3e40a90f8e
2018-07-16cosmetic: assignment_fsm: update ID after pchan switchNeels Hofmeyr1-0/+4
Change-Id: Ifc71bd8d4b214a114ddb8e2b5ee848fd466ddaf9
2018-07-16timeslot FSM: fix ts_fsm_in_use_onenter() for TCH/F_TCH/H_PDCHNeels Hofmeyr3-7/+134
Change-Id: I73947cc846e36558e48903e5445d81f7120837af
2018-07-16timeslot_fsm: fix name str of TS_ST_WAIT_PDCH_DEACTNeels Hofmeyr1-1/+1
Change-Id: I879f4e77490a251f7803febcbc464ecff55dfc71
2018-07-16large refactoring: use FSMs for lchans; add inter-BSC HONeels Hofmeyr73-4868/+8391
Add FSMs: - timeslot_fsm: handle dynamic timeslots and OML+RSL availability. - lchan_fsm: handle an individual lchan activation, RTP stream and release, signal the appropriate calling FSMs on success, failure, release. - mgw_endpoint_fsm: handle one entire endpoint with several CI. - assignment_fsm: BSSMAP Assignment Request. - handover_fsm: all of intra, inter-MO and inter-MT handover. Above FSMs absorb large parts of the gscon FSM. The gscon FSM was surpassing the maximum amount events (32), and it is more logical to treat assignment, handover and MGW procedures in separate FSMs. - Add logging macros for each FSM type: - LOG_TS() - LOG_LCHAN() - LOG_MGWEP(), LOG_CI() - LOG_ASSIGNMENT() - LOG_HO() These log with the osmo_fsm_inst where present. New style decision: logging without a final newline char is awkward, especially for gsmtap logging and when other logs interleave LOGPC() calls; we have various cases where the final \n goes missing, and also this invokes the log category checking N times instead of once. So I decided to make these macros *always* append a newline, but only if there is no final newline yet. I hope that the compiler optimizes the strlen() of the constant format strings away. Thus I can log with or without typing "\n" and always get an \n termination anyway. General: - replace osmo_timers, state enums and program-wide osmo_signal_dispatch() with dedicated FSM timeouts, states and events. - introduce a common way to handle Tnnn timers: gsm_timers.h/.c: struct T_def. These can be used (with some macro magic) to define a state's timeout once, and not make mistakes for each osmo_fsm_inst_state_chg(). Details: bsc_subscr_conn_fsm.c: - move most states of this FSM to lchan_fsm, assignment_fsm, handover_fsm and mgw_endpoint_fsm. - There is exactly one state for an ongoing Assignment, with all details handled in conn->assignment.fi. The state relies on the assignment_fsm's timeout. - There is one state for an ongoing Handover; except for an incoming Handover from a remote BSS, the gscon remains in ST_INIT until the new lchan and conn are both established. - move bssmap_add_lcls_status() to osmo_bsc_lcls.c abis_rsl.c: - move all dynamic timeslot logic away into timeslot_fsm. Only keep plain send/receive functions in abis_rsl.c - reduce some rsl functions to merely send a message, rename to "_tx_". - rsl_ipacc_mdcx(): add '_tx_' in the name; move parts that change the lchan state out into the lchan_fsm, the lchan->abis_ip.* are now set there prior to invoking this function. - move all timers and error/release handling away into various FSMs. - tweak ipa_smod_s_for_lchan() and ipa_rtp_pt_for_lchan() to not require an lchan passed, but just mode,type that they require. Rename to ipacc_speech_mode*() and ipacc_payload_type(). - add rsl_forward_layer3_info, used for inter-BSC HO MO, to just send the RR message received during BSSMAP Handover Command. - move various logging to LOG_LCHAN() in order to log with the lchan FSM instance. One drawback is that the lchan FSM is limited to one logging category, i.e. this moves some logging from DRR to DRSL. It might actually make sense to combine those categories. - lose LOGP...LOGPC logging cascades: they are bad for gsmtap logging and for performance. - handle_classmark_chg(): change logging, move cm2 len check out of the cm3 condition (I hope that's correct). - gsm48_send_ho_cmd(): split off gsm48_make_ho_cmd() which doesn't send right away, so that during inter-bsc HO we can make an RR Handover Command to send via the MSC to the remote BSS. assignment_fsm.c: - the Chan Mode Modify in case of re-using the same lchan is not implemented yet, because this was also missing in the previous implementation (OS#3357). osmo_bsc_api.c: - simplify bsc_mr_config() and move to lchan_fsm.c, the only caller; rename to lchan_mr_config(). (bsc_mr_config() used to copy the values to mr_bts_lv twice, once by member assignment and then again with a memcpy.) - During handover, we used to copy the MR config from the old lchan. Since we may handover between FR and HR, rather set the MR Config anew every time, so that FR rates are always available on FR lchans, and never on HR lchans. Depends: I03ee7ce840ecfa0b6a33358e7385528aabd4873f Change-Id: I82e3f918295daa83274a4cf803f046979f284366
2018-07-11add gsm_timers, for Tnnn definitions usable by FSMsNeels Hofmeyr23-180/+513
Change-Id: If212fcd042051b6fa53484254223614c5b93a9c6
2018-07-11move RSL and RR related functions to abis_rsl.[hc]Neels Hofmeyr6-593/+594
It doesn't make sense to spread them all over the place, and introduces odd dependencies from utility programs or regression test linkages. This is a cosmetic patch preparing for lchan activation refactoring. Change-Id: Ie8ee334145bf7bc3a601d395ea7ab9b2009b61c7
2018-07-11fix / clarify rsl dtap cacheNeels Hofmeyr9-161/+186
In certain situations like handover or assignment, DTAP must not go out via RSL directly but is cached to be submitted later. Make sure that all RSL DTAP sending adheres to this: gscon_submit_rsl_dtap() is the new "public" API to request an RSL DTAP to be sent. Depending on the gscon's state, this ends up in the cache or is sent directly. When caching, there is no way to tell whether sending will succeed or not, so semantically it does not make sense to even return a result code. Just return void. Change all "public" callers to gscon_submit_rsl_dtap(). Merge gsm0808_submit_dtap() and submit_dtap() guts to gsm0808_send_rsl_dtap(), static in bsc_subscr_conn_fsm.c: directly send DTAP, assume a conn->lchan to be present, or otherwise trigger a BSSMAP Clear Request. The static submit_dtap() becomes a thin convenience wrapper. Move ho_dtap_cache* functions to bsc_subscr_conn_fsm.c and rename to gscon_dtap_cache_* -- they are not only for handover, also for assignment. Function gsm0808_submit_dtap() m Introduce function gscon_submit_rsl_dtap() Change-Id: I6ffd7aa641c8905292c769400048c96aa0949585
2018-07-11doc: update/fix FSM chartsNeels Hofmeyr14-35/+194
Change-Id: I29e31b753e23a4207662e0e385a337e7df836f45
2018-07-11inter-BSC HO: add neighbor_ident API to manage neighbor-BSS-cellsNeels Hofmeyr21-5/+1968
Depends: Ia71ba742108b5ff020997bfb612ad5eb30d04fcd (libosmocore) Change-Id: I0153d7069817fba9146ddc11214de2757d7d37bf
2018-07-11call osmo_xua_msg_tall_ctx_init()Neels Hofmeyr1-0/+3
xua_msg allocations should not go unnoticed by our root ctx. libosmo-sigtran recently added this API to fix that. Depends: I618878680a096a7f7fc2d83098590f2e4cb08870 (libosmo-sccp) Change-Id: I8d5edda17be82e0cb4a1af3e2a62cbcb3a2ddda3
2018-07-11cosmetic: name osmo-bsc's root ctx 'osmo-bsc', not 'openbsc'Neels Hofmeyr1-1/+1
Change-Id: Ie038bbed436069e7849ba78c3c77c80a68bc3dad
2018-06-28filter: Allocate each ctr group with a different idxPau Espin Pedrol1-2/+18
Fixes following runtime warning: libosmocore/src/rate_ctr.c:219 counter group 'nat:filter' already exists for index 0, instead using index 1. This is a software bug that needs fixing. Forward-port from openbsc.git c08d58802e03a45f95b8f7d28b29dc7026f664ba. Change-Id: I7c5054c374281bb1d4bd1ecd76ddcca7a010d50a
2018-06-28filter: Replace '.' in counter names with ':'Pau Espin Pedrol1-3/+3
The '.' is illegal character in counter names, as they are exported via CTRL interface, where '.' has a special meaning that cannot be used by strings comprising the variable name. Forward-port from openbsc.git 360284d4d797519faed33559b0ae746b6c17e68a. Change-Id: I57b78162701a6a101b5cbaf68aaea89d17a0f819
2018-06-28filter: vty: Print policy list in cmd show access-listPau Espin Pedrol1-16/+17
Change-Id: I3761819fb29f6fe49995ce4c1ae0e9bf92f993cd
2018-06-28Rename bsc_msg_acc_lst_vty_init to have more uniform prefixPau Espin Pedrol3-3/+3
Change-Id: I6f125d040a8f511590ef67ba8babbd2e01c6bf21
2018-06-28Init access_lists before passing it as a parameterPau Espin Pedrol1-3/+1
Previous state is harmless because the pointer is stored but not used in that function. However, it's more clear this way. Change-Id: I048ebc120306ea30ea973d6ee16ed84c9f341183
2018-06-28bsc_vty: Write access list entries when storing bsc configPau Espin Pedrol3-2/+12
Change-Id: Ice8ce203a52b918e1eddb56ea437d082efd634bc
2018-06-28bsc-filter: Remove unused func barr_adapt and set barr_find staticPau Espin Pedrol2-68/+1
bar_find is set as static because it's still being used internally by other functions. Change-Id: I2db8f0ba60cf01929ce2c63edd9859612724de48
2018-06-26lcls: set codec info when performing MGW operationPhilipp Maier3-6/+10
While GSCON is setting the codec info when operating on the MGW, LCLS is not doing that yet. This means that the MDCX messages that are sent by LCLS do not contain any payload type and also no ptime or rtpmap fields. This also causes the following TTCN3 tests to fail: TC_lcls_connect_break TC_lcls_connect_clear TC_lcls_gcr_bway_connect TC_lcls_gcr_bway_dont_connect_csc - Make mgcp_pick_codec() public as bsc_subscr_pick_codec() - use bsc_subscr_pick_codec() to set codec info in osmo_bsc_lcls.c Change-Id: I383d55fa602cda0926dd701ee517a299db578260 Closes: OS#3358
2018-06-25gscon: pick suitable payload type / encoding name for MGCPPhilipp Maier1-0/+34
The GSCON FSM does not care about the codec information when performing interactions with the MGW. Before upgrading the client the codec information was hardcoded to AMR inside the client. Now the client offers APIs to set the codec information. Since this feature is new, osmo-bsc does not set any codec information yet, which causes many of the TTCN3 tests to fail. So lets add some logic to pick suitable codec info. - Hardcode ptime to 20 (is the same for all possible codecs) - Select a codec according to the flags in userplane Change-Id: Ibddc3492572b39f166e3a1b8b8120813ce2dadc2 Related: OS#2728
2018-06-25debian: Move meas related binaries into new package osmo-bsc-meas-utilsPau Espin Pedrol2-0/+7
Only meas_json is added so far, since the other related ones are conditionally built. Change-Id: I35ba3c19fcdfb5663691a67c9876537765963c5d
2018-06-18cosmetic / linking: move str_to_imsi() out of abis_rsl.cNeels Hofmeyr6-11/+14
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-15fix dyn TS init: properly identify BTS on OML OPSTART ACKNeels Hofmeyr4-27/+37
Commit "dyn ts, bts_ipaccess_nanobts.c: init PDCH on Chan OPSTART ACK" bf7099262adf0f27e71a08387747c5cb0d459360 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-15osmo-bsc: Add -V param to print versionPau Espin Pedrol1-1/+8
Change-Id: I74e0e40ee6b2ce66d76f151528d9a958683944c7
2018-06-15osmo-bsc: Clean help description of cmd line parametersPau Espin Pedrol1-10/+10
Change-Id: I2ce242e97445785c3f1d965d89e3f1b6ca6a37ab
2018-06-15pcu_sock: Log event pcu_sock createdPau Espin Pedrol1-0/+2
Change-Id: If5691d8e8bae7166e06382db589850ce94c20a30
2018-06-14absi_rsl: Fix segfault in rsl_rx_conn_fail()Harald Welte1-1/+2
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-11bsc_subscr_conn_fsm: BSC must not release SCCP connectionHarald Welte1-1/+3
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-11Add missing event string name for GSCON_EV_LCLS_FAILHarald Welte1-0/+1
Change-Id: Ia8c8303a87412ce6456c38ae29e3c55de9522ac0
2018-06-10remove traces of osmo-bsc_nat in python test (osmoappdesc/test_runner)Harald Welte2-82/+2
Change-Id: I9127ddb7b29eb82defd3a8afac9c1dbfd424fb72
2018-06-09Remove unused logging subsystems DCC and DMGCPHarald Welte2-14/+4
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-08Explicitly register CTRL-over-IPA callback with libosmo-sigtranHarald Welte1-1/+5
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-08Ignore "dest" command in MSC nodeHarald Welte1-0/+12
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-08make T10 configurable like the rest of themNeels Hofmeyr4-6/+9
Change-Id: I112c0db17d355d57eb08bc67121ccf49fbf53943