Commit Graph

28 Commits

Author SHA1 Message Date
Jacob Erlbeck 62e96a3535 vty: Add a file for C++ functions
Currently the pcu_vty.c doesn't compile with C++. Thus C++ object
cannot be access directly there.

This commit adds a helper C++ file that exports all functions with C
calling conventions and naming to work around that limitation until
the transition of pcu_vty.c is completed.

Sponsored-by: On-Waves ehf
2015-06-08 09:39:43 +02:00
Jacob Erlbeck a098c19b55 tbf: Set MS timeout
This commit sets the MS timeout when the MS object is created. The
value is taken from the ms_idle_sec field in gprs_rlcmac_bts which
can be changed by the VTY commands shown below.

The following VTY commands are added to the config-pcu node:

- ms-idle-time <1-7200>      Set the timeout in seconds
- no ms-idle-time            Disable the timeout

Another timer that is related is T3314 (Ready Timer, default 44s, GSM
24.008, 11.2.2) which requires the SGSN to use paging after its
expiry. Longer timeouts can help if adaptive coding scheme selection
is used (not yet implemented). On the other hand, measurement values
(TA, signal quality) can get invalid after some time, especially with
a moving MS. So a value slightly above T3314 is probably a good value
to start with.

Sponsored-by: On-Waves ehf
2015-05-28 17:40:15 +02:00
Jacob Erlbeck 0288cdb0a8 bssgp: Add VTY command to Limit the bucket size by time
Currently the bucket size is by default being computed based on the
leak rate and the expected life time of LLC frames. The latter is
either taken from 'queue lifetime' (if given) or a fixed value is
used. Using 'queue lifetime' has the drawback that it sets a 'hard'
limit, since frames will be dropped if they stay in the queue
for a longer time.

This commit adds a VTY command to specifically set the time used for
the computation of the bucket size advertised to the SGSN. It does
not affect the PCUs queue handling in any way. If the bucket time is
not set (or if the 'no' command has been used), the old behaviour
(see above) is applied.

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

- flow-control bucket-time <1-65534>  Sets the time in centisecs
- no flow-control bucket-time         Don't use this time

Ticket: OW#1432
Sponsored-by: On-Waves ehf
2015-05-06 15:22:33 +02:00
Jacob Erlbeck 87d7341fbe bssgp: Make BVC bucket size / leak rate configurable
Currently the FLOW-CONTROL_BVC message contains fixed values: The tag
is 1, the BVC bucket size is 6MB, the BVC bucket leak rate is
820kbit/s, the MS bucket size is 50kB, and the MS leak rate is
50kbit/s.

This commit makes the BVC parameters configurable and adds the
following VTY commands:

- flow-control force-bvc-bucket-size <1-6553500>
- no flow-control force-bvc-bucket-size
- flow-control force-bvc-leak-rate <1-6553500>
- no flow-control force-bvc-leak-rate
- flow-control force-ms-bucket-size <1-6553500>
- no flow-control force-ms-bucket-size
- flow-control force-ms-leak-rate <1-6553500>
- no flow-control force-ms-leak-rate

The 'no' variants restore the default behaviour.

Sponsored-by: On-Waves ehf
2015-05-06 15:20:35 +02:00
Jacob Erlbeck 2acfbebfd3 vty: Fix value range of commands accepting csecs
Currently an uint8_t csec variable is used to temporarily store
the number of centiseconds which can be set within the range
1 - 65535. This way values above 255 cannot be set properly. This
affects the VTY commands "queue lifetime", "queue hysteres", and
"queue idle-ack-delay".

This commit replaces the uint8_t by an uint16_t.

Sponsored-by: On-Waves ehf
2015-05-04 09:58:34 +02:00
Jacob Erlbeck c0c580c414 vty: Fix warnings about undeclared functions
This commit adds missing includes to pcu_vty.c and fixes the
llist_head type (missing struct keyword) used by tbf_print_vty_info.

Sponsored-by: On-Waves ehf
2015-05-04 09:58:34 +02:00
Jacob Erlbeck cc12f02658 vty: Use libosmocore VTY standards
This commit applies to following changes to pcu_vty.c:

- Use vty_install_default() instead of install_default()
- Add a blank after the '#' of the prompt
- Rename the 'pcu' configuration node to 'config-pcu'

Sponsored-by: On-Waves ehf
2015-04-09 17:05:19 +02:00
Jacob Erlbeck d0261b72de tbf: Force ACK after the last DL LCC frame has been received
If the protocol layers above LLC (e.g. TCP) need an acknowledgement
to continue, it can take up to 400ms (single TS) until the MS is
polled for Ack/Nack which it can use to request an uplink TBF
quickly. The 400ms result from requesting an DL Ack/Nack every 20 RLC
blocks until all pending LLC frames have been sent.

Especially TCP's slow start mechanism can lead to a high delay at the
start of the connection, since the sender will eventually stop after
having sent the first packets (up to 4 (RFC2581) or 10 (RFC6928)).

This commit modifies append_data() to (re-)start
a timer every time it handles an LLC packet and to request an
Ack/Nack every time it expires. So if the server ceases to send IP
packets, the MS is polled in the assumption, that the server is
waiting for an ACK.

The following VTY commands are added (pcu node):

 - queue idle-ack-delay <1-65535>  timeout in centiseconds
 - no queue idle-ack-delay         disable this feature (default)

A sensible value is 10 (100ms) that at gave promising results when
testing locally.

Sponsored-by: On-Waves ehf
2015-04-02 18:14:08 +02:00
Jacob Erlbeck 0c1c8778df tbf: Use a hysteresis when discarding DL LLC frames
Currently single LLC blocks are discarded when the PDU lifetime
expires. If an IP packet has been fragmented either on the IP or on
the LLC layer and is therefore distributed over several LLC frames,
the kept fragments are transmitted and then discarded by the MS
because of the missing PDU. This can cause massive IP packet loss
when there are many fragmented packets (e.g. when trying 'ping
-s1800' or if the GGSN chops downlink IP packets into several SNDCP
packets).

On the other hand, discarding too many packets might disturb the
congestion handling of TCP. Dropping plain TCP ACKs might also hinder
flow control and congestion avoidance.

This commit adds a hysteresis algorithm to the LLC discard loop. If
an LLC message's age reaches the high water mark, further message's
with an age above the low water mark are discarded, too. This is
aborted, if a GMM, a non-UI, or a small message is detected. In
these cases, that message is kept.

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

- queue hysteresis <1-65535>   set the difference between high
                               (lifetime) and low watermark in
                               centiseconds
- no queue hysteresis          disable this feature (default)

Since the SGSN will most probably send all fragments of a single
N-PDU without much delay between them, a value slightly above the
average transmission delay jitter between SGSN and PCU is probably a
sensible value to discard all fragments of a single IP packet.

This is an experimental feature that might be replaced by more
advanced means of active queue management in the future.

Sponsored-by: On-Waves ehf
2015-04-02 12:34:48 +02:00
Jacob Erlbeck 3bed5d11d2 tbf: Implement delayed release of a downlink TBF
Currently a DL TBF is immediately closed, when the LLC queue is
drained. This will lead to a new DL assignment if data is received
afterwards. In addition, it is not possible to keep the PACCH open
to poll the MS for UL establishment requests there.

GSM 44.060, 9.3.1a suggests to delay the release of an inactive TBF
for some time (max 5s).

This commit mainly changes create_new_bsn() to send LLC dummy
commands as filler if no LLC data is available until keep_open()
returns false. The keep_open() functions returns true unless a
configurable time has passed after the LLC data store drained. By
default, that time is not set which causes keep_open() to always
return false, so that delayed release is effectively disabled.

The following VTY commands are added:
  - dl-tbf-idle-time <1-5000>    to set the delay in ms
  - no dl-tbf-idle-time          to disable delayed release

Ticket: #556
Sponsored-by: On-Waves ehf
2015-03-25 12:32:35 +01:00
Holger Hans Peter Freyther 49f26bf6e8 Fix VTY documentation
Documentation error (missing docs):
<command id='show tbf all'>
        <param name='all' doc='(null)' />
2014-12-20 15:22:09 +01:00
Holger Hans Peter Freyther e8915b9d9d misc: Add missing include for the rate counter
pcu_vty.c:285:2: warning: implicit declaration of function 'vty_out_rate_ctr_group' is invalid in C99 [-Wimplicit-function-declaration]
        vty_out_rate_ctr_group(vty, "", bts_main_data_stats());
        ^
2014-07-02 14:57:47 +02:00
Holger Hans Peter Freyther 2c98f1db78 misc: Add missing include for atoi
pcu_vty.c:128:21: warning: implicit declaration of function 'atoi' is invalid in C99 [-Wimplicit-function-declaration]
        bts->fc_interval = atoi(argv[0]);
                           ^
2014-07-02 14:56:36 +02:00
Holger Hans Peter Freyther c421e8aaf2 misc: Add {} to avoid nested if/if/else ambigiouty
pcu_vty.c:89:3: warning: add explicit braces to avoid dangling else [-Wdangling-else]
                else
2014-07-02 14:55:17 +02:00
Daniel Willmann 772415fd8a pcu_vty: Add a command to print info about all TBFs 2014-01-15 17:41:45 +01:00
Holger Hans Peter Freyther 0e0f2f5faf pcu: Address the return without value
Fixes: Coverity CID 1040959
2013-11-11 20:10:04 +01:00
Holger Hans Peter Freyther f537298cca bts: Start creating statistics inside the BTS code 2013-10-30 21:24:12 +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
Harald Welte d1e340f0be VTY: complete the copyright message 2013-01-17 12:27:59 +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 07e97cf8a5 Adding single block allocation
It is mandatory to support it because MS may request a single block.
In this case the network must assign a single block.

It is possible to force single block allocation for all uplink requests
on RACH. (VTY option)
2012-08-07 16:00:56 +02:00
Andreas Eversberg a1503fa356 VTY: Select timeslot allocation algorithm via VTY
The selections are: single slot or multislot
2012-07-23 18:25:43 +02:00
Andreas Eversberg 24131bf55b Add check of lifetime of LLC frame
If lifetime expires of queued LLC frames, they are discarded. The number
of discarded frames and the sum of their octets are reported to SGSN
via LLC-DISCARDED message.

The lifetime can be overridden via VTY. The value can be centi-seconds
or "infinite".
2012-07-21 11:09:58 +02:00
Andreas Eversberg 8b761a3419 VTY: Added option to force given CS and ignore the scheme given by BTS 2012-07-20 21:50:31 +02:00
Andreas Eversberg 1294256d65 VTY implementation 2012-07-13 12:30:03 +02:00