aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/osmocom/bsc/handover_cfg.h7
-rw-r--r--src/osmo-bsc/handover_decision_2.c13
-rw-r--r--tests/handover/test_rxqual.ho_vty22
-rw-r--r--tests/handover_cfg.vty3
4 files changed, 44 insertions, 1 deletions
diff --git a/include/osmocom/bsc/handover_cfg.h b/include/osmocom/bsc/handover_cfg.h
index 2bd26812e..7d68e6317 100644
--- a/include/osmocom/bsc/handover_cfg.h
+++ b/include/osmocom/bsc/handover_cfg.h
@@ -268,6 +268,13 @@ static inline int bool2i(bool arg)
"Time to suspend re-assignment after an lchan was re-assigned because of low RxQual\n" \
"Seconds\n") \
\
+ HO_CFG_ONE_MEMBER(int, hodec2_penalty_low_rxqual_ho, 60, \
+ "handover2 ", "penalty-time low-rxqual-ho", "<0-99999>", atoi, "%d", as_is, \
+ HO_CFG_STR_HANDOVER2 \
+ HO_CFG_STR_PENALTY_TIME \
+ "Time to suspend handover back to a cell after bad RxQual caused handover away from it\n" \
+ "Seconds\n") \
+ \
HO_CFG_ONE_MEMBER(int, hodec2_retries, 0, \
"handover2 ", "retries", "<0-9>", atoi, "%d", as_is, \
HO_CFG_STR_HANDOVER2 \
diff --git a/src/osmo-bsc/handover_decision_2.c b/src/osmo-bsc/handover_decision_2.c
index 14bc2d4b0..8627910e8 100644
--- a/src/osmo-bsc/handover_decision_2.c
+++ b/src/osmo-bsc/handover_decision_2.c
@@ -914,6 +914,19 @@ static int trigger_local_ho_or_as(struct ho_candidate *c, uint8_t requirements)
full_rate ? "TCH/F" : "TCH/H",
ho_reason_name(global_ho_reason));
handover_request(&req);
+
+ /* Apply penalty timer hodec2_penalty_low_rxqual_ho */
+ if (global_ho_reason == HO_REASON_INTERFERENCE
+ || global_ho_reason == HO_REASON_BAD_QUALITY) {
+ struct gsm0808_cell_id bts_id;
+ struct gsm_subscriber_connection *conn = c->current.lchan->conn;
+ int timeout = ho_get_hodec2_penalty_low_rxqual_ho(c->current.bts->ho);
+ gsm_bts_cell_id(&bts_id, c->current.bts);
+ LOGPHOCAND(c, LOGL_DEBUG, "Applying penalty-time low-rxqual-ho %d s on bts %u (%s), reason: %s\n",
+ timeout, c->current.bts->nr, gsm0808_cell_id_name_c(OTC_SELECT, &bts_id),
+ ho_reason_name(global_ho_reason));
+ penalty_timers_add(conn, &conn->hodec2.penalty_timers, &bts_id, timeout);
+ }
}
return 0;
}
diff --git a/tests/handover/test_rxqual.ho_vty b/tests/handover/test_rxqual.ho_vty
index f64de525d..6f86cf47f 100644
--- a/tests/handover/test_rxqual.ho_vty
+++ b/tests/handover/test_rxqual.ho_vty
@@ -10,6 +10,10 @@
# See Performance Enhancements in a Frequency Hopping GSM Network (Nielsen Wigard 2002), Chapter
# 2.1.1, "Interference" in the list of triggers on p.157.
+# first show undesired oscillation when penalty-time low-rxqual-ho is disabled
+network
+ handover2 penalty-time low-rxqual-ho 0
+
create-n-bts 2
set-ts-use trx 0 0 states * TCH/F - - - - - -
meas-rep repeat 9 lchan 0 0 1 0 rxlev 40 rxqual 6 ta 0 neighbors 30
@@ -20,10 +24,26 @@ expect-ts-use trx 0 0 states * - - - - - - -
expect-ts-use trx 1 0 states * TCH/F - - - - - -
# Now the channel is on bts 1, which has lower rxlev than bts 0.
-# The result is an undesired ho oscillation
+# The result is an undesired ho oscillation, because the penalty timer is zero
meas-rep lchan 1 0 1 0 rxlev 30 rxqual 0 ta 0 neighbors 40
expect-ho from lchan 1 0 1 0 to lchan 0 0 1 0
+
+# Set a proper penalty timeout and report bad-rxqual again
+network
+ handover2 penalty-time low-rxqual-ho 10
meas-rep repeat 10 lchan 0 0 1 0 rxlev 40 rxqual 6 ta 0 neighbors 30
expect-ho from lchan 0 0 1 0 to lchan 1 0 1 0
+
+# This time the penalty timer prevents oscillation
+meas-rep repeat 10 lchan 1 0 1 0 rxlev 30 rxqual 0 ta 0 neighbors 40
+expect-no-chan
+
+# After the penalty timeout passes, we do go back to the cell with stronger rxlev
+wait 10
meas-rep lchan 1 0 1 0 rxlev 30 rxqual 0 ta 0 neighbors 40
expect-ho from lchan 1 0 1 0 to lchan 0 0 1 0
+# If the rxqual is still bad here after the penalty timeout, well, then we quickly snap back to the weaker cell, once
+meas-rep repeat 10 lchan 0 0 1 0 rxlev 40 rxqual 6 ta 0 neighbors 30
+expect-ho from lchan 0 0 1 0 to lchan 1 0 1 0
+meas-rep repeat 10 lchan 1 0 1 0 rxlev 30 rxqual 0 ta 0 neighbors 40
+expect-no-chan
diff --git a/tests/handover_cfg.vty b/tests/handover_cfg.vty
index eb3ec3ed7..fb3c73c49 100644
--- a/tests/handover_cfg.vty
+++ b/tests/handover_cfg.vty
@@ -190,6 +190,7 @@ OsmoBSC(config-net)# list
handover2 penalty-time failed-ho (<0-99999>|default)
handover2 penalty-time failed-assignment (<0-99999>|default)
handover2 penalty-time low-rxqual-assignment (<0-99999>|default)
+ handover2 penalty-time low-rxqual-ho (<0-99999>|default)
handover2 retries (<0-9>|default)
handover2 congestion-check (disabled|<1-999>|now)
...
@@ -389,6 +390,7 @@ OsmoBSC(config-net)# handover2 penalty-time ?
failed-ho Time to suspend handover for a subscriber after a failed handover into this cell; see also 'handover2 retries'
failed-assignment Time to suspend handover for a subscriber after a failed re-assignment within this cell; see also 'handover2 retries'
low-rxqual-assignment Time to suspend re-assignment after an lchan was re-assigned because of low RxQual
+ low-rxqual-ho Time to suspend handover back to a cell after bad RxQual caused handover away from it
OsmoBSC(config-net)# handover2 penalty-time max-distance ?
<0-99999> Seconds
@@ -613,6 +615,7 @@ OsmoBSC(config-net-bts)# handover2 penalty-time ?
failed-ho Time to suspend handover for a subscriber after a failed handover into this cell; see also 'handover2 retries'
failed-assignment Time to suspend handover for a subscriber after a failed re-assignment within this cell; see also 'handover2 retries'
low-rxqual-assignment Time to suspend re-assignment after an lchan was re-assigned because of low RxQual
+ low-rxqual-ho Time to suspend handover back to a cell after bad RxQual caused handover away from it
OsmoBSC(config-net-bts)# handover2 penalty-time max-distance ?
<0-99999> Seconds