Commit Graph

2435 Commits

Author SHA1 Message Date
Holger Hans Peter Freyther d8157c07df misc: Remove the unused sgsn pointer from the compilation unit 2013-07-30 12:20:15 +04:00
Holger Hans Peter Freyther 90692f93cf misc: Move the struct bssgp_bvc_ctx into the struct osmo_pcu 2013-07-30 12:19:40 +04:00
Holger Hans Peter Freyther 90f08efe58 misc: Introduce a struct osmo_pcu and move things into it.
One of the issues with not properly re-setting everything is that
due the global state it is not clear which variables belong together
and how long it exists. Begin with creating a osmo_pcu and moving
things into this class.

Think of an organic cell, this commit is introducing the cell wall
around it... and defines what is inside and what is outside of it.
2013-07-30 12:18:45 +04:00
Holger Hans Peter Freyther a30f47613a misc: Add an option exit/quit when the BSSGP is supposed to be destroyed
The PCU does not properly re-set the state when the connection to the
BTS is lost (and the SGSN potentially is re-started during that). This
results in the BSSGP BVCI > 1 remaining blocked and no data will be
accepted by the SGSN.

Add the '-e' option and exit the PCU when the BSSGP/NS are getting
destroyed.
2013-07-27 22:15:04 +02:00
Holger Hans Peter Freyther 51c57045e5 misc: Remove if (timer_pending) stop_timer idiom from the code
osmo_timer_del is an idempotent operation. There is no requirement
to check if it is running. If you don't want a timer to run, delete
it. Maybe one should have called the method _unschedule, _cancel to
make this more clear.
2013-07-27 22:14:45 +02:00
Andreas Eversberg a004e6a823 Added timing advance support for up and downlink TBFs
The timing advance of any TBF is stored when it ends. Whenever a new TBF
with the same TLLI is created (downlink TBF), the stored TA is recalled.

This algorithm assumes that the mobile does not move too fast during
transfer. Also the mobile must start a connection in order to get correct
initial timing advance.

This algorithm does not implement the timing advance procedure as defined
in TS 04.60. To implement the standard timing advance procedure, the BTS
must decode RACH on certain bursts, the mobile is expected to send them.
This requires much more complexity to a transceiver like USRP/UmTRX or
Calypso BTS.

The algorithm was tested at TA >= 8 and works quite well.
2013-05-13 16:45:21 +02:00
Andreas Eversberg 783aa4bcb8 Allow to enable realtime priority for the BTS process
I ported the Holger's scheduling patch from sysmobts to osmo-pcu.

This is usefull, if PCU uses direct access to the DSP of sysmobts.
The latency to respond to a PH-READY_TO_SEND.ind may not be higher
than 18ms. Currently we are using nice to increase our priority but
for a heavily loaded cell this is not enough. Add an option to enable
realtime scheduling and use it in the screenrc.

Linux offers two realtime scheduling classes these are SCHED_FIFO
and SCHED_RR. For SCHED_FIFO the process is running as long as possible
(potentially taking all the CPU and never yielding it), for SCHED_RR
the process can still be pre-empted at the end of the timeslice.

Using SCHED_RR appears to be the more safe option as a run-a-way
sysmobts process will not be able to take all the CPU time.
2013-05-09 08:58:09 +02:00
Ivan Kluchnikov b6bb55d88c We shouldn't include the VTY tests in make check by default. 2013-04-24 15:53:25 +04:00
Kat 7dac4862bc Added conditional python-based tests for VTY/config handling 2013-04-06 11:00:20 +02:00
Holger Hans Peter Freyther 72075f0e00 Make the code handle SIGTERM.
This way the pcu can be easily stopped with a sysvinit script.
2013-03-19 18:33:06 +04:00
Andreas Eversberg 81a12be317 Fix: Correctly display SGSN remote IP at debugging 2013-03-17 17:16:44 +01:00
Andreas Eversberg 050ace2fb4 Introduce new file for various measurements
The measurements include:
- DL bandwidth usage
- DL packet loss rate
- DL measurements by mobile
- UL measurements by BTS

In order to receive DL measurements from mobile, it must be enabled via
system information message at BSC.
2013-03-17 17:16:44 +01:00
Andreas Eversberg 570b44b29b Add RSSI of data blocks to PCU interface
This bumps the PCU API version to 5 and requires osmo-bts >= 0.2.0.
2013-03-17 17:16:18 +01:00
Andreas Eversberg 0b874b64ef Use default 'alpha' value of 0
Since we don't know the RX and TX parameters of the BTS that might be used
with PCU, the MS should not adapt the TX power from the RX level. So the
MS should always transmits with same power.

Finding an 'alpha' and 'gamma' value that will result in a constant
RX level at the BTS is a task of deployment.
2013-03-16 15:56:01 +01:00
Harald Welte 30a73d8544 PCU: respect the PCU-side "local port" as configured via L1 IF
This makes sure that the UDP local port of the Gb link is actually
set to what is configured via OML from OpenBSC.
2013-03-10 08:57:03 +00:00
Ivan Kluchnikov 4440845614 Fixed decoding and encoding of CSN_RECURSIVE_TARRAY, CSN_RECURSIVE_TARRAY_1, CSN_RECURSIVE_TARRAY_2.
We should offset pointer to data after each iteration.
2013-03-01 02:46:10 +04:00
Ivan Kluchnikov 5dc29a51ef Fixed memory leaks caused by not freeing msgb in udp_read_cb() function. 2013-02-04 12:57:00 +04:00
Andreas Eversberg 3afe56d7d8 Fixed closing of PDCH when enabling sysmo-bts' direct DSP access
If not compiled with this support, the closing function does not exists,
so it must not be called.

Removed a "#warning", because closing is already supported.
2013-01-25 07:22:59 +01:00
Holger Hans Peter Freyther 827ed55c3b misc: Use the $enableval in the macro and not "yes"
--enable-sysmocom-bts=no does not work because the enableval variable
is not used.
2013-01-23 21:54:19 +01:00
Harald Welte e5a093986b pcu_main: Add '-V' to obtain the (compile) version of osmo-pcu 2013-01-17 12:28:16 +01:00
Harald Welte d1e340f0be VTY: complete the copyright message 2013-01-17 12:27:59 +01:00
Andreas Eversberg 71cce91a76 Use PCU's talloc context to allocate libosmogb instances
This is usefull to identifiy memory leaks while using libosmogb.
2013-01-16 13:50:42 +01:00
Andreas Eversberg 0f4541b691 Free each fl1h (sysmo-bts' layer 1 handler) when closing BTS<->PCU socket 2013-01-16 09:19:34 +01:00
Andreas Eversberg 273a222d7f Fixed memory leaks caused by not freeing bitvector
Especially each data message from SGSN caused two memory leaks, which
resulted in increasing memory usage while receiving date from SGSN.
2013-01-16 09:19:22 +01:00
Andreas Eversberg 7a5a67ab7b Use global PCU's talloc context for all talloc calls
This allows to track memory leaks of all memory that is allocated by
talloc. Especially bitvector allocations is tracked now.
2013-01-16 09:19:11 +01:00
Andreas Eversberg 97644ed7f8 Various fixes for multi slot allocation algotihm 2013-01-15 13:20:22 +01:00
Andreas Eversberg 02d7cd2ac2 Get rid of allocating first timeslot at tfi_alloc
This simpliefies the allocation process.

tfi_alloc is responsible to allocate a TFI, not a time slot.

The first time slot available depends on multislot class and on other
ongoing TBF (concurrent TBFs), so it is part of the allocation
algorithm to select it.
2013-01-15 08:59:34 +01:00
Andreas Eversberg 138f4e62d2 Adding missing initialization of logging to RLCMACTest.cpp 2013-01-14 12:31:11 +01:00
Harald Welte 9aaf2ae24d add missing examples/Makefile.am 2013-01-11 18:03:25 +01:00
Harald Welte e4050114f5 install osmo-pcu.cfg to /etc/osmocom/ 2013-01-11 17:49:22 +01:00
Harald Welte 850d80b898 add example configuration file as per Andreas' suggestion 2013-01-11 17:26:53 +01:00
Harald Welte de5253a20f make sure to register NS protocol to the VTY
Without calling gprs_ns_vty_init(), the NS specific VTY commands are not
activated.
2013-01-11 09:45:17 +01:00
Andreas Eversberg a23c7eee15 Adding direct access to DSP of sysmoBTS for PDTCH traffice
In order to use this feature, sysmoBTS requires option "-M", otherwise
the traffic is forwarded through socket interface.

This is essential, if PCU runs on processor of sysmoBTS. The reaction
time and delay of PDTCH frames could heavily degrade proper packet flow.
2012-12-18 10:47:28 +01:00
Andreas Eversberg 106ea79337 Fix: Align TLLI to 32 bit margin, before converting it 2012-12-18 10:04:24 +01:00
Andreas Eversberg d87b4685b8 Fix of debug names and initial log levels 2012-12-18 10:04:10 +01:00
Andreas Eversberg 5b8a528251 Doc: Update on README and tbf.txt 2012-12-18 10:04:03 +01:00
Andreas Eversberg f01929bcb6 Rework on multislot allocation algorithm
The slots are choosen in a way that later selection of slots for
concurrent TBFs will have the same downlink/uplink control channel
(PACCH).
This is required for polling acknowledge of new TBF assignment on PACCH.
The MS will always have the same PACCH uplink slot while beeing in packet
transfer mode.
2012-12-18 10:03:50 +01:00
Andreas Eversberg 8c3680dcc9 Added paging PS support by Ivan Kluchnikov
Original code: c7e7f6868b
(The code was committed earlier, but got lost somehow.)

I added IMSI, so the paging request is sent in correct paging group.
Also I excluded rest octets from pseudo length.

It is tested and it work.
2012-12-18 10:03:34 +01:00
Andreas Eversberg 00950743d7 Use seperate function to parse IMSI from BSSGP message 2012-12-18 10:03:24 +01:00
Andreas Eversberg afdd9e1be5 Fix: Don't use TIMING_ADVANCE_INDEX in assignment messages, if not used
Some MS will leave packet transfer mode, if TAI is given, but no timing
advance control messages are sent on PTCCH. This could results in
permanent loss of larger packets.
2012-12-18 10:03:14 +01:00
Andreas Eversberg 3a7eb6b80f Fix: Drop ongoing UL TBF, if another UL TBF is established for same TLLI
This happens, if the mobile looses coverage and establishes a subsequent
uplink TBF.
2012-12-18 10:03:05 +01:00
Andreas Eversberg 0c9b50c498 Fix: Handling of final acknowledge on downlink TBFs
It is essential to initialize the first_fin_ack variable.

Also it is essential not to free TBF, in case the final ack is not
received, but all frames have been acked. In this special case, we resend
the final block again and again (and poll), until we receive the final
ack.
2012-12-18 10:02:58 +01:00
Andreas Eversberg aafcd703f3 Fix: Be sure to check if the PACKET DOWNLINK ACK belongs to the polled MS 2012-12-18 10:02:44 +01:00
Andreas Eversberg b83e2a7d5c Adding flow chart diagram of ongoing TBFs and their events
It is quite essential. It shows how TBFs are related and helps to estimate
states and timers (timeouts) of the MS.

In order to use it, it must be defined by a switch at gprs_rlcmac.h.
2012-12-18 10:02:20 +01:00
Andreas Eversberg 5cae087ae9 Fix: Free CS paging messages 2012-12-18 10:02:01 +01:00
Andreas Eversberg f7adfdebe9 Fix: Removed potential double free bug when receiving NS messages 2012-12-18 10:01:27 +01:00
Ivan Kluchnikov 701d9f83f8 Ported fixes and improvements from Wireshark for RLC/MAC control block decoding. Part 1.
Generic improvements to the csn.1 dissector include:
• Added a flag to the type descriptor structure so that any type can (potentially) flagged as xxx_OR_NULL.  This was specifically needed for UINT_OR_NULL for the ms capabilities struct.
• Changed the CSN_SERIALIZE so that the length of the length field can be specified.
• For CSN_NEXT_EXIST removed the requirement that the next type be CSN_END, to allow truncation of multiple IEs.
• For CSN_LEFT_ALIGNED_VAR_BITMAP corrected the handling of bit_offset.
• Added a new type CSN_PADDING_BITS to make inspection of padding bits more convenient.
• Improved the CSN_RECURSIVE_TARRAY_1 to show the array index.

Improvements to the gsm_rlcmac dissector include:
• Rework the definition of EGPRS Ack/Nack Description so that the length IE (and absence thereof) is handled correctly.
• Added Padding Bits definitions to all PDUs
• Change the Multislot_capability_t and Content_t definitions to allow truncation at any IE
2012-10-10 19:43:37 +04:00
Ivan Kluchnikov 9eb552b239 Merge branch 'jolly'
Conflicts:
	src/gprs_bssgp_pcu.cpp
	src/gprs_rlcmac.cpp
	src/gprs_rlcmac_data.cpp
	src/gprs_rlcmac_sched.cpp
2012-10-05 18:17:57 +04:00
Andreas Eversberg 499ff415a9 Allow setting of seperate coding schemes for uplink and downlink 2012-10-03 14:21:36 +02:00
Andreas Eversberg 3b1332cdb4 Replace switch/case construct by a structure, to define coding schemes
A new attribute at TBF instance indicates the current scheme used.
2012-10-03 14:20:53 +02:00