laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/27966 )
Change subject: CBSP: tr_CBSP_REPLACE_CBS_COMPL: num_compl_list is optional
......................................................................
CBSP: tr_CBSP_REPLACE_CBS_COMPL: num_compl_list is optional
The list might be empty because either there were no broadcasts
completed in case of a CBS message, or because it was an emergency
message where this IE is never used.
Change-Id: I2b24ac7e5857bdd50a821399b3c383cea9d408ad
---
M library/CBSP_Templates.ttcn
1 file changed, 10 insertions(+), 2 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/66/27966/1
diff --git a/library/CBSP_Templates.ttcn b/library/CBSP_Templates.ttcn
index f86241e..17d933a 100644
--- a/library/CBSP_Templates.ttcn
+++ b/library/CBSP_Templates.ttcn
@@ -408,9 +408,17 @@
var template CBSP_IEs ies := {
tr_CbspMsgId(msg_id),
tr_NewSerNo(new_ser_nr),
- tr_OldSerNo(old_ser_nr),
- tr_CbspNumComplList(compl_list)
+ tr_OldSerNo(old_ser_nr)
};
+ if (istemplatekind(compl_list, "*")) {
+ testcase.stop("TITAN > 6.5.0 doesn't support this");
+ //ies[lengthof(ies)] := tr_CbspNumComplList ifpresent;
+ } else if (istemplatekind(compl_list, "?")) {
+ ies[lengthof(ies)] := tr_CbspNumComplList(?);
+ } else if (not istemplatekind(compl_list, "omit")) {
+ ies[lengthof(ies)] := tr_CbspNumComplList(compl_list);
+ }
+
if (istemplatekind(cell_list, "*")) {
testcase.stop("TITAN > 6.5.0 doesn't support this");
//ies[lengthof(ies)] := tr_CbspCellList ifpresent;
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/27966
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I2b24ac7e5857bdd50a821399b3c383cea9d408ad
Gerrit-Change-Number: 27966
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-MessageType: newchange
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bsc/+/27965 )
Change subject: paging: Increase T3113 based on paging group load in BSC queue
......................................................................
paging: Increase T3113 based on paging group load in BSC queue
Related: OS#5536
Change-Id: I904c008222ddc3d92843d87fb3182c30b484c8a2
---
M include/osmocom/bsc/paging.h
M src/osmo-bsc/paging.c
2 files changed, 37 insertions(+), 5 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/65/27965/1
diff --git a/include/osmocom/bsc/paging.h b/include/osmocom/bsc/paging.h
index 8d5c9ac..9b63225 100644
--- a/include/osmocom/bsc/paging.h
+++ b/include/osmocom/bsc/paging.h
@@ -76,6 +76,8 @@
struct gsm_bts *bts;
/* what kind of channel type do we ask the MS to establish */
int chan_type;
+ /* paging group of the subscriber: */
+ uint8_t pgroup;
/* Timer 3113: how long do we try to page? */
struct osmo_timer_list T3113;
diff --git a/src/osmo-bsc/paging.c b/src/osmo-bsc/paging.c
index 993e5df..f2bcf96 100644
--- a/src/osmo-bsc/paging.c
+++ b/src/osmo-bsc/paging.c
@@ -330,7 +330,9 @@
}
#define GSM51_MFRAME_DURATION_us (51 * GSM_TDMA_FN_DURATION_uS) /* 235365 us */
-static unsigned int calculate_timer_3113(struct gsm_paging_request *req)
+static unsigned int paging_estimate_delay_us(struct gsm_bts *bts, unsigned int num_reqs);
+
+static unsigned int calculate_timer_3113(struct gsm_paging_request *req, unsigned int reqs_before)
{
unsigned int to_us, to;
struct gsm_bts *bts = req->bts;
@@ -345,8 +347,6 @@
if (!bts->T3113_dynamic)
return d->val;
- /* TODO: take into account load of paging group for req->bsub */
-
/* MFRMS defines repeat interval of paging messages for MSs that belong
* to same paging group across multiple 51 frame multiframes.
* MAXTRANS defines maximum number of RACH retransmissions, spread over
@@ -358,6 +358,9 @@
to_us = GSM51_MFRAME_DURATION_us * bs_pa_mfrms +
GSM_TDMA_FN_DURATION_uS * rach_tx_integer * rach_max_trans;
+ /* Now add some extra time based on how many requests need to be transmitted before this one: */
+ to_us += paging_estimate_delay_us(bts, reqs_before);
+
/* ceiling in seconds + extra time */
to = (to_us + 999999) / 1000000 + d->val;
LOG_PAGING_BTS(req, bts, DPAG, LOGL_DEBUG, "Paging request: T3113 expires in %u seconds\n", to);
@@ -375,6 +378,9 @@
struct gsm_bts_paging_state *bts_entry = &bts->paging;
struct gsm_paging_request *req, *last_initial_req = NULL;
unsigned int t3113_timeout_s;
+ unsigned int reqs_before_same_pgroup = 0;
+ uint8_t pgroup = gsm0502_calc_paging_group(&bts->si_common.chan_desc,
+ str_to_imsi(params->bsub->imsi));
rate_ctr_inc(rate_ctr_group_get_ctr(bts->bts_ctrs, BTS_CTR_PAGING_ATTEMPTED));
@@ -392,8 +398,15 @@
rate_ctr_inc(rate_ctr_group_get_ctr(bts->bts_ctrs, BTS_CTR_PAGING_ALREADY));
return -EEXIST;
}
- if (req->attempts == 0)
+ if (req->attempts == 0) {
last_initial_req = req;
+ if (req->pgroup == pgroup)
+ reqs_before_same_pgroup++;
+ } else if (last_initial_req == NULL) {
+ /* If no req with attempts=0 was found, we'll append to end of list, so keep counting. */
+ if (req->pgroup == pgroup)
+ reqs_before_same_pgroup++;
+ }
}
LOG_PAGING_BTS(params, bts, DPAG, LOGL_DEBUG, "Start paging\n");
@@ -405,6 +418,7 @@
bsc_subscr_get(req->bsub, BSUB_USE_PAGING_REQUEST);
req->bts = bts;
req->chan_type = params->chan_needed;
+ req->pgroup = pgroup;
req->msc = params->msc;
osmo_timer_setup(&req->T3113, paging_T3113_expired, req);
@@ -414,7 +428,7 @@
else/* Add in the middle of the list after last_initial_req */
__llist_add(&req->entry, &last_initial_req->entry, last_initial_req->entry.next);
- t3113_timeout_s = calculate_timer_3113(req);
+ t3113_timeout_s = calculate_timer_3113(req, reqs_before_same_pgroup);
osmo_timer_schedule(&req->T3113, t3113_timeout_s, 0);
paging_schedule_if_needed(bts_entry);
@@ -598,3 +612,19 @@
available_slots, time_span_s);
return available_slots;
}
+
+/*! Conservative estimate of time needed by BTS to schedule a number of paging
+ * requests (num_reqs), based on current load at the BSC queue (doesn't take into
+ * account BTs own buffer) */
+static unsigned int paging_estimate_delay_us(struct gsm_bts *bts, unsigned int num_reqs)
+{
+ unsigned int n_pag_blocks = gsm0502_get_n_pag_blocks(&bts->si_common.chan_desc);
+ unsigned int n_mframes = (num_reqs + (n_pag_blocks - 1)) / n_pag_blocks;
+ unsigned int time_us = n_mframes * GSM51_MFRAME_DURATION_us;
+ /* the multiframes are not consecutive for a paging group, let's add the spacing between: */
+ if (n_mframes > 1) {
+ unsigned int bs_pa_mfrms = (bts->si_common.chan_desc.bs_pa_mfrms + 2);
+ time_us += (n_mframes - 1) * bs_pa_mfrms * GSM51_MFRAME_DURATION_us;
+ }
+ return time_us;
+}
--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/27965
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I904c008222ddc3d92843d87fb3182c30b484c8a2
Gerrit-Change-Number: 27965
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: newchange
Attention is currently required from: laforge.
Hello Jenkins Builder,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/osmo-bsc/+/27936
to look at the new patch set (#3).
Change subject: paging: Rework timer lifecycle logic
......................................................................
paging: Rework timer lifecycle logic
Decouple credit_timer from event "available_slots became 0".
Let's actually relate credit_timer to the fact of not receiving CCCH
Load Indication: If no CCCH Load Indication is received (cch_load_ind_period * 2),
then assume we are below CCH Load Indication threshold (10% load) and
start estimating the available_slots in a cch_load_ind_period*2 time
frame.
Moreover, in paging_schedule_if_needed(), there's no use in delaying
start of processing work if the work_timer is not already doing work.
Related: OS#5537
Change-Id: I6a0da03c408270044079e81d431f6641527c00cd
---
M src/osmo-bsc/paging.c
1 file changed, 14 insertions(+), 20 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/36/27936/3
--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/27936
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I6a0da03c408270044079e81d431f6641527c00cd
Gerrit-Change-Number: 27936
Gerrit-PatchSet: 3
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: laforge <laforge(a)osmocom.org>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-MessageType: newpatchset
laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bsc/+/27961 )
Change subject: smscb: Always start ETWS timer even in cells without ETWS support
......................................................................
smscb: Always start ETWS timer even in cells without ETWS support
ETWS is sent over both dedicated channels and broadcast channels.
Some BTS models may not support the latter, but it is still useful
to start the related timer to ensure bts->etws.active gets set to
false after the emergency period has concluded.
Change-Id: I448be9fd75b87c1f7333a5bfa4f6ba238569fdc3
---
M src/osmo-bsc/smscb.c
1 file changed, 8 insertions(+), 6 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/61/27961/1
diff --git a/src/osmo-bsc/smscb.c b/src/osmo-bsc/smscb.c
index a11ca0f..8d92b5e 100644
--- a/src/osmo-bsc/smscb.c
+++ b/src/osmo-bsc/smscb.c
@@ -538,14 +538,16 @@
if (osmo_bts_has_feature(&bts->features, BTS_FEAT_ETWS_PN)) {
rsl_etws_pn_command(bts, RSL_CHAN_PCH_AGCH, bes->primary, sizeof(bes->primary));
LOG_BTS(bts, DCBS, LOGL_NOTICE, "Sent ETWS Primary Notification via common channel\n");
- if (wrepl->u.emergency.warning_period != 0xffffffff) {
- osmo_timer_setup(&bts->etws.timer, etws_pn_cb, bts);
- osmo_timer_schedule(&bts->etws.timer, wrepl->u.emergency.warning_period, 0);
- } else
- LOG_BTS(bts, DCBS, LOGL_NOTICE, "Unlimited ETWS PN broadcast, this breaks "
- "normal network operation due to PCH blockage\n");
} else
LOG_BTS(bts, DCBS, LOGL_ERROR, "BTS doesn't support RSL command for ETWS PN\n");
+
+ /* start the expiration timer, if any */
+ if (wrepl->u.emergency.warning_period != 0xffffffff) {
+ osmo_timer_setup(&bts->etws.timer, etws_pn_cb, bts);
+ osmo_timer_schedule(&bts->etws.timer, wrepl->u.emergency.warning_period, 0);
+ } else
+ LOG_BTS(bts, DCBS, LOGL_NOTICE, "Unlimited ETWS PN broadcast, this breaks "
+ "normal network operation due to PCH blockage\n");
}
/*! Try to execute a write-replace operation; roll-back if it fails.
--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/27961
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I448be9fd75b87c1f7333a5bfa4f6ba238569fdc3
Gerrit-Change-Number: 27961
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-MessageType: newchange
laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bsc/+/27963 )
Change subject: cbsp: Reject CBSP WRITE for emergency if emergency already active
......................................................................
cbsp: Reject CBSP WRITE for emergency if emergency already active
From 3GPP TS 48.018:
If only the New Serial Number IE, and not the Old Serial Number IE, is
included in the WRITE-REPLACE message,then the BSC shall interpret the
message as a write request, i.e. a broadcast request of a new emergency
message without replacing an ongoing emergency message broadcast.
Only one emergency message at the time can be broadcasted in a cell. If
a write request is received for a cell where an emergency message
broadcast is currently ongoing, the write request is considered as
failed.
Change-Id: I376c9e796f3a2d26b22d0451f15ef1debbd7f656
Closes: OS#5539
Related: SYS#5906
---
M src/osmo-bsc/smscb.c
1 file changed, 28 insertions(+), 3 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/63/27963/1
diff --git a/src/osmo-bsc/smscb.c b/src/osmo-bsc/smscb.c
index 873d665..2b37df9 100644
--- a/src/osmo-bsc/smscb.c
+++ b/src/osmo-bsc/smscb.c
@@ -494,13 +494,37 @@
etws_pn_stop(bts, true);
}
-static void etws_primary_to_bts(struct gsm_bts *bts, const struct osmo_cbsp_write_replace *wrepl)
+static int etws_primary_to_bts(struct gsm_bts *bts, const struct osmo_cbsp_write_replace *wrepl)
{
struct bts_etws_state *bes = &bts->etws;
struct gsm_bts_trx *trx;
unsigned int count = 0;
int i, j;
+ if (bes->active) {
+ /* we were already broadcasting emergency before receiving this WRITE-REPLACE */
+
+ /* If only the New Serial Number IE, and not the Old Serial Number IE, is included in the
+ * WRITE-REPLACE message, then the BSC shall interpret the message as a write request, i.e. a
+ * broadcast request of a new emergency message without replacing an ongoing emergency message
+ * broadcast. */
+ if (!wrepl->old_serial_nr) {
+ /* If a write request is received for a cell where an emergency message broadcast is
+ * currently ongoing, the write request is considered as failed */
+ LOG_BTS(bts, DCBS, LOGL_NOTICE, "Rx CBSP WRITE rejected due to ongoing emergency "
+ "while no Old Serial Nr IE present in CBSP WRITE\n");
+ return -CBSP_CAUSE_BSC_CAPACITY_EXCEEDED;
+ }
+
+ if (!etws_msg_id_matches(*wrepl->old_serial_nr, bes->input.serial_nr)) {
+ LOG_BTS(bts, DCBS, LOGL_NOTICE, "Rx CBSP WRITE-REPLACE old_serial 0x%04x doesn't match "
+ "current serial 0x%04x. Is the CBC confused?\n",
+ *wrepl->old_serial_nr, bes->input.serial_nr);
+ /* we allow the WRITE-REPLACE to continue, TS 48.049 doesn't specify how to
+ * handle situations like this */
+ }
+ }
+
if (bes->input.sec_info) {
talloc_free(bes->input.sec_info);
bes->input.sec_info = NULL;
@@ -554,6 +578,8 @@
} else
LOG_BTS(bts, DCBS, LOGL_NOTICE, "Unlimited ETWS PN broadcast, this breaks "
"normal network operation due to PCH blockage\n");
+
+ return 0;
}
/*! Try to execute a write-replace operation; roll-back if it fails.
@@ -625,8 +651,7 @@
int rc;
if (!wrepl->is_cbs) {
- etws_primary_to_bts(bts, wrepl);
- return 0;
+ return etws_primary_to_bts(bts, wrepl);
}
/* check if cell has a CBCH at all */
--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/27963
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I376c9e796f3a2d26b22d0451f15ef1debbd7f656
Gerrit-Change-Number: 27963
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-MessageType: newchange
laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bsc/+/27959 )
Change subject: smscb: Don't include extraneous IEs in CBSP KILL COMPLETE / FAILURE
......................................................................
smscb: Don't include extraneous IEs in CBSP KILL COMPLETE / FAILURE
TS 48.049 states the following rules for the KILL COMPLETE / FAILURE
mesages:
The Number of Broadcasts Completed List IE, if present, contains for
each cell the total number of broadcasts of the killed CBS message.
The Cell List IE, if present, contains the cells in which the emergency
message is successfully terminated.
As any message can only be either emergency or CBS, this means that
we can (at maximum) have only one of those two IEs in the message.
As there is no explicit indication in the KILL whether it relates
to CBS or Emergency, we use the "Channel Indicator" IE, which is
specified as "only included if the message refers to a CBS message".
Related: SYS#5906
Closes: OS#5541
Change-Id: I9a43d386da01f085663d231a555b8b5acc99faca
---
M src/osmo-bsc/smscb.c
1 file changed, 20 insertions(+), 10 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/59/27959/1
diff --git a/src/osmo-bsc/smscb.c b/src/osmo-bsc/smscb.c
index 5fe6345..c89bedb 100644
--- a/src/osmo-bsc/smscb.c
+++ b/src/osmo-bsc/smscb.c
@@ -791,11 +791,16 @@
fail->channel_ind = kill->channel_ind;
llist_replace_head(&fail->fail_list, &r_state->fail);
- fail->cell_list.id_discr = r_state->success.id_discr;
- llist_replace_head(&fail->cell_list.list, &r_state->success.list);
-
- fail->num_compl_list.id_discr = r_state->num_completed.id_discr;
- llist_replace_head(&fail->num_compl_list.list, &r_state->num_completed.list);
+ /* if the KILL relates to CBS, the "Channel Indicator" IE is present */
+ if (kill->channel_ind) {
+ /* only if it was CBS */
+ fail->num_compl_list.id_discr = r_state->num_completed.id_discr;
+ llist_replace_head(&fail->num_compl_list.list, &r_state->num_completed.list);
+ } else {
+ /* only if it was emergency */
+ fail->cell_list.id_discr = r_state->success.id_discr;
+ llist_replace_head(&fail->cell_list.list, &r_state->success.list);
+ }
} else {
resp = osmo_cbsp_decoded_alloc(cbc, CBSP_MSGT_KILL_COMPL);
struct osmo_cbsp_kill_complete *compl = &resp->u.kill_compl;
@@ -803,11 +808,16 @@
compl->old_serial_nr = kill->old_serial_nr;
compl->channel_ind = kill->channel_ind;
- compl->cell_list.id_discr = r_state->success.id_discr;
- llist_replace_head(&compl->cell_list.list, &r_state->success.list);
-
- compl->num_compl_list.id_discr = r_state->num_completed.id_discr;
- llist_replace_head(&compl->num_compl_list.list, &r_state->num_completed.list);
+ /* if the KILL relates to CBS, the "Channel Indicator" IE is present */
+ if (kill->channel_ind) {
+ /* only if it was CBS */
+ compl->num_compl_list.id_discr = r_state->num_completed.id_discr;
+ llist_replace_head(&compl->num_compl_list.list, &r_state->num_completed.list);
+ } else {
+ /* only if it was emergency */
+ compl->cell_list.id_discr = r_state->success.id_discr;
+ llist_replace_head(&compl->cell_list.list, &r_state->success.list);
+ }
}
cbsp_tx_decoded(cbc, resp);
--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/27959
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I9a43d386da01f085663d231a555b8b5acc99faca
Gerrit-Change-Number: 27959
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-MessageType: newchange