Commit Graph

62 Commits

Author SHA1 Message Date
Minh-Quang Nguyen 1f18909335 EDGE: Fix UL link adaptation.
We have seen that UL MCS5- MCS9 link adaptation has not been implemented in current PCU implementation.
If the MS slowly moves far away from the BTS, the UL MCS will always stick at MCS9 no matter UL link quality values leading to poor data service experience.
The UL MCS is expected to adapt from MCS9 -> MCSx due to bad UL quality.

Below PCU traces indicate that UL MCS is quickly increasing to MCS9 (max MCS 9 was used in this test) and it never changes to other UL MCS due zero thresholds.

<0004> gprs_ms.cpp:670 MS (IMSI ): Link quality 23dB (23dB) left window [0, 0], modifying uplink CS level: MCS-6 -> MCS-7
<0004> gprs_ms.cpp:670 MS (IMSI 000): Link quality 23dB (23dB) left window [0, 0], modifying uplink CS level: MCS-7 -> MCS-8
<0004> gprs_ms.cpp:670 MS (IMSI 000): Link quality 23dB (23dB) left window [0, 0], modifying uplink CS level: MCS-8 -> MCS-9

Change-Id: I9272c337ad6399da4a47cc6e2736e25f24e099d8
2017-08-18 18:09:24 +00:00
Pau Espin c4178e55ea Add pcu-socket vty config
osmo-bts already supports configuring a different path for the bts<->pcu
socket by using the 'pcu-socket' config field.

Change-Id: I9b3e1171da467519750b201849ec892a1e318129
2017-08-09 12:17:39 +02:00
Alexander Couzens ccde5c9557 remove pcu own bitvector implementation
The osmocore bitvec is exact the same, but use a pointer instead of
a reference.

Change-Id: Id8f797631d89aa12b6e48efb2dc153a3e2f059f7
2017-05-15 12:46:33 +00:00
Neels Hofmeyr 78ce59137f main, tests: use msgb_talloc_ctx_init() (new)
msgb_set_talloc_ctx() is deprecated since libosmocore commit
f45334be29016a36594aacc07c90e262e4994525 / change-id
I747fbbf977c4d2c868c8dead64cfc5fd86eb8d4c

Change-Id: I8d40abec428b739460ed545c9983d1b63021bd08
2017-02-08 17:37:55 +01:00
sivasankari ee78bf0882 Adds rate_ctr_init in the startup of osmo-pcu
Issue:Though the rate_ctr framework is used in osmo-pcu for bts statistics,
      the interval counters are always 0.
Fix:rate_ctr_init is added in the startup which arms the timer and hence
    the rate ctr intervals is displayed with proper values.

Change-Id: Ib0f33d2de9406aa7436aa9aeb6a8dabdff96383b
2016-12-22 14:09:43 +00:00
Neels Hofmeyr fd9e16ce97 heed VTY 'line vty'/'bind' command
Like most other osmo-* programs, bind the telnet VTY to the address specified
by the 'line vty'/'bind' command. This is added by vty_init(), so until now the
PCU offered this config but ignored it.

Change-Id: I4cca05a212ec0d493b906014dc3a83e687ebbb1d
2016-09-22 07:06:41 +02:00
Neels Hofmeyr 01826c13b1 vty: use OSMO_VTY_PORT_PCU instead of number
Include vty/ports.h and use the proper constant.

Change-Id: I9c5b7683f76994c539da5551f40df32379dc685e
2016-08-27 02:19:48 +00:00
Aravind Sirsikar 50b097003b Modify EGPRS DL TBF flow to support SPB
Modify the EGPRS DL TBF flow to support Split block during
Retx. This patch will also Upgrade the test suite with test cases
to validate the EGPRS Downlink SPB for Retransmission

Scenarios like MCS6->MCS3, MCS4->MCS1, MCS5->MCS2, MCS9->MCS3
MCS7->MCS2, MCS8->MCS3 have been simulated and Integration tested
in NuRAN 1.0 hardware thoroughly.

Change-Id: I242afdd8ae7622dec8593b26382ad66bad5b9516
2016-08-25 10:41:33 +00:00
Aravind Sirsikar 99ab0a8fa0 Add header type 1 support for EGPRS uplink
Function is added to parse the EGPRS header type 1 in uplink tbf path.
along with configuration parameter updation to reflect max mcs in UL

Change-Id: I13c250e2e07377982ac3f29745f3cffd4088552a
Reviewed-on: https://gerrit.osmocom.org/270
Reviewed-by: Harald Welte <laforge@gnumonks.org>
Tested-by: Jenkins Builder
2016-06-16 14:32:07 +00:00
Holger Hans Peter Freyther 173ef90a53 pcu: Fix compiler warning about using string
Make the gsmtap hostname const to avoid turning a constant into
a mutable character. We never tried to modify the string so the
warning didn't reveal a genuine issue.

pcu_main.cpp:49:28: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
 static char *gsmtap_addr = "localhost"; // FIXME: use gengetopt's default value instead
2016-03-04 18:26:44 +01:00
Max 2efdf69734 Introduce --gsmtap-ip/-i option
This option allows user to use custom IP address instead of default "localhost".
Correspondingly gsmtap init moved from sysmoBTS-specific code up to "bts" struct
level. This way it can be easier reused by other implementations. The
lack of regressions was verified by checking following command on
sysmoBTS: "./osmo-pcu -c osmo-pcu.cfg -r 1 -i 192.168.10.1" where
192.168.10.1 is the host which was running wireshark and netcat:
"nc -u -l 192.168.10.1 -p 4729" to accept gsmtap flow.
2016-02-22 14:00:17 +01:00
Holger Hans Peter Freyther 4f8438a6cd Merge remote-tracking branch 'origin/jerlbeck/master'
This adds EDGE support and at the same time is changing a lot of code
on GPRS support as well. Due my business decision of completing as much
as possible during the time we had the unit test coverage is not as
extensive as I had hoped for.

This is just the beginning. We do not support mixed GPRS/EDGE support
and have plenty of things to improve throughput.

Thanks to On-Waves for supporting a project with so many unknowns and
uncertainty and Jacob for leading the effort at sysmocom.
2016-02-22 09:44:39 +01:00
Harald Welte 7f4841b3ac Fix missing '-V / --version' in print_help() 2016-02-14 12:14:18 +01:00
Jacob Erlbeck 36df7740dd edge: Make window size configurable
Currently the window size is fixed to 64 even for EGPRS.

Support dynamic window sizes depending on the number of PDCH. The
WS can be set to b + f * N_PDCH. If the result is not valid according
to TS 44.060, Table 9.1.9.2.1, the value will be corrected to use the
next lower valid value (or 64).

The following VTY commands are added (config-pcu node):

  window-size <0-1024>          set base (b) value and leave f unchanged
  window-size <0-1024> <0-256>  set base (b) and factor (f)

Sponsored-by: On-Waves ehf
2016-02-08 00:45:36 +01:00
Jacob Erlbeck 96ccea8436 edge: Add initial_mcs_dl and initial_mcs_ul config values
Provide the initial MCS values for EGPRS data blocks. They are set
to 1 (MCS-1) for each direction and there is no support to change
these configuration values yet (the automatic adaption still works,
so there is probably no need to set these values).

Sponsored-by: On-Waves ehf
2016-02-01 13:58:14 +01:00
Jacob Erlbeck 0d05805b76 edge: Add max_mcs_ul and max_mcs_dl config
This sets the maximum MCS encoding used for EGPRS RLC data blocks
in either direction.

The following VTY command are added to node config-pcu:

 - mcs max <1-9>         set maximum for both, uplink and downlink
 - mcs max <1-9> <1-9>   set maximum for downlink and uplink (in that
                         order)
 - no mcs max            do not limit

Note that using a value of 4 or below for each direction implies
that a GMSK-only TBF may be assumed, which for instance would allow
the use of the GPRS MS class instead of the possibly more restrictive
EGPRS MS class.

Sponsored-by: On-Waves ehf
2016-02-01 13:58:13 +01:00
Jacob Erlbeck eb93f592e5 pcu: Enable dl-tbf-idle-time and idle-ack-delay by default
Currently these are enabled in the default config file. Since CoDel
is enabled by default in main() but should not be used without at
least dl-tbf-idle-time, the current default config may lead to
packet loss and performance problems.

This commit enables both features to provide a good (GPRS) performance
experience even without a configuration.

Sponsored-by: On-Waves ehf
2015-11-30 12:11:39 +01:00
Jacob Erlbeck 42aba81c2f stats: Enable stats subsystem
Sponsored-by: On-Waves ehf
2015-11-17 15:42:01 +01:00
Jacob Erlbeck 56af6d55ed ns: Add logging support
Currently there is not support for Network Service (NS) logging.

This commit adds the missing definitions and sets the default level
to INFO. Further configuration can now be done with the 'logging
level ns' VTY command.

Sponsored-by: On-Waves ehf
2015-08-17 16:24:11 +02:00
Jacob Erlbeck b31f5ef699 pcu: Enable LLC CoDel by default
Currently CoDel is disabled by default.

This commit enables CoDel on start up with the default interval time,
equivalent to the 'queue codel' VTY command.

To disable CoDel, use the 'no queue codel' command.

Sponsored-by: On-Waves ehf
2015-07-21 19:22:36 +02:00
Jacob Erlbeck f16a069fd7 pcu: Use alloc_algorithm_dynamic by default
The dynamic algorithm behaves like B until there are no TFI left.

This commit changes the default algorithm to to former.

Ticket: #1934
Sponsored-by: On-Waves ehf
2015-07-16 19:24:16 +02:00
Jacob Erlbeck 70b96aa232 ms: Reduce DL CS level if only a few LLC bytes are left
If just a few bytes are left to send to the MS, it makes sense to
reduce the coding scheme level to increase the throughput. This
has been shown by Chen and Goodman in their paper "Theoretical
Analysis of GPRS Throughput and Delay". See their throughput over C/I
measurement graphs (figures 4 and 5 in the paper) for details.

This commit implements a simplified CS downgrade feature for the
downlink. The coding scheme will be downgraded if there are only a
few octets are left to be send over the TBF (see the
downgrade-threshold command below) and the NACK rate is not low (the
CS will not get degraded on a high quality RF link). As an exception,
CS-3 will be degraded to CS-1, since CS-2 does not improve the
throughput in general when a few small packets are sent and the
signal fades slowly (see Chen/Goodman).

The following VTY command is added to the config-pcu node:

- cs downgrade-threshold <1-10000>
- cs no downgrade-threshold

to set the threshold of the number of remaining bytes to be RLC/MAC
encoded. The CS will only be reduced, if the number is below the
threshold. The 'no' command disables this feature completely. The
default value is 200 octets.

Sponsored-by: On-Waves ehf
2015-06-22 10:39:06 +02:00
Jacob Erlbeck 94cde130ca ms: Add UL CS selection based on L1 link quality
Currently the UL CS values are set to the corresponding DL CS value,
eventually limited by a maximum value. This approach does not reflect
the general situation of the RF link between ME and BTS, which is
rather asymmetric e.g. due to a lower degree of TX efficiency of the
built-in antenna. This means, that UL and DL CS control should be
decoupled for better results.

This commit adds automatic UL CS selection based on the link quality
measurement parameter. Each coding scheme is mapped to a link quality
range. If the link quality value leaves that range, the current UL CS
value is increased/decreased accordingly. This value will be copied
when the next PACKET_UPLINK_ACK_NACK or PACKET_UPLINK_ASSIGMENT is
sent to the MS.

The following VTY command will be added to the config-pcu node:

-  cs link-quality-ranges cs1 <0-35> cs2 <0-35> <0-35>
          cs3 <0-35> <0-35> cs4 <0-35>

which sets the ranges for the four coding schemes. For instance the
example below reflects the current default values:

  cs link-quality-ranges cs1 6 cs2 5 8 cs3 7 13 cs4 12

set the following ranges, where the overlapping is used to configure
a hysteresis:

  CS1: -inf ..  6
  CS2:    5 ..  8
  CS3:    7 .. 13
  CS4:   12 .. inf

Sponsored-by: On-Waves ehf
2015-06-22 10:39:06 +02:00
Jacob Erlbeck b33e675e5a ms: Add support for maximum CS values
Currently the CS values can be increased to CS4 even when the "cs"
configuration command has been used with a lower value. The "cs"
command just sets the initial coding scheme, so other means are
needed to limit the selection. One approach is to use the CS flags
passed in SI, but these are currently ignored.

To make it possible to limit the CS selection by configuring the PCU,
this commit adds the following VTY commands to config-pcu:

- cs max <1-4>             Limit DL and UL CS to the given value
- cs max <1-4> <1-4>       Limit DL and UL CS separately (DL first)
- no cs max                Don't limit

Ticket: #1674
Sponsored-by: On-Waves ehf
2015-06-08 09:41:07 +02:00
Jacob Erlbeck 1751c62c98 tbf: Add adaptive DL CS adjustment
To cope with transmission failures due to bad radio conditions, a
different coding scheme with more redundance can be used.

This commit adds an implemenation that is based on the Ack/Nack
ratio per PACKET DOWNLINK ACK/NACK message received from the MS.

Basically the CS level is decreased, if the block error rate goes
above cs_adj_upper_limit (default 33%), and it is increased, if the
rate drops below cs_adj_lower_limit (default 10%). Only blocks that
have been encoded with the current CS are taken into account.

Note that this approach doesn't measure the MS->BTS conditions and
that the measurement values reported by the MS are not taken into
account.

Ticket: #1739
Sponsored-by: On-Waves ehf
2015-06-08 09:40:09 +02:00
Jacob Erlbeck 3c91cb881d pcu: Set ms_idle_sec to 60s
Since the timing advance storage has been removed, the TA values are
lost, when the last TBF of a single MS is freed. The TA storage has
at least saved the last 30 TA values. So now in more cases a wrong TA
value can be transmitted to an MS. Note that this also could have
happened before the removal of the storage, especially if more than
30 MS were in use.

This commit changes the default value of ms_idle_sec to 60s which is
higher than default value for T3314 (44s, see TS 24.008, 11.2.2),
after which the SGSN will have to start paging anyway. In that case,
a RACH request will be triggered, that will trigger an update of the
TA value in the PCU.

Sponsored-by: On-Waves ehf
2015-06-05 13:49:06 +02:00
Jacob Erlbeck 1db67e0a35 tbf: Remove TimingAdvance storage
Currently the TA storage stores up to 30 TLLI->TA mappings, if more
entries are created the oldest one is dropped. In theory this can
lead to missing TA information if many MS are present.

This commit removes the TimingAdvance class completely, since the TA
value is now stored in the GprsMs objects.

Note that the GprsMs objects are currently not kept after the TBFs
have detached from them, so the TA values are now kept for a shorter
time than before.

Ticket: #1674
Sponsored-by: On-Waves ehf
2015-05-28 13:59:25 +02:00
Jacob Erlbeck 00fc6b13f2 pcu: Call bssgp_set_log_ss(DBSSGP) in main()
Currently the BSSGP functions in libosmocore do not log correctly to
DBSSGP since the DBSSGP variable in common_vty.c is left
uninitialized.

This commit adds the call to bssgp_set_log_ss() to inform libosmocore
which sub system id it shall use for BSSGP.

Sponsored-by: On-Waves ehf
2015-04-09 19:26:39 +02:00
Daniel Willmann 6d8884de49 Always exit and don't try to recover
The current code tries to recover from dropped connections and resets the
pcu state so it can keep running. However, this never worked correctly
which is why the -e option is used. This option exits the pcu as soon as
the internal state needs to be reset.

This patch removes this option and makes this behaviour default.

Ticket: SYS#390
Sponsored-by: On-Waves ehf
2014-06-15 19:28:51 +02:00
Holger Hans Peter Freyther 12c039cdb2 debug_diagram: Remove the special debug_diagram compilation mode
This approach is somehow flawed. We need/want to debug problems on
systems with real traffic and re-compiling it with debug_diagram
is not an option. All internal logging needs to be expressive enough
so we can understand what is going on (e.g. create a script to
post-process the output).
2013-11-26 20:57:24 +01:00
Holger Hans Peter Freyther 4e8b50cd8d misc: Fix a potential leak on config parsing
Fixes: Coverity CID 1040949
2013-11-11 20:12:30 +01:00
Holger Hans Peter Freyther 111614a994 ta: Create TimingAdvance class and make it belong to the BTS
This allows us to easily flush the state in case a PCU/BTS
connection is lost.
2013-10-30 21:24:10 +01:00
Holger Hans Peter Freyther b6acfdaa24 bts: Introduce a singleton for the BTS and use it in the code
Compared to the previous code there will be a branch to get the
global pointer so the code will be slightly slower than the previous
version but it allows us to start creating objects but still use
the code from C. It is best approach I have found so far.

One downside of C++ is that by default talloc will not be used
(unless we override the new operator to use talloc. Right now
we need to memset the C data structure by hand. The benefit of
enforcing a better structure should is more important though.
2013-10-30 21:20:45 +01:00
Holger Hans Peter Freyther 67ed34eedb bts: Move struct gprs_rlcmac_bts and other structs into a bts.h
Begin to make the BTS a real C++ object with real responsibilities.
The biggest issue will be the pcu_vty.c that might not like C++
at all.
2013-10-30 21:20:45 +01: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
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
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 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 e5a093986b pcu_main: Add '-V' to obtain the (compile) version of osmo-pcu 2013-01-17 12:28:16 +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 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 499ff415a9 Allow setting of seperate coding schemes for uplink and downlink 2012-10-03 14:21:36 +02:00
Andreas Eversberg aafcbbb252 Set Alpha and Gamma at assingment messages for power control
The initial power control value Alpha must be set in SI13.
2012-09-27 09:20:45 +02:00
Andreas Eversberg cd8a83a42c Statefull reset and unblock BVCs and sending flow control messages
The flow control interval can be set via VTY.
2012-09-23 06:41:21 +02:00
Andreas Eversberg 53f4725d10 Adding multislot allocation algorithm 2012-07-15 07:10:10 +02:00
Andreas Eversberg f298fa87b9 multislot: Extracted "slot allocation algorithm" from tbf allocator
The current available algorithm only supports selecting a single slot
for downlink/uplink. (In the future, a multislot algorithm will follow.)
2012-07-13 14:50:57 +02:00
Andreas Eversberg e266bd48ac Adding signal handler to allow clean exit of PCU
The signal handler will end the main loop, so clean exit is performed.

The allocated memory is dumped in order to detect memory leaks.

All talloc functions use tall_pcu_ctx context instead of NULL, to track
memory leaks.
2012-07-13 14:00:21 +02:00
Andreas Eversberg ebde64f258 logging: Add vty to allow definition/storage of debug levels
Note: This requires new libosomocore that allows to compile VTY headers
with C++.
2012-07-13 13:46:25 +02:00
Ivan Kluchnikov ef7f28cc7f Merge branch 'jolly_new'
Merge is based on jolly_new branch with two modifications.
1. Modified PCU L1 interface.
pcu_l1_if.cpp - common functions for tx and rx messages on L1 interface.
sysmo_sock.cpp - SYSMO-PCU socket functions.
openbts_sock.cpp - OpenBTS-PCU socket functions.
pcuif_proto.h - L1 interface's primitives.
2. Modified encoding of RLC/MAC Control messages, now we use structures and encode_gsm_rlcmac_downlink() function for encode control blocks (without  hand-coding).
2012-07-12 14:49:15 +04:00