aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/libbsc/bsc_init.c
AgeCommit message (Collapse)AuthorFilesLines
2018-03-22backport support for 3-digit MNC with leading zerosneels/mnc3Neels Hofmeyr1-3/+4
Backport the patches with the following change-ids: osmo-bsc.git: I5b097dbb6329f284e3b4914a744d5c3ad628f715 I8e722103344186fde118b26d8353db95a4581daa I78f30aef7aa224b2e9db54c3a844d8f520b3aee0 I38ac98a4d25159cfd4f686efbfbaf8f00625a6d8 osmo-iuh.git: I29ebcddd45fe3079f8883589a83cc7216a535475 Also apply change of ipac_bcch_info.cgi to struct osmo_cell_global_id in src/ipaccess/network_listen.c, a change that appears to not have been necessary in the new split repositories. Related: OS#3010 Change-Id: Ibf50fd7e1ca5472d0a38fcb87c68227d6de44f42
2018-03-14Add support for Access Control Class ramping.Stefan Sperling1-1/+14
Access Control Class (ACC) ramping is used to slowly make the cell available to an increasing number of MS. This avoids overload at startup time in cases where a lot of MS would discover the new cell and try to connect to it all at once. Ramping behaviour can be configured with new VTY commands: [no] access-control-class-ramping access-control-class-ramping-step-interval (<30-600>|dynamic) access-control-class-ramping-step-size (<1-10>) (The minimum and maximum values for these parameters are hard-coded, but could be changed if they are found to be inadequate.) The VTY command 'show bts' has been extended to display the current ACC ramping configuration. By default, ACC ramping is disabled. When enabled, the default behaviour is to enable one ACC per ramping step with a 'dynamic' step interval. This means the ramping interval (time between steps) is scaled to the channel load average of the BTS, i.e. the number of used vs. available channels measured over a certain amount of time. Below is an example of debug log output with ACC ramping enabled, while many 'mobile' programs are concurrently trying to connect to the network via an osmo-bts-virtual BTS. Initially, all ACCs are barred, and then only one class is allowed. Then the current BTS channel load average is consulted for scheduling the next ramping step. While the channel load average is low, ramping proceeds faster, and while it is is high, ramping proceeds slower: (bts=0) ACC RAMP: barring Access Control Class 0 (bts=0) ACC RAMP: barring Access Control Class 1 (bts=0) ACC RAMP: barring Access Control Class 2 (bts=0) ACC RAMP: barring Access Control Class 3 (bts=0) ACC RAMP: barring Access Control Class 4 (bts=0) ACC RAMP: barring Access Control Class 5 (bts=0) ACC RAMP: barring Access Control Class 6 (bts=0) ACC RAMP: barring Access Control Class 7 (bts=0) ACC RAMP: barring Access Control Class 8 (bts=0) ACC RAMP: barring Access Control Class 9 (bts=0) ACC RAMP: allowing Access Control Class 0 (bts=0) ACC RAMP: step interval set to 30 seconds based on 0% channel load average (bts=0) ACC RAMP: allowing Access Control Class 1 (bts=0) ACC RAMP: step interval set to 354 seconds based on 59% channel load average (bts=0) ACC RAMP: allowing Access Control Class 2 (bts=0) ACC RAMP: step interval set to 30 seconds based on 0% channel load average (bts=0) ACC RAMP: allowing Access Control Class 3 (bts=0) ACC RAMP: step interval set to 30 seconds based on 0% channel load average Port of osmo-bsc commit a5c1e8727c391bc56847a00b2ecc08787573b91f Change-Id: Idd5c4fd7ea2e10086d9b26deee3a71f9469d1280 Related: OS#2591
2018-03-14Make "waiting indicator" of IMMEDIATE ASSIGN REJECT dynamic.Stefan Sperling1-0/+2
The IMMEDIATE ASSIGN REJECT message contains a wait indicator which tells an MS requesting a channel to wait for a specified amount of time before trying to request a channel again, i.e. the wait indicator controls the T3122 timeout value in the MS. Previously, the wait indicator was fixed to 10 seconds. This is not sufficient if there are a lot of MS requesting channels because the MS will retry too soon. Instead of using a fixed value, maintain a dynamic wait indicator value based on average channel load. The load (used vs. available channels on a BTS) is sampled once per second, and once 8 samples have been collected we update a BTS-specific T3122 wait indicator based on the measured load. While the wait indicator could go up to 255 seconds, this initial implementation keeps it in the range from 10 to 128 seconds. Further experimentation and testing will show whether higher wait indicator values are desirable, if the sampling rate needs to change, or if the function mapping the load measurement to a wait indicator value should change (currently we map the load average linearly into the range [10, 128] inclusive). Port of osmo-bsc commit 6cee893a0f2c4e53155a2631aff12a5f615b973d Change-Id: Id9df0e790ece8108212b2ddf718cf2953f5b9bd4 Related: OS#2592
2017-07-16gsm_bts_trx_set_system_infos(): Disable non-existing SIHarald Welte1-6/+17
If we previously had a given SI present/active, we must send a zero-length BCCH FILLING for that SI type to the BTS to stop it from further transmitting this SI. Change-Id: I33e356e2fa3a69efac9080813e3e9ef4e6438ed1 Closes: OS#2368
2017-07-15Fix regression causing loss of static system-information messagesHarald Welte1-2/+2
In commit 8b1a2f8cd7a81c6b8c7cdb0963dcf89de7c46100 we started to initialize bts->si_valid to 0. This means we are skipping the manually configured static system information. Instead, we have to initialize bts->si_valid to bts->si_mode_static, i.e. start with those that are static and not to be auto-generated. Found while developing http://git.osmocom.org/osmo-ttcn3-hacks/tree/sysinfo Change-Id: Iab9cc93cf6d54560a72cc393cc3721a8d10e04bf Closes: #2367
2017-07-10Fix BTS attribute requestsMax1-2/+2
* fix BTS numbers: use 0 to indicate given BTS and 0xFF to indicate all BTS' as it's explained in 3GPP TS 52.021 §9.3. * only request attributes from supported (OsmoBTS) types Change-Id: I8f43055c38000248033a8ff9ddaf0910d68d794b Related: OS#2317
2017-06-15bsc_init: Forget which SIs are valid for the trxMax1-2/+4
Previously the SI generation lead to setting the BCCH SIs for all TRX in a multi-trx setup. This is because we create the SIs globally but si_valid appears to be limited to the 'current' trx. Warn if we attempt to set SIs for the BCCH on a trx that does not have a BCCH. Change-Id: Ie0e288252a2e7709c4dae16b96a0b1512278847f Tweaked-by: Max <msuraev@sysmocom.de>
2017-06-15Update SI data structures and generationMax1-1/+5
To support segmented SI2quater as per 3GPP TS 44.018 we'll have to support multiple SI messages (up to 16 for SI2q) for a given type in contrast to existing 1:1 mapping: * expand storage space to hold up to 16 SI messages (spec limit) * add assertions for budget calculations * generate multiple SI2q messages * adjust SI2q-related tests * use precise check for number of SIq messages instead of approximate estimation Change-Id: Ic516ec9f0b821557d9461ae9f1c0afdd786f3b05 Related: OS#1660
2017-06-15Move SI-related definesMax1-1/+1
* move SI2quater related defines to shared header * add define from OsmoBTS which checks for presence of a given SI message in gsm_bts struct. Rename it to avoid conflicts with OsmoBTS code and to match naming conventions of similar macros. Change-Id: I11432c93c772d1ead6d45a7bb0f1d13d492c82f1 Related: OS#1660
2017-06-09Get TRX attributesMax1-5/+11
Request per-TRX attributes in addition to BTS attributes. Change-Id: I2b61131b9930afd03357c0b66947ee856d58cc46 Related: OS#1614
2017-05-29libbsc: Create pcu-socket only as specified in config fileHarald Welte1-14/+0
Since commit b4999b60d48bcbb5aa575973d068e07ab672e095 we created PCU sockets at hard-coded paths in the filesystem by default for all BTSs. This is inflexible and prevents the use of multiple BSC instances on a single filesystem, or the placement of the sockets in a more secure location than /tmp. The new approach with this patch is that * no PCU sockets are created by default * only for those BTSs where a 'pcu-socket' is configured via VTY, the socket will actually be created Change-Id: Ie9079470584777dcc31f85f9bf0808f479156ccb Closes: OS#2293
2017-05-25Use new e1inp_signal_names from libosmo-abis to print input signal namesHarald Welte1-2/+2
Change-Id: I156027ecdd1456228c9f8776577edd48e70c19da
2017-05-25pcu_sock: add basic pcu interface supportPhilipp Maier1-0/+22
Adds a basic version of a pcu socket interface, similar to the one that can be found in osmo-bts. Change-Id: Ib13cb4099d12fa71e9e0b8727e19ab29e11909b2
2017-05-25libbsc: add debug log message to S_L_INP_* callbacksPhilipp Maier1-0/+2
Improve debug log output of input callbacks by adding a line containing the signal event name. Change-Id: Ifca46dd8b356d0de31cccbd79e406079d3a0d7d2
2017-05-17Get basic BTS attributesMax1-0/+6
Request BTS attributes via OML on connection and parse the response: request/parse incoming response as sw-config. Note: only basic BTS-wide KV attributes wrapped in sw-config are supported for now. Change-Id: I589be51daca0cb9e1f3473b93e910e46b06e23ae Related: OS#1614
2017-03-16Don't drop OML links for Get Attributes NACKMax1-10/+10
Previously any OML NACK message will result in BSC dropping OML link to BTS which makes it impossible to use optional OML messages which might be unsupported by BTS. Fix this for 3GPP TS 52.021 §8.11.1 Get Attributes message. Also, log human-readable NACK name to see what exactly causing OML link drop. Change-Id: Ib8af2872c27abb793172ec59bdc145b8d54f83da Related: OS#1614
2017-01-06Cosmetic fixes around SI generationMax1-1/+1
* add missing spaces after comma and minus * prevent useless recursion calls * mark static functions as such * name and explicitly use enum for ARFCN range Change-Id: If5b717445c8b24668bad0e78fd5bb51f66c4d18e
2016-12-02split bsc_bootstrap_network() in alloc and configNeels Hofmeyr1-5/+9
For patch clarity, keep some code dup to be removed in a subsequent patch. In the same sense don't change the fact that mncc_sock_init()'s return value is ignored. The global gsm_network instance 'bsc_gsmnet' is basically only used by the VTY, and a future patch will "hide" that global in a vty .c file. In a nutshell, I want to - first allocate a gsm_network, - then initialize the VTY passing the gsm_network pointer, - and then read the config file using the initialized VTY. So far, bsc_bootstrap_network() allocates the gsm_network and reads the config file right away, which only works by sharing the extern bsc_gsmnet pointer, which I would like to uncouple. Change-Id: I480a09a31a79766ad07b627dd5238b7e37f3be7a
2016-11-24move to libcommon-cs: net init 2: move bsc_network_init decl to new .hNeels Hofmeyr1-1/+1
bsc_network_init() is more fit to live in a BSC specific header, move it to new common_bsc.h. It will probably also absorb the BSC-specific part of gsm_network in the future. Adjust header includes across the board. Particularly, fix abis_nm.h by explicitly including gsm_data.h: it so far relied on other headers to do that, which now is no longer always given. Change-Id: I9edfb1e748bb1cb484fadd48b0406f5b3098e89b
2016-11-24move to libcommon-cs: net init 1: rename to bsc_network_initNeels Hofmeyr1-1/+2
The gsm_network_init() function initializes a whole lot of BSC specific stuff. Aiming to move some of it to libcommon-cs, first rename it to bsc_network_init(). This will retain the BSC specific stuff when the move is done. Adjust all callers. Future: osmo-cscn will call the more generic part and not the BSC specific part. Change-Id: I4816ae19374390fc5c64972f7cad2e9ec3d8bcc3
2016-11-24define mncc_recv_cb_t to avoid code dupNeels Hofmeyr1-2/+1
Put mncc_recv_cb_t in common_cs.h to avoid header include complications: if placing right above struct gsm_network, one must include gsm_data.h to use mncc_recv_cb_t as function parameter in a header, which will include gsm_data_shared.h, which will include common_cs.h (future knowledge). Since I will need to use mncc_recv_cb_t in common_cs.h, including gsm_data.h from there would introduce an #include loop. Avoid that and define mncc_recv_cb_t in common_cs.h to begin with. Change-Id: I2e64cffa563750ce9f3172ffba6f9cf5b9280e9c
2016-10-13Log use of incompatible BS-AG-BLKS-RES valueMax1-2/+7
There's "channel-descrption bs-ag-blks-res" vty command which sets BS-AG-BLKS-RES which might be too high if CCCH is combined with SDCCHs. Previously proper value was silently enforced. Log this situation explicitly and add spec reference to the comment. Change-Id: I53e2b881fc28472d6709f063fb265a4e6a0fffcd
2016-09-27log VTY telnet bind only onceNeels Hofmeyr1-2/+0
After libosmocore 55dc2edc89c1a85187ef8aafc09f7d922383231f which outputs 'telnet at <ip> <port>' from telnet_init_dynif(), there's no need to log the telnet VTY bind here anymore. Change-Id: I97a730b28759df1d549a5049f47a3da1c16a3447
2016-09-26mscsplit: gsm_network_init(): add explicit root talloc ctxNeels Hofmeyr1-1/+1
Decouple the root talloc context from libbsc's global talloc_bsc_ctx. This allows to define the root talloc ctx from a main() scope, which in turn helps decouple libmsc from libbsc. Change-Id: I92f6b47b1eeea2e8f3fba66f25d7e708e5659f8a
2016-09-26mscsplit: bsc_init: don't pass telnet dummy connNeels Hofmeyr1-4/+1
We want to create the telnet for VTY only after reading the config file, and the dummy_conn was a workaround to be able to do so, but is not needed: gsmnet_from_vty() used to expect vty->priv to point to a gsm_network struct, but that is not actually the case anymore. It is using a static pointer to store the gsm_network struct instead. Change-Id: I51e7224c5a4cd5baf564bee871cf2fa6e885cda7
2016-08-29libmsc/bsc: split rate counters into bsc and msc groupAlexander Couzens1-2/+2
Tweaked-By: Neels Hofmeyr <nhofmeyr@sysmocom.de> Change-Id: I7361033cd1eb919ec3c2ea2652f40ab8c75b2f99
2016-08-27libbsc/libmsc: convert old osmo counter into rate_ctrgsAlexander Couzens1-2/+2
rate counters support the export to statsd and can have a delta value. Change-Id: Ie749cebd53a0bb618d0e23d375885712078bf8dd
2016-06-14dyn PDCH: send PDCH ACT for each TCH/F_PDCH on TS EnableNeels Hofmeyr1-3/+1
Add dyn_pdch_init() in new file bsc_dyn_pdch.c (new file to avoid linking issues; bsc_init.c would create undefined references, and putting in a new file is the easiest solution). Call dyn_pdch_init() from nm_statechg_event() whenever a TS is enabled. Revert the |= TS_F_PDCH_MODE chunk from previous commit, since this flag will now be set after dyn_pdch_init() sent out the PDCH ACT and when subsequently the PDCH ACT ACK messages are received in rsl_rx_pdch_act_ack(). Change-Id: I0cad93dec59d546b3f3b19e332e0833496031575
2016-06-14dyn PDCH: Automatically deactivate/activate PDCH on TCH/F+PDCH channelAndreas Eversberg1-1/+3
Handle shared TCH/F+PDCH channels as regular TCH/F channels. Prior to activation, deactivate PDCH mode. After deactivation, restore PDCH mode. Change-Id: I59712b8769cc3959ef114a6e12e77801816fe8b6
2016-05-17Move DTX settings to BTSMax1-6/+0
* Add per-BTS DTX settings * Configure Uplink and Downlink DTX separately * Deprecate global DTX option (it was never tested/used anyway) * Use libosmocore function for DTX indicator in System Information (previously it was incorrectly assigned for half-rate channels) Related: OS#22 Change-Id: I3d55168475ad47044b6238b55846ea22bdd518a4 Reviewed-on: https://gerrit.osmocom.org/40 Tested-by: Jenkins Builder Reviewed-by: Holger Freyther <holger@freyther.de>
2016-04-16Add basic SI2quater supportMax1-3/+3
* support for sending arbitrary static SI2quater. * vty interface for neightbor EARFCNs specific to SI2quater. * dynamic generation of SI2quater messages. * unit test for SI2quater messages. Fixes: OS#1630
2016-04-16Add SI2quater support to SI3Max1-0/+1
Advertise SI2 quater presence and location (if available) using SI3 according to 3GPP TS 44.018 § 10.5.2.34
2016-04-11Fix segfault with broken configMax1-0/+3
Fixes OS#1691
2016-02-25enable telnet VTY bind address config for various programsNeels Hofmeyr1-1/+5
Following the 'line vty'/'bind A.B.C.D' command added in libosmocore, use the configured address to set the telnet bind for the VTY line. It is now possible to publish the VTY on a specific local interface (including 0.0.0.0 aka "any"). Implement in all of: osmo-gbproxy osmo-gtphub osmo-sgsn osmo-bsc osmo-bsc_nat osmo-bsc_mgcp osmo-nitb In some of these main programs, move the telnet initialization below the configuration parsing. Historically, this was not a good idea for programs using bsc_init.c (aka bsc_bootstrap_network()), since they expected a gsm_network struct pointer in ((struct telnet_connection*)vty->priv)->priv, so that telnet had to be either initialized or replaced by a dummy struct. In the meantime, the gsm_network struct is not actually looked up in a priv pointer but in the static bsc_vty.c scope (bsc_gsmnet), so this limitation is mere legacy (even though said legacy is still there in an "#if 0" chunk). In the other binaries I have briefly looked at the init sequence dependencies and found no reason to initialize telnet above the config file parsing. In any case, I have tested every single one of abovementioned binaries to verify that they still parse the example config successfully and launch, allowing VTY connections on the configured address(es). I hope this suffices. In all of the above, log VTY address and port. LOGL_INFO is disabled by default in some of the logging scopes, and since it is a single log message right at program launch, I decided for the slightly more aggressive LOGL_NOTICE.
2015-11-20Fix TSC/BSIC handling bug and remove bts->tscHarald Welte1-2/+2
This fixes a bug in the following circumstances: * BSIC is set to 0 in the config file * No TSC is explicitly specified at the BST level in the config file In this case, we ended up using BSIC=0 and TSC=7, as TSC=7 is our default initialization value. The TSC of the CCCH/BCCH must always be the BCC, which is the lower 3 bits of the BSIC. Having configuration options for both the BSIC _and_ the TSC at the BTS level therefore makes no sense, as it only adds ways in which users can configure non-oprational configurations. So we remove the bts->tsc member, and keep only the ts->tsc members that allow us to configure a timeslot-specific TSC that's different from the BTS TSC (= BCC).
2015-08-17Add option to set RADIO LINK TIMEOUT value via VTYAndreas Eversberg1-3/+0
2015-06-20bts: Arfcn can never be smaller than 0Holger Hans Peter Freyther1-2/+1
Remove the condition because it can never be true. Fixes: Coverity CID#1307793
2015-06-19Fix GSM900 ARFCN range checkMichael McTernan1-2/+2
Allow ARFCN 0 to be used in GSM900 band.
2015-06-02libbsc: Move SIs update/generation for a BTS into a separate function.Alexander Chemeris1-1/+21
The code to do that doesn't belong to the control interface, so abstract it out to a separate function gsm_bts_set_system_infos(). [hfreyther: Fix the coding style...]
2014-11-21bsc: Allow to generate new system information onlineHolger Hans Peter Freyther1-2/+2
Increase the bcch_change_mark and generate a new copy of the system information. Make the method public, add a small test case. Manually verified using the FakeBTS. I don't know if the MS will re-read these SIs. Related: SYS#739
2014-08-24Use port number #defines for VTY and CTRL portsHarald Welte1-1/+2
.. as defined in libosmocore
2013-07-03hsl: Remove the support for the HSL bts from OpenBSCHolger Hans Peter Freyther1-22/+3
The support has been implemented for an old model, we were told that newer versions would be made incompatible with OpenBSC. Ther are various warnings in the code and coverity has found some new ones. Just remove the code as we don't know of anyone using this code.
2013-01-08si: Do not schedule SI1 to SI4 on the second TRXAndreas Eversberg1-3/+5
2012-11-11bts: Really drop the BTS in case of an OML NACKHolger Hans Peter Freyther1-7/+5
The previous code didn't work as expected. The trx and dst pointer are located in an union and in the case of the Abis code the dst is used to point to the signalling link timeslot and not the TRX. The is_ipaccess_bts always returned false because the dst was casted to a trx while it was no trx. This fix was tested with the nack_test/NACKTest.st of the test repo.
2012-10-18Allow setting of Control Channel Description parameters via VTYAndreas Eversberg1-4/+4
2012-10-09bsc: Do not print "SI 18" but SI2ter when the SI generation failsHolger Hans Peter Freyther1-2/+2
2012-10-08bsc_init: Don't drop all BTSs because a single BTS had an errorHarald Welte1-6/+8
2012-09-11bsc_init: Initialize rc on all paths to address a compiler warningHolger Hans Peter Freyther1-0/+1
bsc_init.c:203:6: warning: ‘rc’ may be used uninitialized in this function [-Wmaybe-uninitialized] bsc_init.c:101:6: note: ‘rc’ was declared here
2012-03-01Improved generation of SYSTEM INFORMATIONs 2* and 5* for neighbour bandsAndreas Eversberg1-20/+43
In addition to SI 2 and SI 5, the SI 2ter and 2bis is generated, if neighbour cells in other bands exist. Also it is indicated in the rest octets of SI3, that SI 2ter is used. If no neighbour cell in a different band exists, the SI 2ter and SI 5ter is omitted. A special case is P-GSM range (channels 1-124). To be compatible with older phones, SI 2bis and SI 5bis is used. If the BCCH lays inside the P-GSM band, only neighbour cells of the P-GSM range are included in SI 2 and SI 5. If neighbour cells exist in the same band (900), but lay outside the P-GSM range, the SI 2bis and SI 5bis is used to extend the list of neighbour cells. The extension is also indicated in SI 2 and SI 5. If the BCCH lays inside the P-GSM range, but no neighbour cell exists in the same band outside the P-GSM range, the SI 2bis ans SI 5bis are omitted.
2012-01-29ARFCNs are in the range of 0..1023, not 0..1024Harald Welte1-2/+2
I'm sure I read somewhere that it actually was 0..1024, as I kept wondering how stupid it was to use 10bit+1. However, that source was incorrect, as GSM TS 05.05 quite clearly states 0..1023