aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2022-11-29 11:51:41 +0100
committerPau Espin Pedrol <pespin@sysmocom.de>2022-11-30 20:23:34 +0100
commitd681b897b60f5ff91ac339edb3e449877a649ae8 (patch)
tree7a7b9e7b3db102807367af61a23ad063cd104ccf
parent3b5e8982715f110b92d9249f3db612e4515ad82c (diff)
paging: Replace reqs waiting for retransmission with new incoming inital req if queue is full
If queue size (in transmit delay of requests) is too long (above threshold) when a new initial incoming request arrives, instead of directly discarding it, see if we can drop a pending retransmission and insert the new one instead, in order to avoid losing initial requests. This is done under the assumption that it is more important to transmit intial requests than to retransmit already transmitted ones. The rationale is that there's lower chances that an MS which didn't answer lately will answer now (aka being reachable at the cell), so it's better to allocate resources for new requests (new MS) which may be available in the cell. Change-Id: Idfd93254ae456b1ee08416e05479488299dd063d Related: OS#5552
-rw-r--r--src/osmo-bsc/net_init.c5
-rw-r--r--src/osmo-bsc/paging.c21
-rw-r--r--tests/timer.vty4
3 files changed, 19 insertions, 11 deletions
diff --git a/src/osmo-bsc/net_init.c b/src/osmo-bsc/net_init.c
index 75dcbf323..ad2f8c412 100644
--- a/src/osmo-bsc/net_init.c
+++ b/src/osmo-bsc/net_init.c
@@ -77,8 +77,9 @@ static struct osmo_tdef gsm_network_T_defs[] = {
{ .T = -3111, .default_val = 4, .desc = "Wait time after lchan was released in error (should be T3111 + 2s)" },
{ .T = -3113, .default_val = PAGING_THRESHOLD_X3113_DEFAULT_SEC,
.desc = "Maximum Paging Request Transmit Delay Threshold: " \
- "If the estimated transmit delay of the messages of the paging queue surpasses this threshold, new incoming "
- "paging requests are discarded, hence limiting the size of the queue and maximum delay of its scheduled requests. "
+ "If the estimated transmit delay of the messages in the paging queue surpasses this threshold, then new incoming "
+ "paging requests will if possible replace a request in retransmission state from the queue or otherwise be discarded, "
+ "hence limiting the size of the queue and maximum delay of its scheduled requests. "
"X3113 also serves as the upper boundary for dynamic T3113 when estimating the expected maximum delay to get a response" },
{ .T = -3210, .default_val = 20, .desc = "After L3 Complete, wait for MSC to confirm" },
{}
diff --git a/src/osmo-bsc/paging.c b/src/osmo-bsc/paging.c
index fda508ed2..657665c14 100644
--- a/src/osmo-bsc/paging.c
+++ b/src/osmo-bsc/paging.c
@@ -509,13 +509,6 @@ static int _paging_request(const struct bsc_paging_params *params, struct gsm_bt
rate_ctr_inc(rate_ctr_group_get_ctr(bts->bts_ctrs, BTS_CTR_PAGING_ATTEMPTED));
- /* Don't try to queue more requests than we can realistically handle within X3113 seconds,
- * see PAGING_THRESHOLD_X3113_DEFAULT_SEC. */
- if (paging_pending_requests_nr(bts) > paging_estimate_available_slots(bts, x3113_s)) {
- rate_ctr_inc(rate_ctr_group_get_ctr(bts->bts_ctrs, BTS_CTR_PAGING_OVERLOAD));
- return -ENOSPC;
- }
-
/* Find if we already have one for the given subscriber on this BTS: */
if (bsc_subscr_find_req_by_bts(params->bsub, bts)) {
LOG_PAGING_BTS(params, bts, DPAG, LOGL_INFO, "Paging request already pending for this subscriber\n");
@@ -523,6 +516,20 @@ static int _paging_request(const struct bsc_paging_params *params, struct gsm_bt
return -EEXIST;
}
+ /* Don't try to queue more requests than we can realistically handle within X3113 seconds,
+ * see PAGING_THRESHOLD_X3113_DEFAULT_SEC. */
+ if (paging_pending_requests_nr(bts) > paging_estimate_available_slots(bts, x3113_s)) {
+ struct gsm_paging_request *first_retrans_req;
+ rate_ctr_inc(rate_ctr_group_get_ctr(bts->bts_ctrs, BTS_CTR_PAGING_OVERLOAD));
+ /* Need to drop a retrans from the queue if possible, in order to make space for the new initial req. */
+ if (bts_entry->retrans_req_list_len == 0) {
+ /* There are no retrans to be replaced by this initial request, discard it. */
+ return -ENOSPC;
+ }
+ first_retrans_req = llist_first_entry(&bts_entry->retrans_req_list, struct gsm_paging_request, entry);
+ paging_remove_request(first_retrans_req);
+ }
+
/* The incoming new req will be stored in initial_req_list giving higher prio
* to it over retransmissions. This avoids new subscribers being paged to
* be delayed if the paging queue is full due to a lot of retranmissions.
diff --git a/tests/timer.vty b/tests/timer.vty
index 731d134b2..9573a0922 100644
--- a/tests/timer.vty
+++ b/tests/timer.vty
@@ -35,7 +35,7 @@ net: X17 = 0 ms Rounding threshold for all_allocated:* rate counters: round up t
net: X18 = 60000 ms Forget-sum period for all_allocated:* rate counters: after this amount of idle time, forget internally cumulated time remainders. Zero to always keep remainders. See also X16, X17. (default: 60000 ms)
net: X25 = 5 s Timeout for initial user data after an MSC initiated an SCCP connection to the BSS (default: 5 s)
net: X3111 = 4 s Wait time after lchan was released in error (should be T3111 + 2s) (default: 4 s)
-net: X3113 = 60 s Maximum Paging Request Transmit Delay Threshold: If the estimated transmit delay of the messages of the paging queue surpasses this threshold, new incoming paging requests are discarded, hence limiting the size of the queue and maximum delay of its scheduled requests. X3113 also serves as the upper boundary for dynamic T3113 when estimating the expected maximum delay to get a response (default: 60 s)
+net: X3113 = 60 s Maximum Paging Request Transmit Delay Threshold: If the estimated transmit delay of the messages in the paging queue surpasses this threshold, then new incoming paging requests will if possible replace a request in retransmission state from the queue or otherwise be discarded, hence limiting the size of the queue and maximum delay of its scheduled requests. X3113 also serves as the upper boundary for dynamic T3113 when estimating the expected maximum delay to get a response (default: 60 s)
net: X3210 = 20 s After L3 Complete, wait for MSC to confirm (default: 20 s)
mgw: X2427 = 5 s timeout for MGCP response from MGW (default: 5 s)
@@ -90,7 +90,7 @@ net: X17 = 0 ms Rounding threshold for all_allocated:* rate counters: round up t
net: X18 = 60000 ms Forget-sum period for all_allocated:* rate counters: after this amount of idle time, forget internally cumulated time remainders. Zero to always keep remainders. See also X16, X17. (default: 60000 ms)
net: X25 = 5 s Timeout for initial user data after an MSC initiated an SCCP connection to the BSS (default: 5 s)
net: X3111 = 4 s Wait time after lchan was released in error (should be T3111 + 2s) (default: 4 s)
-net: X3113 = 60 s Maximum Paging Request Transmit Delay Threshold: If the estimated transmit delay of the messages of the paging queue surpasses this threshold, new incoming paging requests are discarded, hence limiting the size of the queue and maximum delay of its scheduled requests. X3113 also serves as the upper boundary for dynamic T3113 when estimating the expected maximum delay to get a response (default: 60 s)
+net: X3113 = 60 s Maximum Paging Request Transmit Delay Threshold: If the estimated transmit delay of the messages in the paging queue surpasses this threshold, then new incoming paging requests will if possible replace a request in retransmission state from the queue or otherwise be discarded, hence limiting the size of the queue and maximum delay of its scheduled requests. X3113 also serves as the upper boundary for dynamic T3113 when estimating the expected maximum delay to get a response (default: 60 s)
net: X3210 = 20 s After L3 Complete, wait for MSC to confirm (default: 20 s)
mgw: X2427 = 5 s timeout for MGCP response from MGW (default: 5 s)