- Fix vrtsim uneven antenna configurations
- Fix shm_td_iq_channel client-server SHM race
- Set shm size to 2G in unit test docker run to prevent out-of-memory errors
Closes: #130
Signed-off-by: Bartosz Podrygajlo <bartosz.podrygajlo@openairinterface.org>
Move the initial IPC from file-based to Unix Domain Socket. The server
keeps a lightweights UDS accept / write thread while the clients attempt
to connect / read from the socket. This makes the communication more robust
because if the server process exits, it will always result in a failure to
connect from the client. With file-based IPC this was not always the case.
Assisted-by: Gemini-3.5:Flash
Closes: #125
Signed-off-by: Bartosz Podrygajlo <bartosz.podrygajlo@openairinterface.org>
Prior commits stored PCCH parameters and can decode P-RNTI,
this commit schedules PDCCH monitoring at the right TTIs.
In camped idle the UE must listen for network paging on P-RNTI only on
the correct paging frame (PF) and paging occasion (PO), only if the
paging common search space is set.
On monitor_paging_dci() success it adds P-RNTI to the downlink DCI
config for the existing PHY/MAC paging decode path.
Changes:
- Add monitor_paging_dci():
- resolve paging_SS_id, call config_dci_pdu(TYPE_P_RNTI_) only
when monitor_paging_dci() is true.
- require is_ss_monitor_occasion on the paging search space
- validate T/N/Ns from mac->paging_cfg
- apply TS 38.304 §7.1 PF and i_s
- PF via nr_pcch_sfn_is_pf
- PO index i_s via nr_pcch_po_index
- non-zero type-2 PO window via nr_pcch_type2_po_mo_in_range
Refs:
- 3GPP TS 38.304 §7.1 (PF/PO)
- 3GPP TS 38.213 §10.1 (PDCCH monitoring for paging)
Signed-off-by: Guido Casati <guido.casati@openairinterface.org>
Keep normal no-redirection RRCRelease on the acquired
camped-cell context while preserving the existing full
GO_TO_IDLE cell-selection path for other idle transitions.
Changes:
- Add UE_IDLE and GO_TO_IDLE_KEEP_CAMPED to represent camped
idle without starting RA.
- Map no-redirection RRCRelease to GO_TO_IDLE_KEEP_CAMPED and
keep SIB1 validity for that path.
- Release connected-mode MAC/BWP0 dedicated config while
preserving common BWP0 and paging PDCCH context.
- Keep the existing full GO_TO_IDLE cleanup for idle transitions
that must perform cell selection.
Refs:
- TS 38.331 §5.3.11
- TS 38.304 §5.2.5, §5.2.6, §7.1
- TS 38.321 §5.12
Signed-off-by: Guido Casati <guido.casati@openairinterface.org>
Route paging-triggered Service Request through NAS_INITIAL_UL_TRANSFER_REQ so
RRC can buffer the PDU for RRCSetupComplete (dedicatedNAS-Message, TS 38.331)
when no UL-DCCH SRB exists, start MAC RA from RRC_IDLE, or drop the ITTI PDU
with LOG_W if SRB1/SRB2 is already established (NAS paging path is 5GMM-IDLE
only).
Changes:
- Define ITTI NAS_INITIAL_UL_TRANSFER_REQ and
NAS_INITIAL_UL_TRANSFER_REQ() (rrc_messages_def.h,
rrc_messages_types.h).
- Extend NR_UE_RRC_INST_t with pending_initial_nas for setup-complete
transport (rrc_defs.h).
- Refactor ULInformationTransfer+PDCP send into
nr_rrc_ue_send_ul_information_transfer_nas(): on NAS_UPLINK_DATA_REQ,
refuse PDCP when neither SRB1 nor SRB2 is established (free PDU).
- On NAS_INITIAL_UL_TRANSFER_REQ: store NAS in pending_initial_nas when
no SRB, in RRC_STATE_IDLE_NR set ra_trigger to RRC_CONNECTION_SETUP,
call nr_rrc_ue_prepare_RRCSetupRequest(), and nr_rrc_send_msg_to_mac()
with NR_MAC_RRC_START_RA, otherwise replace pending and send on SRB.
- Use forwarded initial NAS messafe in rrc_ue_generate_RRCSetupComplete():
if pending_initial_nas is set, move it into the NAS payload and refresh
security keys when integrity context exists, else generateRegistrationRequest().
- In nr_nas_msg.c, add send_nas_initial_ul_transfer_req() and use it for
paging Service Request instead of send_nas_uplink_data_req()
Refs: TS 24.501, TS 38.331 §5.3.3.4, TS 33.501 §6.8.1.2
Signed-off-by: Guido Casati <guido.casati@openairinterface.org>
RRC starts random access via NR_MAC_RRC_START_RA with an explicit
cause. RA trigger is no longer piggybacked on NR_MAC_RRC_CONFIG_RESET.
T300 expiry and RRC re-establishment are the call sites switched in this
commit. MAC handles setup/T300 and re-establishment paths in
nr_mac_start_ra().
Changes:
- Add nr_mac_rrc_types.h (nr_mac_ra_start_cause_t)
- Add nr_mac_rrc_start_ra_t in rrc_messages_types.h
- In rrc_UE.c, add nr_rrc_trigger_mac_ra(), call it from
handle_t300_expiry and nr_rrc_initiate_rrcReestablishment
- In config_ue.c:
- add nr_mac_start_ra() entry point with causes switch
- add nr_rrc_mac_start_ra() handler
- remove T300_EXPIRY, RE_ESTABLISHMENT reset handling
in nr_rrc_mac_config_req_reset, now delegated to
nr_mac_start_ra
- mac_defs.h: drop T300_EXPIRY from NR_UE_MAC_reset_cause_t
Signed-off-by: Guido Casati <guido.casati@openairinterface.org>
Transfer UE-side paging matches from RRC to NAS so a registered idle UE
can generate and send a Service Request after `NAS_PAGING_IND`. Guard
the path with explicit cause, identity, state, and mode checks so
unsupported cases are logged and ignored.
Changes:
- in `rrc_UE.c`, send `NAS_PAGING_IND` to TASK_NAS_NRUE with cause
`AS_CONNECTION_ESTABLISH` from `rrc_nrue()` when a paging match is found
- in `nr_nas_msg.c`, implement `NAS_PAGING_IND` handling in `nas_nrue()`
- accept only paging indications with cause
`AS_CONNECTION_ESTABLISH`, then require `nas->guti`,
`FGS_REGISTERED`, and `FGS_IDLE` before proceeding
- generate the Service Request with `generateServiceRequest()` and send
it through `send_nas_uplink_data_req()`
Refs:
- TS 23.502 §4.2.3.3 (Network Triggered Service Request)
- TS 24.501 §5.6.2.2.1 (Paging for 5GS services)
Signed-off-by: Guido Casati <guido.casati@openairinterface.org>
In NR RRC idle or inactive, decode PCCH SDUs from MAC and scan Paging
records (TS 38.331 §5.3.2.3) for ng-5G-S-TMSI against the UE M-TMSI
(lower 32 bits of fiveG_S_TMSI). PCCH is ignored in other states.
Changes:
- Add nr_rrc_ue_decode_pcch(): call nr_pcch_decode(), compare each
ng-5G-S-TMSI M-TMSI to (fiveG_S_TMSI & UINT32_MAX), return on match
or failure
- In rrc_nrue(), handle NR_RRC_MAC_PCCH_DATA_IND by wrapping sdu/
sdu_size in byte_array_t, calling nr_rrc_ue_decode_pcch()
Signed-off-by: Guido Casati <guido.casati@openairinterface.org>
When PHY reports a successful P-RNTI PDSCH decode as
FAPI_NR_RX_PDU_TYPE_PCCH, MAC must deliver the TB to RRC as a raw PCCH
SDU. Add the ITTI indication and a dedicated RX handler in the PHY
interface module, mirroring how BCCH/SIB paths are kept separate
from C-RNTI DLSCH.
Changes:
- Add NR_RRC_MAC_PCCH_DATA_IND ITTI message, NRRrcMacPcchDataInd, and
NR_RRC_MAC_PCCH_DATA_IND() accessor.
- Add send_pcch_rrc() to queue the PCCH SDU toward TASK_RRC_NRUE.
- Add handle_pcch() in NR_IF_Module.c: on successful decode forward the
TB with send_pcch_rrc(), log and drop on LDPC failure.
- Dispatch FAPI_NR_RX_PDU_TYPE_PCCH in nr_ue_dl_processing().
Signed-off-by: Guido Casati <guido.casati@openairinterface.org>
Implement UE-side DCI format 1_0 for CRC scrambled by P-RNTI: decode the
P-RNTI-specific bitfield, validate the short message indicator,
compute the DL-SCH grant (TBS, TB scaling, fixed
RV/HARQ), and append the DL config PDU when the grant is accepted.
Changes:
- Add extract_10_p_rnti and call it from nr_extract_dci_00_10 for TYPE_P_RNTI_
(replacing AssertFatal).
- In nr_ue_process_dci_dl_10: ignore dedicated pdsch_Config for TYPE_P_RNTI_,
reject reserved SMIs that do not apply. After MCS apply
nr_ue_process_dci_dl_10_p_rnti for TBS/Qm/code rate, RV/HARQ defaults,
tb_scaling scaling factor, and guards. On success set bump the DLSCH DL
config PDU count.
Signed-off-by: Guido Casati <guido.casati@openairinterface.org>
Improve UE DCI PDU configuration robustness by validating monitoring-symbol
inputs before extraction, and add explicit P-RNTI DCI setup for paging
search-space monitoring.
Changes:
- Add guard checks for `monitoringSymbolsWithinSlot` presence, buffer, and
minimum size before computing symbol masks in `config_dci_pdu()`
- Factor out monitoringSymbolsWithinSlot which is common across RNTI cases
and reuse local `monitoringSymbols` pointer for symbol-mask extraction
- Implement `TYPE_P_RNTI_` branch to set symbol mask, `rel15->rnti =
P_RNTI`, and `SubcarrierSpacing` for paging DCI configuration
Signed-off-by: Guido Casati <guido.casati@openairinterface.org>
Push the 5G-S-TMSI received by UE RRC down to MAC so paging can use
the TS 38.304 UE_ID.
Changes:
- add a paging UE_ID field to the UE MAC paging configuration
- add nr_rrc_mac_config_req_paging_ue_id() to derive UE_ID from
5G-S-TMSI and store it under the MAC interface mutex
- update the NAS_5GMM_IND handling in rrc_nrue() to pass the received
5G-S-TMSI to MAC for paging PF/PO derivation
Signed-off-by: Guido Casati <guido.casati@openairinterface.org>
Populate UE MAC paging state from SIB1 PCCH-Config so PF/PO-related
parameters are available to the rest of the UE MAC.
Changes:
- Add nr_ue_paging_cfg_t to NR_UE_MAC_INST_s with parsed paging fields
(T, N, Ns, PF_offset, X) and the optional
firstPDCCH-MonitoringOccasionOfPO list (first_mo_of_po[],
first_mo_of_po_count)
- Add configure_pcch_config() to decode SIB1 PCCH-Config via the
common helpers nr_pcch_default_paging_cycle_rf,
nr_pcch_n_and_paging_frame_offset, nr_pcch_ns_per_pf and
nr_pcch_first_pdcch_start_mo
- Add NR_PCCH_MAX_PO constant (TS 38.331 PCCH-Config) and size the
first_mo_of_po[]
- Invoke configure_pcch_config() from nr_rrc_mac_config_req_sib1()
Signed-off-by: Guido Casati <guido.casati@openairinterface.org>
Map P-RNTI scheduled DLSCH to the UE DLSCH receive indication flow so
paging traffic is also classified like DLSCH together with C-RNTI.
Changes:
- Set `dlsch0->rnti_type` from DLSCH RNTI in scheduled response, using
`TYPE_P_RNTI_` when RNTI is `P_RNTI`
- Extend `nr_ue_dlsch_procedures()` RX indication mapping to include
`TYPE_P_RNTI_` in the DLSCH indication case
Signed-off-by: Guido Casati <guido.casati@openairinterface.org>
Integration: `2026.w24`
- #145 RLC data req: Use API to fill multiple RLC PDUs at gNB
- #160 ci: maintainer approval for additional file changes and update maintainer's contact
- #146 Unit tests for bit functions
- #142 UE DL Channel compensation and LLR optimization
- #166 CI OCUDU configuration changes
- #170 fix(fhi72): add observability to the O-DU
- #173 fix(f1): DRB Information has criticality ignore
- #171 Local ssb detection
Local ssb detection (#171)
PSS/SSS detection in the UE code uses a global structure that describe
the cell parameters it is not logical because we will populate this
information from what we read in the MIB and the SIB1 later it also
blocks us to make a cell scanner in a logical manner, just calling pss
detection function with a set of detection parameters and a buffer of
digital radio
this MR fixes this and simplifies the code.
Reviewed-by: Sakthivel Velumani <s.velumani@northeastern.edu>
fix(f1): DRB Information has criticality ignore (#173)
See 38.473: this IE is supposed to be "ignore".
Closes: #172
Reviewed-By: Guido Casati <guido.casati@openairinterface.org>
fix(fhi72): add observability to the O-DU (#170)
This change adds printout to packet error/timing counters for the O-DU K
release. In F release these counters are either not present or not
implemented properly.
Reviewed-by: Teodora Vladić <teodora.vladic@openairinterface.org>
At each DL slot, schedule_nr_pcch() scans pcch_queue for records whose
UE paging occasion matches (frame, slot), encodes one PCCH-Message via
do_NR_Paging(), and fills P-RNTI PDCCH/PDSCH NFAPI PDUs.
Paging occasion detection is now owned by MAC via PCCH scheduler
helper that implements PF/PO computation per TS 38.304
§7. Computation is determined by defaultPagingCycle (T),
nAndPagingFrameOffset (N), ns (Ns), with PF formula
(SFN + PF_offset) mod T = (T div N) * (UE_ID mod N),
and PO slot mapping for Ns = 1/2/4. Paging is transmitted only
when (frame, slot) is the UE's paging occasion
(TS 38.304 §7.1) and when a Type2-PDCCH CSS is configured via
pagingSearchSpace, so the UE can receive it.
The RRC PCCH path is simplified accordingly.
Changes
In `openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_pcch.c`:
- Add paging-specific scheduling logic, including `is_paging_occasion()`,
paging-search-space resolution, and `nr_fill_nfapi_dl_PCCH_pdu()`
- Add `schedule_nr_pcch()` implementation to allocate CCE/PDSCH
resources, populate DL/TX NFAPI requests, encode at PO via do_NR_Paging()
In gNB scheduler:
- Invoke `schedule_nr_pcch()` in SA-mode DL scheduling
In `openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c`:
- Add PCCH scheduling helpers to be reused at UE side
Also:
- Remove no longer relevant `rrc_gNB_generate_pcch_msg()` from `rrc_gNB.c`
Signed-off-by: Guido Casati <guido.casati@openairinterface.org>
Make fh_timer_tick robust against CLOCK_REALTIME jumps. In case of
forward jump the symbol callback will be called for each missed symbol.
In case of backwards jump the function will return without calling
any callbacks. This continues until the local timer catches up to the
last callback symbol.
Signed-off-by: Bartosz Podrygajlo <bartosz.podrygajlo@openairinterface.org>
Ensure DL DCI payload preparation for paging with P-RNTI returns,
avoiding use of UE scheduling state and HARQ processes that do
not exist for paging.
Changes:
- Add early return in prepare_dci_dl_payload for TYPE_P_RNTI_
- Defer NR_UE_sched_ctrl_t lookup until after the P-RNTI path to avoid
accessing UE context and HARQ state for paging
Signed-off-by: Guido Casati <guido.casati@openairinterface.org>
When the core pages an idle UE, the DU queues paging records unti
MAC can send it on PCCH at the right PF/PO. This commit moves that
buffering into gNB MAC and connects the existing F1AP Paging entry points.
The CN UE paging is therefore routed from F1AP inputs into a MAC-managed
PCCH queue. The unused RRC PCCH generator stub is dropped. This makes paging
delivery path explicit in MAC for later PF/PO scheduling.
Changes:
- f1ap_du_paging.c: decode F1AP Paging and call f1_paging()
- mac_rrc_dl_handler.c: add f1_paging()- CN UE identity only, reject RAN UE,
call nr_mac_pcch_enqueue
- gNB_scheduler_pcch.c (new): queue init/free/enqueue, store identity only
(nr_mac_pcch_record_t: ue_id, fiveg_s_tmsi) in spsc_q
- nr_mac_gNB.h: add nr_mac_pcch_record_t and pcch_queue on NR_COMMON_channels_t
- mac_rrc_dl_direct.c: f1_paging_transfer_direct(), call f1_paging()
Signed-off-by: Guido Casati <guido.casati@openairinterface.org>
Add PCCH decoding and use in ASN.1 tests.
Changes:
- add `nr_pcch_decode()`
- extend `test_asn1_msg.cpp` with `encode_decode_paging()` round trips
for multiple `ng-5G-S-TMSI` values, `accessType`, and `fullI-RNTI`
Signed-off-by: Guido Casati <guido.casati@openairinterface.org>
Replace the old buffer-based do_NR_Paging API with a params struct and
byte_array_t return; add support for fullI-RNTI and optional accessType/
pagingCause. Encoding uses uper_encode_to_new_buffer, callers own and
free the returned buffer.
Changes:
- asn1_msg.h:
- Add nr_paging_params_t (ue_identity_type, union ue_identity union
{ m_tmsi or full_i_rnti }, access_type, paging_cause),
- Add NR_PAGING_FULL_I_RNTI_SIZE define.
- asn1_msg.c:
- Implement do_NR_Paging with nr_paging_params_t.
- Support ng-5G-S-TMSI (48-bit, M-TMSI in bytes 2–5)
and fullI-RNTI (40-bit, 5 bytes).
- Set optional accessType (non3GPP) and optional nonCriticalExtension
(pagingRecordList-v1700 with pagingCause-r17).
- Use asn1cCalloc for ASN.1 allocations and encode via
uper_encode_to_new_buffer. On failure free buffer and return empty
byte_array_t.
- rrc_gNB.c: disable do_NR_Paging call in rrc_gNB_generate_pcch_msg
with #if 0 (will be removed in a descendant commit, no need to update
call site yet).
- test_asn1_msg.cpp: update caller in asn1 tests (minimal change, test
will be updated in a later commit)
- common/platform_constants.h: add NR_PCCH_MAX_PAGING_RECORDS
Signed-off-by: Guido Casati <guido.casati@openairinterface.org>
Expose the RB/MCS/TBS selection helper as a shared MAC function for
common PDSCH instead of keeping as static variant for SIB-specific use
in the BCH scheduler. It will be reused by the PCCH code path in a descendant
commit.
Signed-off-by: Guido Casati <guido.casati@openairinterface.org>
Implement the Type0-PDCCH occasion helper for reusability and
use it in schedule_nr_sib1. Adopt in a descendant commit
in PCCH scheduling as well.
Changes:
- gNB_scheduler_primitives.c: add is_type0_occasion()
- gNB_scheduler_bch.c: in schedule_nr_sib1, replace inline code
with is_type0_occasion
- Rename check_frame_sib1 to check_frame_type0, as it is not
limited to sib1 but applies to PCCH as well.
Signed-off-by: Guido Casati <guido.casati@openairinterface.org>
gNB_scheduler_bch.c now calls the shared get_max_ssbs() instead of
duplicating the SSB bitmap size logic in schedule_nr_sib1
Signed-off-by: Guido Casati <guido.casati@openairinterface.org>
Move get_max_ssbs and the Type0-PDCCH frame-check logic from
gNB_scheduler_bch.c to gNB_scheduler_primitives.c so they can be
reused (e.g. for both paging and SIB1).
Changes:
- check_frame_sib1() with NULL check for ssb_periodicityServingCell
and clearer logic
- Improved documentation
Signed-off-by: Guido Casati <guido.casati@openairinterface.org>
OAI DFT has scaling issues when the signal is very strong or close to
full scale. So reduce amplitude by 10dB in gnb to prevent
overflow/clipping.
Signed-off-by: Sakthivel Velumani <s.velumani@northeastern.edu>
UE DL Channel compensation and LLR optimization (#142)
- Common channel compensation: Extracted nr_channel_compensation() as a
shared function (AVX2/MRC inline) used by both gNB and UE PDSCH/PUSCH
paths, eliminating duplicated compensation logic.
- Common ML/MMSE 2-layer MIMO: Created shared ML LLR and MMSE routines
for 2-layer spatial multiplexing, shared between gNB and UE
demodulation.
- File segregation: Moved common LLR and channel compensation functions
into dedicated source files for better modularity and reuse.
- nr_dlsim -E flag: Added a command-line argument to enable/disable
ML/MMSE equalization at runtime (MMSE default), enabling side-by-side
performance comparison without recompilation.
- Persistent UE buffer allocation: pdsch_dl_ch_estimates, rxdataF_comp,
dl_ch_mag,dl_ch_magb,dl_ch_magr and rho_dl are now allocated once in
PHY_VARS_NR_UE on first use, resize automatically when dimensions
change (resizeAllowed=true), and are freed at UE teardown in
term_nr_ue_signal. Eliminates per-slot heap allocation/free overhead.
- PTRS restricted to one antenna port: PTRS phase tracking is only valid
for a single port; processing now correctly restricted to avoid
unnecessary computation.
- Reduce rxdataF_comp buffer size: MRC combines all Rx antenna
contributions into a per-layer output, so the first dimension was
reduced from Nl * nb_antennas_rx to Nl, reducing buffer footprint
proportionally.
- 256QAM segfault fix: nr_256qam_llr() on gNB side used a VLA for LLRs
without alignment, causing AVX2 load faults. Fixed with
attribute((aligned(32))).
Reviewed-by: Sakthivel Velumani <s.velumani@northeastern.edu>