aboutsummaryrefslogtreecommitdiffstats
path: root/src
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
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')
-rw-r--r--src/bts.h1
-rw-r--r--src/gprs_ms.cpp33
-rw-r--r--src/gprs_ms.h5
-rw-r--r--src/pcu_main.cpp1
-rw-r--r--src/pcu_vty.c34
5 files changed, 69 insertions, 5 deletions
diff --git a/src/bts.h b/src/bts.h
index 0c5b47a0..2ed50307 100644
--- a/src/bts.h
+++ b/src/bts.h
@@ -149,6 +149,7 @@ struct gprs_rlcmac_bts {
uint8_t cs_adj_upper_limit;
uint8_t cs_adj_lower_limit;
struct {int16_t low; int16_t high;} cs_lqual_ranges[4];
+ uint16_t cs_downgrade_threshold; /* downgrade if less packets left (DL) */
/* TBF handling, make private or move into TBFController */
/* list of uplink TBFs */
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;
+}
+
diff --git a/src/gprs_ms.h b/src/gprs_ms.h
index 05387239..3d0195ce 100644
--- a/src/gprs_ms.h
+++ b/src/gprs_ms.h
@@ -170,11 +170,6 @@ inline uint8_t GprsMs::ms_class() const
return m_ms_class;
}
-inline uint8_t GprsMs::current_cs_dl() const
-{
- return m_current_cs_dl;
-}
-
inline uint8_t GprsMs::current_cs_ul() const
{
return m_current_cs_ul;
diff --git a/src/pcu_main.cpp b/src/pcu_main.cpp
index 416e48f3..3efdd843 100644
--- a/src/pcu_main.cpp
+++ b/src/pcu_main.cpp
@@ -187,6 +187,7 @@ int main(int argc, char *argv[])
bts->cs_lqual_ranges[2].high = 13;
bts->cs_lqual_ranges[3].low = 12;
bts->cs_lqual_ranges[3].high = 256;
+ bts->cs_downgrade_threshold = 200;
msgb_set_talloc_ctx(tall_pcu_ctx);
diff --git a/src/pcu_vty.c b/src/pcu_vty.c
index 8db025e6..05c4b7a1 100644
--- a/src/pcu_vty.c
+++ b/src/pcu_vty.c
@@ -90,6 +90,12 @@ static int config_write_pcu(struct vty *vty)
else
vty_out(vty, " no cs threshold%s", VTY_NEWLINE);
+ if (bts->cs_downgrade_threshold)
+ vty_out(vty, " cs downgrade-threshold %d%s",
+ bts->cs_downgrade_threshold, VTY_NEWLINE);
+ else
+ vty_out(vty, " no cs downgrade-threshold%s", VTY_NEWLINE);
+
vty_out(vty, " cs link-quality-ranges cs1 %d cs2 %d %d cs3 %d %d cs4 %d%s",
bts->cs_lqual_ranges[0].high,
bts->cs_lqual_ranges[1].low,
@@ -609,6 +615,32 @@ DEFUN(cfg_pcu_no_cs_err_limits,
return CMD_SUCCESS;
}
+#define CS_DOWNGRADE_STR "set threshold for data size based CS downgrade\n"
+DEFUN(cfg_pcu_cs_downgrade_thrsh,
+ cfg_pcu_cs_downgrade_thrsh_cmd,
+ "cs downgrade-threshold <1-10000>",
+ CS_STR CS_DOWNGRADE_STR "downgrade if less octets left\n")
+{
+ struct gprs_rlcmac_bts *bts = bts_main_data();
+
+ bts->cs_downgrade_threshold = atoi(argv[0]);
+
+ return CMD_SUCCESS;
+}
+
+DEFUN(cfg_pcu_no_cs_downgrade_thrsh,
+ cfg_pcu_no_cs_downgrade_thrsh_cmd,
+ "no cs downgrade-threshold",
+ CS_STR CS_DOWNGRADE_STR)
+{
+ struct gprs_rlcmac_bts *bts = bts_main_data();
+
+ bts->cs_downgrade_threshold = 0;
+
+ return CMD_SUCCESS;
+}
+
+
DEFUN(cfg_pcu_cs_lqual_ranges,
cfg_pcu_cs_lqual_ranges_cmd,
"cs link-quality-ranges cs1 <0-35> cs2 <0-35> <0-35> cs3 <0-35> <0-35> cs4 <0-35>",
@@ -729,6 +761,8 @@ int pcu_vty_init(const struct log_info *cat)
install_element(PCU_NODE, &cfg_pcu_no_cs_max_cmd);
install_element(PCU_NODE, &cfg_pcu_cs_err_limits_cmd);
install_element(PCU_NODE, &cfg_pcu_no_cs_err_limits_cmd);
+ install_element(PCU_NODE, &cfg_pcu_cs_downgrade_thrsh_cmd);
+ install_element(PCU_NODE, &cfg_pcu_no_cs_downgrade_thrsh_cmd);
install_element(PCU_NODE, &cfg_pcu_cs_lqual_ranges_cmd);
install_element(PCU_NODE, &cfg_pcu_queue_lifetime_cmd);
install_element(PCU_NODE, &cfg_pcu_queue_lifetime_inf_cmd);