pespin has submitted this change. (
https://gerrit.osmocom.org/c/osmo-bsc/+/30347 )
Change subject: paging: Replace reqs waiting for retransmission with new
incoming inital req if queue is full
......................................................................
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
---
M src/osmo-bsc/net_init.c
M src/osmo-bsc/paging.c
M tests/timer.vty
3 files changed, 19 insertions(+), 11 deletions(-)
Approvals:
Jenkins Builder: Verified
daniel: Looks good to me, but someone else must approve
osmith: Looks good to me, but someone else must approve
laforge: Looks good to me, approved
diff --git a/src/osmo-bsc/net_init.c b/src/osmo-bsc/net_init.c
index 75dcbf3..ad2f8c4 100644
--- a/src/osmo-bsc/net_init.c
+++ b/src/osmo-bsc/net_init.c
@@ -77,8 +77,9 @@
{ .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 fda508e..657665c 100644
--- a/src/osmo-bsc/paging.c
+++ b/src/osmo-bsc/paging.c
@@ -509,13 +509,6 @@
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 @@
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 731d134..9573a09 100644
--- a/tests/timer.vty
+++ b/tests/timer.vty
@@ -35,7 +35,7 @@
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: 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)
--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/30347
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: Idfd93254ae456b1ee08416e05479488299dd063d
Gerrit-Change-Number: 30347
Gerrit-PatchSet: 7
Gerrit-Owner: pespin <[email protected]>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <[email protected]>
Gerrit-Reviewer: laforge <[email protected]>
Gerrit-Reviewer: osmith <[email protected]>
Gerrit-Reviewer: pespin <[email protected]>
Gerrit-CC: fixeria <[email protected]>
Gerrit-CC: neels <[email protected]>
Gerrit-MessageType: merged