Extend the UE 5GS Service Request path to carry `PDU session status` inside a NAS message container and cipher only that container value when valid NAS contexts exist. This aligns the initial Service Request handling with the TS 24.501 rules for non-cleartext IEs. Treat the generated Service Request as integrity-protected whenever an integrity context is available, and keep the post-request KgNB refresh aligned with the NAS UL count used for that protected message. Changes: - update `generateServiceRequest()` in `nr_nas_msg.c` to derive a `PDU session status` bitmap from configured UE PDU sessions and treat it as the non-cleartext trigger for the initial Service Request - build an inner plain Service Request carrying `PDU session status`, place it in the `NAS message container`, cipher only the container value with the NAS ciphering context, and keep the outer Service Request integrity protected - extend `fgs_service_request` lib to support optional `PDU session status` and `NAS message container` fields - decode known optional Service Request TLV IEs with a `switch` and skip unsupported ones - add `free_fgs_service_request()` and `eq_fgs_service_request()` - extend `nas_lib_test` to cover Service Request encoding and decoding with `PDU session status`, `NAS message container`, and skipped optional IEs, and initialize the test logging/config stubs - set the outgoing ngKSI with `set_fgs_ksi(nas)` instead of hardcoding `NAS_KEY_SET_IDENTIFIER_NOT_AVAILABLE` - move `initialNasMsg->nas_data` allocation into the protected and plain branches so each path allocates after its final size accounting - increment `nas->security.nas_count_ul` after integrity MAC computation - derive a refreshed KgNB with `derive_kgnb()` and send it through `nas_itti_kgnb_refresh_req()` after the protected Service Request is built Refs: - TS 24.501 §4.4.6 (protection of initial NAS signalling messages) - TS 24.501 §4.4.4.1 and §4.4.6 allow an initial Service Request to be integrity protected and unciphered when a valid 5G NAS security context exists and no NAS message container is included. - TS 24.501 §8.2.16.1 (Service Request message content) - TS 24.501 §8.2.16.3 (PDU session status) - TS 24.501 §9.11.3.33 (NAS message container) - TS 33.501 §6.4.3.1 (NAS integrity inputs) - TS 33.501 §6.4.4.1 (NAS confidentiality inputs) - TS 33.501 §6.8.1.2.2 derives KgNB from the UL NAS COUNT of the NAS message that moves the UE from CM-IDLE to CM-CONNECTED, unless a subsequent NAS Security Mode Complete exists, in which case that newer UL NAS COUNT becomes the freshness input. Signed-off-by: Guido Casati <guido.casati@openairinterface.org>
OpenAirInterface License
The source code is distributed under CSSL v1.0. Some files, such as for orchestration, are distributed under MIT license(MIT.txt). Documentation is distributed under Creative Commons Attribution 4.0 International license.
All the files without an explicit copyright header have an implicit "Copyright of OpenAirInterface Authors".
Please see NOTICE for other licenses which are used in the software.
In the past OAI source code has been re-licensed sometimes, here is the history:
- CSSL v1.0 starting tag 2026.w14
- OAI Public License v1.1 starting tag v1.0 till
af4b0d53 - OAI Public License v1.0: starting tag v.04 till v1.0
- GPL 3: starting tag v.0 till v.04 (only initial implementation of 4G)
Where to Start
- General overview of documentation
- The implemented features
- System Requirements for Using OAI Stack
- How to build
- How to run the modems
Not all information is available in a central place, and information for specific sub-systems might be available in the corresponding sub-directories. To find all READMEs, this command might be handy:
find . -iname "readme*"
RAN repository structure
The OpenAirInterface (OAI) software is composed of the following parts:
openairinterface5g
├── charts
├── ci-scripts : Meta-scripts used by the OSA CI process. Contains also configuration files used day-to-day by CI.
├── CMakeLists.txt : Top-level CMakeLists.txt for building
├── cmake_targets : Build utilities to compile (simulation, emulation and real-time platforms), and generated build files.
├── common : Some common OAI utilities, some other tools can be found at openair2/UTILS.
├── doc : Documentation
├── docker : Dockerfiles to build for Ubuntu and RHEL
├── executables : Top-level executable source files (gNB, eNB, ...)
├── maketags : Script to generate emacs tags.
├── nfapi : (n)FAPI code for MAC-PHY interface
├── openair1 : Layer 1 (3GPP LTE Rel-10/12 PHY, NR Rel-15 PHY)
├── openair2 : Layer 2 (3GPP LTE Rel-10 MAC/RLC/PDCP/RRC/X2AP, LTE Rel-14 M2AP, NR Rel-15+ MAC/RLC/PDCP/SDAP/RRC/X2AP/F1AP/E1AP), E2AP
├── openair3 : Layer 3 (3GPP LTE Rel-10 S1AP/GTP, NR Rel-15 NGAP/GTP)
├── openshift : OpenShift helm charts for some deployment options of OAI
├── radio : Drivers for various radios such as USRP, AW2S, RFsim, 7.2 FHI, ...
├── targets : Some configuration files; only historical relevance, and might be deleted in the future
└── tools : Tools for use by the developers/ci machines: code analysis and formatting
How to get support from the OAI Community
You can ask your question on the mailing lists.
Your email should contain below information:
- A clear subject in your email.
- For all the queries there should be [Query] in the subject of the email and for problems there should be [Problem].
- In case of a problem, add a small description.
- Do not share any photos unless you want to share a diagram.
- OAI gNB/DU/CU/CU-CP/CU-UP configuration file in
.confformat only. - Logs of OAI gNB/DU/CU/CU-CP/CU-UP in
.logor.txtformat only. - In case your question is related to performance, include a small description of the machine (Operating System, Kernel version, CPU, RAM and networking card) and diagram of your testing environment.
- Known/open issues are present on GitLab, so keep checking.
Always remember a structured email will help us understand your issues quickly.
