13412 Commits

Author SHA1 Message Date
Jaroslava Fiedlerova
9c7b3d02e0 Merge remote-tracking branch 'sakthivelvelumani/ue-trs-support' into integration_2026_w28
UE: implement TRS processing in PHY (#199)

This PR implements PHY layer processing for CSI-RS tracking signal that
estimates the CFO and sends a frequency correction command to the radio
when CFO goes above a threshold of 500Hz.

A CI test is added with a GNU radio script between OCUDU gNB and the UE
that simulates a continuous frequency offset. The test passes if the UE
sends a frequency correction command.

Reviewed-by: Robert Schmidt <robert.schmidt@openairinterface.org>
Reviewed-by: Bartosz Podrygajlo <bartosz.podrygajlo@openairinterface.org>
Reviewed-by: Francesco Mani <email@francescomani.it>
2026-07-10 13:48:18 +02:00
Robert Schmidt
aff84037a7 Merge remote-tracking branch 'GuidoCasati/sdap-header-fix' into integration_2026_w28
SDAP header handling fixes (#249)

OAI SDAP treated SDAP header presence as a single PDU-session flag
(enable_sdap), so a valid asymmetric RRC config (UL header present, DL
header absent) caused the UE to parse downlink payload as an SDAP QFI
and drop traffic (e.g. IPv4 0x45 -> bogus QFI 5).

SDAP now follows RRC SDAP-Config per DRB and per direction from (TS
38.331 / TS 37.324). Header presence, QFI-to-DRB mapping, and
default-DRB fallback all derive from what RRC configured for each DRB.

In the new implementation, RRC (SDAP-Config IE) fills sdap_config_t per
DRB (role, defaultDRB, mapped QFIs), SDAP entity stores it in
qfi2drb_table + default_drb row to be used in the TX/RX data path.

Also, simplify mapping logic, improves E1 QoS-flow remap, and completes
UE reflective QoS mapping with the correct entity_role on new QFI rows.

Reviewed-by: Robert Schmidt <robert.schmidt@openairinterface.org>
Reviewed-by: Bartosz Podrygajlo <bartosz.podrygajlo@openairinterface.org>
2026-07-09 19:45:58 +02:00
Sakthivel Velumani
7729bab5af feature: Estimate CFO from CSI-RS tracking signal
TRS resources if configured by gnb, is present in two consequtive slots
and two symbols per slot. LS estimates from the first symbol is saved
and in second symbol frequency offset and time offset is estimated. The
estimated FO is saved in UE global structure which is used in the last
TRS slot. If the FO is above a threshold, the radio's center frequency
is adjusted.

Time offset is estimated but not used because time is already tracked
using PBCH DMRS.

Signed-off-by: Sakthivel Velumani <s.velumani@northeastern.edu>
2026-07-09 16:21:51 +00:00
Guido Casati
14b5bcb600 doc: clarify enable_sdap as RRC SDAP header policy
Log, param help, and rrc-usage.md described enable_sdap as toggling the
SDAP layer, while it only sets sdap-HeaderUL/DL in RRC SDAP-Config.

Signed-off-by: Guido Casati <guido.casati@openairinterface.org>
2026-07-09 15:04:11 +02:00
Guido Casati
223fd132e0 sdap: rename pdcp_entity to drb_id
In nr_sdap_rx_entity, the RX callback receives the DRB identity from PDCP
(drb-Identity). Rename pdcp_entity to drb_id to be aligned with TS 37.324 terminology.

Changes:
- Rename the RX callback argument through the full SDAP RX surface:
sdap_data_ind(), the rx_entity function pointer table, and nr_sdap_rx_entity().

Signed-off-by: Guido Casati <guido.casati@openairinterface.org>
2026-07-09 12:21:03 +02:00
Guido Casati
7d029ed5b1 fix (sdap): copy entity_role on reflective QoS mapping
After new per-DRB SDAP roles changes, UE downlink reflective mapping
(TS 37.324 §5.3.2) still stored only drb_id on the new QFI row.
entity_role stayed NO_SDAP_HEADER, so later uplink TX and §5.3.1
end-marker logic read the wrong header config from that row.

When storing the reflective UL rule, copy the receiving DRB entity_role
(from nr_sdap_drb_lookup) together with drb_id, matching qfi2drb_map_add.

Changes:
- nr_sdap_rx_entity(): set qfi2drb_table[qfi].entity_role on RDI store

Refs:
- TS 37.324 §5.3.1, §5.3.2
- TS 38.331 SDAP-Config (sdap-HeaderUL / sdap-HeaderDL)

Signed-off-by: Guido Casati <guido.casati@openairinterface.org>
2026-07-09 12:21:03 +02:00
Guido Casati
991ede5c59 rrc: simplify E1 SDAP header present flags in fill_e1_drb_to_setup
In fill_e1_drb_to_setup(), derive E1 SDAP-Config header-present booleans
with logical negation instead of redundant ternary expressions.

Changes:
- NGAP: sDAP_Header_UL/DL assignment in fill_e1_drb_to_setup()

Signed-off-by: Guido Casati <guido.casati@openairinterface.org>
2026-07-09 12:21:03 +02:00
Guido Casati
f34ecdd021 sdap: validate gNB UL RX QFI via qfi2drb_map and receiving DRB
Parent commits route QFI-to-DRB lookup through qfi2drb_map (including
default-DRB fallback per TS 37.324 clause 5.2.1), but gNB UL RX still
checked the raw mapping table and accepted any mapped QFI on whatever
DRB received the PDU.

On gNB UL SDAP PDUs with a header, nr_sdap_rx_entity resolves the QFI
through entity->qfi2drb_map, drops when no rule and no default DRB apply,
and drops when the resolved DRB does not match the receiving DRB before
GTP-U forwarding.

Changes:
- parse UL header with nr_sdap_ul_hdr_t
- call qfi2drb_map for QFI validation
- verify receiving-DRB match
- simplify gNB UL block

Refs:
- TS 37.324 clause 5.2.1 (Uplink), clause 6.2.2.3 (UL data PDU)

Signed-off-by: Guido Casati <guido.casati@openairinterface.org>
2026-07-09 12:21:03 +02:00
Guido Casati
96dc20010e sdap: pass sdap_config_t through E1 QoS-flow remap
E1 DRB-To-Modify already carries the new QFI list. The old
nr_sdap_entity_update_qos_flows() duplicated that as a bare qfi[] plus other params
while map_update expects a full sdap_config_t (add/release lists and per-DRB
role). Route the E1 path through one struct instead.

Changes:
- nr_sdap_entity_update_qos_flows(): take sdap_config_t *, caller fills the struct,
  function sets role and defaultDRB from qfi2drb_table, builds mappedQFIs2Release
  for QFIs dropped from the DRB, then calls qfi2drb_map_update()
- cucp_cuup_handler.c: build stack sdap_config_t from E1 qosFlows[] and call
  the new API

Signed-off-by: Guido Casati <guido.casati@openairinterface.org>
2026-07-09 12:21:03 +02:00
Guido Casati
1edb0a09bb fix (sdap): select RX/TX SDAP headers on per-DRB RRC role
A DRB may have an uplink SDAP header but no downlink header (valid TS 38.331).
The old entity->enable_sdap flag was true if either direction had a header, so UE
downlink wrongly read byte 0 as QFI. IPv4 payloads start with 0x45 -> bogus QFI 5
and dropped traffic before the TUN (PR !158).

Header presence must follow TS 37.324 §5.2.1/§5.2.2 per DRB and direction, not a
single PDU-session-wide enable-sdap.

Also, store the default DRB as a `qfi2drb_t` mapping in the SDAP entity and use
it directly for fallback paths.

Changes:
- Add nr_sdap_drb_lookup() to return first qfi2drb_table row for a DRB
- nr_sdap_rx_entity(): parse QFI only when the receiving direction has a header,
  drop if the DRB has no table row
- nr_sdap_tx_entity(): UL/DL TX header bits from qfi2drb_map() (drb_id + entity_role),
  including default-DRB fallback
- nr_sdap_qfi2drb(): const qfi2drb_t *, remove SDAP_MAP_RULE_EMPTY
- nr_sdap_map_ctrl_pdu(): handle NULL from qfi2drb_map
- nr_sdap_qfi2drb_map_update(): sync entity_role on
  all QFIs for the DRB. At most one DRB when both headers absent.
- nr_sdap_entity_update_qos_flows(): keep per-DRB role from nr_sdap_drb_lookup(),
  skip update when DRB has no row
- Cleanup entity->enable_sdap
- nr_sdap.c: remove TUN-thread QFI drop, tx_entity owns unmappable-QFI handling
- replace default_drb with qfi2drb_t default_drb in SDAP entity and init
  default DRB id+role at SDAP entity creation

Refs:
- PR #158
- TS 37.324 §5.2.1, §5.2.2, §6.2.2.1
- TS 38.331 SDAP-Config (sdap-HeaderUL / sdap-HeaderDL)

Signed-off-by: Guido Casati <guido.casati@openairinterface.org>
2026-07-09 12:21:03 +02:00
Robert Schmidt
d86bad7915 Merge remote-tracking branch 'PC-OC/scfdma-uplink-scheduler-rbsize' into integration_2026_w28
Enforce N_PRB=2^x3^y5^z in SC-FDMA uplink scheduler (#247)

With SC-FDMA, the scheduler in uplink needs to schedule N_PRB=2^x3^y5^z.
Not enforcing it may lead to unwanted UE behavior like retransmissions
and re-establishments.

TS38.211 - 6.3.1.4

Reviewed-by: Francesco Mani <email@francescomani.it>
Reviewed-by: Robert Schmidt <robert.schmidt@openairinterface.org>
2026-07-06 18:28:55 +02:00
Robert Schmidt
fcf078b18c Merge remote-tracking branch 'GuidoCasati/rrc-fixes' into integration_2026_w28
RRC fixes (#225)

- Hardens NR RRC re-establishment handling on the gNB and UE:
  re-establishment requests with invalid PCI/C-RNTI or incomplete UE
  context are rejected or fall back to RRCSetup per TS 38.33.
- Fixes an invalid post-release connected state after PDU session
  teardown
- Stops gNB process aborts when a UE sends spare RRC establishment-cause
  values.
- Fix RRCSetup fallback: the UE MAC layer is reset before bearer
  teardown on RRCSetup fallback to avoid scheduler use of released RLC
  entities.

Closes: #127
Closes: #128
Closes: #148
Reviewed-by: Robert Schmidt <robert.schmidt@openairinterface.org>
Reviewed-by: Francesco Mani <email@francescomani.it>
2026-07-06 18:28:16 +02:00
Calvin Peyron
fe56b68514 Remove trailing spaces
Signed-off-by: Calvin Peyron <calvin.peyron@open-cells.com>
2026-07-06 11:54:57 +02:00
Calvin Peyron
ad304b62d6 With SC-FDMA, scheduler in uplink needs to schedule N_PRB=2^x3^y5^z
Signed-off-by: Calvin Peyron <calvin.peyron@open-cells.com>
2026-07-06 11:54:50 +02:00
Robert Schmidt
69a017f57b Merge remote-tracking branch 'Thecave3/e3-agent-framework' into integration_2026_w27
Implementation of the E3 Agent for dApps and E3AP (no service models) (#204)

These changes introduce an E3 Agent for dApps in the OAI codebase. dApps
are real-time microservices designed to operate within the O-RAN
ecosystem, enabling sub-10 ms Artificial Intelligence (AI) routines in
the Radio Access Network (RAN).

The E3 Agent enables spectrum sensing, frequency-domain signal logging,
and dynamic PRB (Physical Resource Block) policies through IPC/ZMQ
communication with dApps or xApps.

The dApps are designed for co-location with the CU/DU, where it can
interact directly with user-plane data to enable different network
management scenarios such as optimizing network slicing, scheduling, and
resource management.  A python library for the creation of the dApps is
available here [1].

Additional information about dApps:

- Paper on the dApp architecture [2]
- dApp framework presentation [3]
- Tutorial on dApp deployment on OAI [4]

As agreed in the original MR [5], this PR includes only the agent lifecycle,
configuration parsing, build plumbing, and the nr-softmodem init/destroy
hook.

It registers zero service models, so it builds and runs as an idle
agent. Concrete service models (e.g. spectrum sensing) and the PHY/MAC
hooks that drive them follow in later PRs.

Opt-in and dependencies

- Gated behind the E3_AGENT CMake option (OFF by default) / the
  --build-e3 build flag.  The default build is unaffected — e3ap is only
  compiled and linked into nr-softmodem when E3_AGENT=ON.

- When enabled, requires the external libe3 library [6] (vendor-neutral
  E3AP C++ lib), discovered via pkg_check_modules(CLIBE3 REQUIRED
  libe3). It is not vendored.

  Install libe3 (Debian/Ubuntu):

      git clone https://github.com/wineslab/libe3 && cd libe3
      ./build_libe3 -I      # installs deps: build-essential cmake pkg-config libzmq3-dev asn1c nlohmann-json3-dev libsctp-dev ...
      ./build_libe3 --install      # release build + installation

Build & test

Tested in RFsim: the gNB initializes the E3 agent, opens its setup
socket (/tmp/dapps/setup), registers zero service models, and runs
without crashing.  Configuration

The agent reads an optional E3Configuration section from the gNB config
file (parsed only when E3_AGENT=ON). If absent, it falls back to
built-in defaults (posix/ipc).

    E3Configuration : {
        link = "zmq";        # posix | zmq
        transport = "ipc";   # tcp | sctp | ipc
    };

The same parameters can be overridden on the command line (no
config-file edit required):

    sudo ./nr-softmodem -O <gnb.conf> ... --E3Configuration.link zmq --E3Configuration.transport ipc

Validated link/transport combinations: (zmq,ipc) (zmq,tcp) (posix,tcp)
(posix,sctp) (posix,ipc).

Notes

- I have added a new log component E3AP specific for the ops performed
  by the E3 Agent.
- This PR ships no gNB config file; the E3Configuration block / CLI
  override above is the documented way to enable the agent. Example
  configs follow in the next PRs.

[1] https://pypi.org/project/dapps/
[2] https://arxiv.org/pdf/2501.16502
[3] https://openrangym.com/o-ran-frameworks/dapps
[4] https://openrangym.com/tutorials/dapps-oai
[5] https://gitlab.eurecom.fr/oai/openairinterface5g/-/merge_requests/3361
[6] https://github.com/wineslab/libe3

Reviewed-by: Teodora Vladić <teodora.vladic@openairinterface.org>
Reviewed-by: Sagar Arora <sagar.arora@openairinterface.org>
Reviewed-by: Robert Schmidt <robert.schmidt@openairinterface.org>
2026-07-02 18:35:23 +02:00
Andrea Lacava
602d729d43 e3ap: add README with dApp overview, prerequisites, and startup guide
Signed-off-by: Andrea Lacava <thecave003@gmail.com>
2026-07-02 09:55:05 -04:00
Andrea Lacava
29c20ac232 e3ap: add E3 agent lifecycle and nr-softmodem init hook
Add the E3 agent lifecycle on top of libe3: configuration mapping,
agent creation/init/start, dApp report and status-change handlers,
and xApp control and subscription-query helpers. Wire e3_init() and
e3_destroy() into nr-softmodem under the E3_AGENT guard.

The agent registers no concrete service models: service models (such
as spectrum sensing) live in their own modules and register
themselves, keeping the framework decoupled from any specific use
case.

Signed-off-by: Andrea Lacava <thecave003@gmail.com>
2026-07-02 09:53:52 -04:00
Andrea Lacava
0a885dcf5a e3ap: add E3 agent configuration and CMake target
Add the E3AP CMake target, which links the external libe3 library
discovered via pkg-config, and the E3Configuration parser that reads
the link and transport selection from the gNB configuration file and
validates the supported link/transport combinations.

libe3 is kept external and is only required when E3_AGENT is enabled.

Signed-off-by: Andrea Lacava <thecave003@gmail.com>
2026-07-02 09:53:16 -04:00
Andrea Lacava
447ff67aba build: add opt-in E3_AGENT build option for the O-RAN E3 agent
Introduce the E3_AGENT CMake option (default OFF) and the matching
--build-e3 flag in build_oai so the E3 agent for O-RAN dApps can be
compiled opt-in. Gate the E3AP subdirectory and the nr-softmodem
linkage behind the option, and register an E3AP log component
together with its legacy T-tracer message IDs.

The E3 interface (nGRG) lets the gNB exchange real-time reports and
controls with external dApps. Keeping it behind a build flag leaves
the default CI build unchanged and avoids pulling in the external
libe3 dependency unless the agent is explicitly requested.

Signed-off-by: Andrea Lacava <thecave003@gmail.com>
2026-07-02 09:51:58 -04:00
Robert Schmidt
465b57d8c5 Merge remote-tracking branch 'rorsc/more-cleanup-split8-api' into integration_2026_w27
Clean up openair0_device, remove eth_params usage in L2/L3 (#243)

This PR has three goals

- Remove the usage of eth_params in L2/L3 code, and replace with
  tailored data structures for IP connectivity where necessary
- Remove many of the includes of common_lib.h where possible
- Slightly clean up openair0_device and in particular move fields to
  eth_state_t where appropriate

Reviewed-by: Bartosz Podrygajlo <bartosz.podrygajlo@openairinterface.org>
Reviewed-by: Teodora Vladić <teodora.vladic@openairinterface.org>
2026-07-02 14:55:07 +02:00
Guido Casati
860232782a fix (NGAP/RRC): map spare RRC establishment causes to NGAP notAvailable
A UE RRCSetupRequest with establishmentCause in the spare range (10–15)
could abort nr-softmodem: RRC asserted on cause >= NGAP_RRC_CAUSE_LAST,
and cause 11 failed NGAP ASN.1 encode when passed through by index.

NR RRC (TS 38.331) and NGAP RRCEstablishmentCause (TS 38.413 §9.3.1.111)
do not share one integer namespace: spare values must not be sent
as NGAP causes.

Remove the RRC AssertFatal on causes. When building
InitialUEMessage, map RRC indices 0–9 to the matching NGAP cause
and map anything else to notAvailable, as specified for unmapped UE
causes.

Changes:
- Drop establishment-cause range AssertFatal in rrc_gNB_send_NGAP_NAS_FIRST_REQ
- Add rrc2ngap_establishment_cause() and use it for InitialUEMessage RRCEstablishmentCause
- Remove redundant DevCheck on establishment_cause in ngap_gNB_handle_nas_first_req
- Adopt mapping logic in rrc_gNB_send_NGAP_NAS_FIRST_REQ

Closes: #127

Signed-off-by: Guido Casati <guido.casati@openairinterface.org>
2026-07-02 14:12:30 +02:00
Guido Casati
e179a6df8f fix (UE RRC): queue MAC reset before RLC teardown on RRCSetup fallback
When the gNB answers RRCReestablishmentRequest with RRCSetup (TS 38.331
clause 5.3.3.4 fallback), the UE must release all bearers except SRB0 before
applying the new masterCellGroup. CONFIG_RESET was queued after RLC release,
so the MAC slot thread kept polling LCID 1 from a stale lc_ordered_list while
the RLC entity was already NULL.

Queue NR_MAC_RRC_CONFIG_RESET (RRC_SETUP_REESTAB_RESUME) first, then release
PDCP, RLC, and SDAP. On the MAC thread, clear lc_ordered_list except SRB0
before release_mac_configuration() so the UL scheduler stops looping released
logical channels until CONFIG_CG re-adds SRB1.

Changes:
- rrc_UE.c: move CONFIG_RESET to the start of nr_rrc_rrcsetup_fallback()
- config_ue.c: drop non-SRB0 lc_ordered_list entries on RRC_SETUP_REESTAB_RESUME

Closes: #128

Signed-off-by: Guido Casati <guido.casati@openairinterface.org>
2026-07-02 14:12:30 +02:00
Guido Casati
1c659403b7 fix (RRC): log in nr_rrc_rrcsetup_fallback
Signed-off-by: Guido Casati <guido.casati@openairinterface.org>
2026-07-02 14:12:30 +02:00
Guido Casati
1a1502ac5a fix (gNB RRC): release RRC connection after last DRB
TS 38.331 §5.3.1.1 forbids RRC_CONNECTED with SRB2 and zero DRBs.
Releasing all DRBs must release the RRC connection.

After PDU session release (3GPP TS 23.502 §4.3.4.2), OAI left
SRB2 up and COTS UEs could re-establish into an invalid configuration.

On NGAP PDU Session Release Response, if no DRBs remain and SRB2 is
active, send NGAP UE Context Release Request. AMF Command drives
RRCRelease on the existing CU-CP path.

Closes: #148

Signed-off-by: Guido Casati <guido.casati@openairinterface.org>
2026-07-02 14:12:30 +02:00
Guido Casati
cb9dab74e3 fix (gNB RRC): skip CU-UP notify on re-estab without DRBs
Avoid E1 bearer modification when the UE has no DRBs left (e.g. after PDU
session release). (TS 38.331 clause 5.3.5.6.5 DRB with reestablishPDCP)

Changes:
- cuup_notify_reestablishment(): return early if drbs is empty

Fixes: #148

Signed-off-by: Guido Casati <guido.casati@openairinterface.org>
2026-07-02 14:12:30 +02:00
Guido Casati
f79f5087e5 RRCReestablishmentRequest: add doxygen documentation
Signed-off-by: Guido Casati <guido.casati@openairinterface.org>
2026-07-02 14:12:30 +02:00
Guido Casati
f5aaacd9e8 RRCReestablishmentRequest: replace random value magic number with constant
Replace the magic number 0x7fffffffff used for masking 39-bit random
values with a named constant NR_RRC_RANDOM_VALUE_39_BIT_MASK defined
in nr_rrc_defs.h.

Refs:
- TS 38.331 5.3.3.3: Random UE identity (39-bit values)

Signed-off-by: Guido Casati <guido.casati@openairinterface.org>
2026-07-02 14:12:30 +02:00
Guido Casati
cde7d98a61 RRCReestablishmentRequest: add C-RNTI constants and fix spec compliance
Replace hardcoded C-RNTI range values (0x1, 0xffef) with named constants
NR_C_RNTI_MIN and NR_C_RNTI_MAX. Correct maximum value to 0xfff2 per TS 38.321
Table 7.1-1. Change invalid C-RNTI handling to return early instead of
fallback to RRCSetup for spec compliance.

Fallback to RRCSetup only occurs when UE context cannot be retrieved,
not for validation errors, which for out-of-range values could
come from malicious UEs.

Major changes:
- Add NR_C_RNTI_MIN (0x0001) and NR_C_RNTI_MAX (0xfff2) constants to
  common/platform_constants.h
- Replace magic numbers in C-RNTI validation with named constants
- Change error path from fallback_rrc_setup to return for invalid C-RNTI
- Early validation before further processing

Signed-off-by: Guido Casati <guido.casati@openairinterface.org>
2026-07-02 14:12:29 +02:00
Guido Casati
d568920466 RRCReestablishmentRequest: add input parameters validation
Add defensive parameter checks at the start of
rrc_handle_RRCReestablishmentRequest to prevent NULL pointer
dereferences and invalid assoc_id handling.

Signed-off-by: Guido Casati <guido.casati@openairinterface.org>
2026-07-02 14:03:24 +02:00
Guido Casati
2716a5a3dc RRCReestablishmentRequest: add PCI range validation
Add validation of physCellId against valid range (0-1007) per TS 38.331
specification. Invalid PCI values are now rejected early in the
reestablishment procedure.

This prevents processing of invalid reestablishment requests with
out-of-range PCI values, improving robustness and spec compliance.

Major changes:
- Add NR_PHYS_CELL_ID_MAX to common/platform_constants.h
- Add PCI range check in rrc_handle_RRCReestablishmentRequest() before
  cell lookup, returning early on invalid values

Signed-off-by: Guido Casati <guido.casati@openairinterface.org>
2026-07-02 14:03:24 +02:00
Guido Casati
ede596cfc7 RRCReestablishmentRequest: note RRCSetup fallback when UE context is missing
Signed-off-by: Guido Casati <guido.casati@openairinterface.org>
2026-07-02 14:03:24 +02:00
Guido Casati
33ff225739 fix (RRC): add SRB2 and DRB validation checks for reestablishment
Add validation checks per TS 38.331 5.3.7.1 to ensure SRB2 and at
least one DRB are active before processing RRC reestablishment
requests. Use more specific NGAP cause code for procedure failures.

Reestablishment requests without SRB2 or DRB setup now properly
fall back to RRC setup with appropriate NGAP cause indication

Major changes:
- Add SRB2 active check before processing reestablishment
- Add DRB active check (at least one DRB required)

Signed-off-by: Guido Casati <guido.casati@openairinterface.org>
2026-07-02 14:03:24 +02:00
Robert Schmidt
c5d1895540 Merge remote-tracking branch 'origin/dlsim_type0_test' into integration_2026_w27
DLSIM test for type0 PDSCH frequency allocation (#192)

Adding the test requires some changes in gNB L2 structures but it
doesn't implement the full support of type0 allocation in L2

Reviewed-by: Robert Schmidt <robert.schmidt@openairinterface.org>
2026-07-02 13:34:58 +02:00
Robert Schmidt
326f2a0cfb Merge remote-tracking branch 'aswanthkc/fix-check-sa/nsa' into integration_2026_w27
fix: proper SA/NSA mode detection (#233)

Use IS_SA_MODE(get_softmodem_params()) for proper SA/NSA check

Reviewed-by: Robert Schmidt <robert.schmidt@openairinterface.org>
2026-06-30 12:30:58 +02:00
Robert Schmidt
61a1e8c0d8 Remove common_lib.h includes
After having removed eth_params_t from all L2/L3 files, we can reduce
the scope of common_lib.h, and remove the include from many files.

Signed-off-by: Robert Schmidt <robert.schmidt@openairinterface.org>
2026-06-30 11:34:09 +02:00
Robert Schmidt
bc32bf8875 Remove eth_params_s from nr_mac_gNB.h
We don't actually configure ethernet paramaters, only IP. Further, the
appropriate type f1ap_net_config_t already exists, so use this instead.

Signed-off-by: Robert Schmidt <robert.schmidt@openairinterface.org>
2026-06-30 11:34:08 +02:00
Robert Schmidt
9f5ac5ac8e Remove eth_params_t from configure_nr_nfapi_vnf()
There are no ethernet parameters to be configured, and it can be
simplified.

Signed-off-by: Robert Schmidt <robert.schmidt@openairinterface.org>
2026-06-30 11:34:08 +02:00
Robert Schmidt
ac738ae714 Remove RRC eth_params
In 4G, it's not used.
In 5G, there is no need, as we can pass it directly to the CU task.

Signed-off-by: Robert Schmidt <robert.schmidt@openairinterface.org>
2026-06-30 11:34:08 +02:00
Robert Schmidt
6f7a26d681 Remove duplicate code
The same code is further up.

Signed-off-by: Robert Schmidt <robert.schmidt@openairinterface.org>
2026-06-30 11:34:08 +02:00
Robert Schmidt
6d437cffcf Remove unused MAC.eth_params_s
This field is used as an intermediate "storage facility", but is never
really used. Besides, in the MAC, we store IP information, not Ethernet
information, so it's wrong anyway.

Also remove memory leaks through strdup(), the pointer lifetime is
smaller than that of MacRLC_ParamList.

Signed-off-by: Robert Schmidt <robert.schmidt@openairinterface.org>
2026-06-30 11:34:08 +02:00
aswanthkc
52c53c868f fix: proper SA/NSA mode detection
- Use IS_SA_MODE(get_softmodem_params()) for proper SA/NSA check

Signed-off-by: aswanthkc <a.kallangaattuvalasu@northeastern.edu>
2026-06-29 21:33:16 +00:00
Francesco Mani
fe211685ec setup DLSIM to test type0 DLSCH allocation
Signed-off-by: Francesco Mani <email@francescomani.it>
2026-06-29 16:21:38 +02:00
Francesco Mani
eba9f272ce include options for allocation type in sched_pdsch
(set to type1 in all scenarios)

Signed-off-by: Francesco Mani <email@francescomani.it>
2026-06-29 16:07:15 +02:00
Robert Schmidt
633b6de92a Merge remote-tracking branch 'venkatareddy453/ngap-pathswitch-and-ack-for-xnho' into integration_2026_w26
NGAP Procedures for Xn Handover: Path Switch Request Path Switch Request Acknowledge (#194)

This PR adds the following NGAP Path Switch procedures to support Xn
handover in accordance with 3GPP TS 38.413v16.2.0.

NGAP Path Switch Request: add encode and ITTI support

- Add a case in TASK_NGAP to support ITTI message from RRC to NGAP
- Add Path Switch Request message type definitions
- Implement encoder for Path Switch Request (3GPP TS 38.413v16.2.0
  §9.2.3.8)
  * RAN UE NGAP ID (M)
  * Source AMF UE NGAP ID (M)
  * User Location Information (M)
  * UE Security Capabilities (M)
  * PDU Session Resource to be Switched in Downlink List (M)
- Add required ASN.1 header includes for Path Switch Request IEs

NGAP Path Switch Request Acknowledge: add decode and handler

- Add handler at NGAP for Path Switch Request Acknowledge from AMF
- Add Path Switch Request Acknowledge message type definitions
- Implement decoder for Path Switch Request Acknowledge (3GPP TS
  38.413v16.2.0 §9.2.3.9)
  * AMF UE NGAP ID (M)
  * RAN UE NGAP ID (M)
  * Security Context (M)
  * PDU Session Resource Switched List (M)
  * Allowed NSSAI (M)
- Add required ASN.1 header includes for Path Switch Request Acknowledge
  IEs

Notes:

- Added a case NGAP_PATH_SWITCH_REQ in task_ngap to support ITTI message
  from RRC, and this will be allocated at
- RRC when the target gNB receives the RRC complete message from the UE
  during Xn handover.
- OAI CN5G does not support any of the NGAP path switch procedures
  (request, ack, and failure) as of today to test Xn Handover.
- We tested the procedures in an E2E setup at IISc with two gNBs in
  E1+F1+7.2x split containing the Xn handover code and connected to the
  same 5G core (used Open5GS & Aether-OnRamp separately), and also did
  not observe any Path Switch Failure.
- The implementation of Path Switch Failure at OAI RAN will be done
  along with the implementation of Path Switch procedures in OAI CN5G
  once the XNAP integration in OAI RAN is complete.

Acknowledgement:

> This work has been partially carried out as part of Xn Handover
development at the Indian Institute of Science (IISc), Bengaluru.

Reviewed-by: Robert Schmidt <robert.schmidt@openairinterface.org>
Reviewed-By: Guido Casati <guido.casati@openairinterface.org>
2026-06-29 09:17:07 +02:00
Venkatareddy Akumalla
829d6fe7cf NGAP Path Switch Request Acknowledge: add decode and handler
- Add handler at NGAP for Path Switch Request Acknowledge from AMF
- Add Path Switch Request Acknowledge message type definitions
- Implement decoder for Path Switch Request Acknowledge
  (Reference: 3GPP TS 38.413 §9.2.3.9)
    - AMF UE NGAP ID (M)
    - RAN UE NGAP ID (M)
    - Security Context (M)
    - PDU Session Resource Switched List (M)
    - Allowed NSSAI (M)
- Add required ASN.1 header includes for Path Switch Request Acknowledge IEs

Co-authored-by: Rakesh BB <rakesh.bb@fsid-iisc.in>
Signed-off-by: Venkatareddy Akumalla <venkatareddy.akumalla@openairinterface.org>
2026-06-26 10:09:29 +00:00
Venkatareddy Akumalla
db7dbda8e2 NGAP Path Switch Request: add encode and ITTI support
- Add a case in TASK_NGAP to support ITTI message from RRC to NGAP
- Add Path Switch Request message type definitions
- Implement encoder for Path Switch Request (3GPP TS 38.413v16.2.0 §9.2.3.8)
    - RAN UE NGAP ID (M)
    - Source AMF UE NGAP ID (M)
    - User Location Information (M)
    - UE Security Capabilities (M)
    - PDU Session Resource to be Switched in Downlink List (M)
- Add required ASN.1 header includes for Path Switch Request IEs

Co-authored-by: Rakesh BB <rakesh.bb@fsid-iisc.in>
Signed-off-by: Venkatareddy Akumalla <venkatareddy.akumalla@openairinterface.org>
2026-06-26 10:09:12 +00:00
Robert Schmidt
716c29fe1f Merge remote-tracking branch 'GuidoCasati/issue-212' into integration_2026_w26
fix (f1ap): DRB-Information criticality and non-dynamic fiveQI handling in DU (#223)

Aligns OAI F1AP encoding with TS 38.473 for DRB-Information criticality
on UE Context Modification, and clarifies how non-dynamic fiveQI is
handled across F1AP/E1AP decode and CU RRC.

Non-dynamic fiveQI may name standardized or pre-configured profiles on
the wire (0..255). F1/E1 libs now accept the full ASN range and reject
only out-of-range values. Pre-configured and other non-standardized
non-dynamic 5QI remain unsupported at RRC via the existing
is_5qi_standardized() skip.

DU is now gracefully handling unsupported 5QIs instead of crashing.

Closes: #212
Reviewed-by: Robert Schmidt <robert.schmidt@openairinterface.org>
2026-06-26 11:55:34 +02:00
Guido Casati
5f2108edb0 fix (mac): gracefully handle unsupported 5QIs on DRB setup
When a CU sends a DRB with a non-dynamic 5QI that is not in the
DU MAC lookup table, get_non_dynamic_priority() used to AssertFatal and
abort. Return -1 and log a warning instead, and skip flows with negative
priority when deriving the logical-channel priority so setup can continue.

A more spec-aligned fix would require F1AP UE Context Setup/Modification
Failure (not implemented) in case of a logical error in the DU:

> Where the logical error occurs in a request message of a class 1 procedure,
> and the procedure has a message to report this unsuccessful outcome,
> this message shall be sent with an appropriate cause value.

Signed-off-by: Guido Casati <guido.casati@openairinterface.org>
2026-06-25 12:53:24 +02:00
Sakthivel Velumani
7032477784 log: fix typo in printing mac stats
Signed-off-by: Sakthivel Velumani <s.velumani@northeastern.edu>
2026-06-23 13:54:46 +00:00
Guido Casati
7e0c0fe18b fix (f1ap,e1ap,rrc): accept ASN non-dynamic fiveQI at lib decode
Non-dynamic fiveQI on F1AP/E1AP may name standardized or pre-configured
profiles (TS 38.473), the range is 0..255. Decode now accepts
MIN_FIVEQI..MAX_FIVEQI (0..255) and fails only when fiveQI is outside
that range. Pre-configured and other non-standardized non-dynamic values
remain unsupported: RRC still skips them via is_5qi_standardized().

Changes:
- F1AP/E1AP: range-check 0..255 only
- improve documentation

Refs:
- 3GPP TS 38.473 §9.3.1.49 (non-dynamic standardized or pre-configured 5QI)
- 3GPP TS 23.501 §5.7.2.1

Signed-off-by: Guido Casati <guido.casati@openairinterface.org>
2026-06-23 12:55:42 +02:00