path: root/include
diff options
authorVadim Yanitskiy <axilirator@gmail.com>2018-08-02 16:22:17 +0700
committerHarald Welte <laforge@gnumonks.org>2018-10-25 17:51:33 +0000
commitee9e8e9eb22257000765f4c6a5138fc0200e864f (patch)
treedd0ef859058c99b1a3fc03f6fb5d58cb185108b7 /include
parent34018dd4c9a192d7a9b8568ed41d4ed9a35bf0f2 (diff)
common/scheduler.c: track TDMA frame loss per logical channels
This change modifies the logic of TDMA frame loss tracking. To be more precise, the tracking logic was moved from per timeslot level to per logical channel level, what makes OsmoBTS more accurate in its measurements. But before getting into details, it's important to clarify some things about the Uplink burst processing in transceiver (OsmoTRX). If an Uplink burst is detected, OsmoTRX demodulates it and sends to OsmoBTS. If nothing is detected on a particular timeslot, OsmoTRX will do nothing. In other words, it will not notify OsmoBTS about this. Meanwhile, there are usually a few logical channels mapped to a single TDMA timeslot. Let's use SDCCH8 channel configuration as an example (simplified layout): /* SDCCH/8 (ss=0), subscriber A (active) */ { TRXC_SDCCH8_0, bid=0 }, { TRXC_SDCCH8_0, bid=1 }, { TRXC_SDCCH8_0, bid=2 }, { TRXC_SDCCH8_0, bid=3 }, // <-- last_fn=X /* SDCCH/8 (ss=1), subscriber B (inactive) */ { TRXC_SDCCH8_1, bid=0 }, { TRXC_SDCCH8_1, bid=1 }, { TRXC_SDCCH8_1, bid=2 }, { TRXC_SDCCH8_1, bid=3 }, /* SDCCH/8 (ss=2), subscriber C (active) */ { TRXC_SDCCH8_2, bid=0 }, // <-- current_fn=X+5 { TRXC_SDCCH8_2, bid=1 }, { TRXC_SDCCH8_2, bid=2 }, { TRXC_SDCCH8_2, bid=3 }, SDCCH8 has 8 sub-slots, so up to 8 subscribers can use a single timeslot. Let's imagine there are three subscribers: A, B, and C. Both A and C are active subscribers, i.e. they are continuously transmitting UL bursts, while B is not using ss=1 anymore. The original way of TDMA frame loss tracking was the following: - when an UL burst is received, store it's frame number in the timeslot state structure (last_fn); - when the next UL burst is received on same timeslot, compute how many frames elapsed since the last_fn; - if elapsed = (current_fn - last_fn) is lower than 10, then iterate from (last_fn + 1) until the current_fn and send dummy zero-filled bursts to the higher layers; - otherwise (elapsed > 10), process the current burst, and do nothing :/ According to our example, subscriber A is sending 4 bursts, then nobody is sending anything, and then subscriber C is sending 4 bursts. So, there is a 4 frames long gap between the both transmissions, which is being substituted by dummy bursts. But, as the logical channel on ss=1 is not active, they are dropped. This is not that scary, but the current algorithm produces lots of false-positives, and moreover is not able to track real frame drops in longer periods (i.e. >10). So, tracking the frame loss per individual logical channels makes much more sense. Let's finally drop this hackish 'while (42) { ... }', and track the amount of lost / received TDMA frames (bursts) individually per logical channels. Let's also use the multiframe period as the loss detection period, instead of hardcoded 10. And finally, let's print more informative debug messages. Also, it makes sense to use the amount of lost / received bursts during the calculation of the measurement reports, instead of sending dummy bursts, but let's do this separately. Change-Id: I70d05b67a35ddcbdd1b6394dbd7198404a440e76 Related: OS#3428
Diffstat (limited to 'include')
1 files changed, 3 insertions, 1 deletions
diff --git a/include/osmo-bts/scheduler.h b/include/osmo-bts/scheduler.h
index 32d6e917..f9d99629 100644
--- a/include/osmo-bts/scheduler.h
+++ b/include/osmo-bts/scheduler.h
@@ -80,6 +80,9 @@ struct l1sched_chan_state {
/* loss detection */
uint8_t lost_frames; /* how many L2 frames were lost */
+ uint32_t last_tdma_fn; /* last processed TDMA frame number */
+ uint32_t proc_tdma_fs; /* how many TDMA frames were processed */
+ uint32_t lost_tdma_fs; /* how many TDMA frames were lost */
/* mode */
uint8_t rsl_cmode, tch_mode; /* mode for TCH channels */
@@ -124,7 +127,6 @@ struct l1sched_chan_state {
struct l1sched_ts {
uint8_t mf_index; /* selected multiframe index */
- uint32_t mf_last_fn; /* last received frame number */
uint8_t mf_period; /* period of multiframe */
const struct trx_sched_frame *mf_frames; /* pointer to frame layout */