Synchronize multiple gNBs by aligning the slot boundaries
Currently, we derive frame and slot number based on proc->timestamp_rx
using
proc->frame_rx = (proc->timestamp_rx / (fp->samples_per_subframe*10))&1023;
proc->tti_rx = get_slot_from_timestamp(proc->timestamp_rx, fp);
This ignores the samples
proc->timestamp_rx % fp->samples_per_frame
while computing the frame and slot number creating a mis-alignment with
the slot boundaries. A detailed description of the slot misalignment
in a pictorial representation can be seen in an attachment in the MR [1].
We fix this alignment issue by compensating these samples during the
first reception.
We can test the synchronization of the multiple gNBs from the estimated
ToAs from the PRS in the Downlink and the estimated ToAs from the SRS in
the Uplink using rfsim.
In order to test this, make sure you build gNB and nrUE along with the
telnetsrv flag using the option --build-lib telnetsrv.
Also, enable the following log in the function
nr_est_srs_timing_advance_offset() in
openair1/PHY/NR_ESTIMATION/nr_measurements_gNB.c to observe SRS ToAs
LOG_I(NR_PHY, "SRS estimatd ToA %d [RX ant %d]: TA offset %d, TA offset ns %d (max_val %ld, mean_val %ld, max_idx %d)\n", srs_toa, ant, *ta_offset, *ta_offset_nsec, max_val, mean_val, max_idx);
Furthermore, update the option Active_gNBs = 2; in
targets/PROJECTS/GENERIC-NR-5GC/CONF/ue.nr.prs.fr1.106prb.conf to enable
decoding PRS transmitted from two gNBs
To run:
nrUE:
sudo ./nr-uesoftmodem -r 106 --numerology 1 --band 78 -C 3619200000 --uicc0.imsi 001010000000001 --rfsim --phy-test -O ../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/ue.nr.prs.fr1.106prb.conf --rfsimulator.serveraddr server
gNB 0:
sudo ./nr-softmodem -O ../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb0.prs.band78.fr1.106PRB.usrpx310.conf --gNBs.[0].min_rxtxtime 6 --rfsim --phy-test --rfsimulator.[0].serveraddr 127.0.0.1 --rfsimulator.[0].options chanmod --rfsimulator.[0].modelname AWGN --telnetsrv
gNB 1:
sudo ./nr-softmodem -O ../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb1.prs.band78.fr1.106PRB.usrpx310.conf --gNBs.[0].min_rxtxtime 6 --rfsim --phy-test --rfsimulator.[0].serveraddr 127.0.0.1 --rfsimulator.[0].options chanmod --rfsimulator.[0].modelname AWGN --telnetsrv
When we run the nrUE, gNB0 and gNB1, we can see the following logs
nrUE:
[PHY] [gNB 0][rsc 0][Rx 0][sfn 976][slot 2] DL PRS ToA ==> 0.0 / 2048 samples, peak channel power -16.4 dBm, SNR +4.0 dB, rsrp -42.2 dBm
[PHY] [gNB 1][rsc 0][Rx 0][sfn 976][slot 3] DL PRS ToA ==> 0.0 / 2048 samples, peak channel power -16.4 dBm, SNR +4.0 dB, rsrp -42.2 dBm
gNB 0:
[NR_PHY] SRS estimatd ToA 0 [RX ant 0]: TA offset 31, TA offset ns 0 (max_val 99820162, mean_val 80176, max_idx 0)
gNB 1:
[NR_PHY] SRS estimatd ToA 0 [RX ant 0]: TA offset 31, TA offset ns 0 (max_val 98784562, mean_val 79369, max_idx 0)
From the above logs, when we run the rfsim and when no delays introduced, we can observe the following results
In the Downlink at the UE, the estimated ToAs using PRS from both gNB0
and gNB1 are 0 and in the uplink, the ToA estimated from the SRS
transmitted by the UE at both the gNBs are also 0. This indicates that
both the gNBs are synchronized along with their slot boundaries. We also
highlight that this is not the case in the current develop branch since
the slot boundaries are not aligned.
We also can test the multi gNB synchronization by introducing delays
using telnet as follows,
Introduce new_offset (delay) of 4 samples to the gNB 0 from UE in the
uplink as follows,
openairinterface5g$ echo rfsimu setdistance rfsimu_channel_enB0 20 | ncat --idle 1 127.0.0.80 9080
softmodem_gnb> rfsimu_setdistance_cmd: new_offset 4, new (exact) distance 19.518 m, new delay 0.000065 ms
Ncat: Idle timeout expired (1000 ms).
We can oberve this delay of 4 samples being reflected in the estimated
SRS ToAs at gNB 0 while not changing the ToA in gNB 1
[NR_PHY] SRS estimatd ToA 4 [RX ant 0]: TA offset 31, TA offset ns 65 (max_val 98803636, mean_val 79430, max_idx 8)
similarly, Introduce new_offset (delay) of 2 samples to the gNB 1 from
UE in the uplink as follows,
openairinterface5g$ echo rfsimu setdistance rfsimu_channel_enB0 10 | ncat --idle 1 127.0.0.81 9081
softmodem_gnb> rfsimu_setdistance_cmd: new_offset 2, new (exact) distance 9.759 m, new delay 0.000033 ms
Ncat: Idle timeout expired (1000 ms).
We can oberve this delay of 2 samples being reflected in the estimated
SRS ToAs at gNB 1 while not changing the ToA in gNB 0
[NR_PHY] SRS estimatd ToA 2 [RX ant 0]: TA offset 31, TA offset ns 32 (max_val 98962768, mean_val 79552, max_idx 4)
Closes #897
[1] https://gitlab.eurecom.fr/oai/openairinterface5g/-/merge_requests/3892
OpenAirInterface documentation overview
This is the general overview page of the OpenAirInterface documentation. This page groups links to general information, tutorials, design documents, radio integration, and special-purpose libraries.
IMPORTANT NOTE:
Before reading this documentation, we strongly advise you to keep your own repository rebased on develop
or at least to checkout the documentation on the version of the repository you are using.
Then the documentation will better reflect the features available in your repository so that you may avoid some errors.
Beware if you previously pulled the develop branch that your repository may be now behind develop.
[[TOC]]
General
- FEATURE_SET.md: lists supported features
- GET_SOURCES.md: how to download the sources
- BUILD.md: how to build the sources
- code-style-contrib.md: overall working practices, code style, and review process
- cross-compile.md: how to cross-compile OAI for ARM
- clang-format.md: how to format the code
- sanitizers.md: how to run with ASan/UBSan/MemSAN/TSan
- environment-variables.md: the environment variables used by OAI
- tuning_and_security.md: performance and security considerations
There is some general information in the OpenAirInterface Gitlab Wiki
Tutorials
- Step-by-step tutorials to set up 5G:
- RUNMODEM.md: Generic information on how to
- Run simulators
- Run with hardware
- Specific OAI modes (phy-test, do-ra, noS1)
- (5G) Using SDAP and custom DRBs
- IF setups and arbitrary frequencies
- MIMO
- How to run OAI with O-RAN 7.2 FHI
- How to run a 5G-NSA setup
- How to run a 4G setup using L1 simulator Note: we recommend the RFsimulator
- How to use the L2 simulator
- How to use the OAI channel simulator
- How to use GPU-accelerated channel simulation
- How to use multiple BWPs
- How to run OAI-VNF and OAI-PNF: how to run the FAPI/nFAPI split, including some general remarks on FAPI/nFAPI.
- How to use the positioning reference signal (PRS)
- How to use device-to-device communication (D2D, 4G)
- How to run with E2 agent
- How to run the physical simulators
- How to setup OAI with Nvidia Aerial and Foxconn
- How to setup OAI with LDPC accelerators (Xilinx T2/Intel ACCs)
- How to setup OAI with the XDMA FPGA LDPC accelerator
- How to do a handover
- How to setup gNB frequency
- How to use the RT data recording app
- How to use packages
Legacy unmaintained files:
L2NFAPI_NOS1.md,L2NFAPI_S1.md: old L2simulator, not valid anymore
Designs
- General software architecture notes: SW_archi.md
- Information on E1
- Information on F1
- Information on how NR nFAPI works
- Flow graph of the L1 in gNB
- L1 threads in NR-UE
- Information on gNB MAC
- Information on gNB RRC
- Information on analog beamforming implementation
- Information on the UE 5G NAS implementation
- Information on UL-MIMO: UL-MIMO specific notes
Building and running from images
- How to build images
- How to run 5G with the RFsimulator from images
- How to run 4G with the RFsimulator from images
- How to run physical simulators in OpenShift
Libraries
General
- The T tracer: a generic tracing tool (VCD, Wireshark, GUI, to save for later, ...)
- OPT: how to trace to wireshark
- The configuration module
- The logging module
- The shared object loader
- The threadpool used in L1
- The LDPC implementation is a shared library
- The time management module
Radios
Some directories under radio contain READMEs:
The other SDRs (AW2S, LimeSDR, ...) have no READMEs.
Special-purpose libraries
- OAI has two scopes: one based on Xforms and one based on imgui, described in this README
- OAI comes with an integrated telnet server to monitor and control
- OAI comes with an integrated web server
Testing
- UnitTests.md explains the unit testing setup
- Component tests are under
tests/. Currently, there is a simple CU-UP tester, see the corresponding README.md. - TESTBenches.md lists the CI setup and links to pipelines
- The CI setup uses a custom framework to run end-to-end tests.
Developer tools
- formatting is a clang-format error detection tool
- iwyu is a tool to detect
#includeerrors - docker-dev-env is a ubuntu24 docker development environment
- doc_best_practices.md: overall best practices for writing documentations