diff options
37 files changed, 831 insertions, 77 deletions
diff --git a/README.md b/README.md new file mode 100644 index 000000000..f210d3805 --- /dev/null +++ b/README.md @@ -0,0 +1,22 @@ +openbsc.git +=========== + +This is a HISTORICAL,OBSOLETE repository containing the code-base +of what used to be known as bs11_hack, later OpenBSC and also OsmoNITB. + +Those projects have been superseded by OsmoBSC, OsmoMSC and OsmoHLR +(collectively known as Osmocom CNI). + +The code in this repository is completely unmaintained, unsupported and +it is strongly discouraged to use it. On the other hand, the modern +Osmocom CNI implementations are fully maintained and continuously +tested. + +Do not bother the developers with questions about code from this +repository. + +Further Links +------------- + +* [New-style GSM NITB baesd on discrete Osmocom CNI projects](https://osmocom.org/projects/cellular-infrastructure/wiki/Osmocom_Network_In_The_Box) +* [Migration guide from OsmoNITB to Osmcoom CNI](https://osmocom.org/projects/cellular-infrastructure/wiki/OsmoNITB_Migration_Guide) diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index da8703a22..4b9d532c1 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -54,7 +54,6 @@ build_project() { # Build and publish manuals if [ "$WITH_MANUALS" = "1" ]; then # Build all manuals first - osmo-build-dep.sh osmo-gsm-manuals for dir in "$base"/manuals/*/; do make -C "$dir" done diff --git a/debian/changelog b/debian/changelog index e670c9a3e..f78784ffb 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,48 @@ +openbsc (1.4.1) unstable; urgency=medium + + [ Oliver Smith ] + * contrib/jenkins: don't build osmo-gsm-manuals + * debian/control: remove dh-systemd build-depend + + [ Pau Espin Pedrol ] + * tests: Explicitly drop category from log + * gitignore: Ignore configure~ file + * tests: Replace deprecated API log_set_print_filename + + [ Harald Welte ] + * add README.md to indicate what this repo is about + + -- Pau Espin Pedrol <pespin@sysmocom.de> Tue, 16 Nov 2021 18:35:09 +0100 + +openbsc (1.4.0) unstable; urgency=medium + + [ Harald Welte ] + * Migrate from BSC_FD_* to OSMO_FD_* + * Add very clear obsolescence / unmaintained warnings + + [ Pau Espin Pedrol ] + * bsc-nat: generate coredump and exit upon SIGABRT received + * osmo-nitb: generate coredump and exit upon SIGABRT received + + -- Pau Espin Pedrol <pespin@espeweb.net> Thu, 10 Dec 2020 17:07:14 +0100 + +openbsc (1.3.3) unstable; urgency=medium + + [ Keith ] + * rsl: Send IE MS Power Param during CHAN ACT and MS PWR CTRL messages + + [ Harald Welte ] + * fix compilation with gcc-10 + + [ Vadim Yanitskiy ] + * fix typo in osmo_bts_variant_names: s/omso/osmo/ + + [ Pau Espin Pedrol ] + * doc: Copy {bsc,bts}.adoc from osmo-gsm-manuals + * db_test: Disable using color in log output + + -- Pau Espin Pedrol <pespin@sysmocom.de> Fri, 18 Sep 2020 11:50:16 +0200 + openbsc (1.3.2) unstable; urgency=medium [ Harald Welte ] diff --git a/debian/control b/debian/control index b9008ef30..c176bee70 100644 --- a/debian/control +++ b/debian/control @@ -8,7 +8,6 @@ Build-Depends: debhelper (>= 9), pkg-config, libdbi0-dev, dh-autoreconf, - dh-systemd (>= 1.5), libsmpp34-dev (>= 1.13.0), libosmocore-dev (>= 1.0.1), libosmo-abis-dev (>= 0.6.0), diff --git a/manuals/OsmoNITB/chapters/bsc.adoc b/manuals/OsmoNITB/chapters/bsc.adoc new file mode 100644 index 000000000..49d25e5a9 --- /dev/null +++ b/manuals/OsmoNITB/chapters/bsc.adoc @@ -0,0 +1,120 @@ +== BSC level configuration + +The BSC component is shared between OsmoBSC and OsmoNITB. This chapter +describes some of the configuration options related to this shared BSC +component. + +=== Hand-over + +==== Hand-over in GSM + +Hand-over is the process of changing a MS with a currently active +dedicated channel from one BTS to another BTS. As opposed to idle mode, +where the MS autonomously performs cell re-selection, in dedicated mode +this happens under network control. + +In order to determine when to perform hand-over, and to which cells, the +network requests the MS to perform measurements on a list of neighbor +cell channels, which the MS then reports back to the network in the form +of GSM RR 'Measurement Result' messages. Those messages contain the +downlink measurements as determined by the MS. + +Furthermore, the BTS also performs measurements on the uplink, and +communicates those by means of RSL to the BSC. + +The hand-over decision is made by an algorithm that processes those +measurement results and determines when to perform the hand-over. + +==== Configuration of hand-over in OsmoBSC/OsmoNITB + +OsmoBSC (like the internal BSC component of OsmoNITB) only support +so-called intra-BSC hand-over, where the hand-over is performed between +two BTSs within the same BSC. + +Hand-over is enabled and configured by the use of a set of `handover` +commands. Using those, you can tune the key parameters of the hand-over +algorithm and adapt it to your specific environment. + +.Example handover configuration snippet +---- + handover 1 <1> + handover window rxlev averaging 10 <2> + handover window rxqual averaging 1 <3> + handover window rxlev neighbor averaging 10 <4> + handover power budget interval 6 <5> + handover power budget hysteresis 3 <6> + handover maximum distance 9999 <7> +---- +<1> Enable hand-over +<2> Set the RxLev averaging window for the serving cell to 10 measurements +<3> Set the RxQual averaging window for the serving cell to 1 + measurement (no window) +<4> Set the RxLev averaging for neighbor cells to 10 measurements +<5> Check for the conditions of a power budget hand-over every 6 SACCH + frames +<6> A neighbor cell must be at least 3 dB stronger than the serving cell + to be considered a candidate for hand-over +<7> Perform a maximum distance hand-over if TA is larger 9999 (i.e. never) + +//TODO: Move all to BSC node + +=== Timer Configuration + +The GSM specification specifies a variety of timers both on the network +as well as on the mobile station side. + +Those timers can be configured using the `timer tXXXX` command. + +.Configurable Timers +|=== +|node|timer|default|description +|network|t3101|10|Timeout for 'Immediate Assignment' (sec) +|network|t3103|?|Timeout for Handover (sec) +|network|t3105|40|Repetition of 'Physical Information' (sec) +|network|t3107|?|? +|network|t3109|?|RSL SACCH deactivation timeout (sec) +|network|t3111|?|RSL timeout to wait before releasing the RF channel (sec) +|network|t3113|60|Time to try paging for a subscriber (sec) +|network|t3115|?|? +|network|t3117|?|? +|network|t3119|?|? +|network|t3122|10|Waiting time after 'Immediate Assignment Reject' +|network|t3141|?|? +|=== + +//TODO: split between BSC and MSC timers + +=== Discontinuous Transmission (DTX) + +GSM provides a full-duplex voice call service. However, in any +civilized communication between human beings, only one of the +participants is speaking at any given point in time. This means that +most of the time, one of the two directions of the radio link is +transmitting so-called 'silence frames'. + +During such periods of quiescence in one of the two directions, it is +possible to suppress transmission of most of the radio bursts, as there +is no voice signal to transport. GSM calls this feature 'Discontinuous +Transmission'. It exists separately for uplink (DTXu) and downlink +(DTXd). + +Downlink DTX is only permitted on non-primary transceivers (!= TRX0), as +TRX0 must always transmit at constant output power to ensure it is +detected during cell selection. + +Uplink DTX is possible on any TRX, and serves primarily two uses: + +possible on any TRX, and serves primarily two uses: + +. reducing the MS battery consumption by transmitting at a lower duty cycle +. reducing the uplink interference caused in surrounding cells that + re-use the same ARFCN. + +DTS for both uplink and downlink is implemented in the BTS. Not all BTS +models support it. + +The Osmocom BSC component can instruct the BTS to enable or disable +uplink and/or downlink DTX by means of A-bis OML. + +//TODO: Test/implement, at least for uplink +//TODO: Move to BSC diff --git a/manuals/OsmoNITB/chapters/bts.adoc b/manuals/OsmoNITB/chapters/bts.adoc new file mode 100644 index 000000000..2c09dc326 --- /dev/null +++ b/manuals/OsmoNITB/chapters/bts.adoc @@ -0,0 +1,489 @@ +[[bts]] +== Reviewing and Provisioning BTS configuration + +The main functionality of the BSC component is to manage BTSs. As such, +provisioning BTSs within the BSC is one of the most common tasks during +BSC operation. Just like about anything else in OsmoBSC, they are +configured using the VTY. + +BTSs are internally numbered with integer numbers starting from "0" for +the first BTS. BTS numbers have to be contiguous, so you cannot +configure 0,1,2 and then 5. + + +=== Reviewing current BTS status and configuration + +In order to view the status and properties of a BTS, you can issue the +`show bts` command. If used without any BTS number, it will display +information about all provisioned BTS numbers. + +---- +OsmoBSC> show bts 0 +BTS 0 is of nanobts type in band DCS1800, has CI 0 LAC 1, BSIC 63, TSC 7 and 1 TRX +Description: (null) +MS Max power: 15 dBm +Minimum Rx Level for Access: -110 dBm +Cell Reselection Hysteresis: 4 dBm +RACH TX-Integer: 9 +RACH Max transmissions: 7 +System Information present: 0x0000007e, static: 0x00000000 + Unit ID: 200/0/0, OML Stream ID 0xff + NM State: Oper 'Enabled', Admin 2, Avail 'OK' + Site Mgr NM State: Oper 'Enabled', Admin 0, Avail 'OK' + Paging: 0 pending requests, 0 free slots + OML Link state: connected. + Current Channel Load: + TCH/F: 0% (0/5) + SDCCH8: 0% (0/8) +---- + +You can also review the status of the TRXs configured within the BTSs of +this BSC by using `show trx`: + +---- +OsmoBSC> show trx 0 0 +TRX 0 of BTS 0 is on ARFCN 871 +Description: (null) + RF Nominal Power: 23 dBm, reduced by 0 dB, resulting BS power: 23 dBm + NM State: Oper 'Enabled', Admin 2, Avail 'OK' + Baseband Transceiver NM State: Oper 'Enabled', Admin 2, Avail 'OK' + ip.access stream ID: 0x00 +---- + +The output can be restricted to the TRXs of one specified BTS number +(`show trx 0`) or even that of a single specified TRX within a +specified BTS (`show trx 0 0`). + +Furthermore, information on the individual timeslots can be shown by +means of `show timeslot`. The output can be restricted to the +timeslots of a single BTS (`show timeslot 0`) or that of a single +TRX (`show timeslot 0 0`). Finally, you can restrict the output to +a single timeslot by specifying the BTS, TRX and TS numbers (`show +timeslot 0 0 4`). + +---- +OsmoBSC> show timeslot 0 0 0 +BTS 0, TRX 0, Timeslot 0, phys cfg CCCH, TSC 7 + NM State: Oper 'Enabled', Admin 2, Avail 'OK' +OsmoBSC> show timeslot 0 0 1 +BTS 0, TRX 0, Timeslot 1, phys cfg SDCCH8, TSC 7 + NM State: Oper 'Enabled', Admin 2, Avail 'OK' +---- + + +=== Provisioning a new BTS + +In order to provision BTSs, you have to enter the BTS config node of the +VTY. In order to configure BTS 0, you can issue the following sequence +of commands: + +---- +OsmoBSC> enable +OsmoBSC# configure terminal +OsmoBSC(config)# network +OsmoBSC(config-net)# bts 0 +OsmoBSC(config-net-bts)# +---- + +At this point, you have a plethora of commands, in fact an entire +hierarchy of commands to configure all aspects of the BTS, as well as +each of its TRX and each timeslot within each TRX. For a full +reference, please consult the telnet VTY integrated help or the respective +chapter in the VTY reference. + +BTS configuration depends quite a bit on the specific BTS vendor and +model. The section below provides just one possible example for the +case of a sysmoBTS. + +Note that from the `configure terminal` command onwards, the telnet VTY +commands above are identical to configuration file settings, for details see +<<vty>>. + +Starting with `network` as above, your complete sysmoBTS configuration may look +like this: + +---- +network + bts 0 + type sysmobts + band DCS1800 + description The new BTS in Baikonur + location_area_code 2342 + cell_identity 5 + base_station_id_code 63 + ip.access unit_id 8888 0 + ms max power 40 + trx 0 + arfcn 871 + nominal power 23 + max_power_red 0 + timeslot 0 + phys_chan_config CCCH+SDCCH4 + timeslot 1 + phys_chan_config TCH/F + timeslot 2 + phys_chan_config TCH/F + timeslot 3 + phys_chan_config TCH/F + timeslot 4 + phys_chan_config TCH/F + timeslot 5 + phys_chan_config TCH/F + timeslot 6 + phys_chan_config TCH/F + timeslot 7 + phys_chan_config PDCH +---- + + +=== System Information configuration + +A GSM BTS periodically transmits a series of 'SYSTEM INFORMATION' +messages to mobile stations, both via the BCCH in idle mode, was well as +via the SACCH in dedicated mode. There are many different types of such +messages. For their detailed contents and encoding, please see _3GPP TS +24.008_ <<3gpp-ts-24-008>>. + +For each of the 'SYSTEM INFORMATION' message types, you can configure to +have the BSC generate it automatically ('computed'), or you can specify +the respective binary message as a string of hexadecimal digits. + +The default configuration is to compute all (required) 'SYSTEM +INFORMATION' messages automatically. + +Please see the _OsmoBSC VTY Reference Manual_ <<vty-ref-osmobsc>> for +further information, particularly on the following commands: + +* `system-information (1|2|3|4|5|6|7|8|9|10|13|16|17|18|19|20|2bis|2ter|2quater|5bis|5ter) mode (static|computed)` +* `system-information (1|2|3|4|5|6|7|8|9|10|13|16|17|18|19|20|2bis|2ter|2quater|5bis|5ter) static HEXSTRING` + + +=== Neighbor List configuration + +Every BTS sends a list of ARFCNs of neighbor cells +. within its 'SYSTEM INFORMATION 2' (and 2bis/2ter) messages on the BCCH +. within its 'SYSTEM INFORMATION 5' messages on SACCH in dedicated mode + +For every BTS config node in the VTY, you can specify the behavior of +the neighbor list using the `neighbor list mode` VTY command: + +automatic:: + Automatically generate a list of neighbor cells using all other + BTSs configured in the VTY +manual:: + Manually specify the neighbor list by means of `neighbor-list +(add|del) arfcn <0-1023>` commands, having identical neighbor lists on +BCCH (SI2) and SACCH (SI5) + +manual-si5:: + Manually specify the neighbor list by means of `neighbor-list +(add|del) arfcn <0-1023>` for BCCH (SI2) and a separate neighbor list by +means of `si5 neighbor-list (add|del) arfcn <0-1023>` for SACCH (SI5). + + +=== Configuring GPRS PCU parameters of a BTS + +In the case of BTS models using Abis/IP (IPA), the GPRS PCU is located +inside the BTS. The BTS then establishes a Gb connection to the SGSN. + +All the BTS-internal PCU configuration is performed via A-bis OML by +means of configuring the 'CELL', 'NSVC' (NS Virtual Connection and 'NSE' +(NS Entity). + +There is one 'CELL' node and one 'NSE' node, but there are two 'NSVC' +nodes. At the time of this writing, only the NSVC 0 is supported by +OsmoBTS, while both NSVC are supported by the ip.access nanoBTS. + +The respective VTY configuration parameters are described below. They +all exist beneath each BTS VTY config node. + +But let's first start with a small example + +.Example configuration of GPRS PCU parameters at VTY BTS node +---- +OsmoBSC(config-net-bts)# gprs mode gprs +OsmoBSC(config-net-bts)# gprs routing area 1 +OsmoBSC(config-net-bts)# gprs cell bvci 1234 +OsmoBSC(config-net-bts)# gprs nsei 1234 +OsmoBSC(config-net-bts)# gprs nsvc 0 nsvci 1234 +OsmoBSC(config-net-bts)# gprs nsvc 0 local udp port 23000 +OsmoBSC(config-net-bts)# gprs nsvc 0 remote udp port 23000 +OsmoBSC(config-net-bts)# gprs nsvc 0 remote ip 192.168.100.239 +---- + + +=== More explanation about the PCU config parameters + +//FIXME: should this go into VTY additions? + +==== `gprs mode (none|gprs|egprs)` + +This command determines if GPRS (or EGPRS) services are to be enabled in +this cell at all. + + +==== `gprs cell bvci <2-65535>` + +Configures the 'BSSGP Virtual Circuit Identifier'. It must be unique +between all BGSGP connections to one SGSN. + +NOTE: It is up to the system administrator to ensure all PCUs are +allocated an unique bvci. OsmoBSC will not ensure this policy. + + +==== `gprs nsei <0-65535>` + +Configures the 'NS Entity Identifier'. It must be unique between all NS +connections to one SGSN. + +NOTE: It is up to the system administrator to ensure all PCUs are +allocated an unique bvci. OsmoBSC will not ensure this policy. + + +==== `gprs nsvc <0-1> nsvci <0-65535>` + +Configures the 'NS Virtual Connection Identifier'. It must be unique +between all NS virtual connections to one SGSN. + +NOTE: It is up to the system administrator to ensure all PCUs are +allocated an unique nsvci. OsmoBSC will not ensure this policy. + + +==== `gprs nsvc <0-1> local udp port <0-65535>` + +Configures the local (PCU side) UDP port for the NS-over-UDP link. + + +==== `gprs nsvc <0-1> remote udp port <0-65535>` + +Configures the remote (SGSN side) UDP port for the NS-over-UDP link. + + +==== `gprs nsvc <0-1> remote ip A.B.C.D` + +Configures the remote (SGSN side) UDP port for the NS-over-UDP link. + + +==== `gprs ns timer (tns-block|tns-block-retries|tns-reset|tns-reset-retries|tns-test|tns-alive|tns-alive-retries)` <0-255> + +Configures the various GPRS NS related timers. Please check the GPRS NS +specification for the detailed meaning of those timers. + + +=== Dynamic Timeslot Configuration (TCH / PDCH) + +A dynamic timeslot is in principle a voice timeslot (TCH) that is used to serve +GPRS data (PDCH) when no voice call is active on it. This enhances GPRS +bandwidth while no voice calls are active, which is dynamically scaled down as +voice calls need to be served. This is a tremendous improvement in service over +statically assigning a fixed number of timeslots for voice and data. + +The causality is as follows: to establish a voice call, the +MSC requests a logical channel of a given TCH kind from the BSC. The BSC +assigns such a channel from a BTS' TRX's timeslot of its choice. The knowledge +that a given timeslot is dynamic exists only on the BSC level. When the MSC +asks for a logical channel, the BSC may switch off PDCH on a dynamic timeslot +and then assign a logical TCH channel on it. Hence, though compatibility with +the BTS needs to be ensured, any MSC is compatible with dynamic timeslots by +definition. + +OsmoBSC support two kinds of dynamic timeslot handling, configured +via the `network` / `bts` / `trx` / `timeslot` / `phys_chan_config` +configuration. Not all BTS models support dynamic channels. + +[[dyn_ts_compat]] +.Dynamic timeslot support by various BTS models +[cols="50%,25%,25%"] +|=== +| |`TCH/F_TCH/H_PDCH` |`TCH/F_PDCH` +|ip.access nanoBTS |- |supported +|Ericsson RBS |supported |- +|sysmoBTS using _osmo-bts-sysmo_ |supported |supported +|various SDR platforms using _osmo-bts-trx_ |supported |supported +|Nutaq Litecell 1.5 using _osmo-bts-litecell15_ |supported |supported +|Octasic OctBTS using _osmo-bts-octphy_ | supported | supported +|=== + +The _OsmoBTS Abis Protocol Specification_ <<osmobts-abis-spec>> describes the +non-standard RSL messages used for these timeslot kinds. + +NOTE: Same as for dedicated PDCH timeslots, you need to enable GPRS and operate +a PCU, SGSN and GGSN to provide the actual data service. + +==== Osmocom Style Dynamic Timeslots (TCH/F_TCH/H_PDCH) + +Timeslots of the `TCH/F_TCH/H_PDCH` type dynamically switch between TCH/F, +TCH/H and PDCH, depending on the channel kind requested by the MSC. The RSL +messaging for `TCH/F_TCH/H_PDCH` timeslots is compatible with Ericsson RBS. + +BTS models supporting this timeslot kind are shown in <<dyn_ts_compat>>. + +==== ip.access Style Dynamic Timeslots (TCH/F_PDCH) + +Timeslots of the `TCH/F_PDCH` type dynamically switch between TCH/F and PDCH. +The RSL messaging for `TCH/F_PDCH` timeslots is compatible with ip.access +nanoBTS. + +BTS models supporting this timeslot kind are shown in <<dyn_ts_compat>>. + +==== Avoid PDCH Exhaustion + +To avoid disrupting GPRS, configure at least one timeslot as dedicated PDCH. +With only dynamic timeslots, a given number of voice calls would convert all +timeslots to TCH, and no PDCH timeslots would be left for GPRS service. + +==== Dynamic Timeslot Configuration Examples + +This is an extract of an `osmo-bsc`` config file. A timeslot configuration with +five Osmocom style dynamic timeslots and one dedicated PDCH may look like this: + +---- +network + bts 0 + trx 0 + timeslot 0 + phys_chan_config CCCH+SDCCH4 + timeslot 1 + phys_chan_config SDCCH8 + timeslot 2 + phys_chan_config TCH/F_TCH/H_PDCH + timeslot 3 + phys_chan_config TCH/F_TCH/H_PDCH + timeslot 4 + phys_chan_config TCH/F_TCH/H_PDCH + timeslot 5 + phys_chan_config TCH/F_TCH/H_PDCH + timeslot 6 + phys_chan_config TCH/F_TCH/H_PDCH + timeslot 7 + phys_chan_config PDCH +---- + +With the ip.access nanoBTS, only `TCH/F_PDCH` dynamic timeslots are supported, +and hence a nanoBTS configuration may look like this: + +---- +network + bts 0 + trx 0 + timeslot 0 + phys_chan_config CCCH+SDCCH4 + timeslot 1 + phys_chan_config SDCCH8 + timeslot 2 + phys_chan_config TCH/F_PDCH + timeslot 3 + phys_chan_config TCH/F_PDCH + timeslot 4 + phys_chan_config TCH/F_PDCH + timeslot 5 + phys_chan_config TCH/F_PDCH + timeslot 6 + phys_chan_config TCH/F_PDCH + timeslot 7 + phys_chan_config PDCH +---- + +=== Tuning Access to the BTS + +OsmoBSC offers several configuration options to fine-tune access to the BTS. +It can allow only a portion of the subscribers access to the network. +This can also be used to ramp up access to the network on startup by slowly +letting in more and more subscribers. This is especially useful for isolated +cells with a huge number of subscribers. + +Other options control the behaviour of the MS when it needs to access the +random access channel before a dedicated channel is established. + +If the BTS is connected to the BSC via a high-latency connection the MS should +wait longer for an answer to a RACH request. If it does not the network will +have to deal with an increased load due to duplicate RACH requests. However, +in order to minimize the delay when a RACH request or response gets lost the +MS should not wait too long before retransmitting. + +==== Load Management + +Every SIM card is member of one of the ten regular ACCs (0-9). Access to the +BTS can be restricted to SIMs that are members of certain ACCs. + +Since the ACCs are distributed uniformly across all SIMs allowing only ACCs +0-4 to connect to the BTS should reduce its load by 50%. + +The default is to allow all ACCs to connect. + +.Example: Restrict access to the BTS by ACC +---- +network + bts 0 + rach access-control-class 1 barred <1> + rach access-control-class 9 allowed <2> +---- +<1> Disallow SIMs with access-class 1 from connecting to the BTS +<2> Permit SIMs with access-class 9 to connect to the BTS. + + +Smaller cells with lots of subscribers can be overwhelmed with traffic after +the network is turned on. This is especially true in areas with little to no +reception from other networks. To manage the load OsmoBSC has an option to +enable one Access Class at a time so initial access to the network is +distributed across a longer time. + +.Example: Ramp up access to the BTS after startup +---- +network + bts 0 + access-control-class-ramping <1> + access-control-class-ramping-step-interval 30 <2> + access-control-class-ramping-step-size 1 <3> +---- +<1> Turn on access-control-class ramping +<2> Enable more ACCs every 30 seconds +<3> At each step enable one more ACC + + +==== RACH Parameter Configuration + +The following parameters allow control over how the MS can access the random +access channel (RACH). It is possible to set a minimum receive level under +which the MS will not even attempt to access the network. + +The RACH is a shared channel which means multiple MS can choose to send a +request at the same time. To minimize the risk of a collision each MS will +choose a random number of RACH slots to wait before trying to send a RACH +request. + +On very busy networks the range this number is chosen from should be +high to avoid collisions, but a lower range reduces the overall delay when +trying to establish a channel. + +The option `rach tx integer N` controls the range from which this number X +is chosen. It is `0 <= X < max(8,N)`. + +After sending a RACH request the MS will wait a random amount of slots before +retransmitting its RACH request. The range it will wait is also determined by +the option `rach tx integer N`, but calculating it is not so straightforward. +It is defined as `S <= X < S+N` where `S` is determined from a table. + +In particular `S` is lowest when `N` is one of 3, 8, 14 or 50 and highest when +`N` is 7, 12 or 32. + +For more information see _3GPP TA 44.018_ <<3gpp-ts-44-018>> Ch. 3.3.1.1.2 and +Table 3.3.1.1.2.1 in particular. + +The amount of times the MS attempts to retransmit RACH requests can also be +changed. A higher number means more load on the RACH while a lower number can +cause channel establishment to fail due to collisions or bad reception. + +.Example: Configure RACH Access Parameters +---- +network + bts 0 + rxlev access min 20 <1> + rach tx integer 50<2> + rach max transmission <3> +---- +<1> Allow access to the network if the MS receives the BCCH of the cell at +-90dBm or better (20dB above -110dBm). +<2> This number affects how long the MS waits before (re-)transmitting RACH +requests. +<3> How often to retransmit the RACH request. diff --git a/manuals/OsmoNITB/chapters/overview.adoc b/manuals/OsmoNITB/chapters/overview.adoc index d161af3f9..2db7a42e9 100644 --- a/manuals/OsmoNITB/chapters/overview.adoc +++ b/manuals/OsmoNITB/chapters/overview.adoc @@ -4,6 +4,14 @@ This manual should help you getting started with OsmoNITB. It will cover aspects of configuring and running the OsmoNITB. +WARNING:: osmo-nitb is obsolete since 2017. It is not actively maintained, +and it lack several man-years of development effort that went into the +so-called post-NITB stack consisting of separate OsmoBSC, OsmoMSC, +OsmoMGW and OsmoHLR. You should not use this software except for +archaeological purpose. You will be on your own. Do not contact the +developers about any issues you may experience while running unsuported, +obsolete software! + [[intro_overview]] === About OsmoNITB diff --git a/manuals/OsmoNITB/osmonitb-usermanual.adoc b/manuals/OsmoNITB/osmonitb-usermanual.adoc index 543e836a1..ca2551ee2 100644 --- a/manuals/OsmoNITB/osmonitb-usermanual.adoc +++ b/manuals/OsmoNITB/osmonitb-usermanual.adoc @@ -1,10 +1,17 @@ :gfdl-enabled: :program-name: OsmoNITB -OsmoNITB User Manual -==================== +OBSOLETE OsmoNITB User Manual +============================= Harald Welte <hwelte@sysmocom.de> +WARNING:: osmo-nitb is obsolete since 2017. It is not actively maintained, +and it lack several man-years of development effort that went into the +so-called post-NITB stack consisting of separate OsmoBSC, OsmoMSC, +OsmoMGW and OsmoHLR. You should not use this software except for +archaeological purpose. You will be on your own. Do not contact the +developers about any issues you may experience while running unsuported, +obsolete software! include::./common/chapters/preface.adoc[] @@ -24,9 +31,9 @@ include::{srcdir}/chapters/counters.adoc[] include::{srcdir}/chapters/net.adoc[] -include::./common/chapters/bsc.adoc[] +include::{srcdir}/chapters/bsc.adoc[] -include::./common/chapters/bts.adoc[] +include::{srcdir}/chapters/bts.adoc[] include::{srcdir}/chapters/bts-examples.adoc[] @@ -49,4 +56,3 @@ include::./common/chapters/bibliography.adoc[] include::./common/chapters/glossary.adoc[] include::./common/chapters/gfdl.adoc[] - diff --git a/openbsc/.gitignore b/openbsc/.gitignore index a1695c6ed..e99632d99 100644 --- a/openbsc/.gitignore +++ b/openbsc/.gitignore @@ -38,6 +38,7 @@ stamp-h1 libtool ltmain.sh m4/*.m4 +configure~ # git-version-gen magic .tarball-version diff --git a/openbsc/osmoappdesc.py b/openbsc/osmoappdesc.py index af949e8fa..ba3ccf900 100644 --- a/openbsc/osmoappdesc.py +++ b/openbsc/osmoappdesc.py @@ -39,10 +39,11 @@ app_configs = { apps = [(4242, "src/osmo-bsc/osmo-bsc-sccplite", "OsmoBSC", "osmo-bsc-sccplite"), (4244, "src/osmo-bsc_nat/osmo-bsc_nat", "OsmoBSCNAT", "nat"), (4243, "src/osmo-bsc_mgcp/osmo-bsc_mgcp", "OpenBSC MGCP", "mgcp"), - (4242, "src/osmo-nitb/osmo-nitb", "OpenBSC", "nitb"), + (4242, "src/osmo-nitb/osmo-nitb --yes-i-really-want-to-run-prehistoric-software", "OpenBSC", "nitb"), ] vty_command = ["./src/osmo-nitb/osmo-nitb", "-c", - "doc/examples/osmo-nitb/nanobts/osmo-nitb.cfg"] + "doc/examples/osmo-nitb/nanobts/osmo-nitb.cfg", + "--yes-i-really-want-to-run-prehistoric-software"] vty_app = apps[3] # reference apps[] entry for osmo-nitb diff --git a/openbsc/src/libbsc/abis_nm.c b/openbsc/src/libbsc/abis_nm.c index 922c2d54a..c1e2b5347 100644 --- a/openbsc/src/libbsc/abis_nm.c +++ b/openbsc/src/libbsc/abis_nm.c @@ -1993,6 +1993,8 @@ int abis_nm_perform_test(struct gsm_bts *bts, uint8_t obj_class, if (!msg) msg = nm_msgb_alloc(); + if (!msg) + return -ENOMEM; msgb_tv_push(msg, NM_ATT_AUTON_REPORT, auton_report); msgb_tv_push(msg, NM_ATT_TEST_NO, test_nr); diff --git a/openbsc/src/libbsc/bsc_msc.c b/openbsc/src/libbsc/bsc_msc.c index 82a572dbe..dac0e5203 100644 --- a/openbsc/src/libbsc/bsc_msc.c +++ b/openbsc/src/libbsc/bsc_msc.c @@ -81,7 +81,7 @@ static int msc_connection_connect(struct osmo_fd *fd, unsigned int what) queue = container_of(fd, struct osmo_wqueue, bfd); con = container_of(queue, struct bsc_msc_connection, write_queue); - if ((what & BSC_FD_WRITE) == 0) { + if ((what & OSMO_FD_WRITE) == 0) { LOGP(DMSC, LOGL_ERROR, "MSC(%s) Callback but not writable.\n", con->name); return -1; @@ -107,7 +107,7 @@ static int msc_connection_connect(struct osmo_fd *fd, unsigned int what) /* go to full operation */ fd->cb = osmo_wqueue_bfd_cb; - fd->when = BSC_FD_READ | BSC_FD_EXCEPT; + fd->when = OSMO_FD_READ | OSMO_FD_EXCEPT; con->is_connected = 1; LOGP(DMSC, LOGL_NOTICE, @@ -209,7 +209,7 @@ int bsc_msc_connect(struct bsc_msc_connection *con) if (ret == -1 && errno == EINPROGRESS) { LOGP(DMSC, LOGL_ERROR, "MSC(%s) Connection in progress\n", con->name); - fd->when = BSC_FD_WRITE; + fd->when = OSMO_FD_WRITE; fd->cb = msc_connection_connect; osmo_timer_setup(&con->timeout_timer, msc_con_timeout, con); osmo_timer_schedule(&con->timeout_timer, 20, 0); @@ -218,7 +218,7 @@ int bsc_msc_connect(struct bsc_msc_connection *con) connection_loss(con); return ret; } else { - fd->when = BSC_FD_READ | BSC_FD_EXCEPT; + fd->when = OSMO_FD_READ | OSMO_FD_EXCEPT; fd->cb = osmo_wqueue_bfd_cb; con->is_connected = 1; if (con->connected) diff --git a/openbsc/src/libbsc/bsc_rf_ctrl.c b/openbsc/src/libbsc/bsc_rf_ctrl.c index 0e28600b5..9159a8f76 100644 --- a/openbsc/src/libbsc/bsc_rf_ctrl.c +++ b/openbsc/src/libbsc/bsc_rf_ctrl.c @@ -373,7 +373,7 @@ static int rf_ctrl_accept(struct osmo_fd *bfd, unsigned int what) osmo_wqueue_init(&conn->queue, 10); conn->queue.bfd.data = conn; conn->queue.bfd.fd = fd; - conn->queue.bfd.when = BSC_FD_READ | BSC_FD_WRITE; + conn->queue.bfd.when = OSMO_FD_READ | OSMO_FD_WRITE; conn->queue.read_cb = rf_read_cmd; conn->queue.write_cb = rf_write_cmd; conn->rf = rf; @@ -479,7 +479,7 @@ static int rf_create_socket(struct osmo_bsc_rf *rf, const char *path) return -1; } - bfd->when = BSC_FD_READ; + bfd->when = OSMO_FD_READ; bfd->cb = rf_ctrl_accept; bfd->data = rf; diff --git a/openbsc/src/libbsc/pcu_sock.c b/openbsc/src/libbsc/pcu_sock.c index e2066ba3e..4411df84a 100644 --- a/openbsc/src/libbsc/pcu_sock.c +++ b/openbsc/src/libbsc/pcu_sock.c @@ -484,7 +484,7 @@ static int pcu_sock_send(struct gsm_bts *bts, struct msgb *msg) return -EIO; } msgb_enqueue(&state->upqueue, msg); - conn_bfd->when |= BSC_FD_WRITE; + conn_bfd->when |= OSMO_FD_WRITE; return 0; } @@ -507,7 +507,7 @@ static void pcu_sock_close(struct pcu_sock_state *state) osmo_fd_unregister(bfd); /* re-enable the generation of ACCEPT for new connections */ - state->listen_bfd.when |= BSC_FD_READ; + state->listen_bfd.when |= OSMO_FD_READ; #if 0 /* remove si13, ... */ @@ -586,7 +586,7 @@ static int pcu_sock_write(struct osmo_fd *bfd) msg = llist_entry(state->upqueue.next, struct msgb, list); pcu_prim = (struct gsm_pcu_if *)msg->data; - bfd->when &= ~BSC_FD_WRITE; + bfd->when &= ~OSMO_FD_WRITE; /* bug hunter 8-): maybe someone forgot msgb_put(...) ? */ if (!msgb_length(msg)) { @@ -601,7 +601,7 @@ static int pcu_sock_write(struct osmo_fd *bfd) goto close; if (rc < 0) { if (errno == EAGAIN) { - bfd->when |= BSC_FD_WRITE; + bfd->when |= OSMO_FD_WRITE; break; } goto close; @@ -625,12 +625,12 @@ static int pcu_sock_cb(struct osmo_fd *bfd, unsigned int flags) { int rc = 0; - if (flags & BSC_FD_READ) + if (flags & OSMO_FD_READ) rc = pcu_sock_read(bfd); if (rc < 0) return rc; - if (flags & BSC_FD_WRITE) + if (flags & OSMO_FD_WRITE) rc = pcu_sock_write(bfd); return rc; @@ -656,13 +656,13 @@ static int pcu_sock_accept(struct osmo_fd *bfd, unsigned int flags) LOGP(DPCU, LOGL_NOTICE, "PCU connects but we already have " "another active connection ?!?\n"); /* We already have one PCU connected, this is all we support */ - state->listen_bfd.when &= ~BSC_FD_READ; + state->listen_bfd.when &= ~OSMO_FD_READ; close(rc); return 0; } conn_bfd->fd = rc; - conn_bfd->when = BSC_FD_READ; + conn_bfd->when = OSMO_FD_READ; conn_bfd->cb = pcu_sock_cb; conn_bfd->data = state; @@ -705,7 +705,7 @@ int pcu_sock_init(const char *path, struct gsm_bts *bts) return -1; } - bfd->when = BSC_FD_READ; + bfd->when = OSMO_FD_READ; bfd->cb = pcu_sock_accept; bfd->data = state; diff --git a/openbsc/src/libcommon/bsc_version.c b/openbsc/src/libcommon/bsc_version.c index f0369bffe..9111a0eb1 100644 --- a/openbsc/src/libcommon/bsc_version.c +++ b/openbsc/src/libcommon/bsc_version.c @@ -19,12 +19,19 @@ #include "../../bscconfig.h" +#define DIVIDER "======================================================================\r\n" const char *openbsc_copyright = "Copyright (C) 2008-2016 Harald Welte, Holger Freyther\r\n" "Contributions by Daniel Willmann, Jan Lübbe, Stefan Schmidt\r\n" "Dieter Spaar, Andreas Eversberg, Sylvain Munaut, Neels Hofmeyr\r\n\r\n" "License AGPLv3+: GNU AGPL version 3 or later <http://gnu.org/licenses/agpl-3.0.html>\r\n" "This is free software: you are free to change and redistribute it.\r\n" - "There is NO WARRANTY, to the extent permitted by law.\r\n"; + "There is NO WARRANTY, to the extent permitted by law.\r\n" DIVIDER + "WARNING: You should not run osmo-nitb except for archaeological purpose.\r\n" + "It is ancient, unmaintained and obsolete for several years. But you seem\r\n" + "to insist on using obsolete and known-broken software that ignores years \r\n" + "of hard development work. That's your choice, but you have been warned.\r\n" + "DON'T EVER BOTHER THE DEVELOPERS IF YOU ENCOUNTER PROBLEMS WITH IT!!!\r\n" + "See https://osmocom.org/projects/cellular-infrastructure/wiki/Osmocom_Network_In_The_Box\r\n" DIVIDER; diff --git a/openbsc/src/libcommon/gsm_data_shared.c b/openbsc/src/libcommon/gsm_data_shared.c index 75fe0b0ef..a97a2b9e6 100644 --- a/openbsc/src/libcommon/gsm_data_shared.c +++ b/openbsc/src/libcommon/gsm_data_shared.c @@ -87,7 +87,7 @@ const struct value_string osmo_bts_variant_names[_NUM_BTS_VARIANT + 1] = { { BTS_OSMO_LITECELL15, "osmo-bts-lc15" }, { BTS_OSMO_OCTPHY, "osmo-bts-octphy" }, { BTS_OSMO_SYSMO, "osmo-bts-sysmo" }, - { BTS_OSMO_TRX, "omso-bts-trx" }, + { BTS_OSMO_TRX, "osmo-bts-trx" }, { 0, NULL } }; diff --git a/openbsc/src/libcommon/socket.c b/openbsc/src/libcommon/socket.c index 2a64767f8..5697c3367 100644 --- a/openbsc/src/libcommon/socket.c +++ b/openbsc/src/libcommon/socket.c @@ -65,7 +65,7 @@ int make_sock(struct osmo_fd *bfd, int proto, bfd->fd = socket(AF_INET, type, proto); bfd->cb = cb; - bfd->when = BSC_FD_READ; + bfd->when = OSMO_FD_READ; bfd->data = data; bfd->priv_nr = priv_nr; diff --git a/openbsc/src/libmgcp/mgcp_network.c b/openbsc/src/libmgcp/mgcp_network.c index 49500d92c..e2686587d 100644 --- a/openbsc/src/libmgcp/mgcp_network.c +++ b/openbsc/src/libmgcp/mgcp_network.c @@ -972,14 +972,14 @@ static int bind_rtp(struct mgcp_config *cfg, const char *source_addr, mgcp_set_ip_tos(rtp_end->rtp.fd, cfg->endp_dscp); mgcp_set_ip_tos(rtp_end->rtcp.fd, cfg->endp_dscp); - rtp_end->rtp.when = BSC_FD_READ; + rtp_end->rtp.when = OSMO_FD_READ; if (osmo_fd_register(&rtp_end->rtp) != 0) { LOGP(DMGCP, LOGL_ERROR, "Failed to register RTP port %d on 0x%x\n", rtp_end->local_port, endpno); goto cleanup2; } - rtp_end->rtcp.when = BSC_FD_READ; + rtp_end->rtcp.when = OSMO_FD_READ; if (osmo_fd_register(&rtp_end->rtcp) != 0) { LOGP(DMGCP, LOGL_ERROR, "Failed to register RTCP port %d on 0x%x\n", rtp_end->local_port + 1, endpno); diff --git a/openbsc/src/libmgcp/mgcp_osmux.c b/openbsc/src/libmgcp/mgcp_osmux.c index ce344ca7b..232c23ad6 100644 --- a/openbsc/src/libmgcp/mgcp_osmux.c +++ b/openbsc/src/libmgcp/mgcp_osmux.c @@ -445,7 +445,7 @@ int osmux_init(int role, struct mgcp_config *cfg) return ret; } mgcp_set_ip_tos(osmux_fd.fd, cfg->endp_dscp); - osmux_fd.when |= BSC_FD_READ; + osmux_fd.when |= OSMO_FD_READ; ret = osmo_fd_register(&osmux_fd); if (ret < 0) { diff --git a/openbsc/src/libmsc/meas_feed.c b/openbsc/src/libmsc/meas_feed.c index 3ddcdc39c..64134934c 100644 --- a/openbsc/src/libmsc/meas_feed.c +++ b/openbsc/src/libmsc/meas_feed.c @@ -101,7 +101,7 @@ static int feed_read_cb(struct osmo_fd *ofd) char buf[256]; rc = read(ofd->fd, buf, sizeof(buf)); - ofd->fd &= ~BSC_FD_READ; + ofd->fd &= ~OSMO_FD_READ; return rc; } @@ -140,7 +140,7 @@ int meas_feed_cfg_set(const char *dst_host, uint16_t dst_port) if (rc < 0) return rc; - g_mfs.wqueue.bfd.when &= ~BSC_FD_READ; + g_mfs.wqueue.bfd.when &= ~OSMO_FD_READ; if (g_mfs.dst_host) talloc_free(g_mfs.dst_host); diff --git a/openbsc/src/libmsc/mncc_sock.c b/openbsc/src/libmsc/mncc_sock.c index 0efe3a156..98cafa16c 100644 --- a/openbsc/src/libmsc/mncc_sock.c +++ b/openbsc/src/libmsc/mncc_sock.c @@ -73,7 +73,7 @@ int mncc_sock_from_cc(struct gsm_network *net, struct msgb *msg) /* Actually enqueue the message and mark socket write need */ msgb_enqueue(&net->upqueue, msg); - net->mncc_state->conn_bfd.when |= BSC_FD_WRITE; + net->mncc_state->conn_bfd.when |= OSMO_FD_WRITE; return 0; } @@ -88,7 +88,7 @@ static void mncc_sock_close(struct mncc_sock_state *state) osmo_fd_unregister(bfd); /* re-enable the generation of ACCEPT for new connections */ - state->listen_bfd.when |= BSC_FD_READ; + state->listen_bfd.when |= OSMO_FD_READ; /* release all exisitng calls */ gsm0408_clear_all_trans(state->net, GSM48_PDISC_CC); @@ -151,7 +151,7 @@ static int mncc_sock_write(struct osmo_fd *bfd) msg = llist_entry(net->upqueue.next, struct msgb, list); mncc_prim = (struct gsm_mncc *)msg->data; - bfd->when &= ~BSC_FD_WRITE; + bfd->when &= ~OSMO_FD_WRITE; /* bug hunter 8-): maybe someone forgot msgb_put(...) ? */ if (!msgb_length(msg)) { @@ -166,7 +166,7 @@ static int mncc_sock_write(struct osmo_fd *bfd) goto close; if (rc < 0) { if (errno == EAGAIN) { - bfd->when |= BSC_FD_WRITE; + bfd->when |= OSMO_FD_WRITE; break; } goto close; @@ -190,12 +190,12 @@ static int mncc_sock_cb(struct osmo_fd *bfd, unsigned int flags) { int rc = 0; - if (flags & BSC_FD_READ) + if (flags & OSMO_FD_READ) rc = mncc_sock_read(bfd); if (rc < 0) return rc; - if (flags & BSC_FD_WRITE) + if (flags & OSMO_FD_WRITE) rc = mncc_sock_write(bfd); return rc; @@ -227,7 +227,7 @@ static void queue_hello(struct mncc_sock_state *mncc) hello->lchan_type_offset = offsetof(struct gsm_mncc, lchan_type); msgb_enqueue(&mncc->net->upqueue, msg); - mncc->conn_bfd.when |= BSC_FD_WRITE; + mncc->conn_bfd.when |= OSMO_FD_WRITE; } /* accept a new connection */ @@ -250,13 +250,13 @@ static int mncc_sock_accept(struct osmo_fd *bfd, unsigned int flags) LOGP(DMNCC, LOGL_NOTICE, "MNCC app connects but we already have " "another active connection ?!?\n"); /* We already have one MNCC app connected, this is all we support */ - state->listen_bfd.when &= ~BSC_FD_READ; + state->listen_bfd.when &= ~OSMO_FD_READ; close(rc); return 0; } conn_bfd->fd = rc; - conn_bfd->when = BSC_FD_READ; + conn_bfd->when = OSMO_FD_READ; conn_bfd->cb = mncc_sock_cb; conn_bfd->data = state; @@ -299,7 +299,7 @@ int mncc_sock_init(struct gsm_network *net, const char *sock_path) return -1; } - bfd->when = BSC_FD_READ; + bfd->when = OSMO_FD_READ; bfd->cb = mncc_sock_accept; bfd->data = state; diff --git a/openbsc/src/libmsc/smpp_smsc.c b/openbsc/src/libmsc/smpp_smsc.c index 1cee3fe81..3b76d5793 100644 --- a/openbsc/src/libmsc/smpp_smsc.c +++ b/openbsc/src/libmsc/smpp_smsc.c @@ -915,7 +915,7 @@ static int link_accept_cb(struct smsc *smsc, int fd, osmo_wqueue_init(&esme->wqueue, 10); esme->wqueue.bfd.fd = fd; esme->wqueue.bfd.data = esme; - esme->wqueue.bfd.when = BSC_FD_READ; + esme->wqueue.bfd.when = OSMO_FD_READ; if (osmo_fd_register(&esme->wqueue.bfd) != 0) { close(fd); diff --git a/openbsc/src/libtrau/rtp_proxy.c b/openbsc/src/libtrau/rtp_proxy.c index 6b38ee5fe..59fee12b8 100644 --- a/openbsc/src/libtrau/rtp_proxy.c +++ b/openbsc/src/libtrau/rtp_proxy.c @@ -286,7 +286,7 @@ int rtp_send_frame(struct rtp_socket *rs, struct gsm_data_frame *frame) else memcpy(payload, frame->data, payload_len); msgb_enqueue(&rss->tx_queue, msg); - rss->bfd.when |= BSC_FD_WRITE; + rss->bfd.when |= OSMO_FD_WRITE; return 0; } @@ -396,7 +396,7 @@ static int rtp_socket_read(struct rtp_socket *rs, struct rtp_sub_socket *rss) rc = read(rss->bfd.fd, msg->data, RTP_ALLOC_SIZE); if (rc == 0) { - rss->bfd.when &= ~BSC_FD_READ; + rss->bfd.when &= ~OSMO_FD_READ; goto out_free; } else if (rc < 0) { /* Ignore "connection refused". this happens, If we open the @@ -405,7 +405,7 @@ static int rtp_socket_read(struct rtp_socket *rs, struct rtp_sub_socket *rss) goto out_free; DEBUGPC(DLMUX, "Read of RTP socket (%p) failed (errno %d, " "%s)\n", rs, errno, strerror(errno)); - rss->bfd.when &= ~BSC_FD_READ; + rss->bfd.when &= ~OSMO_FD_READ; goto out_free; } @@ -430,7 +430,7 @@ static int rtp_socket_read(struct rtp_socket *rs, struct rtp_sub_socket *rss) goto out_free; } msgb_enqueue(&other_rss->tx_queue, msg); - other_rss->bfd.when |= BSC_FD_WRITE; + other_rss->bfd.when |= OSMO_FD_WRITE; break; case RTP_RECV_UPSTREAM: @@ -448,7 +448,7 @@ static int rtp_socket_read(struct rtp_socket *rs, struct rtp_sub_socket *rss) if (rc < 0) goto out_free; msgb_enqueue(&rss->tx_queue, msg); - rss->bfd.when |= BSC_FD_WRITE; + rss->bfd.when |= OSMO_FD_WRITE; break; } if (rss->bfd.priv_nr != RTP_PRIV_RTP) { @@ -482,7 +482,7 @@ static int rtp_socket_write(struct rtp_socket *rs, struct rtp_sub_socket *rss) msg = msgb_dequeue(&rss->tx_queue); if (!msg) { - rss->bfd.when &= ~BSC_FD_WRITE; + rss->bfd.when &= ~OSMO_FD_WRITE; return 0; } @@ -516,10 +516,10 @@ static int rtp_bfd_cb(struct osmo_fd *bfd, unsigned int flags) return -EINVAL; } - if (flags & BSC_FD_READ) + if (flags & OSMO_FD_READ) rtp_socket_read(rs, rss); - if (flags & BSC_FD_WRITE) + if (flags & OSMO_FD_WRITE) rtp_socket_write(rs, rss); return 0; @@ -600,7 +600,7 @@ static int rtp_sub_socket_bind(struct rtp_sub_socket *rss, uint32_t ip, rss->sin_local.sin_family = AF_INET; rss->sin_local.sin_addr.s_addr = htonl(ip); rss->sin_local.sin_port = htons(port); - rss->bfd.when |= BSC_FD_READ; + rss->bfd.when |= OSMO_FD_READ; rc = bind(rss->bfd.fd, (struct sockaddr *)&rss->sin_local, sizeof(rss->sin_local)); diff --git a/openbsc/src/osmo-bsc/osmo_bsc_msc.c b/openbsc/src/osmo-bsc/osmo_bsc_msc.c index badecc682..a4b0d0f01 100644 --- a/openbsc/src/osmo-bsc/osmo_bsc_msc.c +++ b/openbsc/src/osmo-bsc/osmo_bsc_msc.c @@ -153,7 +153,7 @@ static int mgcp_create_port(struct bsc_msc_data *data) } osmo_wqueue_init(&data->mgcp_agent, 10); - data->mgcp_agent.bfd.when = BSC_FD_READ; + data->mgcp_agent.bfd.when = OSMO_FD_READ; data->mgcp_agent.bfd.data = data; data->mgcp_agent.read_cb = mgcp_do_read; data->mgcp_agent.write_cb = mgcp_do_write; diff --git a/openbsc/src/osmo-bsc_mgcp/mgcp_main.c b/openbsc/src/osmo-bsc_mgcp/mgcp_main.c index 220efa3e8..8a71f53f5 100644 --- a/openbsc/src/osmo-bsc_mgcp/mgcp_main.c +++ b/openbsc/src/osmo-bsc_mgcp/mgcp_main.c @@ -246,7 +246,7 @@ int main(int argc, char **argv) /* we need to bind a socket */ if (rc == 0) { - cfg->gw_fd.bfd.when = BSC_FD_READ; + cfg->gw_fd.bfd.when = OSMO_FD_READ; cfg->gw_fd.bfd.cb = read_call_agent; cfg->gw_fd.bfd.fd = socket(AF_INET, SOCK_DGRAM, 0); if (cfg->gw_fd.bfd.fd < 0) { diff --git a/openbsc/src/osmo-bsc_nat/bsc_mgcp_utils.c b/openbsc/src/osmo-bsc_nat/bsc_mgcp_utils.c index 1b0abf371..069c9646b 100644 --- a/openbsc/src/osmo-bsc_nat/bsc_mgcp_utils.c +++ b/openbsc/src/osmo-bsc_nat/bsc_mgcp_utils.c @@ -1127,7 +1127,7 @@ static int init_mgcp_socket(struct bsc_nat *nat, struct mgcp_config *cfg) } osmo_wqueue_init(&cfg->gw_fd, 10); - cfg->gw_fd.bfd.when = BSC_FD_READ; + cfg->gw_fd.bfd.when = OSMO_FD_READ; cfg->gw_fd.bfd.data = nat; cfg->gw_fd.read_cb = mgcp_do_read; cfg->gw_fd.write_cb = mgcp_do_write; diff --git a/openbsc/src/osmo-bsc_nat/bsc_nat.c b/openbsc/src/osmo-bsc_nat/bsc_nat.c index 9bb33adcf..90af4d780 100644 --- a/openbsc/src/osmo-bsc_nat/bsc_nat.c +++ b/openbsc/src/osmo-bsc_nat/bsc_nat.c @@ -1381,7 +1381,7 @@ static int ipaccess_listen_bsc_cb(struct osmo_fd *bfd, unsigned int what) struct sockaddr_in sa; socklen_t sa_len = sizeof(sa); - if (!(what & BSC_FD_READ)) + if (!(what & OSMO_FD_READ)) return 0; fd = accept(bfd->fd, (struct sockaddr *) &sa, &sa_len); @@ -1431,7 +1431,7 @@ static int ipaccess_listen_bsc_cb(struct osmo_fd *bfd, unsigned int what) bsc->write_queue.bfd.fd = fd; bsc->write_queue.read_cb = ipaccess_bsc_read_cb; bsc->write_queue.write_cb = bsc_write_cb; - bsc->write_queue.bfd.when = BSC_FD_READ; + bsc->write_queue.bfd.when = OSMO_FD_READ; if (osmo_fd_register(&bsc->write_queue.bfd) < 0) { LOGP(DNAT, LOGL_ERROR, "Failed to register BSC fd.\n"); close(fd); @@ -1535,12 +1535,20 @@ static void handle_options(int argc, char **argv) } } -static void signal_handler(int signal) +static void signal_handler(int signum) { - switch (signal) { + switch (signum) { case SIGABRT: - /* in case of abort, we want to obtain a talloc report - * and then return to the caller, who will abort the process */ + /* in case of abort, we want to obtain a talloc report and + * then run default SIGABRT handler, who will generate coredump + * and abort the process. abort() should do this for us after we + * return, but program wouldn't exit if an external SIGABRT is + * received. + */ + talloc_report_full(tall_bsc_ctx, stderr); + signal(SIGABRT, SIG_DFL); + raise(SIGABRT); + break; case SIGUSR1: talloc_report_full(tall_bsc_ctx, stderr); break; diff --git a/openbsc/src/osmo-bsc_nat/bsc_ussd.c b/openbsc/src/osmo-bsc_nat/bsc_ussd.c index d44b1b2fe..471743ac9 100644 --- a/openbsc/src/osmo-bsc_nat/bsc_ussd.c +++ b/openbsc/src/osmo-bsc_nat/bsc_ussd.c @@ -237,7 +237,7 @@ static int ussd_listen_cb(struct osmo_fd *bfd, unsigned int what) socklen_t sa_len = sizeof(sa); int fd; - if (!(what & BSC_FD_READ)) + if (!(what & OSMO_FD_READ)) return 0; fd = accept(bfd->fd, (struct sockaddr *) &sa, &sa_len); @@ -259,7 +259,7 @@ static int ussd_listen_cb(struct osmo_fd *bfd, unsigned int what) osmo_wqueue_init(&conn->queue, 10); conn->queue.bfd.data = conn; conn->queue.bfd.fd = fd; - conn->queue.bfd.when = BSC_FD_READ; + conn->queue.bfd.when = OSMO_FD_READ; conn->queue.read_cb = ussd_read_cb; conn->queue.write_cb = bsc_write_cb; diff --git a/openbsc/src/osmo-nitb/bsc_hack.c b/openbsc/src/osmo-nitb/bsc_hack.c index 2aeaa8fef..9ce5e124a 100644 --- a/openbsc/src/osmo-nitb/bsc_hack.c +++ b/openbsc/src/osmo-nitb/bsc_hack.c @@ -65,6 +65,7 @@ extern const char *openbsc_copyright; static int daemonize = 0; static const char *mncc_sock_path = NULL; static int use_db_counter = 1; +static bool yes_i_really_want = false; /* timer to store statistics */ #define DB_SYNC_INTERVAL 60, 0 @@ -115,6 +116,7 @@ static void handle_options(int argc, char **argv) while (1) { int option_index = 0, c; static struct option long_options[] = { + {"yes-i-really-want-to-run-prehistoric-software", 0, 0, 0}, {"help", 0, 0, 'h'}, {"debug", 1, 0, 'd'}, {"daemonize", 0, 0, 'D'}, @@ -139,6 +141,10 @@ static void handle_options(int argc, char **argv) break; switch (c) { + case 0: + if (option_index == 0) + yes_i_really_want = true; + break; case 'h': print_usage(); print_help(); @@ -196,11 +202,11 @@ static void handle_options(int argc, char **argv) } extern void *tall_vty_ctx; -static void signal_handler(int signal) +static void signal_handler(int signum) { - fprintf(stdout, "signal %u received\n", signal); + fprintf(stdout, "signal %u received\n", signum); - switch (signal) { + switch (signum) { case SIGINT: case SIGTERM: bsc_shutdown_net(bsc_gsmnet); @@ -210,8 +216,17 @@ static void signal_handler(int signal) break; case SIGABRT: osmo_generate_backtrace(); - /* in case of abort, we want to obtain a talloc report - * and then return to the caller, who will abort the process */ + /* in case of abort, we want to obtain a talloc report and + * then run default SIGABRT handler, who will generate coredump + * and abort the process. abort() should do this for us after we + * return, but program wouldn't exit if an external SIGABRT is + * received. + */ + talloc_report(tall_vty_ctx, stderr); + talloc_report_full(tall_bsc_ctx, stderr); + signal(SIGABRT, SIG_DFL); + raise(SIGABRT); + break; case SIGUSR1: talloc_report(tall_vty_ctx, stderr); talloc_report_full(tall_bsc_ctx, stderr); @@ -273,6 +288,28 @@ int main(int argc, char **argv) /* Parse options */ handle_options(argc, argv); +#define DIVIDER "======================================================================\n" + if (!yes_i_really_want) { + fprintf(stderr, DIVIDER + "ERROR: You should not run osmo-nitb. It is ancient, unmaintained and\n" + "obsolete for several years. If you really want to ignore years of hard work on\n" + "the new post-NITB stack (osmo-bsc, osmo-mgw, osmo-msc, osmo-hlr, osmo-stp),\n" + "you may ues the '--yes-i-really-want-to-run-prehistoric-software' command line\n" + "argument. DON'T EVER BOTHER THE DEVELOPERS IF YOU ENCOUNTER PROBLEMS WITH IT!!!\n" + "Use https://osmocom.org/projects/cellular-infrastructure/wiki/Osmocom_Network_In_The_Box\n" + DIVIDER); + exit(2); + } else { + fprintf(stderr, DIVIDER + "WARNING: You should not run osmo-nitb except for archaeological purpose.\n" + "It is ancient, unmaintained and obsolete for several years. But you seem\n" + "to insist on using obsolete and known-broken software that ignores years \n" + "of hard development work. That's your choice, but you have been warned.\n" + "DON'T EVER BOTHER THE DEVELOPERS IF YOU ENCOUNTER PROBLEMS WITH IT!!!\n" + "Use https://osmocom.org/projects/cellular-infrastructure/wiki/Osmocom_Network_In_The_Box\n" + DIVIDER); + } + /* Allocate global gsm_network struct; choose socket/internal MNCC */ rc = bsc_network_alloc(mncc_sock_path? mncc_sock_from_cc : int_mncc_recv); diff --git a/openbsc/tests/ctrl_test_runner.py b/openbsc/tests/ctrl_test_runner.py index a1d4195c7..7724f77fd 100755 --- a/openbsc/tests/ctrl_test_runner.py +++ b/openbsc/tests/ctrl_test_runner.py @@ -468,7 +468,8 @@ class TestCtrlNITB(TestCtrlBase): def ctrl_command(self): return ["./src/osmo-nitb/osmo-nitb", "-c", - "doc/examples/osmo-nitb/nanobts/osmo-nitb.cfg", "-l", "test_hlr.sqlite3"] + "doc/examples/osmo-nitb/nanobts/osmo-nitb.cfg", "-l", "test_hlr.sqlite3", + "--yes-i-really-want-to-run-prehistoric-software"] def ctrl_app(self): return (4249, "./src/osmo-nitb/osmo-nitb", "OsmoBSC", "nitb") diff --git a/openbsc/tests/db/db_test.c b/openbsc/tests/db/db_test.c index 516718522..ad417295a 100644 --- a/openbsc/tests/db/db_test.c +++ b/openbsc/tests/db/db_test.c @@ -205,7 +205,10 @@ int main() { printf("Testing subscriber database code.\n"); osmo_init_logging(&log_info); - log_set_print_filename(osmo_stderr_target, 0); + log_set_print_filename2(osmo_stderr_target, LOG_FILENAME_NONE); + log_set_use_color(osmo_stderr_target, 0); + log_set_print_category(osmo_stderr_target, 0); + log_set_print_category_hex(osmo_stderr_target, 0); dummy_net.subscr_group = &dummy_sgrp; dummy_sgrp.net = &dummy_net; diff --git a/openbsc/tests/db/db_test.err b/openbsc/tests/db/db_test.err index 27e570372..4be5b10c7 100644 --- a/openbsc/tests/db/db_test.err +++ b/openbsc/tests/db/db_test.err @@ -1,3 +1,2 @@ Going to migrate from revision 3 -[0;mGoing to migrate from revision 4 -[0;m
\ No newline at end of file +Going to migrate from revision 4 diff --git a/openbsc/tests/smpp/smpp_test.c b/openbsc/tests/smpp/smpp_test.c index 62fa9d2e9..99c268365 100644 --- a/openbsc/tests/smpp/smpp_test.c +++ b/openbsc/tests/smpp/smpp_test.c @@ -66,7 +66,9 @@ int main(int argc, char **argv) { osmo_init_logging(&log_info); log_set_use_color(osmo_stderr_target, 0); - log_set_print_filename(osmo_stderr_target, 0); + log_set_print_filename2(osmo_stderr_target, LOG_FILENAME_NONE); + log_set_print_category(osmo_stderr_target, 0); + log_set_print_category_hex(osmo_stderr_target, 0); test_coding_scheme(); return EXIT_SUCCESS; diff --git a/openbsc/tests/smpp_test_runner.py b/openbsc/tests/smpp_test_runner.py index a34d7baa6..b518ebbdd 100755 --- a/openbsc/tests/smpp_test_runner.py +++ b/openbsc/tests/smpp_test_runner.py @@ -64,7 +64,8 @@ class TestSMPPNITB(TestVTYBase): def vty_command(self): return ["./src/osmo-nitb/osmo-nitb", "-c", - "doc/examples/osmo-nitb/nanobts/osmo-nitb.cfg"] + "doc/examples/osmo-nitb/nanobts/osmo-nitb.cfg", + "--yes-i-really-want-to-run-prehistoric-software"] def vty_app(self): return (4242, "./src/osmo-nitb/osmo-nitb", "OpenBSC", "nitb") diff --git a/openbsc/tests/subscr/bsc_subscr_test.c b/openbsc/tests/subscr/bsc_subscr_test.c index 60d687d58..cbe635e08 100644 --- a/openbsc/tests/subscr/bsc_subscr_test.c +++ b/openbsc/tests/subscr/bsc_subscr_test.c @@ -114,10 +114,11 @@ int main() { printf("Testing BSC subscriber core code.\n"); osmo_init_logging(&log_info); - log_set_print_filename(osmo_stderr_target, 0); + log_set_print_filename2(osmo_stderr_target, LOG_FILENAME_NONE); log_set_print_timestamp(osmo_stderr_target, 0); log_set_use_color(osmo_stderr_target, 0); log_set_print_category(osmo_stderr_target, 1); + log_set_print_category_hex(osmo_stderr_target, 0); log_set_category_filter(osmo_stderr_target, DREF, 1, LOGL_DEBUG); bsc_subscribers = talloc_zero(NULL, struct llist_head); diff --git a/openbsc/tests/subscr/subscr_test.c b/openbsc/tests/subscr/subscr_test.c index 2a5d0e1c2..947c2c3ef 100644 --- a/openbsc/tests/subscr/subscr_test.c +++ b/openbsc/tests/subscr/subscr_test.c @@ -105,7 +105,9 @@ int main() { printf("Testing subscriber core code.\n"); osmo_init_logging(&log_info); - log_set_print_filename(osmo_stderr_target, 0); + log_set_print_filename2(osmo_stderr_target, LOG_FILENAME_NONE); + log_set_print_category(osmo_stderr_target, 0); + log_set_print_category_hex(osmo_stderr_target, 0); dummy_net.subscr_group = &dummy_sgrp; dummy_sgrp.net = &dummy_net; diff --git a/openbsc/tests/vty_test_runner.py b/openbsc/tests/vty_test_runner.py index 8044e6186..a1293be4b 100755 --- a/openbsc/tests/vty_test_runner.py +++ b/openbsc/tests/vty_test_runner.py @@ -171,7 +171,8 @@ class TestVTYNITB(TestVTYGenericBSC): def vty_command(self): return ["./src/osmo-nitb/osmo-nitb", "-c", - "doc/examples/osmo-nitb/nanobts/osmo-nitb.cfg"] + "doc/examples/osmo-nitb/nanobts/osmo-nitb.cfg", + "--yes-i-really-want-to-run-prehistoric-software"] def vty_app(self): return (4242, "./src/osmo-nitb/osmo-nitb", "OpenBSC", "nitb") |