aboutsummaryrefslogtreecommitdiffstats
path: root/src/gprs_ms.cpp
diff options
context:
space:
mode:
authorJacob Erlbeck <jerlbeck@sysmocom.de>2015-06-12 10:52:34 +0200
committerJacob Erlbeck <jerlbeck@sysmocom.de>2015-06-22 10:39:06 +0200
commit70b96aa232bd9784a94247bf7b193cb2147ada9d (patch)
treed5abe0611be1107b6cabe58d8ba7195f5acda6d3 /src/gprs_ms.cpp
parent07eb655244bd973a9bdf69ef958ee06cf867a0bb (diff)
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
Diffstat (limited to 'src/gprs_ms.cpp')
-rw-r--r--src/gprs_ms.cpp33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/gprs_ms.cpp b/src/gprs_ms.cpp
index b40e1eac..2cfedc3b 100644
--- a/src/gprs_ms.cpp
+++ b/src/gprs_ms.cpp
@@ -485,3 +485,36 @@ void GprsMs::update_l1_meas(const pcu_l1_meas *meas)
}
}
}
+
+uint8_t GprsMs::current_cs_dl() const
+{
+ uint8_t cs = m_current_cs_dl;
+ size_t unencoded_octets;
+
+ if (!m_bts)
+ return cs;
+
+ unencoded_octets = m_llc_queue.octets();
+
+ /* If the DL TBF is active, add number of unencoded chunk octets */
+ if (m_dl_tbf)
+ unencoded_octets = m_dl_tbf->m_llc.chunk_size();
+
+ /* There are many unencoded octets, don't reduce */
+ if (unencoded_octets >= m_bts->bts_data()->cs_downgrade_threshold)
+ return cs;
+
+ /* RF conditions are good, don't reduce */
+ if (m_nack_rate_dl < m_bts->bts_data()->cs_adj_lower_limit)
+ return cs;
+
+ /* The throughput would probably be better if the CS level was reduced */
+ cs -= 1;
+
+ /* CS-2 doesn't gain throughput with small packets, further reduce to CS-1 */
+ if (cs == 2)
+ cs -= 1;
+
+ return cs;
+}
+