Skip to main content

Module codec

Module codec 

Source
Expand description

NGAP (3GPP TS 38.413) PDU structure, the IEs of the procedures NetGet speaks, and message builders — shared by the AMF (server) and the gNB (client).

§What is decoded and what is skipped

An NGAP PDU is a CHOICE of initiating / successful / unsuccessful message, each carrying a procedure code, a criticality and an open type holding a ProtocolIE-Container: a list of (id, criticality, open type) fields. decode_pdu walks that outer structure for every procedure, so any NGAP message can be framed, named and have its IE ids reported. The IE values are decoded only for the procedures listed in procedure_name’s implemented set: NG Setup, Initial UE Message, Downlink/Uplink NAS Transport, Error Indication, NG Reset and UE Context Release. An IE NetGet does not decode stays as its raw octets and is surfaced by id — the open-type framing is exactly what lets a receiver do that honestly.

Every value is checked against its ASN.1 constraint on the way in and on the way out, so an action cannot put a 33-bit gNB ID or an eleven-digit MCC on the wire.

§Bounds

MAX_PDU_LEN bounds the PDU, MAX_IES the IE count per container, MAX_NAS_PDU_LEN the NAS-PDU, and every SEQUENCE OF is bounded by its own 38.413 constraint and by MAX_LIST_ITEMS in total per decode, so the structure handed to the model is bounded however the peer nests its lists. No decoder here recurses.

Re-exports§

pub use aper::AperError as WireError;

Structs§

Budget
Counts list elements across one PDU so nested lists cannot multiply into an unbounded event.
Cause
An NGAP Cause: a group and an index in that group’s root (or, when extended, its extension list).
EncodeError
An encode refusal: what the action asked for cannot be put on the wire.
Ie
One ProtocolIE-Field, its value still an encoded open type.
InitialUe
The UE-associated fields of an Initial UE Message.
NasTransport
The fields of a Downlink or Uplink NAS Transport.
Pdu
One NGAP PDU with its IEs framed but not interpreted.
Plmn
A PLMN identity, three TBCD octets (TS 38.413 section 9.3.3.5, TS 24.008 figure 10.5.13).
ProtocolError
A PDU NetGet refuses, with the NGAP Cause that tells the peer why. The detail is for the log only; nothing in it is put on the wire.

Enums§

CauseGroup
Criticality
PduKind

Constants§

CHOICE_EXTENSIONS
Marker for the choice-Extensions index of a CHOICE with alternatives alternatives.
IE_AMF_NAME
IE_AMF_SET_ID
IE_AMF_UE_NGAP_ID
IE_CAUSE
IE_CRITICALITY_DIAGNOSTICS
IE_DEFAULT_PAGING_DRX
IE_FIVE_G_S_TMSI
IE_GLOBAL_RAN_NODE_ID
IE_NAS_PDU
IE_PLMN_SUPPORT_LIST
IE_RAN_NODE_NAME
IE_RAN_UE_NGAP_ID
IE_RELATIVE_AMF_CAPACITY
IE_RESET_TYPE
IE_RRC_ESTABLISHMENT_CAUSE
IE_SERVED_GUAMI_LIST
IE_SUPPORTED_TA_LIST
IE_TIME_TO_WAIT
IE_UE_ASSOCIATED_LOGICAL_NG_CONNECTION_LIST
IE_UE_CONTEXT_REQUEST
IE_UE_NGAP_IDS
IE_USER_LOCATION_INFORMATION
MAX_AMF_UE_NGAP_ID
MAX_IES
IEs accepted in one ProtocolIE-Container. The constraint allows 65535; the largest message in NetGet’s subset carries about ten.
MAX_LIST_ITEMS
SEQUENCE OF elements decoded per PDU, summed across every list in it.
MAX_NAS_PDU_LEN
Largest NAS-PDU accepted or written. A 5GMM message NetGet handles is under a hundred octets; 8 KiB leaves room for any capability container a UE might add without approaching the APER fragmentation threshold.
MAX_PDU_LEN
Largest NGAP PDU accepted or written. NGAP itself has no length field; this is the bound on one SCTP message (or one lab-transport frame).
MAX_RAN_UE_NGAP_ID
MISC_CONTROL_PROCESSING_OVERLOAD
MISC_HARDWARE_FAILURE
MISC_OM_INTERVENTION
MISC_UNKNOWN_PLMN
MISC_UNSPECIFIED
NAS_NORMAL_RELEASE
NAS_UNSPECIFIED
PPID
SCTP Payload Protocol Identifier for NGAP (TS 38.412 section 7).
PROC_AMF_CONFIGURATION_UPDATE
PROC_DOWNLINK_NAS_TRANSPORT
PROC_ERROR_INDICATION
PROC_INITIAL_UE_MESSAGE
PROC_NG_RESET
PROC_NG_SETUP
PROC_RAN_CONFIGURATION_UPDATE
PROC_UE_CONTEXT_RELEASE
PROC_UPLINK_NAS_TRANSPORT
PROTOCOL_ABSTRACT_SYNTAX_ERROR_REJECT
PROTOCOL_MESSAGE_NOT_COMPATIBLE_WITH_RECEIVER_STATE
PROTOCOL_SEMANTIC_ERROR
PROTOCOL_TRANSFER_SYNTAX_ERROR
PROTOCOL_UNSPECIFIED
RADIO_INCONSISTENT_REMOTE_UE_NGAP_ID
RADIO_UNKNOWN_LOCAL_UE_NGAP_ID
SCTP_PORT
SCTP port the AMF listens on (TS 38.412 section 7, IANA).

Functions§

amf_ue_ngap_id_ie
cause_ie
connection_list_ie
decode_amf_ue_ngap_id
decode_cause
decode_connection_list_ie
decode_global_ran_node_id
GlobalRANNodeID — gNB form decoded; ng-eNB and N3IWF forms named only.
decode_name
decode_nas_pdu
decode_pdu
Decode the outer structure of one NGAP PDU.
decode_plmn_support_list
decode_ran_ue_ngap_id
decode_relative_amf_capacity
decode_reset_type
ResetType: None is reset-all, Some(items) the partial form.
decode_served_guami_list
decode_supported_ta_list
decode_time_to_wait
decode_ue_ngap_ids
UE-NGAP-IDs: (amf_ue_ngap_id, Some(ran_ue_ngap_id)) for the pair form.
decode_user_location
UserLocationInformation: NR decoded fully, E-UTRA decoded, N3IWF named.
downlink_nas_transport
encode_pdu
Encode one NGAP PDU.
error_indication
global_gnb_id_ie
ie_name
Name of an IE id NetGet decodes, for events. Others are reported by number.
initial_ue_message
is_ue_associated
True when the PDU is UE-associated signalling — it carries an AMF or RAN UE NGAP ID — which TS 38.412 section 7 sends on a non-zero SCTP stream. Non-UE-associated signalling (NG Setup, NG Reset, a UE-less Error Indication) uses stream 0.
json_opt_u64
json_u64
name_ie
nas_pdu_ie
ng_reset
ng_reset_acknowledge
NG Reset Acknowledge; for a partial reset the list of connections reset is echoed (38.413 section 8.7.4.2.1).
ng_setup_failure
ng_setup_request
ng_setup_response
NG Setup Response from the model’s fields.
paging_drx_ie
parse_cause_message
NG Setup Failure, or any message carrying an optional Cause and Time to Wait.
parse_initial_ue_message
Initial UE Message (TS 38.413 section 9.2.5.1).
parse_nas_transport
Downlink (9.2.5.2) or Uplink (9.2.5.3) NAS Transport.
parse_ng_setup_request
NG Setup Request, decoded for the model (TS 38.413 section 9.2.6.1).
parse_ng_setup_response
NG Setup Response, decoded for the gNB’s model (TS 38.413 section 9.2.6.2).
peek
The procedure code and kind of an encoded PDU, read without decoding the rest.
plmn_support_list_ie
[{"plmn": {...}, "slices": [{"sst": 1, "sd": "010203"}]}]
procedure_name
Name of a procedure code, for logs and events. None for a code NetGet has no name for.
ran_ue_ngap_id_ie
relative_amf_capacity_ie
reset_type_ie
served_guami_list_ie
[{"plmn": {...}, "amf_region_id": 2, "amf_set_id": 1, "amf_pointer": 0}]
summarize
Every IE id of an encoded PDU, for logs; None when it does not decode.
supported_ta_list_ie
[{"tac": 1, "broadcast_plmns": [{"plmn": {...}, "slices": [{"sst": 1}]}]}]
time_to_wait_ie
ue_context_release_command
ue_context_release_complete
ue_ngap_ids_ie
uplink_nas_transport
user_location_nr_ie
NR user location: {"cgi": {"plmn", "cell_id"}, "tai": {"plmn", "tac"}}.

Type Aliases§

CodecResult
ConnectionItem
One UE-associatedLogicalNG-connectionItem: either id may be absent.
EncodeResult