pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/40444?usp=email )
Change subject: 5gc: Implement UE registration ......................................................................
5gc: Implement UE registration
deps/Makefile nas.git is updated with new version containing tons of fixes regarding LENGTHTO() in most IEs.
Change-Id: Ida0e5268c3109a25ecdd03c4f17d5ff8bce8e567 --- M 5gc/C5G_Tests.ttcn M deps/Makefile M library/NGAP_Emulation.ttcn M library/NG_CryptoFunctions.ttcn M library/NG_NAS_Osmo_Templates.ttcn 5 files changed, 443 insertions(+), 60 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/44/40444/1
diff --git a/5gc/C5G_Tests.ttcn b/5gc/C5G_Tests.ttcn index a27b6cb..85fc599 100644 --- a/5gc/C5G_Tests.ttcn +++ b/5gc/C5G_Tests.ttcn @@ -58,7 +58,7 @@ integer mp_local_ngap_port := 50000; GsmMcc mp_mcc := '999'H; GsmMnc mp_mnc := '70'H; - hexstring mp_imsi := '999700000000000'H; + HEX15n mp_imsi := '999700000000000'H; octetstring mp_usim_key := '762a2206fe0b4151ace403c86a11e479'O; octetstring mp_usim_opc := '3c6e0b8a9c15224a8228b9a98ca1531d'O; uint24_t mp_tac := 1; @@ -73,7 +73,8 @@
/* parameters of emulated UE */ type record UeParams { - hexstring imsi, + HEX15n imsi, + HEX16n imeisv, octetstring usim_key, octetstring usim_opc, charstring ue_ip, @@ -85,6 +86,7 @@ template (value) UeParams ts_UeParams(integer imsi_suffix) := { imsi := f_concat_pad(lengthof(mp_imsi), substr(mp_imsi, 0, lengthof(mp_imsi) - 6), imsi_suffix), + imeisv := f_rnd_imeisv(), usim_key := mp_usim_key, usim_opc := mp_usim_opc, ue_ip := "192.168.123.50", @@ -245,6 +247,24 @@ return plmn_id & '21430001'O & imsi_suffix; }
+private function f_UE_SecurityCapability() runs on ConnHdlr return NG_UE_SecurityCapability { + var template (value) NG_UE_SecurityCapability ue_sec_cap; + ue_sec_cap := cs_NG_UE_SecurityCapabilityTLV(ngeaCap := '80'O, /* ONLY NEA0 (no encryption) for now */ + ngiaCap := '40'O /* ONLY NIA1 supported */); + return valueof(ue_sec_cap); +} + +private function f_ULI() runs on ConnHdlr return UserLocationInformation { + var template (value) UserLocationInformation p_ueLocInf + p_ueLocInf := m_uPTransportLayerInformation_userLocationInformationNR( + m_userLocationInformationNR( + g_pars.ngran_pars[g_pars.c5g_idx].cell_identity.nR_CGI, + ts_ngran_NGAP_TAI(g_pars.ngran_pars[g_pars.c5g_idx]) + + )); + return valueof(p_ueLocInf); +} + friend function f_ngap_setup(integer idx := 0, template (omit) NGAP_IEs.Cause cause := omit) runs on MTC_CT { var template (present) NGAP_IEs.Cause exp_cause := ?; var boolean exp_fail := false; @@ -375,35 +395,45 @@ }; NGAP.send(cfg);
- /* TODO: Tx Security Mode Complete */ + /* TODO: Add Message container IE below: "ERROR: No NAS Message Container in Security mode complete message" */ + var template (value) NG_NAS_UL_Message_Type nas_ul_msg; + var NAS_PDU nas_pdu; + nas_ul_msg := cs_NG_REGISTRATION_REQUEST(cs_RegistrationType(tsc_NG_RegistrationInitial, '1'B), + g_pars.kset_id.nasKeySetId, + g_pars.kset_id.tsc, + cs_NG_MobileIdentitySUCI('0000'B /* Type IMSI */, + f_SUCI_IMSI()), + p_UESecurityCap := f_UE_SecurityCapability()); + nas_pdu := enc_NG_NAS_UL_Message_Type(valueof(nas_ul_msg)); + NGAP.send(cs_NG_SECURITY_MODE_COMPLETE(cs_NG_MobileIdentityTLV_IMEISV(hex2oct(g_pars.ue_pars.imeisv)), + cs_ReplayedNASMessageContainerTLV(nas_pdu))); + } +} + +private altstep as_ngap_handle_configuration_update() runs on ConnHdlr { + var NG_NAS_DL_Message_Type rx_nas; + + [] NGAP.receive(cr_NG_CONFIGURATION_UPDATE_COMMAND) -> value rx_nas { + NGAP.send(cs_NG_CONFIGURATION_UPDATE_COMPLETE); } }
private function f_register() runs on ConnHdlr { - var template (value) UserLocationInformation p_ueLocInf; - var template (value) NG_UE_SecurityCapability ue_sec_cap; var template (value) NGAP_PDU tx_pdu; var template (value) NG_NAS_UL_Message_Type nas_ul_msg; var NAS_PDU nas_pdu; + var NG_NAS_DL_Message_Type rx_nas;
- p_ueLocInf := m_uPTransportLayerInformation_userLocationInformationNR( - m_userLocationInformationNR( - g_pars.ngran_pars[g_pars.c5g_idx].cell_identity.nR_CGI, - ts_ngran_NGAP_TAI(g_pars.ngran_pars[g_pars.c5g_idx]) - - )); - ue_sec_cap := cs_NG_UE_SecurityCapabilityTLV(ngeaCap := '80'O, /* ONLY NEA0 (no encryption) for now */ - ngiaCap := '40'O /* ONLY NIA1 supported */); nas_ul_msg := cs_NG_REGISTRATION_REQUEST(cs_RegistrationType(tsc_NG_RegistrationInitial, '1'B), g_pars.kset_id.nasKeySetId, g_pars.kset_id.tsc, cs_NG_MobileIdentitySUCI('0000'B /* Type IMSI */, f_SUCI_IMSI()), - p_UESecurityCap := ue_sec_cap); + p_UESecurityCap := f_UE_SecurityCapability()); nas_pdu := enc_NG_NAS_UL_Message_Type(valueof(nas_ul_msg)); tx_pdu := m_ngap_initMsg(m_n2_initialUeMessage(g_pars.c5g_idx, nas_pdu, /* Registration request */ - p_ueLocInf, + f_ULI(), mo_Signalling)); NGAP.send(tx_pdu);
@@ -420,7 +450,12 @@ as_ngap_handle_auth(); as_ngap_handle_sec_mode();
- /* TODO: handle Auth, SecurityModeCommand, InitialContextSetup, PDUSessionresource, */ + NGAP.receive(cr_NG_REGISTRATION_ACCEPT) -> value rx_nas; + NGAP.send(cs_NG_REGISTRATION_COMPLETE); + + as_ngap_handle_configuration_update(); + + /* TODO: PDU session establishment request */ f_sleep(5.0); }
diff --git a/deps/Makefile b/deps/Makefile index e841e35..0792c09 100644 --- a/deps/Makefile +++ b/deps/Makefile @@ -85,7 +85,7 @@ # Do not put references to branches here, except for local testing: this breaks the caching # logic of docker containers, which only invalidate their cached ttcn3 dependencies if this # file changed. -nas_commit= 3d14f387cc0d6f09cbbe1cea4920ebcaf1660bcf +nas_commit= eff069b772a53e16773638f07599e7936ffcdd9a titan.Libraries.TCCUsefulFunctions_commit= R.35.B-6-gb3687da titan.ProtocolEmulations.M3UA_commit= b58f92046e48a7b1ed531e243a2319ebca53bf4c titan.ProtocolEmulations.SCCP_commit= 750a3e836831e58eae59d4757ef5d0c759f9ca5d diff --git a/library/NGAP_Emulation.ttcn b/library/NGAP_Emulation.ttcn index 178d6cd..4cb2f05 100644 --- a/library/NGAP_Emulation.ttcn +++ b/library/NGAP_Emulation.ttcn @@ -512,7 +512,7 @@ [] NGAP_CLIENT.receive(NG_NAS_UL_Message_Type:?) -> value ul_nas_msg sender vc_conn { var integer assoc_id := f_assoc_id_by_comp(vc_conn); var AssociationData ad := NGapAssociationTable[assoc_id]; - //ul_nas_msg := f_nas_encaps(NGapAssociationTable[assoc_id].nus, ul_nas_msg); + ul_nas_msg := f_NG_NAS_encaps_ul(NGapAssociationTable[assoc_id].nus, ul_nas_msg); var NAS_PDU nas_enc := enc_NG_NAS_UL_Message_Type(ul_nas_msg); NGAP.send(t_NGAP_Send(g_ngap_conn_id, m_ngap_initMsg( diff --git a/library/NG_CryptoFunctions.ttcn b/library/NG_CryptoFunctions.ttcn index 63755f2..b16029e 100644 --- a/library/NG_CryptoFunctions.ttcn +++ b/library/NG_CryptoFunctions.ttcn @@ -121,6 +121,19 @@ } }
+function f_NG_NAS_encrypt(NG_NAS_ALG_ENC alg, octetstring k_nas_enc, integer count, + integer bearer, boolean is_downlink, inout octetstring data) { + select (alg) { + case (NG_NAS_ALG_ENC_NEA0) { } + case (NG_NAS_ALG_ENC_NEA1) { + f_snow_3g_f8(k_nas_enc, count, bearer, is_downlink, data); + } + case else { + Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, log2str("Unsupported EEA: ", alg)); + } + } +} + /********************************************************************************* * high-level API (full NAS encapsulation/decapsulation) *********************************************************************************/ @@ -236,27 +249,29 @@ nus.rx_count := nus.rx_count + 1; return dec_NG_NAS_DL_Message_Type(secp_nas.plainNASMessage); } -// case ('0010'B) { /* IP + ciphered */ -// nus.new_ctx := false; -// if (not f_NG_NAS_check_ip(nus, secp_nas)) { -// Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, "f_NG_NAS_check_ip() failed"); -// } -// nus.rx_count := nus.rx_count + 1; -// f_nas_encrypt(nus.alg_enc, nus.k_nas_enc, nus.rx_count, 0, -// f_rx_is_downlink(nus), secp_nas.nAS_Message); -// return dec_NG_NAS_DL_Message_Type(secp_nas.plainNASMessage); -// } -// case ('0100'B) { /* IP + ciphered; new EPS security context */ -// nus.new_ctx := true; -// nus.rx_count := 0; -// if (not f_NG_NAS_check_ip(nus, secp_nas)) { -// Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, "f_NG_NAS_check_ip() failed"); -// } -// f_nas_encrypt(nus.alg_enc, nus.k_nas_enc, nus.rx_count, 0, -// f_rx_is_downlink(nus), secp_nas.nAS_Message); -// nus.rx_count := nus.rx_count + 1; -// return dec_NG_NAS_DL_Message_Type(secp_nas.plainNASMessage); -// } + case ('0010'B) { /* IP + ciphered */ + nus.new_ctx := false; + if (not f_NG_NAS_check_ip(nus, secp_nas)) { + Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, "f_NG_NAS_check_ip() failed"); + } + nus.rx_count := nus.rx_count + 1; + f_NG_NAS_encrypt(nus.alg_enc, nus.k_nas_enc, nus.rx_count, + bit2int(tsc_NG_RegResult_3GPP), + f_rx_is_downlink(nus), secp_nas.plainNASMessage); + return dec_NG_NAS_DL_Message_Type(secp_nas.plainNASMessage); + } + case ('0100'B) { /* IP + ciphered; new EPS security context */ + nus.new_ctx := true; + nus.rx_count := 0; + if (not f_NG_NAS_check_ip(nus, secp_nas)) { + Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, "f_NG_NAS_check_ip() failed"); + } + f_NG_NAS_encrypt(nus.alg_enc, nus.k_nas_enc, nus.rx_count, + bit2int(tsc_NG_RegResult_3GPP), + f_rx_is_downlink(nus), secp_nas.plainNASMessage); + nus.rx_count := nus.rx_count + 1; + return dec_NG_NAS_DL_Message_Type(secp_nas.plainNASMessage); + } //case ('0101'B) { /* IP + partially ciphered */ } //case ('1100'B) { /* Service Request Message */ } case else { @@ -266,4 +281,63 @@ } }
+private function f_NG_NAS_determine_sec_hdr_t(boolean encrypt, boolean authenticate, boolean new_ctx) +return BIT4 +{ + if (encrypt == false and authenticate == false and new_ctx == false) { + return '0000'B; + } else if (encrypt == false and authenticate == true and new_ctx == false) { + return '0001'B; + } else if (encrypt == false and authenticate == true and new_ctx == true) { + return '0011'B; + } else if (encrypt == true and authenticate == true and new_ctx == true) { + return '0100'B; + } else if (encrypt == true and authenticate == true and new_ctx == false) { + return '0010'B; + } else { + Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, "Invalid sec_hdr conditions"); + return '0000'B; /* never reached, make compiler happy */ + } +} + +/* encapsulate a NAS message (encrypt, MAC) */ +function f_NG_NAS_encaps_ul(inout NG_NAS_UE_State nus, NG_NAS_UL_Message_Type nas_in) +return NG_NAS_UL_Message_Type +{ + var BIT4 sec_hdr_t; + var OCT4 mac; + var NG_NAS_UL_Message_Type nas_out; + + if (nus.use_enc == false and nus.use_int == false) { + return nas_in; + } + + if (nus.new_ctx) { + nus.tx_count := 0; + } + + var octetstring nas_enc := enc_NG_NAS_UL_Message_Type(nas_in) + if (nus.use_enc) { + f_NG_NAS_encrypt(nus.alg_enc, nus.k_nas_enc, nus.tx_count, + bit2int(tsc_NG_RegResult_3GPP), + f_tx_is_downlink(nus), nas_enc); + } + + if (not nus.use_int) { + Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, "Not supported"); + } + + sec_hdr_t := f_NG_NAS_determine_sec_hdr_t(nus.use_enc, nus.use_int, nus.new_ctx); + mac := f_NG_NAS_mac_calc(nus.alg_int, nus.k_nas_int, nus.tx_count, + bit2int(tsc_NG_RegResult_3GPP), + f_tx_is_downlink(nus), '00'O & nas_enc); + nas_out := valueof(cs_NG_SECURITY_PROTECTED_NAS_MESSAGE(tsc_EPD_GMM, + sec_hdr_t, + mac, + int2oct(nus.tx_count, 1), + nas_enc)); + + return nas_out; +} + } diff --git a/library/NG_NAS_Osmo_Templates.ttcn b/library/NG_NAS_Osmo_Templates.ttcn index c6c242f..4200e7b 100644 --- a/library/NG_NAS_Osmo_Templates.ttcn +++ b/library/NG_NAS_Osmo_Templates.ttcn @@ -19,18 +19,6 @@ import from NG_NAS_MsgContainers all;
/* 24.501 cl. 9.11.3.54 */ -private function f_cs_NG_UE_SecurityCapability_length(template (omit) O1_Type eeaCap := omit, - template (omit) O1_Type eiaCap := omit) -return integer { - var integer len := 2; - if (isvalue(eeaCap)) { - len := len + 1; - } - if (isvalue(eiaCap)) { - len := len + 1; - } - return len; -} template (value) NG_UE_SecurityCapability cs_NG_UE_SecurityCapabilityTLV(template (value) O1_Type ngeaCap := 'f0'O, template (value) O1_Type ngiaCap := '70'O, @@ -38,7 +26,7 @@ template (omit) O1_Type eiaCap := omit) := { iei := '2E'O, - iel := int2oct(f_cs_NG_UE_SecurityCapability_length(eeaCap, eiaCap), 1), + iel := '00'O, /* overwritten by RAW encoder */ ngeaCap := ngeaCap, ngiaCap := ngiaCap, eeaCap := eeaCap, @@ -61,21 +49,57 @@ spare := * };
+template (value) NG_MobileIdentity +cs_NG_MobileIdentityTLV_IMEISV(template (value) octetstring p_OtherDigits) := +{ + iei := '77'O, + iel := '0000'O, /* overwritten by RAW encoder */ + idDigit1 := '0000'B, + oddEvenInd := '0'B, + typeOfId := tsc_IdType_NG_IMEISV, + otherDigits := p_OtherDigits +}; + template (value) AuthenticationResponseParameter cs_AuthenticationResponseParameter(template (value) B32_128_Type p_ExpectedRES) := { iei := '2D'O, - iel := int2oct(lengthof(bit2oct(valueof(p_ExpectedRES))), 1), + iel := '00'O, /* overwritten by RAW encoder */ res := p_ExpectedRES -} +};
- template (value) AuthenticationFailureParameter cs_AuthFailParam(template (value) B112_Type auts) := - { - iei := '30'O, // version 110, and value used in GMM - iel := '0E'O, - auts := auts - }; +template (value) AuthenticationFailureParameter cs_AuthFailParam(template (value) B112_Type auts) := +{ + iei := '30'O, // version 110, and value used in GMM + iel := '0E'O, + auts := auts +};
+/* 24.301 cl. 9.9.3.51*/ +template (value) ReplayedNASMessageContainer +cs_ReplayedNASMessageContainerTLV(template (value) octetstring val) := +{ + iei := '71'O, + iel := '0000'O,//int2oct(lengthof(val), 2), + replayedNASMsgContainerValue := val +}; + +/* 24.501 cl. 9.11.3.6 */ +template (present) RegistrationResult +cr_RegistrationResultLV(template (present) B3_Type p_Result := ?, + template (present) B1_Type p_SMS := ?, + template (present) B1_Type p_EmergencyRegistered := ?, + template (present) B1_Type p_NssaaPerformed := ?, + template (present) B1_Type p_DisasterRoamingResult := ?) := +{ + iel := '01'O, + spare := tsc_Spare1, + disasterRoamingResult := p_DisasterRoamingResult, /* Sep22 @sic R5s221179 Baseline Moving sic@ */ + emergencyRegistered := p_EmergencyRegistered, /* Sep20 @sic R5s201387 Baseline Moving sic@ */ + nssaaPerformed := p_NssaaPerformed, /* Sep20 @sic R5s201387 Baseline Moving sic@ */ + smsAllowed := p_SMS, + resultValue := p_Result +};
/* 24.501 cl. 8.2.1 */ template (present) NG_NAS_DL_Message_Type @@ -128,7 +152,221 @@ authFailureParam := p_AuthFailParam /* cl. 9.11.3.12 O TLV 16 IEI=30 */ } } +/* 24.501 cl. 8.2.7 */ +template (present) NG_NAS_DL_Message_Type +cr_NG_REGISTRATION_ACCEPT(template (present) RegistrationResult p_RegistrationResult := cr_RegistrationResultLV, + template NG_MobileIdentity p_GUTI := *, + template PLMN_List p_EPLMNs := *, + template NG_TrackingAreaIdList p_TAIList := *, + template NSSAI p_AllowedNSSAI := *, + template RejectedNSSAI p_RejectedNSSAI := *, + template NSSAI p_ConfiguredNSSAI := *, + template NG_NetworkFeatureSupport p_NwkFeatureSupport := *, + template PDU_SessionStatus p_PDU_SessionStatus := *, + template PDU_SessionReactivationResult p_PDU_SessionReactResult := *, + template PDU_SessionReactivationError p_PDU_SessionReactError := *, + template LADN_Info p_LADN_Info := *, + template MICO_Ind p_MICO_Ind := *, + template NetworkSlicingInd p_NetworkSlicingInd := *, + template ServiceAreaIdList p_SAIList := *, + template GPRS_Timer3 p_T3512 := *, + template GPRS_Timer2 p_Non3GPPDereg := *, + template GPRS_Timer2 p_T3502 := *, + template EmergNumList p_EmergNumList := *, + template ExtdEmergNumList p_ExtdEmergNumList := *, + template SORTransparentContainer p_SOR := *, + template EAP_Message p_EAP := *, + template InclusionModeNSSAI p_InclusionModeNSSAI := *, + template OperatorAccessCatDefinitions p_AccessCatDefinition := *, + template NG_DRXparameter p_NG_DRXparameter := *, + template Non3GPP_NW_ProvidedPolicies p_Non3GPP_NW_ProvidedPolicies := *, + template EPS_BearerContextStatus p_EPS_BearerContextStatus := *, + template ExtdDRXParams p_NegotiatedExtdDRXParams := *, + template GPRS_Timer3 p_T3447 := *, + template GPRS_Timer3 p_T3448 := *, + template GPRS_Timer3 p_T3324 := *, + template UERadioCapId p_UERadioCapId := *, + template UERadioCapIdDeletion p_UERadioCapIdDeletion := *, + template NSSAI p_PendingNSSAI := *, + template NG_CipheringKeyData p_CipheringKeyData := *, + template CAGInfoList p_CAGInfoList := *, + template TruncatedS_TMSIConfig p_TruncatedS_TMSIConfig := *, + template WUSAssistInfo p_WUSAssistInfo := *, + template NB_N1ModeDRXParams p_NB_N1ModeDRXParams := *, + template ExtdRejectedNSSAI p_ExtdRejectedNSSAI := *, + template ServiceLvlAAContainer p_ServiceLvlAA := *, + template PEIPS_AssistInfo p_NegotiatedPEIPS_AssistInfo := *, + template NG_AddReqResult p_AddRequestResult := *, + template NSSRG_Info p_NssrgInfo := *, + template RegistrationWaitRange p_DisasterRoamingWaitRange := *, + template RegistrationWaitRange p_DisasterReturnWaitRange := *, + template DisasterPLMNList p_DisasterPLMNList := *, + template NG_TrackingAreaIdList p_ForbidTAIList_Roaming := *, + template NG_TrackingAreaIdList p_ForbidTAIList_RegProvService := *, + template ExtdCAGInfoList p_ExtdCAGInfoList := *, + template NSAG_Info p_NsagInfo := *) := +{ + registration_Accept := { + protocolDiscriminator := tsc_EPD_GMM, /* cl. 9.2 M V 1 */ + spareHalfOctet := tsc_SpareHalfOctet, /* cl. 9.3 M V 1/2 */ + securityHeaderType := tsc_SHT_NoSecurityProtection, + messageType := tsc_MT_NG_RegistrationAccept, /* cl. 9.7 M V 1 */ + registrationResult := p_RegistrationResult, /* cl. 9.11.3.6 M LV 2 */ + guti := p_GUTI, /* cl. 9.11.3.4 O TLV 13 IEI=2C */ + equivalentPlmns := p_EPLMNs, /* cl. 9.11.3.45 O TLV 5-47 IEI=4A */ + taiList := p_TAIList, /* cl. 9.11.3.9 O TLV 9-114 IEI=54 */ + allowedNSSAI := p_AllowedNSSAI, /* cl. 9.11.3.37 O TLV 4-74 IEI=70 */ + rejectedNSSAI := p_RejectedNSSAI, /* cl. 9.11.3.46 O TLV 4-42 IEI=0x11 */ + configuredNSSAI := p_ConfiguredNSSAI, /* cl. 9.11.3.37 O TLV 4-146 IEI=31 */ + ngs_NetworkFeatureSupport := p_NwkFeatureSupport, /* cl. 9.11.3.5 O TLV 3-5 IEI=21*/ + pduSessionStatus := p_PDU_SessionStatus, /* cl. 9.11.3.44 O TLV 4-34 IEI=50 */ + pduSessionReactivationResult := p_PDU_SessionReactResult, /* cl. 9.11.3.42 O TLV 4-32 IEI=26 */ + pduSessionReactResultError := p_PDU_SessionReactError, /* cl. 9.11.3.43 O TLV-E 5-515 IEI=7E */ + ladnInfo := p_LADN_Info, /* cl. 9.11.3.30 O TLV-E 12-1707 IEI=79 */ + micoInd := p_MICO_Ind, /* cl. 9.11.3.31 O TV 1 IEI=B */ + networkSlicingInd := p_NetworkSlicingInd, /* cl. 9.11.3.36 O TV 1 IEI=9 */ + saiList := p_SAIList, /* cl. 9.11.3.49 O TLV 6-114 IEI=27 */ + t3512Value := p_T3512, /* cl. 9.11.2.5 O TLV 3 IEI=5E */ + non3GPPDeregisterValue := p_Non3GPPDereg, /* cl. 9.11.2.4 O TLV 3 IEI=5D */ + t3502Value := p_T3502, /* cl. 9.11.2.4 O TLV 3 IEI=16 */ + emergencyNumberList := p_EmergNumList, /* cl. 9.11.3.23 O TLV 5-50 IEI=34 */ + xtdEmergencyNumberList := p_ExtdEmergNumList, /* cl. 9.11.3.26 O TLV-E 6-65538 IEI=7A */ + sorTransparentContainer := p_SOR, /* cl. 9.11.3.51 O TLV-E 20-2048 IEI=7F */ + eapMessage := p_EAP, /* cl. 9.11.2.2 O TLV-E 7-1503 IEI=78*/ + inclusionModeNSSAI := p_InclusionModeNSSAI, /* cl. 9.11.3.37A O TV 1 IEI=A */ + operatorAccessCatDefs := p_AccessCatDefinition, /* cl. 9.11.3.38 O TLV-E 4-n IEI=76 */ + negotiatedDRXParams := p_NG_DRXparameter, /* cl. 9.11.3.2A O TLV 3 IEI=51 */ + non3GPP_NW_ProvidedPolicies := p_Non3GPP_NW_ProvidedPolicies, /* cl. 9.11.3.58 O TV 1 IEI = ? Mar 19 @sic R5w190113 sic@ */ + epsBearerContextStatus := p_EPS_BearerContextStatus, /* cl. 9.11.3.23A O TLV 4 IEI=60 Jun19 @sic R5s190543 sic@ */ + negotiatedExtdDRXParams := p_NegotiatedExtdDRXParams, /* cl. 9.11.3.26A O TLV 3 IEI=6E Sep20 @sic R5s201387 Baseline Moving sic@ */ + t3447Value := p_T3447, /* cl. 9.11.2.5 O TLV 3 IEI=6C Sep20 @sic R5s201387 Baseline Moving sic@ */ + t3448Value := p_T3448, /* cl. 9.11.2.4 O TLV 3 IEI=6B Sep20 @sic R5s201387 Baseline Moving sic@ */ + t3324Value := p_T3324, /* cl. 9.11.2.5 O TLV 3 IEI=6A Sep20 @sic R5s201387 Baseline Moving sic@ */ + ueRadioCapabilityId := p_UERadioCapId, /* cl. 9.11.3.68 O TLV 3-n IEI=67 Sep20 @sic R5s201387 Baseline Moving sic@ */ + ueRadioCapIdDeletionInd := p_UERadioCapIdDeletion, /* cl. 9.11.3.69 O TV 1 IEI=E Sep20 @sic R5s201387 Baseline Moving sic@ */ + pendingNSSAI := p_PendingNSSAI, /* cl. 9.11.3.37 O TLV 4-146 IEI=39 Sep20 @sic R5s201387 Baseline Moving sic@ */ + cipheringKeyData := p_CipheringKeyData, /* cl. 9.11.3.18C O TLV-E 34-n IEI=74 Sep20 @sic R5s201387 Baseline Moving sic@ */ + cagInfoList := p_CAGInfoList, /* cl. 9.11.3.18A O TLV-E 3-n IEI=75 Sep20 @sic R5s201387 Baseline Moving sic@ */ + truncatedS_TMSIConfig := p_TruncatedS_TMSIConfig, /* cl. 9.11.3.70 O TLV 3 IEI=1B Sep20 @sic R5s201387 Baseline Moving sic@ */ + negotiatedWUSAssistanceInfo := p_WUSAssistInfo, /* cl. 9.11.3.71 O TLV 3-n IEI=1C Sep20 @sic R5s201387 Baseline Moving sic@ */ + negotiatedNB_N1DRXParams := p_NB_N1ModeDRXParams, /* cl. 9.11.3.73 O TLV 3 IEI=29 Sep20 @sic R5s201387 Baseline Moving sic@ */ + extdRejectedNSSAI := p_ExtdRejectedNSSAI, /* cl. 9.11.3.75 O TLV 5-90 IEI=68 Sep22 @sic R5s221179 Baseline Moving sic@ */ + serviceLvlAA := p_ServiceLvlAA, /* cl. 9.11.2.10 O TLV-E 6-n IEI=7B Sep22 @sic R5s221179 Baseline Moving sic@ */ + negotiatedPEIPS_AssistInfo := p_NegotiatedPEIPS_AssistInfo, /* cl. 9.11.3.80 O TLV 3-n IEI=33 Sep22 @sic R5s221179 Baseline Moving sic@ */ + ngAddRequestResult := p_AddRequestResult, /* cl. 9.11.3.81 O TLV 3 IEI=34 Sep22 @sic R5s221179 Baseline Moving sic@ */ + nssrgInfo := p_NssrgInfo, /* cl. 9.11.3.82 O TLV-E 7-65538 IEI=70 Sep22 @sic R5s221179 Baseline Moving sic@ */ + disasterRoamingWaitRange := p_DisasterRoamingWaitRange, /* cl. 9.11.3.84 O TLV 4 IEI=14 Sep22 @sic R5s221179 Baseline Moving sic@ */ + disasterReturnWaitRange := p_DisasterReturnWaitRange, /* cl. 9.11.3.84 O TLV 4 IEI=2C Sep22 @sic R5s221179 Baseline Moving sic@ */ + disasterPLMNList := p_DisasterPLMNList, /* cl. 9.11.3.83 O TLV 2-n IEI=13 Sep22 @sic R5s221179 Baseline Moving sic@ */ + forbidTAIList_Roaming := p_ForbidTAIList_Roaming, /* cl. 9.11.3.9 O TLV 9-114 IEI=1D Sep22 @sic R5s221179 Baseline Moving sic@ */ + forbidTAIList_RegProvService := p_ForbidTAIList_RegProvService, /* cl. 9.11.3.9 O TLV 9-114 IEI=1E Sep22 @sic R5s221179 Baseline Moving sic@ */ + extdCAGInfoList := p_ExtdCAGInfoList, /* cl. 9.11.3.86 O TLV-E 3-n IEI=71 Sep22 @sic R5s221179 Baseline Moving sic@ */ + nsagInfo := p_NsagInfo /* cl. 9.11.3.87 O TLV-E 10-n IEI=7C Sep22 @sic R5s221179 Baseline Moving sic@ */ + } +}
+/* 24.501 cl. 8.2.8 */ +template (value) NG_NAS_UL_Message_Type +cs_NG_REGISTRATION_COMPLETE(template (omit) SORTransparentContainer p_SOR := omit) := +{ + registration_Complete := { + protocolDiscriminator := tsc_EPD_GMM, /* cl. 9.2 M V 1 */ + spareHalfOctet := tsc_SpareHalfOctet, /* cl. 9.3 M V 1/2 */ + securityHeaderType := tsc_SHT_NoSecurityProtection, + messageType := tsc_MT_NG_RegistrationComplete, /* cl. 9.7 M V 1 */ + sorTransparentContainer := p_SOR /* cl. 9.11.3.49 O TLV-E 20-2048 IEI=7F */ + } +} + +/* 24.501 cl. 8.2.19 */ +template (present) NG_NAS_DL_Message_Type +cr_NG_CONFIGURATION_UPDATE_COMMAND(template ConfigUpdateInd p_ConfigUpdateInd := *, + template NG_MobileIdentity p_Guti := *, + template NG_TrackingAreaIdList p_TaiList := *, + template NSSAI p_AllowedNSSAI := *, + template ServiceAreaIdList p_SaiList := *, + template NetworkName p_FullNetworkName := *, + template NetworkName p_ShortNetworkName := *, + template TimeZone p_LocalTimeZone := *, + template TimeZoneAndTime p_LocalTimeZoneAndTime := *, + template DaylightSavingTime p_DaylightSavingTime := *, + template LADN_Info p_LadnInfo := *, + template MICO_Ind p_MicoInd := *, + template NetworkSlicingInd p_NetworkSlicingInd := *, + template NSSAI p_ConfiguredNSSAI := *, + template RejectedNSSAI p_RejectedNSSAI := *, + template OperatorAccessCatDefinitions p_OperatorAccessCatDefs := *, + template SMSInd p_SmsInd := *, + template GPRS_Timer3 p_T3447 := *, + template CAGInfoList p_CAGInfoList := *, + template UERadioCapId p_UERadioCapId := *, + template UERadioCapIdDeletion p_UERadioCapIdDeletion := *, + template RegistrationResult p_RegistrationResult := *, + template TruncatedS_TMSIConfig p_TruncatedS_TMSIConfig := *, + template AddConfigInfo p_AddConfigInfo := *, + template ExtdRejectedNSSAI p_ExtdRejectedNSSAI := *, + template ServiceLvlAAContainer p_ServiceLvlAA := *, + template NSSRG_Info p_NssrgInfo := *, + template RegistrationWaitRange p_DisasterRoamingWaitRange := *, + template RegistrationWaitRange p_DisasterReturnWaitRange := *, + template DisasterPLMNList p_DisasterPLMNList := *, + template ExtdCAGInfoList p_ExtdCAGInfoList := *, + template PEIPS_AssistInfo p_UpdatedPEIPS_AssistInfo := *, + template NSAG_Info p_NsagInfo := *, + template PriorityInd p_PriorityInd := *) := +{ + configuration_Update_Command := { + protocolDiscriminator := tsc_EPD_GMM , /* cl. 9.2 M V 1 */ + spareHalfOctet := tsc_SpareHalfOctet, /* cl. 9.5 M V 1/2 */ + securityHeaderType := tsc_SHT_NoSecurityProtection, /* cl. 9.3 M V 1/2 */ + messageType := tsc_MT_NG_ConfigurationUpdateCommand, /* cl. 9.7 M V 1 */ + configUpdateInd := p_ConfigUpdateInd, /* cl. 9.11.3.18 M TV 1 IEI=D */ + guti := p_Guti, /* cl. 9.11.3.4 O TLV 13 IEI=77 Dec18 */ + taiList := p_TaiList, /* cl. 9.11.3.9 O TLV 9-114 IEI=54 */ + allowedNSSAI := p_AllowedNSSAI, /* cl. 9.11.3.37 O TLV 4-74 IEI=15 */ + saiList := p_SaiList, /* cl. 9.11.3.49 O TLV 6-114 IEI=27 */ + fullNetworkName := p_FullNetworkName, /* cl. 9.11.3.35 O TLV 3-? IEI=43 */ + shortNetworkName := p_ShortNetworkName, /* cl. 9.11.3.35 O TLV 3-? IEI=45 */ + localTimeZone := p_LocalTimeZone, /* cl. 9.11.3.52 O TV 2 IEI=46 */ + localTimeZoneAndTime := p_LocalTimeZoneAndTime, /* cl. 9.11.3.53 O TV 8 IEI=47 */ + daylightSavingTime := p_DaylightSavingTime, /* cl. 9.11.3.19 O TLV 3 IEI=49 */ + ladnInfo := p_LadnInfo, /* cl. 9.11.3.30 O TLV-E 3-1715 IEI=79 */ + micoInd := p_MicoInd, /* cl. 9.11.3.31 O TLV 1 IEI=B */ + networkSlicingInd := p_NetworkSlicingInd, /* cl. 9.11.3.36 O TV 1 IEI=9 */ + configuredNSSAI := p_ConfiguredNSSAI, /* cl. 9.11.3.37 O TLV 4-146 IEI=31 */ + rejectedNSSAI := p_RejectedNSSAI, /* cl. 9.11.3.46 O TLV 4-42 IEI=11 */ + operatorAccessCatDefs := p_OperatorAccessCatDefs, /* cl. 9.11.3.38 O TLV-E 4-n IEI=76 Dec18 */ + smsInd := p_SmsInd, /* cl. 9.10.3.50A O TV 1 IEI=F Dec18 */ + t3447Value := p_T3447, /* cl. 9.11.2.5 O TLV 3 IEI=6C Sep20 @sic R5s201387 Baseline Moving sic@ */ + cagInfoList := p_CAGInfoList, /* cl. 9.11.3.18A O TLV-E 3-n IEI=75 Sep20 @sic R5s201387 Baseline Moving sic@ */ + ueRadioCapabilityId := p_UERadioCapId, /* cl. 9.11.3.68 O TLV 3-n IEI=67 Sep20 @sic R5s201387 Baseline Moving sic@ */ + ueRadioCapIdDeletionInd := p_UERadioCapIdDeletion, /* cl. 9.11.3.69 O TV 1 IEI=E Sep20 @sic R5s201387 Baseline Moving sic@ */ + registrationResult := p_RegistrationResult, /* cl. 9.11.3.6 O TLV 3 IEI=44 Sep20 @sic R5s201387 Baseline Moving sic@ */ + truncatedS_TMSIConfig := p_TruncatedS_TMSIConfig, /* cl. 9.11.3.70 O TLV 3 IEI=1B Sep20 @sic R5s201387 Baseline Moving sic@ */ + addConfigInfo := p_AddConfigInfo, /* cl. 9.11.3.74 O TV 1 IEI=C Sep20 @sic R5s201387 Baseline Moving sic@ */ + extdRejectedNSSAI := p_ExtdRejectedNSSAI, /* cl. 9.11.3.75 O TLV 5-90 IEI=68 Sep22 @sic R5s221179 Baseline Moving sic@ */ + serviceLvlAA := p_ServiceLvlAA, /* cl. 9.11.2.10 O TLV-E 6-n IEI=7B Sep22 @sic R5s221179 Baseline Moving sic@ */ + nssrgInfo := p_NssrgInfo, /* cl. 9.11.3.82 O TLV-E 7-65538 IEI=70 Sep22 @sic R5s221179 Baseline Moving sic@ */ + disasterRoamingWaitRange := p_DisasterRoamingWaitRange, /* cl. 9.11.3.84 O TLV 4 IEI=14 Sep22 @sic R5s221179 Baseline Moving sic@ */ + disasterReturnWaitRange := p_DisasterReturnWaitRange, /* cl. 9.11.3.84 O TLV 4 IEI=2C Sep22 @sic R5s221179 Baseline Moving sic@ */ + disasterPLMNList := p_DisasterPLMNList, /* cl. 9.11.3.83 O TLV 2-n IEI=13 Sep22 @sic R5s221179 Baseline Moving sic@ */ + extdCAGInfoList := p_ExtdCAGInfoList, /* cl. 9.11.3.86 O TLV-E 3-n IEI=71 Sep22 @sic R5s221179 Baseline Moving sic@ */ + updatedPEIPS_AssistInfo := p_UpdatedPEIPS_AssistInfo, /* cl. 9.11.3.80 O TLV 3-n IEI=33 Sep22 @sic R5s221179 Baseline Moving sic@ */ + nsagInfo := p_NsagInfo, /* cl. 9.11.3.87 O TLV-E 10-n IEI=7C Sep22 @sic R5s221179 Baseline Moving sic@ */ + priorityInd := p_PriorityInd /* cl. 9.11.3.91 O TV 1 IEI=E- Sep22 @sic R5s221179 Baseline Moving sic@ */ + } +} + +/* 24.501 cl. 8.2.20 */ +template (value) NG_NAS_UL_Message_Type +cs_NG_CONFIGURATION_UPDATE_COMPLETE := { + configuration_Update_Complete := { + protocolDiscriminator := tsc_EPD_GMM , /* cl. 9.2 M V 1 */ + spareHalfOctet := tsc_SpareHalfOctet, /* cl. 9.5 M V 1/2 */ + securityHeaderType := tsc_SHT_NoSecurityProtection, /* cl. 9.3 M V 1/2 */ + messageType := tsc_MT_NG_ConfigurationUpdateComplete /* cl. 9.7 M V 1 */ + } +}
/* 24.501 cl. 8.2.28 */ template (present) NG_NAS_DL_Message_Type @@ -149,6 +387,24 @@ } }
+/* 24.501 cl. 8.2.28 */ +template (value) NG_NAS_UL_Message_Type +cs_NG_SECURITY_PROTECTED_NAS_MESSAGE(template (value) ExtdProtocolDiscriminator p_protocolDiscriminator, + template (value) SecurityHeaderType p_securityHeaderType, + template (value) MessageAuthenticationCode p_messageAuthenticationCode, + template (value) NAS_SequenceNumber p_sequenceNumber, + template (value) NG_NAS_Message p_plainNASMessage) := +{ + security_Protected_Nas_Message := { + protocolDiscriminator := p_protocolDiscriminator, /* cl. 9.2 M V 1 */ + spareHalfOctet := '0'H, /* cl. 9.5 M V 1/2 */ + securityHeaderType := p_securityHeaderType, /* cl. 9.3 M V 1/2 */ + messageAuthenticationCode := p_messageAuthenticationCode, /* cl. 9.8 M V 4 */ + sequenceNumber := p_sequenceNumber, /* cl. 9.10 M V 1 */ + plainNASMessage := p_plainNASMessage /* cl. 9.9 M V 3-n */ + } +} + /* 24.501 cl. 8.2.25 */ template (present) NG_NAS_DL_Message_Type cr_NG_SECURITY_MODE_COMMAND(template (present) NG_NAS_SecurityAlgorithms p_Algs := ?, @@ -179,4 +435,22 @@ } }
+/* 24.501 cl. 8.2.26 */ +template (value) NG_NAS_UL_Message_Type +cs_NG_SECURITY_MODE_COMPLETE(template (omit) NG_MobileIdentity p_IMEISV := omit, + template (omit) ReplayedNASMessageContainer p_NASMsg := omit, + template (omit) NG_MobileIdentity p_NonIMEISV_PEI := omit + ) := +{ + security_Mode_Complete := { + protocolDiscriminator := tsc_EPD_GMM, /* cl. 9.2 M V 1 */ + spareHalfOctet := tsc_SpareHalfOctet, /* cl. 9.3 M V 1/2 */ + securityHeaderType := tsc_SHT_NoSecurityProtection, + messageType := tsc_MT_NG_SecurityModeComplete, /* cl. 9.7 M V 1 */ + imeisv := p_IMEISV, /* cl. 9.11.3.4 O TLV 11 IEI=2C */ + nasMsg := p_NASMsg, /* cl. 9.11.3.33 O TLV-E 3-n IEI=7D */ + nonIMEISV_PEI := p_NonIMEISV_PEI /* cl. 9.11.3.4 O TLV-E 7-n IEI=78 Sep20 @sic R5s201387 Baseline Moving sic@ */ + } +} + }