Commit Graph

45 Commits

Author SHA1 Message Date
Holger Hans Peter Freyther 2e4447baa5 [paging] Implement the counting for TCH/H and TCH/F
Add some code to count TCH/H and TCH/F and also handle
the neci bit of the network. Our channel allocator will
allocate a TCH/F if we request a TCH/H but can not allocate it.
2010-09-06 10:13:23 +08:00
Holger Hans Peter Freyther e66bf1fd46 [paging] Only page if we have some free channels right now
Only page if we have a load that is acceptable for paging. This
option is off by default, and can be enabled per bts. The idea
is that when we have no resources right now we will not page as
it will only create more RACHs and increase the load.

By default we are keeping the old behavior to always page and
only by changing a setting one is using the new behavior.
2010-09-06 10:13:23 +08:00
Holger Hans Peter Freyther eb241aa1d5 [paging] Continuisly send paging commands.
Instead of throwing a huge pile of paging commands to the BTS
we will submit one paging command every half second. This way
we can have different messages between the paging commands.

This is done to avoid crashes of the nanoBTS when too much
paging messages are send.
2010-09-06 10:13:23 +08:00
Holger Hans Peter Freyther 78fab29fa1 [paging] When giving credit try to send out paging requests too.
Make sure the paging timer is restarted after giving some credit
and send out paging requests.
2010-09-06 10:13:23 +08:00
Holger Hans Peter Freyther 6410d93cf8 [paging] When we ran down to 0 available paging slots start a credit timer
It might be that we run down to zero available slots but the BTS
might not send us a load indication. This can happen if we think
we send paging requests and the BTS disagrees and considers them
as errors and does not count the paging message.
When we drop to zero we will start a credit timer to give us extra
credit after six seconds, if we get a CCCH load indication before
we will stop the timer.
2010-09-06 10:13:22 +08:00
Holger Hans Peter Freyther c6bb3c4e33 bsc_api: Fix compile warning in paging code.. 2010-06-17 16:43:24 +08:00
Holger Hans Peter Freyther 86481c29d4 bsc_api: Make paging/silent call work with the subscriber_connection
Do not use the lchan for the paging but operate on the
subscriber_connection, change the signals too to not carry
the lchan but the subscriber connection... the silent call
and vty code still assume there is a lchan inside the
subscriber connection.
2010-06-17 15:05:57 +08:00
Holger Hans Peter Freyther 77008464be bsc_api: Move BSC API between MSC and RSL code...
The lowlevel BSC paging API is a simple wrapper around
the RSL command. The BTS will automatically repeat these
messages but if we end up with two MSC inputs we will
need to count these messages somewhere...
2010-06-16 15:42:40 +08:00
Holger Hans Peter Freyther a581136f73 [misc] Remove spaces, fix indention. 2010-04-30 13:34:15 +08:00
Holger Hans Peter Freyther ef8117883b [paging] Include chan_alloc.h to silence a compiler warning
paging.c:259: warning: implicit declaration of function ‘trx_is_usable’
2010-04-10 00:06:17 +02:00
Holger Hans Peter Freyther 1469600b0d [paging] Start with a smaller paging limit...
The value 20 is just a random number and it really depends
on the number of TRX on a bts to be a sane or insane limit.
2010-04-10 00:01:03 +02:00
Holger Hans Peter Freyther c50b836540 [paging] Move code to use LOGP and print some more information 2010-04-10 00:00:51 +02:00
Holger Hans Peter Freyther 754e801826 [paging] Simplify the last request and treat llist as a queue
The current code was overly complex. It tried to iterate over
the list in a round robin and we had to keep track of the last
element, see if we remove that one, check if the list becomes
empty... This can all replaced by treating the double linked
list as a queue. We take the item at the front, do something
on it and then and then put it back to the list at the end.
2010-04-10 00:00:15 +02:00
Holger Hans Peter Freyther 19722d4411 paging: Avoid integer underflow on ipaccess
On the nanoBTS we do not receive any load indication for the
paging channel and we just decrement our available slots and
the unsigned int wraps to the maximum value. Together with a
not yet understood bug this makes us go amock.

For the nanoBTS and even the Siemens BS11 resetting the load
to 20 after two seconds should be just fine. For the nanoBTS
we would need to reset the 20 a lot more earlier but we need
to take a look at how often we run low.
2010-04-09 23:59:52 +02:00
Holger Hans Peter Freyther 07d838a3bf [paging] Do not use request after it was was destroyed..
Increment the counter before we call the remove request
which is freeing the request...
2010-04-08 17:10:37 +02:00
Holger Hans Peter Freyther d4e7888ae3 [paging] Increase the time used to send paging messages to the BTS
Send a Paging Request to the BTS every two seconds. This way it is
unlikely that a phone will try to respond to two paging requests as
it is currently happening.
2010-04-07 23:14:36 +02:00
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
Sylvain Munaut ef24dff2a2 [signal] Differentiate paging success from expiration in SS_PAGING
This is useful information to know and actually fixes a segfault
in rllp.c where lchan is accessed even tough it could be NULL in
case of failure.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-01-07 10:37:40 +01:00
Harald Welte (local) 82ff397e31 export the 'trx_is_usable() function and use it from paging
this ensures we don't send paging requests to currently inactive transceivers.
2009-12-29 11:00:18 +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 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
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 fe9da827fd [paging] In expiration handling remove the request before doing the callback
Not doing this could lead to a double deletion due the paging
request being removed during the callback and afterwards as
well. Change the code to save the callback data, remove the
request, do the callback.

A patch was proposed by Andreas Eversberg and this one is
based on it.
2009-11-17 10:16:46 +01:00
Holger Hans Peter Freyther 927f056f34 [paging] Use paging_request_stop to stop all paging requests
This loop looks a lot like the one inside the paging code. Call
it instead and change the code in paging_request_stop to cope
with a NULL _bts.
2009-09-28 12:50:49 +02:00
Holger Hans Peter Freyther 98dd1c85ab [paging] Kill old defines from paging.c 2009-09-28 06:04:40 +02:00
Holger Hans Peter Freyther b28285d8e7 [paging] Implement paging by IMSI.
Try to page by IMSI when the TMSI is not set. This will be required
to properly support the MSC/BSSMAP.
2009-09-28 05:14:25 +02:00
Holger Hans Peter Freyther 2223025e21 [tmsi] Make the tmsi a 4 octet number
tmsi is four octets long, there is no need to make it a string
and then jump through hoops to convert it to a number. Keep the database
using it as a string to benefit from the NULL handling of the db.

Introduce the reserved tmsi which has all bits set to 1 according
to GSM 03.03 §2.4 and start checking for it and make sure the db
code will never allocate such a tmsi.
2009-09-28 05:14:25 +02:00
Holger Hans Peter Freyther 5d0e56f722 [gsm48] Introduce a gsm48_generate_mid_from_imsi method
Prefix generate_mid_from_tmsi with a gsm48_, create a new method
to binary encode the imsi. Add a unit test for parsing and decoding.

The implementation can parse the data it generated and the
last octet seems to be filled with the end mark.
2009-08-20 13:59:14 +02:00
Holger Hans Peter Freyther 081c00d885 [paging] Better use ';' for the command... 2009-08-20 13:57:12 +02:00
Harald Welte (local) 0abaf33297 paging_request() now returns the number of started paging requests
this helps the caller to determine if he will ever get called back
or not (and if he should free his data structures now or not)
2009-08-15 11:25:45 +02:00
Harald Welte b2dc37f512 Merge commit 'har/master' 2009-08-15 03:21:45 +02:00
Harald Welte e903edf580 provide return code from paging_request() function
this enables the caller to detect if the paging request was rejected
by the paging layer, especially in case it is already paging this very
subscriber.

In the case of SMS / 04.11, we used to have a memory leak of struct gsm_sms's,
since we would only free them from the paging succeeded/expired callbacks.
2009-08-15 03:16:17 +02:00
Harald Welte (local) d19e58b13c move talloc context creation out of on_dso / constructors
the various constructors get called in a non-obvious, linker determined
order, which makes certain objects disappear from the talloc report.

This change moves the talloc context creation into a new talloc_ctx.c file
2009-08-15 02:30:58 +02:00
Harald Welte f6cea1db99 when paging a MS, use the channel type indicated by caller
The existing code always paged for a TCH/F, which is really wasteful
when considering the delivery of SMS messages.

Also, increase the verbosity of the debug message a bit.
2009-08-08 15:08:19 +02:00
Harald Welte a1b285861e gsm_04_08 no longer needs to iterate over all BTS in LAC
this task is performed by the paging.c code already.
2009-08-01 19:31:47 +02:00
Harald Welte 7bfc267496 move allocation of talloc contexts into link-time constructor
This is much more optimal than checking if the context exists every
time we allocate the respective object.
2009-07-28 00:41:45 +02:00
Harald Welte 470ec29b0d use taloc_zero() rather than talloc() and explisit memset() 2009-06-26 20:25:23 +02:00
Harald Welte 2cf161be08 introduce talloc all over OpenBSC 2009-06-20 22:36:41 +02:00
Harald Welte 4bfdfe7f70 reworked MNCC codebase
This is Harald's reworked MNCC base, slowly heading towards integration
into master.  The key changes are:
* provide much more structure to the data in gsm_mncc
* encode_* and decode_* functions now take a structure rather than tons
  of individual arguments (whose order nobody can remember)
* make sure we don't have copies of the same code everywhere by introducing
  mncc_set_cause() and mncc_release_ind()
* save horizontal screen space if possible
* make sure we break lines > 80 characters
2009-06-10 23:25:50 +08:00
Holger Freyther 04866d4279 Proposal for a "channel request" interface...
Reuqests for a subscriber a stored within the gsm_subscriber
datastructure and it will keep track how many channels are
allocated for this user and of which type to decide on policy...

e.g. attempt to submit SMS during a phone call and not doing
paging but a simple (immediate) assignment of the channel...
2009-06-10 13:20:39 +02:00
Holger Hans Peter Freyther fdac4cc176 [paging] Unbreak breakge when moving things into paging.c
By calling _paging_request_stop with NULL for the lchan we
have never used the paging complete callback... I didn't
spot that when moving the code over and thought it is a great
simplification to not call paging_request_stop first and then
loop... *sigh*

restore the old behaviour. Call the callback first and then
free the requests.
2009-06-10 11:49:01 +02:00
Holger Hans Peter Freyther 2c45123807 Move the "finding" of the right BTS into paging.c
Move the secret of how to find the BTS in a LocationArea into
the paging layer. This allows to implement different strategies
without changing other parts. E.g. we might want to try the BTS
were the device was seen last and then try...

There should be no semantic change and things should continue
to work. It is sadly not tested though.
2009-06-10 06:40:48 +02:00
Harald Welte be1431076d use gsm_bts_by_lac() function to start paging of all bts with same lac
when paging is successfull, the paging_request_stop() function is called
with the current lchan, so the callback function will be called. for all
other bts', the paging_request_stop() function is called without lchan,
so the paging is stopped, but the callback function is not called.

this ensures that only one paging result is received when paging
multiple BTS. (Andreas Eversberg)
2009-06-10 11:21:55 +08:00
Harald Welte 13e10daa33 move openbsc into its own subdirectory 2009-06-10 05:40:52 +08:00