dexter has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/34065 )
Change subject: BTS_Tests: rewrite outdated comment
......................................................................
BTS_Tests: rewrite outdated comment
We are no longer "appending" imsi digits. This is now done properly
using a struct but let's still mention what we use the IMSI for.
Related: OS#5927
Change-Id: I3d943cd96e1d9627ad68e3439b2a649baa5785f1
---
M bts/BTS_Tests.ttcn
1 file changed, 14 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/65/34065/1
diff --git a/bts/BTS_Tests.ttcn b/bts/BTS_Tests.ttcn
index 1ab0f8a..0e4eee7 100644
--- a/bts/BTS_Tests.ttcn
+++ b/bts/BTS_Tests.ttcn
@@ -5847,7 +5847,7 @@
f_init_l1ctl();
f_l1_tune(L1CTL);
- /* append 3 last imsi digits so BTS can compute pagng group */
+ /* The BTS will use the last three IMSI digits to compute pagng group. */
var uint32_t fn := f_PCUIF_tx_imm_ass_pch(PCU, g_pcu_conn_id, imm_ass, '123459987'H);
timer T := 0.5;
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/34065
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: I3d943cd96e1d9627ad68e3439b2a649baa5785f1
Gerrit-Change-Number: 34065
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-MessageType: newchange
dexter has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/34066 )
Change subject: PCUIF: Add support for PCU_IF_SAPI_AGCH_DT
......................................................................
PCUIF: Add support for PCU_IF_SAPI_AGCH_DT
In PCUIF v.11 it will be possible to get confirmations for IMMEDIATE
ASSIGNMENT messages sent through the AGCH.
Related: OS#5927
Change-Id: I40e05a2e68cca77d3c2f41df9af8d35762488abf
---
M library/PCUIF_CodecPort.ttcn
M library/PCUIF_Types.ttcn
2 files changed, 74 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/66/34066/1
diff --git a/library/PCUIF_CodecPort.ttcn b/library/PCUIF_CodecPort.ttcn
index 8824a11..8030bec 100644
--- a/library/PCUIF_CodecPort.ttcn
+++ b/library/PCUIF_CodecPort.ttcn
@@ -196,6 +196,50 @@
return 0;
}
+/* This function can be used to transmit arbitrary GSM MAC blocks via the AGCH. The BTS will only confirm those MAC
+ * blocks that contain actually a valid immediate assignment message. Otherweise no confirmation is sent back */
+function f_PCUIF_tx_mac_block_agch(PCUIF_CODEC_PT pt, integer conn_id, octetstring mac_block, uint8_t bts_nr := 0,
+ boolean wait_for_cnf := true, OCT4 tlli := '01020304'O) return uint32_t {
+ var PCUIF_send_data sd;
+ timer T := 3.0;
+
+ if (mp_pcuif_version < 11) {
+ if (wait_for_cnf == true) {
+ setverdict(fail, "confirmation for AGCH not supported in PCUIF v.10 or earlier");
+ }
+ pt.send(t_SD_PCUIF(conn_id,
+ ts_PCUIF_DATA_REQ(bts_nr, 0, 0, 0, 0, PCU_IF_SAPI_AGCH, mac_block)));
+ } else {
+ var PCUIF_agch_dt agch_dt;
+ agch_dt.tlli := tlli;
+ agch_dt.data := mac_block;
+ pt.send(t_SD_PCUIF(conn_id, ts_PCUIF_DATA_REQ(bts_nr, 0, 0, 0, 0, PCU_IF_SAPI_AGCH_DT, enc_PCUIF_agch_dt(agch_dt))));
+ }
+
+ /* Exit early when the caller is not interested in the confirmation message */
+ if (wait_for_cnf == false) {
+ return 0;
+ }
+
+ T.start;
+ alt {
+ [] pt.receive(t_SD_PCUIF(conn_id, tr_PCUIF_DATA_CNF_DT(bts_nr, 0, 0, PCU_IF_SAPI_AGCH_DT))) -> value sd {
+ if (mp_pcuif_version < 11) {
+ setverdict(fail, "got tr_PCUIF_DATA_CNF_DT, but AGCH confirmation is not supported in PCUIF v.10 or earlier");
+ mtc.stop;
+ } else {
+ log("IMM.ASS was sent on AGCH at fn ", sd.data.u.data_cnf_dt.fn);
+ return sd.data.u.data_cnf_dt.fn;
+ }
+ }
+ [] pt.receive { repeat; }
+ [] T.timeout {
+ setverdict(fail, "Timeout waiting for PCU DATA.cnf (AGCH)");
+ mtc.stop;
+ }
+ }
+ return 0;
+}
diff --git a/library/PCUIF_Types.ttcn b/library/PCUIF_Types.ttcn
index 94056b9..7fe7358 100644
--- a/library/PCUIF_Types.ttcn
+++ b/library/PCUIF_Types.ttcn
@@ -54,7 +54,8 @@
PCU_IF_SAPI_PDTCH ('05'O),
PCU_IF_SAPI_PRACH ('06'O),
PCU_IF_SAPI_PTCCH ('07'O),
- PCU_IF_SAPI_PCH_DT ('08'O)
+ PCU_IF_SAPI_PCH_DT ('08'O),
+ PCU_IF_SAPI_AGCH_DT ('09'O)
} with { variant "FIELDLENGTH(8)" };
type record PCUIF_Flags {
@@ -329,6 +330,21 @@
external function dec_PCUIF_pch_dt(in octetstring stream) return PCUIF_pch_dt
with { extension "prototype(convert) decode(RAW)" };
+/* Record to send a (confirmed) IMMEDIATE ASSIGNMENT message via AGCH. The record is sent by the PCU to the BTS as a
+ * data request (data_req) under SAPI PCU_IF_SAPI_AGCH_DT. */
+type record PCUIF_agch_dt {
+ OCT4 tlli,
+ octetstring data length(23)
+} with {
+ variant (tlli) "BYTEORDER(last)"
+ variant (data) "FIELDLENGTH(23)"
+};
+
+external function enc_PCUIF_agch_dt(in PCUIF_agch_dt pdu) return octetstring
+ with { extension "prototype(convert) encode(RAW)" };
+external function dec_PCUIF_agch_dt(in octetstring stream) return PCUIF_agch_dt
+ with { extension "prototype(convert) decode(RAW)" };
+
type union PCUIF_MsgUnion {
PCUIF_data data_req,
PCUIF_data data_cnf,
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/34066
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: I40e05a2e68cca77d3c2f41df9af8d35762488abf
Gerrit-Change-Number: 34066
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-MessageType: newchange
dexter has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/34068 )
Change subject: PCUIF_Components: add compatibility for PCU_IF_SAPI_AGCH_DT
......................................................................
PCUIF_Components: add compatibility for PCU_IF_SAPI_AGCH_DT
When we receive a PCUIF_DATA_REQ, f_BTS_CT_handler will mangle the
incoming message for us. The resulting BTS_CCCH_Block that is sent up to
the component not only contains the PCUIF message, but will also have
the already parsed MAC block attached. This currently only works for
PCU_IF_SAPI_PCH and PCU_IF_SAPI_PCH_DT but not for PCU_IF_SAPI_AGCH_DT.
Let's add compatibility for PCU_IF_SAPI_AGCH_DT.
Related: OS#5927
Change-Id: Ife67bde444d957822a953391b80d01d49fff064b
---
M pcu/PCUIF_Components.ttcn
1 file changed, 25 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/68/34068/1
diff --git a/pcu/PCUIF_Components.ttcn b/pcu/PCUIF_Components.ttcn
index 8a1207a..af33a14 100644
--- a/pcu/PCUIF_Components.ttcn
+++ b/pcu/PCUIF_Components.ttcn
@@ -499,7 +499,7 @@
/* Wait until the PCU is connected */
PCUIF.receive(tr_RAW_PCU_EV(PCU_EV_CONNECT));
- var template PCUIF_Sapi tr_ccch_sapi := (PCU_IF_SAPI_PCH, PCU_IF_SAPI_PCH_DT, PCU_IF_SAPI_AGCH);
+ var template PCUIF_Sapi tr_ccch_sapi := (PCU_IF_SAPI_PCH, PCU_IF_SAPI_PCH_DT, PCU_IF_SAPI_AGCH, PCU_IF_SAPI_AGCH_DT);
alt {
/* Wait for TXT.ind (PCU_VERSION) and respond with INFO.ind (SI13) */
[] PCUIF.receive(tr_PCUIF_TXT_IND(bts_nr, PCU_VERSION, ?)) -> value pcu_msg {
@@ -538,6 +538,7 @@
[decode_data_req] PCUIF.receive(tr_PCUIF_DATA_REQ(bts_nr, ?, ?, sapi := tr_ccch_sapi)) -> value pcu_msg {
var octetstring data;
var PCUIF_pch_dt pch_dt;
+ var PCUIF_agch_dt agch_dt;
/* On PCH the payload is prefixed with paging group (3 octets): skip it.
* TODO: add an additional template parameter, so we can match it. */
if (pcu_msg.u.data_req.sapi == PCU_IF_SAPI_PCH) {
@@ -553,6 +554,11 @@
pcu_msg_rr.tlli := pch_dt.tlli;
pcu_msg_rr.imsi := pch_dt.imsi;
pcu_msg_rr.rr_msg := dec_GsmRrMessage(pch_dt.data);
+ } else if (pcu_msg_rr.raw.sapi == PCU_IF_SAPI_AGCH_DT) {
+ agch_dt := dec_PCUIF_agch_dt(pcu_msg_rr.raw.data);
+ pcu_msg_rr.imsi := omit;
+ pcu_msg_rr.tlli := agch_dt.tlli;
+ pcu_msg_rr.rr_msg := dec_GsmRrMessage(agch_dt.data);
} else {
pcu_msg_rr.tlli := omit;
pcu_msg_rr.imsi := omit;
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/34068
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: Ife67bde444d957822a953391b80d01d49fff064b
Gerrit-Change-Number: 34068
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-MessageType: newchange
dexter has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/34069 )
Change subject: WIP: fixup for PCU_Tests: use PCUIF v.11 exclusively
......................................................................
WIP: fixup for PCU_Tests: use PCUIF v.11 exclusively
Change-Id: I5e72cbf4bcc2fc4fa305861bd7cf08e00ef7df1d
---
M pcu/GPRS_Components.ttcn
M pcu/PCU_Tests.ttcn
2 files changed, 30 insertions(+), 8 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/69/34069/1
diff --git a/pcu/GPRS_Components.ttcn b/pcu/GPRS_Components.ttcn
index c894cc9..2765a04 100644
--- a/pcu/GPRS_Components.ttcn
+++ b/pcu/GPRS_Components.ttcn
@@ -1069,7 +1069,7 @@
}
}
-altstep as_ms_rx_imm_ass(template PCUIF_Sapi sapi := PCU_IF_SAPI_AGCH,
+altstep as_ms_rx_imm_ass(template PCUIF_Sapi sapi := PCU_IF_SAPI_AGCH_DT,
template GsmRrMessage t_imm_ass := ?,
template (present) TsTrxBtsNum nr := ts_TsTrxBtsNum,
out GsmRrMessage rr_imm_ass)
@@ -1081,14 +1081,12 @@
rr_imm_ass := data_msg.rr_msg;
log("Rx Immediate Assignment: ", rr_imm_ass);
/* Send DATA.cnf back to the IUT (only needed for PCH) */
- if (data_msg.raw.sapi == PCU_IF_SAPI_PCH_DT) {
- f_pcuif_tx_data_cnf(data_msg);
- }
+ f_pcuif_tx_data_cnf(data_msg);
setverdict(pass);
}
}
-function f_pcuif_rx_imm_ass(template PCUIF_Sapi sapi := PCU_IF_SAPI_AGCH,
+function f_pcuif_rx_imm_ass(template PCUIF_Sapi sapi := PCU_IF_SAPI_AGCH_DT,
template GsmRrMessage t_imm_ass := ?,
template (present) TsTrxBtsNum nr := tr_TsTrxBtsNum)
runs on MS_BTS_IFACE_CT return GsmRrMessage {
@@ -1139,7 +1137,7 @@
if (is_11bit != 0) { ra := 127; }
/* Expect Immediate (TBF) Assignment on the same TS/TRX/BTS */
- return f_pcuif_rx_imm_ass(PCU_IF_SAPI_AGCH, tr_IMM_TBF_ASS(false, ra, fn), nr);
+ return f_pcuif_rx_imm_ass(PCU_IF_SAPI_AGCH_DT, tr_IMM_TBF_ASS(false, ra, fn), nr);
}
/* Enqueue DATA.ind (both TDMA frame and block numbers to be patched) */
@@ -1182,7 +1180,7 @@
var BTS_CCCH_Block data_msg;
BTS.receive(tr_PCUIF_DATA_RR(nr.bts_nr,
- tr_PCUIF_DATA(nr.trx_nr, nr.ts_nr, sapi := PCU_IF_SAPI_PCH),
+ tr_PCUIF_DATA(nr.trx_nr, nr.ts_nr, sapi := PCU_IF_SAPI_PCH_DT),
tr_PAG_REQ1(tr_MI_LV(mi1)))) -> value data_msg;
rr_pag_req1 := data_msg.rr_msg;
log("Rx Paging Request Type1: ", rr_pag_req1);
diff --git a/pcu/PCU_Tests.ttcn b/pcu/PCU_Tests.ttcn
index d844736..a9d7fd3 100644
--- a/pcu/PCU_Tests.ttcn
+++ b/pcu/PCU_Tests.ttcn
@@ -4858,7 +4858,22 @@
/* SGSN sends some DL data, PCU will page on CCCH (PCH) */
BSSGP[0].send(ts_BSSGP_DL_UD(ms.tlli, f_rnd_octstring(12)));
- f_ms_exp_dl_tbf_ass_ccch(ms);
+
+ /* The PCU will send an IMMEDIATE ASSIGNMENT message on the AGCH. It
+ * should be noted that IMMEDIATE ASSIGNMENT messages for DL TBFs are
+ * commonly sent on the PCH. However in this case the IMSI is not
+ * known to the PCU and hence no paging group can be calculated. The
+ * PCU is then forced to use the AGCH.
+ *
+ * As a background information to this it should be noted that this
+ * works because the IMSI is commonly unknown during a GMM ATTACH
+ * REQUEST. In this phase the MS is in non-DRX mode, which means that
+ * it listens on all CCCH blocks (PCH and AGCH)
+ *
+ * See also: 3gpp TS 44.060, section 5.5.1.5 and
+ * 3gpp TS 45.002, section 6.5.3, 6.5.6
+ */
+ f_ms_exp_dl_tbf_ass_ccch(ms, PCU_IF_SAPI_AGCH_DT);
f_TC_pcuif_fh_check_imm_ass(valueof(info_ind), ms.dl_tbf.rr_imm_ass);
f_shutdown(__BFILE__, __LINE__, final := true);
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/34069
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: I5e72cbf4bcc2fc4fa305861bd7cf08e00ef7df1d
Gerrit-Change-Number: 34069
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-MessageType: newchange
dexter has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/34062 )
Change subject: BTS_Tests: fix comment
......................................................................
BTS_Tests: fix comment
The testcase is about PCH, not AGCH
Related: OS#5927
Change-Id: I5c2aa1aab261a0f4bfb24b4be7af29c1d814d37a
---
M bts/BTS_Tests.ttcn
1 file changed, 13 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/62/34062/1
diff --git a/bts/BTS_Tests.ttcn b/bts/BTS_Tests.ttcn
index 93b0ddf..c5cc9c7 100644
--- a/bts/BTS_Tests.ttcn
+++ b/bts/BTS_Tests.ttcn
@@ -5806,7 +5806,7 @@
}
}
-/* Send AGCH from PCU; check it appears on Um side */
+/* Send PCH from PCU; check it appears on Um side */
testcase TC_pcu_data_req_pch() runs on test_CT {
timer T := 3.0;
f_init_with_pcuif();
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/34062
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: I5c2aa1aab261a0f4bfb24b4be7af29c1d814d37a
Gerrit-Change-Number: 34062
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-MessageType: newchange
dexter has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bsc/+/34060 )
Change subject: pcu_sock: use PCU_IF_SAPI_AGCH_DT instead PCU_IF_SAPI_AGCH
......................................................................
pcu_sock: use PCU_IF_SAPI_AGCH_DT instead PCU_IF_SAPI_AGCH
In PCUIF v.11 we use PCU_IF_SAPI_AGCH_DT exclusively. We use this SAPI
to transfer IMMEDIATE ASSIGNMENT messages for uplink and downlink. In
both cases we send a confirmation back to the PCU. For details see
coresponding patch in osmo-pcu.git (see Depends)
CAUTION: This patch breaks compatibility to current master osmo-pcu (See
also "Depends")
Related: OS#5927
Depends: osmo-pcu.git I9effdcec1da91a6e2e7a7c41f95d3300ad1bb292
Change-Id: I709c27adaf09a6766cfde4d76d878626d30ebb3c
---
M include/osmocom/bsc/pcuif_proto.h
M src/osmo-bsc/pcu_sock.c
2 files changed, 47 insertions(+), 2 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/60/34060/1
diff --git a/include/osmocom/bsc/pcuif_proto.h b/include/osmocom/bsc/pcuif_proto.h
index 1dda160..0d02379 100644
--- a/include/osmocom/bsc/pcuif_proto.h
+++ b/include/osmocom/bsc/pcuif_proto.h
@@ -42,6 +42,7 @@
#define PCU_IF_SAPI_PRACH 0x06 /* packet random access channel */
#define PCU_IF_SAPI_PTCCH 0x07 /* packet TA control channel */
#define PCU_IF_SAPI_PCH_DT 0x08 /* assignment on PCH (confirmed using TLLI) */
+#define PCU_IF_SAPI_AGCH_DT 0x09 /* assignment on AGCH (confirmed using TLLI) */
/* flags */
#define PCU_IF_FLAG_ACTIVE (1 << 0)/* BTS is active */
@@ -282,6 +283,15 @@
uint8_t data[GSM_MACBLOCK_LEN];
} __attribute__((packed));
+/* Struct to send a (confirmed) IMMEDIATE ASSIGNMENT message via AGCH. The struct is sent as a data request
+ * (data_req) under SAPI PCU_IF_SAPI_AGCH_DT. */
+struct gsm_pcu_if_agch_dt {
+ /* TLLI as reference for confirmation */
+ uint32_t tlli;
+ /* GSM mac-block (with immediate assignment message) */
+ uint8_t data[GSM_MACBLOCK_LEN];
+} __attribute__((packed));
+
struct gsm_pcu_if {
/* context based information */
uint8_t msg_type; /* message type */
diff --git a/src/osmo-bsc/pcu_sock.c b/src/osmo-bsc/pcu_sock.c
index 8a1d5b0..7d05788 100644
--- a/src/osmo-bsc/pcu_sock.c
+++ b/src/osmo-bsc/pcu_sock.c
@@ -528,7 +528,9 @@
uint8_t pag_grp;
int rc = 0;
struct gsm_pcu_if_pch_dt *pch_dt;
+ struct gsm_pcu_if_agch_dt *agch_dt;
struct gsm48_imm_ass *gsm48_imm_ass;
+ bool confirm;
LOG_BTS(bts, DPCU, LOGL_DEBUG, "Data request received: sapi=%s arfcn=%d "
"block=%d data=%s\n", sapi_string[data_req->sapi],
@@ -536,9 +538,23 @@
osmo_hexdump(data_req->data, data_req->len));
switch (data_req->sapi) {
- case PCU_IF_SAPI_AGCH:
- if (rsl_imm_assign_cmd(bts, data_req->len, data_req->data))
+ case PCU_IF_SAPI_AGCH_DT:
+ if (data_req->len < sizeof(struct gsm_pcu_if_agch_dt)) {
+ LOG_BTS(bts, DPCU, LOGL_ERROR, "Received PCU data request with invalid/small length %d\n",
+ data_req->len);
+ break;
+ }
+
+ agch_dt = (struct gsm_pcu_if_agch_dt *)data_req->data;
+ if (rsl_imm_assign_cmd(bts, GSM_MACBLOCK_LEN, agch_dt->data))
rc = -EIO;
+
+ /* Send the confirmation immediately. This is as accurate as we can get since from this point on the
+ * BTS hardware is responsible to schedule the sending of the IMMEDIATE ASSIGNMENT */
+ gsm48_imm_ass = (struct gsm48_imm_ass *)agch_dt->data;
+ confirm = (gsm48_imm_ass->msg_type == GSM48_MT_RR_IMM_ASS);
+ if (confirm)
+ return pcu_tx_pch_confirm(bts, agch_dt->tlli);
break;
case PCU_IF_SAPI_PCH_DT:
/* DT = direct TLLI. A tlli is prefixed so that the BSC/BTS can confirm the sending of the downlink
--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/34060
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I709c27adaf09a6766cfde4d76d878626d30ebb3c
Gerrit-Change-Number: 34060
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-MessageType: newchange