pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/35514?usp=email )
Change subject: GTPv2_Templates: Fix tEID field optional tr_PDU_GTP2C_msgtypes()
......................................................................
GTPv2_Templates: Fix tEID field optional tr_PDU_GTP2C_msgtypes()
The TEID field is optional, based on t_Bit. Hence, we also want to
match by type if there's no TEID.
Change-Id: I65044b8758046704e22f9057f34ce5fdbb7aabfe
---
M library/GTPv2_Templates.ttcn
1 file changed, 13 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/14/35514/1
diff --git a/library/GTPv2_Templates.ttcn b/library/GTPv2_Templates.ttcn
index 5dea7e9..afe0138 100644
--- a/library/GTPv2_Templates.ttcn
+++ b/library/GTPv2_Templates.ttcn
@@ -106,7 +106,7 @@
version := '010'B,
messageType := types,
lengthf := ?,
- tEID := ?,
+ tEID := *,
sequenceNumber := ?,
spare3 := '00'O,
gtpcv2_pdu := ?,
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/35514?usp=email
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: I65044b8758046704e22f9057f34ce5fdbb7aabfe
Gerrit-Change-Number: 35514
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: newchange
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/35515?usp=email )
Change subject: GTPv2_Emulation: routing improvements: Prioritize response, fallback to TEID
......................................................................
GTPv2_Emulation: routing improvements: Prioritize response, fallback to TEID
First try forwarding to component transmitting the originating request,
since this is the most fine-grained match.
Finally, if no specific match was found and if messages belongs to
TEID0, send it over that port as a fallback.
Fixes: 1d2cc67036e95a0c3ee3ac7738d7e15d5f76b8a2
Change-Id: Ie96d65085fb352489150183415dbd6cc8237a47c
---
M library/GTPv2_Emulation.ttcn
1 file changed, 24 insertions(+), 6 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/15/35515/1
diff --git a/library/GTPv2_Emulation.ttcn b/library/GTPv2_Emulation.ttcn
index eb2b977..240cce4 100644
--- a/library/GTPv2_Emulation.ttcn
+++ b/library/GTPv2_Emulation.ttcn
@@ -560,7 +560,12 @@
/* route inbound GTP2-C based on TEID, SEQ or IMSI */
[] GTP2C.receive(Gtp2cUnitdata:?) -> value g2c_ud {
var template hexstring imsi_t := f_gtp2c_extract_imsi(g2c_ud.gtpc);
- if (isvalue(imsi_t) and f_imsi_known(valueof(imsi_t))) {
+ /* if this is a response, route by SEQ: */
+ if (match(g2c_ud.gtpc, tr_PDU_GTP2C_msgtypes(gtp2_responses))
+ and f_seq_known(g2c_ud.gtpc.sequenceNumber)) {
+ vc_conn := f_comp_by_seq(g2c_ud.gtpc.sequenceNumber);
+ CLIENT.send(g2c_ud.gtpc) to vc_conn;
+ }else if (isvalue(imsi_t) and f_imsi_known(valueof(imsi_t))) {
vc_conn := f_comp_by_imsi(valueof(imsi_t));
CLIENT.send(g2c_ud.gtpc) to vc_conn;
} else if ((ispresent(g2c_ud.gtpc.tEID) and g2c_ud.gtpc.tEID != '00000000'O)
@@ -571,13 +576,11 @@
and f_teid_known('00000000'O)) {
vc_conn := f_comp_by_teid(g2c_ud.gtpc.tEID);
CLIENT.send(g2c_ud.gtpc) to vc_conn;
- /* if this is a response, route by SEQ: */
- } else if (match(g2c_ud.gtpc, tr_PDU_GTP2C_msgtypes(gtp2_responses))
- and f_seq_known(g2c_ud.gtpc.sequenceNumber)) {
- vc_conn := f_comp_by_seq(g2c_ud.gtpc.sequenceNumber);
- CLIENT.send(g2c_ud.gtpc) to vc_conn;
} else {
SendToUdMsgTable(g2c_ud);
+ if (not ispresent(g2c_ud.gtpc.tEID) or g2c_ud.gtpc.tEID == '00000000'O) {
+ TEID0.send(g2c_ud.gtpc);
+ }
}
/* remove sequence number if response was received */
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/35515?usp=email
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: Ie96d65085fb352489150183415dbd6cc8237a47c
Gerrit-Change-Number: 35515
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: newchange
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/35516?usp=email )
Change subject: pgw: Expect EchoResp in CLIENT port of component who sent EchoReq
......................................................................
pgw: Expect EchoResp in CLIENT port of component who sent EchoReq
A recent commit in GTPv2_Emulation improved the routing of incoming
messages from network towards clients.
After that change, the GTPv2_Emulation properly matches the originating
component of the procedure and forwards the reply to it.
Hence, TC_tx_echo() needs to be adapter to expect the reply on its
CLIENT port.
TEID0 is now left for incoming initiating messages which have no seqnr
match.
Change-Id: I1764fdf81192597e393d79d34cb8f221aa79bbd9
Fixes: 1d2cc67036e95a0c3ee3ac7738d7e15d5f76b8a2
---
M pgw/PGW_Tests.ttcn
1 file changed, 24 insertions(+), 3 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/16/35516/1
diff --git a/pgw/PGW_Tests.ttcn b/pgw/PGW_Tests.ttcn
index b8eb471..fa7be47 100644
--- a/pgw/PGW_Tests.ttcn
+++ b/pgw/PGW_Tests.ttcn
@@ -41,7 +41,7 @@
}
/* main component, we typically have one per testcase */
-type component PGW_Test_CT {
+type component PGW_Test_CT extends GTP2_ConnHdlr {
var GTPv2_Emulation_CT vc_GTP2;
port GTP2EM_PT TEID0;
@@ -241,6 +241,8 @@
vc_GTP2 := GTPv2_Emulation_CT.create("GTP2_EM");
map(vc_GTP2:GTP2C, system:GTP2C);
connect(vc_GTP2:TEID0, self:TEID0);
+ connect(vc_GTP2:CLIENT, self:GTP2);
+ connect(vc_GTP2:CLIENT_PROC, self:GTP2_PROC);
vc_GTP2.start(GTPv2_Emulation.main(cfg));
if (mp_pcrf_local_ip != "") {
@@ -785,10 +787,10 @@
f_init();
- TEID0.send(ts_GTP2C_EchoReq(0));
+ GTP2.send(ts_GTP2C_EchoReq(0));
T.start;
alt {
- [] TEID0.receive(tr_GTP2C_EchoResp) {
+ [] GTP2.receive(tr_GTP2C_EchoResp) {
setverdict(pass);
}
[] T.timeout {
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/35516?usp=email
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: I1764fdf81192597e393d79d34cb8f221aa79bbd9
Gerrit-Change-Number: 35516
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: newchange
Attention is currently required from: daniel, pespin.
fixeria has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/35509?usp=email )
Change subject: GTP_Templates: Add templates for some GTPv1C IEs
......................................................................
Patch Set 1: Code-Review+1
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/35509?usp=email
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: I84aac34ca40a2707dc9da28e112fd7684e706c8e
Gerrit-Change-Number: 35509
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de>
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: daniel <dwillmann(a)sysmocom.de>
Gerrit-Comment-Date: Tue, 09 Jan 2024 10:58:14 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/35512?usp=email )
Change subject: S1AP_Emulation: Add port message to reset NAS count values
......................................................................
S1AP_Emulation: Add port message to reset NAS count values
It is sometimes needed to reset them to zero as per spec, like when
moving GERAN/UTRAN->EUTRAN.
This will be used by a follow-up patch.
Change-Id: I61d7b919aba8f58a020c18ae9b9bba4108d59010
---
M library/S1AP_Emulation.ttcn
1 file changed, 24 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/12/35512/1
diff --git a/library/S1AP_Emulation.ttcn b/library/S1AP_Emulation.ttcn
index 7d91c36..1ef4a76 100644
--- a/library/S1AP_Emulation.ttcn
+++ b/library/S1AP_Emulation.ttcn
@@ -67,8 +67,12 @@
octetstring k_nas_int,
octetstring k_nas_enc
};
+type record ResetNAScounts {
+/* empty */
+};
type union S1APEM_Config {
- NAS_Keys set_nas_keys
+ NAS_Keys set_nas_keys,
+ ResetNAScounts reset_nas_counts
};
type enumerated S1APEM_EventUpDown {
@@ -442,6 +446,12 @@
S1apAssociationTable[assoc_id].nus.k_nas_int := s1cfg.set_nas_keys.k_nas_int;
S1apAssociationTable[assoc_id].nus.k_nas_enc := s1cfg.set_nas_keys.k_nas_enc;
}
+ /* Configuration primitive from client */
+ [] S1AP_CLIENT.receive(S1APEM_Config:{reset_nas_counts:=?}) -> value s1cfg sender vc_conn {
+ var integer assoc_id := f_assoc_id_by_comp(vc_conn);
+ S1apAssociationTable[assoc_id].nus.rx_count := 0;
+ S1apAssociationTable[assoc_id].nus.tx_count := 0;
+ }
/* S1AP from client: InitialUE */
[] S1AP_CLIENT.receive(tr_S1AP_InitialUE) -> value msg sender vc_conn {
/* create a table entry about this connection */
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/35512?usp=email
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: I61d7b919aba8f58a020c18ae9b9bba4108d59010
Gerrit-Change-Number: 35512
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: newchange
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/35513?usp=email )
Change subject: WIP: mme: 2g->4g
......................................................................
WIP: mme: 2g->4g
Change-Id: I6f8f077b99e83e6467d2b0c05148b81dbcf2ede4
---
M mme/MME_Tests.ttcn
1 file changed, 178 insertions(+), 32 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/13/35513/1
diff --git a/mme/MME_Tests.ttcn b/mme/MME_Tests.ttcn
index f4f41e2..1b4b548 100644
--- a/mme/MME_Tests.ttcn
+++ b/mme/MME_Tests.ttcn
@@ -856,6 +856,37 @@
}
}
+
+/* 3GPP TS 23.401 D.3.5, TS 23.003 2.8.2.1 */
+private function guti2rai_ptmsi(in NAS_EPS_Types.GUTI guti, out RoutingAreaIdentity rai, out OCT4 ptmsi, out OCT3 ptmsi_sig) runs on ConnHdlr {
+ var bitstring mtmsi_bits := oct2bit(guti.mTMSI);
+ var bitstring ptmsi_bits;
+ var bitstring ptmsi_sig_bits;
+
+ rai := valueof(ts_RoutingAreaIdentity(guti.mccDigit1 & guti.mccDigit2 & guti.mccDigit3,
+ guti.mncDigit3 & guti.mncDigit1 & guti.mncDigit2,
+ guti.mMEGI, guti.mMEC));
+ /* 3GPP TS 23.003 2.8.2.0: "P-TMSI shall be of 32 bits length where the two topmost bits are
+ * reserved and always set to '11'. Hence, for a UE which may handover to GERAN/UTRAN (based on
+ * subscription and UE capabilities), the corresponding bits in the M-TMSI are set to '11'"
+ */
+ ptmsi_bits := '11'B & substr(mtmsi_bits, 2, 6) & oct2bit(guti.mMEC) & substr(mtmsi_bits, 16, 16);
+ ptmsi_sig_bits := substr(mtmsi_bits, 8, 8) & oct2bit('0000'O);
+ ptmsi := bit2oct(ptmsi_bits);
+ ptmsi_sig := bit2oct(ptmsi_sig_bits);
+ /* TODO: The UE shall fill the remaining 2 octets of the <P-TMSI signature> according to clauses 9.1.1, 9.4.1, 10.2.1, or
+ * 10.5.1 of 3GPP TS.33.401 [89] , as appropriate, for RAU/Attach procedures.*/
+ /* TODO: 3GPP TS 33.401 9.1.1 The 16 least significant bits available in
+ * the P-TMSI signature field shall be filled with the truncated NAS-token
+ * according to 3GPP TS 23.003 [3].The truncated NAS-token is defined as the 16
+ * least significant bits of the NAS-token.
+ * The NAS-token is derived as specified in Annex A.9. The UE shall use the uplink NAS COUNT value that it would use
+ * in the next NAS message to calculate the NAS-token and increase the stored uplink NAS COUNT value by 1.*/
+ /* TODO: mMEC "also copied into the 8 Most Significant Bits of the NRI field within the P-TMSI" */
+}
+/* Test UE attached to EUTRAN reselecting a GERAN cell. In this scenario, the
+ * new SGSN will attempt to obtain information of the UE from the old SGSN (MME)
+ * through Gn interface using SGSN Context Request/Response procedure (OS#6294). */
private function f_gtp_sgsn_context_4g_to_2g(OCT4 new_sgsn_local_teid := '12345678'O) runs on ConnHdlr {
var template (value) GTPC_PDUs SGSNContextReqPDU;
var RoutingAreaIdentity rai;
@@ -880,10 +911,10 @@
setverdict(pass);
}
[] GTP.receive {
- setverdict(fail, "unexpected GTPC message from MME");
+ Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, log2str("unexpected GTPC message from MME"));
}
[] T.timeout {
- setverdict(fail, "no SGSN Context Response from MME");
+ Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, log2str("no SGSN Context Response from MME"));
}
}
@@ -893,6 +924,43 @@
}
+private altstep as_gtp_sgsn_context_2g_to_4g(OCT4 new_sgsn_teid := 'ABABABAB'O, GTP_Templates.GTP_RATType rat_type := GTP_RAT_TYPE_EUTRAN) runs on ConnHdlr {
+ var Gtp1cUnitdata gtpc_pdu;
+
+ [] GTP.receive(tr_GTPC_SGSNContextReq(g_gn_iface_peer, tr_SGSNContextReqPDU(rat_type := int2oct(enum2int(rat_type), 1)))) -> value gtpc_pdu {
+ var template (value) PDP_Context_GTPC pdp_ctx;
+ var template (value) GTPC_PDUs SGSNContextRespPDU;
+ var Gtp1cUnitdata gtpc_pdu_ack;
+ var OCT4 old_mme_remote_teid := gtpc_pdu.gtpc.gtpc_pdu.sgsn_ContextRequest.teidControlPlane.teidControlPlane;
+
+ const OCT16 ck := '740d62df9803eebde5120acf358433d0'O;
+ const OCT16 ik := '11329aae8e8d2941bb226b2061137c58'O;
+
+ pdp_ctx := ts_PDP_Context_GTPC(f_inet_addr(g_pars.ue_pars.ue_ip),
+ f_inet_addr(mp_gn_local_ip),
+ c_NAS_defaultAPN,
+ ggsn_teic := '12345678'O,
+ ggsn_teid := '87654321'O);
+ SGSNContextRespPDU := ts_SGSNContextRespPDU(GTP_CAUSE_REQUEST_ACCEPTED,
+ g_pars.ue_pars.imsi,
+ new_sgsn_teid,
+ f_inet_addr(mp_gn_local_ip),
+ ts_MM_ContextUMTS(ck, ik),
+ { pdp_ctx });
+ GTP.send(ts_GTPC_SGSNContextResp(g_gn_iface_peer,
+ old_mme_remote_teid,
+ oct2int(gtpc_pdu.gtpc.opt_part.sequenceNumber),
+ SGSNContextRespPDU));
+
+ GTP.receive(tr_GTPC_SGSNContextAck(g_gn_iface_peer, new_sgsn_teid,
+ tr_SGSNContextAckPDU(GTP_CAUSE_REQUEST_ACCEPTED))) -> value gtpc_pdu;
+ setverdict(pass);
+ }
+ [] GTP.receive {
+ setverdict(fail, "unexpected GTPC message from MME");
+ }
+}
+
private function f_attach() runs on ConnHdlr {
var template (value) EPS_MobileIdentityV mi := ts_NAS_MobileId_IMSI(g_pars.ue_pars.imsi);
var template (value) PDU_NAS_EPS nas_esm, nas_emm;
@@ -1312,36 +1380,6 @@
vc_conn.done;
}
-/* Test UE attached to EUTRAN reselecting a GERAN cell. In this scenario, the
- * new SGSN will attempt to obtain information of the UE from the old SGSN (MME)
- * through Gn interface using SGSN Context Request/Response procedure (OS#6294). */
-/* TS 23.003 2.8.2.1 */
-private function guti2rai_ptmsi(in NAS_EPS_Types.GUTI guti, out RoutingAreaIdentity rai, out OCT4 ptmsi, out OCT3 ptmsi_sig) runs on ConnHdlr {
- var bitstring mtmsi_bits := oct2bit(guti.mTMSI);
- var bitstring ptmsi_bits;
- var bitstring ptmsi_sig_bits;
-
- rai := valueof(ts_RoutingAreaIdentity(guti.mccDigit1 & guti.mccDigit2 & guti.mccDigit3,
- guti.mncDigit3 & guti.mncDigit1 & guti.mncDigit2,
- guti.mMEGI, guti.mMEC));
- /* 3GPP TS 23.003 2.8.2.0: "P-TMSI shall be of 32 bits length where the two topmost bits are
- * reserved and always set to '11'. Hence, for a UE which may handover to GERAN/UTRAN (based on
- * subscription and UE capabilities), the corresponding bits in the M-TMSI are set to '11'"
- */
- ptmsi_bits := '11'B & substr(mtmsi_bits, 2, 6) & oct2bit(guti.mMEC) & substr(mtmsi_bits, 16, 16);
- ptmsi_sig_bits := substr(mtmsi_bits, 8, 8) & oct2bit('0000'O);
- ptmsi := bit2oct(ptmsi_bits);
- ptmsi_sig := bit2oct(ptmsi_sig_bits);
- /* TODO: The UE shall fill the remaining 2 octets of the <P-TMSI signature> according to clauses 9.1.1, 9.4.1, 10.2.1, or
- * 10.5.1 of 3GPP TS.33.401 [89] , as appropriate, for RAU/Attach procedures.*/
- /* TODO: 3GPP TS 33.401 9.1.1 The 16 least significant bits available in
- * the P-TMSI signature field shall be filled with the truncated NAS-token
- * according to 3GPP TS 23.003 [3].The truncated NAS-token is defined as the 16
- * least significant bits of the NAS-token.
- * The NAS-token is derived as specified in Annex A.9. The UE shall use the uplink NAS COUNT value that it would use
- * in the next NAS message to calculate the NAS-token and increase the stored uplink NAS COUNT value by 1.*/
- /* TODO: mMEC "also copied into the 8 Most Significant Bits of the NRI field within the P-TMSI" */
-}
private function f_TC_ue_cell_reselect_eutran_to_geran(ConnHdlrPars pars) runs on ConnHdlr {
f_init_handler(pars);
f_gtp_register_imsi(g_pars.ue_pars.imsi);
@@ -1381,6 +1419,104 @@
vc_conn.done;
}
+/* 3GPP TS 23.401 D.3.6, TS 23.003 2.8.2.2 */
+private function rai_ptmsi2_guti(in RoutingAreaIdentity rai, in OCT4 ptmsi, in OCT3 ptmsi_sig, out NAS_EPS_Types.GUTI guti) runs on ConnHdlr {
+
+
+ var bitstring ptmsi_bits := oct2bit(ptmsi);
+ var bitstring ptmsi_sig_bits := oct2bit(ptmsi_sig);
+ var bitstring mtmsi_bits := '11'B &
+ substr(ptmsi_bits, 2, 6) &
+ substr(ptmsi_sig_bits, 0, 8) &
+ substr(ptmsi_bits, 16, 16);
+ guti := valueof(ts_NAS_GUTI(mcc_mnc := rai.mcc_digits & rai.mnc_digits,
+ mmegi := rai.lac,
+ mmec := rai.rac,
+ tmsi := bit2oct(mtmsi_bits)));
+}
+/* Test UE attached to GERAN reselecting a EUTRAN cell. In this scenario, the
+ * new MME will attempt to obtain information of the UE from the old SGSN
+ * through Gn interface using SGSN Context Request/Response procedure (OS#6294). */
+/* 3GPP TS 23.401 D.3.6, TS 23.003 2.8.2.1 */
+private function f_TC_ue_cell_reselect_geran_to_eutran(ConnHdlrPars pars) runs on ConnHdlr {
+ f_init_handler(pars);
+ f_gtp_register_imsi(g_pars.ue_pars.imsi);
+ f_gtp2_register_imsi(g_pars.ue_pars.imsi);
+ /* SGSN Context Req doesn't necessarily contain IMSI, hence expect it through TEID=0 */
+ f_gtp_register_teid('00000000'O);
+ /* passed in SGSN Context Resp to MME, will be used by MME when answering with SGSN Context Ack: */
+ const OCT4 new_sgsn_teid := 'ABABABAB'O;
+ f_gtp_register_teid(new_sgsn_teid);
+
+ var template (value) EPS_MobileIdentityV mi := ts_NAS_MobileId_IMSI(pars.ue_pars.imsi);
+ var template (value) S1AP_PDU tx;
+ var template (value) PDU_NAS_EPS nas_tau;
+ var RoutingAreaIdentity rai;
+ var OCT4 ptmsi := f_gen_tmsi(suffix := 0, nri_v := 0, nri_bitlen := 8);
+ var OCT3 ptmsi_sig := f_rnd_octstring(3);
+ var NAS_EPS_Types.GUTI guti_val;
+ var template (value) EPS_MobileIdentityLV old_guti;
+ timer T := 5.0;
+
+ rai := valueof(ts_RoutingAreaIdentity(mp_gn_local_mcc, mp_gn_local_mnc,
+ int2oct(mp_gn_local_lac, 2), int2oct(mp_gn_local_rac, 1)));
+ rai_ptmsi2_guti(rai, ptmsi, ptmsi_sig, guti_val);
+ old_guti := ts_EPS_MobileId_GUTI_(guti_val);
+
+ nas_tau := ts_PDU_NAS_EPS_TrackingAreaUpdateRequest(old_guti,
+ ts_PTMSI_SignatureTV(ptmsi_sig),
+ ts_GUTI_TypeTV(GUTI_TYPE_MAPPED));
+ tx := ts_S1AP_InitialUE(p_eNB_value := 0, p_nasPdu := enc_PDU_NAS_EPS(valueof(nas_tau)),
+ p_tAI := ts_enb_S1AP_TAI(g_pars.enb_pars[g_pars.mme_idx]),
+ p_eUTRAN_CGI := ts_enb_S1AP_CGI(g_pars.enb_pars[g_pars.mme_idx]),
+ p_rrcCause := mo_Signalling);
+
+ S1AP.send(tx);
+
+ /* NAS counts are reset to zero when a mapped security context is created. */
+ var S1APEM_Config cfg := {
+ reset_nas_counts := {}
+ };
+ S1AP.send(cfg);
+
+ as_gtp_sgsn_context_2g_to_4g(new_sgsn_teid);
+
+ /* We now expect the MME to send a Create Session Request to the SGW-C */
+ //f_gtp2_register_udmsg('20'O);
+ T.start;
+ alt {
+ [] as_GTP2C_CreateSession_success();
+ [] T.timeout { Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, log2str("No message from MME")); }
+ }
+
+ /* 3GPP TS 23.401 D.3.6 steps 14-21: */
+ as_DIA_UpdLoc();
+
+ /* 3GPP TS 23.401 D.3.6 step 22: */
+ S1AP.receive(tr_S1AP_IntialCtxSetupReq())
+ S1AP.receive(tr_PDU_NAS_EPS_TrackingAreaUpdateAccept);
+
+ /* 3GPP TS 23.401 D.3.6 step 23: */
+ // TODO: S1AP.send(ts_PDU_NAS_EPS_TrackingAreaUpdateComplete);
+
+ /* Leave some time for MME to handle TAU Complete: */
+ f_sleep(3.0);
+}
+testcase TC_ue_cell_reselect_geran_to_eutran() runs on MTC_CT {
+ var charstring id := testcasename();
+
+ f_init_diameter(id);
+ f_init_s1ap(id, 6);
+ f_init_gtpv2_s11(id);
+ f_s1ap_setup(0);
+ f_init_gtp(id);
+
+ var ConnHdlrPars pars := f_init_pars(ue_idx := 0);
+ var ConnHdlr vc_conn;
+ vc_conn := f_start_handler_with_pars(refers(f_TC_ue_cell_reselect_geran_to_eutran), pars);
+ vc_conn.done;
+}
+
control {
execute( TC_s1ap_setup_wrong_plmn() );
execute( TC_s1ap_setup_wrong_tac() );
@@ -1391,6 +1527,7 @@
execute( TC_RIM_RAN_INF() );
execute( TC_s1ap_reset() );
execute( TC_ue_cell_reselect_eutran_to_geran() );
+ execute( TC_ue_cell_reselect_geran_to_eutran() );
}
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/35513?usp=email
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: I6f8f077b99e83e6467d2b0c05148b81dbcf2ede4
Gerrit-Change-Number: 35513
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: newchange