lists.osmocom.org
Sign In Sign Up
Manage this list Sign In Sign Up

Keyboard Shortcuts

Thread View

  • j: Next unread message
  • k: Previous unread message
  • j a: Jump to all threads
  • j l: Jump to MailingList overview

gerrit-log

Thread Start a new thread
Download
Threads by month
  • ----- 2026 -----
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2025 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2024 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2023 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2022 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
gerrit-log@lists.osmocom.org

January 2024

  • 1 participants
  • 1559 discussions
[S] Change in osmo-ttcn3-hacks[master]: GTPv2_Templates: Fix tEID field optional tr_PDU_GTP2C_msgtypes()
by pespin 09 Jan '24

09 Jan '24
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
1 0
0 0
[S] Change in osmo-ttcn3-hacks[master]: GTPv2_Emulation: routing improvements: Prioritize response, fallback ...
by pespin 09 Jan '24

09 Jan '24
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
1 0
0 0
[S] Change in osmo-ttcn3-hacks[master]: pgw: Expect EchoResp in CLIENT port of component who sent EchoReq
by pespin 09 Jan '24

09 Jan '24
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
1 0
0 0
[S] Change in libosmocore[master]: gsm: fix osmo_mobile_identity_decode(): init *mi on error
by jolly 09 Jan '24

09 Jan '24
Attention is currently required from: fixeria, pespin. jolly has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmocore/+/35504?usp=email ) Change subject: gsm: fix osmo_mobile_identity_decode(): init *mi on error ...................................................................... Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/35504?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: I1c1503120c6c0e5479d8350fe762470bdb6266b8 Gerrit-Change-Number: 35504 Gerrit-PatchSet: 1 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: jolly <andreas(a)eversberg.eu> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Comment-Date: Tue, 09 Jan 2024 10:59:35 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
[L] Change in osmo-ttcn3-hacks[master]: GTP_Templates: Add templates for some GTPv1C IEs
by fixeria 09 Jan '24

09 Jan '24
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
1 0
0 0
[M] Change in osmo-ttcn3-hacks[master]: NAS_Templates: Introduce template tr_PDU_NAS_EPS_TrackingAreaUpdateAc...
by pespin 09 Jan '24

09 Jan '24
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/35511?usp=email ) Change subject: NAS_Templates: Introduce template tr_PDU_NAS_EPS_TrackingAreaUpdateAccept ...................................................................... NAS_Templates: Introduce template tr_PDU_NAS_EPS_TrackingAreaUpdateAccept Change-Id: Iba19ac8293fecfe0b150155cebe50cbe4d32fe4d --- M library/NAS_Templates.ttcn 1 file changed, 52 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/11/35511/1 diff --git a/library/NAS_Templates.ttcn b/library/NAS_Templates.ttcn index 23637f7..daeaa1c 100644 --- a/library/NAS_Templates.ttcn +++ b/library/NAS_Templates.ttcn @@ -365,6 +365,49 @@ tSC := tSC } +/* 8.2.26 Tracking Area Update Accept */ +template (present) PDU_NAS_EPS +tr_PDU_NAS_EPS_TrackingAreaUpdateAccept := { + protocolDiscriminator := c_EPS_NAS_PD_EMM, + ePS_messages := { + ePS_MobilityManagement := { + pDU_NAS_EPS_TrackingAreaUpdateAccept := { + securityHeaderType := c_EPS_SEC_NONE, + messageType := '01001001'B, + updateResult := { + valueOfUpdateResult := ?, + spare := '0'B + }, + spareHalfOctet := '0000'B, + t3412 := *, + gUTI := *, + tAI_List := *, + ePSBearerContextStatus := *, + locationAreaIdentification := *, + msIdentity := *, + eMMCause := *, + t3402 := *, + t3423 := *, + equivalentPLMNs := *, + emergencyNumberList := *, + ePS_NetworkFeatureSupport := *, + additionalUpdateResult := *, + t3412_Extended := *, + t3324 := *, + extendedDRXParameters := *, + headerCompressionConfigurationStatus := *, + dNCID := *, + sMS_ServiceStatus := *, + non3GPP_NW_ProvidedPolicies := *, + t3448 := *, + networkPolicy := *, + t3447 := *, + extendedEmergencyNumberList := * + } + } + } +} + /* 8.2.28 Tracking Area Update Reject */ template (present) PDU_NAS_EPS tr_PDU_NAS_EPS_TrackingAreaUpdateReject(template (present) EMM_CauseV cause := ?) := { -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/35511?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: Iba19ac8293fecfe0b150155cebe50cbe4d32fe4d Gerrit-Change-Number: 35511 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
[S] Change in osmo-ttcn3-hacks[master]: NAS_Templates: Allow passing old_guti and ptmsi_sig to TAU Req template
by pespin 09 Jan '24

09 Jan '24
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/35510?usp=email ) Change subject: NAS_Templates: Allow passing old_guti and ptmsi_sig to TAU Req template ...................................................................... NAS_Templates: Allow passing old_guti and ptmsi_sig to TAU Req template Change-Id: I5e0204e772edefc49a63b73fc4aad2fed5c14cac --- M library/NAS_Templates.ttcn 1 file changed, 44 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/10/35510/1 diff --git a/library/NAS_Templates.ttcn b/library/NAS_Templates.ttcn index 7652720..23637f7 100644 --- a/library/NAS_Templates.ttcn +++ b/library/NAS_Templates.ttcn @@ -149,6 +149,14 @@ } } +template (value) EPS_MobileIdentityV +ts_NAS_MobileId_GUTI_(template (value) GUTI guti) := { + typeOfIdentity := '110'B, + oddEvenInd_identity := { + guti := guti + } +} + /* 9.9.3.12 EPS mobile identity */ template (value) EPS_MobileIdentityLV ts_EPS_MobileId_IMSI(hexstring imsi) := { @@ -165,6 +173,28 @@ ePS_MobileIdentity := ts_NAS_MobileId_GUTI(mcc_mnc, mmegi, mmec, tmsi) } +template (value) EPS_MobileIdentityLV +ts_EPS_MobileId_GUTI_(template (value) GUTI guti) := { + ePS_MobileIdentity := ts_NAS_MobileId_GUTI_(guti) +} + +/* 9.9.3.26 P-TMSI signature */ +template (value) P_TMSISignatureTV +ts_PTMSI_SignatureTV(template (value) OCT3 ptmsi_sig) := { + elementIdentifier := '19'O, + valueField := ptmsi_sig +} + +/* 9.9.3.45 GUTI Type */ +const BIT1 GUTI_TYPE_NATIVE := '0'B; +const BIT1 GUTI_TYPE_MAPPED := '1'B; +template (value) GUTI_TypeTV +ts_GUTI_TypeTV(template (value) BIT1 guti_type) := { + gUTI_Type := guti_type, + spare := '000'B, + elementIdentifier := '1110'B +} + template (value) PDU_NAS_EPS ts_NAS_EMM_SecurityProtected(BIT4 sec_hdr_t, integer seq_nr, octetstring inner_nas) := { protocolDiscriminator := c_EPS_NAS_PD_EMM, @@ -354,7 +384,9 @@ /* 8.2.29 Tracking Area Update Request */ template (value) PDU_NAS_EPS -ts_PDU_NAS_EPS_TrackingAreaUpdateRequest(EPS_MobileIdentityLV old_guti) := { +ts_PDU_NAS_EPS_TrackingAreaUpdateRequest(template (value) EPS_MobileIdentityLV old_guti, + template (omit) P_TMSISignatureTV old_ptmsi_sig := omit, + template (omit) GUTI_TypeTV old_guti_type := omit) := { protocolDiscriminator := c_EPS_NAS_PD_EMM, ePS_messages := { ePS_MobilityManagement := { @@ -366,7 +398,7 @@ oldGUTI := old_guti, nonCurrentNative_nasKeySetId := omit, gprsCipheringKeySequenceNumber := omit, - old_P_TMSISignature := omit, + old_P_TMSISignature := old_ptmsi_sig, additionalGUTI := omit, nonce := omit, uENetworkCapability := omit, @@ -382,7 +414,7 @@ supportedCodecList := omit, additionalUpdateType := omit, voiceDomainPrefandUEsettings := omit, - oldGUTI_Type := omit, + oldGUTI_Type := old_guti_type, deviceProperties := omit, mS_NetworkFeatureSupport := omit, tMSIBasedNRIContainer := omit, -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/35510?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: I5e0204e772edefc49a63b73fc4aad2fed5c14cac Gerrit-Change-Number: 35510 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
[S] Change in osmo-ttcn3-hacks[master]: S1AP_Emulation: Add port message to reset NAS count values
by pespin 09 Jan '24

09 Jan '24
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
1 0
0 0
[L] Change in osmo-ttcn3-hacks[master]: GTP_Templates: Add templates for some GTPv1C IEs
by pespin 09 Jan '24

09 Jan '24
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/35509?usp=email ) Change subject: GTP_Templates: Add templates for some GTPv1C IEs ...................................................................... GTP_Templates: Add templates for some GTPv1C IEs Change-Id: I84aac34ca40a2707dc9da28e112fd7684e706c8e --- M library/GTP_Templates.ttcn 1 file changed, 324 insertions(+), 45 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/09/35509/1 diff --git a/library/GTP_Templates.ttcn b/library/GTP_Templates.ttcn index 031d9b2..30e42e6 100644 --- a/library/GTP_Templates.ttcn +++ b/library/GTP_Templates.ttcn @@ -162,6 +162,77 @@ ptmsi_Signature := ptmsi_sig } + /* MS Validated - 7.7.10 */ + template (value) MS_Validated ts_MS_Validated(template (value) BIT1 msValidated) := { + type_gtpc := '0D'O, + msValidated := msValidated, + spare := '1111111'B + } + template (present) MS_Validated tr_MS_Validated(template (present) BIT1 msValidated := ?) := { + type_gtpc := '0D'O, + msValidated := msValidated, + spare := '1111111'B + } + function f_tr_MS_Validated(template BIT1 msValidated := *) return template MS_Validated { + if (istemplatekind(msValidated, "omit")) { + return omit; + } else if (istemplatekind(msValidated, "*")) { + return *; + } else { + return tr_MS_Validated(msValidated); + } + } + private function f_ts_MS_Validated(template (omit) BIT1 msValidated) + return template (omit) MS_Validated { + if (istemplatekind(msValidated, "omit")) { + return omit; + } + return ts_MS_Validated(msValidated); + } + + /* 7.7.13 TEI Data I */ + template (value) TeidDataI ts_TeidDataI(template (value) OCT4 teid) := { + type_gtpc := '10'O, + teidDataI := teid + } + template (present) TeidDataI tr_TeidDataI(template (present) OCT4 teid := ?) := { + type_gtpc := '10'O, + teidDataI := teid + } + + /* 7.7.14 TEI Control Plane */ + template (value) TeidControlPlane ts_TEIC(template (value) OCT4 teic) := { + type_gtpc := '11'O, + teidControlPlane := teic + } + template (present) TeidControlPlane tr_TEIC(template (present) OCT4 teic := ?) := { + type_gtpc := '11'O, + teidControlPlane := teic + } + private function f_ts_TEIC(template (omit) OCT4 teic) + return template (omit) TeidControlPlane { + if (istemplatekind(teic, "omit")) { + return omit; + } + return ts_TEIC(teic); + } + + /* 7.7.15 Tunnel Endpoint Identifier Data II */ + template (value) TeidDataII ts_TeidDataII(template (value) BIT4 nsapi, + template (value) OCT4 teid) := { + type_gtpc := '12'O, + nsapi := nsapi, + unused := '0000'B, + teidDataII := teid + } + template (present) TeidDataII tr_TeidDataII(template (present) BIT4 nsapi := ?, + template (present) OCT4 teid := ?) := { + type_gtpc := '12'O, + nsapi := nsapi, + unused := '0000'B, + teidDataII := teid + } + /* IMEI(SV) IE TS 29.060 7.7.53 */ template (value) IMEISV_gtpc ts_IMEISV(template (value) OCT8 imeisv) := { type_gtpc := '9A'O, @@ -236,6 +307,82 @@ chargingChar := chargingChar } + /* 7.7.28 MM Context */ + template (value) MM_Context ts_MM_ContextUMTS(template (value) OCT16 ck, + template (value) OCT16 ik) := { + type_gtpc := '81'O, + context := { + mmcontUMTS := { + lengthf := 0, /* overwritten */ + ksi := '001'B, + usedGPRSIntegrityAlgorithm := '000'B, + ugipai := '1'B, /* Integrity Protection not required */ + gupii := '1'B, /* Ignore "Used GPRS integrity protection algorithm" field" */ + spare1 := '000'B, + noofVectors := 0, /* TODO: fill quintpuplets*/ + security := '01'B, /* UMTS key and quintuplets */ + ck := ck, + ik := ik, + quintupletlength := 0, /* overwritten */ + quintuplet := ''O, + drx_par := '0000'O, + msNetW_cap_length := 0, /* overwritten */ + msNetw_cap := omit, + containerLength := 0, /* overwritten */ + container := omit, + access_restriction_data_length := 0, /* overwritten */ + access_restriction_data := omit + } + } + } + + /* 7.7.29 PDP Context */ + template (value) PDP_Context_GTPC ts_PDP_Context_GTPC(template (value) octetstring pdp_addr, + template (value) octetstring ggsn_gsn_addr, + template (value) octetstring apn, + template (value) OCT4 ggsn_teic := '12345678'O, + template (value) OCT4 ggsn_teid := '87654321'O) := { + type_gtpc := '82'O, + lengthf := 0, /* overwritten */ + nsapi := '0101'B, + order := '0'B, + asi := '0'B, + vaa := '0'B, + ea := '0'B, + sapi := '0011'B, + spare1 := '0000'B, + qos_subLength := 0, /* overwritten */ + qos_sub := ts_QosProfileValueDefault, + qos_reqLength := 0, /* overwritten */ + qos_req := ts_QosProfileValueDefault, + qos_negLength := 0, /* overwritten */ + qos_neg := ts_QosProfileValueDefault, + snd := '0000'O, + snu := '0000'O, + sendNPDUnum := '00'O, + receiveNPDUnum := '00'O, + uteidControlPlane := ggsn_teic, + uteidData1 := ggsn_teid, + pdpcontext := '00'O, + pdp_typeorg := '0001'B, /* IETF */ + spare2 := '1111'B, + pdp_typenum := '21'O, /* IETF IPV4 */ + pdp_addressLength := 0, /* overwritten */ + pdp_address := pdp_addr, + ggsn_addressControlPlaneLength := 0, /* overwritten */ + ggsn_addressControlPlane := ggsn_gsn_addr, + ggsn_addressUserPlaneLength := 0, /* overwritten */ + ggsn_addressUserPlane := ggsn_gsn_addr, + apnLength := 0, /* overwritten */ + apn := apn, + transactionId := '0001'B, + spare3 := '0000'B, + transactionID_cont := '00'O, + pdp_typenum2 := omit, + pdp_addresslength2 := omit, + pdp_Address2 := omit + } + /* template matching reception of GTP-C unit-data */ template (present) Gtp1cUnitdata tr_GTPC_MsgType(template (present) GtpPeer peer, @@ -398,6 +545,11 @@ lengthf := lengthof(ip_addr), addressf := ip_addr } + template (present) GSN_Address_GTPC tr_GsnAddr(template (present) octetstring ip_addr := ?) := { + type_gtpc := '85'O, + lengthf := ?, + addressf := ip_addr + } template (value) MSISDN ts_Msisdn(octetstring msisdn) := { type_gtpc := '86'O, @@ -405,39 +557,46 @@ msisdn := msisdn } + template (value) QoSV_GTPC ts_QosValueDefault := { + reliabilityClass := '011'B, + delayClass := '001'B, + spare1 := '00'B, + precedenceClass := '010'B, + spare2 := '0'B, + peakThroughput := '1001'B, + meanThroughput := '11111'B, + spare3 := '000'B, + deliverErroneusSDU := '010'B, /* Erroneus SDU are delivered */ + deliveryOrder := '10'B, /* Without delivery order */ + trafficClass := '100'B, /* Background */ + maxSDUSize := '96'O, /* 1500 octets */ + maxBitrateUplink := 'FE'O, /* 8640, continues in extended octet */ + maxBitrateDownlink := 'FE'O, /* 8640, continues in extended octet */ + sduErrorRatio := '0100'B, /* 1x10^-4 */ + residualBER := '0101'B, /* 1x10^-3 */ + trafficHandlingPriority := '01'B, /* prio 1 */ + transferDelay := '000001'B, /* 10 ms */ + guaranteedBitRateUplink := 'FE'O, /* 8640, continues in extended octet */ + guaranteedBitRateDownlink := 'FE'O, /* 8640, continues in extended octet */ + sourceStatisticsDescriptor := '0000'B, /* unknown */ + signallingIndication := '0'B, /* Not optimized */ + spare4 := '000'B, + maxBitrateDownlinkExt := '5B'O, /* 33 mbps */ + guaranteedBitRateDownlinkExt := '5B'O, /* 33 mbps */ + maxBitrateUplinkExt := '6e'O, /* 52 mbps */ + guaranteedBitRateUplinkExt := '6e'O /* 52 mbps */ + } + + template (value) QualityOfServiceProfile_Value ts_QosProfileValueDefault := { + allocRetensionPrio := '00'O, + qos_ProfileValue := ts_QosValueDefault + } + template (value) QualityOfServiceProfile ts_QosDefault := { type_gtpc := '87'O, lengthf := 17, allocRetensionPrio := '00'O, - qos_ProfileValue := { - reliabilityClass := '011'B, - delayClass := '001'B, - spare1 := '00'B, - precedenceClass := '010'B, - spare2 := '0'B, - peakThroughput := '1001'B, - meanThroughput := '11111'B, - spare3 := '000'B, - deliverErroneusSDU := '010'B, /* Erroneus SDU are delivered */ - deliveryOrder := '10'B, /* Without delivery order */ - trafficClass := '100'B, /* Background */ - maxSDUSize := '96'O, /* 1500 octets */ - maxBitrateUplink := 'FE'O, /* 8640, continues in extended octet */ - maxBitrateDownlink := 'FE'O, /* 8640, continues in extended octet */ - sduErrorRatio := '0100'B, /* 1x10^-4 */ - residualBER := '0101'B, /* 1x10^-3 */ - trafficHandlingPriority := '01'B, /* prio 1 */ - transferDelay := '000001'B, /* 10 ms */ - guaranteedBitRateUplink := 'FE'O, /* 8640, continues in extended octet */ - guaranteedBitRateDownlink := 'FE'O, /* 8640, continues in extended octet */ - sourceStatisticsDescriptor := '0000'B, /* unknown */ - signallingIndication := '0'B, /* Not optimized */ - spare4 := '000'B, - maxBitrateDownlinkExt := '5B'O, /* 33 mbps */ - guaranteedBitRateDownlinkExt := '5B'O, /* 33 mbps */ - maxBitrateUplinkExt := '6e'O, /* 52 mbps */ - guaranteedBitRateUplinkExt := '6e'O /* 52 mbps */ - } + qos_ProfileValue := ts_QosValueDefault } template (value) IMSI_gtpc ts_Imsi(hexstring digits) := { @@ -469,18 +628,41 @@ } } - function f_ts_RATType(template (omit) OCT1 ratType := omit) return template (omit) RATType { - var template (omit) RATType rt; - if (istemplatekind(ratType, "omit")) { - rt := omit; + /* 7.7.50 RAT Type */ + type enumerated GTP_RATType { + GTP_RAT_TYPE_RESERVED (0), + GTP_RAT_TYPE_UTRAN (1), + GTP_RAT_TYPE_GERAN (2), + GTP_RAT_TYPE_WLAN (3), + GTP_RAT_TYPE_GAN (4), + GTP_RAT_TYPE_HSPA_E (5), + GTP_RAT_TYPE_EUTRAN (6) + }; + template (value) RATType ts_RATType(template (value) OCT1 rat_type) := { + type_gtpc := '97'O, + lengthf := 1, + ratTypeValue := rat_type + } + function f_ts_RATType(template (omit) OCT1 rat_type := omit) return template (omit) RATType { + if (istemplatekind(rat_type, "omit")) { + return omit; } else { - rt := { - type_gtpc := '97'O, - lengthf := 1, - ratTypeValue := ratType - }; + return ts_RATType(rat_type); } - return rt; + } + template (present) RATType tr_RATType(template (present) OCT1 rat_type) := { + type_gtpc := '97'O, + lengthf := 1, + ratTypeValue := rat_type + } + function f_tr_RATType(template OCT1 rat_type := *) return template RATType { + if (istemplatekind(rat_type, "omit")) { + return omit; + } else if (istemplatekind(rat_type, "*")) { + return *; + } else { + return tr_RATType(rat_type); + } } template (value) RoutingAreaIdentity ts_RoutingAreaIdentity(template (value) hexstring mcc_digits, @@ -947,11 +1129,44 @@ } /* SGSN Context Request - 7.5.3 */ + template (present) GTPC_PDUs tr_SGSNContextReqPDU(template (present) RoutingAreaIdentity rai := ?, + template (present) OCT4 teic := ?, + template (present) octetstring sgsn_addr_control := ?, + template hexstring imsi := *, + template BIT1 msValidated := *, + template TLLI tlli := *, + template PacketTMSI ptmsi := *, + template PTMSI_Signature ptmsi_sig := *, + template OCT1 rat_type := *) := { + sgsn_ContextRequest := { + imsi := f_tr_Imsi(imsi), + routingAreaIdentity := rai, + tlli := tlli, + packetTMSI := ptmsi, + ptmsi_Signature := ptmsi_sig, + ms_Validated := f_tr_MS_Validated(msValidated), + teidControlPlane := { + type_gtpc := '11'O, + teidControlPlane := teic + }, + sgsn_addr_controlPlane := tr_GsnAddr(sgsn_addr_control), + alternative_sgsn_addr_controlPlane := *, + sGSN_Number := *, + ratType := f_tr_RATType(rat_type), + hopCounter := *, + private_extension_gtpc := * + } + } + template (present) Gtp1cUnitdata tr_GTPC_SGSNContextReq(template (present) GtpPeer peer, + template (present) GTPC_PDUs SGSNContextReqPDU) := { + peer := peer, + gtpc := tr_GTP1C_PDU(sgsnContextRequest, '00000000'O, SGSNContextReqPDU) + } template (value) GTPC_PDUs ts_SGSNContextReqPDU(template (value) RoutingAreaIdentity rai, template (value) OCT4 teic, template (value) octetstring sgsn_addr_control, template (omit) hexstring imsi := omit, - template (value) BIT1 msValidated := '0'B, + template (omit) BIT1 msValidated := '0'B, template (omit) TLLI tlli := omit, template (omit) PacketTMSI ptmsi := omit, template (omit) PTMSI_Signature ptmsi_sig := omit, @@ -962,11 +1177,7 @@ tlli := tlli, packetTMSI := ptmsi, ptmsi_Signature := ptmsi_sig, - ms_Validated := { - type_gtpc := '0D'O, - msValidated := msValidated, - spare := '1111111'B - }, + ms_Validated := f_ts_MS_Validated(msValidated), teidControlPlane := { type_gtpc := '11'O, teidControlPlane := teic @@ -1025,7 +1236,66 @@ template (present) GTPC_PDUs SGSNContextRespPDU := ?) := tr_GTPC_MsgType(peer, sgsnContextResponse, teid, SGSNContextRespPDU); + template (value) GTPC_PDUs ts_SGSNContextRespPDU(template (value) GTP_Cause cause, + template (omit) hexstring imsi := omit, + template (omit) OCT4 teic := omit, + template (omit) octetstring sgsn_addr_control := omit, + template (omit) MM_Context mm_context := omit, + template (omit) PDP_Context_GTPC_List pdp_ctx_list := omit) := { + sgsn_ContextResponse := { + cause := ts_Cause_gtpc(cause), + imsi := f_ts_Imsi(imsi), + teidControlPlane := f_ts_TEIC(teic), + rabContext := omit, + radioPrioritySMS := omit, + radioPriority := omit, + packetFlowID := omit, + charging_char := omit, + mm_Context := mm_context, + pdp_Context := pdp_ctx_list, + sgsn_addr_controlPlane := ts_GsnAddr(sgsn_addr_control), + pdpContextPriorization := omit, + radioPriority_LCS := omit, + mBMS_UE_Context := omit, + subscribedRFSP_Index := omit, + rFSP_IndexInUse := omit, + colocatedGGSN_PGW_FQDN := omit, + evolvedAllocationRetentionPriorityII := omit, + extendedCommonFlags := omit, + ue_network_capability := omit, + ue_ambr := omit, + apn_ambr_nsapi := omit, + signallingPriorityIndication_nsapi := omit, + higher_bitrates_than_16mbps_flag := omit, + selectionMode_nsapi := omit, + localHomeNetworkID_nsapi := omit, + uE_UsageType := omit, + extendedCommonFlagsII := omit, + private_extension_gtpc := omit + } + } + template (value) Gtp1cUnitdata ts_GTPC_SGSNContextResp(GtpPeer peer, OCT4 teid, uint16_t seq, + template (value) GTPC_PDUs SGSNContextRespPDU) := { + peer := peer, + gtpc := ts_GTP1C_PDU(sgsnContextResponse, teid, valueof(SGSNContextRespPDU), seq) + } + + /* SGSN Context Acknowledge - 7.5.5 */ + template (present) GTPC_PDUs tr_SGSNContextAckPDU(template (present) GTP_Cause cause := ?) := { + sgsn_ContextAcknowledge := { + cause := tr_Cause_gtpc(cause), + teidDataII := *, + sgsn_AddressForUserTraffic := *, + sgsn_Number := *, + nodeIdentifier := *, + private_extension_gtpc := * + } + } + template (present) Gtp1cUnitdata tr_GTPC_SGSNContextAck(template (present) GtpPeer peer := ?, + template (present) OCT4 teid := ?, + template (present) GTPC_PDUs SGSNContextAckPDU := ?) + := tr_GTPC_MsgType(peer, sgsnContextAcknowledge, teid, SGSNContextAckPDU); template (value) GTPC_PDUs ts_SGSNContextAckPDU(template (value) GTP_Cause cause := GTP_CAUSE_REQUEST_ACCEPTED) := { sgsn_ContextAcknowledge := { cause := ts_Cause_gtpc(cause), -- 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-MessageType: newchange
1 0
0 0
[M] Change in osmo-ttcn3-hacks[master]: WIP: mme: 2g->4g
by pespin 09 Jan '24

09 Jan '24
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
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 121
  • 122
  • 123
  • 124
  • 125
  • 126
  • 127
  • ...
  • 156
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.