Commit Graph

92 Commits

Author SHA1 Message Date
Harald Welte dfe6c7d910 split 'libosmocore' from openbsc codebase
This library is intended to collect all generic/common funcitionality
of all Osmocom.org projects, including OpenBSC but also OsmocomBB

The library currently includes the following modules:

bitvec, comp128, gsm_utils, msgb, select, signal, statistics, talloc, timer,
tlv_parse, linuxlist

msgb allocation error debugging had to be temporarily disabled as it depends on
'debug.c' functionality which at the moment remains in OpenBSC
2010-02-20 16:27:23 +01:00
Harald Welte 39315c4798 [OML] parse attributes depending on BTS type
Some NM attributes are defined differently depending on
the BTS type.  Having one big nm_att_tlvdef[] table for
all BTS types is no longer sufficient.  This patch

* introduces 'struct gsm_bts_model' to describe a BTS model
* adds definitions of gsm_bts_model for BS-11 and nanoBTS
* changes the abis_nm_tlv_parse() function: include a bts pointer
2010-01-10 18:01:52 +01:00
Harald Welte 6e670aab5a introduce new gsm_bts_trx_by_nr() function 2010-01-07 20:45:42 +01:00
Sylvain Munaut 4719307f50 gsm_data: Move auth related structure earlier
This is gonna be needed by the next commit ...

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-01-03 10:54:30 +01:00
Sylvain Munaut c863cbb171 gsm_data: Fix sres to be 4 bytes
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-01-03 10:48:23 +01:00
Sylvain Munaut 70881b7e8a db: Add issued/use_count/key_seq fields to AuthTuples
Theses will be useful to know if we can reuse the tuples or if
we should renew. The 'issued' is currently purely informative.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-01-03 10:17:35 +01:00
Harald Welte 83579ca8ff keep 'silent call' state in struct lchan
This enables us to reliably detect if a lchan is part of a silent
call or not.
2010-01-01 10:59:19 +01:00
Holger Hans Peter Freyther f31e4745bb [misc] Utilize rf_locking by setting the nm_state.administrative
* On start the vty code will call the abis_nm method and this
  will set the administrative state to unlock/lock
* During startup the BTS will report its state as well and would
  possible overwrite the set administrative. We are only going
  to update the administrative if it was 0 before. This appears
  to work on all of my tests. In case this will not be the case
  for others we will have to split the administrative into two
  sets one for the BTS and one for the BSC.
2009-12-31 03:05:52 +01:00
Harald Welte (local) d48f4ebb24 rsl: add new 'gsm_trx_name()' function and use it 2009-12-29 11:00:41 +01:00
Harald Welte 1887f9d153 Introduce gsm_lchans_name() for human readable lchan state name
Also, use this new function to dump lchan state on VTY and to
improve readability of RSL log messages.
2009-12-29 10:53:25 +01:00
Harald Welte 8e93b7908f RSL: Introduce LCHAN_S_REL_REQ state
This state will help us to differentiate between channels where we have
requested the release, and channels that are actually released.
2009-12-29 10:53:25 +01:00
Harald Welte (local) 7b37d9710d set the TRX nominal power by default and/or VTY 2009-12-28 13:42:47 +01:00
Harald Welte (local) 19ef62a0a5 Introduce and use gsm_lchan_name() in addition to gsm_ts_name()
In many cases we actually want a name / unique ID for the lchan,
not just for the on-air timeslot... especially in SDCCH/8 case,
where 8 SDCCHs share one timeslot...
2009-12-28 13:42:33 +01:00
Harald Welte (local) 3e46031f52 Introduce new ACT_REQ state to prevent race condition during channel allocation
When we allocate a channel, we send the RSL CHAN ACT REQ and wait until we get
a CHAN ACT ACK.  Only the ACK will change the state, so there is a race where
we allocate that same channel to a different channel request before we get
the ACT ACK.

Introducing a new ACT_REQ state resolves this issue.
2009-12-28 13:41:16 +01:00
Harald Welte (local) ccd8845449 rename gsm_lchan_name() to gsm_lchant_name() 2009-12-28 13:41:06 +01:00
Harald Welte (local) 240ce88185 add 'get_string_value()' as inverse function of 'get_value_string()' 2009-12-26 22:47:55 +01:00
Harald Welte d0c19148dd [debug] Introduce DREF debug category for reference counting 2009-12-24 11:46:44 +01:00
Harald Welte 3606cc5765 [authentication] Code for retrieving authentication data from SQL DB
This is the first step towards supporting actual A3/A8 authentication.
2009-12-24 09:37:34 +01:00
Harald Welte ffa55a4e87 statistics: Introduce 'struct counter' instead of using unsigned long
This has the advantage that counters can be added all over the code
very easily, while having only one routine that stores all of the
current counter values to the database.  The counters are synced
every 60 seconds, providing relatively fine grained statistics
about the network usage as time passes by.
2009-12-22 20:42:40 +01:00
Harald Welte 24ff6ee0a3 keep some internal statistics inside OpenBSC
the statistics will give us some idea about the network load and
performance.
2009-12-22 00:41:05 +01:00
Harald Welte 713550120c remove duplicate flag for cell barring
it's sufficient if we keep the state of cell barring in one place
2009-12-21 23:08:18 +01:00
Harald Welte f7c28b099f [handover] Real handover algorithm
This implements the handover algorithm (and associated parameters)
as described in Chapter 8 of the book "Performance Enhancements in
a Frequency |Hopping GSM Network" by Thomas Toftegard Nielsen and Jeroen
Wigard.

The parameters such as averaging windows are configured in struct
gsm_network.  We keep some state to trakc up to 10 neighbors as
they are being reported from the MS.

This has so far only been tested in a network with two BTS that
have each other as neighbor.  Networks with morge neighbors might
encounter bugs.
2009-12-21 13:33:10 +01:00
Harald Welte b8bfc567b7 RSL: keep track if a channel is active or not
This allows us to block packets that we have received after the channel
is no longer being used.  This is visible during handover, where we still
receive a measurement report after the MS has switched to the new channel.

This leftover measurement report then attempts to trigger another handover,
which si bogus and will fail - and thus only consumes resources.

With the new LCHAN_S_ACTIVE state, we can check for this when processing
the measurement report.
2009-12-21 13:33:10 +01:00
Harald Welte f88c8a02fc remove hand full of 'extern ipacc_rtp_direct' definitions
and instead declare it in gsm_data.h
2009-12-20 14:18:11 +01:00
Harald Welte bc814501e8 [handover] add VTY parameter to enable/disable handover 2009-12-19 21:41:52 +01:00
Harald Welte 5e3d91bff7 ip.access: Keep a full copy of local and remote IP/PORT in lchan
Keeping all parameters for each RTP connection in the abis_ip member of
lchan will help us with actual TCH handover later on.
2009-12-19 18:35:56 +01:00
Harald Welte 88a412ac80 ip.access: Keep OML/RSL up/down state per-bts for multi-BTS setups 2009-12-16 17:32:37 +01:00
Harald Welte d12b0fdf51 introduce cache of 6 last recently received measurement reports for each lchan 2009-12-15 21:36:05 +01:00
Harald Welte 0b12103965 add BSIC parameter to gsm_bts_neighbor()
When looking for the gsm_bts of a neighbor cell, use BSIC and ARFCN
tuple rather than just ARFCN for better identification purpose.
2009-12-15 00:21:31 +01:00
Harald Welte 84874c9005 Implement gsm_bts_neighbor() function to determine neighbor BTS
We will need this for the actual handover algorithm implementation, as we will
only know the current BTS and the BCCH ARFCN of the strongest cell in the
measurement reports.  Using this new function, we can resolve the matching
gsm_bts.
2009-12-14 22:33:02 +01:00
Harald Welte 6c40def716 system_information: use bitvec to generate frequency lists
We use a 1024-bit-sized bitvec to generate the BA and neighbor frequency list.

This bitvec is still generated from the list of all BTS's inside the BSC, but
this patch is the first step to generalize this, i.e. generate arbitrary
neighbor lists.
2009-12-14 22:07:14 +01:00
Harald Welte 648b6ce083 Add VTY setting for whether or not to sending MM INFO 2009-12-14 09:00:24 +01:00
Harald Welte eab84a112c [RRLP] make RRLP mode configurable from config file
We now support different RRLP modes (including "none" to disable RRLP),
you can configure it via "rrlp mode" in the "network" section of
openbsc.cfg.
2009-12-13 10:53:12 +01:00
Harald Welte 1085c097e3 location updating reject cause now specified on VTY rather than command line argument 2009-12-06 12:22:59 +05:30
Harald Welte 2c82899135 move RTP socket information from timeslot to lchan
With ip.access, in case of TCH/H, we have one RTP stream for each half-slot
(lchan), not just one per on-air timeslot.  This is quite different from
a classic BTS where the TRAU frames of the two TCH/H channels would be
part of the same 16k sub-slot in a E1 timeslot.
2009-12-02 01:56:49 +05:30
Harald Welte a43f789a0a Replace template-based SYSTEM INFORMATION with real implementation
Before this commit, OpenBSC used templates for the SYSTEM INFO
1, 2, 3, 4, 5 and 6 messages.  Those templates were patched in
various places to reflect the network config like ARFCN.

Now, we actually generate those SI messages ourselves, using
values from the configuration file, and even calculating neighbor
cell lists.

All bts'es that you have configured in OpenBSC will end up in
the neighbor cell list - which should be more than sufficient for
the current small-single-site networks.
2009-12-01 18:04:30 +05:30
Harald Welte b84ddfc22f Assign default values for T3101 and T3113
Without those default values, old config files will no longer work
after commit 23975e718f
2009-12-01 17:36:54 +05:30
Holger Hans Peter Freyther 2d501ea26a [vty] Add option to disable RF on a given TRX.
- Make sure that on runtime the Radio Carrier can be
  locked and unlocked. The vty code calls into the
  Abis NM to lock/unlock the channel and the state is
  stored there.

- Make sure that on start the Radio Carries remains
  offline and we are not starting it. On start the
  radio carrier is either locked or unlocked. This means
  the RSL will not connect until the RF is unlocked. It
  will connect then. To see RSL bringup failures one
  needs to parse the RSL nack message.

- When the TRX is locked on startup the RSL link will
  only be established after it will be unlocked.
2009-11-24 13:08:50 +01:00
Holger Hans Peter Freyther 4642d4917f [network] Make use of T3113 for paging
Add it to the configuration files and make use
of it in the the paging.c.
2009-11-22 05:28:24 +01:00
Holger Hans Peter Freyther 23975e718f [network] Add config option for the remaining network timers
There are all set to 0 and not used within the code yet but
should be used in the future.
2009-11-22 05:28:23 +01:00
Holger Hans Peter Freyther c4d88ad971 [network] Make T3101 configurable and use it in abis_rsl 2009-11-22 05:28:23 +01:00
Holger Hans Peter Freyther ea52802762 [lchan] RSL and RR need the multirate config, place it in the lchan
Both GSM 04.08 RR and GSM 08.58 RSL need the multirate config
in the channel modify. Place the config in the lchan, change
the gsm48 methods to not take the argument, change the RSL
implementation to make use of it with the right IE.

The other code should use the t(l)v_put routines as well but
were left untouched for now.
2009-11-19 11:42:03 +01:00
Holger Hans Peter Freyther f7d752f7ac [si] Make it possible to set the NECI value...
Allow to configure the NECI value... and change code
that is relying on the NECI value.
2009-11-17 09:46:33 +01:00
Harald Welte ccda96517c move 'struct value_string' and 'get_value_string()' to gsm_data 2009-11-12 22:28:18 +09:00
Harald Welte d409be7fae change some identifiers from u_int64_t to unsigned long long
makes printf much easier on 64bit platforms...
2009-11-07 00:06:19 +09:00
Holger Hans Peter Freyther 5ba6f48092 [lchan] Keep track which SAPIs has been established with the BTS
Keep track of which SAPIs have been established either by the
BTS (from the MS) or by us. This can be used by the on-waves
BSC code to figure out if a new request should be made.
2009-10-29 04:20:21 +01:00
Holger Hans Peter Freyther 251aa918da misc: Make bitfields unsigned int...
There is no use to have a signed bit in bitfields..
2009-10-27 10:42:28 +01:00
Harald Welte a1499d00a5 [GPRS] introudce PDCH and PDCH/TCH physical channels
GPRS needs PDCH (Packet Data Channels), and we need support in
our data model as well as OML and RSL for it
2009-10-24 10:25:50 +02:00
Harald Welte 55dd443ac2 [GPRS] add data structures for OML of NSE,CELL,NSVCE
Supporting GPRS means we have a number of additional OML objects to
deal with.  We need to extend our gsm_bts structure to at least
include the nm_state for each of those objects.
2009-10-24 10:19:14 +02:00
Mike Haben e2d8227499 [ipaccess] Add nanoBTS 1900 support
Add support for 1900 nanoBTS by using unified bts_type
GSM_BTS_TYPE_NANOBTS for 900, 1800 and 1900 versions.

Reduce the nanoBTS enum values to one and derive the
version from the user supplied band. In the future we
might want to do auto band detection.

The configuration file needs to be changed to refer
to nanobts instead of nanobts900/nanobts1800.

Signed-off-by: Mike Haben <michael.haben@btinternet.com>
Signed-off-by: Holger Hans Peter Freyther <zecke@selfish.org>
2009-10-05 12:12:54 +02:00