daniel has submitted this change. (
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37296?usp=email )
Change subject: mme: Verify GUTI -> RAI/PTMSI translation is correct
......................................................................
mme: Verify GUTI -> RAI/PTMSI translation is correct
Change-Id: Id1afd55f84c91a765fa12a22979ef0351b6d6554
---
M mme/MME_Tests.ttcn
1 file changed, 25 insertions(+), 10 deletions(-)
Approvals:
laforge: Looks good to me, but someone else must approve
Jenkins Builder: Verified
lynxis lazus: Looks good to me, approved
diff --git a/mme/MME_Tests.ttcn b/mme/MME_Tests.ttcn
index 3ea17dd..76c9c7e 100644
--- a/mme/MME_Tests.ttcn
+++ b/mme/MME_Tests.ttcn
@@ -962,10 +962,14 @@
}
-private altstep as_gtp_sgsn_context_2g_to_4g(OCT4 new_sgsn_teid := 'ABABABAB'O,
GTPv1C_Templates.GTP_RATType rat_type := GTP_RAT_TYPE_EUTRAN) runs on ConnHdlr {
+private altstep as_gtp_sgsn_context_2g_to_4g(OCT4 new_sgsn_teid := 'ABABABAB'O,
GTPv1C_Templates.GTP_RATType rat_type := GTP_RAT_TYPE_EUTRAN,
+ RoutingAreaIdentity rai,
+ OCT4 ptmsi,
+ OCT3 ptmsi_sig
+) 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 {
+ [] GTP.receive(tr_GTPC_SGSNContextReq(g_gn_iface_peer, tr_SGSNContextReqPDU(rai := rai,
ptmsi := ts_PTMSI(ptmsi), ptmsi_sig := ts_PTMSI_sig(ptmsi_sig), 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;
@@ -1457,25 +1461,25 @@
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 {
+/* 3GPP TS 23.401 D.3.6, TS 23.003 2.8.2.2.2 (Mapping in the UE) */
+private function rai_ptmsi2_guti(in RoutingAreaIdentity rai, in OCT4 ptmsi, out
NAS_EPS_Types.GUTI guti) {
var bitstring ptmsi_bits := oct2bit(ptmsi);
- var bitstring ptmsi_sig_bits := oct2bit(ptmsi_sig);
+ var bitstring rac_bits := oct2bit(rai.rac);
var bitstring mtmsi_bits := '11'B &
substr(ptmsi_bits, 2, 6) &
- substr(ptmsi_sig_bits, 0, 8) &
+ substr(rac_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,
+ mmec := bit2oct(substr(ptmsi_bits, 8, 8)),
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 */
+/* 3GPP TS 23.401 D.3.6, TS 23.003 2.8.2.2.2 */
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);
@@ -1496,10 +1500,12 @@
var template (value) EPS_MobileIdentityLV old_guti;
var S1APEM_Config cfg;
timer T := 5.0;
+ var bitstring ptmsi_bits := oct2bit(ptmsi);
+ var OCT4 ptmsi_exp := bit2oct('11'B & substr(ptmsi_bits, 2, 30));
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);
+ rai_ptmsi2_guti(rai, ptmsi, guti_val);
old_guti := ts_EPS_MobileId_GUTI_(guti_val);
nas_tau := ts_PDU_NAS_EPS_TrackingAreaUpdateRequest(old_guti,
@@ -1520,7 +1526,7 @@
};
S1AP.send(cfg);
- as_gtp_sgsn_context_2g_to_4g(new_sgsn_teid);
+ as_gtp_sgsn_context_2g_to_4g(new_sgsn_teid, GTP_RAT_TYPE_EUTRAN, rai, ptmsi_exp,
ptmsi_sig);
/* We now expect the MME to send a Create Session Request to the SGW-C */
T.start;
--
To view, visit
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37296?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: Id1afd55f84c91a765fa12a22979ef0351b6d6554
Gerrit-Change-Number: 37296
Gerrit-PatchSet: 2
Gerrit-Owner: daniel <dwillmann(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de>
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: lynxis lazus <lynxis(a)fe80.eu>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: merged