Optimization pass for channel modelling on transmission in vrtsim. This
comes from a requirement of O-RU to perform channel modelling with minimum
latency.
- Reduced MAX_CHANNEL_LENGTH to 200 and introduced SAVED_SAMPLES_LEN
- Refactored channel modelling actor allocation to parallelize work better
- Improved batching and task creation for channel modelling
- Replaced static global saved_samples with local static buffer in vrtsim_write_with_chanmod
Integration `2025.w45`
* !3736 fix bugs in scope for pdcch, and optimize cpu cost of pdcch decoding
* !3743 NR UE: fix PDCCH LLR indexing for different search space RB sizes
* !3739 Bugfix: save old tunnel info to remain the user plane connection while rolling back to source DU due to handover failure
* !3742 Simplify node management in CI, handle SIGINT
* !3670 PRS bug fix and CI Integration
* !3746 Fix unsigned to signed decoding parameters to allow for 'no affinity'/'no pin' threads to CPUs
* !3738 CI: Add new Jenkinsfiles
Closes#984 and #1021
See merge request oai/openairinterface5g!3744
CI: Add unified Jenkinsfile for all test pipelines
This MR introduces a single Jenkinsfile to cover all current CI test pipelines
Improvements:
- correct reporting of the start timestamp in the HTML report
- harmonize log collection - always collect as test_logs_${env.BUILD_ID}.zip
Fix unsigned to signed decoding parameters to allow for 'no affinity'/'no pin'
threads to CPUs
By default, 'L1_rx_thread_core', 'L1_tx_thread_core', 'ru_thread_core' are set
to '-1' but the values were decoded from config file as unsigned instead of
signed types, thus, it was not allowing to set them with '-1' from config file.
PRS bug fix and CI Integration
- Fix the bug in PRS channel estimation while copying memory to compute the
impulse response
- Integrate PRS testing to CI
Simplify node management in CI, handle SIGINT
- Make a single <node> XML step entry common to all XML steps to harmonize code
- Handle SIGINT to make it possible to more easily stop the CI script.
Bugfix: save old tunnel info to remain the user plane connection while rolling
back to source DU due to handover failure
This MR closes issue #984 that UE lost the data plane connection while rolling
back to the source DU due to handover failure.
NR UE: fix PDCCH LLR indexing for different search space RB sizes
After !3603 (merged), when multiple search spaces have different CORESET
configurations (different number of RBs), the LLR buffer stride must be
calculated based on the maximum RB size across all search spaces, not the
current search space's RB size.
The LLR buffer is allocated with size based on get_pdcch_max_rbs(), but the
demapping function was using coreset_nbr_rb (current search space) for symbol
stride calculation, causing incorrect LLR extraction when search spaces have
different RB configurations.
This MR tries to fix it.
Closes#1021
By default, 'L1_rx_thread_core', 'L1_tx_thread_core', 'ru_thread_core' are set to '-1' but the values were decoded from config file as unsigned instead of signed types, thus, it was not allowing to set them with '-1' from config file
This commit inputs several distances at once and obtain the summary of
successful and failed tests. We look for the number of successful tests
that are geater than 0. We do that here since we sometimes dont receive
a response for a telnet command from the rfsim although the command
is applied. This is related to the queing telnet commands in the rfsim.
The script for the distances 50, 100 and 150 are called as follows,
./set-and-verify-distance-prs.sh 50 100 150
The summary can be viewed as follows,
==================== SUMMARY ====================
Total tests run : 3
Successful tests: 3
Failed tests : 0
=================================================
Set RFsim (DL) distance and use PRS to estimate the new distance. This
is verified by comparing the distance set in RFsim with the distance
reported through ToA estimation at the UE.
Note that since RFsim telnet output is asynchronous (it uses a queue
internally), we use grep --max-count 1 to wait for the matching line,
together with ncat --idle 0.3 to keep ncat open for some time. The
--max-count option will terminate grep after the first occurrence. For
this to work reliably, we need to use grep <(echo | ncat) as opposod to
simply echo | ncat | grep, as the latter does not seem to reliably
make grep exit after the occurrence.
Co-authored-by: Robert Schmidt <robert.schmidt@openairinterface.org>
fix bugs in scope for pdcch, and optimize cpu cost of pdcch decoding
fix bugs in scope for pdcch, and optimize cpu cost of pdcch decoding by not
processing useless samples in one symbol
When multiple search spaces have different CORESET configurations
(different number of RBs), the LLR buffer stride must be calculated
based on the maximum RB size across all search spaces, not the
current search space's RB size.
The LLR buffer is allocated with size based on get_pdcch_max_rbs(),
but the demapping function was using coreset_nbr_rb (current search
space) for symbol stride calculation, causing incorrect LLR extraction
when search spaces have different RB configurations.
Handle SIGINT and mark any subsequent steps as failed. Receiving SIGINT
a second time will abort the script immediately (as is the case before
this commit).
Note that Python seems to relay the signal to the "controlled" process
(e.g., Ping), which would return immediately with an error. So some
steps like Ping will abort immediately, others (e.g., IdleSleep) will
finish their step, and then the present logic will mark subsequent steps
as failed.
Some CI tasks/commands like Iperf(), Ping() get multiple nodes (via XML
parameter "nodes") to potentially run UEs on different nodes (hosts) at
the same time. However, I argue that this is not good:
- we don't actually use this -- where we specify multiple UEs, it's
always "localhost localhost..."
- it is inconsistent, as we typically have a single "node", not nodes,
and there is a possibility to harmonize (see also next commit)
- if we needed it, there would be better ways to achieve the same.
First, for hardware-based UEs, the ci_infra.yaml can specify different
UEs. For simulated UEs, it would be feasible to have multiple XML
steps run in parallel, e.g., in the XML <parallel> tag, which would
clarify that multiple UEs on different hosts run in parallel
- it reduces code.
Hence, make a single <node> for these XML steps.
Created Jenkinsfiles:
- Jenkinsfile: for stadard test pipelines
- Jenkinsfile-oc: for deployments with OC
These 2 Jenkinsfiles covers all current test pipelines.
Previously, we were using int16_t for the variable ch_tmp which was later harmonized to use c16_t while leaving <<1. This introduced the bug while accessing the address of the element at first_half of the ch_tmp variable.
Integration `2025.w44`
* !3721 improvements in formatting and LOGs in DMRS common functions at MAC
* !3725 Handle GTP receiver errors, fix memory leaks, add CU-UP test
* !3726 fix for CSI payload sizes in PUCCH structure at UE
* CI: Adjust attenutation for HO setup
* !3728 Fix for scenario with no CSI report configured for CSI-RS
* !3731 CI: ensure clean iperf3 server startup
* !3592 Refactor PRACH handling at the gNB
* !3682 Refactor DLSCH scheduler
* !3733 Clarify whitespace
* !3706 Change registry name env var content
Closes#1015 and #1014
See merge request oai/openairinterface5g!3727
Change registry name env var content
Currently setting REGISTRY="" in a .env file results in docker failing to find
/image-name:tag. This corrects that, so it looks for local images named
image-name:tag.
Following the change to use:
image: ${REGISTRY-oaisoftwarealliance/}${GNB_IMG:-oai-gnb}:${TAG:-develop}
the REGISTRY variable must now include the trailing slash.
Refactor DLSCH scheduler
Refactor the DLSCH post processor similarly to what has been done in
!3521 with the goal of saving an additional iteration through all UEs,
hopefully making the DLSCH scheduler faster.
It further includes changes to make working with and debugging multi-UE
operation easier:
- add some measurements in L1 (for total TX/RX time)
- a new option MACRLCs.[0].stats_max_ue to limit the number of UEs in
the periodic output (default: 8, 0=disable)
- avoid stack overflow in the MAC
- fix the writing of stats to nrMAC_stats.log and nrL1_stats.log when
the written output reduces by truncating the files
- avoid to schedule retransmission with 0 RBs.
This slightly speeds up the scheduler (it e.g., does not need to check
for UEs that have retransmissions), and harmonizes with pf_ul(), which
evaluates (UL) BSR at a similar place within the scheduler.
Check and return, if necessary, that we have enough resources to make
retransmissions. Without, we can asserts in L1, such as
Assertion (NPRB>0 && (NPRB + RBstart <= BWPsize)) failed!
In PRBalloc_to_locationandbandwidth0() openairinterface5g/common/utils/nr/nr_common.c:506
Illegal NPRB/RBstart Configuration (0,51) for BWPsize 51
which indicates that the scheduler requested a transmission with 0 PRBs,
which does not make sense.
Refactor PRACH handling at the gNB
- Remove race conditions by correctly setting mutexes
- Fix a bug when having multiple RACH occasions
- Reduce memory footprint by removing global memory, which should also
fix potential memory data races in FHI 7.2
- Additional fixes, see commit messages
a bit difficult to understand: sl_ahead=6 => we systematically miss the
rach detection in the scheduler because the scheduler runs more than 6
slots ahead the rx slot processing (here > 11 slots because 6 (DL and UL
slots) + 4 (RU_RX_SLOT_DEPTH, so UL only))
so, reducing sl_ahead works better than large sl_ahead because the idea
behind is: the scheduler of slot+sl_ahead will never create work to do
in a UL slot before slot+sl_ahead+X (as minimum k2 is X, in the 24PRB CI
test: 6)
saves about 600MB of memory allocation
Move the definition of PRACH items and the PRACH list to the
defs_nr_commons.h file.
Do not re-write the entire structure in nr_schedule_rx_prach(), as it is
quite large now.
Call the post-processor when the allocation is "fixed" (i.e., nothing
changes anymore), instead of having a final loop across all UEs that
might potentially be costly.
In order to calculate the PF metric, note that the statistics "reset" is
moved into pf_dl() instead of the post-processing loop, as it has to be
done on each slot.
See also: dd98030202 ("Refactor to call post-processor in place")
Similarly to parent commit(s), assign sched_pdsch in a single place
instead of relying on sched_ctrl. In a follow-up commit, the
post-processor will be called in a single place.
Similarly to parent commit(s), refactor the use of NR_sched_pdsch.
Instead of using nr_mac->sched_ctrlCommon, put the NR_sched_pdsch_t on
the stack.
This also refactors update_rb_mcs_tbs() to update the existing
NR_sched_pdsch instead of updating individual fields.
This also reduces the extend to which sched_ctrlCommon is used.
Assign NR_sched_pdsch to sched_ctrl->sched_pdsch in one place, where the
post-processing functionality will be called in a follow-up commit. This
should result in no functional change.
It seems to be assumed that curInfo actually has the currently active
number of layers/PMI. However, I am not sure this would always be true
(e.g., UE might not have been scheduled for some slots, but number of
layers decreased as reported by CSI). Instead, recalculate the info
from scratch when necessary.
PF uses MCS and average throughput to decide which UE to schedule. Thus,
the first loop decides on MCS, whereas the second does the "main UE
allocation" after sorting by the PF metric.
A follow-up commit will remove sched_pusch from NR_UE_sched_ctrl_t.
Thus, we cannot rely on sched_ctrl to store the MCS in the first loop,
and look it up from there in the second. Instead, store it as part of
the UE iterator data, and take it from there.
See also: f3068caa37 ("Store selected MCS in UE iterator", for UL)
Introduce a struct with information on FAPI structures to save resource
and data allocation into. It's in nr_mac_gNB.h because the next commits
will reuse this for all preprocessors.
Especially in pf_dl()/pf_ul(), we use a first loop using
UE_iterator(), then iterate over a subset of UEs. It has happened a
couple of times that I was using variable "UE" (from the iterator), when
it should only be used in the first UE_iterator() loop.
Rewrite UE_iterator() to effectively limit the scope of the iterator
variables to the body of the UE_iterator. This should also make it
possible to reuse multiple UE_iterator()s with the same variables in
sequence.
CI: ensure clean iperf3 server startup
- Resolves issue with iperf3 test failure in RFSim5G multiue test
- Minor fix of iperf3 test descriptions in RFSim5G pipeline
Fix for scenario with no CSI report configured for CSI-RS
After changes in !3714 (merged), if we select to measure RSRP on SSB and not
CSI-RS (default option) and there is a single antenna port (so no MIMO report
either) we won't schedule any CSI-RS measurements for the UE. In that case
ideally we shouldn't set do_CSIRS = 1 in configuration file but still the
option is possible. So the fix is to not perform any measurements at UE on
that CSI-RS but not asserting.
Closes#1015
The function rx_nr_prach become autonomous, it doesn't read anymore global variables
So, it can become (later) a threadpool work, that will send a message when it finishes
rx_nr_prach_ru() still use some global variables, but it is executed in sequence, inside the ru main loop, that limits the probability of race conditions
Before starting a new iperf3 server instance in CI tests, explicitly kill any existing
iperf3 processes bound to the same port. This prevents conflicts or failures caused by
leftover iperf3 servers from previous runs that did not terminate properly or on time.
The cleanup is performed using `pkill` before launching the new server.
Handle GTP receiver errors, fix memory leaks, add CU-UP test
- Fix use-after-free bugs in GTP by properly stopping the receive thread(s)
- Fix a bug from !3519 (merged): QFI 0 is a valid QFI
- Fix multiple memory leaks in CU-UP, E1, CU-UP load tester, SCTP
- Add a (conservative) functional CU-UP test that verifies that the load tester
and CU-UP work. Test only a low throughput, as it will run in parallel with
other tests.
Use the CU-UP load tester to test the functionality of the CU-UP and
its loader tester. The requirements on this load test are intentionally
low, as it will be run with other unit tests in parallel, and should
still pass.
It uses an existing configuration file for the CU-UP. The test script
runs the CU-UP, runs the load tester, stops the CU-UP, and returns the
load tester return value as test result (which will be 0=success if all
packets have been received).
Note that this strdup has been intentioally created for debugging
purposes in core files.
See also: 1ab3b8dd8e ("add version signature in core files...")
Direct leak of 8 byte(s) in 1 object(s) allocated from:
#0 0x7f7bc7ee68a3 in calloc (/lib64/libasan.so.8+0xe68a3) (BuildId: 10b8ccd49f75c21babf1d7abe51bb63589d8471f)
#1 0x0000004abfa6 in calloc_or_fail /home/richie/oai/common/utils/utils.h:74
#2 0x0000004abfa6 in decode_e1ap_cuup_setup_request /home/richie/oai/openair2/E1AP/lib/e1ap_interface_management.c:219
#3 0x00000046a9f5 in e1apCUCP_handle_SETUP_REQUEST /home/richie/oai/openair2/E1AP/e1ap.c:187
#4 0x000000470b35 in e1ap_handle_message /home/richie/oai/openair2/E1AP/e1ap.c:109
#5 0x000000470b35 in e1_task_handle_sctp_data_ind /home/richie/oai/openair2/E1AP/e1ap.c:120
#6 0x00000047717b in E1AP_CUCP_task /home/richie/oai/openair2/E1AP/e1ap.c:832
#7 0x7f7bc7e28ee5 in asan_thread_start(void*) (/lib64/libasan.so.8+0x28ee5) (BuildId: 10b8ccd49f75c21babf1d7abe51bb63589d8471f)
Direct leak of 8 byte(s) in 1 object(s) allocated from:
#0 0x7f7bc7ee68a3 in calloc (/lib64/libasan.so.8+0xe68a3) (BuildId: 10b8ccd49f75c21babf1d7abe51bb63589d8471f)
#1 0x0000004ac30c in calloc_or_fail /home/richie/oai/common/utils/utils.h:74
#2 0x0000004ac30c in decode_e1ap_cuup_setup_request /home/richie/oai/openair2/E1AP/lib/e1ap_interface_management.c:194
#3 0x00000046a9f5 in e1apCUCP_handle_SETUP_REQUEST /home/richie/oai/openair2/E1AP/e1ap.c:187
#4 0x000000470b35 in e1ap_handle_message /home/richie/oai/openair2/E1AP/e1ap.c:109
#5 0x000000470b35 in e1_task_handle_sctp_data_ind /home/richie/oai/openair2/E1AP/e1ap.c:120
#6 0x00000047717b in E1AP_CUCP_task /home/richie/oai/openair2/E1AP/e1ap.c:832
#7 0x7f7bc7e28ee5 in asan_thread_start(void*) (/lib64/libasan.so.8+0x28ee5) (BuildId: 10b8ccd49f75c21babf1d7abe51bb63589d8471f)
Direct leak of 100 byte(s) in 1 object(s) allocated from:
#0 0x7f6585ee6f2b in malloc (/lib64/libasan.so.8+0xe6f2b) (BuildId: 10b8ccd49f75c21babf1d7abe51bb63589d8471f)
#1 0x000000414a0d in malloc_or_fail /home/richie/oai/common/utils/utils.h:86
#2 0x0000004061c9 in main /home/richie/oai/tests/nr-cuup/nr-cuup-load-test.c:544
#3 0x7f6585211574 in __libc_start_call_main (/lib64/libc.so.6+0x3574) (BuildId: 48c4b9b1efb1df15da8e787f489128bf31893317)
#4 0x7f6585211627 in __libc_start_main@GLIBC_2.2.5 (/lib64/libc.so.6+0x3627) (BuildId: 48c4b9b1efb1df15da8e787f489128bf31893317)
#5 0x000000413034 in _start (/home/richie/oai/build/tests/nr-cuup/nr-cuup-load-test+0x413034) (BuildId: 8af0132792b03fa12ba95b5623865c9a8a5625a3)
Direct leak of 100 byte(s) in 1 object(s) allocated from:
#0 0x7f6585ee6f2b in malloc (/lib64/libasan.so.8+0xe6f2b) (BuildId: 10b8ccd49f75c21babf1d7abe51bb63589d8471f)
#1 0x000000414a0d in malloc_or_fail /home/richie/oai/common/utils/utils.h:86
#2 0x0000004061ff in main /home/richie/oai/tests/nr-cuup/nr-cuup-load-test.c:546
#3 0x7f6585211574 in __libc_start_call_main (/lib64/libc.so.6+0x3574) (BuildId: 48c4b9b1efb1df15da8e787f489128bf31893317)
#4 0x7f6585211627 in __libc_start_main@GLIBC_2.2.5 (/lib64/libc.so.6+0x3627) (BuildId: 48c4b9b1efb1df15da8e787f489128bf31893317)
#5 0x000000413034 in _start (/home/richie/oai/build/tests/nr-cuup/nr-cuup-load-test+0x413034) (BuildId: 8af0132792b03fa12ba95b5623865c9a8a5625a3)
Free memory including the "base pointer". Fix two places in which it was
on the stack to harmonize. The only stack variable is in reception of
new E1 messages (e1ap_handle_message()), which uses
ASN_STRUCT_FREE_CONTENTS_ONLY().
This fixes bugs similar to these logs:
Direct leak of 40 byte(s) in 1 object(s) allocated from:
#0 0x7f418f4e68a3 in calloc (/lib64/libasan.so.8+0xe68a3) (BuildId: 10b8ccd49f75c21babf1d7abe51bb63589d8471f)
#1 0x00000049e367 in calloc_or_fail /home/richie/oai/common/utils/utils.h:74
#2 0x00000049e367 in encode_e1_bearer_context_release_command /home/richie/oai/openair2/E1AP/lib/e1ap_bearer_context_management.c:1235
#3 0x000000482951 in e1apCUCP_send_BEARER_CONTEXT_RELEASE_COMMAND /home/richie/oai/openair2/E1AP/e1ap.c:546
#4 0x000000482951 in E1AP_CUCP_task /home/richie/oai/openair2/E1AP/e1ap.c:856
#5 0x7f418f428ee5 in asan_thread_start(void*) (/lib64/libasan.so.8+0x28ee5) (BuildId: 10b8ccd49f75c21babf1d7abe51bb63589d8471f)
Direct leak of 40 byte(s) in 1 object(s) allocated from:
#0 0x7f418f4e68a3 in calloc (/lib64/libasan.so.8+0xe68a3) (BuildId: 10b8ccd49f75c21babf1d7abe51bb63589d8471f)
#1 0x00000049380a in calloc_or_fail /home/richie/oai/common/utils/utils.h:74
#2 0x00000049380a in encode_E1_bearer_context_setup_request /home/richie/oai/openair2/E1AP/lib/e1ap_bearer_context_management.c:578
#3 0x00000047f6a2 in e1apCUCP_send_BEARER_CONTEXT_SETUP_REQUEST /home/richie/oai/openair2/E1AP/e1ap.c:378
#4 0x0000004829f8 in E1AP_CUCP_task /home/richie/oai/openair2/E1AP/e1ap.c:846
#5 0x7f418f428ee5 in asan_thread_start(void*) (/lib64/libasan.so.8+0x28ee5) (BuildId: 10b8ccd49f75c21babf1d7abe51bb63589d8471f)
Direct leak of 40 byte(s) in 1 object(s) allocated from:
#0 0x7f418f4e68a3 in calloc (/lib64/libasan.so.8+0xe68a3) (BuildId: 10b8ccd49f75c21babf1d7abe51bb63589d8471f)
#1 0x00000046ede7 in calloc_or_fail /home/richie/oai/common/utils/utils.h:74
#2 0x00000046ede7 in encode_e1ap_cuup_setup_response /home/richie/oai/openair2/E1AP/lib/e1ap_interface_management.c:305
#3 0x00000047e412 in e1ap_send_SETUP_RESPONSE /home/richie/oai/openair2/E1AP/e1ap.c:167
#4 0x000000482a68 in E1AP_CUCP_task /home/richie/oai/openair2/E1AP/e1ap.c:836
#5 0x7f418f428ee5 in asan_thread_start(void*) (/lib64/libasan.so.8+0x28ee5) (BuildId: 10b8ccd49f75c21babf1d7abe51bb63589d8471f)
QFI 0 is a valid QFI: don't check for qfi <= 0, as uint8 cannot be
negative. Also, correctly use SDAP_MAP_RULE_EMPTY for a DRB ID (which
need to be larger than 0).
The gNB will stop the periodical logging of UEs in MAC Info level after
a configurable number of UEs have been printed, by default 8.
Set it to 17 in some CI tests to ensure we still get all UEs for the
time being, as the CI might depend on this.
improvements in formatting and LOGs in DMRS common functions at MAC
DMRS LOGs at MAC were misleading. This MR tried to improve them (and also
adds some formatting fix).
The call to snprintf() as was used is wrong: we use the return value to
advance output, but the man page says
> The functions snprintf() and vsnprintf() do not write more than size
> bytes (including the terminating null byte ('\0')). If the output was
> truncated due to this limit, then the return value is the number of
> characters (excluding the terminating null byte) which would have been
> written to the final string if enough space had been available.
> Thus, a return value of size or more means that the output was
> truncated.
Thus, output could go beyond end, and we get a stack overflow. Instead,
encapsulate the call to snprintf() checking this condition, and only
advancing output as intended, limiting to 0 if we are at the end of the
buffer. This avoids this error:
==964825==ERROR: AddressSanitizer: stack-buffer-overflow on address 0x7be799f51988 at pc 0x7fe7d66b0d39 bp 0x7be79b825ef0 sp 0x7be79b8256c0
WRITE of size 3 at 0x7be799f51988 thread T24
#0 0x7fe7d66b0d38 in vsnprintf (/lib64/libasan.so.8+0xb0d38) (BuildId: 10b8ccd49f75c21babf1d7abe51bb63589d8471f)
#1 0x7fe7d66b2d44 in snprintf (/lib64/libasan.so.8+0xb2d44) (BuildId: 10b8ccd49f75c21babf1d7abe51bb63589d8471f)
#2 0x0000008fe7c6 in dump_mac_stats /home/richie/w/refactor-dlsch/openair2/LAYER2/NR_MAC_gNB/main.c:183
#3 0x00000092071a in gNB_dlsch_ulsch_scheduler /home/richie/w/refactor-dlsch/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c:200
#4 0x0000008f8f78 in run_scheduler_monolithic /home/richie/w/refactor-dlsch/openair2/NR_PHY_INTERFACE/NR_IF_Module.c:399
There is the (global) sched_lock that prevents concurrent access. A
dedicated UE lock does not make sense in that case. Worse, this lock
does not prevent all concurrent UE accesses (e.g., there are many loops
over UEs that are not protected), so it's also wrong.
truncate resets the file size to 0. Without this, e.g., when
disconnecting a UE, the old UE remains at the end and is not
overwritten, which is confusing.
Stop the receive thread before closing the socket, which avoids an error
message when stopping the GTP softmodem:
[GTPU] [91] Recvfrom failed (Bad file descriptor)
[GTPU] exiting thread
On error, exit the GTP thread after printing a diagnostic message. This
avoids also an error flagged by address sanitizer for use-after-free.
[GTPU] [91] Recvfrom failed (Bad file descriptor)
=================================================================
==285377==ERROR: AddressSanitizer: heap-use-after-free on address 0x7cd7b7fe5590 at pc 0x0000006a9e18 bp 0x7b97ad4e1d50 sp 0x7b97ad4e1d48
READ of size 4 at 0x7cd7b7fe5590 thread T8
=================================================================
==285377==ERROR: LeakSanitizer: detected memory leaks
Direct leak of 160 byte(s) in 1 object(s) allocated from:
#0 0x0000006a9e17 in gtpv1uReceiver /home/richie/oai/openair3/ocp-gtpu/gtp_itf.cpp:1346
#1 0x7f97b9a28ee5 in asan_thread_start(void*) (/lib64/libasan.so.8+0x28ee5) (BuildId: 10b8ccd49f75c21babf1d7abe51bb63589d8471f)
#2 0x7f97b8e7ff53 in start_thread (/lib64/libc.so.6+0x71f53) (BuildId: 48c4b9b1efb1df15da8e787f489128bf31893317)
#3 0x7f97b8f0332b in __clone3 (/lib64/libc.so.6+0xf532b) (BuildId: 48c4b9b1efb1df15da8e787f489128bf31893317)
#0 0x7f97b9ae60cb in memalign (/lib64/libasan.so.8+0xe60cb) (BuildId: 10b8ccd49f75c21babf1d7abe51bb63589d8471f)
#1 0x000000471039 in newNotifiedFIFO_elt /home/richie/oai/common/utils/threadPool/notified_fifo.h:75
#2 0x000000471039 in tx_func /home/richie/oai/executables/nr-gnb.c:107
#3 0x000000471039 in L1_tx_thread /home/richie/oai/executables/nr-gnb.c:167
#4 0x7f97b9a28ee5 in asan_thread_start(void*) (/lib64/libasan.so.8+0x28ee5) (BuildId: 10b8ccd49f75c21babf1d7abe51bb63589d8471f)
0x7cd7b7fe5590 is located 336 bytes inside of 400-byte region [0x7cd7b7fe5440,0x7cd7b7fe55d0)
freed by thread T0 here:
SUMMARY: AddressSanitizer: 160 byte(s) leaked in 1 allocation(s).
Integration: `2025.w43`
* !3605 Support beam index in OAI 7.2 Fronthaul Interface
* !3709 Fixes for T-Tracer to work with NR-UE
* !3712 Restore UE Capability IE after RRCReestablishment
* !3716 Remove unused ULSCH measurements at gNB
* !3603 UE symbol based PDCCH receiver
* !3708 Add monolithic N2 handover test pipeline with B210 and Quectel
* !3719 Remove Benetel-specific radio drivers
* !3710 [CI] Update the Push to DockerHub Stage
* !3711 CI: Multiple adjustments
* !3717 Initialize NCC=0 on NGAP Initial Context Setup (3GPP TS 33.501 §6.9.2.1.1)
* !3720 fix direct bugs of not used RU_RX_SLOT_DEPTH defined constant
* !3714 Improve handling of selection of RSRP/SINR report via configuration file
* !3519 Refactor SDAP adaptation work for QoS
* !3698 Other CSI measurement fixes
* !3699 Updates for Feature Set
Closes#1008
See merge request oai/openairinterface5g!3713
Other CSI measurement fixes
Errors fixed in this MR:
- UE currently sends empty CSI measurement report resulting in invalid
cqi_idx 0, default to MCS 9 at gNB because mismanagement of new L1
measurement structure at MAC UE
- nrofReportedRS not updated after UE capability reception at gNB
- multiple RSRP reports multiplexed / de-multiplexed in wrong order
Refactor SDAP adaptation work for QoS
This MR is an adaptation of the code introduced in !2703.
The goal is a cleanup and functional refactor of the SDAP/PDCP
integration, that is:
- centralize SDAP configuration logic
- simplify entity creation
- improve robustness of role-based SDAP handling
- prepare the codebase for clean support of DRB reconfiguration and
teardown flows
More concretely:
1. New sdap_config_t and get_sdap_Config()
- Introduced an internal struct sdap_config_t to abstract SDAP config
input
- Centralized SDAP config parsing into new get_sdap_Config() function
that translates ASN.1 NR_SDAP_Config into this internal
representation. This is called during RRC triggered
(re)configuration procedures.
- Enable mapping of number of QoS flows > 1
2. Unified role handling with bitmasks
- Added a bitmask-based entity_role field to track SDAP directions:
SDAP_UL_RX, SDAP_UL_TX, SDAP_DL_RX, SDAP_DL_TX: header presence was
determined by simple direction (UE vs gNB) and individual
is_sdap_rx/tx() checks, however nr_sdap_rx_entity behaves
differently depending on the direction of the RX entity (DL/UL),
therefore this change can help enable a more accurate SDAP header
handling across directions and node types.
- Replaces old helpers is_sdap_rx() / is_sdap_tx() with internal
checks against the role bitfield
- QFI-to-DRB mapping is now annotated with direction for both data and
control PDUs
3. Simplified DRB and SDAP setup
- add_drb() in PDCP API now delegates SDAP config processing cleanly
- new_nr_sdap_entity() is used consistently to register a fresh SDAP
context for the UE and PDU session.
- Also, re-use and reconfigure existing SDAP entity if already
exists.
- logging has been added to trace mapped QFIs from RRC and resulting
table entries
4. Improved QFI-to-DRB management
- Refactored nr_sdap_qfi2drb_map_update() to register QFIs based on
parsed config
- Ensures control PDUs are correctly routed even after reconfiguration
- Extended nr_sdap_ue_qfi2drb_config: perform UL QoS flow to DRB
mapping configuration for a SDAP entity has already been established
according to TS 37.324, 5.3 QoS flow to DRB Mapping, 5.3.1
Configuration Procedures. Handle both UL QoS Flows mapping rules to
add and to remove. QFIs will now be properly unmapped if specified
via mappedQoS_FlowsToRelease, this might prevent stale QFI mappings
from being used incorrectly.
- nr_sdap_qfi2drb() and sdap_map_ctrl_pdu() now strictly fallback to
default_drb only if a QFI mapping is missing. Missing default DRB
now triggers LOG_E() (previously silent or misrouted to DRB 0).
5. Other cleanup
- Remove dependencies from legacy rb_id_t
Improve handling of selection of RSRP/SINR report via configuration file
In current develop, the selection of SSB or CRI RSRP depends on the
do_CSIRS flag being activated. That's not wanted. CRI report for now it
is never handled, while we need SSB RSRP report for beam switching
regardless of CSI-RS configuration.
This commit refactors the SDAP entity QoS flow to DRB mapping functionality
to improve code organization and enhance maintainability.
Key changes:
- Split nr_sdap_qfi2drb_map_update into focused functions:
* nr_sdap_add_qos_flows_to_drb: handles QFI addition to DRB
* nr_sdap_rm_qos_flows_from_drb: handles QFI removal from DRB
* nr_sdap_ue_control_pdu_config: handles UE control PDU generation
- Consolidate add/modify logic into reusable nr_sdap_addmod_entity function
- Remove entity existence checking and updating from new_nr_sdap_entity:
this function should only add SDAP entities
- Improve function separation of concerns: do SDAP entity add or update
separately and improve modularity by splitting operations in self
contained functions
- At SDAP creation, do only add of QFI to DRB mapping
- rename new_nr_sdap_entity to nr_sdap_add_entity for function naming consinstency
- Remove rb_id parameter from nr_sdap_tx_entity() function signature
- Update tx_entity function pointer
- Remove rb_id parameter from sdap_data_req() function signature
- Remove unused rb_id variable from sdap_tun_read_thread
The rb_id parameter was redundant since SDAP determines DRB ID
from QFI mapping via entity->qfi2drb_map(entity, qfi). This
simplifies the interface.
Each QFI should always be mapped to a DRB. If that is not the case, we
have an undefined behavior. This should not occur. This commit prints
an error in tx_entity and returns.
The TX/RX entity should have different behavior according to
5.2.1, 5.2.2, 3GPP TS 37.324, depending on whether it is UL and DL.
The gNB can play a role both as UL RX entity and DL TX entity, while
the UE can play a role both as UL TX entity and DL RX entity.
The goal of this commit is to extend the information stored in the
SDAP entity as the current code is just marking the entity as TX/RX.
The commit introduces a bitmap to store the role of the
entity, which can be DL RX, DL TX, UL RX and UL TX. Based on this
the TX SDAP entity knows whether a DL/UL PDU should be build, and
the RX SDAP entity knows whether a DL/UL PDU should be processed.
See also Figure 4.2.2-1.
SDAP headers are present only if enable_sdap option is used.
nr_sdap_qfi2drb_map_update function pointer should
process QFIs to add and release from the entity mapping, therefore
a new function pointer for QFIs to add was introduced and
the function pointer to release the QFIs was called in the same function.
Now the nr_sdap_qfi2drb_map_update is:
(1) looping through the QFIs to add/update and store in the qfi2drb_table
(2) looping through the QFIs to release and delete from qfi2drb_table
Also:
* Update the function signature to use sdap_config_t and nr_sdap_entity_t
* log error when the update fails
* limit the scope of the function
* clang-formatted
* removed limit on table entries set by AVLBL_DRB, replaced with MAX_DRBS_PER_UE
The function nr_sdap_ue_qfi2drb_config should do UL QoS flow to DRB mapping configuration
for a SDAP entity has already been established according to TS 37.324, 5.3 QoS flow to
DRB Mapping, 5.3.1 Configuration Procedures. It should handle both mapping rules to add and to remove.
To this purpose:
* Simplify function signature by passing the sdap config.
* Improve readability of the function.
* Move handling of sdap.mappedQFIs2ReleaseCount (in nr_reconfigure_sdap_entity)
inside the function.
* Simplify end-marker control PDU mapping function by removing unused
DRB ID input parameter (the function is fetching the DRB ID based on the input
map type)
* use int instead of legacy rb_id_t
* limit scope of functions whenever necessary
The goal of this function is to return the DRB ID mapped to the input QFI, for both DL and UL.
The function looks up the DRB that is mapped to the QFI, if no mapping rule exists
returns the default DRB. Returns 0 If no mapping and no default DRB exists for that QFI
The function should not update the stored mapping rules, that is done when receiving
a new SDAP configuration. In this function it was removed.
See TS 37.324, 5.2.1 Uplink
> If there is no stored QoS flow to DRB mapping rule for the QoS flow as specified in the subclause 5.3,
> map the SDAP SDU to the default DRB else, map the SDAP SDU to the DRB according to the stored QoS flow to DRB mapping rule.
* change function signature: pass the sdap_config_t
* update qfi2drb mapping when receiving a configuration for an already existing SDAP entity
* always update mapping rules, not only for default DRB
* use get_sdap_Config to process sdap_Config
* move SDAP config logic to the scope where it is relevant
* add SDAP entity direcly in RRC, not from PDCP
* replaced nr_pdcp_add_drbs with single add_drb call: it was no longer
efficient to keep it in the new logic. The addMod list can be looped directly in RRC.
* add specific function to add bearers from addMod list in E1, NSA, and UE
fix direct bugs of not used RU_RX_SLOT_DEPTH defined constant
with this commit, the gNB can work if we change RU_RX_SLOT_DEPTH to
another value than 4 but it remain not well designed
Initialize NCC=0 on NGAP Initial Context Setup (3GPP TS 33.501 §6.9.2.1.1)
The nhcc should be initialized to 0 upon Initial Context Setup.
Also, remove unused kgnb_ncc: nh_ncc is already there.
Closes#1008
[CI] Update the Push to DockerHub Stage
This MR addresses two cases:
1. Error Handling: Ensures subsequent Image Test Processes stages
continue to run even if the preceding Push to DockerHub stage fails
(applies when the condition is PUSH event and doBuild is true).
2. Introduces conditional logic to correctly handle multi-architecture
images: Images built for both AMD64 and Jetson ARMv8 (oai-gnb,
oai-nr-ue, oai-nr-cuup) use docker buildx imagetools for push to
DockerHub.
All other AMD64 images are pushed using standard Docker commands.
Related MR !3691
Add monolithic N2 handover test pipeline with B210 and Quectel
The goal of this MR is to provide an automated end-to-end N2 HO
validation with real RF (B210) and Quectel UE.
During the testing phase a post-HO assertion failure due to
uninitialized selected_plmn_identity was found: this was also fixed.
CI: Add monolithic N2 handover test pipeline (B210 + Quectel)
- New XML pipeline for N2 HO testing
- Docker Compose for two monolithic gNBs (gNB1/gNB2)
- Handover sequence: gNB1 → gNB2 → gNB1 with 5s controlled attenuation
(RC4DAT).
- Channel mapping: ch1-2 gNB1, ch3-4 gNB2
- Telnet server enabled for CI commands
- Clean-up/reset of attenuator state included
NGAP
- fix PLMN/cell location for Initial UE and Uplink NAS
- Prevents assertion in ngap_gNB_nas_uplink() due to uninitialized
selected_plmn_identity
- Initial UE Message: pass UE-selected PLMN and NR cell ID from RRC to
NGAP
- Uplink NAS Transport: use PLMN, TAC, and cell ID from the message
- Build NR CGI as gNB ID + cell ID
- Store UE-selected PLMN only in RRC UE context (for later NAS); stop
storing PLMN in NGAP UE context.
- PLMN validation when processing handover requests from the source gNB:
when PLMN validation fails, the target gNB now properly sends
NGAP_HANDOVER_FAILURE
- Store serving PLMN for later use in UE context
UE symbol based PDCCH receiver
This is a partial rebase/rewrite of !2895
The goal of this MR is to check how we can merge this.
The eventual result is stated in !2895. The way forward is to modify UE
RX procedures to work symbol by symbol by extracting the symbol loop out
of RX procedures. After all channels are modified this way, the main
thread can be modified to work symbol by symbol.
At this point only PDCCH was modified.
- Push both AMD64 & ARMv8 Jetson images together for images built on both using `docker buildx imagetools`
- Use standard 'docker pull and push' for images built only on AMD64.
Prevent assertion in ngap_gNB_nas_uplink() due to uninitialized selected_plmn_identity:
the selected_plmn_identity field was not being set during N2 handover,
causing the assertion ((plmn->mnc_digit_length == 3) || (plmn->mnc_digit_length == 2))
to fail when processing subsequent NAS messages. The issue is that the Serving PLMN
is not stored by RRC. During N2 mobility, RRC can get this info from GUAMI.
When receiving the Handover Request the target gNB knows from GUAMI
which serving PLMN is the AMF belonging to. In current design, allowed PLMNs
are stored in rrc.configuration. The incoming PLMN needs to be validate
against the PLMNs in the list, then stored in the UE context as Serving PLMN.
This change adds PLMN validation when processing handover requests from the source gNB.
The validation is needed because:
- Target gNB must verify that the PLMN from the GUAMI in the handover request
is allowed by its configuration before accepting the handover to prevent handover
to unsupported PLMNs.
- When PLMN validation fails, the target gNB now properly sends NGAP_HANDOVER_FAILURE
- UE Context must store serving PLMN for later use
This commit is removing the storage of selected PLMN in NGAP UE context.
We store the Serving PLMN in the RRC UE context instead.
The Selected PLMN is the PLMN that the UE chose (or was directed to) for registration
and it is sent in the RRCSetupComplete. This is different from the selected
PLMN mentioned in the NG INITIAL UE MESSAGE for network sharing.
Selected PLMN: determines which core network and AMF the UE is registered with
GUAMI = Identifies the serving AMF and includes the PLMN of that AMF
Serving PLMN: the PLMN that is currently serving the UE (e.g. contained in GUAMI)
The AMF’s PLMN may match the selected PLMN, or not (especially in network sharing or roaming).
Regardless, the UE always have a Serving PLMN.
Initial UE message does not have a TAI IE per se, but TAI is a mandatory
member of the mandatory UserLocationInformation CHOICE.
NR CGI is also mandatory and carried inside UserLocationInformation:
in network sharing, the PLMN ID in TAI takes on additional
significance: RAN is shared but CN are different, so in this case PLMN in TAI is
needed for the AMF route the message to the correct operator’s core.
If network sharing applies (e.g., shared RAN between PLMN-A and PLMN-B):
the UE or network may select PLMN-B instead, and that PLMN identity
is included in the Initial UE Message’s TAI IE.
Conclusion:
1) UE always sends the selected PLMN during the registration,
regardless of whether it is shared or not.
2) Selected PLMN Identity is an actual IE sent in the RRCSetupComplete
while in NGAP there's no Selected PLMN Identity IE, only PLMN Identity
IEs in both TAI and NR CGI. It is a subtle difference.
3) The serving PLMN of the UE needs to be stored in RRC UE Context for
later use in NAS procedures. e.g. at initial registration it matches
the Selected PLMN
4) No need to store PLMN in NGAP UE Context, params are passed by RRC
5) TAI and NR CGI, which contain the PLMN identity, are mandatory in
UserLocationInformation IE CHOICE, and should reflect current status
Changes
- Initial UE Message: pass UE-selected PLMN and NR cell id from RRC to NGAP
- Uplink NAS Transport: use PLMN, TAC, and cell id provided by the message;
- Build NR CGI from gNB ID + cell id
- Store UE-selected PLMN only in RRC UE context at NAS_FIRST_REQ for later
Uplink NAS, stop storing PLMN in NGAP UE context
- Add XML pipeline for N2 handover testing
- Add Docker compose for two monolithic gNBs
- Features:
* Two monolithic gNBs (gNB1, gNB2) with proper CU+DU parameters
* Gradual attenuation control using RC4DAT attenuator (5s duration)
* N2 handover sequence: gNB1 → gNB2 → gNB1
* Proper channel mapping: ch1-2 for gNB1, ch3-4 for gNB2
* Telnet server configuration for CI commands
* Handover-specific neighbor configuration
* Clean test state management with attenuator reset
Update based on !3645
Note: For some test configurations we still need to provide
ra_ResponseWindow, for more details, check commit message of
41d14b571c
1. Refactor PDCCH PHY functions to take rxdataF of one OFDM symbol and
produce LLR for each search space. The modified functions take
rxdataF in a different format than that produced by nr_slot_fep(). So
for now a memcpy is used to change the array structure. Once
nr_slot_fep() is modified, this memcpy will no longer be needed and
will be removed.
2. Modify DCI functions to decode DCI in the last PDCCH symbol and
inidcate to MAC once.
3. Fix PDCCH monitoring for start symbol > 0.
4. Fix multiple PDCCH monitoring within slot.
Co-authored-by: Sakthivel Velumani <mail@sakthi.me>
1.Create new funtion nr_symbol_fep() to do OFDM demod of one symbol on
all antennas. This is called by nr_slot_fep() for now. In the
upcoming MR, this function will be called directly after reading
each OFDM symbol from the radio.
2.Removed redundant memory alignment. DFT function performs memory
alignment if the input memory is not aligned.
Fixes for T-Tracer to work with NR-UE
Fixes to align NR UE events with their definitions in T_messages.txt and
match the expected format in the tracer GUI parser.
Also fixes DL SNR to work in tracer GUI.
Support beam index in OAI 7.2 Fronthaul Interface
This branch supports beam index in OAI 7.2 Fronthaul Interface.
- For CP DL (PDSCH), nBeamIndex of the corresponding prbMapElm is set
when sending IQ data in oran_fh_if4p5_south_out. nBeamIndex of the
corresponding prbMapElm is set when sending IQ data in
oran_fh_if4p5_south_out.
- For CP UL (PUSCH and PRACH), nBeamIndex of the corresponding prbMapElm
is set in oran_fh_if4p5_south_out.
In addition, it fixes a couple of issues
- XRAN hardcodes nBeamIndex of PRACH to zero. Modify XRAN to support
setting of nBeamIndex of PRACH and update xran F release patch.
- Fix the bug in calculating fh_config->neAxc where num_beams_period is
multiplified twice
Testing methodology: Use Benetel O_RU for testing even though it does
not support beamforming. With successful registration and data transfer,
one could check the pcap on the fronthaul interface to see if CP packets
are with the right beam index.
Results:
1. Verified that CP-packets for SSB, DCI, PDSCH, PRACH, PDSCH, PUSCH,
CSI-RS and SRS are with the right beam index
2. Verified that there is no side-effect on Benetel O_RU. UE could
register properly.
3. Verified 4 SSB with ssb_PositionsInBurst_Bitmap = 85. Could see SSB
and PRACH with 4 different indices.
Handle CP UL packet at xran_fx_tx_send_slot() instead of
xran_fh_rx_read_slot(), as the latter would set this information too
late (on reception on samples, but it needs to be filled in the CP
packet prior to reception).
Initialize ru_info structure with beam information, and set beams on TX
direction. Initialize the number of antennas for both RX/TX in both
cases for completeness.
By configuring the Jenkins pythonExecutor to match the test machine, we can use
localhost as the node for running individual test cases. This change makes it
easy to move tests across machines, as the only adjustment needed is updating
the pythonExecutor in Jenkins.
By configuring the Jenkins pythonExecutor to match the test machine, we can use
localhost as the node for running individual test cases. This change makes it
easy to move tests across machines, as the only adjustment needed is updating
the pythonExecutor in Jenkins.
By configuring the Jenkins pythonExecutor to match the test machine, we can use
localhost as the node for running individual test cases. This change makes it
easy to move tests across machines, as the only adjustment needed is updating
the pythonExecutor in Jenkins.
1. Fix UE_PHY_PDSCH_IQ event
2. Fix UE_PHY_PDCCH_ENERGY event
3. Fix UE_PHY_PDSCH_ENERGY event
4. Fix UE_PHY_MEAS event
All fixes align NR UE events with their definitions in T_messages.txt and match the expected format in the tracer GUI parser.
Integration `2025.w42`
* !3623 Optimization of PDSCH precoding operation
* !3691 \[CI\] Ensure multi-arch DockerHub Push after successful image build
* !3696 asn1c doesn't follow c99 variables alias rules, it needs to be compiled this...
* !3685 Assign antenna ports correctly for 1 and 2 layers for aerial.
* !3495 Type0 PDSCH frequency allocation at L1 UE
* !3686 Remove NR L2 simulator code from UE
* !3693 Remove B200-specific clock-rate setting
* !3701 OAI UE: add shared RSRP Table 10.1.6.1-1 mapping function to helpers and adopt it RRC UE
* !3662 RRC UE file cleanup
* update doc/README.md
* !3608 use common scale channel functions for DLSCH and ULSCH
* !3694 fix non initialized DMRS port value in case of DCI00 at UE
* !3702 Extend F1 rfsim CI test
* !3704 remove unused global queues, dead code
* !3673 CI: Aerial: Add an UL-heavy pipeline test
* !3651 CI: Upgrade HO setup to use an attenuator
* !3695 CI: Upgrade Aerial setup to 25-2.1
Closes#940
See merge request oai/openairinterface5g!3700
CI: Upgrade Aerial setup to 25-2.1
The purpose of this MR is to upgrade the cuBB image in the Aerial setup to
release 25-2.1 and update the doc/Aerial_FAPI_Split_Tutorial.md accordingly.
CI: Upgrade HO setup to use an attenuator
The goal of this MR is to upgrade HO CI setup to include a digital attenuator
that will allow us to trigger handover by attenuating the signals on the DUs.
Doing this before using set_master_clock_rate() on the B200 seems to
invalidate synchronization setting.
[HW] USRP clock set to 1759836386.000000 sec
[...]
[HW] current pps at 3.286750, starting streaming at 4.286750
In other words, the current time setting was reset. With this change
now, we see
[HW] USRP clock set to 1759929873.000000 sec
[...]
[HW] current pps at 1759929873.000000, starting streaming at 1759929874.000000
This is because changing clock sources (I assume setting the master
clock rate impacts the clock) can result in changing the time. From the
documentation of [1]:
> Note: When changing clock sources, a previously set time will most
> likely be lost. It is recommended to set the time after changing the
> clock source. Otherwise, an unexpected time may line up with future PPS
> edges.
[1] https://files.ettus.com/manual/classuhd_1_1usrp_1_1multi__usrp.html#a99254abfa5259b70a020e667eee619b9
- main.py: replace %%workspace%% with CONTAINERS.eNBSourceCodePath in Custom_Command and Custom_Script
Co-authored-by: Guido Casati <hello@guidocasati.com>
- Add band mismatch check in valid_du_in_neighbour_configs function
- Ensures neighbor cell band matches serving cell band
- Prevents invalid neighbor configurations for handover
The code only checked that Msg3 would be scheduled during UL, but in
some combinations, e.g., with DSUUU, the current slot can very well be
UL as well => we would schedule DCI in UL slot.
Update cuBB image to cubb-build:25-2.1_srs-ul-heavy (release 25-2.1 with
changes in the L1 config to test heavy ul)
Co-authored-by: Reem Bahsoun <reem.bahsoun@openairinterface.org>
fix non initialized DMRS port value in case of DCI00 at UE
When transmitted PUSCH is neither scheduled by DCI format 0_1 with CRC
scrambled by C-RNTI, CS-RNTI, SP-CSI-RNTI or MCS-C-RNTI, nor
corresponding to a configured grant, the UE shall use [...] DM-RS port
0.
In UE code it was not set in case of DCI00 and that was leading to ULSCH
failures in some scenarios.
- Trigger handover
- IdleSleep 2s
- Ping ext-dn from NR-UE
- Verify UE(1) connected to DU-PCI1
Validate absence of heap-use-after-free ASAN error found in !3600.
Closes#940
OAI UE: add shared RSRP Table 10.1.6.1-1 mapping function to helpers and adopt
it RRC UE
- Add to common/utils/nr/nr_common remove from NR_MAC_UE/nr_ue_procedures.c
- Adopt in asn1_msg.c for MeasurementReport: this solves the following possible
assert:
Assertion (enc_rval.encoded > 0) failed!
In do_nrMeasurementReport_SA() /oai-ran/openair2/RRC/NR/MESSAGES/asn1_msg.c:898
ASN1 message encoding failed (MeasResultServMOList, 18446744073709551615)!
Motivation: unify RSRP-to-index mapping across layers and fix NR RRC
MeasurementReport encoding failures due to out-of-range values by reusing the
validated mapping.
Note: NR_RSRP-Range.c constraint: /* (0..127) */
Also refactored MeasurementReport to improve the code.
Remove B200-specific clock-rate setting
Avoid this clock-rate setting, as we already do it around usrp_lib.cpp:1121, so
it is superfluous. For instance, we also do not set a master clock rate for N3xx
either. This also enables us to synchronize B200 for handover settings,
e.g., for !3651.
See the commit message for more information about synchronization.
- Simplify do_nrMeasurementReport_SA API (encoder allocates local report)
- Adopt asn1cCalloc consistently
- Minor init cleanup for UL_DCCH message struct
- Add to common/utils/nr/nr_common remove from NR_MAC_UE/nr_ue_procedures.c
- Adopt in asn1_msg.c for MeasurementReport: this solves the following assert:
Assertion (enc_rval.encoded > 0) failed!
In do_nrMeasurementReport_SA() /oai-ran/openair2/RRC/NR/MESSAGES/asn1_msg.c:898
ASN1 message encoding failed (MeasResultServMOList, 18446744073709551615)!
Motivation: unify RSRP-to-index mapping across layers and fix NR RRC MeasurementReport
encoding failures due to out-of-range values by reusing the validated mapping.
Note NR_RSRP-Range.c constraint:
{ APC_CONSTRAINED, 7, 7, 0, 127 } /* (0..127) */
Remove NR L2 simulator code from UE
This MR removes NR (SA and NSA) L2 simulator from the codebase. The code, at
least at the UE side, was done at a time where there was no clear L2/L1 split
leading to a complex implementation that never worked as expected. The L2
simulator has been broken and removed from testing for long time and, once it
needs to be revived, it would require a complete new implementation.
Assign antenna ports correctly for 1 and 2 layers for aerial.
With this change aerial successfully decodes PUSCH with 2 UL layers.
The code should use sched_pusch->dmrs.num_dmrs_cdm_grps_no_data == 1 rather
than NFAPI_MODE != NFAPI_MODE_AERIAL, but that will make the changes a bit
more extensive.
Prior to this change, sending antenna_ports.val = 2 with rank 2 would tell
the UE to transmit on DMRS ports 2,3 rather than 0,1 causing it to not decode.
[CI] Ensure multi-arch DockerHub Push after successful image build
This merge request improves the CI script to ensure that the DockerHub-Push
stage executes whenever:
- All Image Build stages succeed &
- doBuild is true &
- The event is a PUSH
This behavior ensures that Docker images are published whenever the image build
stages succeed, regardless of any failures in the Image Test stages.
Jetson ARM64/V8 and AMD64 images will now be published on DockerHub under the
same tag (develop or WEEK_TAG) to provide multi-architecture images.
Optimization of PDSCH precoding operation
x86/aarch64 optimizations for precoding, more complete timing reporting in
nr_dlsim. Timing report in nr_dlsim now shows the total PDSCH generation time
and is broken down into Layer mapping, resource mapping and precoding.
The optimizations for x86 are basically reorganizing loops (for AVX512,AVX2,
NEON but not SSE2) to minimize repetitive instructions when formatting of the
precoder weights, and creation of inline functions for complex multiply-add.
AVX512 optimization was added. requiring AVX512BW. Detection of up to 4 PRBs
with common PMI for efficiency with AVX512 (was 2 in develop for AVX2).
For aarch64, native coding of the precoder to avoid inefficient SIMDe
translations for this operation.
nr_dlsim now uses default precoding indices depending on the scenario instead
of 0 which doesn't do precoding at all.
See merge request description for nr_dlsim test results.
- On PUSH events, if image build stages succeed, trigger DockerHub push stage
- Build the images, then trigger the Push to DockerHub stage
- Publish Jetson (ARM64/v8) and AMD64 images under the same tag on DockerHub
Doing this before using set_master_clock_rate() on the B200 seems to
invalidate clock settings:
[HW] USRP clock set to 1759836386.000000 sec
[...]
[HW] current pps at 3.286750, starting streaming at 4.286750
In other words, the current time setting was reset. With this change
now, we see
[HW] USRP clock set to 1759929873.000000 sec
[...]
[HW] current pps at 1759929873.000000, starting streaming at 1759929874.000000
This is because changing clock sources (I assume setting the master
clock rate impacts the clock) can result in changing the time. From the
documentation of set_time_next_pps() [1]:
> Note: When changing clock sources, a previously set time will most
> likely be lost. It is recommended to set the time after changing the
> clock source. Otherwise, an unexpected time may line up with future PPS
> edges.
[1] https://files.ettus.com/manual/classuhd_1_1usrp_1_1multi__usrp.html#a75b1c5375549e6a446d686ee7d9b4e14
The next commit introduces an "UL-heavy" configuration to be tested with
Aerial. To avoid waiting for the CN, start&stop it once at the beginning
of the CI run.
Reduce throughput requirement, as this fails once two DUs are connected
to a UE, which creates more load on the machine and frequently fails
with low throughput.
CI: Enable Physim threshold check for tests on Caracal and GH
This MR adds support for configurable timing threshold files in PhySim
tests.
- Introduces a new CMake cache variable PHYSIM_CHECK_FILES to specify
one or more timing threshold files (semicolon-separated).
- Enables optional enforcement of timing thresholds check in PhySim
tests without changing existing test definitions.
- Defines timing thresholds for LDPC encoding/decoding in nr_ulsim,
nr_dlsim and ldpctest on Caracal and GH machines.
SRS noise power
This MR implements the calculation of the noise power based on SRS in a
different way, and check whether SNR is more accurate or not. This MR is
built on top of the MR: !3460
A graph was added in T_Tracer to observe UL-SNR calculated using SRS.
See merge request description for measurement results.
Replace the previous add_timed_physim_test() macro with add_physim_test()
to use a single, unified function for defining physim tests. This simplifies
the test configuration and removes redundant macro definitions while keeping
all existing functionality.
This change follows up on the earlier addition of support for including
custom timing threshold files (PHYSIM_CHECK_FILES).
Update existing tests accordingly.
Add missing timinig analysis scripts to RHEL9 physim docker image. These files
are now copied from the build stage to /oai-ran/openair1/SIMULATION/tests/,
where they are expected by ctest.
Resolves following issue when running ctest in docker container:
CMake Error: Error processing file: /oai-ran/openair1/SIMULATION/tests/RunTimedTest.cmake
For some physical simulators, we have multiple SNR iterations.
The previous version of the script correctly retained only the last
measurement, but if a previous measurement condition set RC=1, the
script would fail although the final "good" run might fulfil the
measurement condition (IOW, it would show SUCCESS, but still fail on the
check).
Instead, check if all measurement lines finish on SUCCESS, which handles
the above case.
The awk script in analyze-timing.sh used syntax that works with gawk but fails
on systems where mawk is the default implementation, producing errors such as:
awk: /dev/fd/3: line 6: syntax error at or near ,
-- test command finished with SIGPIPE
Concretely, the match(text, pattern, variable) function does not exist
in mawk, as it cannot capture matches in variables. Work around by
substituing strings, and force a numeric comparison.
Fixes to prevent assertion due to 0 PRB allocation
Assertion (NPRB>0 && (NPRB + RBstart <= BWPsize)) failed!
In PRBalloc_to_locationandbandwidth0() /home/user/openairinterface5g/common/utils/nr/nr_common.c:506
Illegal NPRB/RBstart Configuration (0,51) for BWPsize 51
Probably caused by missing safeguards to prevent computing TBS with 0 PRB
as input.
Fix OAI UE memory leaks
Fix 1: Replaced asn1cFreeStruc with ASN_STRUCT_FREE in MAC layer to properly
free nested ASN.1 structures in cell group configuration.
Fix 2: Removed premature nullification of dedicatedNAS_Message->buf in
dlInformationTransfer processing to allow proper ASN.1 cleanup.
Fix 3: Fixed memory ownership in nr_rrc_process_dedicatedNAS_MessageList by
copying OCTET_STRING data instead of transferring ownership, preventing
ASN.1 cleanup from losing track of allocated memory
Closes#828
fix RSRP computation at UE
Conflicts between !3595 (merged) and !3596 (merged) leading to double conversion
of RSRP into index in L1 and L2. With this fix it is only converted in L2.
Replace int16 min when obvious
INT16_MIN doesn't have a opposite value on 16 bits, so SIMD abs (absolute()), or
simple C operations doesn't make the expected result.
example:
(gdb) p (short)-(short)-32768
$4 = -32768
(gdb)
This MR replaces constants INT16_MIN by -INT16_MAX (so -32767) in places where
it used for mathematical operations. This is not perfect, nevertheless reduces
overflow probability.
We saw in some places a dirty case: code do first calls to _mm_adds_epi16
(or subs), so because of the saturated operations, the probability to reach
32767 and -32768 is higher than the other numbers but, _mm_abs_epi16(), or
negate operations (conjugate) can follow, that is making strong error as
abs(-32768)=-32768
Also, don't use "set -x" debugging for oc login command:
ci-scripts/cls_cmd.py:242 sets BASH_XTRACEFD=1, which makes that all
"set -x" output is in stdout, leading to a redirect to the file into
which we redirect. This would lead to the following error with
unsuccessfull oc login:
error: You are not a member of project "****-core-for-ci-ran".
Error from server (Forbidden): imagestreams.image.openshift.io "oai-physim"
is forbidden: User "system:anonymous" cannot get resource "imagestreams" in
API group "image.openshift.io" in the namespace "****-ran"
This fixes basically two problems. First, remove "set -e", which leads
to the script exiting on error. For instance, there was the sleep which
should account for the time of the pod being in "ContainerCreating", but
might not be enough. In that case, the script would exit, leaving the
pod deployed.
Second, a fixed time is not good, as it can be too short and unduly
prolong waiting time. Replace with a loop.
- Remove unnecessary NULL assignment for dedicatedNAS_Message->buf
- The original buffer is copied and transfered to NAS, so it can be properly freed by ASN.1 structure cleanup
Root cause: Code was nullifying dedicatedNAS_Message->buf pointer before ASN.1 cleanup could free the original allocation, causing the leak from OCTET_STRING_decode_uper.
AddressSanitizer leak trace (FIXED):
Direct leak of 119 byte(s) in 3 object(s) allocated from:
/#0 0x7ec2a42b4c38 in __interceptor_realloc
/#1 0x555fade852e0 in OCTET_STRING_decode_uper
/#9 0x555fadb48b11 in nr_rrc_ue_decode_dcch.
The leak was caused by improper memory ownership handling in the
dedicatedNAS_MessageList processing. The function was transferring
buffer ownership to NAS messages and then preventing ASN.1 cleanup
from freeing the original allocations by setting
list.count = 0, causing a memory leak.
Leak trace:
Direct leak of 40 byte(s) in 1 object(s) allocated from:
/#0 0x7f2ce3ab4a57 in __interceptor_calloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:154
/#1 0x567907083f0f in OCTET_STRING_decode_uper /cmake_targets/ran_build/build/openair2/RRC/LTE/MESSAGES/OCTET_STRING_uper.c:89
/#2 0x5679070ed5e6 in SET_OF_decode_uper /cmake_targets/ran_build/build/openair2/RRC/NR/MESSAGES/constr_SET_OF_uper.c:70
/#3 0x56790707b6dc in SEQUENCE_decode_uper /cmake_targets/ran_build/build/openair2/RRC/LTE/MESSAGES/constr_SEQUENCE_uper.c:118
/#4 0x56790707b6dc in SEQUENCE_decode_uper /cmake_targets/ran_build/build/openair2/RRC/LTE/MESSAGES/constr_SEQUENCE_uper.c:118
/#5 0x56790709a403 in CHOICE_decode_uper /cmake_targets/ran_build/build/openair2/RRC/LTE/MESSAGES/constr_CHOICE_uper.c:84
/#6 0x56790707b6dc in SEQUENCE_decode_uper /cmake_targets/ran_build/build/openair2/RRC/LTE/MESSAGES/constr_SEQUENCE_uper.c:118
/#7 0x56790709a403 in CHOICE_decode_uper /cmake_targets/ran_build/build/openair2/RRC/LTE/MESSAGES/constr_CHOICE_uper.c:84
/#8 0x56790709a403 in CHOICE_decode_uper /cmake_targets/ran_build/build/openair2/RRC/LTE/MESSAGES/constr_CHOICE_uper.c:84
/#9 0x56790707b6dc in SEQUENCE_decode_uper /cmake_targets/ran_build/build/openair2/RRC/LTE/MESSAGES/constr_SEQUENCE_uper.c:118
/#10 0x56790708b5f1 in uper_decode /cmake_targets/ran_build/build/openair2/RRC/LTE/MESSAGES/uper_decoder.c:83
/#11 0x567906d44b4b in nr_rrc_ue_decode_dcch /openair2/RRC/NR_UE/rrc_UE.c:2212
/#12 0x567906d520a3 in rrc_nrue /openair2/RRC/NR_UE/rrc_UE.c:2615
/#13 0x567906d5f77e in rrc_nrue_task /openair2/RRC/NR_UE/rrc_UE.c:2501
/#14 0x7f2ce2494ac2 in start_thread nptl/pthread_create.c:442
Fix:
- Copy OCTET_STRING data instead of transferring ownership
- Allow ASN.1 cleanup to properly free original allocations
This fixes the leak that occurred during rrcReconfiguration
message processing when dedicatedNAS_MessageList was present.
Closes#828
- Replace asn1cFreeStruc with ASN_STRUCT_FREE in MAC layer cleanup
- Fixes improper memory management of NR_CellGroupConfig structures
Root cause: asn1cFreeStruc only calls ASN_STRUCT_RESET + free(), which doesn't properly free nested ASN.1 allocations. ASN_STRUCT_FREE frees all nested structures completely.
AddressSanitizer leak trace:
Direct leak of 288 byte(s) in 1 object(s) allocated from:
/#0 0x7fb72bab4a57 in __interceptor_calloc
/#1 0x593752b28d0d in SEQUENCE_decode_uper
/#2 0x593752b9a546 in SET_OF_decode_uper
/#3 0x593752b2863c in SEQUENCE_decode_uper
/#4 0x593752b47363 in CHOICE_decode_uper
/#5 0x593752b2863c in SEQUENCE_decode_uper
/#6 0x593752b2863c in SEQUENCE_decode_uper
/#7 0x593752b2863c in SEQUENCE_decode_uper
/#8 0x593752b2863c in SEQUENCE_decode_uper
/#9 0x593752b2863c in SEQUENCE_decode_uper
/#10 0x593752b38551 in uper_decode
/#11 0x5937527d859f in nr_rrc_ue_process_masterCellGroup
/#12 0x5937527d9408 in nr_rrc_process_reconfiguration_v1530
/#13 0x5937527dd5bb in nr_rrc_ue_process_rrcReconfiguration
/#14 0x5937527f5e6b in nr_rrc_ue_decode_dcch
/#15 0x5937527ff003 in rrc_nrue
/#16 0x59375280c6de in rrc_nrue_task
Integration: `2025.w40`
* !3672 \[ci\] Fix MissingPropertyException - COTS-UE by binding OAI_Registry globally
* !3609 BWP with no PRACH occasions
* !3657 do not assert for mismatched TBS in phy-test mode
* !3667 CI: Updates for HO and AW2S pipeline
* !3674 NR UE: remove function get_nr_RSRP() and get_nr_rx_total_gain_dB() for cleanup
* !3478 NR UE: add UCI (HARQ-ACK/NACK) on PUSCH support at PHY
* !3664 modulation LUTs size was wrong, and remove inconsistent test of SSE2 enable
* !3665 Make all targets compile
* !3554 Handle failures in RRCReconfiguration encoding gracefully
* !3655 Improvements to N2 handover
* !3678 Add OAIUE longrun pipeline
* !3628 Update documentation
Closes#979, #726, #959, #967, and #930
See merge request oai/openairinterface5g!3676
Add OAIUE longrun pipeline
Add a new XML file for OAIUE longrun.
- Test description:
* 40 MHz BW, n78
* gNB with USRP N310, UE with USRP N310
* CN deployed on OC
- Test duration: 1 hour
- Test scenario: 3x DL 10 min test (20 Mbps) + 3x UL 10 min test (5
Mbps)
pods deployed through helm occasionally take more time, leading to
errors such as
Error from server (BadRequest): container "physim" in pod "oai-physims-4g-sczvl" is waiting to start: ContainerCreating
Give a bit more time before checking the logs. We cannot wait too much,
as the container will just end on FINISHED in running state, so the logs
will always be there.
Make all targets compile
This MR enables us to compile all targets, and does that in one CI test. This
closes#726. Now, this should work:
cd ~/openairinterface5g
mkdir build && cd build
cmake .. -GNinja && ninja
To achieve this, I did the following:
- some targets have been fixed (warnings, errors)
- some targets have been removed when they did not seem to serve a good purpose
(e.g., an almost empty test)
- some targets have been commented (e.g., LTE simulators, some unitary tests)
which we maybe want to revive in the future
- some targets built when just building with ninja, but not all. For instance,
telnetsrv_enb would typically build, but it was missing a dependency. Doing
cmake .. -GNinja && ninja telnetsrv_enb would show this (in develop)
To help with the last bullet point, there is a script compile_targets.sh that
can compile targets independently (and in parallel, to not wait for ages) to
show that targets compile properly compile-targets.patch.
In almost all cases, the problem is that a specific module uses the logging
module, which depends on T, which needs to dynamically create headers. The way
to do this is to have a dependency, and many targets use generate_T or {T_LIB}
({} intentional: T might be absent, so then it evaluates to nothing). However,
not all do this, and those that depend on T actually don't depend on T, but on
the logging module, which in turn depends on T. So in many places, a simple
dependency onto log_headers fixes this problem, and generate_T or {T_LIB}
simplifies the dependency (but not always). The commits should have more info.
Note that at least the targets in FlexRIC do not all compile, at least in the
configuration that we use in docker/Dockerfile.build.ubuntu. So for the latter,
we cannot build with a simple ninja, but FlexRIC seems to be the only one that
does not compile. Since FlexRIC is a separate repository, that needs to be
addressed in the corresponding repository.
Previously, the script attempted to directly merge ${merge}, which could f
ail if the branch was not already available locally. This update explicitly
fetches the branch from origin and then merges FETCH_HEAD with --ff, ensuring
the merge works even when the branch is missing locally.
- Move 'What is a gNB neighbor?' explanation from rrc-usage.md to handover-tutorial.md where it belongs
- Replace generic parameter names with actual configuration parameter names and specific descriptions (e.g. gNB_ID, nr_cellid)
- Add example configuration structure showing proper syntax
- Add missing 'band' parameter that was not listed before
- Provide concrete examples and exact constraints for each parameter
- Cross-reference between documents for better organization
This addresses documentation issues where generic parameter descriptions were
not useful for developers configuring neighbor cells.
- Remove extensive traffic testing before HO (iperf tests 030001, 030002)
- Do 1 ping test after attachment
- Reduce ping packet count from 100 to 50 packets for remaining connectivity test
Time savings: ~2-3 minutes by removing traffic validation overhead
Split monolithic e1_send_bearer_updates into three focused functions:
- e1_send_bearer_updates(): DRB setup from F1 UE Context Modification Response
- e1_request_pdcp_status(): Request PDCP status during inter-CU handover
- e1_notify_pdcp_status(): Notify CU-UP with PDCP status during handover
Extract common helpers:
- append_e1_drb_mod_req(): Common DRB-to-mod for bearer request logic
- e1_send_bearer_modification_request(): Common sending step
Bug fixes:
- Fix loop bounds (i < n instead of i == n)
- Fix array access bounds checking
- Fix DRB ID consistency
Memory management:
- Add missing free_e1ap_context_mod_request calls
- Improve error handling with early returns
In the process:
- Simplify cuup_notify_reestablishment with FOR_EACH_SEQ_ARR loop
- Adopted all callers to use new consolidated functions
Improves maintainability and eliminates complex conditional logic.
Replace field-by-field assignment with struct copy for plmn_identity.
Both source and destination use identical plmn_id_t type, making
this change safe and more maintainable.
- Reduces lines of code
- More readable and less error-prone
- Single memory copy operation instead of multiple field assignments
- ngap_gNB_handover_notify: Fix misleading error message from 'Failed to encode'
to 'Failed to find UE context' for better clarity
- ngap_gNB_handle_ul_ran_status_transfer: Standardize error message format
from 'Could not find' to 'Failed to find' for consistency across functions
This ensures consistent and accurate error reporting across all NGAP handover functions.
- Update encoder functions in ngap_gNB_mobility_management.c to use calloc_or_fail
- Provides zero-initialized memory and consistent error handling
- Prevents uninitialized fields and improves memory safety
Also:
- Update NG Setup Request to use calloc_or_fail
- Replace inefficient 'allocate, extract, free' pattern with direct value extraction
- Remove unused functions get_gap_config_from_smtc() and get_gap_config()
- Add extract_gap_config_from_smtc() that extracts values directly without allocation
- Eliminates use-after-free risk and improves performance
- No allocation overhead, no memory leaks
- Add missing ASN_STRUCT_FREE for NR_MeasGapConfig in create_measgap_config
- Fix 48-byte measurement gap config leak in get_gap_config_from_smtc
AddressSanitizer backtrace:
Direct leak of 48 byte(s) in 1 object(s) allocated from:
/#0 0x7d32adab4a57 in __interceptor_calloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:154
/#1 0x5751f99cbb79 in calloc_or_fail /home/guido/repo/openairinterface5g/develop/common/utils/utils.h:74
/#2 0x5751f99cbb79 in get_gap_config_from_smtc /home/guido/repo/openairinterface5g/develop/openair2/LAYER2/NR_MAC_gNB/nr_radio_config.c:4164
/#3 0x5751f99cbb79 in create_measgap_config /home/guido/repo/openairinterface5g/develop/openair2/LAYER2/NR_MAC_gNB/nr_radio_config.c:4310
/#4 0x5751f9964abe in ue_context_setup_request /home/guido/repo/openairinterface5g/develop/openair2/LAYER2/NR_MAC_gNB/mac_rrc_dl_handler.c:709
/#5 0x5751f979e568 in nr_initiate_handover /home/guido/repo/openairinterface5g/develop/openair2/RRC/NR/rrc_gNB_mobility.c:218
/#6 0x5751f97a637f in nr_rrc_trigger_n2_ho_target /home/guido/repo/openairinterface5g/develop/openair2/RRC/NR/rrc_gNB_mobility.c:526
/#7 0x5751f9703608 in rrc_gNB_process_e1_bearer_context_setup_resp /home/guido/repo/openairinterface5g/develop/openair2/RRC/NR/rrc_gNB.c:2641
/#8 0x5751f9706b7b in rrc_gnb_task /home/guido/repo/openairinterface5g/develop/openair2/RRC/NR/rrc_gNB.c:3020
/#9 0x7d32ac494ac2 in start_thread nptl/pthread_create.c:442
Root cause: create_measgap_config allocated NR_MeasGapConfig via get_gap_config_from_smtc()
but never freed it after extracting the needed values to populate the measgap_config_t
return structure.
- Add missing handover context cleanup in rrc_CU_process_ue_context_release_complete
- Fix 16-byte handover context leak in N2 handover source gNB trigger path
AddressSanitizer backtrace:
Direct leak of 16 byte(s) in 1 object(s) allocated from:
/#0 0x7fee67cb4a57 in __interceptor_calloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:154
/#1 0x58059e33454b in calloc_or_fail /home/guido/repo/openairinterface5g/develop/common/utils/utils.h:74
/#2 0x58059e33454b in alloc_ho_ctx /home/guido/repo/openairinterface5g/develop/openair2/RRC/NR/rrc_gNB_mobility.c:47
/#3 0x58059e339e4d in nr_rrc_trigger_n2_ho /home/guido/repo/openairinterface5g/develop/openair2/RRC/NR/rrc_gNB_mobility.c:556
/#4 0x58059e33ae93 in nr_HO_N2_trigger_telnet /home/guido/repo/openairinterface5g/develop/openair2/RRC/NR/rrc_gNB_mobility.c:611
Root cause: Handover context allocated in N2 handover source gNB trigger path (nr_rrc_trigger_n2_ho)
for any successful N2 handover but not properly freed in all handover completion scenarios.
The UE context release complete handler was missing cleanup for handover context.
Solution: refactor handover context cleanup
- Move nr_rrc_finalize_ho() call to rrc_delete_ue_data() for centralized cleanup
- Remove redundant nr_rrc_finalize_ho() calls from handover failure paths:
* rrc_CU_process_ue_context_release_request() - UE not deleted yet
* invalidate_du_connections() - UE will be deleted later
- Keep nr_rrc_finalize_ho() calls in handover success paths where UE continues operating
- Ensures handover context is cleaned up exactly once when UE is actually deleted
- Prevents potential double-free and use-after-free issues in handover cleanup
This centralizes all UE data cleanup in rrc_delete_ue_data() and ensures
handover context is properly managed throughout the UE lifecycle and cleaned up
when UE delete happens.
NR UE: add UCI (HARQ-ACK/NACK) on PUSCH support at PHY
Add UCI (HARQ-ACK/NACK) on PUSCH support at nrUE PHY, the multiplexing procedure
can be found in TS 38.212 section 6.2.7.
Verified with 3rd-pary gNB for cases when HARQ payload bits length is 1, 2 or 3.
Closes#959 and #967 .
- Add missing ASN_STRUCT_FREE for NR_MeasurementTimingConfiguration in ue_context_setup_request
- Fix 64-byte MTC sequence leak in get_nr_mtc → SEQUENCE_decode_uper
AddressSanitizer backtrace:
Direct leak of 64 byte(s) in 1 object(s) allocated from:
/#0 0x7dcfcb8b4a57 in __interceptor_calloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:154
/#1 0x591fcc59b67d in SEQUENCE_decode_uper /home/guido/repo/openairinterface5g/develop/cmake_targets/ran_build/build/openair2/RRC/LTE/MESSAGES/constr_SEQUENCE_uper.c:37
/#2 0x591fcc57eaa1 in uper_decode /home/guido/repo/openairinterface5g/develop/openair2/RRC/LTE/MESSAGES/uper_decoder.c:83
/#3 0x591fcbdbedeb in get_nr_mtc /home/guido/repo/openairinterface5g/develop/openair2/LAYER2/NR_MAC_gNB/nr_radio_config.c:4216
/#4 0x591fcbd58188 in ue_context_setup_request /home/guido/repo/openairinterface5g/develop/openair2/LAYER2/NR_MAC_gNB/mac_rrc_dl_handler.c:635
/#5 0x591fcbb92568 in nr_initiate_handover /home/guido/repo/openairinterface5g/develop/openair2/RRC/NR/rrc_gNB_mobility.c:218
/#6 0x591fcbb9a37f in nr_rrc_trigger_n2_ho_target /home/guido/repo/openairinterface5g/develop/openair2/RRC/NR/rrc_gNB_mobility.c:526
/#7 0x591fcbaf7608 in rrc_gNB_process_e1_bearer_context_setup_resp /home/guido/repo/openairinterface5g/develop/openair2/RRC/NR/rrc_gNB.c:2640
/#8 0x591fcbafab7b in rrc_gnb_task /home/guido/repo/openairinterface5g/develop/openair2/RRC/NR/rrc_gNB.c:3019
/#9 0x7dcfca294ac2 in start_thread nptl/pthread_create.c:442
Root cause: ue_context_setup_request allocated NR_MeasurementTimingConfiguration via
get_nr_mtc() but never freed it after creating the measurement gap configuration.
The create_measgap_config function only reads from the structure and doesn't take
ownership, so the caller must free it.
- Replace heap allocation with stack allocation for seq_arr_t structures
- Use proper seq_arr_free() with free functions for ASN.1 structures
- Remove unnecessary malloc/free calls for sequence containers
- Improve memory safety and performance with automatic cleanup
Fixes 128-byte memory leak:
Direct leak of 128 byte(s) in 2 object(s) allocated from:
/#0 0x7e7f39ab4a57 in __interceptor_calloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:154
/#1 0x56df8b07312d in SEQUENCE_decode_uper /home/guido/repo/openairinterface5g/develop/cmake_targets/ran_build/build/openair2/RRC/LTE/MESSAGES/constr_SEQUENCE_uper.c:37
/#2 0x56df8b056551 in uper_decode /home/guido/repo/openairinterface5g/develop/cmake_targets/ran_build/build/openair2/RRC/LTE/MESSAGES/uper_decoder.c:83
/#3 0x56df8a896b1b in get_nr_mtc /home/guido/repo/openairinterface5g/develop/openair2/LAYER2/NR_MAC_gNB/nr_radio_config.c:4216
/#4 0x56df8a82feb8 in ue_context_setup_request /home/guido/repo/openairinterface5g/develop/openair2/LAYER2/NR_MAC_gNB/mac_rrc_dl_handler.c:635
/#5 0x56df8a66a298 in nr_initiate_handover /home/guido/repo/openairinterface5g/develop/openair2/RRC/NR/rrc_gNB_mobility.c:218
/#6 0x56df8a6720af in nr_rrc_trigger_n2_ho_target /home/guido/repo/openairinterface5g/develop/openair2/RRC/NR/rrc_gNB_mobility.c:526
/#7 0x56df8a5cf338 in rrc_gNB_process_e1_bearer_context_setup_resp /home/guido/repo/openairinterface5g/develop/openair2/RRC/NR/rrc_gNB.c:2633
/#8 0x56df8a5d28ab in rrc_gnb_task /home/guido/repo/openairinterface5g/develop/openair2/RRC/NR/rrc_gNB.c:3012
/#9 0x7e7f38494ac2 in start_thread nptl/pthread_create.c:442
- Add early check for existing UE context by AMF UE NGAP ID at beginning of rrc_gNB_process_Handover_Request
- Add dedicated function to get UE context by AMF UE NGAP ID: rrc_gNB_get_ue_context_by_amf_ue_ngap_id()
- Send handover failure with appropriate cause if UE context already exists
- Remove redundant ho_context NULL check that could never be true for newly created UE contexts
- Prevents duplicate handover processing and resource leaks
Move UE context creation and storage to after successful PDU encoding
to prevent memory leaks if encoding fails. Also add proper PDU cleanup
when AMF fetch fails and use consistent NULL check style.
This ensures UE context is only stored when the operation is guaranteed
to succeed, improving error handling and memory management.
In the current memory management the caller wasn't responsible for freeing
memory they allocate. The ngap_gNB_encode_pdu function was taking ownership
of PDU contents by calling ASN_STRUCT_FREE_CONTENTS_ONLY, while callers
also expected to manage the same memory. This created unclear ownership semantics and
potential double-free bugs.
- Remove ASN_STRUCT_FREE_CONTENTS_ONLY from ngap_gNB_encode_pdu to prevent double-free
- Remove unnecessary ASN_STRUCT_FREE when encode function returns NULL
- Add proper ASN_STRUCT_FREE cleanup for heap-allocated PDUs in ngap_gNB.c functions
- Add ASN_STRUCT_FREE_CONTENTS_ONLY cleanup for stack-allocated PDUs in NAS and context management functions
- Ensure consistent memory cleanup patterns across all NGAP encoder callers
- Fix potential memory leaks in all ngap_gNB_encode_pdu call sites
This prevents double-free bugs and ensures proper cleanup of ASN.1 structures
in both heap and stack allocation scenarios.
Add check for cu_exists_f1_ue_data() before calling cu_get_f1_ue_data()
to prevent assertion failure when telnet command 'ci fetch_du_by_ue_id'
is used for UEs that have been handed over via N2 (and no longer have
F1 UE data).
This fixes the crash:
Assertion (ret == HASH_TABLE_OK && data != ((void *)0)) failed!
In get_hashtable_data() /oai-ran/openair2/F1AP/f1ap_ids.c:36
element for ue_id 1 not found
The function now returns NULL gracefully when F1 UE data is not available.
Co-authored-by: Guido Casati <hello@guidocasati.com>
- Add proper cleanup of allocated ASN.1 structures in all return paths
- Fix early returns that were leaking NR_HandoverPreparationInformation
- Fix early returns that were leaking NR_RRCReconfiguration
- Add cleanup at end of successful function execution
This prevents memory leaks when processing handover preparation information
during N2 handover procedures.
- Add UE context cleanup before sending handover failure message
- Prevents memory/resource leak when PDU session establishment fails during handover
- UE context was created but never cleaned up on failure path
This fixes a bug where UE contexts would accumulate over time
when handovers failed after context creation.
Since there is no UCI on PUSCH implementation in gNB, it is good to test
UE's implementation with matlab.
This commit allows to test with matlab in two ways:
1. generate OFDM waveform from ulsim and decode it in matlab using
uci_on_pusch_decode.m
2. generate codeword in matlab using uci_on_pusch_encode.m read it in
ulsim and compare the bits. ulsim option -o is used
When the codeword has UCI multiplexed with data, we need to handle UCI scrambling according to 38.211 section 6.3.1.1.
Especially when O_ACK <= 2 there are x and y placeholder bits for UCI.
Get beta offset, alpha scaling and other parameters to calculate rate matching information for UCI on PUSCH,
then use the rate matching info to encode UCI and re-encode PUSCH, call nr_uci_on_pusch to get final multiplexed codeword for scrambling.
NR UE: remove function get_nr_RSRP() and get_nr_rx_total_gain_dB() for cleanup
The function get_nr_RSRP() and get_nr_rx_total_gain_dB() are not used anywhere
in the code, removing for cleanup.
CI: Updates for HO and AW2S pipeline
This MR introduces several CI updates:
- Change center frequency from 3439 MHz (n78) to 4185 MHz (n77) in HO setup to
prevent interference with other lab setups.
- Enable attaching multiple AmariUEs simultaneously in the AW2S pipeline - save
~25s.
- Update RX gain configuration on AmariUE - improve DL throughput.
BWP with no PRACH occasions
This MR includes fixes at gNB and UE in case the current BWP has no PRACH
occasions, i.e. we need to switch to initial BWP.
`def` creates a variable local to the script object, not automatically visible inside helper functions.
This fixes the following exception in Jenkins:
Found unhandled groovy.lang.MissingPropertyException exception:
No such property: OAI_Registry for class: groovy.lang.Binding
These libraries depend on the logging module, so add the right
dependency log_headers. Indirectly, this will fulfill the condition of
T. I consider the prior usage of generate_T or {T_LIB} incorrect,
because basically none of these libraries actually, actively use T, but
rather only the logging module, which pulls in T. The dependency of
log_headers will also take care of generating and including T headers,
which is a dependency of the logging module.
For conf2uedata and related, fulfill the dependency
through conf2uedata_lib (on which the rest depends).
These libraries have no dependencies on UTIL, so it's better to omit it.
However, then the test is missing symbols for the config (which likely,
indirectly came through UTIL -> LOG -> CONFIG_LIB, so add it now onto
the test.
These libraries have an (indirect) dependency on T, either by using the
logging module (which in turn depends on T), or through other includes.
The easiest is to depend on the logging module, which will fulfil also
the T dependency.
It would equally be feasible to use the utils target (which in turn
depends on log_headers), but this would necessitate to compile, and does
not seem to be necessary.
Since E2 agent uses the config library, include it directly. This also
makes the dependency on T obsolete, because
- it is the logging headers that are needed, and
- the T dependency is fulfilled through the log_headers.
It seems that many compilation units include T.h through the config
module (as evidenced when taking out T.h from
config_load_configmodule.h). This is strange, because T.h is only used
in the logging headers. Hence, move it to there, where it is used.
coding_defs.h included defs_common.h, which pulls in many dependencies,
e.g., the logging module, which pulls in T. However, it does not use
anything of this. So remove, and include stdbool.h instead (because bool
is used in coding_defs.h.
nr_polar_defs.h relied on some includes done in coding_defs. Use
includes for pthreads and SIMD to define types that are used in
nr_polar_defs.h.
We don't use JER. This avoids compilation problems, such as:
/usr/bin/ld: openair3/NRPPA/MESSAGES/libasn1_nrppa.a(INTEGER_jer.c.o): in function `INTEGER_decode_jer':
tmp.MtrwVDhQqY/openair3/NRPPA/MESSAGES/INTEGER_jer.c:186:(.text+0x5b8): undefined reference to `jer_decode_primitive
XNAP is asn1c compiled with -no-gen-BER. Correspondingly, no
ber_decoder.h file is created. However, when running cmake followed by
ninja, it notices the absence of this file:
ninja explain: output openair2/XNAP/MESSAGES/ber_decoder.h doesn't exist
which triggers a complete rebuild of XNAP ASN.1. Without this file, the
targets are not marked as dirty.
This constant seems to be an analogon to NUMBER_OF_UE_MAX; replace with
the latter, as it does the same. (NBIoT does not work, anyway)
Fix dependencies of the NB_IoT target so it compiles.
Remove, because
1) it does not compile (the asn1c generated code should be prepend with
LTE_ etc, nobody did that)
2) a shared module makes no sense
3) the configuration is trivial to recreate
Link E2_AGENT libraries directly into nr-softmodem/lte-softmodem instead
of L2/L2_NR/F1AP. Doing that ensures that simulators, e.g.,
nr_dlsim/nr_ulsim do still compile. It also simplifies the code.
Prior to this, compiling nr_ulsim with E2_AGENT, for instance, resulted
in the following errors, fixed in this commit:
FAILED: nr_ulsim
/usr/bin/ld: openair2/E2AP/RAN_FUNCTION/libe2_ran_func_du_cucp_cuup.a(ran_func_rc.c.o): in function `send_aper_ric_ind':
/home/oai/robert/cleanup-t-dependency-cmake/openair2/E2AP/RAN_FUNCTION/O-RAN/ran_func_rc.c:643: (.text+0xee6): undefined reference to `async_event_agent_api'
/usr/bin/ld: /home/oai/robert/cleanup-t-dependency-cmake/openair2/E2AP/RAN_FUNCTION/O-RAN/ran_func_rc.c:643:(.text+0x11ca): undefined reference to `async_event_agent_api'
/usr/bin/ld: /home/oai/robert/cleanup-t-dependency-cmake/openair2/E2AP/RAN_FUNCTION/O-RAN/ran_func_rc.c:643:(.text+0x1485): undefined reference to `async_event_agent_api'
/usr/bin/ld: /home/oai/robert/cleanup-t-dependency-cmake/openair2/E2AP/RAN_FUNCTION/O-RAN/ran_func_rc.c:643:(.text+0x159c): undefined reference to `async_event_agent_api'
/usr/bin/ld: /home/oai/robert/cleanup-t-dependency-cmake/openair2/E2AP/RAN_FUNCTION/O-RAN/ran_func_rc.c:643:(.text+0x16b1): undefined reference to `async_event_agent_api'
[...]
warning: ‘genericPowerPerAntena’ defined but not used [-Wunused-function]
warning: ‘graph.text’ is used uninitialized [-Wuninitialized]
warning: ignoring return value of ‘read’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
Lower the RX gain used by the Amarisoft UE in CI tests to prevent DL signal
saturation. This resolves an issue with low DL throughput observed in CI.
RX/TX signal levels on the Amarisoft UE can be checked with "t spl" command
in lteue; MAX values should not approach 0.
Data and control multiplexing procedure is defined in 38.212 section 6.2.7.
Step 3 (CSI1 and CSI2 mapping) is not implemented, only HARQ-ACK.
PUSCH frequency hopping is not supported.
Use betaOffset and alpha scaling etc. to get rate matching information of UCI on PUSCH (e.g. max bit capacity of encoded UCI and encoded ULSCH)
according to TS 38.212 section 6.3.2.4 and 6.2.7.
38.212 section 5.3.3.1 and 5.3.3.2 describe how to encode 1-bit and 2-bit information.
This is needed when typically HARQ-ACK will be transmitted on PUSCH.
38.212 section 5.4.3 also describes how to do rate matching for channel coding of small block lengths.
- Replace error handling for impossible ID mismatches with DevAssert statements
- If ngap_get_ue_context() succeeds, returned context must have matching NGAP gNB UE IDs by definition
- This catches potential bugs in the lookup function immediately
- Affects: handover_required, handover_notify, handover_cancel, ul_ran_status_transfer
These checks were logically impossible since we looked up the context using
the same IDs we were then checking for mismatch.
- Fixed incorrect log messages that said 'PCI=%lu' when printing nr_cell_id
- Now prints both NR Cell ID and PCI when DU is found
- Provides better debugging information for handover requests
- Add _E1_EQ_CHECK_OPTIONAL_PTR checks for pdcp_config, sdap_config, UP_TL_information, and securityIndication
- Fix bug in eq_pdu_session_to_mod_item where a->UP_TL_information was compared with itself instead of b->UP_TL_information
- Fix eq_security_ind call to properly handle return value with early return pattern
- Improve consistency with existing macro usage patterns in the codebase
- Provide better error reporting for optional pointer field mismatches
Replace result &= pattern with consistent early return pattern:
- Fix mixing of logical (&&) and binary (&) operators
- Use consistent 'if (!eq_()) return false;' pattern throughout
- Fix bug in eq_bearer_context_mod_response where drbModA was compared with itself
- Remove unused 'bool result = true;' variables
- Always return true at the end of equality functions
This makes the code more consistent with the rest of the codebase
and provides better error reporting through the existing _E1_EQ_CHECK macros.
Integration `2025.w39`
* !3582 replace bad DCI by specific message for each case and add checks for bad...
* !3595 Implementing the option to have more than 1 RSRP in CSI report
* !3640 Code cleanup (SRS, config files and more)
* !3654 Extend t300 in multi_ue rfsim testcase
* !3650 NR UE improvements for scheduling ACK/NACK for MSG4
* !3652 In ReconfigurationWithSync, make sure epochTime_r17 present if there is a ntn_Config_r17
* !3653 NR UE: in nr_ue_scheduler.c set LCID_buffer_remain to 0 if RLC indicates not more bytes in buffer
* !3549 Switch to new (internal) registry
* !3513 Improvements to RRC PDU session and DRB handling logic
Closes#995 and #997
See merge request oai/openairinterface5g!3658
Improvements to RRC PDU session and DRB handling logic
This merge request introduces a major simplification and cleanup of the gNB RRC
PDU Sessions and DRBs handling logic. The core goals of this work are to:
- Replace fixed-size PDU Session, DRBs and QoS arrays with dynamic containers
- Simplify and modularize helper functions for session/DRB management
- Prepare for further refactoring of the PDU Session state machine
- Improve code safety and maintainability through better bounds checking
common/utils/threadPool/measurement_display.c:55:14 warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 3 has type ‘long long unsigned int’ [-Wformat=]
- Replace simple counter-based DRB ID assignment with actual DRB ID lookup
- Add nested loop to iterate through DRBs for each PDU session to be release
- Improve logic flow with early continue for non-matching PDU sessions
This ensures DRB release list contains correct DRB IDs that correspond to actual DRB entities
* There is no IE corresponding to PDU sessions failed to release
in the PDU SESSION RESOURCE RELEASE RESPONSE message. This was removed
and the corresponding code was refactored and cleaned up.
* In the Release Command handler, only established PDU Session are set to be
released. The Response message is filled accordingly.
Motivation:
The previous architecture had several issues:
- Duplicate DRB generation logic in generateDRB() and generateDRB_ASN1()
- Embedded SDAP/PDCP configs in drb_t created tight coupling
- No clear separation between RRC internal state and ASN.1 encoding
- Maintenance burden due to duplicated configuration logic
New Architecture:
- drb_t now only stores DRB-specific data (ID, PDU session ID, PDCP config)
- SDAP configuration moved to PDU session level (following PDCP design pattern)
- ASN.1 encoding helpers (nr_rrc_build_*_config_ie()) handle conversion
- Single source of truth for DRB creation in RRC via nr_rrc_add_drb()
Key changes:
- Store nr_sdap_configuration_t per PDU session
- Simplified drb_t structure: removed embedded SDAP/PDCP configs, added pdusession_id
- New helper: nr_rrc_build_sdap_config_ie()
- Updated createDRBlist() to use new helper functions and proper DRB ID lookup
- Refactored trigger_bearer_setup() to use nr_rrc_add_drb() and fill_e1_drb_to_setup()
- Removed generateDRB() and generateDRB_ASN1() functions
- Updated set_bearer_context_pdcp_config() to return config by value
- Added SDAP configuration header file for type definitions
This eliminates code duplication, improves maintainability, and creates
a cleaner separation between RRC state management and ASN.1 encoding.
- Move QoS-related enums and structures from ngap_messages_types.h to 5g_platform_types.h
- Replace ngap_* QoS types with generic qos_* types for better reusability
- Update field names from allocation_retention_priority to arp for consistency
- Update all references across RRC and NGAP modules to use new type names
- Remove duplicate QoS type definitions from NGAP-specific header
This improves code organization by centralizing QoS parameter definitions
in a common platform types header and eliminates NGAP-specific naming
in favor of more generic, reusable type definitions.
The maximum number of QoS flows is 64.
- Replace QOSFLOW_MAX_VALUE with MAX_QOS_FLOWS constant
- Move MAX_QOS_FLOWS definition to common/platform_constants.h
- Remove duplicate QOSFLOW_MAX_VALUE definition from ngap_messages_types.h
This improves maintainability by centralizing the QoS flow limit constant
and eliminates duplicate definitions across different header files.
- Limit scope of get_default_rbconfig function: from asn1_msg.c/.h to rrc_gNB_nsa.c where it's used
- Create new rrc_gNB_asn1.c/h files for ASN.1 utility functions: they can be used in other RRC files
- Add nr_rrc_build_pdcp_config_ie function for building PDCP configuration IEs
- Update get_default_rbconfig to use the new PDCP config builder
- Add rrc_gNB_asn1.c to CMakeLists.txt build configuration
The previous DRB management relied on a fixed-size array (established_drbs[MAX_DRBS_PER_UE])
and manual status tracking using DRB_ACTIVE/INACTIVE flags. This approach was inefficient,
and made assumptions about DRB ID allocation that do not generalize well
to dynamic procedures like bearer modification or removal.
* Replace fixed-size array established_drbs[] with dynamic
seq_arr_t *drbs in gNB_RRC_UE_t
* Refactor get_drb() and added nr_rrc_add_drb() with clean abstractions
using find and seq_arr lib
* Updated all DRB-related logic (e.g., generateDRB,
F1AP/E1AP tunnel config, reestablishment, mobility) to use seq_arr.
* Removed status field and DRB_ACTIVE/INACTIVE logic: list presence implies active
* DRB ID allocation now tracked via seq_arr size : simplifies DRB management and
avoids DRB ID–indexed assumptions: code assumed DRB IDs mapped directly to
array indices: established_drbs[drb_id - 1]. This could break when:
DRB IDs are not sequential, DRBs are removed and re-added, or there are gaps in IDs
The RRC PDU Session struct is converted from a fixed-size array
to a dynamically sized seq_arr. This improves flexibility and
simplifies session management by eliminating arbitrary size limits
and enabling dynamic addition/removal of PDU sessions.
Helper functions and loops have been adapted to use the seq_arr API.
This change is a step toward more robust and maintainable handling
of PDU sessions in the gNB RRC layer.
The "status" state machine remains untouched in this commit and
is refactored in a later commit.
Also:
* add macro to push to seq_arr and return the new element
* move initialization of xid (RRC PDU Session struct) to
find_pduSession (temporary, will be finalized in a later
commit) since with the new seq_arr design the initialization
is no longer possible in the UE context generation (also
does not belong to it, initialize when adding a new PDU Session)
The function was printing a "not found" error message even in the case
the return value was set to "true". Return directly true/false.
This is relevant in PDU Session Release procedures.
- Process all PDU sessions in handover request instead of only the first one
- Add DevAssert for bounds checking on nb_of_pdusessions
- Fix logic error where multiple PDU sessions were ignored in handover scenarios
Previously, the RRC layer was incorrectly allocating stack memory for the ho_required_transfer field and passing it to NGAP, however it was not used. The IE is mandatory but contains only 1 optional IE, therefore is encoded in the NG message with empty content.
Changes:
- Remove unnecessary ho_required_transfer field from pdusession_resource_t definition, the IE is encoded anyway with empty content. If Direct Forwarding Path Availability is needed at any stage in the future it can be added to pdusession_resource_t and filled in RRC.
- Add clarifying comment about empty HandoverRequiredTransfer structure
NR UE: in nr_ue_scheduler.c set LCID_buffer_remain to 0 if RLC indicates not
more bytes in buffer
If the RLC indicates that there is no more data in the buffer, also the
scheduler's LCID_buffer_remain should be set to 0. Else the UE sends BSR
indicating it has data to be transmitted. The gNB would then unnecessarily
schedule UL for this UE, which would not be used, as there is no actual data
to be transmitted.
Extend t300 in multi_ue rfsim testcase
Extend t300 to 1000 to increase the time the gNB has to handle MSG3. Hopefully
this prevents the UEs from timing out after MSG3. Add UE id to timer timeout
LOGs so the UE behavior can be traced through the stack.
Code cleanup (SRS, config files and more)
- Remove deprecated elements from some configuration files (also closes#997)
- Improve SRS code with a better separation between common code and gNB/UE code
- Other minor compilation improvements
Implementing the option to have more than 1 RSRP in CSI report
In collaboration with NI/Emerson.
The standard allows up to 4 RSRP measurements in CSI report (1 full and the other
differential). In current OAI, we just configure 1 RSRP report for the strongest
SSB. This MR allows to configure at gNB more than 1 RSRP report (depending on
config file, number of SSBs and UE capabilities) and makes changes at the UE to
send this report.
replace bad DCI by specific message for each case and add checks for bad...
Replace bad DCI by specific message for each case and add checks for bad
pointers, or sanitize detected warnings. Then fix several issues in DCI
decoding. With this MR, LTE UE has less bad DCI, and each bad DCI has a
reason better diagnosis.
If the RLC indicates that there is no more data in the buffer, also the scheduler's
LCID_buffer_remain should be set to 0. Else the UE sends BSR indicating it has data
to be transmitted. The gNB would then unnecessarily schedule UL for this UE, which
would not be used, as there is no actual data to be transmitted.
Correctly handle unpacking of the first RSRP report and its resource ID before processing additional reports.
Use the initial RSRP value as the reference for differential RSRP calculations in subsequent reports.
N2 handover
This MR introduces full support for N2 handover, covering handover
decision, preparation, execution, and notification between source and
target NG-RAN nodes.
Key features:
1. Handover Decision & Preparation:
- Implement N2 handover decision based on UE measurement reports.
- Generate the Handover Preparation Information message, including
RRCReconfiguration.
- Send Handover Required message from the source NG-RAN to the AMF.
2. Handover Execution:
- Decode and handle the Handover Request on the target NG-RAN.
- Process the Handover Command on the source gNB, triggering
RRCReconfiguration.
- Initiate Handover Notify after successful completion.
3 NGAP & RRC Enhancements:
- Implement NGAP encoding/decoding functions for Handover Required,
Handover Request, Handover Command, Handover Failure, and Handover
Notify (3GPP TS 38.413).
- Adds NG-RAN Status Transfer support (UL/DL) for PDCP COUNT
preservation during mobility:
- support for NGAP Uplink and Downlink RAN Status Transfer messages
(TS 38.413 §9.2.3.13-14) to enable proper PDCP COUNT value
transfer during handover or recovery: NGAP encoding/decoding for
RAN Status Transfer, PDCP helpers to extract and apply COUNT (HFN
+ SN) per DRB. This aligns with TS 38.300 §9.2.3.2.1 and TS 23.502
§4.9.1.3.3, ensuring PDCP status preservation in AM.
4. Testing:
- Introduce a Telnet command to manually trigger N2 handover using UE
ID and neighbor PCI.
- Add configuration file for testing N2 handover with a target gNB.
CI: build images on Jetson (armv8)
Add a new build pipeline for NVIDIA Jetson (armv8). Images have tag
prefix armv8_ to distinguish from gracehopper-built images prefixed arm_
(should have maybe been better with armv9_?)
This commit completes the NGAP Mobility Management procedure for N2 handover.
Upon failure on source gNB the Handover Cancel message is sent to the AMF which
in return responds with an ack.
Upon reception of NG RAN Status at the target CU-CP, send PDCP Status
via E1 Bearer Context Modification to the target CU-UP and update PDCP Count
upon reception of the message.
For the sake of simplicity, re-used and extended legacy e1_send_bearer_updates.
Further refactoring is not addressed in this commit.
Once fetched the PDCP Status from the PDCP entity over E1, the CU-CP triggers
the NG RAN Status Transfer procedure to transfer the PDCP Status to the target
CU.
This commit is also introducing the RRC callback.
* Check presence of PDCP Status Requested in Bearer Context Modification Request
* Fetch PDCP Status from PDCP entity and fill in the Bearer Context Modification Response
The E1 Bearer Context Modification Request shall send a PDCP Status Request IE
during handover, e.g. the HO context is set to source, and it is not target, i.e.
only in N2 not in F1.
The current function "e1_send_bearer_updates" used to fill the E1 Request has been
refactored only for the sake of this commit and to avoid duplicated and redundant code.
The function itself deeper analysis and eventually a refactoring that will not be addressed
in this commit.
* Introduced nr_pdcp_count_update() to apply COUNT values to the PDCP entity:
- Computes tx_next, rx_next, and rx_deliv from HFN+SN
- Handles both 12-bit and 18-bit SN modes with dynamic bitmask
* Introduced nr_pdcp_get_drb_count_values() to extract PDCP COUNT values from entity:
- Used for building UL RAN Status Transfer on source CU side
According to 4.9.1.3.3 of 3GPP TS 23.502:
> 2a. - 2c. The S-RAN sends the Uplink RAN Status Transfer message to the S-AMF,
> as specified in TS 36.300 [46] and TS 38.300 [9]. The S-RAN may omit sending
> this message if none of the radio bearers of the UE shall be treated with PDCP status preservation.
TS 38.300 says:
> For DRBs not configured with DAPS, the source gNB sends the SN STATUS TRANSFER message to the target
> gNB to convey the uplink PDCP SN receiver status and the downlink PDCP SN transmitter status of DRBs for
> which PDCP status preservation applies (i.e. for RLC AM). The uplink PDCP SN receiver status includes at
> least the PDCP SN of the first missing UL PDCP SDU and may include a bit map of the receive status of the out
> of sequence UL PDCP SDUs that the UE needs to retransmit in the target cell, if any. The downlink PDCP SN
> transmitter status indicates the next PDCP SN that the target gNB shall assign to new PDCP SDUs, not having a
> PDCP SN yet.
i.e., for DRBs for which PDCP status preservation applies (i.e. for RLC AM), which is is our case.
This commit introduces full support for NG-RAN Status Transfer message handling
(TS 38.413 §9.2.3.13-14) in CU. It enables correct state transfer of PDCP COUNT
values (SN + HFN) during mobility or recovery scenarios.
Summary of changes - NGAP:
* Added encoding/decoding support for UL/DL RAN Status Transfer message
* Defined structures for: ngap_drb_count_value_t, ngap_drb_status_t,
ngap_ran_status_container_t, ngap_ran_status_transfer_t
The pipeline is using the already existing conf files
for the source/target gNB CUs/DUs.
For the sake of simplicity, neighbour-config.conf has
been rewritten and simplified in this commit, then
adopted in this pipeline. The file was not used before.
* the command gets in input the neighbour PCI and the UE ID
* the telnet ci function to retrieve the UE context was extended in the process
* add function to trigger handover on the same gNB for testing purposes
Co-authored-by: batuhan duyuler <batuhan.duyuler@firecell.io>
* trigger upon reception of MasterKeyUpdate
* derive NH, store NH NCC and valid NH key in RRC
* masterKeyUpdate: derive enc/int keys after master key update
and set PDCP security for SRB1
* call nr_rrc_process_reconfiguration_v1530 before nr_rrc_ue_process_RadioBearerConfig
and move dedicatedNAS_MessageList processing at the end of the flow. The sequence
shall be (1) keys/security update (2) radioBearerConfig processing, with PDCP entity
creation, PDCP reestablishment, SDAP entity creation (3) NAS PDUs processing, which
triggers PDU Session Establishment Accept, which sets up the TUN interface.
SDAP entity is a pre-requisite, therefore the radioBearerConfig has to be processed
(in nr_rrc_ue_process_RadioBearerConfig, add_drb) early enough, or it may cause a
race condition in SDAP.
* add trigger function to (1) add the callbacks and (2) initiate
handover on the target NG-RAN
* add handover failure callback on target NG-RAN: the Handover
Failure is a procedure that belongs to the target NG-RAN and
it is different from the Handover Cancel procedure
Co-authored-by: batuhan duyuler <batuhan.duyuler@firecell.io>
This commit introduces the NG Mobility Management Procedure known as
Handover Notification. The outbound message is sent by the target NG-RAN
and is known as Handover Notify. The procedure is used to indicate to
the AMF that the UE has arrived to the target cell and the NG-based
handover has been successfully completed
* after RRCReconfiguration complete, in the N2 callback for HO success
* add NGAP encoder for the message
* RRC callback to trigger Handover Notify message
Co-authored-by: batuhan duyuler <batuhan.duyuler@firecell.io>
* add NG Handover Command message decoder
* process in RRC: encode RRCReconfiguration message
from the received HandoverCommandMessage
* trigger RRCReconfiguration for handover
Co-authored-by: batuhan duyuler <batuhan.duyuler@firecell.io>
* generate Handover Command for the source NG-RAN
to be added to the target to source transparent
container of the Handover Acknowledge message
* add Handover Acknowledge callback for N2
* send NG Handover Acknowledge to AMF
Co-authored-by: batuhan duyuler <batuhan.duyuler@firecell.io>
This commit completes the NG Mobility Management Procedure known as
Handover Resource Allocation. The outbound message is sent by the
target NG-RAN and is known as Handover Request Acknowledge.
Major changes:
* add RRC callback to trigger the generation of NG Handover
Request Acknowledge on the target NG-RAN
* add NG Handover Request Acknowledge encoder
Co-authored-by: batuhan duyuler <batuhan.duyuler@firecell.io>
This commit introduces the NG Mobility Management Procedure known as
Handover Resource Allocation. The inbound message is sent by the AMF
and is known as Handover Request.
Major changes:
(0) Add Handover Resource Allocation initiating message decoding
* add case for NGAP initiating message and unsuccessful message decoding
(1) handle Handover Request on the target NG-RAN
(2) decode NG Handover Request message
(3) process payload, e.g. create UE context,
store IDs, set UP security and trigger bearer setup
Co-authored-by: batuhan duyuler <batuhan.duyuler@firecell.io>
This message is sent from the Target NG-RAN to the AMF.
The commit introduces:
* NGAP encoding function
* N2 callback for the target gNB
* handle the failure in RRC, inform NGAP
* send NGAP message to AMF via SCTP
Note: UE context in NGAP is fetched from the amf_ue_ngap_id
Co-authored-by: batuhan duyuler <batuhan.duyuler@firecell.io>
(1) add N2 ho decision based on measurements
(2) add trigger for N2 HO on source CU
(3) generate NG Handover Preparation Information message,
including RRCReconfiguration, to be passed to the
NG Handover Required message
(4) call RRC callback for Handover Required message
Co-authored-by: batuhan duyuler <batuhan.duyuler@firecell.io>
This commit introduces the NG Mobility Management Procedure known as
Handover Preparation. The outbound message is sent by the source NG-RAN
and is known as Handover Required.
* introduce NGAP library for Mobility Management
* introduce NGAP IEs encoder functions for Handover Required and relevant common IEs
* handle RRC trigger in NGAP and Send NGAP Handover Required to the AMF
Co-authored-by: batuhan duyuler <batuhan.duyuler@firecell.io>
During the N2 HO review has been found that the HO context
was not allocated at trigger time but later in the flow. This
might lead to issues in some scenarios (e.g. in N2 HO)
and it was fixed in this commit.
Introduce a new timer for the use case where a UE should not be
scheduled anymore after a certain time. This is the case, for instance,
during handover, where the "source DU" forwards the RRCReconfiguration
and should stop scheduling this UE after some time.
Originally, transm_interrupt was introduced in 5c6d90aaff ("Use
NR_timer_t for UE transmission interrupt, e.g., RRC processing") to stop
scheduling a UE.
Commit 004403c84d ("Implement F1 UE Ctxt Modif Transmission Action
Indicator") reused this timer in an attempt to save code with an
"interrupt follow action".
In commit 89ebbb4192 ("Do not trigger ul failure in measgap scheduling
and standardize the verification if MAC is active in other scheduling
functions"), the transm_interrupt timer is used to not schedule a UE
through function nr_mac_ue_is_active(). This led to the UE not being
forwarded the RRCReconfiguration, effectively breaking handover, as the
message never reaches the UE. By using a new timer, the intended
functionality is restored.
Fixes: 89ebbb4192 ("Do not trigger ul failure in measgap scheduling
and standardize the verification if MAC is active in other
scheduling functions")
Remove this flag, as it is not used as of this commit, and introduces
confusion (see next commit: we reused the trans_interrupt timer for
the transmission action indicator stop action, where the UE should stay
active, while it is *not* when transm_interrupt is active).
For clarity, rename to native_armv9 for clarity. The check inside Python
checked for native_arm, and if we introduce native_armv8 (for jetson),
it would also match that.
Add nr-cuup to run_locally.sh
E1 deploy wasn't enable in the run_locally.sh script to run the CI on a local
machine. This MR is adding it. It was validated locally.
Fix UE DCI monitoring after RRC setup
After the UE is configured with pdcch-Config, it continues to monitor
fallback search spaces in pdcch-ConfigCommon for DCI with C-RNTI.
The rational is that after sending RRC Setup the network won't know if
the UE has received and successfully applied it. Hence the network would
still continue to use the fallback DCI till it receives RRC setup
complete.
Closes#954
Fix memory allocation issue in KPM RAN function sd parameter handling
This fixes a segmentation fault in the gNB when a KPM xApp sends the sd
parameter in the subscription message.
The segmentation fault seems to occur because *sd is uninitialized when
malloc(**sd) is called. This causes a double dereference of an uninitialized
pointer - **sd reads a random memory value which becomes the size parameter
for malloc(), leading to unpredictable memory allocation and segfaults.
This fix allocates the size using malloc(sizeof(uint32_t)) instead of
dereferencing the uninitialized pointer.
After the UE is configured with pdcch-Config, it continues to monitor
fallback search spaces in pdcch-ConfigCommon for DCI with C-RNTI.
The rational is that after sending RRC Setup the network won't know if
the UE has received and successfully applied it. Hence the network would
still continue to use the fallback DCI till it receives RRC setup
complete.
Fix an issue in which the unpacking is erroneously deemed unsuccessful even though it succeed in pulling all the bytes, this was due to not properly handling the return value of pull16 which is either 0 or 2, not 0 or 1.
Check the results of push and pull operation with correct boolean operator.
During the review of the N2 HO MR it has been found that the wrong type
plmn_identity_t (S1AP) was used in RRC. Now updated to the platform type plmn_id_t.
The malloced struct is initialized to garbage and when
the IE is absent, the output "PDCP reestablishment"
member (allocated in the stack) is set to a random value.
Integration: `2025.w37`
* !3514 NR UE: add support for PDSCH rate matching with NZP CSI-RS
* !3630 feat(ldpc_aal): Do not try EAL init if FHI 7.2 is enabled
* !3634 reset MSG3 C-RNTI flag in case of failure
* !3566 fix 600 cppcheck notifications
* !3633 Fix PLMN print in select_amf
* !3631 Revert "Removed TRP-scheme byte from UL BF PDU to Interop with Aerial 25-1 (FAPI 10.02)"
* !3622 Populate sampled_ue_antennas
* !3601 gNB: adaptive DL/UL MCS based on reported SSB-SINR and measured PUSCH SNR
* !3637 fix bug in computing number of LCG IDs with data at UE
* !3635 Fixes and updates for UL scheduling, notably DSUUU
* !3607 Reworking BWP configuration
* !3531 Refactor measConfig
* !3612 CI: Creation of F1 Handover pipeline
* !3611 CI: Generalize PhySim tests, run PhySims on Gracehopper
Closes#985 and #975
See merge request oai/openairinterface5g!3636
CI: Generalize PhySim tests, run PhySims on Gracehopper
This changeset generalizes/harmonizes the CI infrastructure for physim
testing, and adds a new pipeline for physim tests on Gracehopper
machines.
Specifically:
- Refactor the existing CI code for running and analyzing physical
simulators. The existing code assumed those tests are deployed using
OpenShift. Instead, OpenShift/Helm-specificities (e.g., running a
"release") have been removed, and instead of hardcoding the deployment
of the physical simulators using a script for Helm, the function takes
any script that can deploy using Helm/docker/from source. The overall
appearance is the same.
- Add a new pipeline RAN-PhySim-GraceHopper-5G that executes physical
simulators on gracehopper. Reporting is done in the same way as for
existing physical simulators (e.g., like in the RAN-PhySim-Cluster-5G
pipeline), but deployed in docker instead of helm.
-> some tests don't work reliably on ARM yet and are skipped
- the RAN-gNB-N300-Timing-Phytest-LDPC pipeline has been reworked to use
the same code for testing T2 offload, with ctest, and the same
reporting.
- the CUDA LDPC test XML has been removed, as these tests don't work
reliably.
- add a new macro add_timed_physim_test() that allows to define
thresholds to be checked, so that ctest will check for them. see the
documentation for more information
CI: Creation of F1 Handover pipeline
In this MR we are modifying/adding all the required files (.xml, .conf,
.yml) in order to create a pipeline on Jenkins that allows us to test
OTA F1 handover.
Remove the runtime, which is not interesting, and add instead
- test name and if the test failed
- the threshold checks, if any, and
- possible additional information about test failures.
Prior to this change, each test would have, as label, it's description.
This leads to many labels, which are normally reserved for grouping
tests. Move the description into a custom property instead.
Since we rely on the JSON output for the generation of HTML reports, we
need to also extract the description from the generated JSON. However,
custom properties are only logged starting from cmake 3.30. For
back-wards compatibility, write an additional, separate environment
variable TEST_DESCRIPTION from which the description can be read as a
fallback.
For the add_timed_physim_test(), this has been already done in a parent
commit.
The unit tests have been imported with this command:
xmlstarlet sel -t
-m '//testCaseList/testCase[class="Run_Physim"]' \
-v "concat('add_timed_physim_test(physim.5g-offload.',physim_test,'.testX.Y \"',desc,'\" ',physim_test,' ',physim_run_args,')')" \
-n t2_offload_enc_nr_dlsim.xml t2_offload_dec_nr_ulsim.xml >> ../../openair1/SIMULATION/tests/CMakeLists.txt
The next commit will further cleanup this output. I commit it like this
for verification purposes.
Add two new macros that allow to register physim tests for ctest,
including timing thresholds that should be fulfilled.
First, add_timed_physim_test() registers a new test using a helper
script RunTimedTest.cmake. This is because after test execution, we need
to analyze logs, and the recommended way to do multiple steps in one
test is via a helper cmake script:
https://cmake.org/pipermail/cmake-developers/2016-February/027816.html
Second, check_physim_threshold() adds new thresholds. It takes a text to
be parsed, and a condition (e.g., "< 20") to check for the number
following the threshold (which is assumed to be present right after the
threshold). It uses a test property to count the total number of checks
(limiting them to 10), and sets environment variables for the script. I
initially planned to use a test property for checks, but those are only
valid in the same directory, and RunTimedTest.cmake seems to be assumed
by cmake to be "elsewhere", hence I needed to resort to environment
variables.
RunTimedTest.cmake is called through cmake with the test parameters and
checks. It re-constructs a list of checks [1], runs the test, and pipes
the log into a separate script that is passed all checks (see below).
Afterwards, it verifies that both the test and script passed.
A script analyze-timing.sh builds an awk script from the checks passed.
The script analyzes each line of the test output for the threshold, and
compares against the threshold. analyze-timing.sh returns success if all
checks passed.
[1] I did not manage to pass a "list" of checks in a single environment
variable through the check_physim_threshold(), which would be simpler.
Change signature of the macro to take the full test name, a separate
description (previously called a label?), and the executable and test
invocation. The overall signature becomes easier.
The rational for the full test name is that a later commit will
introduce the possibility to define physim tests that are checked for
specific times, in which case we need to reuse the test name. Thus,
using the full name from the beginning leads to more clarity, even
though they are a bit longer.
Add an additional safety check that the given simulator is actually a
target defined within the project (in other words, it actually exists).
Update the documentation correspondingly.
Most (but not all) physical simulators are defined under
openair1/SIMULATION/. Defining physical simulators below there seems to
be the more "obvious" directory anyway, as the physical simulators are
openair1/SIMULATION/tests
Phy(L1) Sim tests => PhySim (tests)
Refactor measConfig
- Refactor and minor improvements in get_MeasConfig function;
- Add support for band in neighbourConfiguration (It is currently
possible to handover cells with different frequencies, as long as they
are in the same band, but this MR allows the handover to also be done
between cells in different bands).
Reworking BWP configuration
This MR reworks the configuration via fail of additional BWPs. Moreover, it
allows for a single BWP to be configured for a given UE at a given time (BWP
switch possible only via reconfiguration). It also reworks PTRS configuration
for consistency with the BWP one.
Fixes and updates for UL scheduling, notably DSUUU
Fix a number of problems that stem from !3521, notably regarding Msg3
scheduling, retransmissions in "UL-heavy" TDD scenarios, and BSR
handling. Modify a CI test to run a UL-heavy TDD scenario, and add
documentation for UL-heavy TDD scenarios.
The parameter is either set to 10 (the default, so not necessary), or to
0 forcing the gNB to schedule the UE all the time, which is only
necessary in specific scenario, and here simply wrong.
In high throughput UL scenarios, at least with our configuration, the UE
only sends Short BSR. The maximum is 300000 bytes, which is completely
"scheduled away" after a couple of UL grants. Increase the periodic BSR
to 5ms to get more BSR, which results in higher UL throughput.
On BSR reception, reset sched_ul_bytes. This change means that we assume
that no data is "in flight" for this UE at time of BSR reception, or,
put differently, that we overestimate the buffer size at UE (in the
worst case).
To illustrate this, consider the following traces before/after this
change.
Before this change: Upon BSR reception, the estimated BSR of the UE is
reset, but the gNB still accounts for data "in flight". It is visible
that the calculated buffer size (estimated - scheduled) quickly goes to
zero, and we don't use all resources, despite the buffer still being
full. The maximum application throughput in this run was ~220Mbps.
[NR_MAC] SHORT BSR at 773.19, est buf 300000
[NR_MAC] ULSCH/PUSCH: 774. 6 RNTI af8e UL sched 774. 9 PRB start 0:162 TDA 2 TBS 32797 est 300000 sched 152704 est BSR 147296 TPC 1
[NR_MAC] ULSCH/PUSCH: 774. 6 RNTI af8e UL sched 774.11 PRB start 0:162 TDA 4 TBS 7172 est 300000 sched 159876 est BSR 140124 TPC 1
[NR_MAC] ULSCH/PUSCH: 774.10 RNTI af8e UL sched 774.12 PRB start 0:162 TDA 0 TBS 32797 est 292845 sched 185501 est BSR 107344 TPC 1
[NR_MAC] ULSCH/PUSCH: 774.10 RNTI af8e UL sched 774.13 PRB start 0:162 TDA 2 TBS 32797 est 292845 sched 218298 est BSR 74547 TPC 1
[NR_MAC] ULSCH/PUSCH: 774.11 RNTI af8e UL sched 774.14 PRB start 0:162 TDA 2 TBS 32797 est 260117 sched 218298 est BSR 41819 TPC 1
[NR_MAC] ULSCH/PUSCH: 774.11 RNTI af8e UL sched 774.16 PRB start 0:162 TDA 4 TBS 7172 est 260117 sched 225470 est BSR 34647 TPC 1
[NR_MAC] ULSCH/PUSCH: 774.15 RNTI af8e UL sched 774.17 PRB start 0: 35 TDA 0 TBS 7172 est 220236 sched 185501 est BSR 34735 TPC 1
[NR_MAC] ULSCH/PUSCH: 774.15 RNTI af8e UL sched 774.18 PRB start 0:162 TDA 2 TBS 32797 est 220236 sched 218298 est BSR 1938 TPC 1
[NR_MAC] ULSCH/PUSCH: 774.16 RNTI af8e UL sched 774.19 PRB start 0: 10 TDA 2 TBS 2017 est 187508 sched 187518 est BSR -10 TPC 1
[NR_MAC] SHORT BSR at 774. 9, est buf 300000
[NR_MAC] ULSCH/PUSCH: 775. 0 RNTI af8e UL sched 775. 2 PRB start 0:162 TDA 0 TBS 32797 est 260117 sched 147549 est BSR 112568 TPC 1
[NR_MAC] ULSCH/PUSCH: 775. 0 RNTI af8e UL sched 775. 3 PRB start 0:162 TDA 2 TBS 32797 est 260117 sched 180346 est BSR 79771 TPC 1
[NR_MAC] ULSCH/PUSCH: 775. 1 RNTI af8e UL sched 775. 4 PRB start 0:162 TDA 2 TBS 32797 est 227389 sched 180346 est BSR 47043 TPC 1
[NR_MAC] ULSCH/PUSCH: 775. 1 RNTI af8e UL sched 775. 6 PRB start 0:162 TDA 4 TBS 7172 est 227389 sched 187518 est BSR 39871 TPC 1
[NR_MAC] ULSCH/PUSCH: 775. 5 RNTI af8e UL sched 775. 7 PRB start 0:162 TDA 0 TBS 32797 est 180353 sched 173174 est BSR 7179 TPC 1
[NR_MAC] ULSCH/PUSCH: 775. 5 RNTI af8e UL sched 775. 8 PRB start 0: 36 TDA 2 TBS 7298 est 180353 sched 180472 est BSR -119 TPC 1
After this change: The gNB resets the number of bytes "in flight"
(sched). Thus, the calculated buffer is larger, and does not "run out"
before a new BSR arrives (which still indicates the maximum). The UE is
thus allocated all resources, but we might overestimate some resources.
The maximum application throughput in this run was ~300Mbps, limited by
MCS and not by estimated buffer size as in the previous case.
[NR_MAC] SHORT BSR at 43. 3, est buf 300000
[NR_MAC] ULSCH/PUSCH: 43.15 RNTI d3ea UL sched 43.17 PRB start 0:162 TDA 0 TBS 36897 est 263180 sched 36897 est BSR 226283 TPC 1
[NR_MAC] ULSCH/PUSCH: 43.15 RNTI d3ea UL sched 43.18 PRB start 0:162 TDA 2 TBS 36897 est 263180 sched 73794 est BSR 189386 TPC 1
[NR_MAC] ULSCH/PUSCH: 43.16 RNTI d3ea UL sched 43.19 PRB start 12:150 TDA 2 TBS 33822 est 263180 sched 107616 est BSR 155564 TPC 1
[NR_MAC] ULSCH/PUSCH: 43.16 RNTI d3ea UL sched 44. 1 PRB start 0:162 TDA 4 TBS 7941 est 263180 sched 115557 est BSR 147623 TPC 1
[NR_MAC] ULSCH/PUSCH: 44. 1 RNTI d3ea UL sched 44. 3 PRB start 0:162 TDA 0 TBS 36897 est 173698 sched 25881 est BSR 147817 TPC 1
[NR_MAC] ULSCH/PUSCH: 44. 1 RNTI d3ea UL sched 44. 4 PRB start 0:162 TDA 2 TBS 36897 est 173698 sched 62778 est BSR 110920 TPC 1
[NR_MAC] ULSCH/PUSCH: 44. 1 RNTI d3ea UL sched 44. 6 PRB start 0:162 TDA 4 TBS 7941 est 173698 sched 70719 est BSR 102979 TPC 1
[NR_MAC] SHORT BSR at 43.13, est buf 300000
[NR_MAC] ULSCH/PUSCH: 44. 5 RNTI d3ea UL sched 44. 7 PRB start 0:162 TDA 0 TBS 36897 est 292079 sched 36897 est BSR 255182 TPC 1
[NR_MAC] ULSCH/PUSCH: 44. 5 RNTI d3ea UL sched 44. 8 PRB start 0:162 TDA 2 TBS 36897 est 292079 sched 73794 est BSR 218285 TPC 1
[NR_MAC] ULSCH/PUSCH: 44. 6 RNTI d3ea UL sched 44. 9 PRB start 0:162 TDA 2 TBS 36897 est 292079 sched 110691 est BSR 181388 TPC 1
[NR_MAC] ULSCH/PUSCH: 44. 6 RNTI d3ea UL sched 44.11 PRB start 0:162 TDA 4 TBS 7941 est 292079 sched 118632 est BSR 173447 TPC 1
[NR_MAC] ULSCH/PUSCH: 44.10 RNTI d3ea UL sched 44.12 PRB start 0:162 TDA 0 TBS 36897 est 213587 sched 39972 est BSR 173615 TPC 1
[NR_MAC] ULSCH/PUSCH: 44.10 RNTI d3ea UL sched 44.13 PRB start 0:162 TDA 2 TBS 36897 est 213587 sched 76869 est BSR 136718 TPC 1
gNB: adaptive DL/UL MCS based on reported SSB-SINR and measured PUSCH SNR
Currently this is used esp. if the number of rounds is limited to 1
(e.g. disable_harq).
Revert "Removed TRP-scheme byte from UL BF PDU to Interop with Aerial 25-1 (FAPI 10.02)"
This commit broke compatibility with Aerial when compiled with
-DSCF_FAPI_10_04_SRS=ON. It was decided that this should become the
default.
Modify documentation, and use a dedicated image name to make it clear in
the CI that it has SRS.
A future commit will enable to deploy physical simulators via docker.
Hence:
- Move the script to run out of deploy_oc_physim(), to make it more
generic (later commits will introduce other scripts)
- pass the working directory (the function will be moved into
cls_oaicitest, as it fits neither cls_containerize nor cls_cluster
when deploying the tests from source)
- not using ci-scripts: don't hardcode a specific path, just use the
working directory
- avoid helm-specific pods summary, and put it into the general "physim
logs"
- remove helm-specific "release", and use a generic name for results
- always log pod logs and status to debug, even if deployment was not
successful or tests did not finish.
Instead of making the function a class member, make it an instance
member because (1) it is more aligned with other functions, notably,
run(), and (2) especially for RemoteCmd() it can be faster, as
successive exec_script() calls do not require a new SSH connection.
This commit broke compatibility with Aerial when compiled with -DSCF_FAPI_10_04_SRS=ON. It was decided that this should become the default.
This reverts commit 8beb382277.
Instead of only saving this information in the first transmission, also
store it on each retransmission. This should ensure that if some
information changes, we always relate to the last transmission. For
instance, power control information might have changed, and should be
considered in subsequent rounds, if necessary. It also simplifies code.
Fixes: 6294ce715e ("Reorder pf_ul to process retransmission")
In at least the case of mu=1, min_rxtxtime=2 and DDDSU with no UL
symbols (for ULSCH) in the mixed slot, the current state of code does
not allow a UE to attach. This is because at mu=1, Msg3 is k2+delta,
where k2=min_rxtxtime and delta(mu)=3.
Prior, this special case was handled because we had a dedicated Msg3
TDA, which in most cases is not necessary (because the mixed slot
allocates the DCI, and the following mixed slot has the UL grant). Add
code that tries to ensure that we only add the Msg3 TDA in cases when we
need it.
Fixes: 961a646dc7 ("Remove dedicated Msg3 TDA")
reset MSG3 C-RNTI flag in case of failure
If MSG3 with C-RNTI fails, the UE should come back with a
re-establishment (after a given number of RA failures in general). In
that case, the OAI UE wouldn't reset the MSG3 with C-RNTI flag leading
to re-establishment failure.
feat(ldpc_aal): Do not try EAL init if FHI 7.2 is enabled
When FHI 7.2 is enabled, the EAL initialization is done by the FHI and
the attempt to init EAL by ldpc_aal will fail. In that case, it is not
necessary neither to provide a DPDK core list for BBDEV.
This MR offers to skip EAL init in ldpc_aal when FHI 7.2 is enabled in
order to avoid error messages in the log and to allow dropping the
useless DPDK cores argument in that case.
Also add some fixes to the LDPC offload documentation.
NR UE: add support for PDSCH rate matching with NZP CSI-RS
Currently only ZP CSI-RS is considered in function
configure_ratematching_csi, add support for NZP CSI-RS.
Closes#975
If the DCI in PDCCH is not correctly received, no PDSCH would be decoded but counted as no error.
Also if the DCI was not correctly received, a TBS of 0 would be used in some computations and memory allocations.
Fix these not counting if there is no PDSCH decoding, and by using the known TBS instead of the one received from the DCI.
Previously, the TDA reuse condition was wrong: for multiple TDAs with
different k2, the symbol allocation might be the same, in which the
previous logic was using the wrong TDA. Fix the condition, and insert an
assert to ensure the allocated TDA is correct.
Integration: `2025.w36`
* !3613 Speedup complex rotate for aarch64
* !3614 Ldpc encoder zc384 optimization
* !3625 gNB scheduler small fixes
* !3629 Fix for gNB max feedback time parameter
* !3619 Fix RA 2-Step MgsB Ack at UE
* !3626 Upgrade CI to Aerial 25-2
See merge request oai/openairinterface5g!3627
When FHI 7.2 is enabled, the EAL initialization is done by the FHI and
the attempt to init EAL by ldpc_aal will fail.
In that case, it is not necessary neither to provide a DPDK core list
for BBDEV.
This commit offers to skip EAL initialization if it is already initialized
in order to allow dropping the useless DPDK cores argument in that case.
The change relies on `rte_dev_probe` to detect if EAL was already
initialized.
Fix for gNB max feedback time parameter
This bug is causing assertions like the following
Assertion (curr_pucch->active == 0) failed!
In nr_csi_meas_reporting() /oai-ran/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c:282
CSI structure is scheduled in advance. It should be free!
because the PUCCH structure would be smaller than it should be causing
overlapping.
gNB scheduler small fixes
A couple of fixes in gNB scheduling function. Removing a superfluous input from
CCE function and adding a missing call to reset beam allocation.
Ldpc encoder zc384 optimization
This is a modification for the ldpc encoder which improves performance for
high-throughput cases. It contains a newly-generated file for innermost part of
the parity bit generation which, for AVX512, uses the mm512_permutex2var_epi8
instruction and for 128-bit (aarch64) the mm_alignr_epi8 (vextq_s8) in the
computation corresponding to each non-zero bit of the H matrix. This allows for
removing a very large memcpy and reduces the memory demand for the parity matrix
computation. For the moment this is limited to largest case in BG1, namely
Zc=384. This is the only format used when the number of segments after codeblock
segmentation is large (>8). This improves the timing required for ldpc parity
bits generation by more than a factor 2 with AVX512. This significantly reduces
the total time to generate the DLSCH/PDSCH.
See the merge request description for numbers.
Speedup complex rotate for aarch64
This is a simple optimization for aarch64 for the "rotate_cpx_vector" used for
the phase_rotation in 5G NR. It provides a speedup of around 1.5 on high-end
aarch64 targets compared to the SIMDe translated version. It is implemented with
native NEON intrinsics and was largely inspired by suggestions from ChatGPT 5 :-)
newly-generated files for innermost part of the parity bit
generation which, for AVX512, uses the mm512_permutex2var_epi8
instruction and for 128-bit (aarch64) the mm_alignr_epi8 (vextq_s8) in
the computation corresponding to each non-zero bit of the H matrix.
It is generated with ldpctest -n0 -g1. the changes for this are in a
future MR. I did these changes to compare with the GPU version
(ldpc_encoder_cuda), so that the CPU version is as fast as possible. The
generator will come when we merge the GPU encoder/decoder which also has
a generator for the CUDA version. it was difficult to extract the
changes in ldpctest/ldpc_encoder.c so I just took the generated file.
This allows for removing a very large memcpy and reduces the memory
demand for the parity matrix computation. For the moment this is limited
to largest case in BG1, namely Zc=384. This is the only format used when
the number of segments after codeblock segmentation is large (>8). This
improves the timing required for ldpc parity bits generation by more
than a factor 2 with AVX512. This significantly reduces the total time
to generate the DLSCH/PDSCH
Redirect to files and manual analysis as done in this Dockerfile is not
necessary since we just output all relevant build files to stdout.
Simplify to do the same here.
See: 35361db76b ("build_oai: don't redirect compilations to a file")
Fix OAIUE-OTA pipeline and increase tested traffic
I tried to "fix" the OAIUE pipeline in !3610 (merged) for making it more reliable, but inadvertently introduced many ULSCH DTX for UL traffic. Fix this, and increase DL traffic.
See merge request oai/openairinterface5g!3621
Integration: `2025.w35`
* !3604 Consider PDSCH EPRE to DMRS EPRE in NR UE
* !3606 Fix SRS TLV unpack
* !3602 Update RFsim CN
* !3516 [FHI72 M-plane] CM improvements and PM implementation
* !3538 add a new graphical T tracer to see gNB MAC scheduling decisions
* !3425 RFSim test for 10 UEs/process
Closes#950
See merge request oai/openairinterface5g!3610
RFSim test for 10 UEs/process
This MR adds a testcase and changes required to run 10 UEs in a single
process with RFSim
- Added deregistration for all connected UEs
- Refactored MAC/RRC instance handling
- made map_current_symbol thread safe
- made opeanir0_cfg thread safe and local
- Added 10UE/process testcase
Some code in T tracers is used by both LTE and NR.
In LTE, we expect 10 subframes per frame, and the logging is done with
this assumption. We have one tick per subframe.
In NR, we deal with slots, not subframes. And we have n ticks per frame
(depending on mu). As of today, only n=20 is tested (corresponding to
mu=1).
A previous commit introduced 'subframes_per_frame' which had the correct
meaning for LTE but was truly 'slots per frame' for NR. This creates
confusion.
Let's replace 'subframe' by 'tick' to reduce confusion.
Update RFsim CN
- Update RFsim CNs to latest version
- update the MBIM stop script to remove IP addresses (we don't use this
script directly, so it does not have an impact)
[FHI72 M-plane] CM improvements and PM implementation
Configuration Management:
- addition of the RU username in the fhi_72 section of the config file;
previously hardcoded to oranbenetel
- modification of the frequency offset, frame structure, fft size,
cyclic prefix, and Tx gain;
- addition of the managed delay node;
for Tx/Rx endpoints.
Performance Management implementation where OAI gNB
activates/deactivates available RU performance measurements.
- Replaced ITTI message queues with notifiedFIFO for RRC to MAC communication in UE.
- Enables correct message delivery to multiple MAC instances running in parallel threads.
- Introduced `nr_mac_rrc_message_t` union for MAC-RRC messages.
- Updated all relevant message handling and initialization code to use notifiedFIFO.
Performance Management support explanation.
Example run modified according to:
- modification of the frequency offset, frame structure, fft size, cyclic prefix, and Tx gain;
- addition of the managed delay node;
for Tx/Rx endpoints.
Introduced a parameter start_up_timing which indicates if PM activation is supported during the start-up
procedure. We initialize this parameter, based on the vendor.
Notification interval is set to 10s.
Definition in o-ran-uplane-conf.yang model:
"Gain correction of RF path linked with array element or array layers.
Common part of overall gain_correction.
gain_correction = common array-carrier gain-correction + eAxC gain correction."
Fix SRS TLV unpack
This MR changes the type of a variable to get the last index in which we
unpack the full 32 bits in a SRS TLV to int16 instead of uint16, in
order to be -1 when the TLV length is 0, thus skipping unpacking. This
only affects the SRS.indications sent by Aerial L1, which don't have
padding in the TLV, in case of OAI L1, we unpack in "full" 32 bit blocks
until the end of the TLV, if the length is 0, the unpacking loop exits
immediately. Furthermore, it also adds a check for the Report Type
parameter value in handle_nr_srs_measurements. If this value is zero,
according to SCF 222.10.04 Table 3-129 means a null report, so we can
skip processing it.
- Use MAX_NUM_NR_UE_INST in NR UE MAC to control number of MAC instances.
- Modify the MAC interface slightly so that nr_l2_init_ue only initializes one instance
Use MAX_NUM_NR_UE_INST for number of NR UE RRC instances. Change the RRC
interface slightly so nr_rrc_init_ue initializes only one RRC instance pointed
to by the id given to the function
Integration: `2025.w34`
* !3555 Remove dead code and variables, simplify code
* !3591 separate computation of size and value for DCI precoding information
* !3550 some work for better interoperability with srsRAN DU
* !3562 cleaning syntax of nr-ru.c
* !3598 Align add_boolean_option as per CMake documentation use only ON/OFF for uniformity
* !3407 Taps client for vrtsim
* !3035 NR L1 common channel level functions
* !3589 RF emulator and improvements of the timers
* !3577 Fix for UECAP file handling in dora/phytest mode
* !3600 Fix for UE TCI state ID configuration
* !3599 DLSCH scheduler: fix bugs in UE sorting
See merge request oai/openairinterface5g!3597
The CI detects whether a UE connected (and has a PDU session) by trying
to read the IP address. It therefore assumes that as long as the UE is
not connected, no IP would be present.
With the existing stop_quectel_mbim.sh script, this was not the case; it
would simply leave the IP address. Modify this script to flush all IP
addresses on disconnect to remedy this.
DLSCH scheduler: fix bugs in UE sorting
Fix two issues/bugs when sorting UEs in the DLSCH scheduler following
the PF metric, which should improve fairness.
RF emulator and improvements of the timers
RF emulator:
Add an RF library emulating a real device without the need of a real
device. This is thought to enable using phy-test without requiring a
radio device or channel simulation. The library synchronizes on the
real time clock, drops TX and generate noise on RX. Noise generation
can be disabled and the noise level configured.
Timers improvements:
- Fix standard deviation for merged timers
- Add display of ULSCH decoding timers
- Add decoding timer in AAL
Update the comparator() to properly sort UEs based on their coefficient
by appliey a consistent logic of -1/0/1 (see man qsort) for
smaller/equal/larger. The previous logic was only sorting based on 0/1
(equal/larger), which would result in some UEs with a high coefficient
not necessarily advancing to the start of the list, which could reduce
the likelihood of them being scheduled when they actually should (in
other words, this should improve fairness).
See also: 62e4025bc8 ("Integrate inactivity scheduling into main
allocation loop")
Taps client for vrtsim
The MR allows vrtsim to connect to the Raytracing Channel Emulator (CE later).
https://gitlab.eurecom.fr/oai/raytracing-channel-emulator
Additional Ubuntu packages required:
- libnanomsg-dev
- flatbuffers-compiler
- libflatbuffers-dev
Everything was tested on the same host. Follow the steps below to
successfully replicate:
1. Build nr-softmodem dependencies
2. Build nr-softmodem for (gNB, nrUE) with OAI_VRTSIM_TAPS_CLIENTset to ON.
3. Start the core network (Optional) follow this tutorial
4. Start the gNB
sudo ./nr-softmodem -O ../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf --gNBs.[0].min_rxtxtime 6 --device.name vrtsim --vrtsim.role server --vrtsim.timescale 0.5 --vrtsim.taps-socket ipc:///tmp/ru_socket_0
5. Start the nrUE
sudo ./nr-uesoftmodem -C 3619200000 -r 106 --numerology 1 --ssb 516 --band 78 --device.name vrtsim --vrtsim.taps-socket ipc:///tmp/ue_socket_0
6. Start the CE Server, once the UE and gNB are running properly, so the
server can connect to IPC sockets
7. Start CE client; the binaries can be downloaded from a pipeline run
or from this link
8. Move the UE in the CE client to generate a new taps array and
populate the taps in softmodems
Align add_boolean_option as per CMake documentation use only ON/OFF for uniformity
The add_boolean_option of CMake is not uniform everywhere. We were using
either True/False or ON/OFF. It is better to be uniform to avoid
confusion.
As an example, see here CMake documentation for an example:
https://cmake.org/cmake/help/latest/module/CMakeDependentOption.html#example-basic-usage
There are also some minor spelling corrections.
some work for better interoperability with srsRAN DU
Just add the minimum to get some user plane traffic going on.
When doing user plane traffic, in the CU logs we have a lot of:
[GTPU] NR-RAN container type: 1 not supported
That will be fixed in another MR, not here.
Interoperability testing with srsRAN DU shows than when receiving
RRCReconfigurationCompleteIndicator in a UEContextModificationRequest
the DU replies in the UEContextModificationResponse with an empty
CellGroupConfig.
This CellGroupConfig is encoded as 2 zero bytes. Let's ignore this
message when we receive it, don't forward it to the UE in a
RRC Reconfiguration, as it should per standard (38.473 8.3.4.2):
If the CellGroupConfig IE is included in the DU to CU RRC Information
IE contained in the UE CONTEXT MODIFICATION RESPONSE message, the
gNB-CU shall perform RRC Reconfiguration as described in TS 38.331 [8].
The CellGroupConfig IE shall transparently be signaled to the UE as
specified in TS 38.331 [8].
To be removed/reworked in the future if the interoperability
situation improves.
This is in 3GPP TS 38.425.
Because it was not done, there was a problem of interoperability
between openair CU and srsran DU. No DL traffic was reaching the UE.
A new GTPU API function is introduced: gtpv1uSendDirectWithNRUSeqNum().
It is only used in the gNB CU, in PDCP. So it was decided to not add a
new parameter to gtpv1uSendDirect() but instead add a new API function.
Replace the unwieldy unix socket implementation of peer information
exchange with an authorative connection descriptor file that
informs the client of the connection method an number of antennas
on the server.
This allows the server to run without the client and allows the
client to reconnect as long as the server is running, as many times
as needed.
Move the channel state management outside the channel implementation.
This simplifies the channel implementation but forces users of the
channel to manage it's state manually.
Add handling for error states in vrtsim which allows to close the
softmodems with CTRL+C without hanging, improving user experience
- Client detection of stale timer.
- Abort state for client and server
Added a libary that can connect to a channel emulator and provide taps
as they are generated.
- Enable connection from vrtsim to channel emulation server
- Depends on flatbuffers definition file from raytracing-channel-emulator
- Depends on libanomsg-dev and flatbuffers-compiler (Ubuntu) or equivalent
- Added a compile time option ENABLE_TAPS_CLIENT to prevent other users
from being affected by additional dependencies
separate computation of size and value for DCI precoding information
This removes stuff that is only relevant for the gNB from the common
functions and moves it to the gNB scheduler functions (related to UL
precoding). In principle no functional change.
2 functions with same name as static to make it clearer they are separate.
remove unused copy of log_level global var.
remove threequarter sampling variable from the radio board general
configuration. The decision of sampling rate is made above. A better
behavior can be done later, like ask to the radio board what sampling
rate it can do,then use it to decide the appropiate sampling rate from
the gNB configuration. In UE case, it is another issue, as the sampling
rate would change after we decode SIB1, but also it is not developped
yet.
Think: NR with different number of slots per frame depending on mu.
The name 'subframes_per_frame' is a bit ambiguous. It is valid for LTE,
but for NR it should be 'slots_per_frame'.
For example, for sub-carrier spacing of 30KHz, we have 20 slots per
frame, so in this case subframes_per_frame = 20. In reality whatever
the numerology, there is always 10 subframes per frame in NR.
But how to name this variable which is used both for LTE and NR cases?
'subframes_or_slots_per_frame'? It's a bit long and also ambiguous.
Conclusion: no big deal I think. 'subframes_per_frame' and so be it.
- Allow client to exit cleanly if server is down
- Ensure timing_thread is joined only once avoiding exit_function loop
- Free noise_device
- Save previously sent samples for channel modelling
Integration: `2025.w33`
* !3563 UE fixes: pucch format 2 and CSI IM
* !3567 Workaround for handling 2 SS0 occasions per slot
* !3578 fix a T trace
* !3395 RFsim variable size H_awgn_mimo
* !3581 NR UE NTN: consider acceleration on orbital path to calculate N_UE_TA_drift_variant
* !3580 NR UE: fix pdcch llr_size calculation in nr_rx_pdcch()
* !3576 Cleanup documentation and interface of the LDPC segment coding libraries
* !3573 Make Amarisoft UE sim a RedCap UE
* !3586 Print UE command line parameters at gNB MAC for split architecture without L1
* !3584 add gtpu error packet parsing and display
* !3556 Introduce support for Cat-B RU using Predefined-Beam BF with Aerial L1
* !3492 Upgrade CI images to Ubuntu 24
* !3521 Refactor ULSCH scheduler towards more TDD pattern flexibility
* !3590 Improve MAC docs for MCS and docker for BuildKit usage
* !3579 CI: speed up and simplify build, remove unnecessary Python code, remove --eNB\* parameter list
Closes#927 and #973
See merge request oai/openairinterface5g!3583
Add a simple RF emulator library with no real RF.
It only synchronizes the gNB with the real time clock.
It is to be used for stress test or benchmarking in phy-test mode.
Improve MAC docs for MCS and docker for BuildKit usage
See commits for details. The first one is for fixing an omission in
!3281, the second to clarify docker build usage.
Closes: #973
CI: speed up and simplify build, remove unnecessary Python code, remove --eNB* parameter list
This cleans up the CI framework for running end-to-end tests, and
improves the integration with OAI code. Specifically
- cleanup build_oai and helpers to output all text, which is captured
better by the CI
- build some images in the Cluster-Build in parallel to increase speed
- remove all --eNB{,1,2}{IPAddress,UserName,Password} variables. Those
were indexed through "instance" and "server ID" and are replaced with
the actual node name. I consider further cleanup to introduce a
"global" XML file node name so we don't need this in each step and
instead define this once.
- individual cleanup
A previous commit changed to use archiveArtifact() to recover CI logs,
and then attempted to "guess" the L1/MAC stats file name through a
regex. However, the format "enb-[0-9]+" is not correct, as
archiveArtifact() puts the task ID ("[0-9]+") BEFORE the file name
(here, "enb"). So, make it more generic and match the final "-enb.log"
("$" means "end of string").
Fixes: 244ea8fc22 ("Use archiveArtifact() for TerminateeNB()")
Many of these tests exit with an exit code != 0. Thus, the CI
automatically logs the result. Rather, write everything including stderr
to the file for analysis.
Also, rewrite the file with ">" instead of appending through ">>". While
appending works because the CI removes files after archiving, it seems
"cleaner" to remove files.
It is superseded by the CreateWorkspace() function and task step (which
removes and recreates a workspace), and this option was not actually
used in any function except for the build of unit tests, but no XML
step actually specified this option.
After having transitioned to direct node names in the XML, these
parameters are not relevant anymore.
The best way to view this patch is with
git show <SHA> --ignore-all-space
Remove this class. It is not safe to use (no return codes, can get out
of sync), hardcodes the use of passwords, and it's API is cumbersone.
More explanations can also be found in !1867. It is superseded by
cls_cmd.py
Since 28ce0dc444 ("Main: pass in ctx"), the CI always collects logs
into cmake_targets/log/. Hence, LogCollecteNB() is never called. We can
remove it.
Further, change the cmake_targets/log/ to ci-log/, which is shorter, and
append a / on the zip path to make sure that only contents is zipped.
Reimplement these functions by
- using cls_cmd
- retain only the necessary steps from the timing-phytest function
- pass in ctx and node information, instead of server ID
- remove all superfluous variables that don't seem to be used
- make some lists (corresponding indices are "server ID") into normal
variables.
Pass node directly from XML to these functions
- BuildClusterImage()
- BuildImage()
- BuildProxy()
- BuildRunTests()
instead of reading the "server ID" and looking up from
eNB_IPAddress/eNB1_IPAddress/eNB2_IPAddress.
Improve the proxy build unit test by properly passing ctx information.
build_oai primarily builds UHD for OAI. Thus, a number of targets (B100,
USRP1/2, ...) can be omitted, as OAI does not run on them. Further,
disable documentation and man pages, which is typically not necessary
for the averages user, and does not need to be installed for containers.
Similarly to the parent, don't redirect log files to a file. It makes
the CI more complicated, and also raises user awareness of what is being
installed.
Refactor ULSCH scheduler towards more TDD pattern flexibility
Refactors ULSCH scheduler, notably to support "UL-heavy" TDD patterns,
e.g., DSUUU. Also allows to run TDD pattern2 with UL slots, which was a
limitation in the previous code.
Increase the number of aggregration level candidates. Since we have many
UEs with concurrent traffic in that pipeline, we should ensure that we
can allocate many DCIs to not waste resources (e.g., not all RBs used
because could not find DCIs for specific UEs).
Add the possibility to use UL slots in TDD pattern 2. For simplicity, we
require the mixed slot to be of the same symbols in pattern 1 & 2. For
UL slots, simply use the right amount of UL TDAs, depending on which
number of UL slots among pattern 1 & 2 is bigger.
One complication is the TDA for the mixed slot. The current code assumes
that k2 has to be equal or larger than (number of DL slots +1) (because
the spec says min k2=2, but we might want to schedule DSUUU). Then,
there could be for instance the following cases:
- only pattern 1: DSUUU DSUUU ...: the mixed slot has to be reached an
entire period in advance
- pattern 1 & 2: DSUUU DDDDD: normal mixed slot k2, e.g., like for 7DS2U
- pattern 1 & 2: DSUUU DDDSU: the mixed slot has to be reached
N_ul2+N_dl1+1 slots in advance
I can't think of more cases right now. To avoid unscheduled slots, I put
an assertion (which could also trivially be taken out).
Adds the capability to pack/unpack the TDD table in CONFIG.request
following both SCF222.10.02 (Tag 0x1027) and SCF222.10.04 (Tag 0x1035)
formats In the case of Aerial, the TDD table is packed following the
10.04 format, but with the 10.02 tag Prevent the packing of Digital
Beamforming table and Precoding Matrix table for Aerial
A new function get_best_ul_tda() allows to select the "best" TDA out of
a number of TDA. Specifically, get_best_ul_tda() considers in how many
RBs a given TDA might be allocated, and multiplies this number of RBs
with the number of symbols in the TDA to form a "score". The TDA with
the best "score" is selected, considering it maximizes resource usage.
In phytest scheduler, we use this function to verify that the given TDA
can be really allocated in all selected slots.
Schedule SRS longer in advance, so that it would also be enough even
with big k2 for UL TDA.
Remove useless types: we do not use the information on sched_srs
anymore, so remove it.
Check that the VRB map is free before making allocations.
Since the parent commit, the TDA for UL scheduling is dynamically
selected, instead of being hardcoded to specific indices. We can thus
also omit the SRS TDA if no SRS is configured.
Also add SRS-specific TDAs if we schedule further into the future.
Add multiple TDAs with k2 larger than the min_rxtxtime, to potentially
allow to allocate all available slots. For this, nr_rrc_config_ul_tda()
inspects the TDD pattern, and allocates as many TDAs as necessary. It
also sorts the TDA list, with smaller k2 and larger symbol lengths
first.
This in turn is now used by get_num_ul_tda() to use a k2 and the slot
configuration to find a suitable TDA, assuming a list as sorted in
nr_rrc_config_ul_tda().
Note that since get_num_ul_tda() does only inspect the available UL
slots, there might be overlap (e.g., when scheduling SRS), which will be
fixed in a follow-up commit.
Also, TDD pattern 2 is not handled here yet, and a follow-up commit will
fix it.
Add a loop to advance slots as determined by current ("DL") slot, and
advance further into the future (for "UL" slots) if TDAs allow. Ensure
to schedule all TDAs if it's the last DL slot, to guarantee a previously
scheduled TDA will also reoccur (i.e., for guaranteeing that
retransmissions can be made).
Note that the check for number of UE being zero is removed, as this
allows to keep "ul_next" close to the "min_next" slot. This way, we can
use fs_get_max(); otherwise, if we did not always execute this loop,
they might diverge far from each other, making the logic inside the loop
more complicated.
This commit introduces a new type "fsn_t" (frame-slot number) that
encapsulates a single frame-slot combination in a single struct. The
helper functions (in gNB_scheduler_ulsch.c) should be moved to a new
file under common/, but we don't do this here to limit the amount of
code changes.
For scheduling multiple ULSCH ahead, we will have to use different k2.
Hence, we will need to check for k2 in the TDA selection as well. The
function get_ul_tda() is renamed to get_num_ul_tda() to reflect that it
might return multiple TDAs (not done in this commit, but in a follow-up
MR). get_num_ul_tda() also returns a pointer to the first suitable TDA.
In the phy-test scheduler, simplify the selection of the TDA to use: do
not hardcode a specific K2, but rather, use the first one (with any k2).
For the multi-UL slot scheduling functionality in a follow-up commit, it
would be important to know if the scheduler allocated any UEs. If
pf_ul() allocated for some UEs, we might run it again on a different
slot. If on the other hand, no UEs were allocated, there is no point in
running it again.
Introduce support for Cat-B RU using Predefined-Beam BF with Aerial L1
This merge introduces the support for BeamID based Beamforming in OAI L2 using FAPI and leveraging Aerial L1. Support for OAI L1 is not in the scope of this MR.
Main changes:
- Introduced a third state for the analog_beamforming parameter.
0=disabled,1=analog_bf,2=oran_bf
- Correctly populated the FAPI BF PDUs (prg_size, num_prgs,
dig_bf_interfaces)
The Dockerfiles are reused for building on different architectures
(amd64/arm64). They differ, though, on some steps for downloading or
installing platform-specific utilities.
This is handled automatically when using BuildKit, which is the default
in docker versions v23.0+. Older docker versions require some special
settings. Explain this in the README.
Closes: #973
Previous commits removed min_grant_mcs and instead introduced
dl/ul_min_mcs as a more generic replacement.
Fixes: 96b0cae63e ("Drop 'min_grant_mcs' configuration parameter ")
Fixes: 699afafc6f ("Add support for 'dl_min_mcs' and 'ul_min_mcs'
configuration parameters")
Make Amarisoft UE sim a RedCap UE
Change Amarisoft UE configuration and gNB of the AW2S pipeline to
be/handle RedCap UEs.
The UE should only connect if the gNB handles RedCap UEs. In the logs,
we should see
[MAC] UE with RNTI 3725 is RedCap
which we check for the first two UEs (one normal UE/absence of this
message, one RedCap UE/presence of this message).
Cleanup documentation and interface of the LDPC segment coding libraries
Fix interface: The LDPC segment decoder interface had variables
'harq_pid', 'ulsch_id' and 'C' that are not useful to the segment
decoder. This MR removes these variables from the interface.
Fix documentation: libconfig log do not display anymore by default so we
may better not show them in the documentation to avoid any
misunderstanding.
Remove ldpc_cl library since the library does not work.
Since the parent commit, UE 1 is normal (no RedCap), UE 2 is RedCap.
Verify that the gNB agrees with that and detects the second UE as RedCap
by analyzing some logs.
The first check is a bit elaborate, but basically is
[ $(docker logs | grep XYZ | wc -l) -eq 0 ]
^ ^ ^ ^ ^
1 2 3 4 5
(1) is the if statement, that compares
(4) the number of occurrences
(3) of "RedCap" in the
(2) docker logs
(5) to being equal to
Note for all UEs which number, and whether it is RedCap (so this need to
be kept in sync with the Amarisoft UE sim configuration file in use!).
Change the parameters to be redcap (release: 17, redcap: "redcap") on
some UEs, and modify the path to the updated configuration.
Specifically, make UE 1 normal (no RedCap), UE 2 RedCap, UEs 3&4 normal,
UEs 5&6 RedCap, etc.
RedCap UEs should now only be able to connect if the gNB is handling Redcap
UEs, which is done in the parent commit.
NR UE NTN: consider acceleration on orbital path to calculate N_UE_TA_drift_variant
The ntn-Config ephemerisInfo contains the SAT position and velocity
vector but not the acceleration vector.
But the acceleration magnitude on the orbital path can be calculated as:
t = 2 * pi * r / v
omega = 2 * pi / t = v / r
acceleration = omega² * r = v² / r
Where t is the orbital period, r is the orbital radius, v is the orbital
velocity, omega is the angular velocity. The acceleration direction is
from the SAT position towards the earth center. To calculate the
acceleration towards the UE, this is projected on the direction from the
SAT to the UE.
This is used to calculate the variable N_UE_TA_drift_variant and improve
the TA accuracy.
Workaround for handling 2 SS0 occasions per slot
Search Space 0 monitoring might depend on SSB. In !3332 this dependence
was removed by moving the configuration of SS0 earlier in a workaround
to avoid a segfault in handover. Now, a new workaround is needed to
handle 2 search space occasions per slot.
As DEBIAN_FRONTEND has been set as environment variable, there is no need to use DEBIAN_FRONTEND=noninteractive inside RUN lines, it is redundant, hence it has been removed.
Libboost went from 1.74.0 to 1.83.0 alongside Ubuntu update.
GCC version is set as default to be more practical.
In Ubuntu22, apt sources were in .list files, in Ubuntu24 they are in .sources files.
Add --break-system-packages for pip installation to use same logic as before, see the pip update 23.0.1 (2023-02-17).
With Ubuntu24 liboai_device requires libpython3.12
Redirecting to a file has the problem that it is difficult in the CI to
recover these files. Furthermore, at least with ninja, when running
build_oai interactively, the build output will only take some lines
(because ninja rewrites lines), so the change should not be that big to
users.
One CI function would print the entire output from build_oai to the
console. Since that output might be long now, do not do this. The file
is archived, anyway.
The acceleration magnitude on the orbital path can be calculated as:
t = 2 * pi * r / v
omega = 2 * pi / t = v / r
acceleration = omega² * r = v² / r
Where t is the orbital period, r is the orbital radius, v is the orbital velocity, omega is the angular velocity.
The acceleration direction is from the SAT position towards the earth center.
To calculate the acceleration towards the UE, this is projected on the direction from the SAT to the UE.
Variables 'harq_pid', 'ulsch_id' and 'C' of the segment decoder
interface were not used any more by the implementations and set to zero
by all the callers.
Then it is more relevant and compliant to remove them.
Integration: `2025.w32`
* !3548 NR UE: fix reliable SIB19 reception when ntn-UlSyncValidityDuration-r17 expires
* !3559 numelt in place of config_isparamset
* !3487 T hacks: add new tracer ant0 and a tool to plot ofdm data from usrp or rfsim (output or input)
* !3541 simplify and make more local variables in nr_rx_pdcch() and fix small bugs
* !3547 Add a CU-UP load tester and improve GTP performance
* !3552 CI: refactor iperf3 UDP analysis function
* !3557 Fix PDSCH rate-matching for periodic CSI in UE
* !3571 fix time manager tests in the CI
* !3344 LDPC BBDEV/AAL rework
* !3560 CI: Refactor log collection, collect also (COTS) UE logs
See merge request oai/openairinterface5g!3565
CI: Refactor log collection, collect also (COTS) UE logs
Refactor log handling in CI: collect according to currently used XML files. This
makes it homogeneous in the pipelines, and avoids accidental overwriting (as
happens in phytest-timing), as well as harmonizing the log placement
(e.g., no YAML lookup in Ping/Iperf).
Allow to trace and archive UE logs (e.g., Quectel via QLog, Amarisoft UE logs).
By default, no logs will be collected as of this MR, as many files are big.
Various cleanup in Jenkinsfiles, some bugfixes, add unit tests.
Sometimes the connection fails because of the reboot. Without may_fail,
it would stop the build, which will then run the wrong code, possibly.
Instead, continue; if there is a problem with USRP, it will be visible
when starting nr-softmodem.
I have to make both together, since they both depend on
AnalyzeBuildLogs().
- remove mkdir for legacy sub-logfiles in build_oai, that does not exist
anymore; also, remove corresponding log analysis, I think we don't use
it and it is overkill (either build works or not)
- manually try to copy "all.txt"
- explicitly list log files to copy, then analyze
- AnalyzeBuildLogs(): pass log files to inspect explicitly
LDPC BBDEV/AAL rework
This branch aims to generalize the existing LDPC T2 implementation to support
other DPDK BBDEV accelerators, e.g., Intel ACC100/200.
Differences from the current T2 implementation include:
1. relax CMakeLists.txt checking for custom dpdk-t2 implementation,
technically, any DPDK BBDEV should work
2. BBDEV capability checks during init
3. llr_scaling to scale the input llr accordingly for better decoding
performance on the Intel ACC100/200
4. self-managed harq buffers for the ACC200, as internal harq memory is not
available
Tested BBDEV devices:
1. Intel ACC100
2. Intel ACC200/VRB1
Set the context for each task step. Set the artifact result path based
on the XML, so it is harmonized; currently, most pipelines use the "YAML
path" of docker-compose, but that does not always make sense. For
instance, Ping/Iperf() needs to look up this path, but does not
inherently belong to one specific YAML path (there might even be more).
This class provides a generic "context" for individual tasks about the
current task step, and where to log results. It's used by
archiveArtifact() that would automatically log files in the right
directory, based on a directory in the context, and in a way that order
of files is preserved for long-running pipelines.
Note: this does not actually work. In the pipelines, we see that for
some reason, quectel-CM cannot establish a connection. Manually, it
works though(?)
It is not necessary (the final undeploys at the end are "always_exec"),
and makes the CI potentially fail since there is nothing to copy at this
point.
check for IP once before sleeping in case UE IP address exists, which
should speed up the CI. With this, Only print the actual attach command
once. Print errors only at the beginning. This should simplify attach
command output logs.
The CI fails sometimes, because some processes/threads are created in
unpredictable order and if the client connects before the server is
ready some tests fail, as seen in the following log:
[UTIL] client/server iq-samples: launch sub-processes
[UTIL] threadCreate() for time client: creating thread (no affinity, default priority)
[UTIL] time manager configuration: [time source: server] [mode: client] [server IP: 127.0.0.1} [server port: 7374]
[UTIL] time client: connection to 127.0.0.1:7374 failed, try again in 1s
[UTIL] threadCreate() for time source iq samples: creating thread (no affinity, default priority)
[UTIL] threadCreate() for time server: creating thread (no affinity, default priority)
[UTIL] time manager configuration: [time source: iq_samples] [mode: server] [server IP: 127.0.0.1} [server port: 7374]
[UTIL] client/server: rlc ticks: 1000 pdcp ticks: 1000 x2ap ticks: 1000
CMDLINE: "/oai-ran/build/common/utils/time_manager/tests/test_time_manager_auto" "--time_management.mode" "server" "--time_management.time_source" "iq_samples"
[UTIL] client/server: rlc ticks: 0 pdcp ticks: 0 x2ap ticks: 0
CMDLINE: "/oai-ran/build/common/utils/time_manager/tests/test_time_manager_auto" "--time_management.mode" "client"
[UTIL] client-server iq-samples: ERROR
The client/server iq-samples test is started.
Then we see this log:
[UTIL] time manager configuration: [time source: server] [mode: client] [server IP: 127.0.0.1} [server port: 7374]
Which means that the client is running.
It tries to connect to the server (not running yet), but fails, so sleeps
for 1 second before attempting another connection to the server:
[UTIL] time client: connection to 127.0.0.1:7374 failed, try again in 1s
The sleep is done by the time_client thread, the main thread of the test
program continues and does a sleep(1).
Then the server arrives:
[UTIL] time manager configuration: [time source: iq_samples] [mode: server] [server IP: 127.0.0.1} [server port: 7374]
It sends all the ticks (to no client, since the client is still sleeping).
Then the test is over, the sleep(1) of the client finishes and the program
exits. The client never connected to the server.
We have this log:
[UTIL] client/server: rlc ticks: 0 pdcp ticks: 0 x2ap ticks: 0
And the test fails.
It's complicated to write an automatic test involving several uncoordinated
programs. The operating system may create processes in any order. We use
some sleeping to wait, but it may be too short or too long, leading to test
failure.
Let's see with more sleep if the CI fails less.
Fix PDSCH rate-matching for periodic CSI in UE
Changed the search structure to have periodic resoruce id in the outer
loop and configured resource set as inner loop to prevent configuring
resource that is not needed.
Use const for input pointers.
CI: refactor iperf3 UDP analysis function
- add helper function to covert reported bitrate values to Mbps for calculations
- clean up the UDP analysis function, improve test report formatting
- fix an issue where Gbps values were incorrectly reported
(example: https://jenkins-oai.eurecom.fr/job/RAN-SA-AERIAL-CN5G/4802/)
- update CI unit test report checks to match the new formatting
Rename the library to reflect that it's more a generic AAL driver than
specifically for AAL. To this end, rename some documentation.
As of this commit, the options are still called nrLDPC_coding_t2. The
next commit will correct this.
Co-authored-by: Xin Zhe Khooi <khooixz@comp.nus.edu.sg>
Changed the search structure to have periodic resoruce id in the outer
loop and configured resource set as inner loop to prevent configuring
resource that is not needed.
Use const for input pointers.
Add a CU-UP load tester and improve GTP performance
This adds a simple tester program for the CU-UP. It sets up a number of
UEs/bearers in the CU-UP via the E1 interface, then streams data in
downlink/uplink (as seen by the CU-UP). More information is available in
tests/nr-cuup/README.md.
Includes some fixes to properly verify that SCTP is installed, and use
"the right cmake way" to use it in cmake code (see commit for details).
simplify and make more local variables in nr_rx_pdcch() and fix small bugs...
simplify and make more local variables in nr_rx_pdcch() and fix small bugs
(size 9 RE instaed of 12 RE)
T hacks: add new tracer ant0 and a tool to plot ofdm data from usrp or rfsim
(output or input)
The tool ant0 dumps IQ data to a file (or stdout) as float complex or short.
It is needed for a student's project. (Well, we could use record/extract, but
it's simpler.) The tool ofdm-plot is used to plot output or input signal from
gnb in the frequency domain. May be useful to debug, why not.
numelt in place of config_isparamset
config_isparamset doesn't seem to work for array types, a temporary solution is
using numelt to verify if the parameter is set in config file
NR UE: fix reliable SIB19 reception when ntn-UlSyncValidityDuration-r17 expires
Fixes:
- gNB: fix scheduling of Rel-17 SIBs
- gNB: fix case in update_SIB1_NR_SI() when multiple Rel-17 SIBs would be defined
- NR UE: fix calculation of SI window expiry
Updating LEO scenario to test this
- set ntn-UlSyncValidityDuration-r17 to 5 seconds for LEO scenario
- NTN config: setting sib1_tda is not required anymore
Remove these F1-C port numbers. The configuration is not actually
applied, and the default F1-C port number 38472 (see F1AP_PORT_NUMBER)
is hardcoded in the F1 module.
For the moment, I leave the configuration option, in case we want to
allow to configure the port numbers later).
Make a common pattern, which makes it simpler to find them in gNB logs,
and, maybe more importantly, link tunnel creation and update (the update
message was missing the "incoming" TEID, so it is not easy to link to
creation apart from the UE ID, but even then the UE might have multiple
tunnels).
Reuse the gtpv1u_bearer_t for internal functions. Hopefully this will
also simplify implementation of IPv6, as it encapsulates IP address
handling within gtpv1u_bearer_t.
The (remote) port number of the GTP module is configured during
initialization. It is therefore not required when calling
newGtpuCreateTunnel(), and could even lead to bugs (if another port
number is used than specified during GTP init).
This is a simple CU-UP load tester. It sets up a configurable number of UEs in the
CU-UP, then sends GTP traffic in downlink/uplink in the N3-F1/F1-N3
direction at the CU-UP. It then compares the sent and received data.
Additional parameters, such as amount of traffic, test length, packet
size, and IP addresses/ports are configurable.
To run:
mkdir build && cd build && cmake .. -GNinja && ninja nr-cuup nr-cuup-load-test params_libconfig
./tests/nr-cuup/nr-cuup-load-test
./nr-cuup -O ../tests/nr-cuup/load-test.conf
The tester should be able to detect lost and reordered packets.
Example lost: Receive order 2,3,5,6 (lost packet 4)
=> on packet 2, expected 2, next=expected+1=3
=> on packet 3, expected 3, next=expected+1=4
=> on packet 5, expected 4, diff=5-4=1 (lost 1), next=payload+1=6
=> on packet 6, expected 6
=> 1 lost
Example reordered: Receiver order 2,5,3,6 (lost packet 4)
=> on packet 2, expected 2, next=expected+1=3
=> on packet 5, expected 3, diff=5-3=2 (lost 2), next=payload+1=6
=> on packet 3, expected 6, (reduce lost by 1 to 1), next=expected=6
=> on packet 6, expected 6
=> 1 lost
Example reordered: Receiver order 2,5,3,4,6 (no losses)
The boolean value v17_sib was not set to true when allocating si_schedulingInfo_v17 and schedulingInfo2_r17.
So multiple Rel-17 SIBs would lead to multiple allocations and only the last SIB being actually configured.
Fix this by removing the redundant v17_sib variable and directly check if the memory was already allocated.
Also move the definition and allocation of si_schedulingInfo_v17 closer to its actual usage.
Now that we reliably receive SIB19, we can set the ntn-UlSyncValidityDuration-r17 to a sane value
and thus make sure that the UE always has up-to-date SIB19 information.
A dedicated Msg3 TDA is simply not necessary: get_feasible_msg3_tda()
already iterates through all TDAs to find a suitable one for Msg3, and
takes things such as parameter Δ already into account.
The only prerequisite is that the ra_ResponseWindow is long enough. In
some configurations, Msg3 TDA ensured that Msg2 still happened during
ra_ResponseWindow, while Msg3 was outside of it. This is not necessarily
the case anymore, unless ra_ResponseWindow is long enough.
For the normal user, removing ra_ResponseWindow from the config will be
enough.
Since the parent commit, the ra_ResponseWindow will be chosen
automatically. Correspondingly, remove most ra_ResponseWindow options
from configuration files in the repository.
One problem in some mu=1 configs is that the ra_ResponseWindow=4 (10
slots), which might be overly restrictive if the L1 slot ahead is
somewhat close to 10 (e.g., 6), in which case we might not be always
able to allocate Msg2 in time.
A notable exception here is gnb-vnf.sa.band66.u0.25prb.nfapi.conf, in
which we still provide it (1) since it uses a non-standard configuration
of a ra_ResponseWindow longer than 10ms (see also issue #916 for more
information) and (2) as an example.
If the config file does not specify ra_ResponseWindow, select it to be
10 slots in mu=0, or 20 slots for all others.
This should give us enough flexibility to allocate Msg2 without running
out of the response window. The next commit will remove most
ra_ResponseWindow options in configs.
Scheduling for inactivity only deviates in details from the main
scheduling logic: we simply allocate a fixed number of RBs instead of
making it dependent of data.
In this commit, add an additional flag to sort UEs that are scheduled
for inactivity in front of "normal" UEs (with traffic). Then, schedule
those UEs by limiting/fixing the amount of RBs to schedule to
min_grant_prb.
Update the comparator() to properly sort UEs based on this flag and the
coefficient by applying a consistent logic of -1/0/1 (see man qsort) for
smaller/equal/larger. The inactivity flag, if set, will always have
higher priority over the coefficient to schedule these UEs first, as was
the case prior to this commit.
Remove sched_ctrl->sched_ulsch, and call the post-processing function
post_process_ulsch() in the places where sched_ctrl->sched_ulsch has
been assigned. This will have two effects:
- it is not necessary to have the final loop over all UEs, which might
be costly especially towards many UEs.
- till now, there is only a single sched_ulsch; however, a later commit
will allow to schedule multiple PUSCH transmissions from a single (DL)
slot. This would require to make sched_ctrl->sched_ulsch, and
also iterate through all sched_ulsch. In this new scheme, we can
simply call post_process_ulsch() multiple times, which is simpler (and
therefore, implicitly handleded as of this commit).
Write a single NR_sched_pusch_t structure in a single statement (where
possible). Assign to sched_ctrl->sched_pusch later, where the
post-processing functionality will be called in a follow-up commit.
Write a single NR_sched_pusch_t structure in a single statement (where
possible). Assign to sched_ctrl->sched_pusch in one place, where the
post-processing functionality will be called in a follow-up commit.
Avoid to overwrite the existing retInfo. Instead, create a new
NR_sched_pusch_t and assign to sched_ctrl->sched_pusch in one place. A
follow-up commit will directly trigger the post processor here.
Write a single NR_sched_pusch_t structure in a single statement (where
possible). Assign to sched_ctrl->sched_pusch in one place, where the
post-processing functionality will be called in a follow-up commit.
PF uses MCS and average throughput to decide which UE to schedule. Thus,
the first loop selects the MCS, and the second does the main UE
allocation after sorting by priority, depending on the MCS.
A follow-up commit will remove sched_pusch from NR_UE_sched_ctrl_t.
Thus, we cannot rely on sched_ctrl to store the MCS in the first loop,
and look it up from there in the second. Instead, store it as part of
the UE iterator data, and take it from there.
A later commit will remove sched_ctrl->sched_pusch. Instead, the TX
power is also stored for each HARQ process (as they contain
sched_pusch). Read it from there, which should have the same effect.
Introduce an array with information on FAPI structures to save resource
allocation into. It's in nr_mac_gNB.h because the next commit reuses
this for all preprocessors.
DC subcarrier has a significantly higher energy compared to other CSI IM
resource elements. This causes the average interference + noise
estimation to be higher than CSI-RS signal power making the CQI 0. With
a third-party gnb that schedules PDSCH based on CQI, the UE never
receives DL DCI once it starts sending CSI reports.
- Add helper function to normalize bitrate values to Mbps for calculations.
- Add helper function to extract data from iperf test report.
- Clean up the UDP analysis function, improve test report formatting.
- Fix an issue where Gbps values were incorrectly reported due to inconsistent
unit parsing.
- Update CI unit test report checks to match the new formatting.
feat(LDPCImplementation.md): Fix documentation
Few ambiguities and outdated names were found in the LDPC documentation
by Vlademir Brusse (see in the devel mailing list).
- Outdated names of the functions of the segment coding interface.
- Ambiguity about loading of the segment coding libraries.
Fix Dedicated BWPs
- Improve SearchSpace selection
- Improve CORESET selection
- Fix fill 'initialDownlinkBWP->pdsch_Config' when there are
DedicatedBWPs
* This fixes the reported 'RSRP = 0' issue when the UE is in the
InitialBWP and we have DedicatedBWPs configured
- Add a 'common' type SearchSpace in the NR_BWP_DownlinkDedicated IE for
DedicatedBWPs
- Fix hardcoded 'controlResourceSetId' by making it dynamic
- Remove 'searchspaceid' from 'verify_agg_levels' function because it
was used only for LOG
- CI: Add DedicatedBWP to '40 MHz TDD F1+E1 SA' in
'RAN-SA-B200-Module-SABOX-Container'
Fix overflow when negating minimum int16_t value in precoding
This closes#955
It prevents undefined behavior caused by the minimum int16_t value
(-32768) in two's complement representation. Because possible negation
by multiplying with -1 during precoding cause an overflows since +32768
cannot be represented in 16-bit signed integers and end up again in
-32768 because of overflow, here reveald by using the SIMD functions.
Workaround we use a slightly smaller number than 1 in Q15 Format to
prevent this error. Q15 representation of (integer value -32767) -1 +
2^-15 = -0.999969482421875
remove specific directory for LTE SIM management tools
This is very old code has never been integrated with the "main" OAI
cmake infrastructure and more recent libraries.
This MR integrates the three binaries for LTE virtual sim management in
the regular build process and log system
Avoid the include gtpv1_u_messages_types.h, as this pulls in e.g., LTE
RRC definitions. The CU-UP load tester integrated in one of the
following commits should be able to build without LTE RRC, if it was for
GTP. Unfortunately, ITTI also pulls in LTE RRC, so it's also somewhat
useless...
Put some forward declarations instead. That also shows that the API is
unnecessarily complex, and would need some cleanup.
Remove sctp from all other targets, since we use sctp::sctp on
SCTP_CLIENT (would fail if it does not exist), and SCTP_CLIENT already
fulfils the SCTP dependency.
- Provide some documentation
- Make cmake keywards and sctp lib name lowercase
- Use standard form of find_package_handle_standard_args()
- Make an imported target sctp::sctp that will fail if being used in
cmake unless defined, which will avoid that "sctp" appears in the
cmake code but is silently discarded
See also:
https://cmake.org/cmake/help/latest/manual/cmake-developer.7.html#a-sample-find-module
Following frequency change in the pipeline, we observed degraded UL channel
conditions resulting in low UL throughput. Increasing attenuation on the gNB
side was found to mitigate this issue by improving UL channel quality
and reducing UL noise power.
Increase tested UL and DL bitrates in OAIUE pipeline.
Tell strncpy() the size including the NULL byte to make sure we copy all
data.
This just fixes these warnings:
openair3/NAS/TOOLS/conf_usim.c: In function ‘gen_usim_data’:
openair3/NAS/TOOLS/conf_usim.c:191:17: warning: ‘strncpy’ output truncated before terminating nul copying as many bytes from a string as its length [-Wstringop-truncation]
openair3/NAS/TOOLS/conf_usim.c:190:53: note: length computed here
openair3/NAS/TOOLS/conf_usim.c:195:17: warning: ‘strncpy’ output truncated before terminating nul copying as many bytes from a string as its length [-Wstringop-truncation]
openair3/NAS/TOOLS/conf_usim.c:194:54: note: length computed here
add copy with limited size and truncate properly with null C string termination.
As clang-format doesn't handle tab indented files and as it is not the
OAI coding rule, the entire file is re-indented with present OAI coding
rule.
Move the path to the beginning, so that we can use it early.
Specifically, it was after the SCTP module, and the next commit will use
the Findsctp.cmake module to find SCTP. Use the cmake-proper variable.
Remove --usim-test command line option
Remove the --usim-test option: to my knowledge, it's not used by users,
and is misleadingly placed in various places where there should not be a
difference w.r.t. USIM configuration.
When making the changes, I assumed that --usim-test would be 0 (the
default), which is the case in all executables when not specified in
options except for the nr_dlsim, nr_pbchsmi, nr_ulsim simulators.
The only exception is the initialization of PDCP from the MAC, which
does not seem to be correct (the PDCP is in the CU, so it does not make
sense to call it from the MAC which is in the DU).
Synchronized Real-Time Data Recording Application Addition
The main Features of Synchronized Real-Time Data Recording Application:
- The Data Recording Application runs in parallel to the gNB or UE
server or in another server as Data Recording or Data Lake Server
- It makes use of (an extended version) of OAI’s T-tracer framework
- It communicates with base station, and user terminal
- It synchronizes and combines data traces and control information
(meta-data) from Base station and User terminal into consistent SigMF
data sets
Details on implementation addition:
- T_tracer Extension to Support up to 35 Parameters in the T() macro
- Add traces on gNB PHY UL and related requirement: FD PUSH IQ, FD DMRS, and UL Channel estimates wi/wo interpolation, and Rx Payload bits:
1. The required memories have been created and initialized in:
openair1/PHY/NR_TRANSPORT/nr_ulsch_demodulation.c
2. Those memories: memory for DMRS signals, memory for channel
estimates based on DMRS positions, memory to store slot grid with
channel coefficients based on DMRS positions after interpolation,
and memory to store extracted data including PUSCH + DMRS.
3. The input parameters to nr_pusch_channel_estimation() has been
updated to get the pointer to the added memories of
pusch_dmrs_slot_mem and pusch_ch_est_dmrs_pos_slot_mem
(openair1/PHY/NR_ESTIMATION/nr_ul_estimation.h)
4. The DMRS grid of NR slot and the estimated channel coefficients at
DMRS locations are logged to created memories in:
openair1/PHY/NR_ESTIMATION/nr_ul_channel_estimation.c
5. The function inner_rx in
openair1/PHY/NR_TRANSPORT/nr_ulsch_demodulation.c is updated to log
the extracted ULSCH PRBs and the interpolated channel coefficients.
6. The T-macro() has been called in
(openair1/PHY/NR_TRANSPORT/nr_ulsch_demodulation.c) to trace added
traces: T_GNB_PHY_UL_FD_DMRS, T_GNB_PHY_UL_FD_CHAN_EST_DMRS_POS,
T_GNB_PHY_UL_FD_PUSCH_IQ, T_GNB_PHY_UL_FD_CHAN_EST_DMRS_INTERPL
- Add traces on UE PHY UL and related requirement: Tx Scrambled bits and Tx payload bits
1. Update input parameters to nr_ulsch_encoding () in
nr_transport_proto_ue.h to get number_dmrs_symbols to be added to
meta-data.
2. In nr_ulsch_coding.c: Trace UE PHY UL Payload TX bits (T_message:
T_UE_PHY_UL_PAYLOAD_TX_BITS) including related meta-data and UTC
time.
3. In nr_ulsch_ue.c: Trace UE PHY UL Scrambled TX bits (T_message:
T_UE_PHY_UL_SCRAMBLED_TX_BITS) including related meta-data and UTC
time.
4. Fix the input prameters in nr_ulsch_encoding () called in
(openair1/SIMULATION/NR_PHY/ulschsim.c) since a new input parameter
has been added.
- Add Data Collection Services (T-Tracers for gNB and UE)
1. Add _tracer_app_gnb and t_tracer_app_ue apps to common/utils/T/tracer/Makefile
2. Add Data collection Service for gNB: common/utils/T/tracer/t_tracer_app_gnb.c
3. Add Data Collection Service for UE: common/utils/T/tracer/t_tracer_app_ue.c
- Add Shared memory configuration
(common/utils/T/tracer/shared_memory_config.h), since we will have too
much memory consumption on the stack if the T-tracer is not fast
enough to process the traces or if we have too much traces. As a
result, tracers start to capture data, write data in shared memory,
then close the T-Tracer after getting the recording of N slots. The
Data recording App will read data from the shared memory.
- Add Main app of Data Recording Application v1.0 including: Config
files, SigMF Interface, Config Interface, Sync Service, and def
messages: The data recording App includes mainly the following files:
1. The main app: data_recording_app_v1.0.py that has the data control
service, interact with tracers, data sync and conversion service.
2. The configuration file:
common/utils/data_recording/config/config_data_recording.json
3. The wireless dictionary file:
common/utils/data_recording/config/wireless_link_parameter_map.yaml
4. Config Interface
(common/utils/data_recording/lib/config_interface.py) that reads
the configuration for both gNB and UE.
5. Sync interface (common/utils/data_recording/lib/sync_service.py)
that sync captured data for gNB and UE before saving them in SigMF
format
6. The SigMF Interface
(common/utils/data_recording/lib/sigmf_interface.py) to store
recorded data and meta-data in SigMF format
7. A simple script
(common/utils/data_recording/sync_validation_demo.py) to validate
that the recorded bits from gNB and UE are in Sync
- For more info look to doc/data_recording.md
The LLR threshold buffers hold only for one symbol but the LLRs are
computed for all symbols together. So only the threshold of last symbol
was used for computing LLR for all other symbols.
This commit calls nr_dlsch_llr for each symbol togther with rest of
nr_rx_pdsch() and calls nr_dlsch_layer_demapping at the last symbol.
Fixes issue 948.
TS 38.213 4.1 says coreset 0 is present only if kssb < 24 for FR1 and <
12 for FR2. This commit sets get_sib1 flag based on kssb.
Also, setting of mac state is taken out of function nr_ue_decode_mib().
After RRCSetup, until RRCReconfigurationComplete, gNB continues to schedule ULSCH using DCIs in a common searchspace.
In theory, the UE should decode DCIs in:
<downlinkBWP-ToAddModList>
<BWP-Downlink>
<bwp-Common>
<pdcch-ConfigCommon>
<setup>
<commonSearchSpaceList>
...
</commonSearchSpaceList>
However, due to the limited amount of time to investigate this issue, the easy way I found to get DCIs decoded in common searchspace of a DedicatedBWP was by adding a common searchspace in the bwp-Dedicated:
<bwp-Dedicated>
<pdcch-Config>
<setup>
<searchSpacesToAddModList>
<SearchSpace>
...
</SearchSpace>
</searchSpacesToAddModList>
This way, let's call it a workaround.
There is a removal of the NR_SearchSpace__searchSpaceType_PR because, at this point, the gNB already selected the searchspace and it calls this function only to find the coreset with controlResourceSetId based on the previously searchspace id selected;
There is no need to send a pointer to the entire searchspace structure because we only need the controlResourceSetId: NR_ControlResourceSetId_t coreset_id = *ss->controlResourceSetId;
It also prevents a segmentation fault, in develop when NR_SearchSpace__searchSpaceType_PR_common because gNB calls sched_ctrl->coreset = get_coreset(nr_mac, scc, bwpd, sched_ctrl->search_space, target_ss); the bwpd is NR_BWP_DownlinkDedicated_t *bwpd = NULL; and is it incompatible with the cast to NR_BWP_Downlink_t in coreset = ((NR_BWP_Downlink_t*)bwp)->bwp_Common->pdcch_ConfigCommon->choice.setup->commonControlResourceSet; this was never noticed until now because gNB barely used NR_SearchSpace__searchSpaceType_PR_common
Integration: `2025.w30`
* !3529 Add CI RFsim5G test for second PDU session
* !3532 Count bits in variable with mask
* !3533 CI: test T2 with DPDK 22.11
* !3535 RAN-Container-Parent: Auto-generate artifact in failure case
* !3542 bugfix: avoid segmentation fault when Redcap tries to connect to gNB
* !3543 rfsimulator: fix model name for channel
* !3540 CI: migrate RFSim4G to acamas machine
See merge request oai/openairinterface5g!3539
Pre-initialize this variable. It should be set in pucch2x_scrambling(),
but the compiler warns with
In function ‘pucch2x_modulation’,
inlined from ‘generate_pucch2x’ at oai/openair1/PHY/LTE_UE_TRANSPORT/pucch_ue.c:425:3:
oai/openair1/PHY/LTE_UE_TRANSPORT/pucch_ue.c:361:18: warning: ‘btilde’ may be used uninitialized [-Wmaybe-uninitialized]
361 | d[i] = btilde[i] == 1 ? -amp : amp;
oai/openair1/PHY/LTE_UE_TRANSPORT/pucch_ue.c: In function ‘generate_pucch2x’:
oai/openair1/PHY/LTE_UE_TRANSPORT/pucch_ue.c:387:11: note: ‘btilde’ declared here
387 | uint8_t btilde[20];
Remove the --usim-test option: to my knowledge, it's not used by users,
and is misleadingly placed in various places where there should not be a
difference w.r.t. USIM configuration.
When making the changes, I assumed that --usim-test would be 0 (the
default), which is the case in all executables when not specified in
options except for the nr_dlsim, nr_pbchsmi, nr_ulsim simulators.
The only exception is the initialization of PDCP from the MAC, which is
not correct (the PDCP is in the CU, so it does not make sense to call it
from the MAC which is in the DU). Instead, always initialize from main,
even in the NSA case (NSA was covered by the incorrect initialization
from MAC).
This in turn let to some more cleanup around function du_rlc_data_req().
After receiving GTP packets at the DU, they were given to the PDCP to
enqueue the packet at RLC. This does not work anymore, since the PDCP is
not initialized; it also does not seem necessary, as this enqueue
functionality is necessary to decouple PDCP and RLC to avoid deadlocks
in monolithic, but in split-mode, this cannot happen. Instead, call
directly into the RLC when receiving GTP packets.
It provides and overview about the Architecture, Requirement Packages,
Configuration Files, How to run Data Recording Application, and an
Overview on Collected Data Set.
The data recording App includes the following files:
- The main app: data_recording_app_v1.0.py that has the data control service, interact with tracers, and data sync and conversion service
- The configuration file: common/utils/data_recording/config/config_data_recording.json
- The wireless dictionary file: common/utils/data_recording/config/wireless_link_parameter_map.yaml
- The SigMF Interface (common/utils/data_recording/lib/sigmf_interface.py) to store recorded data and meta-data in SigMF format
- A simple script (common/utils/data_recording/sync_validation_demo.py) to validate that the recorded bits from gNB and UE are in Sync
- For more info look to doc/data_recording.md
A squashed commit further updates:
- Enhance Data Recording App structure
- Support the new state machine of T-Tracers
- Add new files for Config Interface, sync Service, def of data recording messages, and common utilties
- Make part of logging on Terminal configurable
- Add _tracer_app_gnb and t_tracer_app_ue apps to common/utils/T/tracer/Makefile
- Add Data collection Service for gNB: common/utils/T/tracer/t_tracer_app_gnb.c
- Add Data Collection Service for UE: common/utils/T/tracer/t_tracer_app_ue.c
- Add Shared memory configuration (common/utils/T/tracer/shared_memory_config.h),
since We will have too much memory consumption on the stack if the
T-tracer is not fast enough to process the traces or if we have too
much traces. As a result, tracers start to capture data, write data in
shared memory, then close the T-Tracer after getting the recording of
N slots
- Support the operation of : COnfig, Record, and Stop
- Poll from Socket and not use get_events to mitigate long-time waiting
if there is no data in buffer or the UE is already released or crashed
- Add extra offset to improve data sync
- Update input parameters to nr_ulsch_encoding () in
nr_transport_proto_ue.h to get number_dmrs_symbols to be added to
meta-data.
- In nr_ulsch_coding.c: Trace UE PHY UL Payload TX bits (T_message:
T_UE_PHY_UL_PAYLOAD_TX_BITS) including related meta-data and UTC time.
- In nr_ulsch_ue.c: Trace UE PHY UL Scrambled TX bits (T_message:
T_UE_PHY_UL_SCRAMBLED_TX_BITS) including related meta-data and UTC
time.
- Fix the input prameters in nr_ulsch_encoding () called in
(openair1/SIMULATION/NR_PHY/ulschsim.c) since a new input parameter
has been added.
- The required memories have been created and initialized in:
openair1/PHY/NR_TRANSPORT/nr_ulsch_demodulation.c
- Those memories: memory for DMRS signals, memory for channel estimates
based on DMRS positions, memory to store slot grid with channel
coefficients based on DMRS positions after interpolation, and memory
to store extracted data including PUSCH + DMRS.
- The input parameters to nr_pusch_channel_estimation() has been updated
to get the pointer to the added memories of pusch_dmrs_slot_mem and
pusch_ch_est_dmrs_pos_slot_mem
(openair1/PHY/NR_ESTIMATION/nr_ul_estimation.h)
- The DMRS grid of NR slot and the estimated channel coefficients at
DMRS locations are logged to created memories in:
openair1/PHY/NR_ESTIMATION/nr_ul_channel_estimation.c
- The function inner_rx in
openair1/PHY/NR_TRANSPORT/nr_ulsch_demodulation.c is updated to log
the extracted ULSCH PRBs and the interpolated channel coefficients.
- The T-macro() has been called in
(openair1/PHY/NR_TRANSPORT/nr_ulsch_demodulation.c) to trace added
traces: T_GNB_PHY_UL_FD_DMRS, T_GNB_PHY_UL_FD_CHAN_EST_DMRS_POS,
T_GNB_PHY_UL_FD_PUSCH_IQ, T_GNB_PHY_UL_FD_CHAN_EST_DMRS_INTERPL
bugfix: avoid segmentation fault when Redcap tries to connect to gNB
bugfix: avoid segmentation fault when Redcap tries to connect to gNB
as NR_ServingCellConfig_t scd is NULL when Redcap does RA
RAN-Container-Parent: Auto-generate artifact in failure case
RAN-Container-Parent uses Jenkinsfile-GitLab-Container, which only
triggers sub pipelines, then collects their results. However, if a sub
pipeline did not generate an artifact, the result was skipped. It would
also not show it in the automatically generated result page, when it
should.
Remedy this by automatically generating a file with a link to the
pipeline if the artifact could not be retrieved, which
1. Will give a link, which is easier for developers to follow to the
pipeline than manually clicking through Jenkins,
2. Makes the failed pipeline appear in the list of failed pipelines.
CI: test T2 with DPDK 22.11
Following the upgrade of T2 to the latest firmware, DPDK 22.11 is now required.
This MR updates the testing pipeline to ensure compatibility and deployment of
T2 physims with DPDK 22.11.
bridge->nb_cnx++ is done before calling snprintf(modelname,... in the function,
so we take the model name of the next channel. This commit corrects the issue by
using bridge->nb_cnx - 1, ensuring that the model name corresponds to the currently
connected client.
This bug was introduced by MR !3455.
Co-authored-by: Bartosz Podrygajlo <bartosz.podrygajlo@openairinterface.org>
Co-authored-by: Laurent THOMAS <laurent.thomas@open-cells.com>
RAN-Container-Parent uses Jenkinsfile-GitLab-Container, which only
triggers sub pipelines, then collects their results. However, if a sub
pipeline did not generate an artifact, the result was skipped. It would
also not show it in the automatically generated result page, when it
should.
Remedy this by automatically generating a file with a link to the
pipeline if the artifact could not be retrieved, which
1. Will give a link, which is easier for developers to follow to the
pipeline than manually clicking through Jenkins,
2. Makes the failed pipeline appear in the list of failed pipelines.
Build and run OAI physims with DPDK version 22.11 for testing with the latest
T2 firmware release. Environment variables PKG_CONFIG_PATH and LD_LIBRARY_PATH
are set to point to the custom installation path of DPDK v22.11.
Integration: `2025.w29`
* !3346 Add WLS as a transport option for VNF/PNF, refactor existing options
* !3455 RF simulator: Fix concurrency issues during new client connections
* !3515 Extended changes to "Initial support for RedCap" feature in gNB
* !3510 NR UE: fix PDSCH overlap with ZP CSI-RS case
* !3512 speedup NR RLC RX for AM
* !3528 fix(RLC): Count dropped DL SDUs by the RLC
* !3486 NR UE: Enable additional PDU session
* !3225 Measurement gaps
* !3526 CI: migrate RFSim5G to acamas machine
* !3527 CI: Change RU in Aerial setup from Foxconn to WNC
See merge request oai/openairinterface5g!3525
CI: Change RU in Aerial setup from Foxconn to WNC
- Change frequency in the gNB config file, from 3.75GHz to 3.5GHz
- Add high throughput tests with may_fail tag (1Gbps in DL and 90Mbps in UL)
- Update Aerial tutorial to match the changes
NR UE: Enable additional PDU session
- fix a bug with wraparound of buffer_remain_ep
- Add --extra-pdu-id command line option
Testing procedure:
1. Start cn in openairinterface5g/doc/tutorial_resources/oai-cn5g with
docker compose up
2. Start gnb:
sudo ./nr-softmodem -O ../../targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf --gNBs.[0].min_rxtxtime 6 --rfsim --rfsimulator.server_address server
3. Monitor extra interfaces being created:
watch -n 0.5 "ifconfig | grep tun"
4. Start UE:
sudo ./nr-uesoftmodem -C 3619200000 -r 106 --numerology 1 --ssb 516 --band 78 --rfsim --uicc0.imsi 001010000000001 --extra-pdu-id 11
5. An extra tun interface oaitun_ue1p11 should be created. Observe in
the terminal from step 3
6. Ping the core network from both interfaces, e.g., ping -I
oaitun_ue1p11 10.0.0.1, ping -I oaitun_ue1 10.0.0.1. This should
generate traffic on the gNB on different LCIDs.
Measurement gaps
Scheduling measurement gaps to provide sufficient time for the UE to
re-tune its transceiver to the target carrier, complete the set of
measurements and then re-tune its transceiver back to the original
carrier.
This commit reduces the UL throughput target in the 2x2 test to align
with the host’s performance capabilities. The adjustment ensures more
reliable and consistent CI results.
Based on observations from testing on acamas, the interval between DL
disruption and the UE synch check needs to be increased - the UE takes
longer to go out of sync . A sleep of 15 seconds has proven to be a
reliable value to ensure constant results.
fix(RLC): Count dropped DL SDUs by the RLC
When a downlink SDU was discarded by the RLC Acknowledged Mode entity
due to a full transmit buffer (tx_maxsize), the drop statistics were not
being updated. The txpdu_dd_pkts and txpdu_dd_bytes counters remained at
0. It should be noted that while the statistics are named txpdu_dd_*,
the drop at this stage occurs at the SDU level.
speedup NR RLC RX for AM
rx_list is replaced by an array of size 2^(SN size - 1) which is 131072
for an SN size of 18 bits, leading to 1048576 bytes of memory used.
(Less for smaller SN sizes.)
A lot of RX processing was to run through rx_list. When the list was big
(with some non-ideal channel), it can take some time. Removing this list
should improve things. Checking with benchmark_nr_rlc_am_entity a
speedup of more thant x10 is achieved (except for the case 1024 which is
surprisingly faster than the others in the develop branch).
The only thing that may be slower is when looking for cur->next where
the SN is different, in which case we need to look for all SN one by one
until we find something or reach the limit (rx_highest_status). These
are the functions get_first_rx_pdu() and get_next_rx_pdu().
Add SYS_NICE capability to enable setting thread priority and affinity
in rfsim5g tests. This improves execution speed in test cases with
heavier processing workloads.
When migrating from RHEL (on cacofonix) to Ubuntu 22.04 (on acamas), the `nc`
command needs to be replaced by `ncat`. The version of `nc` available on Ubuntu
is the OpenBSD variant, which lacks support for some options used in our scripts.
`ncat` from the Nmap is used instead.
RF simulator: Fix concurrency issues during new client connections
- Fix concurrency issues happening when a new client connects, sometimes
leading to a total softmodem deadlock.
- trace in 4G RAR processing to debug ci result
Add WLS as a transport option for VNF/PNF, refactor existing options
This MR adds a new transport mechanism for the VNF and PNF split, using
the Intel WLS library, which makes use of DPDK and shared memory to
transport messages. This transport mechanism is what is used to
interface with Radisys ODU, while also working with OAI VNF/PNF.
The VNF and PNF have been refactored so that the transport-specific
functions are isolated from the rest of the logic, and as such,
interchangeable by means of function pointers.
The same change is done for the packing/unpacking procedures, allowing
to switch between FAPI and nFAPI encoding.
This MR also reduces the amount of duplicated code, by refactoring the
VNF with Aerial, which now only has the transport-relevant functions, as
well as the ones that are unique to it ( for example, the unpacking
procedures where a secondary data buffer is used for the message
payloads )
Additionally a new callback is added to the VNF to process
ERROR.indication messages, which currently only indicates which message
originated the error, and which error occurred.
When a downlink SDU was discarded by the RLC Acknowledged Mode entity due to a full transmit buffer (tx_maxsize), the drop statistics were not being updated.
The `txpdu_dd_pkts` and `txpdu_dd_bytes` counters remained at 0.
It should be noted that while the statistics are named `txpdu_dd_*`, the drop at this stage occurs at the SDU level.
Add nr_fapi_p5 library to the simulators common library for access to the utility function `copy_config_request`
Add dummy VNF/PNF functions to be referenced by lte-softmodem, before LTE and NR implementations of the VNF/PNF are separated
Add a section in nfapi.md related to the different transport mechanisms available for VNF/PNF communication
Edit NR_NFAPI_archi.md to describe the VNF and PNF processing logic, as well as adding a flowchart for each of the components execution
Add the necessary patch to install the WLS library in the system
The changes done in this commit are to contribute the supporting changes
for the existing "Initial support for RedCap" feature in gNB.
In this patch, handle and store the RedCap related IE's present in "NR
UE Capability Information" msg which are
- 'supportOfRedCap-r17'
- 'supportOf16DRB-RedCap-r17'
- 'longSN-RedCap-r17'
- 'am-WithLongSN-RedCap-r17'
use 'longSN-RedCap-r17' and 'am-WithLongSN-RedCap-r17' IEs to set the SN
length to either 12 Bit or 18 Bit accordingly.
Previously, we only supported intra-frequency handovers, so the
measurements where only for intra-frequency, reusing the same
measurement object. Now that we would support inter-frequency handover,
also add multiple MeasObjects for each neighbor.
Add some helper functions that will be used by the MAC handler to fill
the right MeasGap configuration based on Measurement Configuration sent
by the CU, in the next commit.
Checks whether there are at least 4 bytes available to pull tag and length values.
On tlv_list unpack, if the size is sent as 0, immediately exit the function
Created a function nr_error_ind_cb for the VNF that takes a received ERROR.indication and shows some details regarding the reported error from the PNF, since up until now it was not handled and treated as an unknown message.
Proper error handling procedure not created, only shows that the error occurred.
Remove duplicated functions in fapi_vnf_p7.c, leaving only functions for messages that require usage of the secondaty data_buf for unpacking
Move vnf_info struct declaration to nfapi_vnf.h to be available in fapi_nvIPC.c
Add check to vnf_nr_handle_param_response for when phy_info is not found
The WLS VNF is in charge of Enqueueing the used blocks after usage for transport, this is done by keeping track of all blocks used, and calling WLS_Enqueue for all of them upon receiving a SLOT.indication
The common library exposes functions for the PNF to return the received blocks to the VNF for it to call WLS_Enqueue on them.
This is done in order to ensure the Blocks are returned after processing, also preventing the Dequeueing of blocks that are still being used, i.e. the internal value is not -1
All saved blocks are to be enqueued at the reception of a SLOT.indication by the VNF
Additionally, the definition of NFAPI_MAX_PACKED_MESSAGE_SIZE was moved to nfapi_interface.h and removed from the other headers, this is done to allow to set the maximum message size when using WLS by only changing the value in one place
Fixup fapi_nr_message_header_unpack call in nfapi_hex_parser
Integration: `2025.w28`
* !3517 CI: set interface name in UPF container for RFSim5G
* !3501 Fix automatic SSS detection logic
* !3503 DLSCH RB extraction: check DMRS bitmap only in DMRS symbols
* !3498 bugfix: UE AMBR is optional
* !3504 Improvements to the FHI for enabling further use cases
Closes#975
See merge request oai/openairinterface5g!3518
Recently f buffer was changed to hold packed bits and the correspoinding
change in dlsim was not done so the number of error bits before decoding
was incorrectly reported. This commit fixes it.
Improvements to the FHI for enabling further use cases
These changes to the FHI were primarily thought to enable the integration of
the intel ACC ( !3344 ) in parallel of the FHI.
I preferred to make a separate MR because I believe this topic is orthogonal
enough to be handled separately and because I wanted to bring even further
improvements.
The improvements that it actually brings are:
- Enable compiling and running xran F release with DPDK 21+
- Enable including a BBDEV device in addition of the ethernet device for the
FHI when performing EAL init, which is necessary for using the intel ACC
with the FHI.
- Fix an issue in usage of pkgconfig in xran E and F release. This enables to
reliably build xran with the version of DPDK requested to pkgconfig while
before this fix xran was always selecting the headers installed in /usr/local.
E release had the same issue of not using pkgconfig properly as F release.
This issue was fixed in F release when enabling its compatibility with DPDK 21+.
This commit brings this fix to E release.
In order to be usable in parallel of FHI 7.2, BBDEV devices should be included in the EAL initialization that is prformed by xran.
This commit adds a way of adding the BBDEV device from OAI.
Also fixes an issue with pkgconfig in xran.
Get xran stats in the trx_oran_get_stats function
and use trx_oran_get_stats upon stopping and ending RF.
Co-authored-by: Romain Beurdouche <romain.beurdouche@eurecom.fr>
Look up xran_fh_init/xran_fh_config through driver instead of peaking
into xran internals. Note that xran writes values back into these
structs during initialization, and hence it is important to store them
_after initialization_.
Some remarks regarding less obvious changes:
- slotnum is replaced by slots_in_sf: SLOTNUM_PER_SUBFRAME uses the time
duration of a slot (=interval_us_local) to calculate the numbers of
slots in a subframe, which can be done with a simple shift instead
- The prach duration should be queried from the PRACH configuration
table. The function to query the occasion info is part of the MAC
layer code while this information can be used outside of this layer.
Use header `nr_prach_config.h` to not duplicate functionality.
Co-authored-by: Romain Beurdouche <romain.beurdouche@eurecom.fr>
Split out type and function definitions for a cleaner separation for
some consumers of these functions. Concretely, nr_mac_common.h includes
various ASN.1 NR RRC headers, but not all consumers of these APIs might
need these headers. For instance, the next commit will use these
functions in the driver for 7.2 (it needs to compute PRACH length), but
the driver itself does not depend on nor does it need the ASN.1 NR RRC
headers. Defining a new header avoids the problem.
bugfix: UE AMBR is optional
This was a problem with open5gs and more than one PDU session. The core network
sets UE AMBR only once, leading to failure in the gNB for the second PDU session.
(A proper handling of AMBR has to be develop at some point in the gNB.)
The buffers are set up by the OAI xran driver, so instead of peaking
into xran internal data, access the buffers through the driver directly.
The buffers get set up through the following xran calls
In xran_5g_fronthault_config():
- src => sFrontHaulTxBbuIoBufCtrl
- srccp => sFrontHaulTxPrbMapBbuIoBufCtrl
- dst => sFrontHaulRxBbuIoBufCtrl
- dstcp => sFrontHaulRxPrbMapBbuIoBufCtrl
In xran_5g_prach_req()
- prach(dst) => sFHPrachRxBbuIoBufCtrl
- prach(dst)decomp => sFHPrachRxBbuIoBufCtrlDecomp
Note that in all cases:
- the xran buffer array is [XRAN_N_FE_BUF_LEN][XRAN_MAX_SECTOR_NR][XRAN_MAX_ANTENNA_NR]
(of [internal] type BbuIoBufCtrlStruct, but we give an sBufferList)
- the driver buffer array is [XRAN_MAX_ANTENNA_NR][XRAN_N_FE_BUF_LEN]
Hence, we switch the order of indexing, leave out the sector, and omit
the sBufferList member.
xran_get_slot_idx_from_tti() has been introduced to access data
information from xran. However, it makes no sense, as the used macros to
calculate frame, slot, subframe, are already in the public API. Hence,
use these macros directly.
It would be possible to remove xran_get_slot_idx_from_tti(), but doing
so we would need to update the patch ID, causing trouble to users.
CI: set interface name in UPF container for RFSim5G
This MR addresses an issue related to CN deployment, observed in the RFSim5G CI pipeline. Specifically, the IP addresses within the UPF container were not consistently bound to the correct network interfaces. This inconsistency led to incorrect IP address assignments for the N3, N4, and N6 interfaces, resulting in connectivity issues.
See merge request oai/openairinterface5g!3517
Fix automatic SSS detection logic
When we try to detect a specific PCI and it fails, the SSS detection returns
successful detection with wrong frequency offset.
This was a problem with open5gs and more than one PDU session.
The core network sets UE AMBR only once, leading to failure in the gNB
for the second PDU session.
(A proper handling of AMBR has to be develop at some point in the gNB.)
Integration: `2025.w27`
Closes#958
See merge request oai/openairinterface5g!3506
* !3349 Speed up docker deployment in CI
* !3360 NR UE: fix reestablishment for NTN
* !3488 Refactor F1 UE context messages, add unit tests
* !3502 bugfix for UL TBSLBRM
* !3475 Use of common functions to prepare FAPI PDUs at gNB MAC
* !3499 NR UE: enable CSI report for SISO case
* !3497 Update/refine gNB MAC stats, update L1
* remove unit test `--output-on-failure` option to avoid hitting timeout
* !3508 gNB: fix NTN UL retransmissions
* !3494 bugfix: read msg_type only after deciphering
* set `tx_amp_backoff_dB = 30;` for RFsim 2x2 to make it pass
* !3432 NR RRC Reject UE
* !3500 Various fixes for UE handling, HO doc updates
* !3398 continuously update SIB19 information for rfsim NTN LEO scenarios
continuously update SIB19 information for rfsim NTN LEO scenarios
Contains mainly these changes:
- gNB: add function nr_update_sib19() allowing to update SIB19
information
- rfsimulator: update SIB19 contents every frame for LEO channel
simulations
- NR UE: improve initial timing advance calculation from SIB19
Before, we only considered ta_Common_r17 and the SAT position from SIB19
to compute the initial timing advance value. This is good enough if the
satellite does not move too fast (e.g. GEO satellite).
Now we also consider ta_CommonDrift_r17, ta_CommonDriftVariant_r17 and
the SAT velocity together with the epoch time from SIB19. This improves
the accuracy of the initial TA computation, esp. for LEO satellite
scenarios.
Various fixes for UE handling, HO doc updates
- On release request, search both attach and connected list to free a UE.
- on DU disconnect, only release the correspnonding UE contexts.
- When no AMF for the UE, auto-release the UE (NGAP would also send an
answer, but better check first)
- implement a "grace period" before the DU/MAC automatically releases a
UE: this is to avoid cases in which (for whatever reason) the UE
release request is not honored by the CU. In order to not fill up UE
contexts unnecessarily, the DU will eventually (after 10s) drop the UE
context
- some clarification in HO tutorial
When the RA procedure fails at Msg4, we trigger UL failure and send a
message to the CU to request release. There was a bug in that upon the
ensueing release command, we did not search in the attach list (only
connected list). However, the UE failing at Msg4 does not have
transitioned to the connected list yet, thus not freeing the context.
Fixes: 8f62baefa6 ("Use list of UEs during RA instead of array of RA
processes)"
It might happen that the CU does not answer a release request. In that
case, the MAC would never free the UE context, potentially blocking the
DU. Avoid this by introducing a "grace period" after which a UE context
is automatically freed at the MAC (and RLC), currently at 10s after the
30s UL failure timer.
Mark non-existing AMF UE NGAP ID through invalid INT64_MAX number
(permitted range is up to 2^40-1). Check for this range in the RAN
function, as we might otherwise pass the invalid AMF UE NGAP ID to the
agent, which would assert with
nr-softmodem: /oai-ran/openair2/E2AP/flexric/src/lib/3gpp/enc/enc_gnb.c:83: enc_gNB_UE_asn: Assertion `gnb->amf_ue_ngap_id < 1UL << 40' failed.
In other words, don't send KPM messages for a UE which has no valid AMF
UE NGAP ID yet (which follows from the fact that the spec requires an
AMF UE NGAP ID; the previous behavior of simply sending 0 could be
considered a bug, because it's not the UE's true AMF UE NGAP ID).
rx_list is replaced by an array of size 2^(SN size - 1)
which is 131072 for an SN size of 18 bits, leading to
1048576 bytes of memory used. (Less for smaller SN sizes.)
A lot of RX processing was to run through rx_list. When the list was
big (with some non-ideal channel), it can take some time. Removing this
list should improve things. Checking with benchmark_nr_rlc_am_entity
a speedup of more thant x10 is achieved (except for the case 1024 which
is surprisingly faster than the others in the develop branch).
The only thing that may be slower is when looking for cur->next where
the SN is different, in which case we need to look for all SN one by
one until we find something or reach the limit (rx_highest_status).
These are the functions get_first_rx_pdu() and get_next_rx_pdu().
NR RRC Reject UE
Improvements in procedures to handle RRCReject message both at gNB and
UE. At gNB we send RRC Reject if the UE cannot be given resources to go
into connected mode.
bugfix: read msg_type only after deciphering
There was a problem with accessing msg_type from the input buffer before
deciphering, giving obviously wrong value.
CI team: we should add a test in the CI with NAS ciphering + integrity
(connection to the core) set to not null (I suggest nea2/nia2). With
openair's core, this is done by setting this in the amf config file
(nia1 and nea2 at the top of the list):
supported_integrity_algorithms:
- "NIA2"
- "NIA1"
- "NIA0"
supported_encryption_algorithms:
- "NEA2"
- "NEA1"
- "NEA0"
And also put full security in the AS. This is done with this in the gnb
config file:
security = {
ciphering_algorithms = ( "nea2", "nea0" );
integrity_algorithms = ( "nia2", "nia1", "nia0" );
drb_ciphering = "yes";
drb_integrity = "yes"
};
Ideally we should test this with both openair UE and cots UE. But as a
strict minimum do for openair UE (this is where the bug was).
No need to do much traffic, a few ping is enough. But if you want to
check throughput with full security, why not.
Remove this option: some tests produce an excessive amount of output on
failure (e.g., googletest/benchmark). This seems to overwhelm the Python
CI code. Suppress this output, because we can always manually run this
test. A high-level "this test is ok/nok" should be fine for the CI.
NR UE: enable CSI report for SISO case
Correct precoded_sinr_dB wrongly set to 0 for SISO case, also correct
ri_restriction is 0 when calculating CQI bit length for SISO.
Update/refine gNB MAC stats, update L1
Only applicable with -q option.
Print a number of statistics, e.g., rx_ulsch_sdu to track UL MAC stats
timing. Remove unused time_meas_t definitions, and fix the name for the
total gNB scheduler time.
Print the RU stats in nrL1_stats.log, as some are already there, and do
not "pollute" the periodic logs when -q is enabled.
I used this to see why there are sometimes late slots with Aerial. I
used the above stats to get a general overview. This additional patch
shows that at least in RFsim, the RLC indication in rx ulsch sdu can
take up to 20us on my machine. Given that we can have multiple PDUs in
UL (10?), this can amount to a sizeable amount of time. While this is
for another MR, I thought the cleanup would be nice to have.
Do not pollute periodic output, and rather print those into
nrL1_stats.log. A number of them are already there anyway, so transfer
the rest. Note: ru->ifdevice.tx_fhaul is omitted, as we don't have any
IF5 split in 5G.
Refactor F1 UE context messages, add unit tests
Add encoder+decoder+util functions for F1 UE context messages, and use
them in the stack. The overall goal is to unit test encoder+decoder (to
be sure that what we send is what we receive), and remove any memory
leaks related to F1 handling. Messages that have a unit test:
- F1 UE context setup request/response
- F1 UE context modification request/response
- F1 UE context release request/command/complete
This MR removes almost all remaining memory leaks that are observable in
a "standard" configuration, running SISO in RFsim. In RFsim (without
channel modelling), there are only two memory leaks shown in asan, one
in L1, and one in NGAP.
Speed up docker deployment in CI
- Using docker compose up --wait instead of a custom healthcheck script:
from: https://docs.docker.com/reference/cli/docker/compose/up/
--wait Wait for services to be running|healthy. Implies detached mode.
--wait-timeout Maximum duration in seconds to wait for the project to be running|healthy
- Speeding up the healthchecks by reducing the interval from 1-10s to
0.5s during start period
start_period creates a special period after the start of the container
where the healthcheck is executed every start_interval . During this
time the failures do not count towards the retries counter, but
successes change the status to healthy. This allows container to reach
healthy status much sooner.
- Using init: true to speed up docker compose down/stop
`init: true` initializes the docker container with tini or
alternative: tini is used to collect all the processes and correctly
pass the termination signal to them. This allows the docker container
to be stopped without waiting 10 seconds to kill the container
- Smallest example of this is:
services:
test-init:
image: ubuntu:jammy
command: sleep 10d
Fix concurrency issues happening when a new client connects, sometimes
leading to a total softmodem deadlock.
Key changes:
- Fix sample sending on new client connection: send the first
sample only to the newly connected client.
- Remove the --rfsimulator.hanging-workaround option
- Replace global nb_ue and Sockmutex with nb_cnx and Sockmutex
in rfsimulator_state_t for better concurrency and clarity.
We use the same resource for CSI meas report and RSRP (judging by the
name of the functions), but the memory allocations need to be separate
to avoid a double free:
==2063066==ERROR: AddressSanitizer: heap-use-after-free on address 0x7c27d43e3ce8 at pc 0x000000fcd279 bp 0x7be7cc9e7120 sp 0x7be7cc9e7118
READ of size 8 at 0x7c27d43e3ce8 thread T6
#0 0x000000fcd278 in SEQUENCE_free /home/richie/w/f1-refactor-ue-context/build/openair2/RRC/LTE/MESSAGES/constr_SEQUENCE.c:97
#1 0x000000fcd278 in SEQUENCE_free /home/richie/w/f1-refactor-ue-context/build/openair2/RRC/LTE/MESSAGES/constr_SEQUENCE.c:69
#2 0x000000fd6249 in SET_OF_free /home/richie/w/f1-refactor-ue-context/build/openair2/RRC/LTE/MESSAGES/constr_SET_OF.c:236
#3 0x000000fd6249 in SET_OF_free /home/richie/w/f1-refactor-ue-context/build/openair2/RRC/LTE/MESSAGES/constr_SET_OF.c:220
#4 0x000000fcd103 in SEQUENCE_free /home/richie/w/f1-refactor-ue-context/build/openair2/RRC/LTE/MESSAGES/constr_SEQUENCE.c:91
#5 0x000000fcd103 in SEQUENCE_free /home/richie/w/f1-refactor-ue-context/build/openair2/RRC/LTE/MESSAGES/constr_SEQUENCE.c:69
#6 0x000000fc90c9 in CHOICE_free /home/richie/w/f1-refactor-ue-context/build/openair2/RRC/LTE/MESSAGES/constr_CHOICE.c:185
#7 0x000000fc90c9 in CHOICE_free /home/richie/w/f1-refactor-ue-context/build/openair2/RRC/LTE/MESSAGES/constr_CHOICE.c:158
#8 0x000000fcd103 in SEQUENCE_free /home/richie/w/f1-refactor-ue-context/build/openair2/RRC/LTE/MESSAGES/constr_SEQUENCE.c:91
#9 0x000000fcd103 in SEQUENCE_free /home/richie/w/f1-refactor-ue-context/build/openair2/RRC/LTE/MESSAGES/constr_SEQUENCE.c:69
#10 0x000000fd6249 in SET_OF_free /home/richie/w/f1-refactor-ue-context/build/openair2/RRC/LTE/MESSAGES/constr_SET_OF.c:236
#11 0x000000fd6249 in SET_OF_free /home/richie/w/f1-refactor-ue-context/build/openair2/RRC/LTE/MESSAGES/constr_SET_OF.c:220
#12 0x000000fcd01a in SEQUENCE_free /home/richie/w/f1-refactor-ue-context/build/openair2/RRC/LTE/MESSAGES/constr_SEQUENCE.c:88
#13 0x000000fcd01a in SEQUENCE_free /home/richie/w/f1-refactor-ue-context/build/openair2/RRC/LTE/MESSAGES/constr_SEQUENCE.c:69
#14 0x000000fc90c9 in CHOICE_free /home/richie/w/f1-refactor-ue-context/build/openair2/RRC/LTE/MESSAGES/constr_CHOICE.c:185
#15 0x000000fc90c9 in CHOICE_free /home/richie/w/f1-refactor-ue-context/build/openair2/RRC/LTE/MESSAGES/constr_CHOICE.c:158
#16 0x000000fcd01a in SEQUENCE_free /home/richie/w/f1-refactor-ue-context/build/openair2/RRC/LTE/MESSAGES/constr_SEQUENCE.c:88
#17 0x000000fcd01a in SEQUENCE_free /home/richie/w/f1-refactor-ue-context/build/openair2/RRC/LTE/MESSAGES/constr_SEQUENCE.c:69
#18 0x000000fcd01a in SEQUENCE_free /home/richie/w/f1-refactor-ue-context/build/openair2/RRC/LTE/MESSAGES/constr_SEQUENCE.c:88
#19 0x000000fcd01a in SEQUENCE_free /home/richie/w/f1-refactor-ue-context/build/openair2/RRC/LTE/MESSAGES/constr_SEQUENCE.c:69
#20 0x000000fcd01a in SEQUENCE_free /home/richie/w/f1-refactor-ue-context/build/openair2/RRC/LTE/MESSAGES/constr_SEQUENCE.c:88
#21 0x000000fcd01a in SEQUENCE_free /home/richie/w/f1-refactor-ue-context/build/openair2/RRC/LTE/MESSAGES/constr_SEQUENCE.c:69
#22 0x0000009d78ae in ue_context_setup_request /home/richie/w/f1-refactor-ue-context/openair2/LAYER2/NR_MAC_gNB/mac_rrc_dl_handler.c:692
#23 0x00000083fee2 in rrc_add_nsa_user /home/richie/w/f1-refactor-ue-context/openair2/RRC/NR/rrc_gNB_nsa.c:330
#24 0x000000886e8b in rrc_gNB_process_f1_setup_req /home/richie/w/f1-refactor-ue-context/openair2/RRC/NR/rrc_gNB_du.c:444
#25 0x000000833942 in rrc_gnb_task /home/richie/w/f1-refactor-ue-context/openair2/RRC/NR/rrc_gNB.c:2766
#26 0x7fe7d5e28ee5 in asan_thread_start(void*) (/lib64/libasan.so.8+0x28ee5) (BuildId: 7f1aa7e2e600e8c9d54ce6e3d36f3d31bfe7949a)
#27 0x7fe7d527f1d3 in start_thread (/lib64/libc.so.6+0x711d3) (BuildId: 2b3c02fe7e4d3811767175b6f323692a10a4e116)
#28 0x7fe7d5301ceb in __GI___clone3 (/lib64/libc.so.6+0xf3ceb) (BuildId: 2b3c02fe7e4d3811767175b6f323692a10a4e116)
0x7c27d43e3ce8 is located 24 bytes inside of 40-byte region [0x7c27d43e3cd0,0x7c27d43e3cf8)
freed by thread T6 here:
#0 0x7fe7d5ee5bcb in free.part.0 (/lib64/libasan.so.8+0xe5bcb) (BuildId: 7f1aa7e2e600e8c9d54ce6e3d36f3d31bfe7949a)
#1 0x000000fd6249 in SET_OF_free /home/richie/w/f1-refactor-ue-context/build/openair2/RRC/LTE/MESSAGES/constr_SET_OF.c:236
#2 0x000000fd6249 in SET_OF_free /home/richie/w/f1-refactor-ue-context/build/openair2/RRC/LTE/MESSAGES/constr_SET_OF.c:220
#3 0x000000fcd103 in SEQUENCE_free /home/richie/w/f1-refactor-ue-context/build/openair2/RRC/LTE/MESSAGES/constr_SEQUENCE.c:91
#4 0x000000fcd103 in SEQUENCE_free /home/richie/w/f1-refactor-ue-context/build/openair2/RRC/LTE/MESSAGES/constr_SEQUENCE.c:69
#5 0x000000fc90c9 in CHOICE_free /home/richie/w/f1-refactor-ue-context/build/openair2/RRC/LTE/MESSAGES/constr_CHOICE.c:185
#6 0x000000fc90c9 in CHOICE_free /home/richie/w/f1-refactor-ue-context/build/openair2/RRC/LTE/MESSAGES/constr_CHOICE.c:158
#7 0x000000fcd103 in SEQUENCE_free /home/richie/w/f1-refactor-ue-context/build/openair2/RRC/LTE/MESSAGES/constr_SEQUENCE.c:91
#8 0x000000fcd103 in SEQUENCE_free /home/richie/w/f1-refactor-ue-context/build/openair2/RRC/LTE/MESSAGES/constr_SEQUENCE.c:69
#9 0x000000fd6249 in SET_OF_free /home/richie/w/f1-refactor-ue-context/build/openair2/RRC/LTE/MESSAGES/constr_SET_OF.c:236
#10 0x000000fd6249 in SET_OF_free /home/richie/w/f1-refactor-ue-context/build/openair2/RRC/LTE/MESSAGES/constr_SET_OF.c:220
#11 0x000000fcd01a in SEQUENCE_free /home/richie/w/f1-refactor-ue-context/build/openair2/RRC/LTE/MESSAGES/constr_SEQUENCE.c:88
#12 0x000000fcd01a in SEQUENCE_free /home/richie/w/f1-refactor-ue-context/build/openair2/RRC/LTE/MESSAGES/constr_SEQUENCE.c:69
#13 0x000000fc90c9 in CHOICE_free /home/richie/w/f1-refactor-ue-context/build/openair2/RRC/LTE/MESSAGES/constr_CHOICE.c:185
#14 0x000000fc90c9 in CHOICE_free /home/richie/w/f1-refactor-ue-context/build/openair2/RRC/LTE/MESSAGES/constr_CHOICE.c:158
#15 0x000000fcd01a in SEQUENCE_free /home/richie/w/f1-refactor-ue-context/build/openair2/RRC/LTE/MESSAGES/constr_SEQUENCE.c:88
#16 0x000000fcd01a in SEQUENCE_free /home/richie/w/f1-refactor-ue-context/build/openair2/RRC/LTE/MESSAGES/constr_SEQUENCE.c:69
#17 0x000000fcd01a in SEQUENCE_free /home/richie/w/f1-refactor-ue-context/build/openair2/RRC/LTE/MESSAGES/constr_SEQUENCE.c:88
#18 0x000000fcd01a in SEQUENCE_free /home/richie/w/f1-refactor-ue-context/build/openair2/RRC/LTE/MESSAGES/constr_SEQUENCE.c:69
#19 0x000000fcd01a in SEQUENCE_free /home/richie/w/f1-refactor-ue-context/build/openair2/RRC/LTE/MESSAGES/constr_SEQUENCE.c:88
#20 0x000000fcd01a in SEQUENCE_free /home/richie/w/f1-refactor-ue-context/build/openair2/RRC/LTE/MESSAGES/constr_SEQUENCE.c:69
#21 0x0000009d78ae in ue_context_setup_request /home/richie/w/f1-refactor-ue-context/openair2/LAYER2/NR_MAC_gNB/mac_rrc_dl_handler.c:692
#22 0x00000083fee2 in rrc_add_nsa_user /home/richie/w/f1-refactor-ue-context/openair2/RRC/NR/rrc_gNB_nsa.c:330
#23 0x000000886e8b in rrc_gNB_process_f1_setup_req /home/richie/w/f1-refactor-ue-context/openair2/RRC/NR/rrc_gNB_du.c:444
#24 0x000000833942 in rrc_gnb_task /home/richie/w/f1-refactor-ue-context/openair2/RRC/NR/rrc_gNB.c:2766
#25 0x7fe7d5e28ee5 in asan_thread_start(void*) (/lib64/libasan.so.8+0x28ee5) (BuildId: 7f1aa7e2e600e8c9d54ce6e3d36f3d31bfe7949a)
previously allocated by thread T6 here:
#0 0x7fe7d5ee6883 in calloc (/lib64/libasan.so.8+0xe6883) (BuildId: 7f1aa7e2e600e8c9d54ce6e3d36f3d31bfe7949a)
#1 0x000000a1ac53 in get_default_secondaryCellGroup /home/richie/w/f1-refactor-ue-context/openair2/LAYER2/NR_MAC_gNB/nr_radio_config.c:3969
#2 0x0000009d8913 in create_new_UE /home/richie/w/f1-refactor-ue-context/openair2/LAYER2/NR_MAC_gNB/mac_rrc_dl_handler.c:571
#3 0x0000009d8913 in ue_context_setup_request /home/richie/w/f1-refactor-ue-context/openair2/LAYER2/NR_MAC_gNB/mac_rrc_dl_handler.c:638
#4 0x00000083fee2 in rrc_add_nsa_user /home/richie/w/f1-refactor-ue-context/openair2/RRC/NR/rrc_gNB_nsa.c:330
#5 0x000000886e8b in rrc_gNB_process_f1_setup_req /home/richie/w/f1-refactor-ue-context/openair2/RRC/NR/rrc_gNB_du.c:444
#6 0x000000833942 in rrc_gnb_task /home/richie/w/f1-refactor-ue-context/openair2/RRC/NR/rrc_gNB.c:2766
#7 0x7fe7d5e28ee5 in asan_thread_start(void*) (/lib64/libasan.so.8+0x28ee5) (BuildId: 7f1aa7e2e600e8c9d54ce6e3d36f3d31bfe7949a)
Thread T6 created by T0 here:
#0 0x7fe7d5ede492 in pthread_create (/lib64/libasan.so.8+0xde492) (BuildId: 7f1aa7e2e600e8c9d54ce6e3d36f3d31bfe7949a)
#1 0x0000012a4ba3 in threadCreate /home/richie/w/f1-refactor-ue-context/common/utils/system.c:283
#2 0x0000006b5fef in itti_create_task /home/richie/w/f1-refactor-ue-context/common/utils/ocp_itti/intertask_interface.cpp:317
#3 0x000000435c5f in create_gNB_tasks /home/richie/w/f1-refactor-ue-context/executables/nr-softmodem.c:310
#4 0x000000435c5f in main /home/richie/w/f1-refactor-ue-context/executables/nr-softmodem.c:620
#5 0x7fe7d52115f4 in __libc_start_call_main (/lib64/libc.so.6+0x35f4) (BuildId: 2b3c02fe7e4d3811767175b6f323692a10a4e116)
#6 0x7fe7d52116a7 in __libc_start_main@@GLIBC_2.34 (/lib64/libc.so.6+0x36a7) (BuildId: 2b3c02fe7e4d3811767175b6f323692a10a4e116)
#7 0x0000004672d4 in _start (/home/richie/w/f1-refactor-ue-context/build/nr-softmodem+0x4672d4) (BuildId: 81450e9a0b832ca9e36b1984ecc232efde59d424)
Closes: #958
Direct leak of 512 byte(s) in 1 object(s) allocated from:
#0 0x7f37634e5e2b in realloc.part.0 (/lib64/libasan.so.8+0xe5e2b) (BuildId: 7f1aa7e2e600e8c9d54ce6e3d36f3d31bfe7949a)
#1 0x000000fbb9ad in encode_dyn_cb /home/richie/w/f1-refactor-ue-context/build/openair2/RRC/LTE/MESSAGES/per_encoder.c:23
#2 0x000000fc279e in asn_put_few_bits /home/richie/w/f1-refactor-ue-context/build/openair2/RRC/LTE/MESSAGES/asn_bit_data.c:220
#3 0x000000fc279e in asn_put_few_bits /home/richie/w/f1-refactor-ue-context/build/openair2/RRC/LTE/MESSAGES/asn_bit_data.c:192
#4 0x000000fc2ce5 in asn_put_many_bits /home/richie/w/f1-refactor-ue-context/build/openair2/RRC/LTE/MESSAGES/asn_bit_data.c:293
#5 0x000000fb8c33 in OCTET_STRING_encode_uper /home/richie/w/f1-refactor-ue-context/build/openair2/RRC/LTE/MESSAGES/OCTET_STRING_uper.c:306
#6 0x000000fd191a in SEQUENCE_encode_uper /home/richie/w/f1-refactor-ue-context/build/openair2/RRC/LTE/MESSAGES/constr_SEQUENCE_uper.c:403
#7 0x000000fd191a in SEQUENCE_encode_uper /home/richie/w/f1-refactor-ue-context/build/openair2/RRC/LTE/MESSAGES/constr_SEQUENCE_uper.c:403
#8 0x000000fcb140 in CHOICE_encode_uper /home/richie/w/f1-refactor-ue-context/build/openair2/RRC/LTE/MESSAGES/constr_CHOICE_uper.c:177
#9 0x000000fd191a in SEQUENCE_encode_uper /home/richie/w/f1-refactor-ue-context/build/openair2/RRC/LTE/MESSAGES/constr_SEQUENCE_uper.c:403
#10 0x000000fcb140 in CHOICE_encode_uper /home/richie/w/f1-refactor-ue-context/build/openair2/RRC/LTE/MESSAGES/constr_CHOICE_uper.c:177
#11 0x000000fcb140 in CHOICE_encode_uper /home/richie/w/f1-refactor-ue-context/build/openair2/RRC/LTE/MESSAGES/constr_CHOICE_uper.c:177
#12 0x000000fd191a in SEQUENCE_encode_uper /home/richie/w/f1-refactor-ue-context/build/openair2/RRC/LTE/MESSAGES/constr_SEQUENCE_uper.c:403
#13 0x000000fbc1ed in uper_encode /home/richie/w/f1-refactor-ue-context/build/openair2/RRC/LTE/MESSAGES/uper_encoder.c:27
#14 0x000000fbc73a in uper_encode_to_new_buffer /home/richie/w/f1-refactor-ue-context/build/openair2/RRC/LTE/MESSAGES/uper_encoder.c:85
#15 0x000000e10fbd in do_RRCReconfiguration /home/richie/w/f1-refactor-ue-context/openair2/RRC/NR/MESSAGES/asn1_msg.c:586
#16 0x000000805712 in rrc_gNB_encode_RRCReconfiguration /home/richie/w/f1-refactor-ue-context/openair2/RRC/NR/rrc_gNB.c:652
#17 0x000000893860 in nr_rrc_f1_ho_acknowledge /home/richie/w/f1-refactor-ue-context/openair2/RRC/NR/rrc_gNB_mobility.c:280
#18 0x0000008079ac in rrc_CU_process_ue_context_setup_response /home/richie/w/f1-refactor-ue-context/openair2/RRC/NR/rrc_gNB.c:2139
#19 0x0000008330d8 in rrc_gnb_task /home/richie/w/f1-refactor-ue-context/openair2/RRC/NR/rrc_gNB.c:2771
#20 0x7f3763428ee5 in asan_thread_start(void*) (/lib64/libasan.so.8+0x28ee5) (BuildId: 7f1aa7e2e600e8c9d54ce6e3d36f3d31bfe7949a)
During refactoring, I had asan errors in the next line. It took me some
time to figure out that a DRB ID 0 is not valid (cf.
get_next_available_drb_id() and get_drb(), they enforce this).
Direct leak of 48 byte(s) in 1 object(s) allocated from:
#0 0x7fea71ee6f0b in malloc (/lib64/libasan.so.8+0xe6f0b) (BuildId: 7f1aa7e2e600e8c9d54ce6e3d36f3d31bfe7949a)
#1 0x0000007f29c0 in malloc_or_fail /home/richie/w/f1-refactor-ue-context/common/utils/utils.h:86
#2 0x0000007f29c0 in cuup_notify_reestablishment /home/richie/w/f1-refactor-ue-context/openair2/RRC/NR/rrc_gNB.c:872
#3 0x000000808002 in rrc_CU_process_ue_context_setup_response /home/richie/w/f1-refactor-ue-context/openair2/RRC/NR/rrc_gNB.c:2126
#4 0x0000008330d8 in rrc_gnb_task /home/richie/w/f1-refactor-ue-context/openair2/RRC/NR/rrc_gNB.c:2770
#5 0x7fea71e28ee5 in asan_thread_start(void*) (/lib64/libasan.so.8+0x28ee5) (BuildId: 7f1aa7e2e600e8c9d54ce6e3d36f3d31bfe7949a)
Direct leak of 32 byte(s) in 1 object(s) allocated from:
#0 0x7f672d6e5e2b in realloc.part.0 (/lib64/libasan.so.8+0xe5e2b) (BuildId: 7f1aa7e2e600e8c9d54ce6e3d36f3d31bfe7949a)
#1 0x000000fbb4ed in encode_dyn_cb /home/richie/w/f1-refactor-ue-context/build/openair2/RRC/LTE/MESSAGES/per_encoder.c:23
#2 0x000000fbbeeb in _uper_encode_flush_outp /home/richie/w/f1-refactor-ue-context/build/openair2/RRC/LTE/MESSAGES/uper_encoder.c:126
#3 0x000000fbbeeb in uper_encode /home/richie/w/f1-refactor-ue-context/build/openair2/RRC/LTE/MESSAGES/uper_encoder.c:36
#4 0x000000fbc27a in uper_encode_to_new_buffer /home/richie/w/f1-refactor-ue-context/build/openair2/RRC/LTE/MESSAGES/uper_encoder.c:85
#5 0x00000081037c in handle_ueCapabilityInformation /home/richie/w/f1-refactor-ue-context/openair2/RRC/NR/rrc_gNB.c:1549
#6 0x000000813ced in rrc_gNB_decode_dcch /home/richie/w/f1-refactor-ue-context/openair2/RRC/NR/rrc_gNB.c:1902
#7 0x0000008334f2 in rrc_gnb_task /home/richie/w/f1-refactor-ue-context/openair2/RRC/NR/rrc_gNB.c:2741
#8 0x7f672d628ee5 in asan_thread_start(void*) (/lib64/libasan.so.8+0x28ee5) (BuildId: 7f1aa7e2e600e8c9d54ce6e3d36f3d31bfe7949a)
Move the filling of DRBs to set up for UE context setup/modification
request into the corresponding functions, and use malloc() deliberately
to avoid memory leaks. In fact fill_drb_to_be_setup_from_e1_resp()
allocates memory dynamically (and has to do that), so the easiest is to
do the same for DRBs. The most straight-forward way seems to be to then
dynamically allocate all memory for F1 UE context setup/modification
request messages, and free with the corresponding free functions,
which removes a couple of memory leaks.
Similarly to the commit "Use F1 UE context setup/modif Request in
stack", we do both UE context setup/modification response at once
because of some functions that are shared by the MAC message handler.
Use the new, tested F1 UE context setup request and modification
requests in the stack.
We have to do both at once, because there are some functions that are
used by handlers for both messages, notably
- handle_ue_context_drbs_setup()
- handle_ue_context_srbs_setup()
(+ and some functions called by those two). For instance, the first uses
the (new/old) type f1ap_drb_to_be_setup_t/f1ap_drb_to_setup_t which is
shared. The alternative would be to duplicate the functionality
temporarily, and I want to avoid unnecessary code churn.
Reintroduce separate message types to simplify the encoding/decoding,
including shorter names. The old types will be removed once everything
has been migrated to the new encoder/decoder, which should ensure that
everything is properly migrated to the unit-tested encoder/decoders.
Also, for each type of F1 message (F1 UE context setup request,
response, modification request, ...) introduce a separate type to avoid
to mistakenly use wrong fields, which can lead to bugs. In this regard,
the DL PDCP SN bit size in the DRB-ToBeSetup list of the UE context
setup request is optional, as it will also be used in the UE context
modification request DRB SetupMod list (which avoids quite some code
duplication). The encoder checks that this IE is present, though.
The previous condition was wrong: if a UE did not have the assoc_id of
the DU that connected (i.e., it was connected to another DU then the one
disconnecting), it was marked for deletion. Instead, skip those UEs.
This modification aims to improve health status detection by using PRACH IO as
an indicator of the gNB's status (container is marked as "healthy" when the
PRACH IO value in gNB nrL1_stats.log exceeds 0.0 dB.). The new condition accounts
for scenarios where the container may not exit or produce error codes (e.g.,
“sleep” logs or "error code overflow" messages).
- `init: true` initializes the docker container with tini or alternative - it is
used to collect all the processes and correctly pass the termination signal to
them, this allows the docker container to be stopped without waiting 10 seconds
to kill the container
- speeding up the healthchecks by reducing the interval from 1-10s to 0.5s during
start period
Co-authored-by: Bartosz Podrygajlo <bartosz.podrygajlo@openairinterface.org>
F1AP_LIB_FIND_IE() is used to look up elements in a list, but was
hitherto hardcoded to use "protocolIEs" as an intermediate struct. A
follow-up commit will use this macro where we don't have protocolIEs,
but "iE_Extensions". Hence, modify to make it work for that case (and
others) as well.
Introduce generic _F1_CHECK_EXP(), which is like the macros for checking
values (_F1_EQ_CHECK_INT() etc). Reuse the same for introducing
_F1_EQ_CHECK_OPTIONAL_IE that will be used to write the check for
optional fields more concisely.
CP_OPT_BYTE_ARRAY() FREE_OPT_BYTE_ARRAY() are macros to wrap handling of
optional byte arrays.
_F1_MALLOC() simplifies allocations and is similar to asn1cCallocOne(),
but provided to avoid confusion (since more than ASN.1 structures will
use it).
All will be used in the following commits.
Switches the used socket type in pnf_interface.c and vnf_interface.c.
These values must always be the same in both components so the same socket type is used in both
Adds 3 new function pointers to the P5 and P7 VNF structures, allowing to configure which function to use to pack/unpack the messages, as well as unpack the message header, being then used seamlessly regardless of using the FAPI or nFAPI functions.
Adds 3 new function pointers to the P5 and P7 PNF structures, allowing to configure which function to use to pack/unpack the messages, as well as unpack the message header, being then used seamlessly regardless of using the FAPI or nFAPI functions.
Changes the header unpack and message unpack functions to return true on success and false on failure, instead of an int
This change is done in preparation to add the header unpack functions to the VNF and PNF structures as function pointers, used to peek the message headers prior to processing.
Add a faux fapi_nr_p7_message_header_unpack with the same signature as nfapi_nr_p7_message_header_unpack, to be used for the P7 header unpack function pointer.
Integration: `2025.w26`
See merge request oai/openairinterface5g!3493
* !3435 Cleanup PDU Session Handling in RRC/NGAP
* !3371 Add NAS Authentication Reject enc/dec library and unit test
* !3490 nr pdcp security: add a 'decipher' API function
* !3477 CI: Upgrade Aerial version to 25-1
* !3491 Fix Msg3 with MAC CE for C-RNTI and RRCReestablishmentComplete
Print a number of statistics, e.g., rx_ulsch_sdu to track UL MAC stats
timing. Remove unused time_meas_t definitions, and fix the name for the
total gNB scheduler time.
Fix Msg3 with MAC CE for C-RNTI and RRCReestablishmentComplete
- Only trigger RRCReconfiguration if UE is not performing RRCReestablishment
- The RRCReconfiguration will be triggered by the RRCReestablishmentComplete
Since this MR fixes a regression, additional info can be found in the following
closed issues and merged MR:
- #687 (closed)
- #747 (closed)
- !2600 (merged)
CI: Upgrade Aerial version to 25-1
- Update the Nvidia L1 (cuBB) from version 24-3 to 25-1
- Decrease the number of cores dedicated to the OAI gNB; testing showed
it does not need that many
This fixes a lifelock in nr_ue_get_sdu(), because select_logical_channels() would select
a suspended LCID for scheduling, but fill_mac_sdu() would not provide data for it.
Cleanup PDU Session Handling in RRC/NGAP
Currently, NGAP and RRC share the same structures and responsibilities when
handling PDU Session information: this creates tight coupling, redundancy, and
makes the code harder to maintain.
- NGAP should be responsible only for: Protocol-specific encoding/decoding
(3GPP TS 38.413)
- RRC should own: PDU Session handling and storage in the UE context
This MR is the first step in a broader refactoring of the PDU Session handling
code across NGAP and RRC layers, with the goal of splitting responsibilities
cleanly between both modules.
- Unified gtpu_tunnel_t for tunnel endpoint config (formerly f1u_tunnel_t)
- Refactored and relocated PDU Session struct definitions for better separation
between NGAP and RRC
- Moved pdusession_t for PDU Session handling out of NGAP, now defined and
managed by RRC only
- Defined 3GPP TS 38.413 message-specific structs in NGAP module
- NGAP now decodes NGAP PDU Session Resource Setup/Modify IEs and transfers
decoded data to RRC via ITTI
- Add helper functions to copy from NGAP message to pdusession_t
- Introduced new encoders/decoders/helpers in NGAP for handling PDU Session
Resource Setup/Modify procedures (e.g. decode_pdusession_transfer)
- Migrated to NGAP and removed duplicated logic for QoS information decoding
(fill_qos)
- Improved logging of GTP tunnel info
- Merged redundant functions (f1u_dl_gtp_update and f1u_ul_gtp_update)
- Removed unused code and obsolete types
- do free_func in seq_arr_erase_it on the provided range and updated unit test
- Other fixes and simplifications (e.g. simplified and clarified naming of
tunnel/session parameters and structs)
This cleanup improves code readability, has a high code churn (the deletions are
~159.7% of the insertions) and prepares for better modularity before the
refactoring of PDU Session handling in RRC/NGAP.
Add NAS Authentication Reject enc/dec library and unit test
This MR introduces the library for encoding/decoding of NAS Authentication
Reject (8.2.5.1 of 3GPP TS 24.501) and relevant unit test.
The message is sent by the AMF to the UE to indicate that the authentication
procedure has failed. A NAS handler was also introduced.
The implementation is limited to epoch times that are not more than 5.12 seconds in the future (allowed are up to 10.24 seconds)
and ntn-UlSyncValidityDuration < 5.12 seconds (allowed are up to 90 seconds).
To fix this limitation, the hyper frame number HFN has to be introduced at the OAI UE!
Before, we only considered ta_Common_r17 and the SAT position from SIB19 to compute the initial timing advance value.
This is good enough if the satellite does not move too fast (e.g. GEO satellite).
Now we also consider ta_CommonDrift_r17 and the SAT velocity together with the epoch time from SIB19.
This improves the accuracy of the initial TA computation, esp. for LEO satellite scenarios.
During reestablishment the UE goes back to not synchronized state.
While the synchronizatin is running, we trash frames using the function readFrame().
And when we successfully synchronize, we skip samples to align with the start of the frame using syncInFrame().
In rfsimulator mode, both of these functions send dummy data using the function dummyWrite().
Unfortunately, the writeTimestamp provided to that function was always assuming a duration from RX to TX of NR_UE_CAPABILITY_SLOT_RX_TO_TX.
But in NTN mode, this value is changed when receiving SIB19.
Therefore we have to consider this changed value instead of the static one.
CI: Add "may_fail" step to execute flaky steps
Add a generic may_fail CI XML step option that indicates the CI step may
fail, but the CI would still be marked as succeeded (instead of skipping
all steps and mark as failed). The cause of this failure depends on the
specific step, e.g., Iperf failing because of low throughput. This
allows to clean up some code and e.g. remove the command_fail option of
Custom_Command, which is then superfluous (and less generic). An
inconvenience is that those may_fail steps will be marked as "failed" in
the HTML. Later cleanup can correct this.
The may_fail is used for executing FHI7.2 testing to push 700 Mbps in DL
(close to the maximum).
Fix some bugs and add some clean up, see commit messages.
Enabling usage of ulsyncvalidityDuration timer in SIB19
ntn-UlSyncValidityDuration in SIB19 from Spec 38.331 v17.12 A validity
duration configured by the network for assistance information which
indicates the maximum time duration (from epochTime) during which the UE
can apply assistance information without having acquired new assistance
information. The unit of ntn-UlSyncValidityDuration is second. Value s5
corresponds to 5 s, value s10 indicate 10 s and so on.
ntn-UlSyncValidityDuration-r17 ENUMERATED{ s5, s10, s15, s20, s25, s30, s35,s40, s45, s50, s55, s60, s120, s180, s240, s900}
Implementation of epochtime is under discussion.
It can be configured in configuration file according to the above
enumeration. For GEO - 240s, MEO - 20s, LEO-5s can be used.
Handle authentication not accepted by the network. The handler assumes the message
is not integrity protected, processes the received NAS message and logs whether a
EAP-failure is enclosed. The UE enters state: 5GMM-DEREGISTERED.
Not done in this commit: the UE shall performs actions as per 5.4.1.3.5 of
3GPP TS 24.501, including (1) Abort any ongoing 5GMM procedure
(2) Stop all active timers: T3510, T3516, T3517, T3519, T3520, T3521
(3) Delete stored SUCI. (4) handle EAP-failure message.
- This is to avoid the Docker image builder from being confused in case we have multiple nvIPC files in `/opt/nvidia-ipc`
- This occurs when we have an MR to upgrade the cuBB image
USRP lib: fix incorrect config check for time_source fallback
Corrected a logic bug in usrp_lib.cpp where the code mistakenly checked
openair0_cfg[0].clock_source instead of time_source when a time_source
was already specified in usrp_args.
Also improved the warning log to clarify that the config value is being
ignored in favor of the explicit user-provided usrp_args.
Co-authored-by: Alexandre Serio alexandre.j.serio@altice.pt
NAS Registration Reject: Add bounds and lengths checks
This change adds lengths checks to the received registration reject
message and also performs a bounds check for the received cause.
Since the cause is not checked, any string in the memory can be
dereferenced, possibly leading to DoS.
Signed-off-by: Eduard Vlad eduard.vlad@rwth-aachen.de
Finalize FAPI dump functions, add Digital Beamforming Table and Precoding Matrix
Table to CONFIG.request
This MR finalizes the addition of dump utility functions for the PARAM.response,
CONFIG.request, CONFIG.response, TX_DATA.request and UCI.indication messages.
These functions are intended to be used to aid in debugging FAPI messages between
the VNF and the PNF by printing out every parameter in a more readable form,
instead of a simple hexdump. These are also used by the nFAPI Hex Parser utility,
to be able to debug an Hex dump provided from elsewhere.
Furthermore, this MR also adds the necessary logic to send/receive the Digital
Beamforming Table and Precoding Matrix Table, this in the CONFIG.request message.
This is achieved by the addition of 2 Vendor Extension TLVs (0xA002 and 0xA003),
in order to be able to reuse existing logic to pack/unpack the data. Note: The
present implementation predicts the existence of multiple instances of the
Precoding Matrix Table via the parameter num_pm_idx, whic is not present in the
SCF specification. Note: The created TLVs are only used to ease the pack/unpack
procedure, by allowing to reuse already existing logic for other TlVs, the tag
and length are not sent.
The necessary additions to the utility functions are done to account for these
table. The CONFIG.request unitary test is changed to fill these tables with
randomized data to test transport and copy.
Motivation of the commit:
Previously, the RRC module on the NGAP interface directly handled ASN.1 decoding
of NGAP PDU Session Resource items, that was directly stored in pdusession_t, i.e.
in the UE context. Decode logic between Setup and Modify was also duplicated.,
e.g. fill_qos/fill_qos2. The idea behind this change is to achieve this flow:
(1) NGAP handler: decoding (2) ITTI to RRC: transfer decoded message (3) RRC
handler: process decoded message, e.g. store in UE context, etc..
The goal of this commit is to:
* improve the NGAP decoding library by adding decoding functions
* let RRC handle the already decoded data
* enhance error handling, with decode failures now consistently detected and rejected early
* have a cleaner, more maintainable code with fewer duplications and a clearer separation of modules
Changes:
* Moved all ASN.1 decode logic for PDU Session Resource items into the NGAP library
* Introduced decode functions for NGAP IEs whenever necessary, e.g. decode_TNLInformation
decode_pdusession_transfer
* Removed duplicate fill_qos functions and centralized QoS handling in NGAP
* Added function to copy from NGAP PDU Session Resource item to RRC pdusession_t: this actually
replaces decodePDUSessionResourceSetup in RRC, copying from the decoded NGAP struct to
the UE context pdusession_t
Motivation:
The previous code had overlapping and partially inconsiste definitions of
`pdusession_t` and related structures across NGAP and RRC. This struct type
was used for either the data stored in the UE context and the NGAP message
IEs holding the PDU session to setup/modify information.
This patch aims to separte the `pdusession_t` in RRC, where it logically belongs,
since RRC owns the state of the PDU sessions. NGAP should only
deal with protocol messages, i.e. enc/dec and transfer structures to RRC.
This clarifies module ownership. This also makes the code easier to maintain.
Changes:
* Moved `pdusession_t` definition from NGAP (`ngap_messages_types.h`) to RRC
(`nr_rrc_defs.h`)
* Added a simpler `pdusession_resource_item_t` structure to NGAP for use in
protocol messages
* Adjusted NGAP structures accordingly (Initial Context Setup, PDU Session
Setup Request, and PDU Session Modify Request).
* do decodePDUSessionResourceSetup to decode the NGAP IEs holding PDU session
information and store what necessary in the UE context PDU Session IE: NOTE
this changes were necessary since previously this function was acting on
the common NGAP/RRC pdu_session_t struct
Rename the struct members:
`pdusession_param` to `pdusession` in NGAP Initial Context Setup Request
`pdusession_setup_params` in `ngap_pdusession_setup_req_t`
`pdusession_modify_params` and `ngap_pdusession_modify_req_t`
Motivation:
Clarify the role of GTP tunnel endpoint IDs in PDU session handling. Previously,
the struct members (gNB_teid_N3, UPF_teid_N3, etc.) were confusingly named and
duplicated with separate transport-layer address fields.
This refactoring replaces these with explicit n3_incoming and n3_outgoing members using
gtpu_tunnel_t. This aligns with GTP conventions: "incoming TEID" refers to the
TEID received from the remote peer (UPF on N3), while "outgoing TEID" is the
TEID sent by the local entity (NG-RAN on N3) to the remote peer.
Benefits:
* Improves readability and clarity of the code
* Reduces redundant struct members, i.e. remove UPF_teid_N3, UPF_addr_N3
* Aligns naming with 3GPP conventions for transport layer tunnels
Changes:
* Replace gtp_addr_N3, gNB_teid_N3, gtp_teid, upf_addr with n3_incoming and n3_outgoing
* Update all related code to use the new struct members
* Aligns naming with 3GPP conventions for transport layer tunnels
This struct is used in different layers, e.g. RRC, NGAP: therefore it
has been moved to platform_types.h.
Also, the struct holds the tunnel endpoint configuration for any GTP-U
tunnel, therefore the f1u prefix is not accurate and was updated
to a more generic gtpu.
* Remove drb_is_active: function is unused and the logic will be later
added to another function to add DRBs if necessary
* Remove unused NGAP structs and empty TODO functions
* Remove unused pdusession_setup_req_t struct definition
The seq_arr_erase_it function was modifying start_it during the free_func loop,
which led to incorrectly apply the free_func on the whole array.
This commit makes sure the elements "freed" are only those in the range and not the whole seq_arr.
* Fixes the logic by introducing a temporary iterator for the free loop,
preserving start_it and end_it for correct offset calculations.
* Adds a regression test in test_seq_arr to verify that only the selected
subrange is erased and that free_func is called exactly on that range.
DL NAS Transport: Fix Message Type retrieval on too short message
The change addresses the SM message type retrieval for DL NAS Transport
messages. The assumption of an offset 17 = 7 (MM Sec) + 3 (MM Plain) + 1
(IEI) + 2 (Len) + 4 (SM) is correct.
However, if the DL NAS Transport is received in a plain header, the
lengths would not add up anymore. (This is not complying with the
standard, so not allowed, but possible). The check for the length is
necessary to not process arbitrary memory contents beyond the
pdu_buffer.
Suspend RBs at UE
In case of suspended radio bearer (by RRC), the MAC needs to discarded received
PDUs and avoid to transmit using LCID related to that RB
"multi-ue profile" was a specific iperf option to do iperf across
multiple UEs. However, this is not necessary anymore, the Iperf
handling multiple UEs "implicitly" (based on the number of UEs).
As of the parent commit, there is a generic "may_fail" option through
which we could still ignore an error. Thus, command_fail is superfluous,
and avoids some extra code.
Further, in all these cases, we should better be informed about any
error, so let's not use may_fail for these tests.
There might be various occasions where a CI step should be attempted to
be executed, despite a chance of failing. For instance, we might want
to try executing an instable Iperf test, and still mark the CI as
passing if it fails.
This commit introduces a generic "may_fail" option that will mark any CI
test as succeeded, despite having failed.
Ideally, we would print a warning in the HTML code, but this is not
possible because each step emits its own HTML code, instead of the main
loop handling this. We can improve this in the future.
SPEC 38.331 section 5.2.2.6
Inform MAC that UL SYNC got lost because of T430 expiry
- Send message NR_MAC_RRC_CONFIG_RESET with cause UL_SYNC_LOST_T430_EXPIRY to MAC
Reacquire SIB19 after T430 expiry
This is not checked in this commit
- RACH needs to be performed through probably PDCCH order to reobtain UL-SYNC
- system usecase involving Recovery from T430 expiry not tested yet as that requires changes on gNB side.
Spec 38.331 section 5.2.2.4.21 indicates this
1> start or restart T430 for serving cell with the timer value set to ntn-UlSyncValidityDuration for the serving cell
from the subframe indicated by epochTime for the serving cell;
NOTE: UE should attempt to re-acquire SIB19 before the end of the duration indicated by ntn-UlSyncValidityDuration and epochTime
Epochtime IE
When explicitly provided through SIB, or through dedicated signaling, the EpochTime is the starting time of a DL
sub-frame, indicated by a SFN and a sub-frame number signaled together with the assistance information.
For serving cell, the field sfn indicates the current SFN or the next upcoming SFN after the frame where the message indicating the epochTime is received.
This field is mandatory present when ntn-Config is provided in dedicated configuration.
gNB implementation related to epochtime will be done in a separate merge request.
Adds the packing and unpacking functions needed for the PM Table in CONFIG.request
This table tag is specified in SCF222.10.06(0x104B), previous versions didn't have a tag for this table, and this version of the spec introduces the parameter `num_pm_idx`, previously not present.
A struct nfapi_nr_pm_tlv_ve_t is added to represent this TLV in order to be able to use the pack_nr_tlv function.
The necessary additions to the utility functions are done to account for this table.
The unitary test is changed to fill this table with randomized data to test transport and copy.
Adds the packing and unpacking functions needed for the DBT Table in CONFIG.request
This table tag is specified in SCF222.5.0 (0x1043) and this tag is used to transport the table, previous versions did not include a tag for the table.
A struct nfapi_nr_dbt_tlv_ve_t is added to represent this TLV in order to be able to use the pack_nr_tlv function.
The necessary additions to the utility functions are done to account for this table.
The unitary test is changed to fill this table with randomized data to test transport and copy.
NR UE fallback to RRCSetup from RRCReestablishment
Implementation of the procedure to handle reception of RRCSetup as response
to RRCReestablishment request
Step 004000 appears double in the XML description. Remove one to avoid
that it is executed twice (because the Python code goes through the list
of test descriptions and executes all that match the current ID =>
double if appears twice).
Corrected a logic bug in usrp_lib.cpp where the code mistakenly checked
openair0_cfg[0].clock_source instead of time_source when a time_source
was already specified in usrp_args.
Also improved the warning log to clarify that the config value is being
ignored in favor of the explicit user-provided usrp_args.
Co-authored-by: Alexandre Serio <alexandre.j.serio@altice.pt>
Integration: `2025.w24`
Closes#965
See merge request oai/openairinterface5g!3476
* !3354 Preparation Work for N2 Handover
* !3383 Add configurable values of NR RLC and NR PDCP to the configuration file
* !3468 Resolve "SSB frequency at gnb.sa.band78.fr1.24PRB.usrpb210.conf is invalid"
* !3466 YAML related updates
* !3460 SRS configuration
* !3474 Fix AMF selection fallback by PLMN ID when no UE identity is present or matching
* !3473 Fix various bugs and inconsistencies in config read, SCTP, ITTI, GTP
* !3169 NR RU improvements for analog beamforming
* !3456 CI: update config for AW2S pipeline
* !3369 Add Security Mode Reject lib/unit test and adopt in stack
* !3457 Fix NR reestablishment
* !3412 [E2 agent] E2AP README update and OAI-FlexRIC CI pipeline improvements
[E2 agent] E2AP README update and OAI-FlexRIC CI pipeline improvements
- E2AP README - add OSC nearRT-RIC section; update with proper FlexRIC
links, and explanations on prerequisites, as well as for xApps
- OAI-FlexRIC CI - use separate containers for xApps
- add reference files for CU-UP/CU-CP
- add logging for KPM NSSAI condition
Fix NR reestablishment by implementing the "DRB-suspend" at the MAC.
This means that the during reestablishment, gNB MAC discards received
DRB packets, and does not schedule DRB. Fix a couple of additional
issues in reestablishment. # Please enter a commit message to explain
why this merge is necessary,
For additional information, see
https://gitlab.eurecom.fr/oai/openairinterface5g/-/merge_requests/2668#note_119369
The spCellConfig is to be dropped during reestablishment and to be
applied after reconfiguration. Implement this using the
RRCReconfigurationComplete acknowledgment from the CU to the DU,
applying the spCellConfig if present (which signals a prior
reestablishment). Remove a prior flag that is not needed anymore, and
do not "guess" when is the reconfiguration, because it is now handled in
the case of the ack.
The spCellConfig is not relevant as long as we use a common search space
for DCIs (and the activation of dedicated search space happens after
applying spCellConfig). For PUCCH, there is the PDSCH transmission of
RRCReconfiguration which gets ack'ed in the default PUCCH.
RRCReconfigurationComplete is sent in PUSCH (again through common
search space). In theory, there cannot be another PUCCH before the
application of spCellConfig, as all bearers are still suspended, and
there should not be another SRB1 transmission in the meantime, as only
one RRC transaction can be active at a time.
Co-authored-by: francescomani <email@francescomani.it>
Add a flag for each RB that tracks suspension state. Mark all RBs
(except SRB1) as suspended on reestablishment, and de-suspend on
reconfiguration. Only check RLC status for non-suspended RBs. For UL
data traffic, check that DRB/SRB2 exist (SRB1 should be there as soon as
the UE context exists).
Add Security Mode Reject lib/unit test and adopt in stack
This MR is adding the library for the NAS Security Mode Reject, and
relevant unit test.
The UE shall send a SECURITY MODE REJECT containing a 5GMM cause that
typically indicates one of the following cause values: (23) UE security
capabilities mismatch. (24) security mode rejected, unspecified
- The message shall be protected if a security context is available.
- The message is adopted in the handling of Security Mode Command failure.
See 3GPP TS 24.501 5.4.2.5 "NAS security mode command not accepted by
the UE".
This MR includes changes from !3262:
> This patch series addresses a security issue where the UE improperly
> accepts a Security Mode Command (SMC) without an authentication header
> (Security Header 0). This behavior violates TS 24.501 and enables an
> attacker to bypass authentication, set integrity protection to NULL
> (NIA0), and reconfigure the UE without proper verification.
>
> We identified the following issues:
>
> 1. The UE currently accepts unauthenticated SMC messages, even
> allowing NIA0 and EIA0 to be set outside emergency mode.
> 2. When applying NIA0, the MAC field remains uninitialized,
> consistently containing the sequence 0xFF3F0000, making it feasible
> to bypass authentication and enforce insecure configurations.
> 3. The UE does not properly signal security mode failures to the Core
> Network.
>
> This patch series tries to address the above-mentioned issues:
>
> 1. Reject unauthenticated SMC messages, enforcing the requirement that
> they must be integrity-protected.
> 2. Validate MAC before applying security settings, ensuring that only
> authenticated messages are accepted.
> 3. Tear down the security context if an integrity check fails.
> 4. Introduce the Security Mode Reject message to inform the Core
> Network of failed SMC procedures, as required by TS 24.501.
This change performs the algorithm rejection in the corresponding NAS
handler for 5G, since the protocol definitions differ between LTE and
5G, regarding NIA0/EIA0 user plane traffic.
Therefore, for 5G NIA0 is rejected, since it is not allowed under normal
circumstances, while LTE user plane traffic can indeed have EIA0
selected.
Signed-off-by: Eduard Vlad <eduard.vlad@rwth-aachen.de>
It is not allowed to accept an unauthenticated SMC message,
as this effectively bypasses all security measures and
enables a malicioius attacker to compromise the confidentiality
and integrity of exchanged messages.
Signed-off-by: Eduard Vlad <eduard.vlad@rwth-aachen.de>
Co-authored-by: Guido Casati <hello@guidocasati.com>
Retrieving the mac is necessary during the handling of the SMC, since the
context is generated from the specified keys therein. Therefore, it is
necessary to check the MAC right after generation and ensure the authenticity
of the message. If it is not given, the message must be rejected.
Signed-off-by: Eduard Vlad <eduard.vlad@rwth-aachen.de>
Co-authored-by: Guido Casati <hello@guidocasati.com>
This is necessary to indicate to the Core network, that
the security mode command procedure has failed.
Check for the security context presence when generating the Security Mode
reject message: according to 3GPP TS 24.501 5.4.2.5 "NAS security mode command
not accepted by the UE" The UE shall send a SECURITY MODE REJECT containing
a 5GMM cause that typically indicates one of the following cause values:
(23) UE security capabilities mismatch
(24) security mode rejected, unspecified
The message shall be protected if a security context is available
Signed-off-by: Eduard Vlad <eduard.vlad@rwth-aachen.de>
Co-authored-by: Guido Casati <hello@guidocasati.com>
This 5GMM message is required for an invalid security mode command,
e.g. when the MAC integrity fails, or the wrong Security Header is set.
* Add encode/decode functions for common IEs in fgmm_lib: this library
provides encoding/decoding helpers for IEs shared across multiple
NAS messages. The goal is to avoid the legacy approach of creating
separate files per IE
* add NAS Cause enc/dec lib
* Adopted byte_array_t to handle the buffer
Co-authored-by: Eduard Vlad <eduard.vlad@rwth-aachen.de>
Fix various bugs and inconsistencies in config read, SCTP, ITTI, GTP
Fix bugs across various layers, mostly layer 3, including memory leaks.
See the commits for more details.
Fix AMF selection fallback by PLMN ID when no UE identity is present or matching
If a mask is present (i.e., not zero), AMF selection by PLMN ID may
still fail, causing the AMF selection process to skip the fallback
option, i.e. selection by PLMN ID, when no UE identity is available or
when no match is found.
This MR adds also warnings in case there's a match for the AMF is not
found.
SRS configuration
- Fix segmentation fault, a memory leak, and LOGs for SRS usage
NFAPI_NR_SRS_BEAMMANAGEMENT
- Refactor SRS configuration;
- Add SRS ResourceSet to get the SNR measurements at MAC layer
In this MR we have 2 SRS ResourceSet, for the same SRS Resource. This
way, in addition to obtaining the UL-RI, we also obtain the SNR in the
MAC and fill the PRB Black list.
This branch has been tested with COTS UE and with RFSim. The measured
values seem correct.
Using the USIM interface in the MAC is non-sensical (violates layer
separation). Add header include in nr-softmodem.c, which previously came
through nr_mac_gNB.h -> usim_interface.h.
Avoid leaking memory upon failed socket binding by calling
freeaddrinfo() before exiting in error cases.
Fixes leak:
Direct leak of 64 byte(s) in 1 object(s) allocated from:
#0 0x0000004ac038 in malloc (/home/richie/oai/cmake_targets/ran_build/build/nr-softmodem+0x4ac038) (BuildId: 875d6e5bc54d7c89bdcf151452f12703cb6fd110)
#1 0x7f0fdd92e2a6 in getaddrinfo (/lib64/libc.so.6+0x1202a6) (BuildId: 2b3c02fe7e4d3811767175b6f323692a10a4e116)
#2 0x00000043d7ad in getaddrinfo (/home/richie/oai/cmake_targets/ran_build/build/nr-softmodem+0x43d7ad) (BuildId: 875d6e5bc54d7c89bdcf151452f12703cb6fd110)
#3 0x000000700c73 in udpServerSocket(openAddr_s) /home/richie/oai/openair3/ocp-gtpu/gtp_itf.cpp:486:17
#4 0x000000700c73 in gtpv1Init /home/richie/oai/openair3/ocp-gtpu/gtp_itf.cpp:546:10
#5 0x000000c692b8 in cuup_init_n3 /home/richie/oai/openair2/E1AP/e1ap.c:744:61
#6 0x000000549ea1 in create_gNB_tasks /home/richie/oai/executables/nr-softmodem.c:320:7
#7 0x000000549ea1 in main /home/richie/oai/executables/nr-softmodem.c:619:15
#8 0x7f0fdd8115f4 in __libc_start_call_main (/lib64/libc.so.6+0x35f4) (BuildId: 2b3c02fe7e4d3811767175b6f323692a10a4e116)
#9 0x7f0fdd8116a7 in __libc_start_main@GLIBC_2.2.5 (/lib64/libc.so.6+0x36a7) (BuildId: 2b3c02fe7e4d3811767175b6f323692a10a4e116)
#10 0x000000408524 in _start (/home/richie/oai/cmake_targets/ran_build/build/nr-softmodem+0x408524) (BuildId: 875d6e5bc54d7c89bdcf151452f12703cb6fd110)
This printf just shows which config sections are being read, but this
has no useful information for a user. It was introduced in 7731f5bd2d
but was not present prior to this commit, either.
YAML related updates
- Add common function config_common_getdefault
- Handle exceptions from the yaml-cpp library, transform them into
understandable errors written to stderr
- Add some unit tests.
Add configurable values of NR RLC and NR PDCP to the configuration file
This is for the gNB (the UE gets the values from the gNB).
The physical simulators were also adapted (we put the previously
hardcoded values that were everywhere in the code into the simulators
themselves). I don't think we need to have those values configurable for
the simulators, but I can study the possibility to add this if someone
tells me it's important (if not important I prefer not to do it, I am
not sure if it is trivial to do or not).
Preparation Work for N2 Handover
This MR introduces preliminary improvements to support !3334.
Refactored utility NGAP functions
- Moved allocAddrCopy to NGAP utilities
Decoding Functions for NGAP IEs:
- Added common decoding functions (decode_ngap_guami,
decode_ngap_UEAggregateMaximumBitRate, decode_ngap_nssai, etc.)
- Adopted these functions across the NGAP stack
Improvements to RRC and Handover Handling:
- Enhanced get_neighbour_cell_information and get_neighbour_config to
differentiate input parameters (cell by NR Cell ID vs. gNB by PCI)
- Used byte_array_t in nr_initiate_handover
- Introduced RRCReconfigurationParams_t to structure RRCReconfiguration
IEs
- Added a function to build NR_RRCReconfiguration_IEs_t
- Adopted this approach in do_RRCReconfiguration and refactored the
function
- Refactored the handling of Dedicated NAS message list
- Add masterKeyUpdate handling in RRCReconfiguration generation
PDCP Re-Establishment Improvements:
- Enabled PDCP re-establishment for SRB1/SRB2 based on a bitmap in
createSRBlist (3GPP TS 38.331 RadioBearerConfig)
NH & KgNB Key Management:
- Added NH derivation function as per 3GPP TS 33.501 A.10
- Moved KgNB derivation function to key_nas_deriver utilities
Add the ability to pack/unpack 2 new TLVs for analog beamforming
total_num_beams_vendor_ext and analog_beam_list
Add the unpack related changes for the first 2 vendor extension TLVs introduced related to beamforming.
For the moment the packing is guarded by an Assert to ensure it is not used.
Add the necessary utility function changes to support these VE TLVs
Add the necessary changes to the corresponding unitary test for pack/unpack,
commented for the moment, since the packing is disabled with an Assert.
The mask could be present, .e.g not zero, but the selection of the AMF could
fail. This would lead to a skipping the selection of the AMF by PLMN ID,
which is the last option when no UE identity is present and/or matching.
Free memory allocated in NGAP after use in RRC.
Direct leak of 29 byte(s) in 1 object(s) allocated from:
> #0 0x7f11200b4887 in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:145
> #1 0x558b7fcd0137 in malloc_or_fail /n2-handover-preparation/common/utils/utils.h:86
> #2 0x558b7fcd0137 in create_byte_array /n2-handover-preparation/common/utils/ds/byte_array.c:32
> #3 0x558b7fdb7a5c in rrc_gNB_send_NGAP_NAS_FIRST_REQ /n2-handover-preparation/openair2/RRC/NR/rrc_gNB_NGAP.c:183
> #4 0x558b7fd2ab30 in rrc_gNB_process_RRCSetupComplete /n2-handover-preparation/openair2/RRC/NR/rrc_gNB.c:439
> #5 0x558b7fd2ab30 in handle_rrcSetupComplete /n2-handover-preparation/openair2/RRC/NR/rrc_gNB.c:1715
> #6 0x558b7fd63e23 in rrc_gNB_decode_dcch /n2-handover-preparation/openair2/RRC/NR/rrc_gNB.c:1851
> #7 0x558b7fd8b4c3 in rrc_gnb_task /n2-handover-preparation/openair2/RRC/NR/rrc_gNB.c:2718
> #8 0x7f111ea94ac2 in start_thread nptl/pthread_create.c:442
ASN_SEQUENCE_ADD is calling realloc which is allocating memory for the
'array' which was not freed.
> Direct leak of 32 byte(s) in 1 object(s) allocated from:
> #0 0x7ce97deb4c38 in __interceptor_realloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:164
> #1 0x5813fba02574 in asn_set_add /openairinterface5g/n2-handover-preparation/cmake_targets/ran_build/build/openair2/RRC/LTE/MESSAGES/asn_SET_OF.c:27
> #2 0x5813faf6c672 in createSRBlist /openairinterface5g/n2-handover-preparation/openair2/RRC/NR/rrc_gNB.c:331
> #3 0x5813faf9aa78 in rrc_gNB_generate_RRCSetup /openairinterface5g/n2-handover-preparation/openair2/RRC/NR/rrc_gNB.c:421
> #4 0x5813fafba2ee in rrc_handle_RRCSetupRequest /openairinterface5g/n2-handover-preparation/openair2/RRC/NR/rrc_gNB.c:1243
> #5 0x5813fafba2ee in rrc_gNB_process_initial_ul_rrc_message /openairinterface5g/n2-handover-preparation/openair2/RRC/NR/rrc_gNB.c:2019
> #6 0x5813fafcdc3a in rrc_gnb_task /openairinterface5g/n2-handover-preparation/openair2/RRC/NR/rrc_gNB.c:2761
> #7 0x7ce97c894ac2 in start_thread nptl/pthread_create.c:442
> Direct leak of 32 byte(s) in 1 object(s) allocated from:
> #0 0x7ce97deb4c38 in __interceptor_realloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:164
> #1 0x5813fba02574 in asn_set_add /openairinterface5g/n2-handover-preparation/cmake_targets/ran_build/build/openair2/RRC/LTE/MESSAGES/asn_SET_OF.c:27
> #2 0x5813faf6c672 in createSRBlist /openairinterface5g/n2-handover-preparation/openair2/RRC/NR/rrc_gNB.c:331
> #3 0x5813faf7d89d in get_RRCReconfiguration_params /openairinterface5g/n2-handover-preparation/openair2/RRC/NR/rrc_gNB.c:660
> #4 0x5813faf914b3 in rrc_gNB_generate_dedicatedRRCReconfiguration /openairinterface5g/n2-handover-preparation/openair2/RRC/NR/rrc_gNB.c:716
> #5 0x5813faf96856 in rrc_CU_process_ue_context_setup_response /openairinterface5g/n2-handover-preparation/openair2/RRC/NR/rrc_gNB.c:2190
> #6 0x5813fafcd3ed in rrc_gnb_task /openairinterface5g/n2-handover-preparation/openair2/RRC/NR/rrc_gNB.c:2796
> #7 0x7ce97c894ac2 in start_thread nptl/pthread_create.c:442
dynamically allocated memory is pushed to the seq_arr that
is doing a memcpy, so it can be either or better allocated
in the stack instead
> Direct leak of 16 byte(s) in 1 object(s) allocated from:
> #0 0x7efd8f6b4a57 in __interceptor_calloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:154
> #1 0x577888f3457e in fill_neighbour_cell_configuration /openairinterface5g/n2-handover-preparation/openair2/GNB_APP/gnb_config.c:1914
> #2 0x577888f3457e in RCconfig_NRRRC /openairinterface5g/n2-handover-preparation/openair2/GNB_APP/gnb_config.c:2108
> #3 0x57788869a0d2 in create_gNB_tasks /openairinterface5g/n2-handover-preparation/executables/nr-softmodem.c:253
> #4 0x57788869a0d2 in main /openairinterface5g/n2-handover-preparation/executables/nr-softmodem.c:619
> #5 0x7efd8e029d8f in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58
the dynamically allocated memory is pushed to the seq_arr that
is doing a memcpy, so it can be either or better allocated in the
stack instead
> Direct leak of 48 byte(s) in 1 object(s) allocated from:
> #0 0x7d4c934b4a57 in __interceptor_calloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:154
> #1 0x577622a40137 in fill_neighbour_cell_configuration /openairinterface5g/n2-handover-preparation/openair2/GNB_APP/gnb_config.c:1933
> #2 0x577622a40137 in RCconfig_NRRRC /openairinterface5g/n2-handover-preparation/openair2/GNB_APP/gnb_config.c:2109
> #3 0x5776221a30f2 in create_gNB_tasks /openairinterface5g/n2-handover-preparation/executables/nr-softmodem.c:253
> #4 0x5776221a30f2 in main /openairinterface5g/n2-handover-preparation/executables/nr-softmodem.c:619
> #5 0x7d4c91e29d8f in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58
seq_arr_push_back is doing a memcpy so locally allocated memory can be freed after.
Allocate in stack.
> Direct leak of 64 byte(s) in 2 object(s) allocated from:
> #0 0x7ec4bb8b4a57 in __interceptor_calloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:154
> #1 0x55895aae1b1f in fill_measurement_configuration /openairinterface5g/n2-handover-preparation/openair2/GNB_APP/gnb_config.c:2015
> #2 0x55895aae1b1f in RCconfig_NRRRC /openairinterface5g/n2-handover-preparation/openair2/GNB_APP/gnb_config.c:2112
> #3 0x55895a246112 in create_gNB_tasks /openairinterface5g/n2-handover-preparation/executables/nr-softmodem.c:253
> #4 0x55895a246112 in main /openairinterface5g/n2-handover-preparation/executables/nr-softmodem.c:619
> #5 0x7ec4ba229d8f in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58
Inside of passing the RRCReconfiguration buffer, call RRCReconfiguration
message generation inside the F1 callback. This will simplify the code in the
rrc_CU_process_ue_context_setup_response() function once the N2 handover case
is introduced. In rrc_CU_process_ue_context_setup_response(), with presence
of the HO context, the HO ACK callback is called only once and depending
on the type of HO it will do either RRCReconfiguration for F1 and
HandoverCommand for N2.
The byte_array reference contains the pointer to the
encoded RRC buffer to be used in the handover acknowledge
callback (e.g. in F1 to trigger RRCReconfiguration)
This is necessary because the function was re-establishing PDCP only for SRB2
however according to specs 3GPP TS 38.331 RadioBearerConfig, PDCP shall be
re-established for SRB1 and/or SRB2 whenever the security key used for the
radio bearer changes, with some exceptions for SRB1 (i.e. when resuming
an RRC connection, or at the first reconfiguration after RRC connection
reestablishment in NR, do not re-establish PDCP for SRB1).
* the input param "reestablish" is converted into a bitmap to indicate
whether PDCP should be re-established for the SRB1 and/or SRB2.
* For convenience the bitmap is 0-based, with index 1 corresponding to SRB1,
index 2 to SRB2.
This commit is keeping the legacy re-establishment, that is re-establishment
of PCDP for SRB2 only.
according to TS 38.331, RRCReconfiguration messages can be carried
in a container by different RRC messages, e.g. HandoverPreparationInformation,
HandoverCommand, RRCResume etc.. therefore before the introduction of new
RRCReconfiguration messages, e.g. for handover, a new design seems to be necessary
in order to improve modularity and maintainability of the code.
The goal of this commit is to make the generation of RRCReconfiguration
messages more modular by (1) preparing the RRCReconfiguration parameters
data in RRC (2) pass it to ASN1 for IEs allocation (3) encode to buffer
The following changes are introduced:
(1) introduce struct nr_rrc_reconfig_param_t to store the RRC parameters relevant
to encode the RRCReconfiguration IEs
(2) add RRC function get_RRCReconfiguration_params to fetch nr_rrc_reconfig_param_t
data from the UE context and
(3) pass it to the ASN1 encoder, e.g. do_RRCReconfiguration
(4) add a function build_RRCReconfiguration_IEs to allocate memory and build the
ASN1 NR_RRCReconfiguration_IEs_t and
(5) adopt it in do_RRCReconfiguration
(4) add free_RRCReconfiguration_params for memory management of nr_rrc_reconfig_param_t data
(6) add test for rrc_reconfiguration
get_RRCReconfiguration_params:
This function prepares RRCReconfigurationParams for RRC encoding.
Motivation of this change: depending on the RRCReconfiguration
message to be encoded, the ownership of ASN1 memory allocation
should belong to the ASN1 layer, therefore this function is
preparing the nr_rrc_reconfig_param_t data to pass to the
ASN1 encoder to build the ASN1 message and encode to buffer
The function is preparing the params for the IEs that are
either mandatory or shared among different RRC messages.
Specific fields that depend on the message to be encoded are then
added afterwards in the caller. The input param to indicate
re-establishment has been split between SRBs and DRBs, since
depending on the scenario the PDCP re-establishment can vary.
This will be addressed in a later commit.
This function is also handling xid.
build_RRCReconfiguration_IE:
The long term goal is to transfer ownership of memory allocation in ASN1 encoding to
build_RRCReconfiguration_IE, then by calling ASN_STRUCT_FREE_CONTENTS_ONLY
on dl_dcch_msg, all IEs allocated in the context are freed after encoding to buffer.
In the long term, createDRBlist, createSRBlist can also be brought into the context
of build_RRCReconfiguration_IEs and free the ASN1 structure after encoding.
This improves maintability and helps preventing memory leaks.
Currently, what is not allocated in the context, is nulled and freed outside.
free_RRCReconfiguration_params:
this function frees memory allocated to build the nr_rrc_reconfig_param_t data,
including the NR_DRB_ToAddModList_t and NR_SRB_ToAddModList_t. The function
freeDRBlist has been removed since no longer necessary.
dedicated_NAS_msg_list:
dedicated_NAS_msg_list handling has also been refactored, by:
(1) fetch the NAS PDUs from the UE context in get_RRCReconfiguration_params,
which translates to (2) passing an array of dedicatedNAS-MessageList + size
to the ASN1 encoding function where (3) the ASN1 encoding logic for the
dedicated_NAS_msg_list IE has been moved
Note, 3GPP TS 38.331:
dedicatedNAS-MessageList: SEQUENCE (SIZE(1..maxDRB)) OF DedicatedNAS-Message
* differentiate the 2 functions based on the input: either NR Cell ID or PCI
* enhanced variables naming to distinguish the parameters
* add logging for debugging purposes
this commit is refactoring the function ngap_gNB_handle_nas_first_req
to (1) fill first a local instance of ngap_gNB_ue_context_t and then
(2) pass it to ngap_store_ue_context which will allocate memory
for the instance to store in ngap
This count is used to size the dynamic array lcids_bj_pos. In case
count is zero, this would lead to runtime error. With this change,
the function will indicate to the caller that no SDUs are present and
will print an error.
According to 3GPP TS 38.331 5.3.5.5.2 (Reconfiguration with sync), the UE
shall consider the target SpCell to be one with a physical cell identity
indicated by the physCellId
The primary motivation here is to remove a VLA, as in the parent
commits. Closer inspection revealed that (1) it is only used by the LTE
UE, and (2) it only logs some data which we likely don't need. So I
simply removed this function.
Upon failure, the error message was saying that something failed (i.e.,
the reason), but not parameters of the getaddrinfo(). Simplify root
cause analysis by providing the parameters for the attempted
getaddrinfo() call.
This function is needed also in upcoming NGAP
libraries (i.e. N2 Handover) and therefore is moved
to the NGAP utilities file. The function converts
transport_layer_addr_t data struct to BIT_STRING_t
by copying the content of its members. The naming
is also updated to tnl_to_bitstring.
* Functions added:
decode_ngap_guami
decode_ngap_UEAggregateMaximumBitRate
decode_ngap_nssai
decode_ngap_security_capabilities
decode_ngap_mobility_restriction
* Adopt these functions in the common NGAP library
- remove hardcoded values
- adapt gNB RRC code
- adapt gNB MAC code
- adapt physical simulators, where we put the hardcoded values
that were everywhere else before; if there is a need for those
simulators to get configurable values, more work is needed
(but it's doubtful that it is needed)
To be used in a later commit to retrieve NR PDCP configuration
parameters.
To use, add the following to the configuration file (outside of other
configurations). Adapt the values to your setup. The names ("len18bits",
"ms100", etc.) come from 3GPP TS 38.331.
pdcp = {
drb = {
sn_size = "len18bits"
t_reordering = "ms100"
discard_timer = "infinity"
}
}
Default values are applied if the configuration is absent.
The default values are the ones given above.
To be used in a later commit to retrieve NR RLC configuration
parameters.
To use, add the following to the configuration file (outside of other
configurations). Adapt the values to your setup. The names ("ms45",
"size12", etc.) come from 3GPP TS 38.331.
rlc = {
srb = {
t_poll_retransmit = "ms45"
t_reassembly = "ms25"
t_status_prohibit = "ms0"
poll_pdu = "infinity"
poll_byte = "infinity"
max_retx_threshold = "t8"
sn_field_length = "size12"
}
drb_am = {
t_poll_retransmit = "ms45"
t_reassembly = "ms15"
t_status_prohibit = "ms15"
poll_pdu = "p64"
poll_byte = "kB500"
max_retx_threshold = "t32"
sn_field_length = "size18"
}
drb_um = {
t_reassembly = "ms15"
sn_field_length = "size12"
}
}
Default values are applied if the configuration is absent.
The default values are the ones given above.
Integration: `2025.w23`
Closes#962, #956, and #801
See merge request oai/openairinterface5g!3464
* !3302 Enhance UE identity management in Initial UE Message and other NGAP improvements
* !3400 T bugfix: check input data a bit better
* !3459 Improvements in NR band tables according to Rel.17
* !3465 Fix checking that amf_ip_address section is not set.
* !3463 Move RRC radio parameters file to DU
* CI: Use host network mode in NSA-B200 pipeline
* !3389 Relax NR_UE_CAPABILITY_SLOT_RX_TO_TX asserts
* !3417 Imscope updates
* !3443 Fix data race in NR UE MSG3 scheduling
* !3467 remove dead globals
Fix data race in NR UE MSG3 scheduling
Fixed a data race between DL processing of RAR and UL scheduler, which might
result in dropping MSG3.
It was possible that the UL scheduler for the UL slot which RAR indicates as
MSG3 slot was already run by the time the RAR was decoded.
Therefore when DCI for RAR is decoded, assume worst case and halt UL scheduler
for next slot until RAR is decoded solving the data race. This also in turn
halts all later scheduling due to sequential nature of the UL scheduler calls.
Closes#962
imscope updates
- Add CSV export button to imscope
- Add extra cache for IQ data in imscope record thread so that UE time domain
data can be kept until PDSCH is decoded.
- Add metadata to UE time domain samples scope
- Add UE pdsch pre-compensation IQ and PDSCH channel estimates
Move RRC radio parameters file to DU
A number of radio-related RRC parameters, e.g., CellGroupConfig, "originate" at
the DU and are sent to the CU for forwarding to the UE only. Similarly, there
are additional parameters, e.g., RLC-BearerConfig (part of CellGroupConfig),
that originate at the DU.
Hence, the DU decides about these parameters, depending on the MAC state and
capabilities. To clarify this, move the existing
openair2/RRC/NR/nr_rrc_config.{c,h} => openair2/LAYER2/NR_MAC_gNB/nr_radio_config.{c,h}
So that developers know that while those are RRC parameters, they originate at
the DU.
In other words, the CU/RRC is not supposed to use any of these functions in
the RRC. Correspondingly, includes of this file have been cleaned up (and when
they are not necessary at the MAC as well)
Instead of running xApps from oai-flexric container,
create dedicated xApp containers.
In addition, modify the flexric.conf: DB_PATH doesn't exist;
DB_DIR is the correct name.
- prerequisites - use the links to FlexRIC tutorial
- build FlexRIC - use the build tutorial from FlexRIC tutorial
- explain in more details the supported service model functionalities
- explanation if no RIC INDICATION is being sent
- use multi-UE rfsim tutorial from doc/, not oai-workshops repository
Fixed a data race between DL processing of RAR and UL scheduler, which
might result in dropping MSG3.
It was possible that the UL scheduler for the UL slot which RAR
indicates as MSG3 slot was already run by the time the RAR was decoded.
Therefore when DCI for RAR is decoded, assume worst case and halt the
earliest corresponding UL scheduler call until RAR is decoded solving
the data race. This also in turn halts all later scheduling due to
sequential nature of the UL scheduler calls.
Following a power cycle of the CI machines in the NSA-B200 setup, the gNB
machine encountered a networking issue. Although packets were observed leaving
and returning to the host of gNB, they failed to reach the container.
Debugging steps taken:
- upgraded the gNB machine
- reinstalled Docker
- reviewed and verified IP rules and routing settings
Setting the container to use host network mode resolved the issue.
Enhance UE identity management in Initial UE Message and other NGAP improvements
This MR improves the Initial UE Message procedures by supporting simultaneous
presence of both 5G-S-TMSI and GUAMI. Previously, only one identity could be
used, leading to potential AMF selection failures. Now the presenceMask allows
both identities. The AMF selection is prioritizing GUAMI first, then falling
back to 5G-S-TMSI, and finally using PLMN or highest capacity.
Also, fix handling of selected PLMN identity in NGAP.
Refactoring:
- Select the AMF based on (1) absence of UE Identity (2) Presence of GUAMI
(3) Presence of 5G-S-TMSI
- Also refactored the AMF selection logic for better readability and reliability.
- Refactor and cleanup rrc_gNB_send_NGAP_NAS_FIRST_REQ
- Replace ngap_pdu_t with byte_array_t
- Add guami_t to ngran_types.h: refactor NGAP and RRC code to use one common
GUAMI type instead of two identical ones
Also:
- Bugfix in ngap_gNB_handle_ng_setup_response: use correct count for PLMNSupportList
Closes issue #801
Segmentation fault occured since the commit ID 9e5c5497ab,
where we try to copy the pointer which was not even been allocated. Before, we were
copying the address of a NULL pointer and therefore no segmentation fault.
This commit fixes the segmentation fault by checking if the memory was allocated, i.e. should not be
in the case of CU (as it doesn't contain MAC/RLC layers).
A number of radio-related RRC parameters, e.g., CellGroupConfig,
"originate" at the DU and are sent to the CU for forwarding to the UE
only. Similarly, there are additional parameters, e.g., RLC-BearerConfig
(part of CellGroupConfig), that originate at the DU.
Hence, the DU decides about these parameters, depending on the MAC state
and capabilities. To clarify this, move the existing
openair2/RRC/NR/nr_rrc_config.{c,h} => openair2/LAYER2/NR_MAC_gNB/nr_radio_config.{c,h}
So that developers know that while those are RRC parameters, they
originate at the DU.
In other words, the CU/RRC is not supposed to use any of these functions
in the RRC. Correspondingly, includes of this file have been cleaned up
(and when they are not necessary at the MAC as well).
One of the next commits moves nr_rrc_config.c "down to" the MAC/DU. The
BearerConfig functions are only used at the DU, so move them here in the
corresponding file.
When data is generated by "normal" T tracers, it should be fine.
But it might come from unknown sources and then content might be
"strange". So let's validate input data a bit more.
The way allocation is done (granularity of 64KiB) makes a crash more
difficult to achieve, but if a trace is exactly 64KiB, we miss 4 bytes
in the realloc and then anything may happen.
Integration: `2025.w22`
Closes#832
See merge request oai/openairinterface5g!3452
* !3415 several fixes and cleanup for nrLDPC_coding_t2
* !3448 T: macpdu2wireshark: dump to file instead of sending UDP packets
* !3449 bugfix: pass correct buffer
* !3453 CI: revert modification of SSB per RACH occasion in SC-FDMA test
* !3440 Update NAS documentation
* !3451 fix the number of preambles per SSB at UE in case PRACH is configured with groupB
* !3441 Replace hashtable with epoll_event_t in rfsimulator
* !3277 Add CI test to force RRC IDLE and new connection setup with 5G-S-TMSI
* !3454 Keep old MAC stats after re-establishment
* !3450 Make number of UL/DL actors in NR UE fully configurable
* !3458 (doc): update README with build icons for dedicated arch and os
Make number of UL/DL actors in NR UE fully configurable
Due to different processing requirements on different CPUs it might be
beneficial to enable the users to set the number of UL/DL actors.
Allow disabling UL/DL actor frameworks and processing inline or setting
the number of DL/UL threads with --num-ul-actors/num-dl-actors
This was tested to work with 0 UL/DL actors with rfsim.
GUAMI fields (Set ID, Pointer and Region ID) were decoded as Octet String,
however they are encoded as BIT STRING. Therefore, the GUAMI value was wrongly decoded.
In the AMF logs the AMF IDs are 1,1,1, however in gNB logs we had 1,64,4
Quick local test confirmed that:
---- TESTING AMF IDs = 1 ----
Region ID (OCTET STRING): 1
Region ID (BIT STRING): 1
Set ID (OCTET STRING): 64
Set ID (BIT STRING): 1
Pointer (OCTET STRING): 4
Pointer (BIT STRING): 1
The difference arises because:
- OCTET STRING treats the buffer as raw bytes, with all bits used.
- BIT STRING includes a `bits_unused` field, which tells how many padding bits
are present in the least significant end. This is especially important in
3GPP ASN.1 definitions like AMF Set ID (10 bits), AMF Region ID (8 bits),
AMF Pointer (6 bits), where the full byte(s) may contain unused bits that
must be masked out.
selectedPLMN-Identity IE in RRCSetupComplete is an Index (long) of the PLMN selected
by the UE from the plmn-IdentityInfoList (SIB1) (see 3GPP TS 38.331)
while
Selected PLMN Identity in NGAP INITIAL UE MESSAGE Indicates the selected PLMN
id for the non-3GPP access (PLMN Identity ID carrying MNC, MCC and MNC size,
9.2.5.1 3GPP TS 38.413)
The legacy code was setting Selected PLMN Identity in the latter to an ID
value as the former, however in NGAP the IE to be encoded is PLMN Identity 9.3.3.5
therefore:
* set plmn type plmn_id_t in ngap_nas_first_req_t
* check whether received selectedPLMN-Identity is within bounds
* select PLMN from gNB_RrcConfigurationReq by selectedPLMN-Identity ID
note: this commit is assuming that the plmn-IdentityInfoList in SIB1
is matching the PLMN list in gNB_RrcConfigurationReq
* in NGAP: store the PLMN in the NGAP UE context, no need to fetch the PLMN
in the NGAP instance since the UE context already tells what PLMN
was selected
Closes#801
* use bitmask to select presence of either 5G-S-TMSI or GUAMI
* select the AMF based on
(1) absence of UE Identity (2) Presence of GUAMI (3) Presence of 5G-S-TMSI
Related to #801
* add function to process AMF Identifier
* add function to select AMF
* set const parameters in utility nnsf functions
* adopt utilities for memory allocation
* improve readability and maintainability
* improve logging
ngap_pdu_t has the same definition as byte_array_t, so it is
replaced by the latter. This simplify the stack and reduces
duplicated code.
Also, add function create_byte_array to copy from an
existing buffer to a new byte_array_t and replaced
allocCopy with create_byte_array, and adopted
OCTET_STRING_fromBuf whenever possible.
Due to different processing requirements on different CPUs it might
be beneficial to enable the users to set the number of UL/DL actors.
Allow disabling UL/DL actor frameworks and processing inline or
setting the number of DL/UL threads with --num-ul-actors/num-dl-actors
This was tested to work with 0 UL/DL actors with rfsim.
Add CI test to force RRC IDLE and new connection setup with 5G-S-TMSI
This MR is a follow up to !2725 (merged)..
The primary goal is to introduce a CI test that enforces the following behavior:
- Forces the UE to enter RRC_IDLE state.
- Validates the UE's re-connection procedure using the 5G-S-TMSI as the UE
identity.
fix the number of preambles per SSB at UE in case PRACH is configured with groupB
To fix an issue reported in the mailing list related to UE configured by a 3rd
party gNB with groupB PRACH
Replace hashtable with epoll_event_t in rfsimulator
Replace the FD <-> buffer_t hashtable with epoll_event_t mapping. This
simplifies the code, reduces the probability of memory leaks, and removes
a possible data race on the hashtable during rfsimulator shutdown.
Replace the FD <-> buffer_t hashtable with epoll_event_t mapping.
This simplifies the code, reduces the probability of memory leaks and removes a
possible data race on the hashtable during rfsimulator shutdown.
The UE shall use the currently stored UL NAS count to derive the
KgNB. Hardcoding the UL count to 0 is wrong, if there is a reset
to be done it should be explicitly done elsewhere.
Closes#832
The Security Mode Command is the only NAS message sending a security header
type "integrity protected with new 5G NAS security context". Such header
type is indicating that there is no valid security context and it is
indicating the current one configured by the AMF.
When receiving a Security Mode Command the "AMF shall reset the downlink NAS COUNT"
and use it to integrity protect the initial Security Mode Command. "The AMF shall
send the SECURITY MODE COMMAND message unciphered, but shall integrity protect [...]
The AMF shall set the security header type of the message to
"integrity protected with new 5G NAS security context".
See 5.4.2.2 3GPP TS 24.501.
This commit is ensuring the NAS DL count is reset when the relevant security header
is received. Also, the security container is deleted since no more valid and
NAS_SECURITY_NO_SECURITY_CONTEXT is returned. The setup of the new security context
is done by "handle_security_mode_command",
NAS 3GPP TS 24.501 clause 4.4.4.2 specify which NAS messages
are an exception to the integrity protection. All the other
scenarios are expected to be integrity protected. The
nas_security_rx_process function is returning:
1) NAS_SECURITY_NO_SECURITY_CONTEXT if no security context is established
2) NAS_SECURITY_UNPROTECTED for the messages listed in 4.4.4.2
3) NAS_SECURITY_INTEGRITY_PASSED if the integrity check is successful
These 3 results can be all considered successful. The other not.
Also, add a function to check whether a message is allowed to be
integrity unprotected, as per clause 4.2.2.2.
* trigger Identity Response callback from the handler
* process decoded message
According to 4.4.4.2 3GPP TS 24.501, Identity Request
with Identity Type SUCI is not expected to be
integrity protected.
The information about the payload carried by NAS DOWNLINK is helpful
in the logging and also for debugging purposes, therefore it was
added in this commit by enabling the already existing relevant function.
This commit restores the behaviour before the changes introduced in 611c0554. The NAS
Deregistration Accept message is unprotected, therefore the function will return
NAS_SECURITY_UNPROTECTED that would then be considered as NAS_SECURITY_INTEGRITY_PASSED
Unprotected message have a plain header of 3 octets, however security protected messages
have a 7 octets header.
* Close entity->pdusession_sock manually before pthread_join() to unblock sdap_tun_read_thread()
* Update tun_destroy() to open a fresh socket for interface management, independent from the data socket
* Fix check on success of change_interface_state() in tun_destroy(): is a boolean
* Handle ENODEV error when bringing interface down: treat as success if the interface is already gone.
* tun_destroy() is now handling INTERFACE_DOWN, so `INTERFACE_DOWN` in `tun_config()` is no longer needed
CI: revert modification of SSB per RACH occasion in SC-FDMA test
This MR reverts the parameter ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR back
to 4, undoing the change introduced in commit a4f9a7a6. The initial modification
was made as a potential fix for a reestablishment failure observed in the SC-FDMA
test case of the SABOX-B200 pipeline. However, further validation has shown that
this parameter was not the root cause of the issue.
T: macpdu2wireshark: dump to file instead of sending UDP packets
In NR with several layers, we may have MAC PDU of size bigger than 64KB,
which does not fit into a UDP buffer, destroying macpdu2wireshark.
Let's add an option to dump to a pcap file instead of using UDP packets.
The DLT 252 magic is used (check wireshark documentation to understand).
Run macpdu2wireshark with -h to see how to configure wireshark to read
the produced files.
several fixes and cleanup for nrLDPC_coding_t2
Newer DPDK driver versions may directly provide the internal HW mbuf in the
dequeued structure. So don't try to free the mbufs from that dequeued structure,
but the ones we allocated. Also, this mbuf has an offset to its output data, we
must consider this when accessing the output data.
Main contents of this MR:
- support newer DPDK versions
- make sure to free allocated mbufs
- fix q_bufs memory leak
- use rte_pktmbuf_mtod_offset() to consider offset when accessing output data
- convert the correct number of LLRs from 16 Bit to 8 Bit
- remove unused variables and functions
- some more code cleanup
ntn-UlSyncValidityDuration in SIB19 from Spec 38.331 v17.12
A validity duration configured by the network for assistance information which indicates the maximum time duration
(from epochTime) during which the UE can apply assistance information without having acquired new assistance information.
The unit of ntn-UlSyncValidityDuration is second. Value s5 corresponds to 5 s, value s10 indicate 10 s and so on.
ntn-UlSyncValidityDuration-r17 ENUMERATED{ s5, s10, s15, s20, s25, s30, s35,s40, s45, s50, s55, s60, s120, s180, s240, s900}
Implementation of epochtime is under discussion.
It can be configured in configuration file according to the above enumeration. For GEO - 240s, MEO - 20s, LEO-5s can be used.
In NR with several layers, we may have MAC PDU of size bigger than 64KB,
which does not fit into a UDP buffer, destroying macpdu2wireshark.
Let's add an option to dump to a pcap file instead of using UDP packets.
The DLT 252 magic is used (check wireshark documentation to understand).
Run macpdu2wireshark with -h to see how to configure wireshark to read
the produced files.
This change adds lengths checks to the received registration reject
message and also performs a bounds check for the received cause.
Since the cause is not checked, any string in the memory can be
dereferenced, possibly leading to DoS.
Signed-off-by: Eduard Vlad <eduard.vlad@rwth-aachen.de>
The change addresses the SM message type retrieval for DL NAS Transport
messages. The assumption of an offset 17 = 7 (MM Sec) + 3 (MM Plain) + 1
(IEI) + 2 (Len) + 4 (SM) is correct.
However, if the DL NAS Transport is received in a plain header, the
lengths would not add up anymore. (This is not complying with the
standard, so not allowed, but possible). The check for the length is
necessary to not process arbitrary memory contents beyond the
`pdu_buffer`.
Signed-off-by: Eduard Vlad <eduard.vlad@rwth-aachen.de>
The DPDK driver may directly provide the internal HW mbuf in the dequeued structure.
So don't try to free the mbufs from that dequeued structure, but the ones we allocated.
Integration: `2025.w20`
Closes#826 and #884
See merge request oai/openairinterface5g!3438
* !3168 Improvements for LDPC encoding
* !3386 E1 Bearer Context Release enc/dec lib and unit test
* !3394 Fix Liteon with MTU 1500 and update the FHI docs
* !3437 CI: RFsim F1/HO: Use hanging-workaround to avoid blocking of second client
* !3384 Add enc/dec library and unit test for E1 Bearer Context Modification Failure
* !3418 Use common function to generate CSI-RS signal
* !3379 Add physim tests into ctest framework
* !3420 Added intercommunication between namespaces
* !3422 Tutorials: updates for NR SA Tutorials
* !3436 Beam switching small fixes
* !3439 Fix RRC resources periodicity determination according to number of slots per period
* !3434 Remove EPC/UE main.py parameters
* !3423 Fix PDSCH and PUSCH BWP Start and Size when PXSCH is scheduled with a DCI format x_0 in any type of PDCCH common search space
* !3442 Fix UL chanel estimates mapping in 2-layer MMSE receiver
Fix UL chanel estimates mapping in 2-layer MMSE receiver
This MR addresses a degradation in UL throughput observed in 4x4 MIMO
tests, starting from 2025.w17.
The issue was traced to incoherent indexing in the ul_ch_estimates_ext
when handling 4-antenna UL configurations.
Fix PDSCH and PUSCH BWP Start and Size when PXSCH is scheduled with a DCI format x_0 in any type of PDCCH common search space
- Fix PDSCH and PUSCH BWP Start and Size when PDSCH/PUSCH is scheduled
with a DCI format x_0 in any type of PDCCH common search space
- Fix resource block assignment information (RIV field) for DCI format
x_0 when scheduling in any type of PDCCH common search space
Fix RRC resources periodicity determination according to number of slots per period
Otherwise we may end up in scenarios where some channels would end in
the wrong TDD slot type
Tutorials: updates for NR SA Tutorials
- Update links for the latest Ubuntu 24.04.2 LTS iso file
- Update docker install to the latest instructions on the official
website
- Update UHD to v4.8.0.0
- Add support for 'default'/"empty" DNN to CN5G configuration file
* Add support for 'default' DNN to CN5G configuration file (that
will also be used when DNN is not available, "empty" DNN). This
configuration will allow most of the COTS UE to get PDUSession
without any APN configuration made by the user
* The 'default'/"empty" DNN configuration support was added in
oai/cn5g/oai-cn5g-amf!343
Add physim tests into ctest framework
Convert physim testcases listed in
cmake_targets/autotests/test_case_list.xml into ctest. Note: Tests for
dlsim_tm4 are excluded, due to compilation issues.
CTest evaluates success based on return code: '0' = pass, non-zero =
fail. For some simulators, the return code is non-zero even when the
test is successful (as indicated by success messages in the test logs).
For some simulators, the return code is always '0'. This inconsistency
has been address in the first two commits of this MR.
To build and execute these tests:
- using cmake
cd openairinterface5g
mkdir build && cd build # you can also do that in cmake_targets/ran_build/build
cmake .. -GNinja -DENABLE_PHYSIM_TESTS=ON && ninja tests
ctest
- using build_oai: physim-related ctests are activated when PHY
simulators are built (use build_oai with '-P' or '--phy_simulators'
option)
cd openairinterface5g/cmake_targets
./build_oai --ninja --phy_simulators
cd ran_build/build
ctest
Link to newly created 4g and 5g RAN-Physim-Cluster pipelines:
- RAN-Physim-Cluster-4G: https://jenkins-oai.eurecom.fr/job/RAN-Physim-Cluster-4G/
- RAN-Physim-Cluster-5G: https://jenkins-oai.eurecom.fr/job/RAN-Physim-Cluster-5G/
Initially we were testing SNR from -3 to 7 dB, in recent runs PUCCH test
succeeds at SNR = 0 or 1 dB. Starting at higher SNR helps to reduce test
runtime. Set maximum SNR to 7dB, as it was done in the initial test scenario,
to ensure that possible performance degradation is detected.
The cls_physim1.py is no longer needed. Function for physim deployment has
been migrated to the Cluster class. Log analysis functionality has been
moved to the Analysis class.
Set the CMAKE_RUNTIME_OUTPUT_DIRECTORY CMake option during the OAI build
to control the location of runtime target files. This ensures that ctest
can locate necessary executables after they are copied to the target
Docker image.
Convert physim testcases defined in cmake_targets/autotests/test_case_list.xml
into CTest based tests. These test are activated when '-DENABLE_PHYSIM_TESTS=ON'
CMake flag is set.
Note: Tests for dlsim_tm4 are excluded, due to compilation issues.
CTest evaluates success based on return code: '0' = pass, non-zero = fail.
The following table outlines the physim executables, their success expressions
(`expr_true`), and the return codes for success (`ret_success`) and failure
(`ret_fail`). The `expr_true` is used in test_case_list.xml to check for test
results.
| test_exec | expr_true | ret_succ | ret_fail |
| ------------- | -------------- | --------------- | ----------------- |
| dlsim | passed | 0 | -1 |
| ulsim | passed | 0 (ret) | 1 (ret) |
| ldpctest | BLER 0.000000 | 0 | 1 |
| polartest | BLER= 0.000000 | 0 | 1 |
| nr_pbchsim | PBCH test OK | 0 | 1 |
| nr_dlsim | PDSCH test OK | 0 | 1 |
| smallblocktest| BLER= 0.000000 | 0 | 1 |
| nr_ulschsim | PUSCH test OK | 0 (n_errors) | n_errors |
| nr_pucchsim | PUCCH test OK | 0 | 1 |
| nr_ulsim | PUSCH test OK | 0 (ret) | -1 (ret) |
| nr_prachsim | PRACH test OK | 0 (prach_errors)| > 0 (prach_errors)|
| nr_psbchsim | PSBCH test OK | 0 (errors) | > 0 (errors) |
Add CMake flag "ENABLE_PHYSIM_TESTS=ON" when building OAI with "-P"
or "--phy_simulators" option. This allows physim-related ctest to
be executed from build directory.
Add dependency on coding lib for all 4G physims
Setting the DEBUG_UE_TIMING flag caused a flood of UE timing logs, resulting
in dlsim output logs as large as 1.5MB per test in CI. This commit comments
out the line where we set the flag to reduce log verbosity.
- Change return value of nr_dlsim, nr_pbchsim and nr_pucchsim to:
- Return '0' if test succeeds (indicated also by "PDSCH/PBCH/PUCCH test
OK" in the test log).
- Return '1' if test fails.
- Updated polartest, smallblocktest, and ldpctest to check BLER and return
appropriate status:
- Returns '0' if BLER equals 0.000000 (indicating success).
- Returns '1' for all other BLER values (indicating failure).
- This change improves consistency in return values across the test physims.
Add enc/dec library and unit test for E1 Bearer Context Modification Failure
This MR is adding:
- the enc/dec library
- unit test
- handler and callback in stack
For the E1 Bearer Context Modification Failure.
Fix Liteon with MTU 1500 and update the FHI docs
- Closes#884 - needed to update the max fragments needed for
transmission of one symbol; technically, 5 are enough but due to wrong
equation in the xran F release we had to increase to 6
- Clarify packet length for VFs
- Update Foxconn doc and config file with MTU set for jumbo frames
- Update Benetel docs with new version v1.2.2
E1 Bearer Context Release enc/dec lib and unit test
This MR is adding:
- the enc/dec library
- unit test
And adopting the lib in stack, for the E1 Bearer Context Release.
Improvements for LDPC encoding
AVX512 modifications for LDPC encoding: interleaving, ZC384 BG1, output
formatting for encoder, segmentation (memcpy instead of loop). some
improvement in TX for aarch64 in same places where AVX512 support was
added. Also, rate matching and interleaving are done on bytes containing
8 segments and reformatting of the output is done at the end of segment
processing instead of after ldpc encoding.
This improves the overall performance of the NR DL transmitter in gNB
See the merge request description for numbers.
Release all SDAP entities for a UE in nr_rrc_going_to_IDLE().
With this change the SDAP entities of the UE are cleaned up
when going into RRC_IDLE, including tun sockets, threads etc.
A new SDAP entity is created when re-attaching to the network.
- modify retrieve_ldpc_enc_op() to store encoded results in a packed format
- add timing measurements for T2 encoder
- add simde implementation for bit reversal
- Introduce new bit reversal implementation using simde_mm_gf2p8affine_epi64_epi8
instruction, based on https://wunkolo.github.io/post/2020/11/gf2p8affineqb-bit-reversal/.
This implementation requires GFNI and AVX512VL support on the target machine.
1. The encoder writes the output in sequence after the encoding tasks completed instead of writing within the tasks.
2. Simplify the output writing to make it more readable.
Co-authored-by: Laurent Thomas <laurent.thomas@open-cells.com>
There was a risk of a race condition between encoding tasks on the output array.
It could be that two task compete in writing a word at the border of their respective segment groups.
This commit offers to solve this issue by retaining the tail word in a struct that is returned after task completion so that segment group border can be fixed after completion of all the tasks.
Comes with additional cleanups of nrLDPC_coding_segment_encoder:
1. Move the section of code dedicated to writing to the encoding library output to a separate function.
2. Remove bit interleave debug in AVX512VBMI case of output writing for improving code readability.
1. nrLDPC_coding_segment_encoding: Clarifying encoder parameters
The way the encoder implementation params was used could be made clearer:
* `macro_num` was always used in order to calculate segment indexes.
It is clearer to pass directly the first segment index.
* The initialisation of a common implementation parameters structure can be made clearer.
2. nrLDPC_coding_segment_encoder: Remove multi segment dimension in encoder output
The output of `LDPCencoder` was a 2D unsigned char array.
But all the segments were actually packed in the first segment, 8 bits of different segments per byte of the first segment.
So the first dimension was useless. This commit removes this dimension.
3. nrLDPC_coding_segment_encoder: Rename `nrLDPC_prepare_TB_encoding` into `nrLDPC_launch_TB_encoding`
4. nrLDPC_coding_segment_encoder: Remove the useless second rate matching for E2, one rate matching with max(E, E2) does the job.
5. nr_interleaving_ldpc: cleanup
Rewrite code to use different SIMD sizes in a linear fashion.
This means cascading preprocessor directives are used to start from a high SIMD size an decrease it progressively.
6. ldpc_encoder_optim8segmulti: linear usage of SIMD
Use cascading preprocessor directives to include different SIMD sizes and types depending on which are available on the system.
The different loops use a common index that is progressively incremented.
Also add AVX512 version of bits distribution from 8 segments into one byte.
Co-authored-by: Laurent Thomas <laurent.thomas@open-cells.com>
Since this branch aims to bring all the encoded segments packed and contiguous,
it doesn't make anymore sense to have one output array per segment.
Therefore this commit moves the output array to the TB instead of the segment and adapts its size.
TODO: Adapt the size of f where it is relevant.
1. nrLDPC_coding_segment_encoder: pointer not aligned on 64 bits
An undefined behavior was happening because of a shift on a __m64 which
was actually a uint32_t which was not aligned on 64 bits.
This commit suggests a fix by properly loading into a __m64 with _mm_set_pi32
before performing the shift.
2. nr_rate_matching: Filler bits detection
Previously, if the bit selection was reaching Ncb and restarting selection from the beginning of encoded data, the filler bits were detected by testing the bytes again NR_NULL which was equal to 2.
But on this branch the bits of up to 8 segments are stored in one byte while doing rate matching so that one byte could be tested to be a filler while it is not.
So this commit changes the way to test filler bits.
Instead of relying on NR_NULL, bit selection now relies on the offset and size of filler bits.
3. nr_ulsch_coding: missing filling f with zeros
The array `f` of the UE UL HARQ process was not filled with zeros between transmissions.
This is a problem if the encoder does not properly overwrite its output.
In order to avoid such situation, this commit adds a memset to fill `f` with zeros before passing it to the encoder.
4. nrLDPC_coding_segment_encoder: missing init of f to zeros
In the encoder, `f` is not filled with zeros before being used.
`f` is instead somehow filled with arbitrary values.
When writing to `output` by 64 bit vectors, some arbitrary bits may be added after the segment.
Then the arbitrary added ones are not overwritten when writing the next segment because of writing with a logical or.
This commit properly fills `f` and `f2` with zeros.
5. nr_ulschsim & nr_dlschsim: Adapt modulation to new encoder output
The QPSK symbols that are feed to the channel model of nr_dlschsim were determined based on the bytes of the encoder output.
With the new output of the encoder, it had to be reworked to determine the QPSK symbols based on the bits of the encoder output.
1. 3GPP Rate-matching/interleaving on 8-segment blocks, deinterleaving at output of multi-segment processing.
2. Bit-packing done in nrLDPC_coding_segment_encoder.c now instead of nr_scrambling.
Interestingly, it improves performance significantly too.
Tested for AVX512 only for now.
Avoid the use of simde_mm_sign_epi8 which is inefficient on aarch64.
Decoding times are significantly improved on aarch64.
Co-authored-by: Romain Beurdouche <romain.beurdouche@eurecom.fr>
Add --allowerasing, which will downgrades some packets in order to
satisfy LLVM dependencies.
When building the docker image for clang, CI fails with
Error:
Problem: llvm-18.1.8-3.el9.i686 from ubi-9-appstream-rpms does not belong to a distupgrade repository
- package llvm-toolset-18.1.8-3.el9.x86_64 from ubi-9-appstream-rpms requires llvm = 18.1.8, but none of the providers can be installed
- package llvm-18.1.8-3.el9.x86_64 from ubi-9-appstream-rpms requires llvm-libs(x86-64) = 18.1.8-3.el9, but none of the providers can be installed
- package llvm-18.1.8-3.el9.x86_64 from ubi-9-appstream-rpms requires libLLVM.so.18.1()(64bit), but none of the providers can be installed
- package llvm-18.1.8-3.el9.x86_64 from ubi-9-appstream-rpms requires libLLVM.so.18.1(LLVM_18.1)(64bit), but none of the providers can be installed
- cannot install both llvm-libs-18.1.8-3.el9.x86_64 from ubi-9-appstream-rpms and llvm-libs-19.1.7-2.el9.x86_64 from @System
- package mesa-dri-drivers-24.2.8-2.el9_6.x86_64 from @System requires libLLVM.so.19.1()(64bit), but none of the providers can be installed
- package mesa-dri-drivers-24.2.8-2.el9_6.x86_64 from @System requires libLLVM.so.19.1(LLVM_19.1)(64bit), but none of the providers can be installed
- package mesa-libGL-24.2.8-2.el9_6.x86_64 from @System requires libgallium-24.2.8.so()(64bit), but none of the providers can be installed
- package mesa-libGL-24.2.8-2.el9_6.x86_64 from @System requires libgallium-24.2.8.so(libgallium-24.2.8.so)(64bit), but none of the providers can be installed
- package mesa-libGL-devel-24.2.8-2.el9_6.x86_64 from @System requires mesa-libGL(x86-64) = 24.2.8-2.el9_6, but none of the providers can be installed
- conflicting requests
- problem with installed package mesa-libGL-devel-24.2.8-2.el9_6.x86_64
(try to add '--allowerasing' to command line to replace conflicting packages or '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages)
So when trying to install llvm-toolset from docker/Dockerfile.clang.rhel9,
we have a conflict because this installs 18.1 from ubi-9-appstream-rpms,
but various mesa packets have llvm 19.1.
1. I don't understand why we have mesa installed (no graphics system?)
2. --allowerasing downgrades the relevent mesa package(s)
Alternatively, we would need to select 19.1 when installing
llvm-toolset, but I don't know how to do that.
As per CUS spec, the MTU can be 1500 or 9000 B, where MTU = IQ data format.
Packet length = ethernet header + RTE_PKTMBUF_HEADROOM + MTU
However, xran assumes different definitions of the MTU:
(1) in xran_init_mbuf_pool(): MTU = ethernet header + IQ data format;
(2) in xran_get_num_prb_elm(), xran_init_PrbMap_from_cfg(), xran_init_PrbMap_from_cfg_for_rx(), xran_init_PrbMap_by_symbol_from_cfg(): MTU = complitely wrong (as the IQ data format is not well included).
Additionally, xran assumes that the max MTU 9600 B, instead of 9000 B as per spec.
Nevertheless, I left 9600 B in all config files and docs due to wrong calculation of (2) for the total number of PRBs per fragment.
1. Closes#884 - increase the XRAN_MAX_FRAGMENT from 4 to 6 (sufficient for MTU 1500 with compression 8b)
2. Add new firmware version that supports jumbo frames
3. Update the config file to align with the new Liteon unit in our lab - center frequency, jumbo frames, compression and RU MAC address,
as well as the max DL MIMO layers.
Add support for 'default' DNN to CN5G configuration file (that will also be used when DNN is not available, "empty" DNN). This configuration will allow most of the COTS UE to get PDUSession without any APN configuration made by the user
The 'default'/"empty" DNN configuration support was added in https://gitlab.eurecom.fr/oai/cn5g/oai-cn5g-amf/-/merge_requests/343
Integration: `2025.w19`
Closes#852, #952, and #957
See merge request oai/openairinterface5g!3427
* !3409 Correctly handle minimum RB condition in MAC
* !3421 Fix DMRS for PUCCH format 2
* !3424 limit the number of HARQ processes in case of DCI00 and 10
* !3116 ue txData more contextual, but still global as it is entangled with usrp driver
* !3408 Handling 2 search spaces per slot in SIB1
* !3419 PRACH configuration index warning
* !3429 CI: Add `-l` option for the UL iperf test
* !3381 Add 5GMM Authentication Failure enc/dec lib and unit test
CI: Add `-l` option for the UL iperf test
In this MR, we set the packet length to 1428 bytes for UL iperf3 testing using
the -l option to prevent packet fragmentation. Fragmentation is causing packet
drops between the gNB and the UPF, leading to failed UL throughput tests in CI.
Add 5GMM Authentication Failure enc/dec lib and unit test
This MR is introducing the 5GMM Authentication Failure message library as per
8.2.4 of 3GPP TS 24.501. This message is sent from UE to network under certain
conditions. The message is also introduced in stack and is send if the received
ngKSI already in use.
- add new library for 5GMM Authentication Failure enc/dec and unit test
- introduce handler and generate function for NAS Authentication Failure
store ngKSI
- send Authentication Failure if ngKSI is already associated with one of
the 5G security contexts stored in the UE
Closes#852
After capturing the FH packets, we observed that the RU supports the MTU value for jumbo frames.
Therefore, no fragmentation needed on DL.
Co-authored-by: Teodora Vladic <teodora.vladic@openairinterface.org>
ue txData more contextual, but still global as it is entangled with usrp driver
- txData buffer is global and entangled even in usrp oai driver because of tx
thread feature
- it also makes weird combination with continuous tx usrp bug workaround
- this MR makes most of the calls contextual but keep the globakl txData
- later a MR should remove the global and tackle it with proper context, but we
need to modify gNb, UE, 4G and probably all oai drivers
Fix DMRS for PUCCH format 2
This MR fixes the DMRS for PUCCH format 2.
While at the OAI-UE we have:
uint16_t startingPRB = pucch_pdu->prb_start + pucch_pdu->bwp_start;
uint idxGold = startingPRB >> 2;
uint32_t *seq = gold_cache(temp_x2, idxGold + pucch_pdu->prb_size);
At gNB side, it was missing pucch_pdu->bwp_start, i.e., it was:
uint32_t *sGold = gold_cache(x2, pucch_pdu->prb_start / 4 + ngroup / 2);
uint8_t *sGold8 = (uint8_t *)(sGold + pucch_pdu->prb_start / 4);
This MR was tested with COTS UE with a bwp_start other than 0, and now PUCCH format 2 is being decoded correctly.
Move this message down, at the end of the function, if no code path
exists under which msg3 allocation might fail despite this log having
been printed.
Assume the minimum grant (min_rb) size to be the bandwidth part size. As
an example: rbStart 0, min_rb=bwpSize=106. This should pass, hence
modify these two conditions.
Co-authored-by: Robert Schmidt <robert.schmidt@openairinterface.org>
The functions nr_generate_csi_rs() and nr_ue_generate_csi_rs() are
identical. This commit removes nr_ue_generate_csi_rs() and moves
nr_generate_csi_rs() to nr_phy_common_csirs.c so both gNB and UE can use
the same function.
Integration: `2025.w18`
Closes#953
See merge request oai/openairinterface5g!3413
* !3385 Add enc/dec lib for E1 Bearer Context Setup Failure
* !3410 Avoid segmentation fault when testing trigger reestablishment and there is no DRB[0] established
* !3411 Remove assert for SRI-PUSCH-PowerControl
* !3291 Improvements in handling UE context in gNB DU
* !3416 Signal gNB-DU config update CellStatus from DU to CU
* patch to fix memory leak on DRB_ToAddModList
* update phytest-timing thresholds
Signal gNB-DU config update CellStatus from DU to CU
Add the cell status to gNB-DU configuration update message, including
test. Use the gNB-DU configuration update to signal the cell status in
the stack.
This IE was not included in a previous refactoring round, but is at
least necessary to be decoded when interoperating with the OSC O-DU.
Improvements in handling UE context in gNB DU
The goal of this MR is to improve the handling of UE context in gNB DU.
To achieve this goal, the UE structure is created as soon as the gNB
receive a PRACH indication. At that stage the UE is placed in a new
structure containing UEs performing RA, untill RA is complete where it
is moved to the list of connected UEs. To simplify the code and to
improve the handling of initial procedures (see #751), DCI 10 and DCI 00
is used at every stage until the DU receives from CU the indication of
UE RRC reconfiguration being completed.
Remove assert for SRI-PUSCH-PowerControl
SRI-PUSCH-PowerControl is not implemented at this point but its enough
to warn about incorrect power control behavior rather than assert on the
configuration.
Closes#953
This is preparatory work to allow NSA-like modes to be used over F1 in
the future. Notably, it fills the F1 message for UE context setup with
GTP TEID, and fills additional information to "make the F1 encoder
happy" (fill in QFI etc). Also, provide some F1 fixes to make this work.
Remove stale UE connections, if relevant.
sdap_tun_read_thread needs to know if we are gNB/UE. Previously, we
passed this into the thread, but the next commit also needs to for
interface termination, where this info is not available. So, for noS1
mode, pass this in.
Add functionality to trigger the addition of a new RRC UE context (in
the CU) for NSA modes, using F1. This commit makes do-ra and phy-test
modes work. "True" NSA will work in the next commit, which also sends
the X2 addition request answer message.
Use the gNB-DU configuration update to signal the cell status in the
stack. At the DU, modify the code to always send this message --
previously, we only sent this message if a SIB1 update was necessary,
but now it's always, only including SIB1 updates if necessary.
At the CU, as we don't really have a use as of now, print the
information, but don't do anything with it.
Add enc/dec lib for E1 Bearer Context Setup Failure
This MR is adding:
- the enc/dec library
- unit test
- handler and callback in stack
For the E1 Bearer Context Setup Failure.
- rewrite add_UE_to_list() and rewrite remove_UE_from_list() to simplify
list handling
- return pointer from get_new_nr_ue_inst(); it's completely freed by
delete_nr_ue_data()
- have add_new_UE_RA() add UE context to access list; remove with
nr_release_ra_UE()
- have add_connected_nr_ue() only add UE to connected list; to move from
access to connected use transition_ra_connected_nr_ue(); remove with
mac_remove_nr_ue() as previously
- free memory on problems during RA
- add some documentation
- in NSA/HO: check for pre-configured RA process
- there are asserts in all functions to clarify when a UE has RA
In phy-test and do-ra modes, we will trigger a UE context creation after
F1 Setup (because the DU is ready), in a later commit. However, before
this commit, E1 is started after the gnb_app (which triggers F1 Setup).
E1 starts an (integrated) CU-UP; if the E1 Setup arrives after the F1
setup (which creates a UE context), then the E1 setup handler will drop
the newly created RRC context for a do-ra/phy-test mode.
Avoid/minimize this by starting E1 first, so that E1 setup is done
before F1 Setup is completed (this does not make sure the problem does
not happen, but lowers the risk of the above problem).
SRI-PUSCH-PowerControl is not implemented at this point but its enough
to warn about incorrect power control behavior rather than assert on the
configuration.
This commit does not introduce the callback on the CU-UP to trigger
a Bearer Context Setup Failure when the setup of the bearer context was unsuccessful.
This should be handled properly in the stack e.g. in e1_bearer_context_setup (a comment
in the code says "We assume all DRBs to setup have been setup successfully, so we always
send successful outcome in response and no failed DRBs")
Integration: `2025.w17`
Closes#947
See merge request oai/openairinterface5g!3403
* !3377 Fix all direct MAC memory leaks
* !3397 Fix for MIB/SIB gNB delay mechanism
* !3399 SIBs in DL slot check
* !3401 F1AP: Allocate gNB_DU_ID before storing ID
* !3380 Issue 947 and compilation improvements
* !3391 small bugfix for T tracer
* !3261 Add Bearer Context Modification Request/Response enc/dec lib and adopt in stack
* !3178 mod: refactor PHY multiplications
* !3382 Improve radio for Metanoia RU (and likely others)
* !3388 Update CN5G images tags to the latest release in all CI pipelines
* !3351 Fix ASN1 struct double free
* !3405 Fix for NR UE DLSCH decoding barrier in case of no feedback
* !3404 Polar: remove dead code and a wrong comment
Polar: remove dead code and a wrong comment
a file code duplicated and no more used a comment is wrong:
uint16_t x = INFINITY; is wrong, the gcc comment is true
uint16_t x= INFINITY; sets x=-32768 because it is truncature of 0x7FFFFF
add SIMD for the top lines when i run polartest
Fix for NR UE DLSCH decoding barrier in case of no feedback
In !3291 NTN CI RFsim test fails with the UE being stuck. After some
investigation, this seems to be caused by the scenario where there is no
feedback for DLSCH. In that case there is no need to wait for DLSCH
being completed before generating feedback (there is no feedback).
Fix ASN1 struct double free
When paging, RA and other SI have same PDCCH search space, we should
free the struct once and reset the other pointers to NULL.
Update CN5G images tags to the latest release in all CI pipelines
This MR is updating the tags of the CN5G docker images to the latest
release v2.1.9, for all CI pipelines.
Improve radio for Metanoia RU (and likely others)
We introduced a regression that lowered the achievable DL throughput
with at least the Metanoia RU (i.e., in the configuration and the UE
that we use). git bisect showed up one commit, which does not seem
necessary. We just revert this commit, as it improves the throughput and
does not seem to have a negative impact on performance.
Further, increase RLC buffers a bit. Limit 7.2 pipeline number of layers
to 2.
With PMI reporting working (see HEAD^^), it seems that four layers put
two much processing strain on the machine (cacofonix), which asserts
immediately. In tests, it was found that the same test throughput
(600Mbps) can be achieved with two layers, while not crashing the
machine.
The UE stores PDCCH search spaces from the network in NR_BWP_PDCCH_t
struct within NR_UE_MAC_INST_t. After storing, the pointers otherSI_SS,
ra_SS and paging_SS are updated to point to the stored SS. Multiple
pointers could point to the same stored SS struct depending on
configuration. Then when the UE wants to release the SS, the pointers
are used to free the stored SS using ASN_STRUCT_RESET(). If multiple
pointers point to the same SS, calling ASN_STRUCT_RESET() on all
pointers would lead to double free. So one needs to check for dangling
pointer before freeing.
Instead of using pointers and assigning them during configuration, we
use SS id for otherSI_SS, ra_SS and paging_SS to retrieve the pointers
whenever needed. When the UE wants to release the SS, we make them -1
indicating an invalid SS id.
Add Bearer Context Modification Request/Response enc/dec lib and adopt in stack
This MR is introducing the Bearer Context Modification Response enc/dec
library with relative unit test, and it is also adopting it in the
stack. Also:
- Refactor Security Information IE decoding function
- Adopt Bearer Context Modification Request lib in stack (introduced in
!3219 (merged))
small bugfix for T tracer
small bugfix: missing beam index when addressing txdataF in T tracer
command. Also changed order of if(gNB->phase_comp) so that data is
exported in any case.
Issue 947 and compilation improvements
This MR started with a small commit (03c7f151) to close#947. Little did
I know that I would be taken in a long journey through OAI compilation
hell.
F1AP: Allocate gNB_DU_ID before storing ID
Update the test so it would catch that bug. Check in eq_() that both
gNB_DU_IDs would be present, or not, using xor.
Found while interop testing with OSC DU.
Fix all direct MAC memory leaks
This MR fixes many memory leaks in the MAC that are otherwise shown by
asan if the gNB is started. UEs can be connected and it seems the MAC
does not leak memory. It also fixes a number of memory problems where
e.g., the generation of SIB1 "steals" memory from the
ServingCellConfigCommon. See the commits for more details.
Note that this still leaves behind a lot of memory after calling the new
function mac_top_destroy_gNB(). To see them, add free(mac); in that
function. However, there are no "direct leaks", so it would be feasible
to still clean up (it's just that we don't do it, yet).
I checked. In a "standard" configuration (FR1, 30kHz), the memory leaks
come basically from RRC. Also, the F1 UE context setup message leaks
some memory, which we will handle in the future by adding
encoding/decoding functions that with corresponding utility (free, copy)
functions. On the other hand, the frequent F1 messages (UL/DL RRC
Message Transfer) do not leak memory (they have the utility functions).
A final commit just makes the inability to write nrRRC_stats.log,
nrL1_stats.log, and nrMAC_stats.log, non-fatal to the gNB.
Pass a "type" of RLC operational mode, from which split-type/gNB/UE
decision is derived.
Co-authored-by: Robert Schmidt <robert.schmidt@openairinterface.org>
prepare_scd() sets up memory for possible dedicated BWPs to be set up.
If they are not used, they are freed in fix_scd(). [1]
There are two problems:
1. in prepare_scd(), multiple structures are allocated once (for
multiple elements), but inserted once. When trying to free those, the
logic of ASN.1 is to free list elements individually, but then we try
to call free() on each element of the list that has been allocated in
one go. Fix this by doing multiple allocations to be in line with
ASN.1 logic.
2. in fix_scd(), free recursively all data structures, not only the
sequence element itself.
[1] this is horrible. We should only allocate memory if we actually need
it, but let's fix the more urgent problem of memory leaks first. Fixing
the logic problem would be more involved.
Integration: `2025.w16`
Closes#949, #929, and #941
See merge request oai/openairinterface5g!3392
* !3207 Create nrUE network interface from SDAP (rebased)
* !3293 Cleanup and refactor initial gNB configuration
* !3326 Enable SSB-SINR based CSI reporting
* !3330 NR UE: consider the ratio of PUSCH EPRE to DMRS EPRE when calculating PUSCH DMRS power scaling
* !3376 Correct block_length to Kprime for LDPC decoder
* !3390 fix IP address in 4G UE
* !3071 time management module
* !3254 Follow up on NAS Registration Accept lib
* !3121 Bugfix for number of PRBs in PUCCH format 2
* !3387 fix NTN LEO scenario
* !3393 rejecting DRB if not configured in PDCP-Config
* !3372 Add Delay Mechanism for Initial MIB/SIB Transmission in gNB Scheduler
fix NTN LEO scenario
NR UE: in nr_slot_fep() perform FO compensation in local tmp_dft_in
array instead of global rxdata array.
This avoids problems if nr_slot_fep() is called more than once for an
OFDM symbol.
Add Delay Mechanism for Initial MIB/SIB Transmission in gNB Scheduler
- Delay MIB/SIB in gNB until PRACH noise converges
- Remove the first PRACH random access attempt delay in NR UE
Bugfix for number of PRBs in PUCCH format 2
[TS 38.213 - Section 9.2.1 PUCCH Resource Sets] If the format indicates
PUCCH-format2 or PUCCH-format3, the PUCCH format configured for a PUCCH resource
is PUCCH format 2 or PUCCH format 3, respectively, where the PUCCH resource also
includes a number of PRBs provided by nrofPRBs, a number of symbols for a PUCCH
transmission provided by nrofSymbols, and a first symbol for the PUCCH
transmission provided by startingSymbolIndex.
[TS 38.213 - Section 9.2.3 UE procedure for reporting HARQ-ACK] If a UE transmits
a PUCCH with O_ACK HARQ-ACK information bits and O_CRC bits using PUCCH format 2
or PUCCH format 3 in a PUCCH resource that includes M_PUCCH_RB PRBs, the UE
determines a number of PRBs M_PUCCH_RB_min for the PUCCH transmission to be the
minimum number of PRBs (...)
[TS 38.213 - Section 9.2.5.1 UE procedure for multiplexing HARQ-ACK or CSI and
SR in a PUCCH] If a UE transmits a PUCCH with O_ACK HARQ-ACK information bits,
O_SR = ⌈log2(K+1)⌉ SR bits, and O_CRC CRC bits using PUCCH format 2 or PUCCH
format 3 in a PUCCH resource that includes M_PUCCH_RB PRBs, the UE determines
a number of PRBs M_PUCCH_RB_min for the PUCCH transmission to be the minimum
number of PRBs (...)
[TS 38.213 - Section 9.2.5.2 UE procedure for multiplexing HARQ-ACK/SR/CSI in
a PUCCH] If a UE has HARQ-ACK, SR and wideband or sub-band CSI reports to
transmit and the UE determines a PUCCH resource with PUCCH format 2, or the UE
has HARQ-ACK, SR and wideband CSI reports to transmit and the UE determines a
PUCCH resource with PUCCH format 3 or PUCCH format 4, where (...) the UE
transmits the HARQ-ACK, SR, and CSI reports bits by selecting the minimum number
PUCCH M_PUCCH_RB_min of the M_PUCCH_RB PRBs satisfying (...)
[TS 38.213 - Section 9.2.5.2 UE procedure for multiplexing HARQ-ACK/SR/CSI in a
PUCCH] If a UE has one or more CSI reports and zero or more HARQ-ACK/SR
information bits to transmit in a PUCCH where the HARQ-ACK, if any, is in
response to a PDSCH reception without a corresponding PDCCH; if any of the CSI
reports are overlapping (...); else, the UE transmits the
O_ACK + O_SR + O_CSI + O_CRC bits in a PUCCH resource provided by
pucch-CSI-ResourceList and determined as described in clause 9.2.5
Therefore, the number of PRBs to be used by PUCCH-format2 is M_PUCCH_RB_min,
except if we have zero HARQ-ACK bits, or if we have any HARQ-ACK, is in response
to a PDSCH reception without a corresponding PDCCH. In this case, we must use
the resources indicated in the pucch-CSI-ResourceList and determined as described
in clause 9.2.5.
In OAI, we have:
asn1cSeqAdd(&csirep->reportConfigType.choice.periodic->pucch_CSI_ResourceList.list, pucchcsires);
Where the resource added to the list corresponds to:
pucchres2->pucch_ResourceId = *pucchressetid;
pucchres2->startingPRB = 0;
pucchres2->intraSlotFrequencyHopping = NULL;
pucchres2->secondHopPRB = NULL;
pucchres2->format.present = NR_PUCCH_Resource__format_PR_format2;
pucchres2->format.choice.format2 = calloc(1,sizeof(*pucchres2->format.choice.format2));
pucchres2->format.choice.format2->nrofPRBs = 8;
pucchres2->format.choice.format2->nrofSymbols = 1;
pucchres2->format.choice.format2->startingSymbolIndex = 13;
Currently, in develop branch, we get these prb_size for PUCCH-format2:
[NR_RRC] NGAP_PDUSESSION_SETUP_RESP: sending the message
[NGAP] pdusession_setup_resp_p: pdusession ID 1, gnb_addr 172.31.0.1, SIZE 4, TEID 1579669408
[NR_MAC] (596.3) pucch_pdu->prb_size = 4
[NR_MAC] (596.4) pucch_pdu->prb_size = 3
[NR_MAC] (600.3) pucch_pdu->prb_size = 4
[NR_MAC] (600.4) pucch_pdu->prb_size = 3
[NR_MAC] (604.3) pucch_pdu->prb_size = 4
[NR_MAC] (604.4) pucch_pdu->prb_size = 3
[NR_MAC] (608.3) pucch_pdu->prb_size = 4
While in QXDM we have Num RB = 8, whenever we have zero HARQ-ACK bits:
UCI Request BMask = ACK_NACK_RPT | CSI_RPT
Start symbol = 13
Num Symbols = 1
Starting RB = 0
REL16 DMRS EN = 0
Dual Pol Status = 0
Num RB = 2
Freq Hopping Flag = HOP_MOD_NEITHER
Second Hop RB = NA
Num HARQ ACK Bits = 1
Num SR Bits = 0
Num UCI P1 Bits = 8
UCI Request BMask = ACK_NACK_RPT | CSI_RPT
Start symbol = 13
Num Symbols = 1
Starting RB = 0
REL16 DMRS EN = 0
Dual Pol Status = 0
Num RB = 3
Freq Hopping Flag = HOP_MOD_NEITHER
Second Hop RB = NA
Num HARQ ACK Bits = 3
Num SR Bits = 0
Num UCI P1 Bits = 13
UCI Request BMask = CSI_RPT
Start symbol = 13
Num Symbols = 1
Starting RB = 0
REL16 DMRS EN = 0
Dual Pol Status = 0
Num RB = 8
Freq Hopping Flag = HOP_MOD_NEITHER
Second Hop RB = NA
Num HARQ ACK Bits = 0
Num SR Bits = 0
Num UCI P1 Bits = 10
UCI Request BMask = CSI_RPT | SR_RPT
Start symbol = 13
Num Symbols = 1
Starting RB = 0
REL16 DMRS EN = 0
Dual Pol Status = 0
Num RB = 8
Freq Hopping Flag = HOP_MOD_NEITHER
Second Hop RB = NA
Num HARQ ACK Bits = 0
Num SR Bits = 1
Num UCI P1 Bits = 11
Therefore, this MR fixes the prb_size, so that the number of PUCCH-format2 PRBs matches correctly.
Follow up on NAS Registration Accept lib
This MR is a follow up on !2984 (merged).
The goal is to enhance the NAS Registration Accept lib:
- Add regression test for NAS Registration Accept: the goal of this test is to
prevent on the decoding of the NAS Registration Accept sent by the OAI CN5G
- Add equality check and free utility functions to NAS Registration Accept
library
- Free NAS Registration Accept after use: heap memory is allocated for this
message during decoding and shall be free after processing
- Remove harcoded Slice Differentiator (SD) in NAS decode_nssai_ie and update
the processing logic: The SD stored in the allowed S-NSSAI list was hardcoded
in the decoding function, however this IE is not mandatory but optional.
Therefore, the check of the decoded message contents should take into account
the presence of the field in the received message and in that scenario, check
the stored value against the one from the UICC. If no SD was received, consider
the UICC SD a valid one.
- Cleanup and other fixes to decode_registration_accept: (1) adopt byte array
(2) move registration result enc/dec to registration accept library (3) check
on buffer lengths (4) add defines whenever necessary (5) simplify the code
Disable the PRACH workaround in NR UE. With the MIB/SIB delay
implemented on the gNB there is no longer a need to delay first
NR UE random access attempt.
This commit introduces a delay mechanism for the first MIB/SIB transmission
in the gNB scheduler to allow PRACH noise estimate to converge stabilize
before first PRACH preamble reception.
Key changes:
- Added the `num_scheduled_prach_rx` variable to gNB_MAC_INST to keep track
of total number scheduled of PRACH receptions. Using uint64_t type to avoid
overflow.
- Updated the `gNB_dlsch_ulsch_scheduler` function to conditionally schedule
MIB/SIB transmissions if `num_scheduled_prach_rx` is at least 100.
The value comes from OAIs implementation of PRACH noise estimate.
fix IP address in 4G UE
The following error was appearing when running LTE UE:
inet_pton(): cannot convert -64.-74.0.2 to IPv4 network address
The allocated address by the core actually is 192.182.0.2.
On my host "char" is signed, leading to the above error (192 and 182
are seen as signed).
Let's force "ip_addr" unsigned and everyone is happy.
Correct block_length to Kprime for LDPC decoder
When compile the OAI by CMake, it shows the following error:
../openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_decoder_CL.c:353:40: error: no member named 'block_length' in 'struct nrLDPC_dec_params'
int block_length = p_decParams->block_length;
NR UE: consider the ratio of PUSCH EPRE to DMRS EPRE when calculating PUSCH
DMRS power scaling
When calculating DMRS scaling ratio, we should consider PUSCH EPRE to DMRS
EPRE according to TS 38.214 Table 6.2.2-1.
Close#929
Enable SSB-SINR based CSI reporting
3GPP 38.331 release 16 specifies that If the field reportQuantity-r16 is present,
UE shall ignore reportQuantity (without suffix). reportQuantity-r16 configures
SSB based SINR as the reporting quantity.
set do_SINR = 1; in gNB params part of the config file to enable SSB based SINR
reporting.
Cleanup and refactor initial gNB configuration
This is follow-up on !3048 (merged). Major changes in this MR:
- Add config functions to reduce redundant code repeated in multiple places in the file
- Add macros to reduce redundant code in gNB configuration
- Refactor RCconfig_NR_NG
- Cleanup obsolete and commented out code
- Refactor includes in executables/nr-gnb.c
- Introduce platform type plmn_id_t for consistency across the stack: F1AP, NGAP can now use the same struct type
- And other minor formatting
Create nrUE network interface from SDAP (rebased)
A rebase of !2485. Dropped a few refactors and SDAP manager changes.
Changes
1. Move tunnel interface read thread to SDAP for gNB (noS1) and UE (noS1 and SA).
2. Hold tunnel interface socket fd in SDAP entity instead of global variable.
3. Handle UE tunnel interface creation and IP configuration from NAS thread in noS1 and SA modes.
4. Modified UE tunnel interface naming scheme. Additional PDU sessions get oaitun_ue<id>p<pdusession_id>.
Closes#941
The following error was appearing when running LTE UE:
inet_pton(): cannot convert -64.-74.0.2 to IPv4 network address
The allocated address by the core actually is 192.182.0.2.
On my host "char" is signed, leading to the above error (192 and 182
are seen as signed).
Let's force "ip_addr" unsigned and everyone is happy.
This commit refactors the TUN interface management by moving its creation
and configuration from the PDCP layer to the SDAP layer for UE.
Key changes include:
- Introduced `tun_generate_ue_ifname` and `tun_destroy` functions for better
TUN interface lifecycle management.
- Added support for creating and destroying UE-specific TUN interfaces in SDAP.
- Refactored `nr_pdcp_module_init` to remove TUN-related logic and moved it
to SDAP.
- Updated NAS and SDAP layers to handle PDU session-specific TUN interface
creation and configuration.
- Enhanced SDAP entity management to include TUN socket handling and thread
lifecycle.
- Updated NAS message handling to initialize default PDU session TUN
interfaces in NOS1 mode.
- Use a single SDAP thread function for gNB and UE
- Allow noS1 mode also in SA on gNB
These changes improve modularity by isolating TUN interface management within
the SDAP layer, aligning with the 3GPP architecture, and simplifying the PDCP
layer.
Co-Authored-By: Robert Schmidt <robert.schmidt@openairinterface.org>
This test verifies that a NAS Registration Accept message, as received
from the OAI CN5G, is correctly decoded and matches the expected output
structure. It ensures that future changes to the NAS decoder do not
break compatibility or correctness with existing decoding behavior.
The SD stored in the allowed S-NSSAI list was hardcoded in the decoding
function, however this IE is not mandatory but optional, therefore
the check of the decoded message contents should take into account
this and check the stored value against the one from the UICC only when the field is present.
If no SD was received, consider the UICC SD a valid one.
Also, add free function to Registration Accept library and adopt in stack to free NAS
Registration Accept after use: heap memory is allocated for this message during decoding
and shall be free after processing.
3GPP 38.331 release 16 specifies that If the field reportQuantity-r16 is present, UE shall ignore reportQuantity (without suffix).
reportQuantity-r16 configures SSB based SINR as the reporting quantity.
set do_SINR = 1; in gNB params part of the config file to enable SSB based SINR reporting instead of the default RSRP based.
Replaced `sprintf` with `snprintf` in gnb_config.c to enhance memory safety
by preventing potential buffer overflows. `sprintf` can cause buffer overflows
by not checking the destination buffer size. In contrast, `snprintf` allows
specifying a maximum buffer size, ensuring no overflow occurs by limiting
the number of characters written, including the null terminator.
Integration: `2025.w15`
Closes#901, #943, #944, #942, and #939
See merge request oai/openairinterface5g!3374
* !3358 RedCap InitialBWP
* !3364 NR UE: fix PRACH generation with frequency resource id not 0 when msg1-FDM > 1 in SIB1
* !3365 nr pdcp: 'count' is 32 bits, use explicit type instead of generic 'int'
* !3366 Fix typo in gNB_scheduler_uci.c
* !3370 Doc: add information on how to avoid a common asan bug
* !3275 NAS service reject
* !3312 NR UE: enable concurrent UL slot processing
* !3368 Encapsulate cmake asn1c call, suppress useless output
* !3336 Fix logging in nr_dlsim
* !3281 Add support for 'dl_min_mcs' and 'ul_min_mcs' configuration parameters
* !3355 NR UE: add support for continuous frequency offset compensation (in particular NTN LEO Doppler)
* !3375 CI CoreNetwork fixes
* !3184 NR SIB2
* !3348 CI: Replacing Devkit server with a Grace Hopper in Aerial pipeline
CI: Replacing Devkit server with a Grace Hopper in Aerial pipeline
Switch servers on the Aerial pipeline from Gigabyte (AMD) to Grace
Hopper (ARM), and make the necessary changes:
- Update XML, YAML, and gnb.conf
- Change the argument passed to the L1 in aerial_l1_entrypoint.sh to be
compatible with the GH
- Update the Aerial setup in TESTBench.md and Aerial_FAPI_Split_Tutorial.md docs
- Decrease the tested throughput due to an issue with the RU. Will open
another MR to increase it once the problem is fixed.
NR UE: add support for continuous frequency offset compensation (in particular NTN LEO Doppler)
- move function add_noise() to file
openair1/SIMULATION/TOOLS/phase_noise.c
- refactor (co)sinus calculation out of phase_noise() into get_sin_cos()
in nr_common.c
- NR UE: continuously estimate the frequency offset using PBCH DMRS
- NR UE: add command line parameter --initial-fo to specify known
initial frequency offset
- NR UE: add support for continuous DL frequency offset compensation
--cont-fo-comp
- NR UE: add support for continuous UL frequency offset
pre-compensation. Depending on the main source of frequency offset,
pre-compensate the UL frequency offset (FO) accordingly. Therefore
modify the flag --cont-fo-comp to accept an integer value, where
* 1 specifies, that the main FO contribution comes from the accuracy of the local oscillator (LO)
* 2 specifies, that the main FO contribution comes from Doppler shift
- NR UE: add PI controller to continuous frequency offset compensation
- rfsimulator: enable and correct NTN LEO doppler simulation
- use SIMD to speed up nr_fo_compensation()
- Extend NTN LEO example in RUNMODEM.md to include continuous Doppler
compensation
- NR UE: in nr_adjust_synch_ue() extend the peak search to +/- cyclic
prefix size, esp. for LEO NTN scenarios the timing drifts during
initial sync, which is mostly compensated with
--ntn-initial-time-drift. But there might be a residual time offset,
and by extending the peak search window we make this more tolerant.
- NR UE: remove unused nr_slot_tx_offset, it is unused since commit
f3e60a14
- NR UE: remove now unnecessary local variable
update_ntn_system_information, directly use
UE->ntn_config_message->update instead
- Update the Aerial tutorial to include Grace Hopper server and add reference to Gigabyte server setup instructions.
- Update the Aerial setup in the TESTBench.md
- encode all SI containers the encoding function gets (it's not the
encoding function's job to enforce semantics)
-
Fixes: 30628b820c ("Add encoding/decoding lib for F1AP Setup Response
(Interface Management)")
In various places, e.g., during initialization (before deployment), we
use the name of the CN object, previously including the IP address.
However, the IP might not be available (because the CN is not deployed),
so we would get warnings at this stage. Avoid this by not looking up the
IP.
There is now one place where we have to look up the IP address
separately.
Also, the exception in initialization might be misleading if we used
{self}, because we complain about no node being present, but the {self}
would include a non-existing node name => do not use it.
Add support for 'dl_min_mcs' and 'ul_min_mcs' configuration parameters
Add support for 'dl_min_mcs' and 'ul_min_mcs' configuration parameters,
they will enforce the gNB scheduler to select always a MCS equal or
above its values
In addition to use a min value for MCS, this MR also enables the testing
of a specific MCS value with COTS UE, by setting
xl_min_mcs = xl_max_mcs
example:
dl_min_mcs: 22
dl_max_mcs: 22
ul_min_mcs: 7
ul_max_mcs: 7
In the example above, the scheduler will use always MCS 22 for downlink
and MCS 7 for uplink.
Encapsulate the asn1c call from cmake in a cmake function run_asn1c().
As a notable change to the previous manual add_custom_command()
invocation, in suppresses the output of asn1c by default [1] and stores
it in a log file. In case of asn1c4 error, the output will output on
stdout.
Use the new run_asn1c() in all occasions for code generation.
[1] it is quite verbose, with many warnings that we cannot influence nor
suppress, and lists all generated files which is verified by the build
system automatically, anyway.
NR UE: enable concurrent UL slot processing
This commit introduces support for concurrent UL slot processing
Key changes:
- Increased number of UL actors from 1 to 2
- fix several issues related to writing to global variables inside processSlotTX
- Ensure in-order execution of if_module calls by utilizing the preexisting dynamic_barrier structure.
Note: for NTN, concurrent UL slot processing does not work. A flag
`--num-ul-actors X` has been introduced that allows to fix the number of
UL actors to `X` (default is 2).
Add 5GMM Service Reject enc/dec library and unit test
- introduce the library for the NAS Service Reject enc/dec
- add relevant unit test
- add handler
nr_dlsim allocates memory on every SNR iteration without freeing it.
This can lead to memory exhaustion. Fix this by allocating only once
and reuse memory. Also, free it before exit.
NR UE: fix PRACH generation with frequency resource id not 0 when msg1-FDM > 1 in SIB1
When msg1-FDM > 1 (2, 4 or 8) in SIB1, the frequency resource id of
PRACH could be not 0, current PRACH generation only considers frequency
resource id = 0. This MR fixes it, verified with 3rd-party gNB.
Closes#939
RedCap InitialBWP
Prevent RedCap UEs to move to DedicatedBWP
This allows the coexistence of RedCap UEs and non-RedCap UEs in the
same cell by having an InitialBWP with 20MHz and a larger
DedicatedBWP.
Update example RedCap configuration file to have 20 MHz InitialBWP and
40 MHz DedicatedBWP
esp. for LEO NTN scenarios the timing drifts during initial sync, which is mostly compensated with --ntn-initial-time-drift.
But there might be a residual time offset, and by extending the peak search window we make this more tolerant.
Depending on the main source of frequency offset, pre-compensate the UL frequency offset (FO) accordingly.
Therefore modify the flag `--cont-fo-comp` to accept an integer value, where
- `1` specifies, that the main FO contribution comes from the accuracy of the local oscillator (LO)
- `2` specifies, that the main FO contribution comes from Doppler shift
This commit introduces support for concurrent UL slot processing
Key changes:
- Increased number of UL actors from 1 to 2
- fix several issues related to writing to global variables inside
processSlotTX
- Ensure in-order execution of if_module calls by utilizing the
preexisting dynamic_barrier structure.
Encapsulate the asn1c call from cmake in a cmake function run_asn1c().
As a notable change to the previous manual add_custom_command()
invocation, in suppresses the output of asn1c by default [1] and stores
it in a log file. In case of asn1c4 error, the output will output on
stdout.
Use the new run_asn1c() in all occasions for code generation.
[1] it is quite verbose, with many warnings that we cannot influence nor
suppress, and lists all generated files which is verified by the build
system automatically, anyway.
- Update the L1 (cuBB) version in the docker-compose.yaml
- Change the argument for the L1 config file (cuphycontroller.yaml) in the aerial_l1_entrypoint.sh
- Update the N2 and N3 IP addresses to match the Grace Hopper's in the gnb.conf.
- Remove the test XML file for pulling images in the ARM image builder.
- Update the Aerial XML file to pull ARM images.
- Decrease tested throughput (temporarily) due to problems with Foxconn RU
Integration: `2025.w14` (part 2)
See merge request oai/openairinterface5g!3362
* !3255 Fixes for E1 and PDU session usage
* !3332 sched_ctrlCommon earlier
* !3356 Avoid accessing current_DL_BWP structure when scheduling DCI for other SIBs
* !3359 Fix inconsistent maxnoofPDUSessions definitions between NGAP and platform constants
* !3357 CI: update VVDN configuration file
* !3333 NR RLC improvements
* !3342 Fix bugs detected gcc
* !3347 feat(oran_fhlib_5g): O-RAN 7.2 FrontHaul Interface on Arm
* !3153 [E2 agent] RAN Control SM - support for REPORT Style 1 ("RRC Message" and "UE ID" RAN Parameter IDs)
* !3234 CI: minor tunings and improvements
* !3276 Optimization for unused symbols in NR UE
* !3317 Extend F1 Handover test
Extend F1 Handover test
do 1 more handover in the same test to verify robustness
- This MR keeps a simple ping after the second handover since there are
still issues due to scheduling starting too early, that is as soon as
the UE context is added. This leads to retransmissions that could
eventually lead to a test failure. The issue will be fixed in a future
MR.
add check on connected DU to verify successful handover
- a new telnet function gets in input the UE ID and returns the ID of
the connected DU
wait some time after deploying DU to mimic time for measurements
Optimization for unused symbols in NR UE
After processing TX frequency domain data skip IFFT call for symbols
that aren't used, the time domain buffer is memset instead.
Biggest benefit is when UE does not transmit PUSCH, or PUSCH is using <
14 symbols
[E2 agent] RAN Control SM - support for REPORT Style 1 ("RRC Message" and "UE ID" RAN Parameter IDs)
[Spring of Code 2024] contributions
Extended the RAN Control Service Model at E2 Agent to support all RC
REPORT Styles (1 - 5)
Implemented the following RAN Parameter IDs for REPORT Style 1:
1. "RRC Message": any DL-DCCH, and any UL-DCCH
2. "UE ID": as per spec, when the RRC Setup Complete or F1 UE Context
Setup Request detected
feat(oran_fhlib_5g): O-RAN 7.2 FrontHaul Interface on Arm
This MR is enabling the 7.2 FHI on Arm systems.
Even though the performance are yet very bad (UE connection is very
difficult, 100Mbps DL, almost no UL), still I would like to merge this
now since the matter of making the FHI work is rather orthogonal to the
performance issues.
So merging this feature would provide a reliable settlement on top of
which we could then progressively enhance the porting of OAI to Arm.
Especially that would make our work easier by having less features to
rebase regularly on develop.
The main features this MR is made of are:
1. Make the xran patches dual
We provide patches for both E and F releases of xran that handles x86
targets as well as Arm targets. Both patches have been tested on both
types of machines (armix, broadbill). Thanks to @brobert and @changy
for their work on xran.
2. Perform 9-bits BFP compression with ArmRAL
Since the BFP compression implementation provided with xran does rely
heavily on AVX512, we provide an alternative implementation that is
relying on Arm's RAN Acceleration Library (ArmRAL).
As of writing this commit description, only 9-bits compression is
supported. Other IQ width will be added.
This upcoming change does not prevent review to be performed since the
BFP compression functions of ArmRAL are identical except for the IQ
width. Adding further IQ width is therefore very straightforward.
3. Fixes in oran_fhlib_5g to support Arm
The library oran_fhlib_5g needed few changes to successfully compile and
run on Arm systems. Thanks to @brobert for his work on oran_fhlib_5g.
Fix inconsistent maxnoofPDUSessions definitions between NGAP and platform constants
There are 2 different definition of maxnoofPDUSessions (as per 3GPP TS
38.413), one in NGAP lib (set to 16) and one in platform_constants.h
(256 as per specs). The NGAP lib definition is removed in this commit
and replaced by the one compliant with the specs.
This is fixing the warning:
In function 'fill_pdu_session_resource_failed_to_setup_item',
inlined from 'rrc_gNB_send_NGAP_INITIAL_CONTEXT_SETUP_RESP' at /openair2/RRC/NR/rrc_gNB_NGAP.c:588:7:
/openair2/RRC/NR/rrc_gNB_NGAP.c:451:12: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
451 | f->cause = cause;
| ~~~~~~~~~^~~~~~~
In file included from /common/utils/ocp_itti/intertask_interface.h:235,
from /openair2/RRC/NR/rrc_gNB_NGAP.h:39,
from /openair2/RRC/NR/rrc_gNB_NGAP.c:31:
/openair2/COMMON/ngap_messages_types.h: In function 'rrc_gNB_send_NGAP_INITIAL_CONTEXT_SETUP_RESP':
/openair2/COMMON/ngap_messages_types.h:546:13: note: at offset [8724, 25769812488] into destination object 'gNB_ue_ngap_id' of size 4
546 | uint32_t gNB_ue_ngap_id;
| ^~~~~~~~~~~~~~
Avoid accessing current_DL_BWP structure when scheduling DCI for other SIBs
Avoid access to mac->current_DL_BWP structure when scheduling DCI for
SIBs other than 1. This is not needed and can cause NULL pointer access
which can happen if the UE has released MAC configuration or has not
started RA yet.
sched_ctrlCommon earlier
This MR configures sched_ctrlCommon earlier, in RCconfig_nr_macrlc().
The objective of this MR is to solve the following Assert in the F1 test:
19897952.126019 [NR_MAC] I Adding new UE context with RNTI 0x3269
/oai-ran/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c:366:15: runtime error: member access within null pointer of type 'struct NR_UE_sched_ctrl_t'
[INFO tini (1)] Spawned child process '/opt/oai-gnb/bin/entrypoint.sh' with pid '7'
[INFO tini (1)] Main child exited normally (with status '1')
Wait before triggering a handover. First, we send it very quickly after
deployment, which can make the DU crash (should be fixed in !3332). Second, a
UE would typically first measure neighbors. While we don't do this with OAI UE,
mimic this somewhat by giving more time.
See also !3332.
* the handover is followed by a sleep and an ping test
This MR keeps a simple ping after the second handover since there are still issues due to scheduling starting too early,
that is as soon as the UE context is added. This leads to retransmissions that could eventually lead to a test failure.
The issue will be fixed in a future MR.
The Bearer Context Modification Request test is adding 1 QoS Flow, therefore the encoding/decoding
is done and this bug does not show. The issue is there when no QoS Flow is mapped in the DRBnGRanModList,
therefore when no memory is allocated for the optional IE, and the member is accessed in the decoding
of the Flow Mapping Information.
As per spec, UE ID shall be reported when the message event configured by
the Event Trigger Style 1 is set to “RRC Setup Complete" message (UE attach), or
“Xn/NG Handover Request” or “F1 UE Context Setup Request” (Intra gNB Handover).
In OAI RAN, Xn/NG Handover is not yet supported, and therefore not added as the trigger event
in this commit.
Additionally, as the Event Trigger Definition Format 1 is common for both "RRC Message" and "UE ID",
E2 node will report the “RRC Setup Complete" message which the xApp will decode and print.
Co-authored-by: Khanh Toan Pham <khanh.toan.pham@hhi.fraunhofer.de>
Co-authored-by: Shrinish Donde <shrinish.donde@hhi.fraunhofer.de>
Co-authored-by: Theodoros Tsourdinis <theodoros.tsourdinis@sorbonne-universite.fr>
Co-authored-by: Miguel Fuentes <miguel.fuentes@i2cat.net>
Co-authored-by: Teodora Vladic <teodora.vladic@openairinterface.org>
The fronthaul library ships with BFP compression for AVX512 enabled targets.
This commit adds BFP compression for Arm targets by using the ArmRAL library.
Temporarily deactivate DRB integrity protection in SABOX-B200 E1 testcase
to avoid CI failure due to low measured throughput. Our investigation
suggests that the low throughput is likely due to limitation of the UE
(Quectel RM500Q), which appears to restrict the maximum data rate when
integrity protection is enabled. This limitation is not observed with
Quectel RM520N.
- Cleanup and update of "Machines" table:
- remove asterix - not used in CI
- remove nokiabox - not used in CI
- remove orion - not used in CI
- update of "Lockable Resource" for individual machines - synch with
https://jenkins-oai.eurecom.fr/lockable-resources/
- remove column of "IP Address"
- Update information about build pipelines
The healthcheck interval sets when the first health check occurs after the
container starts. Increasing the healthcheck interval helps avoid marking
the container as "healthy" during the initialization phase of PNF. In
particular, USRP initialization of PNF service may take longer, and deployment
failures can occur even after the 10 seconds interval. Extending the healtcheck
interval provides more time for the service before assessing container health.
Remove memset of the UE TX time domain samples array after trx_write in
RU_write()
This memset is unnecessary and can break openair0 libraries. Some
functionalities, e.g. usrp_lib write_thread expect the samples to be
present in the array after trx_write returns.
The array is always set before being sent either in idft or using memset
so there is no risk of sending the same data twice.
- use Ubuntu image, instead of RHEL image - gNB fails with "Illegal
instruction" during RA, when running with RHEL image
- init DPDK in VA mode
- increase number of cores Tpool
Fixes for E1 and PDU session usage
Fix a number of problems in E1 and PDU session handling:
- For multiple PDU session setup reqs, we send a bearer context setup
each time; fix an assert that was triggered on the second bearer
context setup message
- Add a log for E1 bearer context setup, as already done for
modification and release
- If we get a PDU session setup for an existing PDU session, reject it
as required by the spec [actually, it says to reject individual PDU
sessions; keep it simple for now and reject the entire message, which
might not be correct if there is one new PDU session that does not
exist]
- Add a workaround to handle multiple PDU session setup requests that
come in quick succession for different PDU sessions
Leading to clang error:
/oai-ran/openair2/RRC/NR/rrc_gNB_NGAP.c:1329:37: error: result of comparison of constant 256 with expression of type
'uint8_t' (aka 'unsigned char') is always false [-Werror,-Wtautological-constant-out-of-range-compare]
The value comes from the decoding of: ie->value.choice.PDUSessionResourceToReleaseListRelCmd.list.count
Integration: `2025.w14` (part 1)
Closes#931
See merge request oai/openairinterface5g!3353
* !3247 Add enc/dec lib and unit test for 5GS NAS Service Accept
* !3316 Fix: Correctly Read PDU Address IE
* !3322 Refactor core network handling in CI, harmonize code
* !3327 NR UE fix for disable HARQ
* !3350 Cleanup NR PHY common definitions
* !3352 Turn off any Nagle-like algorithm for SCTP
There are 2 different definition of maxnoofPDUSessions (as per 3GPP TS 38.413),
one in NGAP lib (set to 16) and one in platform_constants.h (256 as per specs).
The NGAP lib definition is removed in this commit and replaced by the one
compliant with the specs.
This is fixing the warning:
In function 'fill_pdu_session_resource_failed_to_setup_item',
inlined from 'rrc_gNB_send_NGAP_INITIAL_CONTEXT_SETUP_RESP' at /openair2/RRC/NR/rrc_gNB_NGAP.c:588:7:
/openair2/RRC/NR/rrc_gNB_NGAP.c:451:12: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
451 | f->cause = cause;
| ~~~~~~~~~^~~~~~~
In file included from /common/utils/ocp_itti/intertask_interface.h:235,
from /openair2/RRC/NR/rrc_gNB_NGAP.h:39,
from /openair2/RRC/NR/rrc_gNB_NGAP.c:31:
/openair2/COMMON/ngap_messages_types.h: In function 'rrc_gNB_send_NGAP_INITIAL_CONTEXT_SETUP_RESP':
/openair2/COMMON/ngap_messages_types.h:546:13: note: at offset [8724, 25769812488] into destination object 'gNB_ue_ngap_id' of size 4
546 | uint32_t gNB_ue_ngap_id;
| ^~~~~~~~~~~~~~
Avoid access to mac->current_DL_BWP structure when scheduling DCI for
SIBs other than 1. This is not needed and can cause NULL pointer access
which can happen if the UE has released MAC configuration or has not
started RA yet.
Turn off any Nagle-like algorithm for SCTP
This means that packets will be sent as soon as possible and no
unnecessary delays are introduced, at the cost of more packets in the
network.
https://www.man7.org/linux/man-pages/man7/sctp.7.html
Refactor core network handling in CI, harmonize code
Prior to change set, there is a highly heterogeneous situation for core
network management in CI code: some log collection is done from groovy
files (when it could be done in python, which is easier for local
development), there are multiple commands to start a CN from XML files,
the code for starting a CN is always different (no one unified way to
start "any" CN), Ping/Iperf require some support in ci_infra.yaml, ...
To help with the above, refactor the handling of core networks in the CI
code as follows:
- define all CNs in ci_infra.yaml (basically how to deploy, undeploy,
collect logs, and on which node)
- make one Python class that reads from ci_infra.yaml and that allows to
start/stop previously defined CNs (and add unit tests...)
- make one XML command for start/stop of CNs, leveraging above class
- leverage the CNs defined in ci_infra.yaml consistently in
Ping()/Iperf()
- delete old code
Furthermore, the following supporting changes/bugfixes are done:
- repair Iperf2_Unidir() and add unit test
- fix a number of invalid escape sequence errors (there are some
remaining, which I will do soon)
- various bug fixes
- remove unused XML steps
Fix: Correctly Read PDU Address IE
The QoS Rules loop correctly moves msg pointer allowing the PDU Address
IE to be read correctly. The PDU Address IE is only processed if it is
provided, otherwise there is a warning.
Closes#931
Add enc/dec lib and unit test for 5GS NAS Service Accept
- add new files for Service Accept fgmm_service_accept.c/.h containing
the enc/dec functions (8.2.17 3GPP TS 24.501)
- enabled compiling
- add unit test
- add handler in stack
This is a hack. With some UEs/CN combinations, PDU session requests
might come in quick succession. Since 38.331 asks us to only have one
reconfiguration at once, we need to delay a second, third, ... PDU
session request until the first has passed, to make one reconfiguration
at a time.
The following cases are covered
- we have a regex whose escape sequences are not to be evaluated in the
string, but given verbatim to the regex engine. Hence, mark them as
raw strings.
- some are parameters for the cmd.run() call, but the parameters are
wrong, so remove that
- there is a `\|` that is also to be passed verbatim
/home/richie/w/ci-refactor-core-handling/ci-scripts/cls_cluster.py:97: SyntaxWarning: invalid escape sequence '\-'
if re.search('buildconfig.build.openshift.io/[a-zA-Z\-0-9]+ created', ret.stdout) is not None:
/home/richie/w/ci-refactor-core-handling/ci-scripts/cls_cluster.py:167: SyntaxWarning: invalid escape sequence '\-'
result = re.search(f'pod/(?P<pod>[a-zA-Z0-9_\-]+) created', ret.stdout)
/home/richie/w/ci-refactor-core-handling/ci-scripts/cls_cluster.py:325: SyntaxWarning: invalid escape sequence '\$'
self.cmd.run(f'oc get pods.metrics.k8s.io &>> cmake_targets/log/build-metrics.log', '\$', 10)
/home/richie/w/ci-refactor-core-handling/ci-scripts/cls_cluster.py:385: SyntaxWarning: invalid escape sequence '\$'
self.cmd.run(f'oc get pods.metrics.k8s.io &>> cmake_targets/log/build-metrics.log', '\$', 10)
/home/richie/w/ci-refactor-core-handling/ci-scripts/cls_cluster.py:398: SyntaxWarning: invalid escape sequence '\$'
self.cmd.run(f'oc get pods.metrics.k8s.io &>> cmake_targets/log/build-metrics.log', '\$', 10)
/home/richie/w/ci-refactor-core-handling/ci-scripts/cls_cluster.py:413: SyntaxWarning: invalid escape sequence '\$'
self.cmd.run(f'oc get pods.metrics.k8s.io &>> cmake_targets/log/build-metrics.log', '\$', 10)
/home/richie/w/ci-refactor-core-handling/ci-scripts/cls_cluster.py:429: SyntaxWarning: invalid escape sequence '\|'
grep_exp = "\|".join(attemptedImages)
/home/richie/w/ci-refactor-core-handling/ci-scripts/cls_cluster.py:431: SyntaxWarning: invalid escape sequence '\$'
self.cmd.run(f'for pod in $(oc get pods | tail -n +2 | awk \'{{print $1}}\'); do oc get pod $pod -o json &>> cmake_targets/log/build_pod_summary.log; done', '\$', 60)
As parent. The second change has no escape sequence, but since it's also
a regex, mark it as raw for uniformity (it doesn't hurt either).
ci-scripts/cls_module.py:165: SyntaxWarning: invalid escape sequence '\.'
result = re.search('inet (?P<ip>[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)', output.stdout)
With the server object to be passed into ping test, it's not necessary
to either hardcode an IP address or provide a template. Instead, always
fill the IP address, which simplies the Ping() code.
Verify that we don't have an IP address/hardcoded by throwing an
assertion.
38.413 section 8.2.1.4 says that if PDU session resource setup req
contains an existing PDU session, that one should be reported as failed.
That is rather complicated for us to do; simply reject all PDU sessions
and let the core deal with that.
If two PDU sessions are to be setup, the CU-CP sends two bearer context
setup requests. When running only the CU-UP, we inconditionally tried to
set up the CU-UP UE ID identifiers upon reception of the bearer context
setup request, leading to an assert. Check if the IDs are not already
set up, to avoid assertions in that case.
The REPORT service was hardcoded to only style 4, and therefore not easily extendable.
This commit moves the support for style 4 in a separate function.
Delete duplicated enum structs for RAN Parameter IDs for all the REPORT styles.
They are already defined in "openair2/E2AP/flexric/src/sm/rc_sm/ie/rc_data_ie.h".
Co-authored-by: Tano Bischoff <tano.bischoff@hhi.fraunhofer.de>
Co-authored-by: Khanh Toan Pham <khanh.toan.pham@hhi.fraunhofer.de>
Co-authored-by: Shrinish Donde <shrinish.donde@hhi.fraunhofer.de>
Co-authored-by: Miguel Fuentes <miguel.fuentes@i2cat.net>
Co-authored-by: Teodora Vladic <teodora.vladic@openairinterface.org>
Update the xran E release patch to work for Arm targets in addition to x86 targets.
Co-authored-by: Yi-Hung Chang <Yi-Hung.Chang@eurecom.fr>
Co-authored-by: brobert <brobert@valiha.com>
Remove include of SIMDE Neon header sse_intrinsic.h to compile on ARM. Otherwise the error below is issued.
```
/usr/include/simde/arm/neon/get_lane.h:279:5: error: incompatible type for argument 1 of ‘vget_lane_f16’
279 | SIMDE_CONSTIFY_8_(vget_lane_f16, r, (HEDLEY_UNREACHABLE(), SIMDE_FLOAT16_VALUE(0.0)), lane, v);
removed the inclusion of neon.h
```
Currently we still activated the DL HARQ process for PUCCH transmission,
and only at the time of the scheduled PUCCH transmission, we actually skip sending the ACK.
This is not only unnecessary, it is at least misleading and strange that
DL HARQ processes can be reused in the meantime, even though they are active...
Therefore simply don't activate the DL HARQ process by skipping the call to set_harq_status() if feedback for it is disabled.
Integration: `2025.w13`
Closes#923, #924, #928, and #925
See merge request oai/openairinterface5g!3345
* !3300 Allow RSRP report handling in phy-test mode
* !3318 Improve handling of some pointers causing potential segfault
* !3321 DLSCH scheduler LOGs assertion prevention in case of HARQ disabled
* !3335 Other compilation improvements
* !3338 prevent access to NULL pointer in RELEASE_IE_FROMLIST
* !3337 Fix for wrong NSA init at UE
* !3339 fix NTN regression by correctly setting cellBarredNTN_r17 for NTN band again
* !3340 NR UE: fix nr_pbch_channel_estimation()
* !3260 Shared memory realtime radio simulation
* !3341 rfsimulator: apply deadlock detection only if more than one client is connected
* !3343 K-offset updated with configured sub carrier spacing
* !3331 Add documentation for Foxconn RU
* !3216 FHI72: Management plane support
* !3295 Fix SRS report TLV unpack
Fix SRS report TLV unpack
Changes the SRS unpacking to not expect padding to be present in the buffer when
working with Aerial, with which the report TLVs are not padded to the nearest
32-bit boundary. This issue was found when using a UE with 1 SRS port, which
causes the TLV to not have a length divisible by 4. Also adds a function to pull
X amount of bytes into a uint32_t, which is used to process the last 4 byte
block of the TLV, only pulling the bytes which are not padding. Completed the
SRS.indication dumping procedure to print out the report TLV. Changed the
SRS.indication unitary test to fill the last 4 byte block of the report TLV
appropriately according to the length ( which ensures the padding bytes are set
to 0 )
This is not really used as of now, because most IPs are hardcoded. See
one of the next commits for the use of this.
To make sure that we have the correct IP, there is some code that
verifies that a hardcoded IP and the CN IP would be the same.
Note: need two separate ci_infra.yaml entries, because
- for FlexRIC, the container name is different (is the tutorial CN)
- for RFsim5G E1, we don't have ext-dn => ping UPF
- call scripts for magma MME-based deployment of OAI 5GC in
ci_infra.yaml
- implement the existing python code through scripts (which does the same)
- save the cql file in the repo, which was previously downloaded every
time
- use for porcepix-cn4g and nano-cn4g (un)deployment, ping, perf, in XML
files
- Use scripts to deploy OpenShift-based 5GC in ci_infra.yaml
- Use for oc-cn5g, oc-cn5g-20897, and oc-cn5g-20897-aerial2
for (un)deployment, ping, iperf in relevant XML files
- Convert hardcoded IP addresses to %cn_ip%
Use the core network class to configure one "end" of these tests. This
will make the tests more generic and predictable, as they are explicitly
configured through two ci_infra.yaml "entities", instead of some
implicit "EPC" IP address given in configuration.
As of this commit, no XML passes this info into the framework, so no XML
step will work. As it is many changes, the following commits will add
the necessary info one by one.
This adds a helper class to manage various core networks in the CI
testing framework. Specifically, it reads from a YAML file information
such as a node, (un-)deployment script (file), log collection
instructions, etc., in order to allow a common interface to be used to
deploy and undeploy various core network implementations.
This commit adds the class (in cls_corenetwork.py) as well as tests for
this class.
FHI72: Management plane support
At the moment, tested with Benetel 550 and 650 RUs FW v1.2.2
- support for multiple RUs
- RPCs implemented: <connect>, <subscribe>, <get>, <supervision-watchdog-reset>,
<edit-config>, <validate>, <commit>, <disconnect>
- read PTP sync status from operational datastore xml
- get vendor name, and for xran store RU MAC, MTU and IQ bitwidth and PRACH
offset, and transfer this info
- store interface name, low-level-tx/rx-endpoint names, tx/rx-carrier names,...,
from operational datastore xml
- add reference gNB/DU config files with M-plane support
- update FHI readme
Add documentation for Foxconn RU
This MR adds documentation for using the Foxconn RU with OAI, as it piques the
interest of some in the community. Note that this RU is not continuously tested
with OAI L1. Additionally, we have observed throughput degradation in OAI
versions beyond tag 2024.w30, and the issue is under investigation. For now, we
are providing documentation based on what we have tested in our lab.
K-offset updated with configured sub carrier spacing
According to 38.331 , cell specific K-OFFSET provided in SIB19 is provided in
number of slots as per 15Khz SCS Koffset before being applied, needs to be
updated to the slots according to the configured subcarrier spacing.
- Increase the maximum logging line for print done through
log_output_memory().
The reason is that we hit this line length when printing some machine
generated configuration (XML) through the M-plane. Increase to make
more of it visible.
- To limit the impact, only increase this locally in function
log_output_memory(), and statically assert that it will never be
larger than 64 kB.
In other places, we use the old limit.
- Move the definition MAX_LOG_TOTAL to log.c, because it's only used
there.
- if RU(s) are not well configured, disconnect immediately and stop the DU
- if all RUs are well configured, proceed with waiting until ready. The RU is
ready when the carriers are activated. Either the RU already has preconfigured
carriers (previous M-plane client configured), or the DU has to wait until receives
the notifications.
Ideally, we should load the yang models from the RU operational datastore, but the issues are following:
1) the yang models order is not good - dependancy models have to be loaded first
2) earlier O-RAN yang versions (e.g. v4) is not properly defined (i.e. optional parameters should not be included by default)
Added support in both cases, loading from RU with <get-schema> RPC, and loading statically from "radio/fhi_72/mplane/yang/models" folder.
Add a function pullx32 to pull x amount of bytes into uint32_t
Change the unpacking to pull only the needed bytes, and skip over the padding, when not Aerial
Change SRS.indication dumping function to also print the report TLV contents
Change SRS.indication unitary test to fill the last 4 byte block of the report TLV according to the length, with padding
Shared memory realtime radio simulation
Realtime and near-realtime RFSimulator alternative without channel modelling.
The purpose of this library is to allow realtime simulation of gNB and nrUE.
The library is loaded using --device.name vrtsim. The server side (gNB) should
also configure --vrtsim.role server and --vrtsim.timescale according to
requirements.
Limitations:
- Only 1UE-to-1gNB connection supported
Future work:
- Telnet API
- cmake version 3.12 defines libxml2 module; the default path is
/usr/share/cmake-3.<sub-version>/Modules/FindLibXml2.cmake
- OAI requires minimum cmake version 3.16
- RU IP address - to connect to RUs via netconf
- DU MAC address - for setting up the CU-planes on RU; not used in xran
- VLAN tag (*) - for setting up the CU-planes on RU; not used in xran
- DU keypair - for authentication when connecting to RU(s)
The parameters that RU-controller shall retreive from RU list of
capabilities:
- MTU
- compression
- RU MAC address
- PRACH offset (**)
(*) VLAN tag is not used in xran but an option is given in fh_config struct.
In my opinion, it is not a very suitable place, as it is needed for VFs.
Therefore, I moved it in the initialization part for M-plane purposes.
(**) PRACH offset shall be >= max(Ntx,Nrx), as per O-RAN CUS specification:
"The O-DU may decide to use same eAxC ID value to address endpoints on different O-RUs,
but eAxC ID values assigned to one O-RU must be unique within the O-RU’s endpoints of same direction."
=> however, LITEON supports flexible assignment of PRACH eAxC IDs, so
we made a workaround in the xran library to support PRACH eAxC IDs same
as PUSCH eAxC IDs.
According to 38.331 , cell specific K-OFFSET provided in SIB19 is provided in number of slots as per 15Khz SCS
Koffset before being applied, needs to be updated to the slots according to the configured subcarrier spacing.
These two functions use the EPC class to potentially fill in
EPC/5GC-related information, or start a packet tracer (tshark). The only
pipeline that uses these functions is RAN-gNB-N300-Timing-Phytest-LDPC,
which does not use a core network. This functionality is not used, and
can therefore be removed.
Add a possibility to use an "infrastructure YAML file" to configure both
ends of the iperf2 call through a file.
Fix bugs in Iperf2: at least on my machine, iperf2 start time is logged
at 0.00 not 0.0, so update the regex to match both. Do not overwrite
results if the matched regex (otherwise, the result might be None at the
end) and suppress server output.
Add a unit test to test that this function actually works (on my
machine, with iperf v2.2.1), as well as a unit test for analysis.
Fix for wrong NSA init at UE
This error is shown in the UE logs as following
[RLC] Activated srb0 for UE 0
[RLC] SRB0 already exists for UE 0, do nothing
- This addition is based on past tests, iperf3 UDP throughput was 520Mbps DL and 40Mbps UL.
- Throughput degrades when using OAI L1 with tags beyond `2024.w30`.
- This RU is being CI tested only in the Aerial pipeline, not with OAI L1.
- The document will be updated once the issue is identified and fixed.
The above is necessary to not compile as many gNB dependencies into the
UE. RLC only uses GTP, which was satisfied by L2_NR, but that's not
necessary. However, only that change results in
/usr/bin/ld: openair2/E2AP/RAN_FUNCTION/libe2_ran_func_cuup.a(ran_func_rc.c.o): in function `get_list_for_report_style':
openair2/E2AP/RAN_FUNCTION/O-RAN/ran_func_rc.c:596:(.text+0xbe7): undefined reference to `cp_e2sm_rc_event_trigger'
/usr/bin/ld: openair2/E2AP/RAN_FUNCTION/O-RAN/ran_func_rc.c:596:(.text+0xc5b): undefined reference to `cp_e2sm_rc_event_trigger'
/usr/bin/ld: openair2/E2AP/RAN_FUNCTION/O-RAN/ran_func_rc.c:596:(.text+0xd3b): undefined reference to `cp_e2sm_rc_event_trigger'
/usr/bin/ld: openair2/E2AP/RAN_FUNCTION/O-RAN/ran_func_rc.c:596:(.text+0xd9d): undefined reference to `cp_e2sm_rc_event_trigger'
/usr/bin/ld: openair2/E2AP/RAN_FUNCTION/O-RAN/ran_func_rc.c:596:(.text+0xded): undefined reference to `cp_e2sm_rc_event_trigger'
/usr/bin/ld: openair2/E2AP/RAN_FUNCTION/libe2_ran_func_cuup.a(ran_func_rc.c.o):openair2/E2AP/RAN_FUNCTION/O-RAN/ran_func_rc.c:596: more undefined references to `cp_e2sm_rc_event_trigger' follow
/usr/bin/ld: openair2/E2AP/RAN_FUNCTION/libe2_ran_func_cuup.a(ran_func_rc_subs.c.o): in function `remove_rc_subs_data':
openair2/E2AP/RAN_FUNCTION/O-RAN/ran_func_rc_subs.c:60:(.text+0xbe): undefined reference to `find_if'
/usr/bin/ld: openair2/E2AP/RAN_FUNCTION/O-RAN/ran_func_rc_subs.c:62:(.text+0xca): undefined reference to `free_e2sm_rc_event_trigger'
nr-cuup previously satisfied these dependencies by depending on L2_NR
which links in e2_ran_func_du_cucp_cuup. However, the nr-cuup E2 RAN
functions are in e2_ran_func_cuup. In the latter, the file rc_data_ie.c
was missing (for cp_e2sm_rc_event_trigger), which in turn needs
e2sm_rc_ir_obj. Finally, find_if comes through alg.
Co-authored-by: Robert Schmidt <robert.schmidt@openairinterface.org>
Realtime and near-realtime RFSimulator alternative without channel modelling.
The purpose of this library is to allow realtime simulation of gNB and nrUE.
The library is loaded using --device.name shm_radio. The server side (gNB) should also
configure --shm_radio.role server and --shm_radio.timescale <timescale> according to requirements.
Limitations:
- Only 1UE-to-1gNB connection supported
Future work:
- Channel modelling
- Telnet API
- Histogram of the TX time budget
This implements a server-client bidirectional time domain IQ channel via
shared memory.
The server creates the channel and should be aware of the client
receiver configuration (num rx/tx antennas).
Server shall be the time source and should call shm_iq_channel_produce_samples
at regular intervals
Integration: `2025.w12`
Closes#920 and #915
See merge request oai/openairinterface5g!3325
* !3301 Remove unused NR UE PHY unit tests
* !3319 Disable EPS NAS security algorithms in 5GMM UE capabilities
* !3315 SCTP: avoid assert on partial SCTP message
* !3323 Fix long RACH regression
* !3311 Harmonize and update Frequency Range computation to the current values specified by the standard
* !3320 Miscelaneous improvements in PHY simulators
* !3286 Add support for ARM build pipeline
* !3308 remove ul_ch_estimates_time to save memory
* !3310 remove globale llr_layers to save memory, improve CPU, simplify code
* !3274 Add initial support for RedCap
* !3328 Fix ULSCH ID type to handle large max_nb_pusch values (ULSCH procedures)
* !3329 NR build improvements
* !3285 Update FHI 7.2 documentation, minor code cleanup
The 5GMM library in openair3/NAS/NR_UE/5GS/5GMM/ contains the
all the definitions necessary to do the enc/dec of 5GMM IEs.
5GMM messages can share the same IEs, therefore they can use
common definitions and enc/dec functions.
The goal of this commit is to add common definitions to new shared
5GMM library files. The consumers of fgmm_lib are the functions
defined in the openair3/NAS/NR_UE/5GS/5GMM/ library.
Update FHI 7.2 documentation, minor code cleanup
- remove some unused functions
- make one function static
- add callback function documentation
- provide some developer function
NR build improvements
This MR is an attempt to improve compilation of NR softmodems by
removing some of NR-LTE cross-compilation (at the cost of a small dummy
file for nr-softmodem) and one small gNB-NRUE cross-compilation.
Fix ULSCH ID type to handle large max_nb_pusch values (ULSCH procedures)
The ULSCH_id variable is currently defined as uint8_t, which limits its
range to 0-255. However, gNB->max_nb_pusch can exceed this range
depending on the configuration (buffer_ul_slots and
MAX_MOBILES_PER_GNB). This can lead to incorrect behavior or undefined
results when max_nb_pusch is larger than 255. This commit changes the
type of ULSCH_id from uint8_t to int to accommodate larger values of
max_nb_pusch.
The issue was observed when running the OAI gNB with MAX_MOBILES_PER_GNB
set to 64 UEs. The root cause was traced back to the changes to UL
processing introduced in !2952.
Change to bool for clarity. The log message would sometimes only show up
at the end, which is misleading; use the logging module, which
harmonizes log statements and should make this appear immediately.
We still do not handle RUs with MTUs of 1500 properly in F release;
therefore, for the close future, we cannot remove support for E release.
Also, it "promises" this for January, which is in the past already.
Update to keep the warning logical.
remove ul_ch_estimates_time to save memory
remove ul_ch_estimates_time that saves 50MB memory to access in RAM, and
make better quality scope data passing (no race)
Add support for ARM build pipeline
Modify the existing python code to be able to build images where the
image tag can be prepended with a prefix, here arm_. This is preparatory
work to create the ARM build image pipeline, and reuse the existing
internal registry on porcepix to have x86 and ARM images coexist.
Fix various bugs in the build system to allow to build on a system with
as many cores as gracehopper.
Also, fix two programs (usim, nvram) to work correctly under ARM.
Miscelaneous improvements in PHY simulators
1: Add a SIGINT handler to NR PHY simulators
When using T2 virtual functions, it is important to properly stop DPDK
and free the device. Otherwise the virtual functions may be blocked and
a restart of the admin application is necessary.
If not carefully done, such kind of operation can lead to losing cores
to DPDK processes that cannot be stopped. This can lead to situations
where the machine is locked and can only be unlocked by a power cycle.
Always properly stopping DPDK and freeing the device reduces the risk of
such situation to happen.
Up to now, SIGINT was shutting down the PHY simulators without freeing
the device. This commit adds a signal handler to handle SIGINT in a way
that allow to properly free the device.
This feature is added to all the NR PHY simulators whether they use T2
or not in case it is now or later of any use.
2: Make nr_ulschsim functional
There were two issues that were making nr_ulschsim non functional:
1. The channel output was not copied to decoder input (llr array)
2. The test on decoding successful outcome was wrong
The result was that nr_ulschsim was succesfull whatever were its
arguments. This changeset fixes the two issues so that nr_ulschsim is
now functional.
Harmonize and update Frequency Range computation to the current values
specified by the standard
3GPP TS 38.101-1 Version 19.0.0 Table 5.1-1: Definition of frequency
ranges
- FR1 from 410 MHz to 7125 MHz
- FR2 from 24.25 GHz to 71 GHz
1. Change the name of `openair1/SIMULATION/NR_PHY/nr_dummy_functions.c` into `openair1/SIMULATION/NR_PHY/nr_unitary_common.c` for naming coherence after adding the SIGINT handler which is not a dummy function.
2. Instead of being built once for every NR PHY simulators, the common functions source file is built once as an object and linked to each simulator.
The ULSCH_id variable is currently defined as uint8_t, which limits its
range to 0-255. However, gNB->max_nb_pusch can exceed this range
depending on the configuration (buffer_ul_slots and MAX_MOBILES_PER_GNB).
This can lead to incorrect behavior or undefined results when max_nb_pusch
is larger than 255. This commit changes the type of ULSCH_id from uint8_t
to int to accommodate larger values of max_nb_pusch.
The issue was observed when running the OAI gNB with MAX_MOBILES_PER_GNB set
to 64 UEs. The root cause was traced back to the changes to UL processing
introduced in !3166 (!2952).
After the parent commit, the registry might contain prefixed images.
This commit adds the functionality to pull such prefixed image. Since we
rename the pulled image (to have a consistent name, from whichever
registry we might pull), remove the prefix as well so that it can be
used with other CI functionality (remove image, use in test, ...)
Examples for renaming:
- pull from internal_registry for x86
internal_registry/oai-gnb:branchA => oai-ci/oai-gnb:branchA
- pull from internal registry for ARM with "arm_" prefix
internal_registry/oai-gnb:arm_branchA => oai-ci/oai-gnb:branchA
- pull from x86 other registry (e.g., openshift)
openshift/namespace/oai-gnb:branchA => oai-ci/oai-gnb:branchA
The only currently viable way to push ARM images to our registry is to
use a custom tag prefix. Modify the python test code to specify such a
tag, and default to "" (no prefix).
After the preceding commits, it's now possible to build images on ARM.
Add a specific "native_arm" build kind to only build what we need as of
now (do not only call it "arm", as that would match the kind
"build_cross_arm64").
Add the corresponding XML. Pushing of images is disabled, as this does
not work as of now.
The (existing) Aerial pipeline on devkit uses an older version of nvipc,
which is upgraded on gracehopper. Use a glob to match them equally,
which also aligns this code with the corresponding Dockerfile, which
already uses that glob.
Use the right type for variable, as getopt_long() returns an int. Using
char is not a problem on x86, but prevents the return of -1 in case of
parameter reading end. This led to infinite loops on ARM, which is fixed
through the variable type change. An additional counter measure (showing
the problem) would be to print and error out when reading an undefined
parameter, which is added here as well.
This has been forgotten when making the same change for getopt() in
cf9854601c ("getopt() returns int").
Dockerfiles hardcoded one copy operation to x86; generalize to capture
ARM as well. Since the target directory cannot have any globs, we need
to manually check the right directory, then move the file.
Note that this is only necessary since we are forced to switch the
compiler, as Ubuntu's default gcc-11 does not work with FlexRIC. When
upgrading to Ubuntu 24, these lines should disappear and asan be
installed as normal. See commit 94497435e7 ("Upgrade CI images to
Ubuntu 22").
SCTP: avoid assert on partial SCTP message
The receive buffer for SCTP, before this branch, is 8192. If a message
is larger, we receive only a partial message, which makes the gNB abort.
Remove the abort to not be susceptible to a message intended to crash
the gNB.
also, increase the receive buffer to be more forgiving for large messages
Closes: #920
Disable EPS NAS security algorithms in 5GMM UE capabilities
OAI nrUE is not supporting multiple RATs, therefore the EPS NAS security
algorithms bit in 5GMM UE capabilities is not relevant.
This bit is only relevant if N26 interface is supported by the AMF and
the UE is supporting S1 mode, meaning that the UE is connected to a 4G
LTE network, via the S1 interface (eNB - MME/SGW). When the UE performs
an inter-system change from N1 mode to S1 mode, it transitions from 5GC
to the EPC: at network level this happens over the N26 interface (which
connects the 5G AMF to the 4G MME).
In this transition is where the EPS security context becomes relevant:
the UE does not know about the N26 interface, however is the AMF that
can tell the UE, e.g. during the registration procedure, if the UE sets
the S1 mode bit to "S1 mode supported" in the 5GMM capability IE, and
the AMF supports the N26 interface, the AMF will include the Selected
EPS NAS security algorithms IE in the SECURITY MODE COMMAND message,
which is what happened in #915.
Closes: #915
Even though the remaining NR PHY simulators do not use the T2, we may still feature them with a SIGINT handler for proper termination on SIGINT and for a matter of completeness.
The remaining NR PHY simulators are:
* nr_pbchsim
* nr_prachsim
* nr_psbchsim
* nr_pucchsim
There was two issues that were making nr_ulschsim non functional:
1. The channel output was not copied to decoder input (llr array)
2. The test on decoding successful outcome was wrong
The result was that nr_ulschsim was succesfull whatever were its arguments.
This commit fixes the two issues so that nr_ulschsim is now functional.
When using T2 virtual functions, it is important to properly stop DPDK and free the device.
Otherwise the virtual functions may be blocked and a restart of the admin application is necessary.
Up to now, SIGINT was shutting down the PHY simulators without freeing the device.
This commit adds a signal handler to handle SIGINT in a way that allow to properly free the device.
This feature is first added to the PHY simulators that use the T2 which are `nr_ulsim`, `nr_dlsim`, `nr_ulschsim` and `nr_dlschsim`.
The receive buffer for SCTP, as of this commit, is 8192. If a message is
larger, we receive only a partial message, which makes the gNB abort.
Remove the abort to not be susceptible to a message intended to crash
the gNB.
Closes: #920
Integration: `2025.w11`
Closes#848
See merge request oai/openairinterface5g!3309
* !3306 Add a new CI label: nrUE
* !3303 remove wrong assertion for B4 PRACH format
* !3296 fix(nrLDPC_decoder): fix numIter increment
* !3150 Rework of NR UE RA procedures
* !3305 CI: Fix timeout for OC Deployments
* !3307 Add CI UE test for RA with C-RNTI
* !3271 Handle changing N_TA_offset correctly
* !3313 Small fix for jenkins message formatting
Add a new CI label: nrUE
Added handling of the nrUE label which limits the amount of CI tests to run. Only tests that use nr-uesoftmodem or phy simulators are triggered.
See merge request oai/openairinterface5g!3306
Local_Cmd forces use to use absolute paths for copy operations (because
that makes more clear where files are being copied). Use the absolute
path to avoid the corresponding exception.
Various libraries in this commit use the log headers (that is the
direct dependency). The log headers in turn include the T headers
(transitive dependency). Building on gracehopper with its many cores
triggers the build of these libraries before T headers have been
generated.
To resolve this and force the generation of T headers before building
the libraries, correctly express their dependency on the log headers,
which in turn ensures that T headers have been generated.
Depending on log_headers is preferrable because it is really the headers
that we depend on. Using instead e.g., utils, would trigger build of
source files, that we don't need for these libraries. This commit is
part of a larger cleanup that I have that is not merged yet. Follow-up
work will generalize this in the repo, and ensure that every(!) library
builds.
We have to add CONFIG_LIB, as the log module has a direct dependency
onto the configuration module (it uses it). I am not sure why this was
not relevant before.
This merge request is for two issues:
1. Core Network Deployment/Undeployment
If the Helm release oai5gcn does not exist (e.g., it was already deleted,
failed during installation), helm uninstall will fail with a "release not
found" error. The --timeout 60s makes Helm wait up to 60 seconds for all
resources to be deleted. If cleanup takes longer (e.g., due to resources
or dependencies), the command fails with a timeout error, potentially
leaving resources in an incomplete state.
2. Increase the timeout value for OpenShift RHEL Builds
The timeout parameter is set as the maximum wait time for the jobs to complete.
If the jobs do not complete within that time, the function logs an error. The
jobs may take longer to complete, the function exits early with an error, even
if the jobs are still progressing.
So, to address both the issues:
We first list all installed Helm releases in the given namespace, returning only
their names. We then pass the release names to helm uninstall, uninstalling all
releases in the namespace. The default value for timeout is 5 minutes.
Increased the timeout value for the RHEL Builds.
fix(nrLDPC_decoder): fix numIter increment
The logs of ./nr_ulsim -n100 -m19 -s12 -S12 -z2 -L4 were showing that sometimes
the decoding of one segment was failing while the CRC check succeeded. This was
happening because the iteration counter numIter was not properly managed so that
when the last iteration was successful to decode the segment still numIter at
the exit was equal to numMaxIter plus 1 so that decoding was considered to have
failed. In other words the last iteration if it occured was always wasted.
This commit offers to solve this problem by simply moving the iteration counter
increment at the end of the iteration loop while remaining careful at fixing the
tests relying on this counter.
Post-Scriptum:
After a first review, we decided to make the counter more standard from a C code
perspective. The counter now counts from 0 to numMaxIter minus 1. If it reaches
numMaxIter, it means that decoding was unsuccessful.
Integration: `2025.w10`
See merge request oai/openairinterface5g!3299
* !3265 Remove some unnecessary extern files
* !3288 FeedbackDisabled removed from RA
* !3294 Fix OAI UE uplink_frequency in FDD mode
* !3282 Use common function to prepare DL PDUs in gNB RA
* !3290 Fix get_nr_prach_info_from_index() for FDD and long format
* !3244 Add F1 handover CI test
* !3292 Ensure clean exit of NR UE
* !3298 Preventing segmentation fault in print_rrc_meas (if reviewed and CI is OK)
* !3297 Reset timing_advance on sync/re-sync
* !3289 use slot type for slots in NR
The idea is to make LDPC iteration accounting more standard from a C coding perspective by making two changes:
1. Now the iteration counter starts at 0 for the first iteration and goes up to max_ldpc_iterations - 1 for the last iteration.
If it is equal to max_ldpc_iterations, it means that decoding failed.
2. A chain of useless returns in the UE DLSCH decoding call chain was removed.
Handle N_TA_offset update the same way timing advance changes are handled:
modify writeBlockSize to ensure continuous transmission. Also address possible
data races by making sure the new timing_advance/N_TA_offset is only read
once from global memory.
Added 3 way F1 handover test with data exchange in the F1 pipeline.
The major change is that the UE is acting as a server in the handover
scenarion, so it needs to comply with the changes in !3280.
This prevents the UE to use an outdated timing_advance after a re-sync. It prevents the UE to send a PRACH with a wrong TA, thus preventing a RAPID mismatch in Msg2 (example: '[UE 0][RAPROC][0.0] Received RAR preamble (29) doesn't match the intended RAPID (30)')
The logs of `./nr_ulsim -n100 -m19 -s12 -S12 -z2 -L4` were showing that sometimes the decoding of one segment was failing while the CRC check succeeded.
This was happening because the iteration counter `numIter` was not properly managed so that when the last iteration was successful to decode the segment
still `numIter` at the exit was equal to `numMaxIter` plus 1 so that decoding was considered to have failed.
In other words the last iteration if it occured was always wasted.
This commit offers to solve this problem by simply moving the iteration counter increment at the end of the iteration loop
while remaining careful at fixing the tests relying on this counter.
the standard in 213 8.4 says: "In response to the PDSCH reception with the UE contention resolution identity, the UE transmits HARQ-ACK information in a PUCCH."
Integration: `2025.w09`
See merge request !3284
* !3088 Support for long PRACH formats
* !3266 Add optional UTC time stamp to the logging module
* !3280 Changes required for UE to work as a rfsim server with channel modelling
* !3279 Fix UL-MCS when UL inactivity and no data
* !3283 Limit amp_dmrs to 16 bit signed max
Use `rfsimu_channel_ue1`, `rfsimu_channel_ue2`, etc. if you want to
use different channel models for each client. The client connection
order determines its channel model name.
Enable/disable workaround based on a new option "hanging-workaround".
This addresses an issue where the workaround will trigger even if there
is no risk of a permanent lockup of the system.
If "utc_time" is selected, log lines are prepended with the UTC time,
formatted as YYYY-MM-DD hh:mm:ss.ssssss UTC.
The documentation has been updated. For other time methods, additional
description of what they show has been added.
Integration: `2025.w08`
Closes#772
See merge request oai/openairinterface5g!3273
* !3263 Free ITTI message after receiving it at MAC from RRC
* !3268 Upgrade SIMDe commit
* !3269 chore(ci): change image rentention from 4weeks to 3weeks
* !3227 fix(nrLDPC_coding): timers in DL encoding, fix(ldpctest): Confusion in sizes
* !3270 Update of gNB-N300-Timing-Phytest threshold
* !3272 Fix: write NSSAI info of F1AP Cell Info struct
* !3259 UE DCI no candidates
* !3264 Fix "Received Nack" log for Msg4/MsgB and minor improvement in RA logs
* !3228 Add option to use global noise power for all RX channels in RFSimulator
* !2725 Use 5G-S-TMSI as UE identity in RRCSetupRequest
Use memcpy in nr_prach.c to fill txdata buffer.
Remove global tables related to PRACH generation.
Add new function to compute modulo multiplicative inverse and use it
directly to get inverse instead of LUT.
Removed nr_ru table and compute the values in-place.
In UE, added new flag root_seq_computed in nrUE_config to only compute
the sequence once after new nrUE_config is received.
Long PRACH extends beyond a slot. Changes necessary to mark future slots
that may contain prach in ru, phy and mac functions.
In RU, the PRACH IDFT is done only after receiving last slot and marks
for L1 to start processing. The L1 processes at the last prach slot and
reports to MAC with the first slot index.
In MAC scheduler, the VRB for future slots are also marked as used.
PRACH scheduler is called in advance one frame minus num prach slots.
Use 5G-S-TMSI as UE identity in RRCSetupRequest
This MR includes the following implementation:
- Handle 5G-S-TMSI in RRCSetup:
- Set the ue-Identity to ng-5G-S-TMSI-Part1 in RRCSetupRequest and
- If RRCSetup is received in response to an RRCSetupRequest: set the
ng-5G-S-TMSI-Value to ng-5G-S-TMSI-Part2 in do_RRCSetupComplete
TS 38.331 5.3.3.3 Actions related to transmission of RRCSetupRequest message:
The UE shall set the contents of RRCSetupRequest message as follows:
1> set the ue-Identity as follows:
2> if upper layers provide a 5G-S-TMSI:
3> set the ue-Identity to ng-5G-S-TMSI-Part1;
- Pass 5G-S-TMSI to RRC when NAS receives GUTI in Registration Accept
- NAS extracts GUTI from Registration Accept
- send ITTI indication from NAS to RRC when GUTI is available and store
5G-S-TMSI in RRC instance
- Rework of Initial UE message handling in RRCSetupComplete: simplify code and memory management
- Fix for integrity failure after UE comes back from RRC IDLE
- Other NAS fixes
Note:
- Initial implementation of Initial NAS Message: Service Request -> moved to !3065 (merged)
- Rework of Registration Request added to !3176 (merged)
Closes#772
Add option to use global noise power for all RX channels in RFSimulator
Added new command line option to rfsimulator: noise_power_dBFS. This options
allows the user to configure noise power in dBFS added instead of the
per-channel value.
This makes it so noise is not accumulated per channel reaching higher than
expected values.
The dBFS unit allows easy configuration. The gNB by default uses -36 dBFS
setting. e.g. to reach 3dB SNR one should set the noise_power_dBFS value to -39.
function returns mu of UL BWP if msg1-SubcarrierSpacing absent instead
of asserting. The mu retured by this function is used to compute the
slot number of PRACH. In case of long format, the slot number is as per
UL mu.
Fix "Received Nack" log for Msg4/MsgB and minor improvement in RA logs
Fix "Received Nack" log for Msg4/MsgB, in 4-Step RA. When there is a Msg4 NACK,
we have this log:
[NR_MAC] (UE 91db) Received Nack in MsgB, preparing retransmission!
This MR fixes the message and now works correctly both in 4-Step RA and 2-Step RA.
Other additional but minor improvement in RA logs.
Fix: write NSSAI info of F1AP Cell Info struct
During refactoring, the previously implemented NSSAI field of the cell
info structure was not written to F1AP ASN.1 structures anymore;
eq_f1ap_cell_info() also conveniently omitted the corresponding equality
check. Add this back so the CU can correctly receive the NSSAI in case
of F1 split operation.
Fixes: f278b008 ("Add encoding/decoding library for F1AP Setup
Request (Interface Management) ")
Update of gNB-N300-Timing-Phytest threshold
Current results are in some cases well below the current thresholds. We should
periodically adapt them to actual values so that the test is meaningful.
fix(nrLDPC_coding): timers in DL encoding, fix(ldpctest): Confusion in sizes
Main improvements:
1. fix(ldpctest): Confusion in sizes
IMPORTANT: This fix makes that ldpctest now works with BG2 and K' != K!
(Worth double checking with more cases than I did check with though)
The variable block_length had an ambiguous role and was used as both K and
Kprime. This was leading to arrays with wrong sizes and functions with wrong
arguments. Now there is not anymore block_length but K and Kprime.
Kprime can be set with the command line argument -l.
There was also some problems with array allocation for segments with length
not divisible by 8. A proper sizing with ((size_in_bits + 7) & ~7) / 8 was
used.
A proper masking of the last byte containing payload bits was also added to
keep filler bits to 0 after random initialization.
2. fix(nrLDPC_coding): timers in DL encoding
While timers were available for rate matching and interleaving in the new
interface, these timers were not merged to rate matching and interleaving
timers in nr_dlsch_coding.
chore(ci): change image rentention from 4weeks to 3weeks
The cluster image registry is getting full. At the moment we have limited
storage so we should reduce the retention period.
Free ITTI message after receiving it at MAC from RRC
Sanitize reporting the following leaks. This small commit seems to fix them.
```
Direct leak of 9888 byte(s) in 103 object(s) allocated from:
#0 0x7fea59b60a06 in __interceptor_calloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cc:153
#1 0x556dd89473e7 in itti_malloc /home/francesco/openairinterface5g/common/utils/ocp_itti/intertask_interface.cpp:64
#2 0x556dd8947b76 in itti_alloc_new_message /home/francesco/openairinterface5g/common/utils/ocp_itti/intertask_interface.cpp:93
#3 0x556dd87100a1 in nr_rrc_ue_decode_NR_BCCH_BCH_Message /home/francesco/openairinterface5g/openair2/RRC/NR_UE/rrc_UE.c:858
#4 0x556dd87100a1 in rrc_nrue /home/francesco/openairinterface5g/openair2/RRC/NR_UE/rrc_UE.c:2013
#5 0x556dd871392e in rrc_nrue_task /home/francesco/openairinterface5g/openair2/RRC/NR_UE/rrc_UE.c:1943
#6 0x7fea59a16608 in start_thread /build/glibc-FcRMwW/glibc-2.31/nptl/pthread_create.c:477
Direct leak of 96 byte(s) in 1 object(s) allocated from:
#0 0x7fea59b60a06 in __interceptor_calloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cc:153
#1 0x556dd89473e7 in itti_malloc /home/francesco/openairinterface5g/common/utils/ocp_itti/intertask_interface.cpp:64
#2 0x556dd8947b76 in itti_alloc_new_message /home/francesco/openairinterface5g/common/utils/ocp_itti/intertask_interface.cpp:93
#3 0x556dd86d707c in nr_rrc_ue_process_masterCellGroup /home/francesco/openairinterface5g/openair2/RRC/NR_UE/rrc_UE.c:1094
#4 0x556dd86faed9 in nr_rrc_process_rrcsetup /home/francesco/openairinterface5g/openair2/RRC/NR_UE/rrc_UE.c:1138
#5 0x556dd86faed9 in nr_rrc_ue_decode_ccch /home/francesco/openairinterface5g/openair2/RRC/NR_UE/rrc_UE.c:1200
#6 0x556dd870a518 in rrc_nrue /home/francesco/openairinterface5g/openair2/RRC/NR_UE/rrc_UE.c:2028
#7 0x556dd871392e in rrc_nrue_task /home/francesco/openairinterface5g/openair2/RRC/NR_UE/rrc_UE.c:1943
#8 0x7fea59a16608 in start_thread /build/glibc-FcRMwW/glibc-2.31/nptl/pthread_create.c:477
Direct leak of 88 byte(s) in 1 object(s) allocated from:
#0 0x7fea59b60a06 in __interceptor_calloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cc:153
#1 0x556dd89473e7 in itti_malloc /home/francesco/openairinterface5g/common/utils/ocp_itti/intertask_interface.cpp:64
#2 0x556dd8947b76 in itti_alloc_new_message /home/francesco/openairinterface5g/common/utils/ocp_itti/intertask_interface.cpp:93
#3 0x556dd86be183 in nr_rrc_process_sib1 /home/francesco/openairinterface5g/openair2/RRC/NR_UE/rrc_UE.c:337
#4 0x556dd870c3b3 in nr_rrc_ue_decode_NR_BCCH_DL_SCH_Message /home/francesco/openairinterface5g/openair2/RRC/NR_UE/rrc_UE.c:954
#5 0x556dd870c3b3 in rrc_nrue /home/francesco/openairinterface5g/openair2/RRC/NR_UE/rrc_UE.c:2015
#6 0x556dd871392e in rrc_nrue_task /home/francesco/openairinterface5g/openair2/RRC/NR_UE/rrc_UE.c:1943
#7 0x7fea59a16608 in start_thread /build/glibc-FcRMwW/glibc-2.31/nptl/pthread_create.c:477
```
During refactoring, the previously implemented NSSAI field of the cell
info structure was not written to F1AP ASN.1 structures anymore;
eq_f1ap_cell_info() also conveniently omitted the corresponding equality
check. Add this back so the CU can correctly receive the NSSAI in case
of F1 split operation.
Fixes: f278b00837 ("Add encoding/decoding library for F1AP Setup
Request (Interface Management) ")
Added new command line option to channelmod: noise_power_dBFS. This options
allows the user to configure noise power in dBFS added instead of the per-channel
value.
This makes it so noise is not accumulated per channel reaching higher than expected
values.
The dBFS unit allows easy configuration. The gNB by default uses -36 dBFS setting.
To reach 3dB SNR one should set the noise_power_dBFS value to -39.
To configure using command line use --channelmod.noise_power_dBFS -50. Using this
setting the gNB and nrUE connect without issue.
After a new connection from RRC IDLE, an integrity failure occurs. This
commit is addressing this issue to pass the integrity check.
* Reset ciphering and integrity algorithms when going into RRC IDLE
* Use uplink NAS COUNT in Registration Request for initial KgNB derivation
* Temporarily deriving UP protection keys in Registration Request
* Note: AS SMC handling should be done according to 33.501 §6.8.1.1.2.2
* Use the 5G-S-TMSI stored in RRC to be used as UE identity
* Use 5G-S-TMSI part 1 in RRCSetupRequest encoding (TS 38.331 clause 5.3.3.3)
* Set the ng-5G-S-TMSI-Value in RRCSetupComplete to ng-5G-S-TMSI-Part2 (5.3.3.4 of 3GPP TS 38.331)
* current and only scenario: RRCSetup is received in response to an RRCSetupRequest
* use initialNasMsg to store nas messages buffer and length
* buffer is dynamically allocated in generateRegistrationRequest, so do the
same in NSA and free dynamic allocated data afterwards
> In N1 mode, upon indication from lower layers that the access stratum
connection has been released, the UE shall enter 5GMM-IDLE mode and
consider the N1 NAS signalling connection released (3GPP TS 24.501)
* NAS -> RRC: RRC receives an ITTI message with NAS 5GMM indication message
containing the 5G-S-TMSI derived from NAS GUTI
* 5G-S-TMSI is stored in the RRC instance and to be later encoded in the RRCSetup
During re-establishment we still have a valid SIB1 so we don't decode it
again. Then the UE never moves out of UE_RECEIVING_SIB, making
re-establishment impossible. This fixes addresses this.
Fixes: 11b87d8744 ("NR UE: RRC layer now explicitly tells MAC layer
when the RA procedure can be started)"
[E2 agent] Multi RC REPORT service styles support
Issue: unforeseen capability of having the same RAN Parameter ID across
different REPORT service styles.
Solution: keep only RAN Parameter IDs from REPORT styles that are
supported by OAI. Implement sequence array where each element is
combination of RIC request ID (unique per RIC SUBSCRIPTION) and Event
Trigger Definition. This way we can properly check further conditions
for a certain RAN Parameter ID. (e.g. if xApp is subscribed to RRC
Connected and/or other modes, for "RRC State Changed To" RAN Parameter
ID)
Next steps: for new RAN Parameter ID, add new sequence array.
Issue: unforeseen capability of having the same RAN Parameter ID across different
REPORT service styles.
Solution: keep only RAN Parameter IDs from REPORT styles that are supported by OAI.
Implement sequence array where each element is combination of RIC request ID (unique per RIC SUBSCRIPTION)
and Event Trigger Definition. This way we can properly check further conditions for a certain RAN Parameter ID.
(e.g. if xApp is subscribed to RRC Connected and/or other modes, for "RRC State Changed To" RAN Parameter ID)
Next steps: for new RAN Parameter ID, add new sequence array.
Co-authored-by: Bischoff <tano.bischoff@hhi.fraunhofer.de>
Co-authored-by: Shrinish Donde <shrinish.donde@hhi.fraunhofer.de>
Co-authored-by: Khanh Toan Pham <khanh.toan.pham@hhi.fraunhofer.de>
FHI72: remove polling, fix memory leak
- FHI72 used polling to track the next slot. This is not necessary, a
simple queue does the job and allows to save one core that was
previously at 100%
- Remove a workaround to avoid a memory leak (fixes#812); allows to
also run RFsim/USRP/otehr radios when compiling for FHI72
fix NTN LEO scenarios
- gNB: add support for NTN parameter ta-CommonDrift-r17
- NR UE: fix application of NTN TA information
- NR UE: add command line parameter ntn-initial-time-drift to compensate
time drift during initial sync
- NR UE: fix writeTimestamp inconsistencies
- NR UE: add MAC state UE_RECEIVING_SIB ensuring to start RA only after
successfully receiving SIBs
- rfsimulator: update earth radius for LEO simulation to match UE
position in ue.conf file
- update conf files for NTN LEO scenario
- update description how to run NTN scenarios in RUNMODEM.md
- fix: ta-Common is a round-trip-time, not a one-way delay
- NR UE: simplify calculation of next_tx_slot_and_frame by moving up
assignment of duration_rx_to_tx
- cellbarredNTN indicates notbarred in SIB1 if NTN access is available
- Removed b66 NTN and enabled B254 NTN conf file in CI
- NR UE: RRC layer now explicitly tells MAC layer when the RA procedure
can be started
- move NTN LEO config to band 254 and update doc/RUNMODEM.md
Closes#901
The "writeTimestamp inconsistencies" are coming from the fact that during the actual processing we write `N_TA_offset` samples _and_ `NR_UE_CAPABILITY_SLOT_RX_TO_TX` slots ahead,
but both was not corrently considered in readFrame() and syncInFrame().
Therefore, there was always a warning about a gap in write timestamps as soon the actual processing starts.
The value of ntn_init_time_drift is used at initial sync to compensate for the time drift during initial sync detection.
To perform the initial time and frequency sync, the OAI UE currently takes a snapshot of two frames and then performes PSS correlation, SSS detection and MIB decoding.
Doing this takes much time, several tens of ms. During that time, the DL timing drifts so much, that we immediatedly lose sync again.
Therefore the current OAI UE implementation needs to know the drift rate to compensate for this drift, as we are "blind" while performing the initial sync.
To my undestanding, commercial UEs simply have a faster initial sync, so the DL timing will not drift away too much while performing that initial sync.
Add check on force_local in custom_command CI handling
The force_local flag was introduced earlier in the main CI script in
order to run a CI test locally.
The flag was still missing in the Custom_Command handling, which was
still targeting the node specified in the test configuration file. This
was causing a failure in the tests with custom commands and therefore
limiting the scenarios that could be run locally.
With this commit, if force_local is enabled the node for the
Custom_Command is set to localhost.
Refactor and extend NAS Registration Request
Extended NAS Registration Request generation and encoding according to
8.2.6 of 3GPP TS 24.501. Main topics:
- NAS Registration Type
- NAS KSI
- integrity protection
- NAS container encoding
Improvements:
- Add 5GMM Modes in NAS
- Introduced 5GMM state machine
Fixes:
- add 5GMM Capability IE to Registration Request
- closes#881, #819
Dynamic PDCCH aggregation level
The aggregation level search order for PDCCH candidates is modified:
- the search starts from desired_agg_level_index, which is a value from
0 to 4 proportial to pdcch_cl_adjust.
- pdcch_cl_adjust is a value between 0 and 1 that indicates PDCCH
channel quality by averaging HARQ DTX rate. A value of 0 means perfect
channel, a value o 1 means impaired channel.
Also added configuration option for number of PDCCH candidates per
aggregation level.
The aggregation level search order for PDCCH candidates is modified:
- the search starts from desired_agg_level_index, which is a value from 0 to 4
proportial to pdcch_cl_adjust.
- pdcch_cl_adjust is a value between 0 and 1 that indicates PDCCH channel quality
by averaging HARQ DTX rate. A value of 0 means perfect channel, a value o 1 means
impaired channel.
first_rx_set is polling-specific: it makes the polling loop wait to only
check the frame/slot counter once we set it for the first time. However,
that is equivalent to checking the frame/slot directly, which will also
be 0 in the beginning.
first_read_set seems to have the function of making frame/slot time
advance only if we started to read the samples in
xran_fh_rx_read_slot(). I interpret that as "only advance the time if
the gNB is reading from xran", which does not make sense to me, because
xran advances the time anyway. Also, polling would not notice, and
no-polling would simply warn about double messages. So the outcome is
likely the same, whether first_read_set is set or not.
I checked in multiple CI runs; it happens that first_read_set is always
set already when oai_xran_fh_rx_callback() is called anyway.
xran_fh_rx_read_slot() uses polling (a loop over cnt++) to wait for the
next frame/slot. The reasons I have been told is "it does not work
differently", or "there are real-time problems". None of those seem to
be true; by default disable polling, and use the queue instead.
It is possible to enable polling with the cmake option
OAI_FHI72_USE_POLLING=ON. Documentation has been updated to inform about
this change.
The queue L1_rx_out was in place to keep RX/TX processing relatively
"close" to each other (in terms of time, since in RFsim, they might
advance faster than realtime; see also parent commit). This lead to a
memory leak in radios that do not use ru->feprx (no front-end processing
for RX, e.g., PRACH), as the code to read the L1_rx_out messages was
inside a block of if (ru->feprx). Move it out so that the queue is
always read and messages are freed to eliminate the memory leak, and
remove the workaround for FHI72 to avoid this memory leak.
This also allows to run RFsim when compiling FHI72, which was not
possible before this commit.
Closes: #812
Some radios (e.g., RFsim) can run faster. A mechanism has been put in
place to keep RX/TX frame/slot numbers not too far from each other.
Refactor in a separate function with documentation to make this clearer.
* The force_local flag was introduced earlier in the main CI script
in order to run a CI test locally. The flag was missing in the
Custom_Command handling, which was still targeting the node specified
in the test configuration file. With this commit, if force_local
is enabled the node for the Custom_Command is set to localhost.
Integration: `2025.w06`
See merge request oai/openairinterface5g!3248
* !3202 Simplify usage of the old segment decoding libraries with the slot coding interface
* !3240 Fix typos in NR_SA_Tutorial_OAI_multi_UE.md
* !3242 Period based phytest bitmap
* !3238 Refactor tun_if.h
* !3000 Improvements for NR dlsim and ulsim
* !3239 Remove inexistant SIMD instruction
* !3246 Deadlock avoidance in rfsimulator
* !3251 nFAPI: make 4-layer on 100MHz work
* !3243 Reset E1 UE contexts after E1 Setup Response
* !3245 Added Support of 35Mhz,45Mhz,70Mhz Bandwidth
* !3219 E1AP enc/dec lib improvements
E1AP enc/dec lib improvements
This MR is including some fixes and improvements for the E1AP library,
focusing mostly on Bearer Context Management:
- struct reorganization: split setup and modification request messages
into distinct structures, ensuring compliance with 3GPP TS 38.463
specifications
- add encoding/decoding sub-functions for different IEs
- improvements to Bearer Context Management: Implemented various
improvements to the E1 Bearer Context Setup Response and Request,
including the adoption of encoding/decoding sub-functions for
different IEs
- use lib functions whenever need (e.g. cp_bearer_context_setup_request
in cucp_cuup_e1ap.c)
- handle optional struct members as pointers
- updated copy/equality check utility functions
EDIT: The MR is also including the changes from !3222 (closed):
> While testing E1 with security enabled for DRBs, it was found that
> data traffic was not functional.
>
> The problem was that security settings were modified in the PDCP
> reestablishment happening when receiving Bearer Context Modification
> Request.
>
> So some restructuring was done.
>
> The actual fix is in 18176297, the others are for support. Basically
> we introduce a boolean to check if the security settings are present in
> Bearer Context Modification Request and we change PDCP security settings
> only if they are.
>
> (Note that in OAI CU security settings are not sent in Bearer Context
> Modification Request, so we could also remove all this, but we need to
> be compatible with other cu-up and/or cu-cp.)
Added Support of 35Mhz,45Mhz,70Mhz Bandwidth
Added Support of 35Mhz,45Mhz,70Mhz Bandwidth for 30Khz Subcarrier
Spacing, Also added 35Mhz, 45Mhz bw for 15Khz Subcarrierspacing.
Referred Spec TS 38.101 v18.6.0 section 5.3.2, table 5.3.2-1
Reset E1 UE contexts after E1 Setup Response
38.463 sec. 8.2.3 says
> This procedure also re-initialises the E1AP UE-related contexts (if
> any) and erases all related signalling connections in the two nodes
> like a Reset procedure would do.
Hence, delete all contexts after reception of E1 Setup Response. This
minimizes a risk of receiving an E1 bearer setup req for an existing UE,
which currently leads to an assert [we trust the CU-CP does not send the
same UE ID twice, as we only "mirror" the existing UE ID]. After this
MR, this is what happens if these entities fail:
- CU-CP fails: all context lost implicitly, upon reconnection, both DU
and CU-UP reset all contexts (like "start from zero")
- DU fails: CU-CP triggers NGAP UE context release request immediately
(radio connection with UE lost), all UE contexts attached to this DU
cleared (like "start from zero" for affected DU)
- CU-UP fails: initially, nothing (UE has no user plane); upon
reconnection of CU-UP, CU-CP triggers NGAP UE context release request
(cause radio connection with UE lost) and sends F1 Reset to DU, all UE
contexts associated to this DU cleared (like "start from zero")
for the last case, a possible improvement could be to use the F1 Reset
message to only clear affected UE conetxts. I chose not to do this,
because this MR is very big now already, and possible "victim" UEs
that were not at that CU-UP will reconnect as well
In Bearer Context Modification Request, the security information
field is needed only if we change the PDCP algorithms/keys. Since we
don't, no need to pass it.
Let's keep the old code, maybe the current understanding of the
specifications is wrong.
If the Bearer Context Modification Request does not contain security
information, the PDCP entity shall keep the currently configured security
settings.
Passing -1 for ciphering_algorithm and integrity_algorithm is the way
to implement this logic.
Check if the IE is memory allocated to deal with presence/absence of this information
element in Bearer Context Modification Request and add encoding/decoding
in the code.
Note that for decoding the integrity settings may be absent, in which
case we consider NIA0 to be used (no integrity protection). To be refined
if needed.
And for encoding, we always encode integrity settings, even if it's NIA0.
May also be refined if needed.
This was not a big problem, but we were advertising wrong
algorithm and deriving keys using this wrong algorithm in case
DRB ciphering and/or integrity was not active. (Say SRBs
are configured with NIA2 but DRBs are configured without
integrity, we would advertise NIA2 and send the integrity
key derived for NIA2, instead of NIA0 for both.)
It was not a problem because in the PDU Session Resource To Setup
item, there is "securityIndication" which we use to effectively
activate/deactivate the ciphering and/or integrity.
But it did not look clean to see a SecurityInformation with
incorrect data when inspecting the message in wireshark.
So let's use the correct values.
We could also not include the SecurityInformation if both ciphering
and integrity are not used, and only include ciphering if integrity
is not used (because integrity settings are optional).
But then if only integrity is used, we still need to include
ciphering, setting algorithm to NEA0 (no ciphering), because
the ciphering settings are always included.
This logic is too complex, let's use the simple one to always
include SecurityInformation with NEA0 and/or NIA0 if ciphering
and/or integrity is not activated.
As in deba3ae066 ("Reset CU-UP E1 UE contexts after E1 Setup
Response"), the CU-CP should reset the E1 UE contexts after E1 Setup
Response. 38.463 sec. 8.2.3 says
> This procedure also re-initialises the E1AP UE-related contexts (if
> any) and erases all related signalling connections in the two nodes like
> a Reset procedure would do.
In the case of CU-CP, this is a bit more complicated. More precisely, we
need to wait for the CU-UP to be available again before informing the DU
about the loss (implemented via an F1 Reset message), because otherwise,
the UE might reconnect immediately, before the CU-UP is online again.
Hence, on connection loss, we mark affected UEs (by setting their E1
association ID to 0); as long as the CU-UP does not connect, nothing
will happen (but UEs don't have user plane). Upon CU-UP connecting
again, we request release of the UEs via NGAP (similarly to what is done
if the DU goes offline, see invalidate_du_connections()), free the UE
contexts locally, and send an F1 Reset message to the DU, because
38.473 sec 8.2.1.2.1 says
> a failure at the gNB-CU [...] has resulted in the loss of some or
> all transaction reference information [...] a RESET message shall be
> sent to the gNB-DU.
The core should accept and send an NGAP release command message; since
no UE contexts are to be found (already deleted), the CU-CP will just
send a release complete (together with some warnings).
It might be possible to more gracefully handle the situation (e.g., as
described in 38.401 section 8.9.5 "Change of gNB-CU-UP"), but
- we lack the PDCP SN exchange
- the current procedure has the advantage of being equivalent to
"restart of the entire gNB", with less downtown.
The next commit will use rrc_remove_ue() to delete a CU(-CP+-UP)
context. However, we don't send NGAP UE context release at that moment
(we will instead *request* the release); more generally, it's not clear
that every user of rrc_remove_ue() wants to actually send this message.
Hence, refactor the code by separately calling
rrc_gNB_send_NGAP_UE_CONTEXT_RELEASE_COMPLETE() where appropriate.
Bearer context setup request and modification request messages
differ in various IEs according to 9.2.2 of 3GPP TS 38.463, e.g.
the Bearer context setup request does not contain a list of
DRBs to modify and does not contain an UP TL configuration.
Thus, the goal of this commit is to split the setup request message
and the modification request into two different structs:
* adopt e1ap_bearer_mod_req_t where necessary (e.g. fill_e1_bearer_modif)
Also, reorganized existing struct members according to specs:
* remove irrelevant struct members from the setup request
* group members from the same IEs into structs
* set optional struct members IEs as pointers
* add and adopt enc/dec/cp/eq lib functions for single IEs
* add UP_TL_information_t struct with TEID and TL address info and adopt in stack
* use int instead of long for count types
* update the relevant copy/equality check utility functions
Extra:
* add a function to handle Security Information in RRC in the process
* add create_up_tl_info and adopt in unit tests
nFAPI: make 4-layer on 100MHz work
5G nFAPI headers specify 32 bits for the length field, so use it also
when segmenting messages. This should stabilize 4-layer MIMO operation
on 100MHz with nFAPI.
Deadlock avoidance in rfsimulator
This change introduces a countermeasure for deadlock in rfsimulator. The
deadlock happens when all entities are waiting for new data to come in,
and happens with 2+ clients, when a new client connects. I think this
issue is due to ordering of fullwrite calls, resulting in out-of-order
delivery of packets and eventually trashing the packets on the receiving
side. The out-of-order delivery warnings are printed just before the
system deadlocks but I have not found a better solution so far. The
workaround makes the server never lock up permanently by ignoring the
client failure to write on time after 10 tries.
This was tested locally for both UE as server and gNB as server and
works correctly, causing the deadlock to clear and the added log to be
printed several times when the deadlock is detected, after which the
system goes back to normal.
I have some gdb output of the executables during deadlock:
UE:
$7 = {conn_sock = 98, lastReceivedTS = 3226163740, headerMode = true, trashingPacket = false, th = {size = 13184, nbAnt = 1, timestamp = 3226150556, option_value = 0, option_flag = 0}, transferPtr = 0x7f6a500018a8 "\200\063", remainToTransfer = 24,
circularBufEnd = 0x7f6a503b3ac0 "", circularBuf = 0x7f6a501f1ac0, channel_model = 0x0}
(gdb) p t->buf[5]
$8 = {conn_sock = 97, lastReceivedTS = 0, headerMode = true, trashingPacket = false, th = {size = 0, nbAnt = 0, timestamp = 0, option_value = 0, option_flag = 0}, transferPtr = 0x7f6a50001900 "", remainToTransfer = 24, circularBufEnd = 0x7f6a50575ad0 "",
circularBuf = 0x7f6a503b3ad0, channel_model = 0x0}
nextRxTimestamp 3225937740
nsamps = 30720
gNB 1:
(gdb) p t->buf[0]
$4 = {conn_sock = 95, lastReceivedTS = 3226026876, headerMode = true, trashingPacket = false, th = {size = 1, nbAnt = 1, timestamp = 3226026875, option_value = 0, option_flag = 0},
transferPtr = 0x7f8dfc003ab8 "\001", remainToTransfer = 24, circularBufEnd = 0x7f8e1c3ff010 "", circularBuf = 0x7f8e1c23d010, channel_model = 0x0}
nextRxTimestamp 3225996956
gNB 2:
lastReceivedTS = 3226026875
$2 = {conn_sock = 95, lastReceivedTS = 3226026875, headerMode = true, trashingPacket = false, th = {size = 1, nbAnt = 1, timestamp = 3226026875, option_value = 0, option_flag = 0},
transferPtr = 0x744898003ab8 "\001", remainToTransfer = 24, circularBufEnd = 0x7448bc2e7010 "", circularBuf = 0x7448bc125010, channel_model = 0x0}
nextRxTimestamp 3226026875
As you can see all executables are in have_to_wait state.
38.463 sec. 8.2.3 says
> This procedure also re-initialises the E1AP UE-related contexts (if
> any) and erases all related signalling connections in the two nodes like
> a Reset procedure would do.
Hence, delete all contexts after reception of E1 Setup Response. This
minimizes a risk of receiving an E1 bearer setup req for an existing UE,
which currently leads to an assert [we trust the CU-CP does not send the
same UE ID twice, as we only "mirror" the existing UE ID].
* Without a valid 5G NAS security context:
* Send REGISTRATION REQUEST with cleartext IEs only.
* After activating a security context via Security Mode Control:
wrap the entire REGISTRATION REQUEST (with both non-cleartext and cleartext)
in a NAS message container IE, include it in SECURITY MODE COMPLETE
* With a valid 5G NAS security context:
* If non-cleartext IEs are needed, wrap the entire message in a NAS message container IE and cipher it.
* If only cleartext IEs are needed, send the message directly without the NAS message container IE.
* this commit is enabling the handling of non-cleartext IEs in the NAS Registration Request message
according to 24.501, 23.502
* send the full Registration Request message in the NAS Container of the SECURITY MODE COMPLETE
* send the non-cleartext IEs in the NAS container of the Registration Request
closes#881
* send integrity protected Initial NAS Message when UE in 5GMM-IDLE mode has valid current 5G NAS security context:
> According to 4.4.2.5 TS 24.501:
> when a UE in 5GMM-IDLE mode establishes a new NAS signalling connection and has a valid current 5G NAS
> security context, the UE shall transmit the initial NAS message integrity protected with the current 5G NAS security
> context and further protect this message as specified in subclause 4.4.6.
* set NAS key set identifier IE to "no key is available (UE to network)"
* previously set to 1 which has no impact
* set now to 111 in order to trigger new authentication
* See 9.11.3.32 of 3GPP TS 24.501
* Do 5GS Registration Type "mobility registration updating" when 5GMM state is De-registered
Make the same change as in parent commit, i.e., write the full 32-bit
segment size.
I could not test this, as we do not reach these rx_data.indication
length. It's based on the fix in the parent commit, and to avoid future
bad surprises.
The 5G nFAPI message length is 32bits. In particular tx_data.requests
can be longer than 64kB. When segmenting, we should correctly write the
message of the current segment (across all 32bits), because the
length would interpreted wrongly otherwise.
This fixes a bug in which tx_data.requests were discarded for 4-layer DL
MIMO on 100 MHz with this message:
P7 unpack message length is greater than the message buffer
Further, increase the type of various (segment-related) variables to 32
bits. Currently, the maximum segment size is sxt to 65000 bytes (and in
will likely remain, because the maximum UDP size is 65536);
nevertheless, increase it in case we will ever go beyond this.
See also commit dee68e6319 ("nFAPI: increase maximum segment size to
65000")
Simplify usage of the old segment decoding libraries with the slot coding interface
This MR transforms the segment coding libraries into slot coding
libraries by statically linking the adaptation layer and the segment
coding libraries.
Therefore they can be used directly in ldpctest which uses the segment
coding interface as well as in all the other PHY simulators and the NR
softmodem which use the slot coding interface.
It is not anymore needed to use the
--nrLDPC_coding_segment.segment_shlibversion
flag. Instead a segment coding library can be directly chosen with
--loader.ldpc.shlibversion
since it implements the slot coding interface.
* added fgs_mm_mode_t enum
* added struct member to NAS
* modes: FGS_IDLE, FGS_CONNECTED
* according to 5GS mobility management (5GMM) modes 5.1.3.2.1.1 of TS 24.501
The variable block_length had an ambiguous role and was used as both K and Kprime.
This was leading to arrays with wrong sizes and functions with wrong arguments.
Now there is not anymore block_length but K and Kprime.
Kprime can be set with the command line argument `-l`.
There was also some problems with array allocation for segments with length not divisible by 8.
A proper sizing with `((size_in_bits + 7) & ~7) / 8` was used.
A proper masking of the last byte containing payload bits was also added to keep filler bits to 0 after random initialization.
The name ldpc8blocks_coding_segment was previously used to avoid any confusion with ldpc8blocks while both were coexisting.
They are not anymore coexisting so it can now be shortened.
While timers were available for rate matching and interleaving in the new interface,
these timers were not merged to rate matching and interleaving timers in nr_dlsch_coding.
Integration: `2025.w05`
Closes#885
See merge request oai/openairinterface5g!3233
* !3102 Dockerized development environment
* !3185 Add IQ file recording and IQ file viewer to ImScope
* !3218 more layer1 cleaning
* !3224 Ensure execution of processSlotTX in order in NR UE
* !3231 Bugfix in frame and slot setting for ULSCH beam allocation
* !3229 Verify the integrity protection of the RRCReestablishment message
* !3230 FHI72: fix for single distributed antenna array for xran F release
* !2984 NAS 5GS refactor
* !3235 Parametrized JenkinsNode and JenkinsResource
* !2799 Changes to support multiple TDD patterns
* !3208 Downgrade gNB power limit LOG from "warning" to "debug"
Downgrade gNB power limit LOG from "warning" to "debug"
Downgrade the UE power limited LOG from LOG_W to LOG_D. This is to avoid
flooding stdout when UE in low coverage enters power limited state for a
longer period of time. The same information can be inferred from the
periodic UE print which also contains PH value (negative PH values
indicate that the UE is power limited)
Also, correct some typos in PH calculation.
Closes#885
Changes to support multiple TDD patterns
- Updated the configuration changes for 2 Patterns
- Update the TDD table configuration for NFAPI
- Added the tdd bitmap for the period
- Adapted the bitmap for UL/DL for the multi TDD pattern
- Updated the RACH procedure for multi TDD pattern
- Updated DL and UL scheduler for multi TDD pattern
Parametrized JenkinsNode and JenkinsResource
Parametrized variables in Jenkinsfile for automated tests on Colosseum
after update of OAI Jenkins server.
NAS 5GS refactor
The goal of this MR is to reorganize the NR NAS code into:
- enc/dec library functions (5GS, 5GMM, 5GSM, NR_NAS_defs.h,
nr_fgs_nas_lib.c)
- handlers and callbacks (nr_nas_msg.c)
The following changes are introduced:
1. migrate 5GS enc/dec lib (5GMM and 5GSM) to a dedicated folder
2. add a nested CMakeLists structure
3. refactor NR NAS enc/dec functions
4. refactor NR NAS messages struct definitions
5. remove most of dependency from NAS LTE
6. further refactor of PDU Session Establishment Accept processing to
separate enc/dec from handling
7. made naming of 5GS definitions consistent whenever necessary
8. cleanup unused code
9. remove redundant struct definitions
Also:
1. fix decoding of AMF Set ID in 5G-S-TMSI UE identity
2. replace Byte_t directly with uint8_t
FHI72: fix for a distributed antenna array for xran F release
in the Rx callback I reset the number of section descriptions/number of
fragments to 0, but for each antenna up to max number of antennas per
RU, instead of up to max number of distributed antenna array
* Remove the ulsch_slot_bitmap and dlsch_slot_bitmap from nrmac
* Adopt the new is_dl_slot/is_ul_slot functions in the stack
to replace is_xlsch_in_slot: these functions are getting
the DL and UL slots as they are set in the TDD configuration
stored in tdd_slot_bitmap (frame_structure_t)
* Keep is_xlsch_in_slot in openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c:
this is necessary because the phy-test pre-processors are using the bitmaps
dlsch_slot_bitmap and ulsch_slot_bitmap to check which DL/UL slots to use
for transmission among those set in the TDD configuration
Co-authored-by: Guido Casati <guido.casati@firecell.io>
previously we had decodeRegistrationAccept acting as a handler and calling
decode_registration_accept to do the decoding. However the logic was mixed
between the two functions, the naming was confusing and the code was hard
understand. The goal of this commit is to simplify the code, improve
readability and maintainability, while adapting the relevant function
to the new OAI NAS libs structure.
To this purpose:
* move enc/dec logic to NAS lib openair3/NAS/NR_UE/5GS/5GMM/MSG/RegistrationAccept.c -
the logic of parse_allowed_nssai, get_allowed_nssai has been moved to
decode_registration_accept and decode_nssai_ie
* add decode_nssai_ie and use it for both Allowed/Configured NSSAIs list (IE handling was added)
* do processing in the handler handle_registration_accept
* simplify the code by removing nested calls
* improve handling of PDU length
Currently only Registration Result, 5GS Mobile Identity, Allowed/Configured NSSAI
are decoded. The other optional IEIs are skipped (only the length is processed).
Downgrade the UE power limited LOG from LOG_W to LOG_D. This is to avoid flooding
stdout when UE in low coverage enters power limited state for a longer period of
time. The same information can be inferred from the periodic UE print which also
contains PH value (negative PH values indicate that the UE is power limited)
- in the Rx callback I reset the number of section descriptions/number of fragments to 0,
but for each antenna up to max number of antennas per RU, instead of up to max number of a distributed antenna array
Ensure execution of processSlotTX in order in NR UE
Make sure that processSlotTX is executed in slot order.
There is a bug that causes decoding error when processSlotTX is executed
out of order. The root cause is not known at this point, but this change
avoids the bug altogether.
Add IQ file recording and IQ file viewer to ImScope
This changeset introduces the following changes to ImScope:
- Added the ability to record IQ data using the same mechanism as
ImScope.
- Added a new executable target imscope_iq_file_viewer for viewing IQ
files.
- Introduced a command line argument --imscope-record that enables data
recording mode.
- Refactored a lot of the scope code
Usage:
- To record IQ data, run a modem with --imscope-record flag. The
recording happens whenever a modem calls dumpScopeData, which
currently is done only in gNB on PUSCH DTX and PUSCH CRC NOK. There
is a limit of ~1GB of files written by the thread in a signle run to
avoid accidentally exhausting disk space. If a directory imscope-dump
is available the data will be recorded there in .imscope files.
Otherwise files are written to the directory the modem was run. This
is done so that the directory can be mapped in a docker container.
- To view recorded IQ files, use the new executable
imscope_iq_file_viewer. This can be done by running:
./imscope_iq_file_viewer <path_to_iq_file>
Replace <path_to_iq_file> with the path to the IQ file you want to view.
Dockerized development environment
This commit introduces a fully dockerized dev env you can start on any
machine that has docker without installing any direct OAI dependencies
on host.
This allows to migrate development environments between machines easily.
Several complementary scripts were added to enable smooth transition
between your docker environment and host environment. Your user and sudo
should work inside the environment.
In its current state, the environment can be used to compile
nr-softmodem with 7.2 FHI but it cannot run it due to missing
dependencies.
This commit introduces a fully dockerized dev env you can start on any
machine that has docker without installing any direct OAI dependencies
on host.
This allows to migrate development environments between machines easily. Several
complementary scripts were added to enable smooth transition between your docker
environment and host environment. Your user and sudo should work inside the
environment.
* the last 6 bits of the GUTI represent the AMF Pointer
* the AMF Set ID is 10 bits long
* the Registration Accept message received from the network contains the GUTI
which, when properly decoded, will be used in any possible following Registration Request
* use defines whenever possible
* introduce a switch to handle security type. Currently only integrity protected and ciphered
is handled, however the idea of the switch is to make the code ready for the future when
different security types will be handled and different actions should be taken based on that.
* define NAS_INTEGRITY_SIZE
* the goal of this commit is to refactor capture_pdu_session_establishment_accept_msg
into a decoding function
* PduSessionEstablishmentAccept.c is in the 5GSM library and shall only do encoding operations
* handling of PDU Session Establishment accept message is done in nr_nas_msg.c
* adopted new NAS decoding functions in the process
* improved QoS rules decoding
* convert getShort into a macro and add to NAS utils
as per legacy code, the NAS functions in nr_nas_msg.c were encoding
the header in the plain header contained in MM_msg
(e.g. plain -> mm_msg -> header in fgs_nas_message_t). The same
header was encoded in the mobility management message contained
in the same struct (e.g. plain -> mm_msg -> registration_request
-> protocoldiscriminator). As this was more complicated than
necessary, the goal of this commit is to simplify the code and
improve readability. Namely:
* Refactor MM_msg into fgmm_nas_message_plain_t to contain
(1) 5GMM Header
(2) 5GMM Payload union
* Use fgmm_nas_message_plain_t and fgmm_nas_msg_security_protected_t
in the 5GMM NAS procedures
* Remove NAS header IEs from 5GMM messages structs and use
the header in fgs_nas_message_plain_t.
This reduce also the repetitions of header members in each
of the 5GMM messages structs.
* Rename struct to distinguish between 5GMM and 5GSM
* Remove fgs_nas_message_t and nas_msg_header_t,
use directly basic 5GS struct definitions, simplify the code
* The callbacks in nr_nas_msg.c are now doing
(1) encode header with the common NAS lib
(2) encode contents with the 5GMM libs
* improve code readibility in the process
* replace encoding code with proper functions from the lib
* remove unnecessary header members in struct definition
this commit removes last enc/dec code in nr_nas_msg.c
* move enc/dec definitions to NR_NAS_defs.h and add new lib file nr_fgs_nas_lib.c
both used by nr_nas_msg.c
* move utility macros to fgs_nas_utils.h: this can be used in all the 5GMM, 5GSM lib files
* use nr_nas_msg.c for handlers/callbacks only, it should call the enc/dec
functions in nr_fgs_nas_lib and in the 5GMM, 5GSM libs
* 5GMM, 5GSM libs should only do the enc/dec of the NAS message contents
* move defines to openair3/NAS/NR_UE/nr_nas_msg.h as they are
only used in nr_nas_msg.c
* made naming of all message types consistent, using the same
prefix for all
* the only function used from nr_common.c is servingNetworkName which is
used in nr_nas_msg.c, so it was moved to the latter file and its scope
was reduced
Every NAS 5GS message can have 3 different headers: (1) security protected
(2) 5GMM plain (3) 5GS plain;
According to 3GPP TS 24.501:
> 4.2 Coordination between the protocols for 5GS mobility management and 5GS session management
> A 5GS session management (5GSM) message is piggybacked in specific 5GS mobility management (5GMM) transport
> messages. To this purpose, the 5GSM messages can be transmitted in an information element in the 5GMM transport
> messages.
A PDU Session Establishment accept is a 5GSM message and as such it is contained in a 5GMM
transport message. The code in capture_pdu_session_establishment_accept_msg is reflecting this.
The message is thus expected to have: (1) Security protected 5GMM header (2) Plain 5GMM message
(3) 5GSM Payload Container (4) Plain 5GSM message.
5.4.5 of 3GPP TS 24.501: also says:
> The type of the payload is identified by the Payload container type IE and includes one of the following: a) a single 5GSM message;
Thus, a 5GSM is not the only possible payload of a NAS transport message.
This commit is focusing on the refactoring of the structs definitions and adaptation of the CMakeLists.
Based on the above:
* Move NR_NAS_defs.h to 5GS subfolder in NR_UE
* Move NAS FGS structs and definitions to NR_NAS_defs.h
* Rename mm_msg_header_t to fgmm_msg_header_t
* Remove duplicated NAS struct definitions
(1) kept fgs_nas_message_security_header_t over security_protected_nas_5gs_msg_t
(2) Kept fgsm_msg_header_t over fgs_sm_nas_msg_header_t
* Remove unused definitions, structs, functions in the process
This commit is introducing the following macro changes:
(1) Migrate NAS 5GS lib files to a new 5GS subfolder in NR_UE
and organize NAS 5GS lib messages into 5GMM and 5GSM subfolders.
A nested CMake structure was implemented and CMakeLists.txt were
added whenever necessary. This is effectively separating 5GS
libraries from LTE libraries.
(2) In order to simplify the separation of 5GS libs from LTE libs,
remaining dependencies from NAS LTE (e.g. nas_ue_task.c, ue-idx-standalone)
were removed in the process
(3) ExtendedProtocolDiscriminator.c/.h and SpareHalfOctet.c/.h were deleted
and affected types were replaced with simple integer types
(4) Cleanup: unused definitions and libs (e.g. LIB_5GNAS_GNB)
were removed
(5) Update doc/Doxyfile
(6) clang-formatted the migrated files in the process
(7) Update includes of headers in affected files
This avoids the issue of compare_exchange_weak always failing. The issue
was that `store()` is not equal to `exchange()`. `exchange` uses memory
copy while `store()` copies the value representation of the argument, which
is not always the same thing.
- Added event parameter for recording which is reflected in the filename
- Added event in the UE for DLSCH NACK
- Added program name to the filename for ease of identification
- Reworked spinlock to use atomics
This commit introduces the following changes to ImScope:
- Added the ability to record IQ data using the same mechanism as ImScope.
- Added a new executable target `imscope_iq_file_viewer` for viewing IQ files.
- Introduced a command line argument `--imscope-record` that enables data recording mode.
- Refactored a lot of the scope code
Usage:
- To record IQ data, run a modem with `--imscope-record` flag.
The recording happens whenever a modem calls dumpScopeData, which currently is
done only in gNB on PUSCH DTX and PUSCH CRC NOK.
There is a limit of ~1GB of files written by the thread in a signle run to avoid
accidentally exhausting disk space.
If a directory `imscope-dump` is available the data will be recorded there in .imscope
files. Otherwise files are written to the directory the modem was run. This is done so that
the directory can be mapped in a docker container.
- To view recorded IQ files, use the new executable `imscope_iq_file_viewer`. This can be done by running:
```
./imscope_iq_file_viewer <path_to_iq_file>
```
Replace `<path_to_iq_file>` with the path to the IQ file you want to view.
* is_ul_slot: returns `true` for UL or mixed slots
* is_dl_slot: returns `true` for DL or mixed slots
* is_mixed_slot: returns `true` for mixed slots
These functions use the TDD slot bitmap for slot type checks
Co-authored-by: Guido Casati <guido.casati@firecell.io>
* take into account pattern2 in nr_rrc_config_dl_tda
* use get_tdd_period_idx in nr_rrc_config_ul_tda
* use get_first_ul_slot_multi_tdd in set_SR_periodandoffset
Co-authored-by: Guido Casati <guido.casati@firecell.io>
* refactor set_ideal_period to use frame_structure from MAC
* use get_ul_slot_offset to assign slot offset to nth UE and adopt in
updated config_csirs, configure_periodic_srs, set_csi_meas_periodicity
Co-authored-by: Guido Casati <guido.casati@firecell.io>
* the function is returning the index of the first full UL slot in tdd_slot_bitmap
or the first UL slot (including mixed) if the "mixed" flag is provided
* the get_ul_slot_offset function calculates the offset of the nth uplink (UL) slot for a given UE index within a TDD period
* this function uses the frame structure bitmap to determine the UL slot positions
* allocate memory for pattern2 only if the IE is present (it is optional)
* fix scc (deallocate memory) when necessary
Co-authored-by: Guido Casati <guido.casati@firecell.io>
* use config_frame_structure in config_common:
- fill frame_structure in MAC and NFAPI Config Request
- use get_tdd_period_idx to set periodicity index in Config Request
- use config_tdd_patterns to fill tdd_period_config
- use set_tdd_config_nr to complete NFAPI Config Request configuration
Co-authored-by: Guido Casati <guido.casati@firecell.io>
* assuming num_dl_slots and num_ul_slots are including also
slots with dl/ul symbols respectively
* refactor set_tdd_config_nr
* moved function to MAC
* fill max_num_of_symbol_per_slot_list depending on slot type
* use new set_tdd_config_nr in stack
* minor refactor in config.c to improve readability (scs)
Co-authored-by: Guido Casati <guido.casati@firecell.io>
* set_tdd_bmap_period, config_tdd_patterns: to configure TDD period, including bitmap, in the frame structure
* get_tdd_periodicity: to retrieve the periodicity in milliseconds for the given TDD pattern
* get_tdd_period_idx: to get the TDD period index based on pattern periodicities
* get_ul_slots_per_period: get the number of UL slots (including mixed with UL symbols) in period
* get_full_ul_slots_per_period: get the number of full UL slots in period
* get_dl_slots_per_period: get the number of DL slots (including mixed with DL symbols) in period
* get_full_dl_slots_per_period: get the number of full DL slots in period
Co-authored-by: vijay chadachan <vijay.chadachan@firecell.io>
* allocate and configure NR_PUSCH_TimeDomainResourceAllocation in a separate function
* remove duplicated lines of code
* use in nr_rrc_config_ul_tda
* use calloc_or_fail
* clang-formatted
Integration: `2025.w04`
Closes#876, #896, #875, #893, and #878
See merge request oai/openairinterface5g!3226
* !3198 remove a set of compile options that don't work anyway
* !3171 Refactor SCTP Association Response Handling and E1 connection loss at CU-UP
* !3023 usrp constant and slow derive timestamp
* !3215 Remove unused code
* !3192 fix nr phy-test mode in ntn
* !3214 fix(nrLDPC_coding_t2): Miscellaneous fixes related to T2
* !3020 use ML receiver for 64 QAM UL-MIMO
* Demote error logs to debug for "PUCCH not processed"
* !3217 minor improvements in T hacks
* !3199 Add a small FAPI Hex parser utility
* !3209 Remove most of m64 type usage
* !3211 Avoid huge calloc by alloc'ing TBs independently
* !3212 F1AP IDs: Allow AddMod, fix concurrency bug
* !3152 E1 Setup enc/dec library and unit test
* !2999 Repair nFAPI in 5G
* !3210 FHI72: FDD support
* !3220 Improve RA logs
Improve RA logs
Modify existing LOG entries to include preamble index, timing advance and
estimated distance from the gNB. This makes mapping RA attempts to
physical/simulated UEs easier via sent/received preamble index or physical
distance from the gNB in scenarios with >1 UE.
FHI72: FDD support
- harmonize DL/UL PRB mapping in one get_xran_prb_map() function with support
of mixed slot and duplex mode
- do not assume TDD by default
Repair nFAPI in 5G
Add 5G nFAPI in OAI/Make it it work.
Many commits in this branch are basically bug fixes of things that don't work
properly, such as
- check for correct conditions (e.g. instance numbers in the RAN context)
- remove artificial limitation (e.g. only one PUCCH per TDD period in the PNF)
- improve performance (reduce big mallocs, make some static buffers such as a
global ring buffer for nFAPI messages in the PNF)
- fix bugs in nFAPI (e.g., increase maximum message size to ~64kB instead of
1500 bytes, because the latter is way too small for many TX_data.requests in
5G, and it will delay message arrival unduly)
- fix bugs in message enc/dec (e.g., handle FDD in config.request)
- adjust the L1 such that the condition "we run monolithic" is not necessery
(e.g., some message numbers in nFAPI struct where reset in MAC, instead of
L1, and this breaks when running the PNF)
There are instructions that explain how to set it up. Two CI tests have been
added, one with COTS UE and MIMO in DL+UL in TDD numerology 1 (30kHz), and a
second test with FDD mu=0 (15kHZ) in RFsimulator.
These were some old to-dos that have been addressed.
- test with COTS UE - 4x4 pipeline works good in DL, UL now also work
- test in RFsim
- make PNF status message
- make FDD in u0 work
This function packs P7 messages. At least RX_data.indication messages
might be much bigger than the global buffer that is used here. Allocate
the buffer on the stack, and make it bigger. Do not use the global
buffer, it's simply not necessary; increasing the global tx buffer size
might have negative effects elsewhere in the code.
That change might make the function reentrant. The mutex seems to only
guards the codec config. However, leave it to not introduce any
regressions as of now.
E1 Setup enc/dec library and unit test
This MR is adding a library for E1 Setup enc/dec functions:
- E1 CU-UP Setup Request
- E1 CU-UP Setup Response
- E1 Setup Failure
and relevant unit tests
F1AP IDs: Add update, fix concurrency bug
I suspect a concurrency bug: For instance, during reestablishment, the
CU needs to update the DU UE ID under which the UE is identified in the
DU. Previously, the CU would remove, then add the DU UE ID info. At the
same time, the PDCP thread might look up the information. This can lead
to asserts. Modify the code to do the update under (one) lock.
Also, refactor some code.
Similar to the parent commit, make the numerology in the VNF
configurable. Unlike for the PNF change, the VNF frame/slot info is in a
per-PNF connection structure to which the "oai_integration" code has no
access. So we need to hack the nfapi_vnf_p7_add_pnf() function signature
to take the numerology, to be able to save this on a per-PNF basis.
The fact that we store this on a per-PNF basis is not strictly required,
as the VNF cannot handle multiple numerologies as of now, either.
However, we might want to extend this in the future, so it seems prudent
to store this on a per-PNF basis, so that we could start handling
multiple numerologies at the L2 without the need to change the L1 or
nFAPI code itself.
Also, the numerology is not needed except for some code that deals with
timing over nFAPI. As of now, we don't use this code (nFAPI gets a
trigger every slot, as per the VNF request, see an earlier commit in
this series), but also here, let's not make the future more complicated
by storing the numerology for each PNF now (this could always be reverted).
For 4G, put numerology 0 (15kHZ SCS), which is the SCS that LTE uses.
Fill in the dynamically received numerology, and make the numerology at
the PNF configurable, following the changes in the parent commit.
The change for the reading is somewhat of a hack, because nFAPI, as of
now, does not really foresee to store the numerology, so we fill the
numerology during the start request, when the numerlogy has been
received in the config request, but at that time, the structure for the
time information (frame/slot) does not exist yet.
At both the PNF and the VNF, introduce a separate numerology field, and
pass the numerology when converting time information using macros from
nfapi_interface.h. The actually numerology is still hardcoded to 1 (as it
was before), but the follow-up commits will put a suitable numerology.
In both cases, but the numerology next to the frame/slot information.
Similar as the parent comment, remove time macros. In this particular
case, we can just pass the exact frame/slot information, instead of
squeezing it in a single integer.
The next commits will modify the time macros used in the 5G nFAPI code
to handle different numerologies. As a preparation, remove all the
usages of these macros where they really don't matter (e.g., don't
convert if we don't need to).
the L1 needs both a PDU (in TX_data.req) as well instructions for
the actual transmission (in DL_TTI.req) to encode a PDSCH message. In
nFAPI, it can happen that a DL_TTI.request message has been received
(configuring the PDSCH transmission), without the TX_data.request having
reached the PNF. The L1 assumes to have the PDU.
To avoid problems, ensure that only the pair of DL_TTI.req/TX_data.req
is delivered. Otherwise, drop either message.
nFAPI has a mechanism to segment messages that are too big for transport
over a given medium (see e.g. SCF 225, section 2.3.2).
The maximum segment size of 10000 makes that for larger payloads, e.g.
TX_data.request, many small segments are to be sent. This can create or
increase delays on the transport. On the other hand, the currently only
available transport mechanism, UDP, allows to transport packets of up to
almost 65535 bytes. Correspondingly, increase the maximum segment size
so that less segments are to be created, and potentially, less delay is
to be incurred. # Please enter the commit message for your changes.
Lines starting
Avoid delays in tx_data.request handling by avoiding big malloc()s and
copy operations. Reimplement function to (1) peek the frame/slot
numbers, (2) decide on buffer, and (3) unpack directly into
pre-allocated memory.
Co-authored-by: hsum <ming-hong.hsu@eurecom.fr>
Co-authored-by: chenyi <Yi-Quan.Chen@eurecom.fr>
Co-authored-by: Rúben Soares Silva <rsilva@allbesmart.pt>
The next commits refactor the rx handling of messages in the PNF. To
efficiently handle them, provide a "peek()" function that gives us the
frame/slot for which a message is destined. This allows to decide if a
message is on time and select a destination buffer, before unpacking it
completely, avoiding copies.
The time that a message between PNF/VNF to arrive depends mostly on the
transport. To allow for some delays, there is a slot_ahead time, during
which the VNF is allowed to schedule and send instructions to the PNF.
This can be multiple slots; the 1ms hitherto given might typically too
short. Increase to 10ms, to encompass a wider range of slot_ahead times.
Make the corresponding log message of when old (stale) message are
removed a bit clearer with respect to times.
This is the first commit in which nFAPI works. Follow-up commits improve
performance.
The usage of this flag in the L1 is simply wrong: either, the NFAPI mode
runs L1, or not. Correspondingly, add an assert to check this invariant.
In the NR_IF_module, the correct check to do is for VNF (implying no L1,
or "emulation of L1" [which is not true]), in which case we use
queues.
The L1 receives a pointer to the L1 payload to use for PDSCH generation.
This would overwrite an existing pre-allocated pointer. Remove this
preallocation. Instead, allocate it in the simulator (the only place
that actively uses this buffer allocation; in nr-softmodem, it's lost by
assigning a pointer). Allocate with an extra byte, because the payload
(in bits) might not be a multiple of 8 bits/1 byte, so the CRC is in the
last 3 bytes.
Also, improve the log with frame/slot information if the PDSCH payload
pointer is NULL.
The function now utilizes simpler variable names and logic to determine
if a given NR P7 request falls within the timing window.
The logic for determining if a request is within the timing window is as follows:
- The function calculates the absolute difference between the current
and received SFN slots, taking into account the possibility of
wraparound.
- If the absolute difference is greater than half of the maximum SFN
slot value, it subtracts this difference from the maximum SFN slot
value to get the actual difference.
- The function then checks if this difference is less than or equal to
the specified timing window. If it is, the request is considered to be
within the window.
Additionally, the commit updates the function signature to return a
boolean value for better readability and consistency.
Changes made:
- Simplified variable names for readability
- Improved logic for handling wraparound scenarios
- Updated function signature to return a boolean value
Co-authored-by: Rúben Soares Silva <rsilva@allbesmart.pt>
Since commit defc97ec16 ("Msg2 and Msg3 at gNB: check allocation before
committing to Msg2"), the scheduler calculate Msg2/Msg3 frame/slot
before allocation of Msg2, and not when receiving Msg1. It also respects
the RA response window correctly.
Correspondingly, we don't need to calculate here if the RACH.indication
is within the time window. The scheduler will do this.
If VNF and PNF are deployed through different processes, it's crucial to
maintain synchronization and ensure smooth operation. This commit
addresses the need to keep the VNF slot ahead of 2 (as required for
network deployment), while ensuring that PNFs wait appropriately to
avoid overtaking the slot. Specifically, this involves measuring slot
duration and implementing a wait mechanism to ensure that PNFs do not
exceed a slot duration of 300 microseconds. This ensures proper smooth
operation, especially in the case of RFsim.
Reset the counters. In monolithic, this happens in the scheduler; in the
PNF, without this change, it would trigger PDCCH again.
Co-authored-by: hsum <ming-hong.hsu@eurecom.fr>
Refactor pnf_phy_ul_dci_req(), pnf_phy_dl_tti_req(),
pnf_phy_tx_data_req(), pnf_phy_ul_tti_req(), to use L1 functions to
"load" L1 jobs to be executed, via L1 functions.
In monolithic, the sched_response mechanism ensures that FAPI messages
for one slot are not overwritten by scheduler instructions for the
following slots (i.e., it is like a memory allocation pool).
The allocation happens in nr_schedule_response(), not used by the PNF.
Hence, only deallocate when in monolithic.
The PNF uses a big ring buffer over all slots in a frame to ensure the
same.
This function applied an sf_ahead, bigger than the actual slot
indication message sending (so a message could NEVER arrive on time!).
Reduce to zero, because this is when it should arrive for us.
FAPI says these lists should be for MAX_TDD_PERIODICITY (which is maybe
a frame, or a TDD period? but likely not two frames). Reduce to one
frame.
Also, the nFAPI code assumes one entire frame, so use that (this commit
necessary to actually make the PNF work, otherwise, the
packing/unpacking of the FAPI message would need to do 2 frames).
Closes: #876
Upon reception of FAPI UL messages (e.g., RACH.indication), those
messages are put into queues, to be delivered in a single call,
NR_UL_indication(). Call the scheduler to trigger processing in UL.
Note that ideally, these queues should not exist at all, and messages
should just be delivered asynchronously, as this would lead to less
copying of messages. Currently, we fulfill the scheduler interface
instead.
Important! Trigger UL after having run DL scheduler and sent the
messages, to ensure short delay between Slot.indication, and the
response to those messages.
The previous designs seems to do:
loop {
poll_ind_queue()
if (msg)
scheduler;
pselect() on messages;
handle_message {
if slot_ind
put_ind_queue()
}
}
So basically, we artificially put a queue for slot indications in the
middle, but still handle it in the same thread(!). This for some reason
results in a big slow down if the PNF runs faster.
Now, we just do pselect(), waiting for messages. We handle the slot
indication immediately (the schedule should take some microseconds),
then return to pselect().
Use this function to implement distinct behavior for monolithic or PNF:
- monolithic: run the scheduler, as normal
- PNF: send a slot indication; the VNF will send an answer which the PNF
will handle elsewhere.
Add function declarations to make nr_ulsim compile, as NR_IF_Module.c is
part of the MAC sources. As of now, this is necessary; I think the right
way would be to take NR_IF_Module.c out of the MAC, and make this a
"glue" library that sticks L1 and L2 together, in monolithic (in VNF, in
that case, we should not link in L1, and for the PNF not the L2,
creating separate executables... Rome was not built in one day).
We are required to store multiple PUCCH (e.g., for multiple UEs).
However, nr_fill_pucch() automatically freed the previously active PUCCH
structure. Of course(!) this does not make sense.
However, the problem is that init_nr_transport() allocated only one
PUCCH structure. Also this does not make sense to me. The problem was
that slot_ahead was 0, which logically cannot happen in this function
(because slot_ahead is illogical, we must give the radio some time). The
reason is that it uses if_inst->sl_ahead, which, prior to this commit,
was not set.
The init_nr_transport() function is called normally from main() through
init_eNB_afterRU(). In this case, we initialize if_inst->sl_ahead to
what is set in main(). In the PNF case, however, we call
init_nr_transport() from the PNF thread, when receiving the start
request. In the main(), we wait for this to happen, before setting
if_inst->sl_ahead. Hence, initializing this variable (which we should
safely be able to do) before solves the problem.
The radio gives the clock. Therefore, we do not need to keep the time
separately in the PNF.
Also, the VNF should not run the ru_thread, as this is an L1 thread.
This is to align with monolithic/FAPI, where we get slot indications in
each slot. In the nFAPI, this is replaced by timing information, such
that the VNF ticks automatically, and gets indications from the PNF on
early/late messages. The timing information handling is not implemented
in the present nFAPI implementation. Instead, we adopt the FAPI behavior
and send timing information in every slot, abusing it to be a slot
indication.
There is no need to add the PNF in nr_start_resp_cb(), because it has
already been done in nr_param_resp_cb(). This might be wrong, because 4G
does it only in nr_start_resp_cb(), but for the moment, since it is also
used in nr_param_resp_cb(), avoid the double add.
The same function is called in nr_start_resp_cb(), why there and not here?
At reception of nr_param_response, we receive the remote PNF information
on PNF/VNF. We have to store it.
In nr_start_response, it might not be correct and/or can be taken out.
The next commit will remove it.
Remove most of m64 type usage
MMX instructions were first SIMD version, the registers management is complex
(_mm_empty()) so, it is better to remove it now and use more recent instructions
anyway, gcc/clang should replace it automatically as long as we enable sse2,
that should always be the case but for code understanding and for ARM porting
for example, it is better to explicitly remove it
Add a small FAPI Hex parser utility
Adds a small FAPI hex parser utility nfapi_hex_parser, that takes in a FAPI
message hexdump, either from the command line or a file, unpacks it and prints
the contents out to the console.
The functions to print the data to the console were added alongside the existing
utility functions, for both P5 and P7 messages.
This allows the user to quickly check if a message has the valid format to be
unpacked in OAI.
The file examples.md contains some examples of execution and output.
This utility is compiled alongside the NFAPI_LIB, as such, it is compiled
whenever we compile nr-softmodem, or any other target that uses the NFAPI_LIB.
Prior to this this commit, the structure NR_UE_info_t is 4881632 bytes.
On some machines, e.g., one of the CI systems, this can lead to realtime
problems when doing the initial calloc() of the data structure.
Commit e586efb29d ("Enable 32 HARQ
Processes in DL, UL") introduced the real-time problems by increasing
the number of HARQ processes.
The reason NR_UE_info_t is that big is that it contains buffers for DL
HARQ data that might need to be retransmitted (the L1 is stateless, it
cannot store this for the L2). To reduce the size, dynamically allocate
the DL HARQ buffers when they are needed. This also reduces the size of
NR_UE_info_t to 15840 bytes.
Encapsulate transportBlock in byte_array and accessory functions, and
allocate in big chunks of multiple of ~32kB.
Reported-By: Cedric Roux <cedric.roux@eurecom.fr>
Fixes: e586efb29dCloses: #875
ran_func_kpm.c uses cp_ba_to_str(), but it is not defined in OAI. Define
it so we can link properly, instead of relying on FlexRIC (where it was
defined).
Introduce function cu_update_f1_ue_data() which does remove+add under
one lock. This fixes a concurrency bug. For instance, during
reestablishment, the CU needs to update the DU UE ID under which the UE
is identified in the DU. Previously, the CU would remove, then add the
DU UE ID info. At the same time, the PDCP thread might look up the
information. This can lead to asserts. Use the above addmod
functionality to do the remove-add under a mutex.
Modify test to verify this works as expected.
use ML receiver for 64 QAM UL-MIMO
Change condition on MMSE/ML selection to include 64QAM for ML UL-MIMO receiver.
Only 256QAM will now use MMSE UL-MIMO receiver.
fix(nrLDPC_coding_t2): Miscellaneous fixes related to T2
1. HARQ combined offset:
The offset provided for each code block in the HARQ combined input and output
buffer shall not be above 512. A modulus was performed on the offset of the TB
in the buffer to avoid this situation. But the offset of the code block was
added afterward so that the total offset was sometimes going above 512.This
commit performs the modulus after adding the code block offset. Usually this
issue was triggering a segfault after less than 2 minutes of an iperf test on
some setup using T2. The same iperf test was successfully performed during 10
minutes on the same setup with this change.
2. Properly stop LDPC coding in gNB and UE:
LDPC coding was yet not properly stopped by using free_nrLDPC_coding_interface
in gNB and UE. This was not causing major issue until now. It was especially not
causing any issue with T2 LDPC coding using the PF. But using T2 VFs, if the
coding library is not properly stopped then the VF cannot be used anymore unless
the admin app is restarted. So this MR adds the missing free_nrLDPC_coding_interface.
fix nr phy-test mode in ntn
Following SIB19 MR !3019 (merged), the phy-test mode is no longer working
In this MR we update the handling NTN-Config from ServingCellConfigCommon
to be the same as when NTN-Config is received in SIB19
More details: !3019 (comment 145103)
usrp constant and slow derive timestamp
Sample write reorder function doesn't handle properly the clock shift.
It keeps the same time origin forever, so, if the clock sifts in one direction,
we finish to reach the maximum time shift that was designed for slot to slot
maximum shift.
We may also consider if this function is useful: gNB and UE currently ensure Tx
in order because there are other issues above if we let Tx preparation run out
of order in separate threads
Closes#893
- Refactor SCTP Association Response Handling
- Unified function for both CU-CP and CU-UP handling
- CU-CP: Notifies RRC of E1 connection loss with CU-UP
- CU-UP: Initiates a new SCTP association request to regain E1 connection
- this fix will prevent issue #878 from happening
- Send list of PDU Session Resources to Failed Setup in the (PDU Session
Resource/Initial Context) Setup Response
- depending on different failure scenarios
- e.g. (#878) when No CU-UP is associated and still the CU-CP receives a PDU
Session Setup Request
- add relevant functions to handle NGAP Setup Response messages with failed
list of items
- this is an extra failure handling to make #878 is handled if it ever happens
again
- NGAP Cause Refactoring
- Refactor struct for NGAP cause group and value
- Add extended radio network cause enumeration values
- Refactor redundant code into a new NGAP cause encoding function
- Minor logging, function descriptions improvements
Closes#878
Useful to debug realtime issues, for example when calling a periodical
routine, if it's not programmed carefully enough, it may be that the first
call takes way longer than the next ones (for example it uses some memory
that is not mapped in the process, leading to many page faults the first
time it's executed).
Having a periodic log for the timing of this routine with min/avg/max/count
will reveal that a call is way longer than average and will help in
finding where exactly in the code the time is spent, thanks to the ease
of use of the T tracer; you put T(T_XX, T_INT(1)) just before the code
you want to measure, you put T(T_XX, T_INT(0)) just after and time_meas
will show the delta time between those events. Then you cut the routine
in smaller pieces, measure with T(1)/T(0), and you finally reach the small
guilty part that takes too long.
In time_meas.c, when getting 0 for the event, we log delta time with
previous 1 for the event. "start_valid" was not cleared, so receiving
a second 0 without 1 in between may lead to wrong logging.
Should not happen in practice, but still, little bug.
(Note: we don't protect against streams of 1, but this case should also
not happen.)
Add utility functions to print the FAPI messages contents
Add dump functions for DL_TTI.request PDUs, remaining message structures to be finished
Add file examples.md with some examples on how to use nfapi_hex_parser
Now uses RC.nb_nr_L1_inst instead of RC.nb_nr_inst in order to configure the L1, since in PNF RC.nb_nr_inst is always 0, and so, it wouldn't configure the L1
chore(ci): Move to new Jenkins and Openshift Cluster
- Update helm-charts with new node roles
- Add resource definition in physim helm-charts to easily schedule them
on different cluster servers
- Update entitlement creation methodology
- Add namespace for aerial pipeline
Due to HW version differences between the CI RHEL build machine and
the FHI 7.2 test machine (cacofonix), FHI 7.2 test using RHEL image
failed, reporting an 'Illegal Instruction' error.
* this commit is making explicit the mandatory IE cn_support
in the E1 Setup Request message
* also, init cn_support in E1 Setup Request initial message preparation
* E1 CU-CP Setup Request is an E1 Interface Management message
whose type defition was missing, and it is introduced in this commit
(see 9.2.1.7 of 3GPP TS 38.463)
LDPC coding was yet not properly stopped by using free_nrLDPC_coding_interface in gNB and UE.
This was not causing major issue until now. It was especially not causing any issue with T2 LDPC coding using the PF.
But using T2 VFs, if the coding library is not properly stopped then the VF cannot be used anymore unless the admin app is restarted.
So this MR adds the missing free_nrLDPC_coding_interface.
The offset provided for each code block in the HARQ combined input and output buffer shall not be above 512.
A modulus was performed on the offset of the TB in the buffer to avoid this situation.
But the offset of the code block was added afterward so that the total offset was sometimes going above 512.
This commit performs the modulus after adding the code block offset.
- extend get_xran_prb_map() function to handle mixed slot
- properly fill PRB configuration based on DL/UL direction and duplex mode
- do not implicitly assume TDD
Modify xu_add_f1_ue_data() to be xu_addmod_f1_ue_data(), i.e., "addmod"
behavior in which it is possible to also update f1_ue_data. I do it this
way since an xu_updade_f1_ue_data() function would be almost the same as
the add function (only deleting existing data, whereas the original
add() was asserting in that case).
Modify tests to test for this behavior.
This fixes a concurrency bug. For instance, during reestablishment, the
CU needs to update the DU UE ID under which the UE is identified in the
DU. Previously, the CU would remove, then add the DU UE ID info.
At the same time, the PDCP thread might look up the information. This
can lead to asserts. Use the above addmod functionality to do the
remove-add under a mutex.
- the parameters used in DL/UL are exactly the same, except the direction and the number of PRBs;
therefore, passing the direction seems convenient for visibility purposes and reduces the code.
Note: Number of PRBs we store in fh_config for both DL/UL is num_rb_dl of openair0_config struct.
At the end, it is actually the same info.
Following SIB19 MR !3019, the phy-test mode is no longer working
In this MR we update the handling NTN-Config from ServingCellConfigCommon
to be the same as when NTN-Config is received in SIB19
Integration: `2025.w03`
See merge request oai/openairinterface5g!3206
* !3167 remove calls to clear SIMD registers, that was a historical issue
* !3179 UE statistics improvements
* !3193 Remove spinlock from threadpool task return
* !3195 UE MAC: in phy-test/do-ra, fill TB randomly
* !3201 T tracer: minor fixes for compilation
* !3204 CI: Increase number of test trials for timing tests
* !3034 Delay compensation for PUCCH2
* !3205 Fix calculation of RSSI in pucch_rx.c
Fix calculation of RSSI in pucch_rx.c
Fix two issues with RSSI calculation in PUCCH:
- RSSI was calculated using partial sum instead of average of squared samples.
- There was a missing parentheses pair which causes the RSSI value to underflow.
The proper way to calculate power in dBFS is
let signal_energy = average of squared samples of received signal over resource elements, antennas and symbols under measurement
then:
rssi[dBFS] = -10log10(max_sample^2 / signal_energy),
or (to avoid division):
rssi[dBFS] = -(10log10(max_sample^2) - 10log10(signal_energy))
CI: Increase number of test trials for timing tests
- Increasing a number of test trials aims to reduce variations and
improve reliability of the nr_ulsim and nr_dlsim test results.
- Disable CPU sleep states on the machine when running physims.
- Minor adjustment of timing threshold in 60 MHz phytest.
Delay compensation for PUCCH2
- Implementation of delay compensation for PUCCH2, which minimizes for
exampe logs "reported RSRP index XXX invalid"
- Adding a test to the CI to perform the delay compensation in PUCCH2
- Refactor code to use c16_t data type in PUCCH decoder
Remove spinlock from threadpool task return
The idea to use atomic aligned to cache line for counting finished jobs
is reused, but instead of polling a semaphore was added.
remove calls to clear SIMD registers, that was a historical issue
This works because gcc/clang replaces the MMX calls by SSE2 automatically.
There are some mm_empty() calls in bad places (places where we don't use
_m64) and it is lacking in places where we still use _m64. Given that
MMX calls are converted to SSE2, there is no problem, and we will remove
remaining _m64 variables.
Fix two issues with RSSI calculation in PUCCH:
- RSSI was calculated using partial sum instead of average of squared samples.
- There was a missing parentheses pair which causes the RSSI value to underflow.
The proper way to calculate power in dBFS is
let signal_energy = average of squared samples of received signal over resource
elements, antennas and symbols under measurement
then:
rssi[dBFS] = -10log10(max_sample^2 / signal_energy),
or (to avoid division):
rssi[dBFS] = -(10log10(max_sample^2) - 10log10(signal_energy))
* this function is used by both CU-CP and CU-UP
* it behaves differently depending on the type of E1 instance:
CU-CP: inform RRC of E1 connection loss with CU-UP
CU-UP: trigger a new SCTP association request by sending an ITTI to the CU-UP task
* after receiving the E1AP register request, the CU-UP will send a new association request to
SCTP until new E1 connection is achieved by sending a TIMER_HAS_EXPIRED message to the CU-UP
task. The function e1apHandleTimer() is basically triggering a new E1 association request
until new E1 connection is achieved
* print SCTP association state in e1ap.c whenever needed
Related to #878
* add function to check whether cu-up is connected
* add functions to send the relevant response messages with the failed list
e.g. to fill PDU Session Resource Failed to Setup items
* set return value of trigger_bearer_setup to bool and handle the
failure by sending setup response messages with list of PDU sessions failed to setup
i.e. send failed list of items when no CU-UP is associated to the CU-CP
note: it considers all PDU Sessions as failed to setup in the considered failure scenarios
* e.g. send a list of failed PDU session resources in the response message to reject
PDU Session Resource Setup in rrc_gNB_process_NGAP_PDUSESSION_SETUP_REQ
* the Initial Context Setup has a Failure message, but for the considered failure scenario
when no CU-UP is available the current design is just sending a list of failed to setup
items in the Response message
* transfer PDU Session Resource/Initial Context Setup Request NAS PDU to UE
closes#878
* new struct definition including both NGAP cause group and value
* add encoding function, temporarily in ngap_common.c
(in the long term to be place in a enc/dec NGAP library)
* extend Radio Network cause enum values
* add cause member to Setup Failure
Integration: `2025.w02`
Closes#866 and #887
See merge request oai/openairinterface5g!3197
* !3135 replace a set of #define by a C bit array, remove duplicated extern global variable declaration
* !3173 nrLDPC_coding: improvements
* !3181 Use UL actor for processSlotTx
* !3186 chore(ci): improved errors messages visibility
* !3101 NR gNB improvements for analog beam management
* !3130 NR gNB MSG3 TPC
* !3175 Improvements for PUSCH per symbol processing
* !3177 CI: change frequency for timing and B200-SABOX pipelines
* !3188 NR UE fix DCI mask size
* !3119 Config files improvements for PRACH
* !3196 Fix yaml example config file
* !3187 nrLDPC_coding: Fix naming, comments, superfluous variables and documentation typos in coding library interfaces
* !3076 move UL_INFO structure allocation local to a rx slot processing
* !3189 fhi_72: allow to provide dpdk_iova_mode to xran
* !3182 RSSI threshold for PUSCH & PUCCH power control
* !3103 Introduce ITTI queue in RRC-to-MAC direction
RSSI threshold for PUSCH & PUCCH power control
To prevent ADC railing or "clipping" when the received power is too
large, introduce RSSI threshold parameters for PUSCH and PUCCH, which
are now configured in units of 0.1 dB. Here is how you can configure and
use these thresholds:
1. Configuration:
- Set the pusch_RSSI_Threshold and pucch_RSSI_Threshold parameters in
your configuration file (e.g., gnb.conf) (MACRLC section).
- These parameters define the maximum acceptable RSSI values for
PUSCH and PUCCH, respectively. The unit is either dBm or dBFS,
depending on the RSSI reporting configuration.
2. Usage:
- The nr_limit_tpc function will automatically adjust the Transmit
Power Control (TPC) commands based on the configured RSSI
thresholds.
- If the RSSI exceeds the threshold, the TPC command will be limited
to prevent further increase in power, thereby avoiding ADC
clipping.
Introduce ITTI queue in RRC-to-MAC direction
resolve ue rcc to mac race conditions by a itti queue, but it doesn't
resolve the problem of exact slot we should apply the new cell
configurtion
fhi_72: allow to provide dpdk_iova_mode to xran
- Introduce a gNB configuration option that enables users to select the
desired IOVA mode for DPDK ("PA" or "VA") with dpdk_iova_mode
parameters in fhi_72 configuration section. If not set, the default
remains PA mode to ensure backward compatibility with existing
configurations. Detailed information about IOVA modes, including their
advantages and disadvantages, can be found in the DPDK documentation:
Memory in DPDK Part 2: Deep Dive into IOVA
- Using IOVA VA mode allows DPDK to run without requiring SYS_ADMIN
capability for the docker container.
- Switch to IOVA VA mode in the FHI7.2 pipeline and reduce the required
capabilities for the docker container.
Move UL_INFO structure allocation local to a rx slot processing
UL_INFO is allocated a gNB, so require mutex and obscur information
passing function to function. Instead, make a local UL_INFO per slot,
removing the mutex and making the code easier to understand.
Use UL_INFO on the stack, to simplify the code. move in the same struct
the associated rach, pdu, crc, srs arrays that where pointed from
directly in gNB structure Keep in nfapi the existing logic that make
malloc for theses rach, pdu, crc, srs array lists
Pass only relevant fields, where appropriate.
Co-authored-by: Robert Schmidt <robert.schmidt@openairinterface.org>
nrLDPC_coding: Fix naming, comments, superfluous variables and documentation typos in coding library interfaces
This MR is clarifying the interfaces to the LDPC coding libraries. It
aims to improve the readability of the interfaces and compliance of
naming with specification 38.212.
Fix yaml example config file
amf_ip_address is decoded as a paramlist_def_t and not as a paramdef_t,
so in the config file it should be a list of ip addresses
In current develop just by trying to run this config file with:
sudo ./nr-softmodem -O ../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.yaml
results in a segfault.
Config files improvements for PRACH
Some PRACH parameters in configuration files are not properly set.
- number of SSB per RACH occasion should be 1 when we have only 1 SSB
(it would still work with 1/2 but it makes little sense and might
limit UE selection of ROs).
- some PRACH configuration indices would generate PRACH conflicting with
PUCCH and therefore reducing scheduling capabilities
Further cleanup of some config files still using deprecated fields
Switching to IOVA VA mode in the FHI7.2 pipeline reduces the required
capabilities for the Docker container. This change allows the removal
of the SYS_ADMIN capability.
In DPDK, IO Virtual Addresses (IOVA) refers to the memory addressing
scheme used for IO operations. The two IOVA modes supported by DPDK are:
- IOVA as Physical Address (PA): IO memory addresses correspond directly
to physical addresses, no address translation required.
- IOVA as Virtual Address (VA): IO memory addresses align with user-space
virtual addresses, requiring IOMMU to remap physical memory.
Previously, this was hardcoded to 0, to use IOVA as PA mode, with xRAN's
DPDK EAL initialization using the "--iova-mode=pa" flag.
This commit introduces a gNB configuration option to allow users to select
the desired IOVA mode. The default remains PA mode to
ensure backward compatibility.
Using IOVA VA mode allows DPDK to run without requiring SYS_ADMIN
capability in the docker container.
NR UE fix DCI mask size
Previous maximum size was 15 but in practice it could be at least up to
18. Also moved assertion on non-contiguous type0 DLSCH allocation to L1
(to remove blocking point for L2 implementation).
CI: change frequency for timing and B200-SABOX pipelines
Change center frequency of
- RAN-SA-B200-Module-SABOX-Container - 20 MHz TDD SA scenario from
3309.48 MHz to 3609.12 MHz
- RAN-gNB-N300-Timing-Phytest-LDPC - Timing phytest 40 MHz scenario from
3619.08 MHz to 3319.68 Mhz
to avoid interference between the SABOX and timing pipeline.
Improvements for PUSCH per symbol processing
- Improved the assert in task_ans.c
- Fixed and issue with PUSCH per-symbol processing that could cause an
issue in case num_pusch_symbols_per_thread is not 1.
NR gNB MSG3 TPC
This MR improves the handling of MSG3 TPC commands at MAC gNB.
TODO: Compute TPC when PRACH sends a valid power measurements (currently
not the case for OAI L1, to be verified with Aerial L1)
Closes#866
NR gNB improvements for analog beam management
- Improvements at gNB MAC layer to properly handle analog beam
management for all channels
- Simple beam switching mechanism based on UE RSRP report
- Introduced new configuration parameters `pusch_RSSI_Threshold` and `pucch_RSSI_Threshold`
(MACRLC section)
- Added `nr_limit_tpc` function in `gNB_scheduler_primitives.c` to limit TPC based on RSSI
threshold.
- Integrated `nr_limit_tpc` in PUCCH and PUSCH power control
Example Configuration
puxch_RSSI_Threshold takes value between -1280 and 0 and is mapped to range -128.0 dBm/dBFS
to 0.0 dBm/dBFS in 0.1 dB increments. Unit depends on RSSI reporting config.
pucch_RSSI_Threshold = -500; # Set the PUSCH RSSI threshold to -50.0dBm/-50dBFS
pucch_RSSI_Threshold = -600; # Set the PUCCH RSSI threshold to -60.0dBm/-60dBFS
chore(ci): improved errors messages visibility
1. There was a trailing && before $BUILD_OPTIONS in the command line
2. Added leading lines and more pattern to the grep command that
displays errors/warnings messages during docker build since we don't
have access to all.txt if build fails
nrLDPC_coding: improvements
One improvement in this changeset: Functions nr_interleaving_ldpc,
nr_deinterleaving_ldpc, nr_rate_matching_ldpc and
nr_rate_matching_ldpc_rx that were previously linked with the PHY layer
in the executables are now linked with the LDPC coding implementations
where they are called.
The parent commit cleans up and groups oai_exit in one place,
nr-softmodem-common.h. Therefore, this 5G file is included in the 4G
defs_common.h (at least it's mostly 4G), which is not nice. Instead,
define oai_exit also in 4G softmodem-common.h, and include this in
defs_common.h. Remove the cyclic inclusion of defs_common.h in
softmodem-common.h, and resolve all subsequent errors around unknown
types and extern definition mismatches.
Commit d641a76196 ("fix BSR report malformed, add SHORT BSR when it
can") removed code to fill the remainder of a TB, if it is not filled
with data from RLC, with random data when using phy-test or do-ra modes.
This random data filling is intentional, as it might prove useful for
demos or when debugging (e.g., to see used spectrum instead of 0, etc.).
Reintroduce the functionality, but unlike the original code, make it
dependent on the mode, not RFsim.
See also discussion in #888.
Fixup: d641a76196
* size of fgs_nas_message_security_header_t is platform-depending
while protocol_discriminator must be 1 byte
* fgs_protocol_discriminator_t stays as enum type
Reduce race conditions through a itti queue, such that RRC-initiated MAC
memory modifications happen at the same time as MAC thread writes.
However, it doesn't resolve the problem of exact slot we should apply
the new cell configurtion.
This assert checks if the structure is correctly initialized. The structure
is one-time use so the assert is valid, but the value of the atomic was added
to the output to improve debugging.
Integration: `2024.w51`
Closes#879
See merge request oai/openairinterface5g!3180
* !3155 UL BLER vs SNR plot
* !3170 Replace AssertFatal with static_assert for cmdline arguments check
* !3172 A script to run CI tests locally.
* !3151 Optimize PHY_ofdm_mod CYCLIC_PREFIX in case of incidentally aligned pointers
* !3164 Fix and refactor channel average
* !3154 Fix TPMI for UL retransmissions
Fix TPMI for UL retransmissions
If the ul_ri of srs_feedback changes between a UL transmission and a
retransmission, we use the TPMI of transmission.
Closes#879
Assertion ((*nrOfLayers==1 && srs_feedback->tpmi <= 1) || (*nrOfLayers==2 && srs_feedback->tpmi == 0)) failed!
In compute_precoding_information() /home/user/openairinterface5g/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c:2896
TPMI 1 is invalid!
Fix and refactor channel average
- Fixing missing init average variable with zero and refactor the code #86b11ab7
Fixes just the missing avg1=0
- Refactor the code to a common SSE/AVX2 inline function using also horizontal add.
- We use int64_t result from now on.
- We decided to fix length to x12 instead of old x9 openair1/PHY/NR_UE_TRANSPORT/dci_nr.c
//compute average channel_level on each (TX,RX) antenna pair
void nr_pdcch_channel_level(int32_t rx_size,
c16_t dl_ch_estimates_ext[][rx_size],
NR_DL_FRAME_PARMS *frame_parms,
int32_t *avg,
int symbol,
int nb_rb)
{
for (int aarx = 0; aarx < frame_parms->nb_antennas_rx; aarx++) {
//clear average level
simde__m128i avg128P = simde_mm_setzero_si128();
simde__m128i *dl_ch128 = (simde__m128i *)&dl_ch_estimates_ext[aarx][symbol * nb_rb * 12];
for (int rb = 0; rb < (nb_rb * 12) >> 2; rb++) { <-------------- here
avg128P = simde_mm_add_epi32(avg128P, simde_mm_madd_epi16(dl_ch128[rb], dl_ch128[rb]));
}
DevAssert(nb_rb);
avg[aarx] = 0;
for (int i = 0; i < 4; i++)
avg[aarx] += ((int32_t *)&avg128P)[i] / (nb_rb * 12); <-------------- and here
LOG_DDD("Channel level : %d\n",avg[aarx]);
}
}
Optimize PHY_ofdm_mod CYCLIC_PREFIX in case of incidentally aligned pointers
It seems that the cyclic prefix is in most cases a multiple of 512 samples.
This means that in most cases the idft output pointer is already aligned and
there is no need to perform an extra memcpy. This saves the memcpy time in
most cyclic prefix insertion cases.
A script to run CI tests locally.
Added ./run_locally.sh script. The script takes one argument being the testcase
that one wants to run. The testcase is run locally. This means that some
testcases that utilize hardware resources will not run. However most if not all
rfsimulator testcases should run as in CI.
To this end, the CI python scripting framework was updated:
- override and <srv_node> elements from XML so all commands are executed locally
in case --local flag is passed
- Allow RemoteCmd class to run on localhost
Replace AssertFatal with static_assert for cmdline arguments check
Replace AssertFatal with static_assert for command line arguments definition
length check. The static assert will not allow the code to compile in case
the size is incorrect.
This could save some time in the future since its easy to forget to extend
CMDLINE_PARAMS_CHECK_DESC.
Added ./run_locally.sh script. The script takes one argument being the testcase
that one wants to run. The testcase is run locally. This means that some testcases that
utilize hardware resources will not run. However most if not all rfsimulator testcases
should run as in CI.
To this end, the CI python scripting framework was updated, adding --local flag which changes
the script behavior as follows:
- overrides <node> and <srv_node> XML elements to 'localhost' so all commands are executed locally
- Avoid running image pull, image cleanup and workspace creation steps of the scripts:
user is responsible for that
Replace AssertFatal with static_assert for command line arguments definition
length check. The static assert will not allow the code to compile in case
the size is incorrect.
This could save some time in the future since its easy to forget to extend
CMDLINE_PARAMS_CHECK_DESC.
Alignment of temporary IDFT buffer was changed to 64 bytes. This is in preparation
for possible use of different IDFT implementation which could use AVX-512, requiring
64-byte alignment.
Integration: `2024.w50`
Closes#753
See merge request oai/openairinterface5g!3166
* !3159 CI: Add FHI7.2 test with Metanoia RU
* !3111 Enable USRP Tx thread in nrUE
* !3144 UE data race fix
* !3149 Fix several issues in ulsch_mmse_2layers
* !3158 GTP: use direct call instead of ITTI
* !3160 FHI-72: initialize mask, find correct libxran
* !3019 SIB19 utilization on UE
* !3162 Add Rocky 9.5 to list of distributions
* !3163 NGAP-Initial Context Setup Failure
* !2952 New LDPC coding library interface for decoding and encoding complete slots in one call to the library
* !3125 Add support for O1 in O-DU via telnet
* !3161 Cmd line option for sync in frames for iqrecorder
Cmd line option for sync in frames for iqrecorder
B200 with high clock drift will go out of sync within 280ms which was
the default duration to sync in with iqrecorder. Now this value can be
specified via cmd line so the user can change it according to needs.
Add support for O1 in O-DU via telnet
This change set adds a simple telnet interface to nr-softmodem. Together
with oai/o1-adapter>, this implements a part of the O1 interface, for
the DU only. Currently supported uses cases:
- some stats are send to an SMO (such as bandwidth, PLMN, frequency, ...)
- re-configuration of bandwidth, frequency
- stop/start of the softmodem, while keeping the CU and L2 running
- the o1-adapter implements two alarms, load overload and base station
offline, using this interface.
It is possible to use the telnet interface by itself (i.e., "o1" without
the o1-adapter). To do this, compile with telnet support (./build_oai
--build-lib telnetsrv) and start the nr-softmodem with O1 module
(./nr-softmodem --telnetsrv --telnetsrv.shrmod o1). You can then do the
following:
- see some statistics as exposed to o1-adapter, in JSON: echo o1 stats | nc 127.0.0.1 9090 && echo
- stop the L1: echo o1 stop_modem | nc 127.0.0.1 9090 && echo
- reconfigure bandwidth: e.g., echo o1 bwconfig 20 | nc 127.0.0.1 9090 && echo (also supported: 40, 60, 100)
- start the L1: echo o1 start_modem | nc 127.0.0.1 9090 && echo
Note that the reconfiguration works with split-8 radios. Notably, it
does not work yet out-of-the-box with 7.2 radios, because they have to
be manually reconfigured on bandwith/frequency switch. The planned
M-plane should allow such use case, though.
To help with the above, this branch also includes fixes (for more
information, refer to the corresponding commits):
- fixes for stopping the L1, notably stop threads in right order, stop
thread pool of RU
- collect some general MAC metrics, fix some bugs in MAC
- fix problems in F1AP gNB-DU configuration update message, update test
- fix some problems in RRC
The consumer of this function just passes a pointer to something to be
sent. This function should not free this memory, it's simply not it's
task. This is the same bug as above in
"CU_handle_gNB_DU_CONFIGURATION_UPDATE(): don't free the message of RRC"
This adds a basic telnet module to support the O1 interface at the DU,
to be used together with the oai/o1-adapter>. Concretely, this first
version supports to
- read/modify cell parameters
- stop/start the L1
Implements the re-start of the L1 after it has been stopped through
stop_L1(). It takes into account some changes, such as bandwidth, or
frequency, when restarting the L1. To this end, it also triggers a
gNB-DU configuration update message on each restart to inform the CU
about any changes in the DU. FDD has not been tested.
Refactor L1 stopping code into a function. The function is basically the
same as what we were doing at the end of main() of nr-softmodem.c.
This will be reused to support the "soft-restart" functionality in the
next commits.
Need to proper forward declaration, as we otherwise need to make
telnet_o1 module dependent on F1. Make functions publicly accessible,
as the F1 functions are used in an upcoming commit to start the L1.
Need to keep track of number of RUs, as the RU initialization increments
the number of RUs. Therefore, subsequent initializations would fail if
we don't decrement first. There is no better place (or I did not find
it) to decrement the number of RUs than in nr_phy_free_RU(). For this
reason, we also have to manually set the number of RUs in nr_prachsim to
1, otherwise the assert will trigger.
Split out these functions, to be reused in a follow-up commit to
correctly have gNB-DU configuration update message working.
Change the return type copy_f1ap_served_cell_info(), to return the copy,
which IMO is more intuitive then passing target and source in
parentheses.
For the "restart" feature, earlier versions where creating multiple UL
TDA. This is not a problem (anymore), but to avoid that we call this
multiple times, add this assert.
The existing code prevents double initialization if e.g., both gNB&UE
call these functions (like in a simulator). However, in the case of a
double-initialization such as stopping and re-starting the L1, the
memory will be freed, but not freed again. Basically, this works:
generate()
generate() # not initialized again
but this leads to problems:
generate()
free()
generate() # not initialized again, but should be!
Reimplement the check based on the data to be initialized, such that an
intermediate free() will be handled properly.
These are the "main" worker threads (apart the ru_thread). If the
thread-pool stops, they might get stuck. E.g., in PUSCH channel
estimation, it uses a local response queue, and if the thread pool is
terminated, it seems that the L1_rx_thread can get stuck in there.
To limit these problems, attempt to stop these threads first; stop the
queue from which they read and make them terminate; then, stop the
thread pool.
Also, fix the termination of respPuschSymb queue.
A later commit implements the "restart" of the L1. The L1 reads
configuration options. First, allow to re-read configurations by
increasing the amount of memory the config module might allocate. Then,
avoid an out-of-bound write by checking that we still have memory
available (and assert if not possible).
New LDPC coding library interface for decoding and encoding complete slots in one call to the library
Previous attempts to integrate LDPC decoding relying on offloading show
the limitation of the original code segment coding interface for the
library implementing LDPC coding. In order to perform the offload and
therefore the decoding in an optimal fashion, it is relevant to provide
the implementation with the broader amount of data possible per call,
which is a slot. A previous MR related to T2 offload managed to offer
an interface for decoding transport blocks by modifying only
nr_ulsch_decoding.c. But this may not be sufficient for performing an
efficient decoding in any situation. Slots could be shared between
multiple transport blocks in case multiple UEs are connected to the RAN,
which makes the transport block size shrink and therefore degrades the
efficiency of the offloading.
This MR offers a broader interface with a gNB decoding entry point in
phy_procedures_nr_gNB.c. The file nr_ulsch_decoding.c now lets the
decoding library implement deinterleaving, rate-unmatching and decoding
for the slot. In gNB encoding and UE decoding and encoding as well,
tasks are partitioned in a similar fashion.
As it allows to feed the implementation with the broadest amount of data
possible, it allows to fit any coding solution in a library. This will
avoid further modification to OAI source code and addition of options to
select an implementation when integrating new decoding solutions. An
implementation of this interface will therefore be offered for every
existing decoding solution in OAI and solutions added in the future will
be provided as independent module code without any modification to the
core of OAI code. The way to choose the decoding solution and to
configure it was also unified using configmodule. The library can be
chosen through the option --loader.ldpc.shlibversion. The slot coding
solutions shipped with this MR can be configured through configmodule
(e.g., T2 address and isolated cores).
This MR includes three coding implementations:
- A wrapper around segment decoding libraries for test purpose: libldpc.so
- A one shot slot coding and encoding with the T2 board: libldpc_t2.so
- A decoder on FPGA using the XDMA driver: libldpc_xdma.so
Improvements brought by this MR:
- Easy integration of a wider variety of LDPC coding solution at gNB and UE
- Easy selection of the LDPC coding solution (option --ldpc-offload-enable is kept for now but it can be ultimately removed)
- T2:
* More efficient when many UEs are connected
* Decoding and encoding in nr-uesoftmodem
NGAP-Initial Context Setup Failure
NGAP Failure message - Initial Context Setup Failure. When an Initial
Context Setup Request is received with the UE context as null, it
triggers Initial Context Setup failure
SIB19 utilization on UE
Following SIB19 initialization and scheduling on gNB (!2899 - merged)
and Receive SIB19 on nrUE (!2920 - merged), this merge request aims to
introduce the actual use of the SIB19 provided parameters by gNB in UE.
Changes needed for utilization include: initialization of position
coordinates parameters for UE (which are needed to calculate propagation
delay between UE and SAT), propagation delay calculations and timing
advance adjusts. Moreover, this change removes the now unused arguments
for ntn_koffset, ntn_ta_common and ntn_ta_commondrift
GTP: use direct call instead of ITTI
Using ITTI calls for user plane implies (1) a memory allocation, (2)
mutexes, and (3) queueing messages for each user plane packet, which is
heavy. Use a direct API call instead to reduce overhead.
It seems that the cyclic prefix is in most cases a multiple of 512 samples.
This means that in most cases the idft output pointer is already aligned and
there is no need to perform an extra memcpy. This saves the memcpy time in
most cyclic prefix insertion cases.
More complex implementations will be achieved using the new reworked interface
- t_nrLDPC_dec_params: remove F, Qm, rv and perCB
- encoder_implemparams_t: remove Qm, Tbslbrm, G, rv and perCB
- Remove all variables (like OPENAIR1), they serve no purpose and make
unnecessarily long lines
- Remove linking to T, it does not seem to be necessary
- Avoid intermediate variables to keep sources, and declare libraries
directly, making for shorter code
NGAP Failure message - Initial Context Setup Failure.
When an Initial Context Setup Request is received with the UE context as null, it triggers Initial Context Setup failure.
Fix several issues in ulsch_mmse_2layers
Fix incorrect array type of determ_fin which was set to int32_t while the
array holds the results of simde_mm_abs_epi32 which produces unsigned
values.
Remove assert on right-shifting negative integers as it is impossible for
determ_fin to hold negative values.
Change type of sum_det to uint32_t to prevent possible overflow. Fix
the type cast (int -> uint32_t) to prevent casting before shift in
nr_ulsch_comp_muli_sum which might have resulted in right shifting
negative integers.
Closes: #753
UE data race fix
When a new sync request is sent to PHY, we clear harq buffer and start
synchronization process. This could lead to unexpected behavior or segv
because DL actors might be using the buffer we just cleared. To avoid
this, the DL actors are shutdown and re initiated before clearing harq
info.
Some users copy libxran.so to a system directory (e.g., /usr/local/lib).
At the same time, we require xran_LOCATION to be set to find the build
directory. Use HINTS to prefer the location passed through
xran_LOCATION.
Also, use NO_DEFAULT_PATH to outright disallow global scope, to prevent
"accidentally" finding libxran.so in global scope (this is for
multi-user systems that are used in development, and where people have
different version of libxran for testing purposes). To still use
packages in e.g., /usr/local/, it would be possible to set xran_LOCATION
to this directory. (there is a problem that the version information will
likely not be read correctly, so this might not be enough)
B200 with high clock drift will go out of sync within 280ms which was
the default duration to sync in with iqrecorder. Now this value can be
specified via cmd line so the user can change it according to needs.
Set the number of barriers to 512 and implement proper slot and frame
based selection. Now the dynamic barriers should not be overwritten in
case the rx-to-tx offset is high. The maximum offset supported is 512.
- Removed ntn_koffset, ntn_ta_common, ntn_ta_commondrift arguments in order to be used directly from SIB19
- Removed global NTN_UE_Koffset variable and it's use
- Introduced getter functions for ntn related parameters
Using ITTI calls for user plane implies (1) a memory allocation, (2)
mutexes, and (3) queueing messages for each user plane packet, which is
heavy. Use a direct API call instead to reduce overhead.
- Added new structure to hold timing advance parameters
- Made SIB19 related calculation to save to this struct
- Modified in ra to get ta struct values
Move handling of sync request from MAC from UE_dl_preprocessing(). This
will process the sync request before receiving the samples of current
slot from radio so we don't 'lose' the slot.
Integration: `2024.w49`
See merge request oai/openairinterface5g!3148
* !3065 NAS Service Request enc/dec implementation
* !3129 Refactor UL MAC PDU decoding
* !3136 Use ninja -k option in CI
* !3137 T tracer: add macpdu traces for the NR UE
* !2392 Documentation: add multi-UE deployment with RFsimulator
* !3145 a lib has been added but missed dependancies
* !3050 doc: Add instructions for 5G NR gNB frequency configuration
* !3141 CI: Allow restart of the container if deployment fails
* !3138 Align YAML config getlist with libconfig implementation
* !3140 remove un-necessary global variables
* !3146 Updates to match more fapi-compliant tx_data.request
* !3025 New threadpool, fixed in NR UE
* CI: Remove USRP mgmt_addr from LTE-2x2 conf files
* !3147 Fronthaul xran library update to F release (2. and final step towards M-plane integration)
* !3142 Add CI test to trigger RLF with high pathloss in channelmod
Upon restoration to ploss, set to 20; when setting to 0, the UE is not
able to sync to the cell anymore.
Co-authored-by: Robert Schmidt <robert.schmidt@openairinterface.org>
Fronthaul xran library update to F release (2. and final step towards M-plane integration)
- xran library support -> both E and F releases
- RU delay profile removed -> not used in neither of the releases
- DU delay profile updated
- one-way delay measurements support is improved/fixed in the F release.
However, not implemented here as it depends on the RU capabilities
The "mgmt_addr" parameter is not required for USRP N310 initialization. The
critical parameter for successful operation is the "addr", which specifies
the IP address of the SFP port used for data transfer.
Including both "mgmt_addr" and "addr" can lead to initialization failures if
one of the specified addresses is unavailable. Since the "mgmt_addr" is
unnecessary for this context, it has been removed to avoid potential conflicts
and simplify the configuration.
Fix incorrect array type of determ_fin which was set to int32_t while the
array holds the results of simde_mm_abs_epi32 which produces unsigned
values.
Remove assert on right-shifting negative integers as it is impossible for
determ_fin to hold negative values.
Change type of sum_det to uint32_t to prevent possible overflow.
Fix the type cast (int -> uint32_t) to prevent casting before shift in
nr_ulsch_comp_muli_sum which might have resulted in right shifting negative
integers.
Updates to match more fapi-compliant tx_data.request
The packing of PDUs as required in aerial for the Tx_data.Request wasn't
complaint with FAPI. That was fixed in Aerial 24-2. This change makes L2
pack the payloads in the way that Aerial now requires.
remove un-necessary global variables
Remove global variables that can be removed by a trivial way:
- simply dead globals
- or reference is a single source, so can be static
setting them static reduces the scope, that is a progress, but of course as
for all static variables, the code is still not re-entrant
Major improvements:
1) bbu_offload - enable packet handling on BBU cores
2) dlCpProcBurst - DL CP processing on one or more symbols
3) SRS CP processing - depends on the RU capabilities that can be
retreived via M-plane (if RU is CAT B)
4) nSecDesc - the number of section descriptors per symbol; it was hardcoded to 0 in E release;
depends on the RU capabilities that can be retreived via M-plane
5) RunSlotPrbMapBySymbolEnable - enable PRB mapping by symbol with multisection;
depends on the RU capabilities that can be retreived via M-plane
6) DSS (Dynamic Spectrum Sharing) support - depends on the RU capabilities that can be retreived via M-plane
Minor fixes in F that exist in E:
1) prach_config->nPrachFilterIdx - explained in commit ID f3045396
2) T1a_min_cp_dl - explained in the commit under title "Clarification on DU delay profile"
3) fh_config->nULRBs - explained in commit under title "Further clarification on xran E release parameters"
Removed const for prb_conf argument in oran_allocate_cplane_buffers()
function, as F release requires the not const struct for
xran_init_PrbMap_by_symbol_from_cfg() and xran_init_PrbMap_from_cfg()
even though the struct is not modified inside of these functions.
- remove xran parameter io_cfg->port logging => this parameter
is filled within xran library in both E and F releases
- PRACH offset explanation; not limited to >= max(Ntx, Nrx);
workaround done in xran to support PRACH eAxC IDs same as PUSCH eAxC IDs
- DL PRB not used in xran; UL PRB used in xran F release, therefore
removed from the patch
- these fixes should have been done in the commit ID f3045396
Align YAML config getlist with libconfig implementation
This aligns the behavior of params_yaml with params_config library:
- when a mapping is read using getlist it returns the number of elements in
the mapping instead of 0
- when a mapping is read using get it returns the number of parameters used
for input
CI: Allow restart of the container if deployment fails
In CI we sometimes encounter fail of the gNB/UE deployment (and fail of the test
scenario) caused by unsuccessful initialization of the USRP N310.
This MR enables to optionally restart the gNB or UE container, if the deployment
fails on the health check during start up. By default, restarts of the container
are not allowed, but we can enable them by setting num_attemps > 1 for a given
deployment in the XML file.
Logs from failed deployment attempts are collected.
This MR aims to avoid known CI failure caused by "USRP N310 Initialization Failure"
mentioned in #871.
Documentation: add multi-UE deployment with RFsimulator
Extended doc/NR_SA_Tutorial_OAI_nrUE.md with section about how to run multiple UEs
- multiple UEs with namespaces (provided new script)
- multiple UEs with Docker UEs
- updated rfsimulator and channel simulation tutorials
- updated README.md
This change makes it so the fapi_nr_p7_message_pack is used to pack TX_DATA.request for Aerial, reducing the amount of repeated code.
Add the capability to pack TLVs with TAG=2 (offset from first address)
Packs the TLV.length differently according to whether or not Aerial is in use ( for Aerial TLV.length is 16-bit, for OAI is 32-bit )
In CI we sometimes encouter fail of the gNB/UE deployment (and fail of
the pipeline) caused by unsuccsessful initialization of the USRP N310.
Restart the container if the health check fails during initialization.
Introduce a configurable parameter (from XML) to set max number of
attempts for the container deployment.
Store logs from failed deployment attempts.
Rework GetContainerHealth() to work with docker compose and services,
instead of using docker and containers. Return health and message about
deployment status (used for console and HTML logging) for a given service.
T tracer: add macpdu traces for the NR UE
MIB, SIB1, random access and regular scheduling are traced.
At the beginning of a connection (rrc setup request and rrc setup), the
RNTI is reported as 0. Might be fixed, somehow, if absolutely needed (not
sure).
Refactor UL MAC PDU decoding
Refactor the UL MAC PDU decoding: A single function is created to decode the
entire MAC subheader
uint8_t decode_ul_mac_sub_pdu_header(uint8_t *pduP, uint8_t *lcid, uint16_t *length).
It returns the length of the MAC subheader and outputs the LCID and Length.
This new function is called from 2 functions: lcid_crnti_lookahead() and
nr_process_mac_pdu().
After calling it in nr_process_mac_pdu(), the validation of the PDU can be
made for all the MAC subPDUs in a single place, allowing for less and more
clean code (as opposed with the previous version where the validation was
made multiple times inside the LCID switch-case).
Additionally, this MR updates the list of LCIDs as in 3GPP TS 38.321 v18.3.0
Table 6.2.1-2: Values of LCID for UL-SCH when the LX field is not present or
is set to 0.
- removed some whitespace noise.
- cleaned up CMakeLists.txt
- reintegrated task_manager.c into thread-pool.c
- cleaned up some unnecessary code
Co-authored-by: Cedric Roux <cedric.roux@eurecom.fr>
Co-authored-by: Mikel Irazabal <mikel.irazabal@openairinterface.com>
Integration: `2024.w48`
See merge request oai/openairinterface5g!3134
* !2951 Integrate Tracy with NR UE
* !2985 E1AP Bearer Context Setup encoding/decoding library and unit tests
* !3115 T2: minor fix for 4x4 processing
* !3117 F1AP lib: minor fixes
* !3126 NR MSG3 scheduling improvements
* !3128 NR UE RRC T304 in phy-test mode
* !3132 Run the last job of gNB pusch channel estimation inline
* !3133 NR UL HARQ handling improvements
* !3091 Update NR UE threading model
* !3030 Imscope updates
* !3131 FAPI P7 Refactoring and unitary test creation
* !3033 Increase the number of UE supported at gNB by having more than 1 PUCCH2 frequency occasion per slot
MIB, SIB1, random access and regular scheduling are traced.
At the beginning of a connection (rrc setup request and rrc setup), the
RNTI is reported as 0. Might be fixed, somehow, if absolutely needed (not
sure).
This aligns the behavior of params_yaml with params_config library so that
when a mapping is read using getlist it returns the number of elements in
the mapping instead of 0.
FAPI P7 Refactoring and unitary test creation
This MR is a follow-up to the work done in !2714 this time separating
the P7 FAPI messages into its own library (nr_fapi_p7).
In the same way, utility functions to copy, free and compare have been
added for each message, as well as an addition function to get the
allocated size for a message, which is used for the messages that can be
too big to fit in a buffer that's allocated in the stack.
Unitary tests have been added for each of the messages, testing
pack/unpack and the utility functions added.
Some users of the OAI CI complain that since we build with -Werror, it
is difficult to see all warnings/errors and fix them, necessitating
multiple attempts at times to see all warnings. To allow them to see
more warnings, use ninja option -k10 to keep going after errors, and
show more errors at once.
There are command line options that one might pass to ninja/make, but
for which cmake does not provide an interface. For instance, make/ninja
support -k/-kN to "keep going" after errors. Cmake does not provide an
option, but it is still possible to pass this. Make a build_oai option
to allow this, used in the next commit.
Imscope updates
- Using imgui docking branch - allows window docking.
- Moved scopes to different windows to allow docking.
- Disabled scatterplot for time domain samples - issues with amount of
vertices caused segfaults.
- Disabled IQ heatmaps for RX IQ samples on gNB and UE - this was
incorrect and currently I don't know how to fix it. This will be
reenabled once it is.
- added a simple menu and disabled demo windows by default.
Update NR UE threading model
This updates the NR UE threading model by preventing calling threadpool
from threadpool and fixes deadlock issues related to processSlotTX. By
making processSlotTX run to completion instead of starting and waiting
for other threads to finish it prevents locking thread pool cores,
therefore prevening deadlocks.
There is a slight difference here compared to the previous version where
I do not use the UL actor as I believe it is not necessary,
processSlotTX satisfies the run-to-completion requirement now. If in the
future any UL procedure would be parallelized using the thread pool it
should either be done in a run-to-completion model or the processSlotTX
function should be taken off the thread pool.
The documentation has been updated.
- Using imgui docking branch - allows window docking.
- Moved scopes to different windows to allow docking.
- Disabled scatterplot for time domain samples - issues with amount of vertices caused segfaults.
- Disabled IQ heatmaps for RX IQ samples on gNB and UE - this was incorrect and currently I don't know
how to fix it. This will be reenabled once it is.
- added a simple menu and disabled demo windows by default.
4G/5G FAPI code is located in the same file. Since 5G code calls 5G
specific functions, these functions need to be defined in 4G.
The solution would be to separate the FAPI changes into 4G and 5G.
Add nr_fapi_p7 library to NFAPI_USER_LIB for access to utility functions
Change message handlers to use the utility functions to copy and properly free the messages
Change the SRS handler to call the handler for the measurements instead of trying to copy to RC.gNB[0], which does not exist
Change nfapi_nr_p7_message_unpack to not allocate unneeded memory
Changed parameter in unpack function to be inline with other unpack functions.
Changed nfapi_p7_allocate call to calloc to avoid dependency to NFAPI_LIB.
Added unitary test for RACH.indication( test pack/unpack, free, copy and compare )
Added constant NFAPI_NR_RACH_IND_MAX_PDU to follow constants related to other P7 messages limiting the maximum number of PDUs to use.
Removed now unneeded dependency to NFAPI_LIB and NFAPI_USER_LIB
Changed parameter in unpack_nr_srs_indication to void * to be inline with other unpack procedures.
Added memory allocation for pdu_list inside unpack function.
Add unitary test for SRS.indication( test pack/unpack, free, copy and compare )
Added rands16 to provide random int16_t values, needed for SRS.indication unitary test
Added constant NFAPI_NR_SRS_IND_MAX_PDU to follow constants related to other P7 messages limiting the maximum number of PDUs to use.
This adds the equality, free and copy functions for SRS.indication message as described in the Table 3–129 of SCF222.10.04, it does not add the functions for the report type structures, as these are always sent/received inside the uint32_t array.
The utility functions for these will be added at a later commit, and subsequently tested in the upcoming unitary test for SRS.indication.
Extra utility function to calculate allocated memory added.
Apply clang-format to pack/unpack procedures.
Add comments to improve readability of iqSize usage.
Fix unpacking return value to not return 0 on success.
Renames nfapi_nr_srs_reported_symbol_t prgs into *reported_symbol_list for two reasons:
So that the name is more representative of what the parameter represents.
For it to actually be a list, and not assume only 1 reported symbol is used.
Allocate reported_symbol_list in unpack_nr_srs_beamforming_report.
Updated all references to prior prgs to point to the first position of reported_symbol_list, still only effectively using the first reported_symbol.
Rename fill_srs_reported_symbol_list into fill_srs_reported_symbol and update input parameter name, since it only fills the information related to one reported symbol
Reordered PDU pack/unpack function to follow PDU value order
Changed nfapi_p7_allocate calls to calloc to avoid dependency from FAPI lib to nFAPI lib.
Add unitary test for UCI.indication( test pack/unpack, free, copy and compare )
Fix PUCCH Format2/3/4 value to be indexed at 0, not 2.
This is according to Table 3-66 of SCF222.10.02
Add utility functions related to UCI.indication
Extra utility function to calculate allocated memory added.
Changed parameter of `unpack_nr_crc_indication` to void* to stay inline with other unpack procedures.
Changed nfapi_p7_allocate call to calloc to avoid dependency from FAPI lib to nFAPI lib.
Add unitary test for CRC.indication( test pack/unpack, free, copy and compare )
Now allocates memory for `uint8_t* cb_crc_status` before pulling in unpack procedure.
Add utility functions related to CRC.indication.
Extra utility function to calculate allocated memory added.
Changed parameter of unpack_nr_rx_data_indication to void* to be inline with other unpack procedures.
Changed nfapi_p7_allocate calls to calloc to avoid dependency from FAPI lib to nFAPI lib.
Add unitary test for RX_DATA.indication( test pack/unpack, free, copy and compare )
Changes pack/unpack procedure to expect pdu_length of 32 bits instead of 16.
This change was first added for compatibility with Aerial L1.
Add utility functions related to RX_DATA.indication
Extra utility function to calculate allocated memory added.
Allocate memory for TX_DATA.request TLV value pointer on tag == 1
In the past, this wasn't noticed because tag == 1 is not used
Add utility functions related to TX_DATA.request
Add extra function to calculate allocated memory
Create separate function to pack/unpack rx_beamforming PDU
Reorder PDU handling order to follow from 0 to 3
Changed PUSCH pdu_bitmap switch to separate if to handle multiple optional sub-pdus
Fix bit_len_harq size to 16 bit
Add utility functions related to UL_TTI.request
Add pack/unpack functionality for parameters
added in previous commit
Add utility functions related to DL_TTI.request,
creating 2 news files to contain these functions
Reorder switch to follow PDU Type order
This makes it so the functions are available to both FAPI and nFAPI libraries, and to more easily move them later to the FAPI library, while being available for nFAPI
Update NR P5 and P7 nFAPI headers to have 32-bit message_length
In the NR functions, this causes the header parameters following message_length to have their position shifted by 2 bytes, due to the increase in message_length size.
Change needed to accommodate SCF222.10.02 Table 3-3
Separates nfapi_p4_p5_message_header_t and nfapi_nr_p4_p5_message_header_t
Change the callbacks signature to accept/return void* intead of expecting a particular header type, being the NR/LTE distinction done inside the callback functions.
Create NR related functions for nFAPI transmit timestamp and checksum calculation.
Move nfapi_p7_codec_config_t and nfapi_p4_p5_codec_config_t to separate header to be shared between LTE and NR VNF/PNF
Move nfapi_nr_timing_info_t into NR header.
Move NR specific function declarations to NR header.
Fix Assert condition to properly check that body was packed successfully
Fix retval value when performing bitwise AND with push16
Remove commented code
Remove dummy_subframe variable, which is initialized once in
start_request() and then copied to memory on the heap. It is not needed.
In nr_start_request(), it should not be necessary, but we keep it for
the moment to not make more changes than necessary.
This avoids a segfault for me, but I am not exactly sure why.
The previous code fills random number in the TDD config, which leads to
unrealistic TDD patterns. Filling wtih a specific, realistic TDD config
allowed to fix the bug in the next commit.
Testing showed that some messages could be at least slightly bigger than
the previous maximum size of 8192. Given that the maximum transport
block could be larger, increase this value to 32768.
unpack_dl_tti_ssb_pdu_rel15_value() reads two additional bytes,
seemingly for RX power information. However, table 3-79 does not
contain such info, so I remove to match the corresponding pack function
pack_dl_tti_ssb_pdu_rel15_value().
TODO: tx power info relevant?
Since tag 2024.w45/commit f54ca5714e,
standalone mode/--sa is the default and does not exist. Correspondingly,
it has been removed from the documentation.
For users reading recent documentation, but running an older version of
OAI, there might be a mismatch in that --sa is necessary to run OAI, but
not given in the documentation. Provide explanatory text to make users
aware of this.
Run the last job of gNB pusch channel estimation inline
In case of 1 antenna this prevents the usage of threadpool which
eliminates the thread pool overhead. In case of >1 antenna the
threadpool contention should be reduced providing smaller benefits.
NR UE RRC T304 in phy-test mode
RRC timer T304 is stopped upon completion of the associated RA handover
procedure. There is no RA procedure in phy-test mode so T304 should not
be started to avoid unwanted expiration.
NR MSG3 scheduling improvements
- fix wrong condition on MSG3 allocation assertion message
- remove assertion altogether and handle properly the case where MSG3
can't be allocated
T2: minor fix for 4x4 processing
- correct max number of LDPC segments for T2 processing
- use pointer arithmetics in retrieve_ldpc_enc_op() in T2 lib to
optimize loop processing
Implement run-to-completion for processSlotTX. This is achieved by using a new
dynamic_barrier_t which allows to specify callback after the first join has been
made.
This commit introduces dynamic_barrier_t. Its a thread barrier that counts joins
but allows callback to be specified later. See std::barrier for a basic barrier
description.
In case of 1 antenna this prevents the usage of threadpool which eliminates
the thread pool overhead.
In case of >1 antenna the threadpool contention should be reduced providing
smaller benefits.
* tac is optional IE, and it was assumed as always present
* is now allocated in DU container by copy_f1ap_served_cell_info
when present in the updated cell info and missing in the
DU container
Integration: `2024.w47`
See merge request oai/openairinterface5g!3120
* !2972 Parallelize PUSCH channel estimation
* !3105 Fix a small bug with total_res in gNB PUSCH symbol processing
* !2996 Ue monitoring stats
* !3122 Avoid assert on non-implemented SM write callback
* !3110 Fronthaul 7.2 improvements (1. step towards M-plane integration)
* !2966 Refactor of includes in gNB/UE for improved header management
* !3123 Reduce double-usage of CI XML files
* !3029 NR UE RRC reconfiguration improvements
* !2670 chore(ci): adding Flexric-RAN integration test
* !3124 CI: use OC CN in aerial pipeline
chore(ci): adding Flexric-RAN integration test
- Triggering a standalone FLEXRIC + 5G-RAN pipeline: OAI-FLEXRIC-RAN-Integration-Test
- will be triggered by the RAN-Container-Parent
- but also by the OAI-FLEXRIC pipeline (to be done once integrated)
- Added an new python option: --FlexRicTag= than if not used, won't have any effect
- Nice addition:
- if --FlexRicTag=develop or --ranCommitID=develop --> will use the latest commit
on either dev or develop branch.
- Scenario-wise
- Using the cn5g deployment file from Luis in documentation, at least we will use
it to make sure it is working at all time
- We can add more test and especially checkers on the flexric calls
Linked to !3085 (merged)
Occasionally, the CN deployment takes longer than 60 seconds to complete
successfully. As a result, the CI reports failure, even when all other test
stages pass (e.g., gNB attaches to the CN, UE connects, and iperf tests succeed).
Replace current docker deployment of OAI CN by deployment on OC. With change
of the CN, we also need to change the routing for UE module - change the
mbim script for controling the UE.
Reduce double-usage of CI XML files
Some pipelines use the same XML files. For instance,
RAN-NSA-B200-Module-LTEBOX-Container and RAN-LTE-{TDD,FDD}-LTEBOX-Container
use both fr1_epc_{closure,start}.xml, but use the core network on different
hosts, by means of different pipeline configuration (EPCtype, etc).
A future MR will remove these additional pipeline configuration, and store
all the CN config in the repository. To simplify the transition, duplicate
some XMLs (i.e., remove duplicate usage of them).
After this MR, the only "double usage" of XML files for core (un-)deployment
should be through pipelines RAN-LTE-{TDD,FDD}-LTEBOX-Container.
Refactor of includes in gNB/UE for improved header management
This merge request implements changes suggested by the Include What You Use
(IWYU) open source tool to streamline the project’s header file usage.
The adjustments ensure that each file includes only the necessary headers for
the symbols it uses, making the code more efficient and maintainable.
Unnecessary includes have been removed, and missing headers have been added
where required. This improves modularity and reduces inter-dependencies between
files, helping to avoid future build issues caused by unused or missing includes.
Each output has been manually reviewed.
Followed a similar approach as in !2953 (merged).
Affected folders/files:
- NR_MAC_gNB/main.c
- nr-softmodem.c
- unitary simulators: nr_dlsim, nr_ulsim, prachsim
- openair2/RRC/NR
- openair3/NGAP
- openair2/LAYER2/nr_pdcp
- openair2/SDAP/nr_sdap
Fronthaul 7.2 improvements (1. step towards M-plane integration)
- added explanations for each parameter used for XRAN library
- added new config files for VVDN, Benetel 550 and Metanoia RUs
- changed config file for Benetel 650
- deleted 8x8 650-550, and added 8x8 650-650 config file
- updated FHI README
- setting one or more VFs; compatibility with Mellanox NIC as well
- fhi_72 section
Avoid assert on non-implemented SM write callback
The asserts might be used to intentionally stop the running process.
Further, it might be an annoyance if it happen unintentionally. Just
print an error message instead.
If we are pulling FlexRIC, overwrite the tag to use with what has been
provided on the command line. This is because we hardcode the tag schema
"branchname-commitId[0:8]" everywhere else, but this does not apply for
FlexRIC, and we have to overwrite this here.
- pass parameter directly instead of indirectly via class
- harmonize to svr_id to read through common code in the next commits
- pass images to express which images will be deleted
- refactor function to use "with" for cls_cmd, and return success (or
not)
- reuse cls_containerize.Containerize.PullImage()
- pass parameter directly instead of indirectly via class
- always read node name and use this instead of "sometimes" looking it
up from a class member. With "sometimes" I mean that if no node name
is given, it will take it from self.eNBIPAddress, which is confusing
at best if we can give the node name directly
- consistently put the node name in the xml file
- pass parameter directly instead of indirectly via class
- call it simply "images", to harmonize with clean-function later
- harmonize to svr_id as in the previous commit
- rewrite function to use with-statement with cls_cmd
- optionally pass a tag to use (which will be used in a test, and can be
used to pull flexric)
- Introduce Pull_Image() which does the actual pulling, can pull from
any registry, and will be reused in the case of pulling from cluster.
* ideally the result of these macros shall be relevant
only in unit tests, in order to validate enc/dec NAS functions
* use a local print macro
* remove dependency from LOG module
* simplified the code
* cleanup TLVDecoder.c (kept it for LTE dependencies)
* FGMM enc/dec library files
* Plain message encoding + logic for security protected message
* added fill_fgstmsi function
* add checks on length in 5G-S-TMSI encoder function
* encoding of NAS Service Request and relevant mandatory IEs
Ue monitoring stats
- one commit to add UE mac stats similar to gNB one and remove a partial
implementation at phy level of some counters
- second commit only rename the two UE persisted HARQ tyepdef names for DL
and for UL (one was saying "UE" but not the direction and the second the
direction but not "UE")
The asserts might be used to intentionally stop the running process.
Further, it might be an annoyance if it happen unintentionally. Just
print an error message instead, and return to FlexRIC that nothing is to
be sent.
The CI pipeline RAN-NSA-B200-Module-LTEBOX-Container uses the same core
network (ltebox) as the pipelines RAN-LTE-{TDD,FDD}-LTEBOX-Container,
triggered through the same XML files. However, the core networks are on
different hosts, configured through (Jenkins) pipeline configuration. A
future MR will move the entire core network configuration into the XML
files [1]. To facilitate this, create separate XML files for the NSA
pipeline.
[1] The advantage is that it will be easier to reason with only the XML
files what is going to be run where and how.
Fix a small bug with total_res in gNB PUSCH symbol processing
Replaced total_res with res_per_task when deciding whether to start a threadpool
task or not. This does not have big impact on the software as the
nr_pusch_symbol_processing will recheck ul_valid_re_per_slot anyway but it may
reduce the number of thread pool tasks created.
- identification of each parameter in fh_init and fh_config structs
- identification of unused parameters in xran library
- identification of parameters used for CAT A O-RU
=> CAT B not supported in this release
- pass parameter directly instead of indirectly via class
- harmonize to svr_id to harmonize parameter with parameters in the next
commit (and towards a future harmonization of directly taking node
names instead of "IDs")
The queue for finished jobs of PUSCH channel estimation is only used inside
nr_pusch_channel_estimation(). Since initialization is fast, it can be
declared on the stack in the function where it is used.
This commit enables the optional use of Tracy for profiling NR UE & gNB.
See https://github.com/wolfpld/tracy/releases/tag/v0.11.1 for details.
How to compile:
use -DTRACY_ENABLE=ON to enable instrumentation and sampling
For gNB currently only sampling is implemented.
How to collect data:
- Windows hosts: tracy-profiler.exe in link above
- Linux hosts: Compile tracy-profiler from source
Enabling collection from docker:
- open port 8086
- to collect cpu data
--privileged
--mount "type=bind,source=/sys/kernel/debug,target=/sys/kernel/debug,readonly"
--user 0:0
--pid=host
How to add instrumentation:
- See examples in this commit or manual in the link above.
Fix error reported by the T2 card when running nr_dlsim with 4 DL layers.
Error can be reproduced by running:
./nr_dlsim -n100 -s30 -e25 -b273 -R273 -x4 -z4 -y4 -P --ldpc_offload.dpdk_dev 41:00.0 -c
So far we set NR_LDPC_MAX_NUM_CB to 72, which is sufficient for max 2 DL layers.
Set max possible number of LDPC segments based on the max number of layers
and max number of DLSCH segments (currently it is 144).
Integration: `2024.w46`
See merge request oai/openairinterface5g!3106
* !3095 UE: Set default SSB config
* !2991 fix BSR report malformed, add SHORT BSR when it can (instead of LONG BSR)...
* !3104 Trigger deregistration only in SA mode → small fixup?
* !3107 Clip the input for -32768 because this will make different result in...
* !3109 T tracer: support float types in traces
* !2777 NR UE trigger for re-establishment
* !3108 Prevent segfaults in gNB stack
* !3059 Test for init_RA
* CI: increase UE thread pool size
* !3036 Further improvements in analog beam management for CSI-RS
* !3093 Added NTN FDD FR1 bands defined in 3GPP TS 38.101-5
Added NTN FDD FR1 bands defined in 3GPP TS 38.101-5
Added support for NTN FDD FR1 bands 254, 255, 256 as specified in 3GPP
TS 38.101-5. Example Conf files added for band254 for 15Khz, 5Mhz and
30Khz, 10Mhz configurations. Tested NTN GEO configuration on band 254
using these conf files.
There seem to be randomly occurring deadlocks when running the UE in the
CI. MR !3091 should fix this. While waiting for this, apply a workaround
by increasing the number of worker pools in the UE to 12.
Since tag 2024.w45/commit f54ca5714e,
standalone mode/--sa is the default and does not exist. Correspondingly,
it has been removed from the documentation.
For users reading recent documentation, but running an older version of
OAI, there might be a mismatch in that --sa is necessary to run OAI, but
not given in the documentation. Provide explanatory text to make users
aware of this.
Test for init_RA
A testcase for init_RA function.
The testcase redefines the following functions as stubs:
- nr_mac_rrc_ra_ind
- nr_write_ce_ulsch_pdu
- mac_rlc_data_req
- lockGet_ul_config
- release_ul_config
- remove_ul_config_last_item
- nr_ue_configure_pucch
These stubs can be used to check init_RA behavior
NR UE trigger for re-establishment
The implementation in this MR triggers RRC re-establishment at the UE in case
of radio link failure either for out of sync messages from lower layers or in
case maximum number of RLC retransmissions is reached.
/opt/oai-gnb/bin/nr-softmodem -O /opt/oai-gnb/etc/gnb.conf --sa --log_config.global_log_options level,nocolor,time --rfsimulator.options chanmod --telnetsrv --telnetsrv.listenaddr 192.168.71.150 --telnetsrv.shrmod ci
=================================================================
==7==ERROR: AddressSanitizer: odr-violation (0x7fce78b85be0):
[1] size=4 'log_mem_write_side' /oai-ran/common/utils/LOG/log.c:78:14
[2] size=4 'log_mem_write_side' /oai-ran/common/utils/LOG/log.c:78:14
These globals were registered at these points:
[1]:
\#0 0x7fce7b691658 in __asan_register_globals ../../../../src/libsanitizer/asan/asan_globals.cpp:341
\#1 0x7fce7bd0c47d in call_init elf/dl-init.c:70
[2]:
\#0 0x7fce7b691658 in __asan_register_globals ../../../../src/libsanitizer/asan/asan_globals.cpp:341
\#1 0x7fce7a5e2eba in call_init ../csu/libc-start.c:145
\#2 0x7fce7a5e2eba in __libc_start_main_impl ../csu/libc-start.c:379
==7==HINT: if you don't care about these errors you may set ASAN_OPTIONS=detect_odr_violation=0
SUMMARY: AddressSanitizer: odr-violation: global 'log_mem_write_side' at /oai-ran/common/utils/LOG/log.c:78:14
==7==ABORTING
[INFO tini (1)] Spawned child process '/opt/oai-gnb/bin/entrypoint.sh' with pid '7'
[INFO tini (1)] Main child exited normally (with status '1')
* trigger re-establshemnt on DU: reset RLC counters on DRB 1
for OAI UE, since SRB 1 does not work for lack of periodic
measurements reports
* how is the re-establishment triggered?
* a transmission on DRB 1 occurs
* detection of a mismatch of RLC counters at the UE side
* max number of RLC retransmissions reached
* RLF detection
* verify re-establishment on CU: we ping the core from the UE; this
sends packets on DRB, and because the sequence number mismatches, will
trigger a reestablishment. We accept in the ping that a couple of
packets might be lost; after ping is over, reestablishment must be
done as well (else the ping will already fail).
Clip the input for -32768 because this will make different result in...
Clip the input for -32768 because this will make different result in
mult_complex_vectors() compared to C version
Trigger deregistration only in SA mode
Upon press of ^C, the UE triggers a NAS deregistration. This does not work
in do-ra or phy-test modes, because there is no NAS. Therefore, in non-SA
modes, just stop the UE directly.
This can potentially improve the 5G RFsim CI test case, because together with
a high RFsim timeout, the chances of the last HARQ status line being without
retransmissions is much higher. If that does not help, we can further increase
the retx threshold.
fix BSR report malformed, add SHORT BSR when it can (instead of LONG BSR)...
fix BSR report malformed, add SHORT BSR when it can (instead of LONG BSR)
simplify the code and make the code more explicit, but the may structure
remain (nr_write_ce_ulsch_pdu interface is complex, merging it into the
called would make simpler and more interstandable code), fix some asserts
related to this part of code
Added support for NTN FDD FR1 bands 254, 255, 256 as specified in 3GPP TS 38.101-5
Conf files added for 15Khz, 5Mhz and 30Khz, 10Mhz configurations added for these bands
In some runs of a multi-UE deployment, we see segfaults because
cell_group->spCellConfig is NULL. We should not segfault in that case,
so check for spCellConfig.
When the UE list is full, the iterator will run through all
MAX_MOBILES_PER_GNB UEs. It expects that eventually the pointer is NULL,
which is not the case if we have MAX_MOBILES_PER_GNB (or it simply
depends on the following memory). So give one array entry more, to
ensure that the last one is NULL.
- add new data structures for antenna processing.
- create arrays that keep track of certain values (max_ch, noise_amp2, nest_count and delay) per each antenna. These values are processed in order to determine one final output.
- add time processing measurements for each antenna, and prints them in nr_ulsim.
- make num_antennas_per_thread configurable in nr_ulsim and the gNB config file.
Co-authored-by: Nada Bouknana <bouknana@eurecom.fr>
Co-authored-by: Brice Robert <brobert@valiha.com>
UE: Set default SSB config
After initial sync the UE sets the ssb index bitmap in nrUE_config with
index obtained in initial sync. This allows UE to continue decoding PBCH
and stay synched with the gNB till SIB1 is received.
Replaced total_res with res_per_task when deciding whether to start a threadpool task or not.
This does not have big impact on the software as the nr_pusch_symbol_processing will recheck
ul_valid_re_per_slot anyway but it may reduce the number of thread pool tasks created.
Upon press of ^C, the UE triggers a NAS deregistration. This does not
work in do-ra or phy-test modes, because there is no NAS. Therefore, in
non-SA modes, just stop the UE directly.
If the RLC cannot retransmit a package, 3GPP specs say that we should
declare radio link failure (RLF). Up to this commit, the code did
nothing though. In this commit, add a per-UE RLF callback; the RLC will
call into this function to signal that RLF has been detected through
maximum retransmissions on a particular RLC bearer.
Integration: `2024.w45`
See merge request oai/openairinterface5g!3097
* !3048 Cleanup and refactoring at gNB initialization
* !3077 Address most thread safety issues in NR UE
* !3089 Improve cross-compile documentation
* !3092 Remove Interop-F1/Accelleran-CU testing pipeline
* !3096 Remove x86-specific instructions from telnet server
* !2949 Better polar decode
* !3070 CI: Add test with 4 DL layers, 60 MHz BW to SA-2x2 pipeline
* !3098 nr rlc: hotfix: test allocation valid before use
* !3090 Add UL PRBs Blacklist section to NR_SA_Tutorial_COTS_UE.md
* !3082 fix blocking bugs in command nr_dlsim -n100 -e27 -s35 -b 273 -R273 -x4 -y4 -z4
* !3100 CI: Remove 5g_l2sim files
* !3024 Set SA mode as default
* !3087 Remove some usage of the old CI sshConnection class
* !3074 CI: cleanup of cls_physim.py
Extract nr_ra_procedures.c into a separate library and add a testcase for init_RA function.
The testcase redefines the following functions as stubs:
- nr_mac_rrc_ra_ind
- nr_write_ce_ulsch_pdu
- mac_rlc_data_req
- *lockGet_ul_config
- release_ul_config
- remove_ul_config_last_item
- nr_ue_configure_pucch
These stubs can be used to check init_RA behavior
CI: Cleanup of cls_physim.py
- Remove unused code and file
- Rework functions for CUDA and T2 log analysis
- Check if test was successful for nr_ulsim and nr_dlsim in
RAN-gNB-N300-Timing-Phytest-LDPC pipeline
Set SA mode as default
- Set standalone (SA) mode as the default.
- Adjust commands in Docker Compose files by removing --sa flags and
adding --nsa flags where applicable.
- Add a function to verify that only one mode is being used at a time.
- Update all relevant documentation.
In the last commits, SSHconnection class has been removed from
cls_containerize.py. We therefore don't need the username and password,
as cls_cmd uses certificates only. Remove the usage of the username and
the password, and harmonize the use of GetCredentials().
Recent refactoring replaced the CreateWorkspace function call with a
dedicated XML step (for clarity, and because it avoids needless
recreation of workspaces). In the proxy function, the same
CreateWorkspace xml step has been added, cloning the OAI RAN repo, when
we actually need the repository for the proxy. Hence, fix this by
calling the CreateWorkspace() function manually, but only when
necessary, to build the proxy. (It would only be a problem if the
pipeline would rebuild the proxy, which did not happen because not much
work is happening on the proxy repo).
Further, refactoring and simplication of the proxy build function were
done:
- never tag proxy with develop, that makes no sense
- overwrite CreateWorkspace() info after having created and used the
workspace (the "if" to build the proxy)
- simplify copying of logs
- add simple unit test
- remove check for ubuntu; the dependcy is "docker". Simplify the code
to not obscure with a class variable.
The first thing Build_Proxy does is to remove the repository. Further,
Build_Proxy does not use the OAI RAN repo, but the proxy repo. The
Create_Workspace() is therefore completely useless.
Remove CheckAndAddRoute(), as it is complicated to read, uses a
multitude of hostname/IP/password combinations. Replace with scripts on
the machines, which, as of this commit, are:
- porcepix: ~/after-reboot.sh
- ofqot: ~/after-reboot.sh
- nepes: ~/after-reboot.sh
- obelix: ~/how-to-resetup-obelix-out-of-reboot.sh
It is clearer in CI logs to use absolute paths, and that is also a
"preference" of the new SSH class (cls_cmd.py) in the sense that some
functions don't handle "cd" gracefully (because of underlying Python
library paramiko).
For zip, though, we should change to have nice relative paths in the
archives, so use cd <path> && zip ... to achieve that, instead of
changing to a directory. This way, the path on which we operate is still
visible in the logs in each line.
The clang build fails with
/oai-ran/openair1/PHY/MODULATION/gen_75KHz.cpp:16:23: error: variable length arrays in C++ are a Clang extension [-Werror,-Wvla-cxx-extension]
16 | complex<double> t[len];
| ^~~
/oai-ran/openair1/PHY/MODULATION/gen_75KHz.cpp:16:23: note: function parameter 'len' with unknown value cannot be used in a constant expression
So ignore this warning (and make the build pass), since OAI uses VLAs in
various places.
The previous version would put the user-defined options first. However,
the default options include e.g., -Wall. If a user tries to override
(see for instance the next commit) -Wall or other options might override
this and not honor the user choice.
To always have the user have the last work, put user-defined compile
options last.
THere are four possibilities, for the three options (phy_test, do_ra,
nsa):
- None is set -> SA
- Only one is set of each -> corresponding mode
Introduce a function softmodem_verify_mode() to check for these.
- Introduce "Run_Physim" function for running ldpctest (with CUDA) and
nr_dlsim/nr_ulsim (with T2) in RAN-gNB-N300-Timing-Phytest-LDPC test
pipeline.
- Create "cls_analysis.py" and introduce "analyze_physim" for
log analysis of physim tests.
- Define patterns to be searched in the physim logs.
- Extract and print information about total gNB RX/TX PHY processing time
from nr_ulsim/nr_dlsim logs.
- Remove "cls_physim.py" as it is not used anymore, cleanup "main.py".
fix blocking bugs in command nr_dlsim -n100 -e27 -s35 -b 273 -R273 -x4 -y4 -z4
errors in main OAI code:
- one stack overflow
- one variable array of size 0
- one direct usage of unaligned SIMD
and small fixes inside the tests tool nr_dlsim to handle this large configuration (4layers, 100MHz)
use a better complex vector multiplication function
Since commit 041b2b2d7a, the CI main loop
iterates over all steps, even if there has been a problem during an
earlier XML step. In all cases, UndeployObject() is marked to always
run, as we always need to make sure that all deployed services are
terminated. UndeployObject() always recovers logs. Hence, it's not
necessary to do it here as well; it leads to duplicated logs.
This is visible in all pipeline with a failed deployment: the logs
appear twice.
create_workspace.sh used to check out develop by default. However, this
is unnecessary because the script later checks out a specific reference
(which can be a commit ID, which is not accepted by git clone, the
reason we don't check out during clone); the repository will simply be
empty in the beginning, which should not be a problem.
Further, it is problematic because we use this script for the build of
the L2sim proxy, and the repository does not have develop; thus, without
this modification, L2sim proxy build will always fail.
- simplify the code
- prevent to use "beta" tables from one decoder run to the next one (to see it
is the case, don't initialize beta, you will see it doesn't decode)
- decrease memory footprint of the decoder by x10 or more
- save about 15% of cpu in polartest unitary test tool, and more if we run in
realistic use case
- still this decoder performs much worse than the (very) slow OAI version by 3dB
telnetsrv uses the Intel/AMD-specific "cpuid" instruction, which is not
available on ARM machines. Remove the call.
The previous code was checking for the number of cores, which is
retained by a call to get_nprocs(). I did not find an equivalent for the
number of threads in C. In C++, there would be
https://en.cppreference.com/w/cpp/thread/thread/hardware_concurrency, in
case it's relevant for anybody.
Also, add it to the cross-compilation pipeline
csiim_vars/csirs_vars used to be global array for each UE. Now its present
in phy_data which is in dynamically allocated memory.
MAC config was done without mutex while DL and UL threads could be running
at the same time.
get_ue_nas_info was allocating memory possibly from more than one thread.
Moved it into new init function for UE NAS layer.
Addreses most issues in #869
The goal of this MR is to improve readability, maintainability and consistency
of gNB initialization functions.
This MR is:
- cleaning up redundant and unused code
- refactoring init_gNB, l1_north_init_gNB, RCconfig_NR_L1, NRRCConfig
- removing redundant memory allocation for gNB RAN context and L1 instances
- cleaning up redundant log lines
telnetsrv uses the Intel/AMD-specific "cpuid" instruction, which is not
available on ARM machines. Remove the call.
The previous code was checking for the number of cores, which is
retained by a call to get_nprocs(). I did not find an equivalent for the
number of threads in C. In C++, there would be
https://en.cppreference.com/w/cpp/thread/thread/hardware_concurrency, in
case it's relevant for anybody.
the version in develop is difficult to understand, and surprizing design
it loops only when avx2mod == 0 because when this test is false, the
size is always small i also spent time to understand, but i think i have
not changed it by not looping over the array.
Use non-recursive polar decoder after traversing the tree once. Maximum number
of nodes is set to 600 (unsure of the maximum). This is more performant
than the recursive version.
- Ensure packed struct through bitfield
- decoder tree buffer increase: i don't find evidence in the 3GPP
standard of the max size of polar coded PDU. even with this max size,
the way this tree is built is not trivial. so, it is hard to predict,
i just put 8 system pages (32KB) that looks enough [1]
- a lot of reformatting
[1] https://arxiv.org/pdf/1804.04389
according to this paper, the largest polar code in 5G is in UL, so
likely the biggest problem will be in gNB, not the UE. in DL, the max
output coded block is 512, in UL 1024. probably the tree we discuss is
related to this size.
"frozen bits" means only bits we don't encode/decode because polar code
size is only by power of 2.
We see this in OAI code: NR_POLAR_PUCCH_N_MAX is 10, so 2^10 is 1024,
that is the maximum size for 5G polar code length. in the code, we
assert if N > 512: "N = %d, not done yet\n",
polarParams->N". so, the today OAI code can't do PUCCH large blocks.
using current oai limitation of 2⁹ max code size, we can create up to
2^9+2⁸... nodes, so 1023 nodes in the tree. the problem then is that
each node have variable size, depending on the 'level' (the power of 2
we are currently). the algo provision large alpha and beta to be able
to store all lower levels in the tree (int leaf_sz = 1 << level)
therefore upper tree nodes are large (the top level for n=9 uses about
1.5KB) and the bottom nodes uses 64 bytes. if all nodes are populated,
the size will be very large: 1.5KB + 2 * 800 + .... but, we create
nodes in the tree only for the "information bits", so the payload, that
is limited to 128 bits (else we assert, the code is not "finished").
1.5KB * 128 is >> 8KB i allocated. but, we can't create more than one
mode at top level, so there is maximum 1.5KB + 2 * 800, + 4 * 400 + 8 *
200 + 16 * 100 + remaining of 128-32 nodes of 64 bytes. about 14KB.
i allocated 1024*sizeof(__m256i) bytes = 32KB that looks good.
* the goal of this function is to initialize and configure the RAN Context
* the goal of get_options is to get command line options
* this commit aims at making the implementation more consistent
* move initialization of RC.nb_nr_CC to this function
* cleanup redundant initializations of RC.nb_nr_macrlc_inst outside NRRCConfig
* cleanup redundant initization of RC.nb_nr_macrlc_inst from getter function (get_node_type)
* cleanup RC initialization in RCconfig_NR_L1
* removed redundant log lines (print number of instances in NRRCConfig only)
* do RC init after getting CL options and configuration
* get_node_type shall access configuration only, not RC context
* NRRCConfig shall be called only once: made it thread-safe
* nb_nr_inst represents the number of gNB instances and the number of RAN contexts
* it used also to count the number of RRC instances in the node
* it is set from config file in NRRCConfig, therefore redundant checks after
this function have been removed
* redundant global variable NB_gNB_INST, set after nb_nr_inst, was removed
* gNB and L1 init is done in init_gNB and RCconfig_NR_L1
* moved RCconfig_nr_prs out of create_gNB_tasks for consistency
* do RCconfig_nr_prs only for L1 instances
* removed initialization of gNB
* separate function to get blacklisted UL PRBs
* call the getter in both L1 and MAC/RLC configuration
* other minor improvements
Some files were not shown because too many files have changed in this diff
Show More
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.