blob: bbe7237c61a7f3ddfc072e51a5986dedfcb88006 [file] [log] [blame]
Harald Weltefc5f6372019-07-09 14:10:05 +08001/* EPC (Evolved Packet Core) NAS (Non-Access Stratum) templates in TTCN-3
2 * (C) 2019 Harald Welte <laforge@gnumonks.org>
3 * All rights reserved.
4 *
5 * Released under the terms of GNU General Public License, Version 2 or
6 * (at your option) any later version.
7 *
8 * SPDX-License-Identifier: GPL-2.0-or-later
9 */
10
11module NAS_Templates {
12
13import from General_Types all;
14import from NAS_EPS_Types all;
15
16template (value) PDU_NAS_EPS
17ts_NAS_SM(template (value) EPS_SessionManagement sm) := {
18 protocolDiscriminator := '0010'B,
19 ePS_messages := {
20 ePS_SessionManagement := sm
21 }
22}
23template (present) PDU_NAS_EPS
24tr_NAS_SM(template (present) EPS_SessionManagement sm) := {
25 protocolDiscriminator := '0010'B,
26 ePS_messages := {
27 ePS_SessionManagement := sm
28 }
29}
30
31template (value) PDU_NAS_EPS
32ts_NAS_MM(template (value) EPS_MobilityManagement mm) := {
33 protocolDiscriminator := c_EPS_NAS_PD_EMM,
34 ePS_messages := {
35 ePS_MobilityManagement := mm
36 }
37}
38template (present) PDU_NAS_EPS
39tr_NAS_MM(template (present) EPS_MobilityManagement mm) := {
40 protocolDiscriminator := c_EPS_NAS_PD_EMM,
41 ePS_messages := {
42 ePS_MobilityManagement := mm
43 }
44}
45
46const BIT4 c_EPS_SEC_NONE := '0000'B;
47const BIT4 c_EPS_NAS_PD_EMM := '0111'B;
48const BIT4 c_EPS_NAS_PD_ESM := '0010'B;
49
50private template (value) ESM_MessageContainerLVE
51ts_NAS_EsmMsgContLVE(template (value) octetstring inp) := {
52 lengthIndicator := 0,
53 content := inp
54}
55private template (present) ESM_MessageContainerLVE
56tr_NAS_EsmMsgContLVE(template (present) octetstring inp) := {
57 lengthIndicator := ?,
58 content := inp
59}
60
61private template (value) MobileIdentityLV
62ts_NAS_MobileIdLV(template (value) MobileIdentityV mid) := {
63 lengthIndicator := 0,
64 mobileIdentityV := mid
65}
66private template (present) MobileIdentityLV
67tr_NAS_MobileIdLV(template (present) MobileIdentityV mid) := {
68 lengthIndicator := ?,
69 mobileIdentityV := mid
70}
71
72private function f_enc_IMSI_NAS(hexstring digits) return IMSI {
73 var IMSI l3;
74 var integer len := lengthof(digits);
75 if (len rem 2 == 1) { /* modulo remainder */
76 l3.oddevenIndicator := '1'B;
77 l3.fillerDigit := omit;
78 } else {
79 l3.oddevenIndicator := '0'B;
80 l3.fillerDigit := '1111'B;
81 }
82 l3.digits := digits;
83 return l3;
84}
85
86private function f_enc_IMEI_NAS(hexstring digits) return IMEI {
87 var IMEI l3;
88 var integer len := lengthof(digits);
89 if (len rem 2 == 1) { /* modulo remainder */
90 l3.oddevenIndicator := '1'B;
91 } else {
92 l3.oddevenIndicator := '0'B;
93 }
94 l3.digits := digits;
95 return l3;
96}
97
98private function f_enc_IMEI_SV(hexstring digits) return IMEI_SV {
99 var IMEI_SV l3;
100 var integer len := lengthof(digits);
101 if (len rem 2 == 1) { /* modulo remainder */
102 l3.oddevenIndicator := '1'B;
103 } else {
104 l3.oddevenIndicator := '0'B;
105 }
106 l3.digits := digits;
107 l3.fillerDigit := '1111'B;
108 return l3;
109}
110
111template (value) GUTI ts_NAS_GUTI(hexstring mcc_mnc, OCT2 mmegi, OCT1 mmec, OCT4 tmsi) := {
112 oddevenIndicator := '0'B,
113 spare := '1111'B,
Philipp Maier68cf9472023-08-31 17:42:13 +0200114 /* use the mcc_mnc format as specified in 3GPP TS 24.301, figure 9.9.3.12.1.
115 * Example: mcc=262, mnc=42 => 262f42.
116 * mcc=001, mnc=01 => 001f01. */
Harald Weltefc5f6372019-07-09 14:10:05 +0800117 mccDigit1 := mcc_mnc[0],
118 mccDigit2 := mcc_mnc[1],
119 mccDigit3 := mcc_mnc[2],
Philipp Maier68cf9472023-08-31 17:42:13 +0200120 mncDigit3 := mcc_mnc[3],
121 mncDigit1 := mcc_mnc[4],
122 mncDigit2 := mcc_mnc[5],
Harald Weltefc5f6372019-07-09 14:10:05 +0800123 mMEGI := mmegi,
124 mMEC := mmec,
125 mTMSI := tmsi
126}
127
128template (value) EPS_MobileIdentityV
129ts_NAS_MobileId_IMSI(hexstring imsi) := {
130 typeOfIdentity := '001'B,
131 oddEvenInd_identity := {
132 imsi := f_enc_IMSI_NAS(imsi)
133 }
134}
135
136template (value) EPS_MobileIdentityV
137ts_NAS_MobileId_IMEI(hexstring imei) := {
138 typeOfIdentity := '011'B,
139 oddEvenInd_identity := {
140 imei := f_enc_IMEI_NAS(imei)
141 }
142}
143
144template (value) EPS_MobileIdentityV
145ts_NAS_MobileId_GUTI(hexstring mcc_mnc, OCT2 mmegi, OCT1 mmec, OCT4 tmsi) := {
146 typeOfIdentity := '110'B,
147 oddEvenInd_identity := {
148 guti := ts_NAS_GUTI(mcc_mnc, mmegi, mmec, tmsi)
149 }
150}
151
152template (value) PDU_NAS_EPS
153ts_NAS_EMM_SecurityProtected(BIT4 sec_hdr_t, integer seq_nr, octetstring inner_nas) := {
154 protocolDiscriminator := c_EPS_NAS_PD_EMM,
155 ePS_messages := {
156 ePS_MobilityManagement := {
157 pDU_NAS_EPS_SecurityProtectedNASMessage := {
158 securityHeaderType := sec_hdr_t,
159 messageAuthenticationCode := '00000000'O,
160 sequenceNumber := seq_nr,
161 nAS_Message := inner_nas
162 }
163 }
164 }
165}
166template (present) PDU_NAS_EPS
167tr_NAS_EMM_SecurityProtected := {
168 protocolDiscriminator := c_EPS_NAS_PD_EMM,
169 ePS_messages := {
170 ePS_MobilityManagement := {
171 pDU_NAS_EPS_SecurityProtectedNASMessage := ?
172 }
173 }
174}
175
176const BIT3 NAS_PDN_T_IPv4 := '001'B;
177const BIT3 NAS_PDN_T_IPv6 := '010'B;
178const BIT3 NAS_PDN_T_IPv4v6 := '011'B;
179const BIT3 NAS_PDN_T_NonIP := '101'B;
180
181
182/*********************************************************************************
183 * Mobility Management
184 *********************************************************************************/
185
186/* 8.2.1 Attach Accept */
187template (value) PDU_NAS_EPS
188ts_NAS_AttachAccept(template (value) EPS_AttachResultV result,
189 template (value) GPRSTimerV t3412,
190 template (value) TAI_Lists tai_lists,
191 template (value) octetstring esm_enc) := {
192 protocolDiscriminator := c_EPS_NAS_PD_EMM,
193 ePS_messages := {
194 ePS_MobilityManagement := {
195 pDU_NAS_EPS_AttachAccept := {
196 securityHeaderType := c_EPS_SEC_NONE,
197 messageType := '01000010'B,
198 ePS_AttachResult := result,
199 spare := '0000'B,
200 t3412 := t3412,
201 tAI_List := {
202 lengthIndicator := 0,
203 trackingAreaIdentityLists := tai_lists
204 },
205 eSM_MessageContainer := ts_NAS_EsmMsgContLVE(esm_enc),
206 gUTI := omit,
207 locationAreaIdentification := omit,
208 msIdentity := omit,
209 eMMCause := omit,
210 t3402 := omit,
211 t3423 := omit,
212 equivalentPLMNs := omit,
213 emergencyNumberList := omit,
214 ePS_NetworkFeatureSupport := omit,
215 additionalUpdateResult := omit,
216 t3412_Extended := omit,
217 t3324 := omit,
218 extendedDRXParameters := omit,
219 dNCID := omit,
220 sMS_ServiceStatus := omit,
221 non3GPP_NW_ProvidedPolicies := omit,
222 t3448 := omit,
223 networkPolicy := omit,
224 t3447 := omit,
225 extendedEmergencyNumberList := omit
226 }
227 }
228 }
229}
230template (present) PDU_NAS_EPS
231tr_NAS_AttachAccept(template (present) EPS_AttachResultV result := ?,
232 template (present) GPRSTimerV t3412 := ?,
233 template (present) TAI_Lists tai_lists := ?,
234 template (present) octetstring esm_enc := ?) := {
235 protocolDiscriminator := c_EPS_NAS_PD_EMM,
236 ePS_messages := {
237 ePS_MobilityManagement := {
238 pDU_NAS_EPS_AttachAccept := {
239 securityHeaderType := c_EPS_SEC_NONE,
240 messageType := '01000010'B,
241 ePS_AttachResult := result,
242 spare := ?,
243 t3412 := t3412,
244 tAI_List := {
245 lengthIndicator := ?,
246 trackingAreaIdentityLists := tai_lists
247 },
248 eSM_MessageContainer := tr_NAS_EsmMsgContLVE(esm_enc),
249 gUTI := *,
250 locationAreaIdentification := *,
251 msIdentity := *,
252 eMMCause := *,
253 t3402 := *,
254 t3423 := *,
255 equivalentPLMNs := *,
256 emergencyNumberList := *,
257 ePS_NetworkFeatureSupport := *,
258 additionalUpdateResult := *,
259 t3412_Extended := *,
260 t3324 := *,
261 extendedDRXParameters := *,
262 dNCID := *,
263 sMS_ServiceStatus := *,
264 non3GPP_NW_ProvidedPolicies := *,
265 t3448 := *,
266 networkPolicy := *,
267 t3447 := *,
268 extendedEmergencyNumberList := *
269 }
270 }
271 }
272}
273
274
275/* 8.2.2 Attach Complete */
276template (value) PDU_NAS_EPS
277ts_NAS_AttachComplete(template (value) octetstring esm_enc) := {
278 protocolDiscriminator := c_EPS_NAS_PD_EMM,
279 ePS_messages := {
280 ePS_MobilityManagement := {
281 pDU_NAS_EPS_AttachComplete := {
282 securityHeaderType := c_EPS_SEC_NONE,
283 messageType := '01000011'B,
284 eSM_MessageContainer := ts_NAS_EsmMsgContLVE(esm_enc)
285 }
286 }
287 }
288}
289template (present) PDU_NAS_EPS
290tr_NAS_AttachComplete(template (present) octetstring esm_enc := ?) := {
291 protocolDiscriminator := c_EPS_NAS_PD_EMM,
292 ePS_messages := {
293 ePS_MobilityManagement := {
294 pDU_NAS_EPS_AttachComplete := {
295 securityHeaderType := c_EPS_SEC_NONE,
296 messageType := '01000011'B,
297 eSM_MessageContainer := tr_NAS_EsmMsgContLVE(esm_enc)
298 }
299 }
300 }
301}
302
303
304/* 8.2.3 Attach Reject */
305template (value) PDU_NAS_EPS
306ts_NAS_AttachReject(template (value) EMM_CauseV cause) := {
307 protocolDiscriminator := c_EPS_NAS_PD_EMM,
308 ePS_messages := {
309 ePS_MobilityManagement := {
310 pDU_NAS_EPS_AttachReject := {
311 securityHeaderType := c_EPS_SEC_NONE,
312 messageType := '01000100'B,
313 emmCause := cause,
314 eSM_MessageContainer := omit,
315 t3346 := omit,
316 t3402 := omit,
317 extendedEmmCause := omit
318 }
319 }
320 }
321}
322template (present) PDU_NAS_EPS
323tr_NAS_AttachReject(template (present) EMM_CauseV cause := ?) := {
324 protocolDiscriminator := c_EPS_NAS_PD_EMM,
325 ePS_messages := {
326 ePS_MobilityManagement := {
327 pDU_NAS_EPS_AttachReject := {
328 securityHeaderType := c_EPS_SEC_NONE,
329 messageType := '01000100'B,
330 emmCause := cause,
331 eSM_MessageContainer := omit,
332 t3346 := omit,
333 t3402 := omit,
334 extendedEmmCause := omit
335 }
336 }
337 }
338}
339
340/* 8.2.4 Attach Request */
341template (value) PDU_NAS_EPS
342ts_NAS_AttachRequest(template (value) BIT3 att_type,
343 template (value) BIT3 kset_id,
344 template (value) EPS_MobileIdentityV mobile_id,
345 template (value) UENetworkCapabilityV ue_net_cap,
346 template (value) octetstring esm_enc) := {
347 protocolDiscriminator := c_EPS_NAS_PD_EMM,
348 ePS_messages := {
349 ePS_MobilityManagement := {
350 pDU_NAS_EPS_AttachRequest := {
351 securityHeaderType := c_EPS_SEC_NONE,
352 messageType := '01000001'B,
353 ePS_attachType := {
354 typeOfAttach := att_type,
355 spare := '0'B
356 },
357 nasKeySetId := {
358 identifier := kset_id,
359 tSC := '1'B
360 },
361 ePSMobileId := {
362 lengthIndicator := 0,
363 ePS_MobileIdentity := mobile_id
364 },
365 uENetworkCapability := {
366 lengthIndicator := 0,
367 uENetworkCapabilityV := ue_net_cap
368 },
369 eSM_MessageContainer := ts_NAS_EsmMsgContLVE(esm_enc),
370 old_P_TMSISignature := omit,
371 additionalGUTI := omit,
372 lastVisitedRegisteredTAI := omit,
373 dRXParameter := omit,
374 mSNetworkCapability := omit,
375 oldLocationAreaIdentification := omit,
376 tMSIStatusTV := omit,
377 mobileStationClassmark2 := omit,
378 mobileStationClassmark3 := omit,
379 supportedCodecList := omit,
380 additionalUpdateType := omit,
381 voiceDomainPrefandUEsettings := omit,
382 deviceProperties := omit,
383 oldGUTI_Type := omit,
384 mS_NetworkFeatureSupport := omit,
385 tMSIBasedNRIContainer := omit,
386 t3324 := omit,
387 t3412_Extended := omit,
388 extendedDRXParameters := omit,
389 uEAdditionalSecurityCapability := omit
390 }
391 }
392 }
393}
394template (present) PDU_NAS_EPS
395tr_NAS_AttachRequest(template (present) BIT3 att_type := ?,
396 template (present) BIT3 kset_id := ?,
397 template (present) EPS_MobileIdentityV mobile_id := ?,
398 template (present) UENetworkCapabilityV ue_net_cap := ?,
399 template (present) octetstring esm_enc := ?) := {
400 protocolDiscriminator := c_EPS_NAS_PD_EMM,
401 ePS_messages := {
402 ePS_MobilityManagement := {
403 pDU_NAS_EPS_AttachRequest := {
404 securityHeaderType := ?,
405 messageType := '01000001'B,
406 ePS_attachType := {
407 typeOfAttach := att_type,
408 spare := ?
409 },
410 nasKeySetId := {
411 identifier := kset_id,
412 tSC := ?
413 },
414 ePSMobileId := {
415 lengthIndicator := ?,
416 ePS_MobileIdentity := mobile_id
417 },
418 uENetworkCapability := {
419 lengthIndicator := ?,
420 uENetworkCapabilityV := ue_net_cap
421 },
422 eSM_MessageContainer := tr_NAS_EsmMsgContLVE(esm_enc),
423 old_P_TMSISignature := *,
424 additionalGUTI := *,
425 lastVisitedRegisteredTAI := *,
426 dRXParameter := *,
427 mSNetworkCapability := *,
428 oldLocationAreaIdentification := *,
429 tMSIStatusTV := *,
430 mobileStationClassmark2 := *,
431 mobileStationClassmark3 := *,
432 supportedCodecList := *,
433 additionalUpdateType := *,
434 voiceDomainPrefandUEsettings := *,
435 deviceProperties := *,
436 oldGUTI_Type := *,
437 mS_NetworkFeatureSupport := *,
438 tMSIBasedNRIContainer := *,
439 t3324 := *,
440 t3412_Extended := *,
441 extendedDRXParameters := *,
442 uEAdditionalSecurityCapability := *
443 }
444 }
445 }
446}
447
448
449/* 8.2.5 Authentication Failure */
450template (value) PDU_NAS_EPS
451ts_NAS_AuthFail(template (value) EMM_CauseV cause /* template (omit) OCT14 auth_fail_par */) := {
452 protocolDiscriminator := c_EPS_NAS_PD_EMM,
453 ePS_messages := {
454 ePS_MobilityManagement := {
455 pDU_NAS_EPS_AuthenticationFailure := {
456 securityHeaderType := c_EPS_SEC_NONE,
457 messageType := '01011100'B,
458 emmCause := cause,
459 authenticationFailureParameter := omit
460 }
461 }
462 }
463}
464template (value) PDU_NAS_EPS
465ts_NAS_AuthFail_par(template (value) EMM_CauseV cause,
466 template (value) OCT14 auth_fail_par) := {
467 protocolDiscriminator := c_EPS_NAS_PD_EMM,
468 ePS_messages := {
469 ePS_MobilityManagement := {
470 pDU_NAS_EPS_AuthenticationFailure := {
471 securityHeaderType := c_EPS_SEC_NONE,
472 messageType := '01011100'B,
473 emmCause := cause,
474 authenticationFailureParameter := {
475 elementIdentifier := '30'O,
476 lengthIndicator := lengthof(auth_fail_par),
477 authenticationFailureParameter := auth_fail_par
478 }
479 }
480 }
481 }
482}
483
484/* 8.2.6 Authentication Reject */
485template (value) PDU_NAS_EPS
486ts_NAS_AuthRej := {
487 protocolDiscriminator := c_EPS_NAS_PD_EMM,
488 ePS_messages := {
489 ePS_MobilityManagement := {
490 pDU_NAS_EPS_AuthenticationReject := {
491 securityHeaderType := c_EPS_SEC_NONE,
492 messageType := '01010100'B
493 }
494 }
495 }
496}
497template (present) PDU_NAS_EPS
498tr_NAS_AuthRej := {
499 protocolDiscriminator := c_EPS_NAS_PD_EMM,
500 ePS_messages := {
501 ePS_MobilityManagement := {
502 pDU_NAS_EPS_AuthenticationReject := {
503 securityHeaderType := ?,
504 messageType := '01010100'B
505 }
506 }
507 }
508}
509
510/* 8.2.7 Authentication Request */
511template (value) PDU_NAS_EPS
512ts_NAS_AuthReq(template (value) NAS_KeySetIdentifierV kset_id,
513 OCT16 rand, OCT16 autn) := {
514 protocolDiscriminator := c_EPS_NAS_PD_EMM,
515 ePS_messages := {
516 ePS_MobilityManagement := {
517 pDU_NAS_EPS_AuthenticationRequest := {
518 securityHeaderType := c_EPS_SEC_NONE,
519 messageType := '01010010'B,
520 nasKeySetId := kset_id,
521 spare := '0000'B,
522 authenticationParameterRAND := {
523 rAND := rand
524 },
525 authenticationParameterAUTN := {
526 lengthIndicator := lengthof(autn),
527 aUTN := autn
528 }
529 }
530 }
531 }
532}
533template (present) PDU_NAS_EPS
534tr_NAS_AuthReq(template (present) NAS_KeySetIdentifierV kset_id := ?,
535 template (present) OCT16 rand := ?,
536 template (present) OCT16 autn := ?) := {
537 protocolDiscriminator := c_EPS_NAS_PD_EMM,
538 ePS_messages := {
539 ePS_MobilityManagement := {
540 pDU_NAS_EPS_AuthenticationRequest := {
541 securityHeaderType := ?,
542 messageType := '01010010'B,
543 nasKeySetId := kset_id,
544 spare := '0000'B,
545 authenticationParameterRAND := {
546 rAND := rand
547 },
548 authenticationParameterAUTN := {
549 lengthIndicator := ?,
550 aUTN := autn
551 }
552 }
553 }
554 }
555}
556
557/* 8.2.8 Authentication Response */
558template (value) PDU_NAS_EPS
559ts_NAS_AuthResp(octetstring res) := {
560 protocolDiscriminator := c_EPS_NAS_PD_EMM,
561 ePS_messages := {
562 ePS_MobilityManagement := {
563 pDU_NAS_EPS_AuthenticationResponse := {
564 securityHeaderType := c_EPS_SEC_NONE,
565 messageType := '01010011'B,
566 authenticationResponseParameter := {
567 lengthIndicator := lengthof(res),
568 authenticationResponseParameter := {
569 rES := res
570 }
571 }
572 }
573 }
574 }
575}
576template (present) PDU_NAS_EPS
577tr_NAS_AuthResp(template OCT16 res := ?) := {
578 protocolDiscriminator := c_EPS_NAS_PD_EMM,
579 ePS_messages := {
580 ePS_MobilityManagement := {
581 pDU_NAS_EPS_AuthenticationResponse := {
582 securityHeaderType := ?,
583 messageType := '01010011'B,
584 authenticationResponseParameter := {
585 lengthIndicator := ?,
586 authenticationResponseParameter := {
587 rES := res
588 }
589 }
590 }
591 }
592 }
593}
594
595/* 8.2.18 Identity Request */
596template (value) PDU_NAS_EPS
597ts_NAS_IdentityReq(template (value) IdentityType2V id_type) := {
598 protocolDiscriminator := c_EPS_NAS_PD_EMM,
599 ePS_messages := {
600 ePS_MobilityManagement := {
601 pDU_NAS_EPS_IdentityRequest := {
602 securityHeaderType := c_EPS_SEC_NONE,
603 messageType := '01010101'B,
604 identityType := id_type,
605 spareHalfOctet := '0000'B
606 }
607 }
608 }
609}
610template (present) PDU_NAS_EPS
611tr_NAS_IdentityReq(template (present) IdentityType2V id_type := ?) := {
612 protocolDiscriminator := c_EPS_NAS_PD_EMM,
613 ePS_messages := {
614 ePS_MobilityManagement := {
615 pDU_NAS_EPS_IdentityRequest := {
616 securityHeaderType := c_EPS_SEC_NONE,
617 messageType := '01010101'B,
618 identityType := id_type,
619 spareHalfOctet := ?
620 }
621 }
622 }
623}
624
625/* 8.2.19 Identity Response */
626template (value) PDU_NAS_EPS
627ts_NAS_IdentityResp(template (value) MobileIdentityV mobile_id) := {
628 protocolDiscriminator := c_EPS_NAS_PD_EMM,
629 ePS_messages := {
630 ePS_MobilityManagement := {
631 pDU_NAS_EPS_IdentityResponse := {
632 securityHeaderType := c_EPS_SEC_NONE,
633 messageType := '01010110'B,
634 mobileIdentity := ts_NAS_MobileIdLV(mobile_id)
635 }
636 }
637 }
638}
639template (present) PDU_NAS_EPS
640tr_NAS_IdentityResp(template (present) MobileIdentityV mobile_id := ?) := {
641 protocolDiscriminator := c_EPS_NAS_PD_EMM,
642 ePS_messages := {
643 ePS_MobilityManagement := {
644 pDU_NAS_EPS_IdentityResponse := {
645 securityHeaderType := c_EPS_SEC_NONE,
646 messageType := '01010110'B,
647 mobileIdentity := tr_NAS_MobileIdLV(mobile_id)
648 }
649 }
650 }
651}
652
653
654
655
656/* 8.2.20 Security Mode Command */
657template (value) PDU_NAS_EPS
658ts_NAS_SecModeCmd(template (value) NAS_SecurityAlgorithmsV alg,
659 template (value) NAS_KeySetIdentifierV kset_id,
660 template (value) UESecurityCapabilityLV ue_sec_cap) := {
661 protocolDiscriminator := c_EPS_NAS_PD_EMM,
662 ePS_messages := {
663 ePS_MobilityManagement := {
664 pDU_NAS_EPS_SecurityModeCommand := {
665 securityHeaderType := c_EPS_SEC_NONE,
666 messageType := '01011101'B,
667 selected_NAS_SecurityAlgorithms := alg,
668 nasKeySetId := kset_id,
669 spareHalfOctet := '0000'B,
670 replayed_UE_SecurityCapability := ue_sec_cap,
671 iMEISV_Request := omit,
672 replayedNonceUE := omit,
673 nonceMME := omit,
674 hashMME := omit,
675 uEAdditionalSecurityCapability := omit
676 }
677 }
678 }
679}
680template (present) PDU_NAS_EPS
681tr_NAS_SecModeCmd(template (present) NAS_SecurityAlgorithmsV alg := ?,
682 template (present) NAS_KeySetIdentifierV kset_id := ?,
683 template (present) UESecurityCapabilityLV ue_sec_cap := ?) := {
684 protocolDiscriminator := c_EPS_NAS_PD_EMM,
685 ePS_messages := {
686 ePS_MobilityManagement := {
687 pDU_NAS_EPS_SecurityModeCommand := {
688 securityHeaderType := c_EPS_SEC_NONE,
689 messageType := '01011101'B,
690 selected_NAS_SecurityAlgorithms := alg,
691 nasKeySetId := kset_id,
692 spareHalfOctet := ?,
693 replayed_UE_SecurityCapability := ue_sec_cap,
694 iMEISV_Request := *,
695 replayedNonceUE := *,
696 nonceMME := *,
697 hashMME := *,
698 uEAdditionalSecurityCapability := *
699 }
700 }
701 }
702}
703
704/* 8.2.21 Security Mode Complete */
705template (value) PDU_NAS_EPS
706ts_NAS_SecModeCmpl := {
707 protocolDiscriminator := c_EPS_NAS_PD_EMM,
708 ePS_messages := {
709 ePS_MobilityManagement := {
710 pDU_NAS_EPS_SecurityModeComplete := {
711 securityHeaderType := c_EPS_SEC_NONE,
712 messageType := '01011110'B,
713 iMEISV := omit,
714 replayedNASMessageContainer := omit
715 }
716 }
717 }
718}
719template (present) PDU_NAS_EPS
720tr_NAS_SecModeCmpl := {
721 protocolDiscriminator := c_EPS_NAS_PD_EMM,
722 ePS_messages := {
723 ePS_MobilityManagement := {
724 pDU_NAS_EPS_SecurityModeComplete := {
725 securityHeaderType := c_EPS_SEC_NONE,
726 messageType := '01011110'B,
727 iMEISV := *,
728 replayedNASMessageContainer := *
729 }
730 }
731 }
732}
733
734/*********************************************************************************
735 * Session Management
736 *********************************************************************************/
737
738/* 9.9.4.11 - 10.5.6.3/24.008 */
739private function ts_NAS_PCO_TLV(template (omit) ProtocolConfigOptionsV pco)
740return template (omit) ProtocolConfigOptionsTLV {
741 var template (value) ProtocolConfigOptionsTLV ret;
742 if (istemplatekind(pco, "omit")) {
743 return omit;
744 }
745 ret := {
746 elementIdentifier := '27'O,
747 protocolConfigOptions := {
748 lengthIndicator := 0,
749 protocolConfigOptionsV := pco
750 }
751 }
752 return ret;
753}
754private function tr_NAS_PCO_TLV(template ProtocolConfigOptionsV pco := ?)
755return template ProtocolConfigOptionsTLV {
756 var template ProtocolConfigOptionsTLV ret := {
757 elementIdentifier := '27'O,
758 protocolConfigOptions := {
759 lengthIndicator := ?,
760 protocolConfigOptionsV := pco
761 }
762 }
763 if (istemplatekind(pco, "omit")) {
764 return omit;
765 } else if (istemplatekind(pco, "*")) {
766 return *;
767 } else {
768 return ret;
769 }
770}
771
772
773
774/* 8.3.20 PDN Connectivity Request */
775template (value) PDU_NAS_EPS
776ts_NAS_PdnConnReq(template (value) BIT4 bearer_id,
777 template (value) BIT8 proc_tid,
778 template (value) BIT3 pdn_type,
779 template (value) BIT3 req_type) := {
780 protocolDiscriminator := c_EPS_NAS_PD_ESM,
781 ePS_messages := {
782 ePS_SessionManagement := {
783 pDU_NAS_EPS_PDN_ConnectivityRequest := {
784 ePSBearerIdentity := bearer_id,
785 procedureTransactionIdentifier := proc_tid,
786 messageType := '11010000'B,
787 requestType := {
788 requestTypeValue := req_type,
789 spare := '0'B
790 },
791 pDN_Type := {
792 pDN_TypeValue := pdn_type,
793 spare := '0'B
794 },
795 eSM_InformationTransferFlag := omit,
796 accessPointName := omit,
797 protocolConfigOptions := omit,
798 deviceProperties := omit,
799 nBIFOMContainer := omit,
800 headerCompressinConfiguration := omit,
801 extendedProtocolConfigurationOptions := omit
802 }
803 }
804 }
805}
806template (present) PDU_NAS_EPS
807tr_NAS_PdnConnReq(template (present) BIT4 bearer_id := ?,
808 template (present) BIT8 proc_tid := ?,
809 template (present) BIT3 pdn_type := ?,
810 template (present) BIT3 req_type := ?) := {
811 protocolDiscriminator := c_EPS_NAS_PD_ESM,
812 ePS_messages := {
813 ePS_SessionManagement := {
814 pDU_NAS_EPS_PDN_ConnectivityRequest := {
815 ePSBearerIdentity := bearer_id,
816 procedureTransactionIdentifier := proc_tid,
817 messageType := '11010000'B,
818 requestType := {
819 requestTypeValue := req_type,
820 spare := '0'B
821 },
822 pDN_Type := {
823 pDN_TypeValue := pdn_type,
824 spare := '0'B
825 },
826 eSM_InformationTransferFlag := omit,
827 accessPointName := omit,
828 protocolConfigOptions := omit,
829 deviceProperties := omit,
830 nBIFOMContainer := omit,
831 headerCompressinConfiguration := omit,
832 extendedProtocolConfigurationOptions := omit
833 }
834 }
835 }
836}
837
838/* 8.3.19 PDN Connectivity Reject */
839template (value) PDU_NAS_EPS
840ts_NAS_PdnConnRej(template (value) BIT4 bearer_id,
841 template (value) BIT8 proc_tid,
842 template (value) ESM_CauseV cause) := {
843 protocolDiscriminator := c_EPS_NAS_PD_ESM,
844 ePS_messages := {
845 ePS_SessionManagement := {
846 pDU_NAS_EPS_PDN_ConnectivityReject := {
847 ePSBearerIdentity := bearer_id,
848 procedureTransactionIdentifier := proc_tid,
849 messageType := '11010001'B,
850 esmCause := cause,
851 protocolConfigOptions := omit,
852 backOffTimer := omit,
853 reAttemptIndicator := omit,
854 nBIFOMContainer := omit,
855 extendedProtocolConfigurationOptions := omit
856 }
857 }
858 }
859}
860template (present) PDU_NAS_EPS
861tr_NAS_PdnConnRej(template (present) BIT4 bearer_id := ?,
862 template (present) BIT8 proc_tid := ?,
863 template (present) ESM_CauseV cause := ?) := {
864 protocolDiscriminator := c_EPS_NAS_PD_ESM,
865 ePS_messages := {
866 ePS_SessionManagement := {
867 pDU_NAS_EPS_PDN_ConnectivityReject := {
868 ePSBearerIdentity := bearer_id,
869 procedureTransactionIdentifier := proc_tid,
870 messageType := '11010001'B,
871 esmCause := cause,
872 protocolConfigOptions := *,
873 backOffTimer := *,
874 reAttemptIndicator := *,
875 nBIFOMContainer := *,
876 extendedProtocolConfigurationOptions := *
877 }
878 }
879 }
880}
881
882
883/* 8.3.6 Activate Default EPS Bearer Context Request */
884template (value) PDU_NAS_EPS
885ts_NAS_ActDefEpsBearCtxReq(template (value) BIT4 bearer_id,
886 template (value) BIT8 proc_tid,
887 template (value) EPS_QualityOfServiceV qos,
888 template (value) octetstring apn,
889 template (value) BIT3 addr_type,
890 template (value) octetstring addr_info) := {
891 protocolDiscriminator := c_EPS_NAS_PD_ESM,
892 ePS_messages := {
893 ePS_SessionManagement := {
894 pDU_NAS_EPS_ActDefEPSBearerContextRequest := {
895 ePSBearerIdentity := bearer_id,
896 procedureTransactionIdentifier := proc_tid,
897 messageType := '11000001'B,
898 ePS_QoS := {
899 lengthIndicator := 0,
900 ePS_QualityOfServiceV := qos
901 },
902 accessPointName := {
903 lengthIndicator := 0,
904 accessPointNameValue := apn
905 },
906 pDN_Address := {
907 lengthIndicator := 0,
908 typeValue := addr_type,
909 spare := '00000'B,
910 addressInformation := addr_info
911 },
912 transactionIdentifier := omit,
913 negotiatedQoS := omit,
914 negotiated_LLC_SAPI := omit,
915 radioPriority := omit,
916 packetFlowID := omit,
917 aPN_AMBR := omit,
918 esmCause := omit,
919 protocolConfigOptions := omit,
920 connectivityType := omit,
921 wLANOffloadIndication := omit,
922 nBIFOMContainer := omit,
923 headerCompressinConfiguration := omit,
924 controlPlaneOnlyIndication := omit,
925 extendedProtocolConfigurationOptions := omit,
926 servingPLMNRateControl := omit,
927 extended_APN_AMBR := omit,
928 extendedQoS := omit
929 }
930 }
931 }
932}
933
934/* 8.3.4 Activate Default EPS Bearer Context Accept */
935template (value) PDU_NAS_EPS
936ts_NAS_ActDefEpsBearCtxAck(template (value) BIT4 bearer_id,
937 template (value) BIT8 proc_tid,
938 template (omit) ProtocolConfigOptionsV pco) := {
939 protocolDiscriminator := c_EPS_NAS_PD_ESM,
940 ePS_messages := {
941 ePS_SessionManagement := {
942 pDU_NAS_EPS_ActDefEPSBearerContextAccept := {
943 ePSBearerIdentity := bearer_id,
944 procedureTransactionIdentifier := proc_tid,
945 messageType := '11000010'B,
946 protocolConfigOptions := ts_NAS_PCO_TLV(pco),
947 extendedProtocolConfigurationOptions := omit
948 }
949 }
950 }
951}
952template (present) PDU_NAS_EPS
953tr_NAS_ActDefEpsBearCtxAck(template (present) BIT4 bearer_id := ?,
954 template (present) BIT8 proc_tid := ?,
955 template ProtocolConfigOptionsV pco := *) := {
956 protocolDiscriminator := c_EPS_NAS_PD_ESM,
957 ePS_messages := {
958 ePS_SessionManagement := {
959 pDU_NAS_EPS_ActDefEPSBearerContextAccept := {
960 ePSBearerIdentity := bearer_id,
961 procedureTransactionIdentifier := proc_tid,
962 messageType := '11000010'B,
963 protocolConfigOptions := tr_NAS_PCO_TLV(pco),
964 extendedProtocolConfigurationOptions := *
965 }
966 }
967 }
968}
969
970
971/* 8.3.5 Activate Default EPS Bearer Context Reject */
972template (value) PDU_NAS_EPS
973ts_NAS_ActDefEpsBearCtxRej(template (value) BIT4 bearer_id,
974 template (value) BIT8 proc_tid,
975 template (value) ESM_CauseV cause) := {
976 protocolDiscriminator := c_EPS_NAS_PD_ESM,
977 ePS_messages := {
978 ePS_SessionManagement := {
979 pDU_NAS_EPS_ActDefEPSBearerContextReject := {
980 ePSBearerIdentity := bearer_id,
981 procedureTransactionIdentifier := proc_tid,
982 messageType := '11000011'B,
983 esmCause := cause,
984 protocolConfigOptions := omit,
985 extendedProtocolConfigurationOptions := omit
986 }
987 }
988 }
989}
990template (present) PDU_NAS_EPS
991tr_NAS_ActDefEpsBearCtxRej(template (present) BIT4 bearer_id := ?,
992 template (present) BIT8 proc_tid := ?,
993 template (present) ESM_CauseV cause := ?) := {
994 protocolDiscriminator := c_EPS_NAS_PD_ESM,
995 ePS_messages := {
996 ePS_SessionManagement := {
997 pDU_NAS_EPS_ActDefEPSBearerContextReject := {
998 ePSBearerIdentity := bearer_id,
999 procedureTransactionIdentifier := proc_tid,
1000 messageType := '11000011'B,
1001 esmCause := cause,
1002 protocolConfigOptions := *,
1003 extendedProtocolConfigurationOptions := *
1004 }
1005 }
1006 }
1007}
1008
1009
1010
1011
1012
1013}