Commit Graph

565 Commits

Author SHA1 Message Date
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 a992a36d5f it's LOGL_ERROR, not LOG_ERROR 2009-12-21 23:44:40 +01:00
Steffen Neubauer ac0c13c02c [sms] bugfix: additional functionality indicator only appears in TP_VPF_ENHANCED - not in TP_VPF_ABSOLUTE 2009-12-21 23:27:54 +01:00
Harald Welte 73d4fce151 make sure bootstrap_bts() only contains static initialization
values that might change at runtime are moved to set_system_infos()
which we might now also call at runtime to update the BTS with
changes in the SI
2009-12-21 23:12:19 +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 1394fea03f ipaccess: Fix two minor bugs regarding multi-TRX setup
we need to set newbfd->priv_nr to 2+trx_id, rather than keeping
it '2' all the time, as it is used to look-up the e1i_ts when
we receive a packet.  A constant '2' would always match to TRX 0.

we also need to keep one separate bit for each TRX state in order
to properly generate the EVT_E1_TEI_UP event for trx > 0.
2009-12-21 23:01:33 +01:00
Harald Welte 6a22c0135a [gprs] SI 13 should only be generated on C0 (BCCH-carrying TRX) 2009-12-21 19:10:55 +01:00
Holger Hans Peter Freyther 306b7219ac [abis] Do not access an array with N elements at index N
Possible crash fixes by preventing accessing the
array out of bounds.
2009-12-21 17:06:07 +01:00
Holger Hans Peter Freyther 17c24c9057 [abis] Properly compare obj_inst->trx_nr to bts->num_trx
* Use >= in this case as we start counting the trx from 0
* This is fixing a problem with multi trx config
2009-12-21 17:00:46 +01:00
Harald Welte b720bd3678 make handover algorithm parameters configurable from VTY 2009-12-21 16:51:50 +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 ade773f441 handover: set old channel to INACTIVE state
After receiving the HANDOVER COMPLETE on the new channel, we mark the
old channel as INACTIVE and try to release it ASAP.
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 38fe2a67e1 meas_rep: utility function for processing of measurement reports
This provides two functions: get_meas_rep_avg() to obtain the sliding
window average of one particular field, and meas_rep_n_out_of_m_be()
to check if at least N out of M measurments are >= BE.
2009-12-21 13:33:10 +01:00
Andreas Eversberg 56315f02bb Fix typo s/memcpy/memcmp in trau_frame.c 2009-12-21 01:18:44 +01:00
Sylvain Munaut f77af1fb30 chan_alloc: Delete T3101 on lchan_free as well
If a RF channel is assigned but no response is ever heard from
the phone, we will receive a CONNECTION FAIL from the BTS,
triggering a RF release freeing the channel. Then sometime later,
T3101 will expire as well and free the channel again ...

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2009-12-21 01:11:25 +01:00
Sylvain Munaut d5778fc4c7 [db] Fix queries for unsent SMS
- Need to use sms.id for the ORDER BY since 'subscriber' also has 'id'
- Need to add the join clause between 'SMS' and 'subscriber'
- Add a LIMIT 1 (probably no impact for the db size we're dealing with
here, but with large DB and mysql/postgresql this can help the planner)
- (fix a wrong comment in passing ...)

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2009-12-21 01:09:57 +01:00
Harald Welte a4e2d04b35 Fix some compiler warnings regarding missing const in rest_octets.c 2009-12-20 17:08:22 +01:00
Harald Welte 9fb1f1065a fix compiler warning and coding style in rtp_proxy 2009-12-20 17:07:23 +01:00
Harald Welte a037902323 [handover] implement TCH RTP stream handover
This patch takes care of handling the RTP streams / sockets during
an in-call handover from one BTS to another BTS.

It only works in combination with rtp_proxy mode.
2009-12-20 17:04:40 +01:00
Harald Welte a72273e176 rename ipacc_connect_proxy_bind() to rsl_ipacc_mdcx_to_rtpsock()
Our RTP sockets are no longer just for the proxy mode, so having
"proxy" in the function name is really misleading.
2009-12-20 16:53:53 +01:00
Harald Welte 17f5bf64f1 Move RTP socket handling out of signal handlers into abis_rsl
This is not really nice, but we will soon have multiple users of
the CRCX / MDCX / DLCX signals, and we cannot guarantee the ordering
of them.  So as a workaround, we move the RTP socket creation and
deletion into the core abis_rsl codebase.
2009-12-20 15:42:44 +01:00
Harald Welte fe03f0d002 don't enable handover unless RTP Proxy is enabled
We cannot support in-call handover of calls without a RTP proxy,
since at the time of the handover the SSRC, sequence number and
timestamp of the RTP frames change.
2009-12-20 14:35:56 +01:00
Harald Welte edbc0f7aea Introduce new MNCC based proxy mode
Since the MNCC API can now send and receive frames to/from the MNCC
application, we can also implement a proxy this way.  Not at the RTP/UDP packet
level, but at the 'TCH speech frame' level.

Especially for handover, we need this mode as the receiver in the BTS needs a
persistent SSRC and monotonic frame numbers / timestamps.
2009-12-20 14:22:11 +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 392736d38b RTP Proxy: Fix RTP sequence number and timestamp in case of dropped frames
During handover, we will not send RTP frames for quite some time.  However,
the way the rtp_send code is structured, it will increment the timestamp
with a fixed amount every time we send a frame, independent how much wallclock
time has actually passed.

This code is a hack to update the sequence number and timestamp in case it
seems to be wrong.  It makes handover much more reliable.
2009-12-20 13:36:42 +01:00
Harald Welte 31981a0051 add FIXME to IMSI DETACH INDICATION: we need to release all transactions 2009-12-20 13:21:01 +01:00
Harald Welte 0b7b61c6b7 fix segfault in rrlp code in case of unsuccessful paging
PAGING_COMPLETED can be signalled without an active lchan in
case it was unable to page the repsective subscriber.
2009-12-20 13:20:54 +01:00
Harald Welte 5e68183a20 handover: disable default-printing of every measurement report 2009-12-20 00:07:05 +01:00
Harald Welte ea09002e73 handover: no debug message for ever non-handover measurement report 2009-12-20 00:07:00 +01:00
Harald Welte 9f16c87106 handover: don't create negative lchan use counts
trans_lchan_change() takes care of use counts for us.
2009-12-20 00:06:53 +01:00
Harald Welte aca8f158bc Add RTP support for EFR
This is just the minimal support to receive and send EFR codec
RTP frames.

We are missing the code to convert TRAU frames in EFR format!
2009-12-19 23:09:35 +01:00
Harald Welte da7ab74298 RTP-enable MNCC API for LCR + ip.access
Instead of passing TRAU frames down the MNCC API to the call control
application like MNCC, we now decode the TRAU frame into the actual codec
frame.  We do the same with the RTP packets in case of ip.access and
thus have a unified format of passing codec data from the BTS to
an application, independent of the BTS type.

This is only implemented for V1 full-rate at the moment, and needs
to be fixed.
2009-12-19 22:23:05 +01:00
Harald Welte bc814501e8 [handover] add VTY parameter to enable/disable handover 2009-12-19 21:41:52 +01:00
Harald Welte e786c32bc9 [handover] don't use measurement reports with NCELL=7
NCELL=7 inidicates that there was no neighbor cell info in the SI5
on the SACCH.
2009-12-19 21:29:19 +01:00
Harald Welte 50e7fec9b8 system_information: DEBUGP() SI13/5/6 during startup 2009-12-19 21:29:00 +01:00
Harald Welte e2d0d5fa8c system_information: ip.access wants L2_PLEN, BS-11 doesn't
It seems that depending on the manufacturer, there is a need to include
the L2 pseudo-length in the SI5+SI6 messasges (SACCH FILLING)

Thanks to Dieter for pointing this out.
2009-12-19 21:26:54 +01:00
Harald Welte 479015bc1f don't print measurement reports that have no cells 2009-12-19 18:35:56 +01:00
Harald Welte 51cec5f725 measurement report parsing: NO-NCELL-M of 7 tells us no neighbors 2009-12-19 18:35:56 +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 f314f6899b add --help message about --rtp-proxy argument 2009-12-19 18:35:56 +01:00
Sylvain Munaut b9f3dce0ae Never allocate transaction ID 7
According to GSM 04.07 11.2.3.1.3 , TID 7 is "reserved
for future extensions".

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2009-12-19 03:22:30 +01:00
Sylvain Munaut ea3f674710 Fix subscr ref leak for multi CM SERV REQ
Multiple CM SERVICE REQUEST can happen on a single RR
connection, in this case, since the subscr reference is
tracked through lchan->subscr and will only be put'd once
on lchan_free, we need to make sure we don't get several
reference ....

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2009-12-19 03:22:25 +01:00
Sylvain Munaut feaca92fc0 Use 'new' rather than 'unknown' when starting transaction
'unknown' has a negative connotation for a case that's totally
normal so refer to it as 'new' so it doesn't sound like a problem.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2009-12-19 03:22:16 +01:00
Sylvain Munaut c56a14181c Fix transaction_id displayed in debug message
In SMS debug messages, we always display the transaction ID
as if we were 'sending' the message.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2009-12-19 03:22:04 +01:00
Sylvain Munaut 1d9efd6c9c Fix typos in debug message / comments
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2009-12-19 03:21:51 +01:00
Harald Welte 18750cf1df [handover] lchan use count handling in case of trans_lchan_change() 2009-12-18 14:51:48 +01:00
Harald Welte a9fa8dca33 [handover]: make sure the new lchan keeps the subscriber pointer of the old lchan
also, ensure that we don't print debug messages about handover in non-handover
channel activation cases.
2009-12-18 14:50:08 +01:00
Harald Welte 6f7a5a7843 handover: use correct handover lookup function 2009-12-18 11:52:03 +01:00
Harald Welte 386cd2b777 for now we only do handover of TCH channels 2009-12-18 11:49:20 +01:00