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