Compare commits

...

189 Commits

Author SHA1 Message Date
Mario Joa-Ng
6014f65602 Revert "support multiple beam using multiple c-plane sections, one for each beam"
This reverts commit 1e4f8742786ab33a505dce44f81e56826f730863.
2025-08-14 21:57:52 +02:00
Mario Joa-Ng
5722b09095 fix the bug where xran lib always set beam_id to 0 2025-08-13 18:38:30 +02:00
Mario Joa-Ng
1c3f7d41f8 remove debugging trace. 2025-08-13 17:19:02 +02:00
Mario Joa-Ng
08e8eecef8 Handle CP UL packet at xran_fx_tx_send_slot() instead of xran_fh_rx_read_slot() as the latter lags behind the former by 4 slots. 2025-08-13 17:18:50 +02:00
Mario Joa-Ng
5f81e85ff9 need to set beam_id for UPLINK_SLOT. 2025-08-13 17:18:05 +02:00
Mario Joa-Ng
cd7e09ab9c set beam_id to -1 instead of 0. 2025-08-13 17:08:11 +02:00
Mario Joa-Ng
7be2077ca5 Set beam_idx to 32767. In phy-f-1.0/fhi_lib/lib/api/xran_pkt_cp.h, beamId:15 is of 15bit. -1 set extension bit ef:1 to 1 mistakenly. 2025-08-05 10:55:15 -04:00
Mario Joa-Ng
fd7cee2c5c each stream uses beam_idx -1 (aka unassigned) at first 2025-08-05 10:55:15 -04:00
Mario Joa-Ng
0425f4bb7b set nBeamIndex to ru->beam_id indexed by slot. 2025-08-05 10:55:15 -04:00
Mario Joa-Ng
62c2885039 Revert "handle per-sysmbol c-plane message"
This reverts commit d4714ff4bca0e6152d721eabe57eef53ee666a1b.
2025-08-05 10:47:26 -04:00
Mario Joa-Ng
f3ea944d30 set set nBeamIndex on RU_port according to beam allocation 2025-08-05 10:47:26 -04:00
Mario Joa-Ng
419c52e9fc handle per-sysmbol c-plane message 2025-08-05 10:47:26 -04:00
Mario Joa-Ng
366e706e47 fix a minor bug in mapping beam to antenna port. 2025-08-05 10:47:26 -04:00
Mario Joa-Ng
84e91d831c set nBeamIndex on RU_port according to beam allocation 2025-08-05 10:47:26 -04:00
Mario Joa-Ng
788d1cbc1c Fix the bug in calculating fh_config->neAxc where num_beams_period is multiplified twice. 2025-08-05 10:47:26 -04:00
Mario Joa-Ng
867c01e896 support multiple beam using multiple c-plane sections, one for each beam 2025-08-05 10:47:26 -04:00
francescomani
af7baede1b minor refactoring in nfapi_nr_interface_scf 2025-08-04 19:29:06 +02:00
francescomani
247e3ccd4c renaming analog to time domain beamforming (for consistency with ORAN specifications) 2025-08-04 19:28:49 +02:00
Gabriele Gemmi
5661e639f3 compute prgsize from number of RA RB 2025-08-02 21:30:56 +00:00
Gabriele Gemmi
8c7bc93e9c Removed TRP-scheme byte from UL BF PDU to Interop with Aerial 25-1 2025-08-01 11:13:07 +02:00
Gabriele Gemmi
407a049ac9 Compute DCI prgsize from Coreset 2025-08-01 11:13:07 +02:00
Gabriele Gemmi
e564b0dc69 Configuration of FAPI Beamforming PDU for Aerial PBBF 2025-08-01 11:13:07 +02:00
francescomani
9d98aee083 add option to directly send the beam index to L1 via FAPI without look-up table (for 7.2 split) 2025-08-01 11:13:02 +02:00
Robert Schmidt
b763692792 Merge branch 'integration_2025_w31' into 'develop'
Integration: `2025.w31`

* !3324 Use complex data type for channel magnitude
* !3462 Synchronized Real-Time Data Recording Application Addition
* !3536 Remove --usim-test command line option
* !3537 Another fix for CSI PDSCH overlap
* !3546 Fix for tun_if.c warning "specified bound 16 equals destination size"
* !3523 Fix UE PDSCH LLR
* !3544 Fix sib1 reception flag
* !3534 CI: Adjust frequency configuration
* !3530 remove specific directory for LTE SIM management tools
* !3545 Fix overflow when negating minimum int16_t value in precoding
* !3461 Fix Dedicated BWPs
* !3558 feat(LDPCImplementation.md): Fix documentation

Closes #948 and #955

See merge request oai/openairinterface5g!3551
2025-08-01 04:40:24 +00:00
Robert Schmidt
755246545e Merge remote-tracking branch 'origin/fix_LDPCImplementation' into integration_2025_w31 (!3558)
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.
2025-07-31 18:43:52 +02:00
Robert Schmidt
c15accf106 Merge remote-tracking branch 'origin/Fix_DedicatedBWPs' into integration_2025_w31 (!3461)
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'
2025-07-31 15:53:31 +02:00
Robert Schmidt
cbdcd2d015 Merge remote-tracking branch 'origin/issue-955' into integration_2025_w31 (!3545)
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
2025-07-31 15:26:21 +02:00
Robert Schmidt
b77be2ae28 Telnet CI: Handle error of no RNTI 2025-07-31 15:20:09 +02:00
Robert Schmidt
93196e630b Bugfix: when no UE found, return -1 2025-07-31 15:20:09 +02:00
Robert Schmidt
128a6f3945 Add XML step to check UE is on dedicated BWP 2025-07-31 15:20:09 +02:00
Robert Schmidt
aa4c2df593 Remove non-existing XML steps 2025-07-31 15:20:09 +02:00
Robert Schmidt
ea8e5d85be Add telnet command to get UE's BWP 2025-07-31 15:20:09 +02:00
Romain Beurdouche
eabb811513 feat(LDPCImplementation.md): Fix documentation
* Outdated names of the functions of the segment coding interface.
* Ambiguity about loading of the segment coding libraries.
2025-07-31 15:04:41 +02:00
Robert Schmidt
da70ea75ae Merge remote-tracking branch 'origin/ci-change-phytest-frequency' into integration_2025_w31 (!3534)
CI: Adjust frequency configuration

Change frequency used by OTA CI pipelines to avoid overlap with
commercial deployments.
2025-07-31 09:51:31 +02:00
Robert Schmidt
71e20bf290 Merge remote-tracking branch 'origin/lte-sim-tools' into integration_2025_w31 (!3530)
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
2025-07-31 09:50:11 +02:00
Jaroslava Fiedlerova
ac6561335c CI: adjust gNB conf file in OAIUE pipeline
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.
2025-07-30 18:11:09 +02:00
Laurent THOMAS
02ce4aaf82 Fix a 4G UE bug 2025-07-30 17:41:28 +02:00
Laurent THOMAS
426e3453cd trace to try to debug old 4G bug 2025-07-30 17:41:28 +02:00
Robert Schmidt
ff52194857 Remove unused parameter from build_oai 2025-07-30 17:41:28 +02:00
Laurent THOMAS
990fc9c55a Fix potential out-of-bound write
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.
2025-07-30 17:40:50 +02:00
Laurent THOMAS
b65b5dd40e Remove specific directory for LTE SIM management tools
Move into openair3/NAS/TOOLS/CMakeLists.txt, and simplify the
CMakeLists.txt.

Co-authored-by: Robert Schmidt <robert.schmidt@openairinterface.org>
2025-07-30 17:39:12 +02:00
Jaroslava Fiedlerova
6c8fc09525 CI: change frequency for AW2S pipeline 2025-07-30 10:59:47 +02:00
Matthias Mehlhose
5b0b40c102 mod: use random numbers in unit test function 2025-07-29 15:40:01 +00:00
Mario Joa-Ng
905a8a495e mod: unit test code to compare CM and SIMD results on both antennas 2025-07-29 15:38:23 +00:00
Matthias Mehlhose
7d27592b4f Initial unit test to refactor and fix nr_layer_precoder_simd function (See #955) 2025-07-29 15:35:24 +00:00
Robert Schmidt
05f6a0660b Merge remote-tracking branch 'origin/fix-ue-cset0-search' into integration_2025_w31 (!3544)
Fix sib1 reception flag

TS 38.213 4.1 says coreset 0 is present only if kssb < 24 for FR1 and <
12 for FR2. So we set get_sib1 flag accordingly.
2025-07-29 09:39:33 +02:00
Robert Schmidt
10ab7c2278 Merge remote-tracking branch 'origin/issue-948-fix' into integration_2025_w31 (!3523)
Fix UE PDSCH LLR

Closes #948
2025-07-29 09:38:59 +02:00
Jaroslava Fiedlerova
62dd459959 CI: change frequency for OAIUE pipeline 2025-07-29 09:30:23 +02:00
Robert Schmidt
8a9d551f42 Merge remote-tracking branch 'origin/fix_warnings' into integration_2025_w31 (!3546)
Fix for tun_if.c warning "specified bound 16 equals destination size"
2025-07-28 10:31:55 +02:00
Robert Schmidt
6d6814044a Merge remote-tracking branch 'origin/fix_csi_pdsch_overlap_fix' into integration_2025_w31 (!3537)
Another fix for CSI PDSCH overlap

This follows up !3510 and takes into account starting PRB to determine
even/odd RB
2025-07-28 10:31:32 +02:00
Robert Schmidt
432dbda010 Merge remote-tracking branch 'origin/remove-usim-test' into integration_2025_w31 (!3536)
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).
2025-07-28 10:31:07 +02:00
Robert Schmidt
4b0b0c4f21 Merge remote-tracking branch 'origin/data_recording_app' into integration_2025_w31 (!3462)
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
2025-07-28 10:28:07 +02:00
Robert Schmidt
5acf5af574 Merge remote-tracking branch 'origin/fix-ch_mag-vars-type' into integration_2025_w31 (!3324)
Use complex data type for channel magnitude

bad type multi casts with wrong meaning like cast to ** a array of 2D
(wrong in C)
2025-07-28 10:27:35 +02:00
francescomani
8f16b02b24 fix tun_if.c warning: specified bound 16 equals destination size 2025-07-25 13:45:34 +02:00
francescomani
c65db568f5 take into account starting PRB when deciding even/odd PRB for CSI PDSCH rate-matching 2025-07-24 19:51:44 +02:00
Sakthivel Velumani
e9d95e8962 Add new physim test cases for nr_dlsim
Following tests are added:
  1. 256QAM with TDL-A channel model
  2. 256QAM with 2 layers
2025-07-24 13:20:07 -04:00
Sakthivel Velumani
dad6cf8dc3 Fix bug in LLR threshold buffer
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.
2025-07-24 13:20:07 -04:00
Sakthivel Velumani
eb44d715ca Dlsim dump processing buffers
Write extracted rxF buffer to output bin file.
Fix offset in writing rxF buffer.
2025-07-24 13:20:04 -04:00
Sakthivel Velumani
b37cd04134 Set sib1 reception flag as per spec
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().
2025-07-24 13:18:04 -04:00
Laurent THOMAS
8dd2119d4e bad type multi casts with wrong meaning like cast to ** a array of 2D (wrong in C) 2025-07-24 13:48:36 +02:00
Laurent THOMAS
3264eca6db enhance llr unitary tests 2025-07-24 13:48:36 +02:00
Laurent THOMAS
f57f6a8d4e factorize code that initialize all 0xff simd vectors 2025-07-24 13:48:36 +02:00
francescomani
d914541838 use CSET0 for common search space in dedicated BWP 2025-07-24 10:47:39 +01:00
luis_pereira87
0aa19da568 CI: Add DedicatedBWP to '40 MHz TDD F1+E1 SA' in 'RAN-SA-B200-Module-SABOX-Container' 2025-07-24 10:47:39 +01:00
luis_pereira87
72d9761698 Remove 'searchspaceid' from 'verify_agg_levels' function because it was used only for LOG 2025-07-24 10:47:39 +01:00
luis_pereira87
7a5d1e55f0 Add a 'common' type SearchSpace in the NR_BWP_DownlinkDedicated IE for DedicatedBWPs to get DCIs decoded in common searchspace of a DedicatedBWP
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.
2025-07-24 10:47:39 +01:00
luis_pereira87
8c58abf85a 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
2025-07-24 10:39:01 +01:00
luis_pereira87
641cf84c0c Improve CORESET selection 2025-07-24 10:39:01 +01:00
luis_pereira87
0ccf1879ae Improve SearchSpace selection
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
2025-07-24 10:39:00 +01:00
Jaroslava Fiedlerova
61c769f8b5 Merge branch 'integration_2025_w30' into 'develop'
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
2025-07-23 15:13:27 +00:00
Jaroslava Fiedlerova
300060c26e Merge remote-tracking branch 'origin/ci-move-rfsim4g-to-acamas' into integration_2025_w30 (!3540)
CI: migrate RFSim4G to acamas machine
2025-07-23 16:46:21 +02:00
Robert Schmidt
db22e23446 Avoid uninitialized variable btilde
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];
2025-07-23 12:12:59 +02:00
Robert Schmidt
465d7de5a9 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 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.
2025-07-23 12:12:59 +02:00
Abdo-Gaber
d619a4e003 Add Readme for the Data Recording Application
It provides and overview about the Architecture, Requirement Packages,
Configuration Files, How to run Data Recording Application, and an
Overview on Collected Data Set.
2025-07-23 11:18:37 +02:00
Abdo-Gaber
8c3e14ead9 Add Data Recording Application v1.0 (main app, SigMF Interface, Config files, Sync validation)
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
2025-07-23 11:18:37 +02:00
Abdo-Gaber
9a9c5c97ef Add Data Collection Services (T-Tracer for gNB and UE)
- 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
2025-07-23 11:18:37 +02:00
Abdo-Gaber
1a8a100444 Add Trace RX Payload on gNB (msg: GNB_PHY_UL_PAYLOAD_RX_BITS) including UTC time
Log gNB RX Payload for both CRC valid and invalid cases
2025-07-23 11:18:37 +02:00
Abdo-Gaber
e0c5621d60 Add traces on UE PHY UL and related requirement: Tx Scrambled bits and Tx payload bits
- 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.
2025-07-23 11:18:37 +02:00
Abdo-Gaber
8caf326134 Add traces on gNB PHY UL and related requirement: FD PUSH IQ, FD DMRS, and UL Channel estimates wi/wo interpolation
- 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
2025-07-23 11:18:33 +02:00
Jaroslava Fiedlerova
fa9feda58f Merge remote-tracking branch 'origin/rfsim-test-fix' into integration_2025_w30 (!3543)
rfsimulator: fix model name for channel
2025-07-23 11:10:58 +02:00
Jaroslava Fiedlerova
dcdf0d3bb5 Merge remote-tracking branch 'origin/bugfix-RA-Redcap' into integration_2025_w30 (!3542)
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
2025-07-23 11:10:17 +02:00
Jaroslava Fiedlerova
9f5c58f358 Merge remote-tracking branch 'origin/ci-handle-no-artifact' into integration_2025_w30 (!3535)
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.
2025-07-23 11:09:32 +02:00
Jaroslava Fiedlerova
c3cb3c8e91 Merge remote-tracking branch 'origin/ci-t2-dpdk-22.11' into integration_2025_w30 (!3533)
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.
2025-07-23 11:08:53 +02:00
Jaroslava Fiedlerova
2ca61b02f1 Merge remote-tracking branch 'origin/count_bits_with_mask' into integration_2025_w30 (!3532)
Count bits in variable with mask

Adding a function to count bit using a mask to set starting and ending point
in the variable
2025-07-23 11:07:49 +02:00
Jaroslava Fiedlerova
b710b7fd8c Merge remote-tracking branch 'origin/test-ci-extra-pdu-session' into integration_2025_w30 (!3529)
Add CI RFsim5G test for second PDU session

after !3486 (merged), check that a second PDU session works with OAi UE by
pinging through it.
2025-07-23 11:06:53 +02:00
Jaroslava Fiedlerova
c5bc949a96 rfsimulator: fix model name for channel
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>
2025-07-22 18:21:03 +02:00
Jaroslava Fiedlerova
3c03e18c23 CI: move RFSim 4G to acamas 2025-07-22 18:17:58 +02:00
Marius Tillner
693dfb9374 bugfix: avoid segmentation fault when Redcap tries to connect to gNB as NR_ServingCellConfig_t scd is NULL when Redcap does RA 2025-07-22 15:51:01 +02:00
Abdo-Gaber
a942e7e5ab Add log tools to get and process UTC Time during data tracing 2025-07-21 14:25:06 +02:00
Abdo-Gaber
e85b38c5c5 Add new trace messages on UE and gNB
GNB_PHY_UL_FD_PUSCH_IQ,
GNB_PHY_UL_FD_DMRS,
GNB_PHY_UL_FD_CHAN_EST_DMRS_POS,
GNB_PHY_UL_PAYLOAD_RX_BITS,
UE_PHY_UL_SCRAMBLED_TX_BITS,
UE_PHY_UL_PAYLOAD_TX_BITS
2025-07-21 14:22:36 +02:00
Abdo-Gaber
b732c6082f T_tracer Extension to Support up to 35 Parameters in the T() macro 2025-07-21 14:22:29 +02:00
Robert Schmidt
b0a099cc15 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.
2025-07-21 12:18:07 +02:00
francescomani
f33e5cbf13 use function to count number of dmrs symbols 2025-07-21 09:50:44 +02:00
francescomani
1a2a8bb04f replace get_dmrs_symbols_in_slot with new function (does exactly the same) 2025-07-21 09:50:44 +02:00
francescomani
10112332cc function to count bits with a mask for start and stop 2025-07-21 09:50:40 +02:00
Jaroslava Fiedlerova
0079c4613e CI: change frequency for phytests with USRP N310 2025-07-18 17:04:51 +02:00
Robert Schmidt
c9aa985e23 Verify 2nd PDU session is up 2025-07-18 15:52:45 +02:00
Jaroslava Fiedlerova
47d857c919 CI: test T2 with DPDK 22.11
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.
2025-07-18 13:49:30 +02:00
Robert Schmidt
4490571e03 CI 5G RFsim nFAPI u0/25PRB: Add Ping test on second PDU session 2025-07-17 12:24:12 +02:00
Robert Schmidt
fc1c762cf2 Merge branch 'integration_2025_w29' into 'develop'
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
2025-07-17 10:19:17 +00:00
Robert Schmidt
4bfdcc03be Merge remote-tracking branch 'origin/aerial-wnc' into integration_2025_w29 (!3527)
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
2025-07-17 12:17:36 +02:00
Robert Schmidt
c651a648d4 Merge remote-tracking branch 'origin/ci-move-rfsim-to-phaedra' into integration_2025_w29 (!3526)
CI: migrate RFSim5G to acamas machine

Testing on acamas machine done in test pipeline (duplicate of main
RFSim5G pipeline):
https://jenkins-oai.eurecom.fr/job/RAN-RFSim-Test-5G-Acamas/

Sample run: https://jenkins-oai.eurecom.fr/job/RAN-RFSim-Test-5G-Acamas/18/
2025-07-17 12:17:05 +02:00
Reem Bahsoun
fc72ce8753 Add WNC RU in Aerial doc + update cuBB iamge name and number of cores used (related to MR 3477) 2025-07-17 10:41:31 +02:00
Reem Bahsoun
27b86205a2 Add high throuput testing on CI 2025-07-17 10:41:31 +02:00
Reem Bahsoun
fdd29779c6 Change frequency to match the WNC RU range of frequencies 2025-07-17 10:41:25 +02:00
Robert Schmidt
ec2e4c1f01 Merge remote-tracking branch 'origin/extra-pdu-session' into integration_2025_w29 (!3486)
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.
2025-07-17 09:45:08 +02:00
Robert Schmidt
9614bb2cca Merge remote-tracking branch 'origin/develop-measGapConfig' into integration_2025_w29 (!3225)
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.
2025-07-17 09:44:35 +02:00
Jaroslava Fiedlerova
fb6640f0e1 CI: adjust UL throughput target for 2x2 RFSim5G test on acamas
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.
2025-07-16 15:13:12 +00:00
Jaroslava Fiedlerova
7ba7017fb7 CI: add sleep after UE deployment in TDD dora test
Give more time to the gNB-UE to establish the connection before ping
test is triggered.
2025-07-16 15:13:12 +00:00
Jaroslava Fiedlerova
456d7f1aab CI: Increase sleep time in RFSim5G
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.
2025-07-16 15:10:29 +00:00
Robert Schmidt
8c224fde9e Merge remote-tracking branch 'origin/txpdu_dd' into integration_2025_w29 (!3528)
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.
2025-07-16 11:12:24 +02:00
Robert Schmidt
a6b0dcc129 Merge remote-tracking branch 'origin/speedup-nr-rlc-am-rx' into integration_2025_w29 (!3512)
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().
2025-07-16 11:11:55 +02:00
Jaroslava Fiedlerova
cde021e1d9 CI: add SYS_NICE capability in some RFSim5G tests
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.
2025-07-16 08:34:04 +00:00
Jaroslava Fiedlerova
3d270cf627 CI: replace nc by ncat
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.
2025-07-16 08:20:04 +00:00
Robert Schmidt
75ea8cd33a Merge remote-tracking branch 'origin/csi_pdsch_overlap_fix' into integration_2025_w29 (!3510)
NR UE: fix PDSCH overlap with ZP CSI-RS case

When PDSCH overlap with ZP CSI-RS, nb_re_pdsch needs to be reduced by
number of CSI-RS RE.
2025-07-16 08:25:24 +02:00
Robert Schmidt
a1e92cc896 Merge remote-tracking branch 'origin/redcap_support_in_gnb' into integration_2025_w29 (!3515)
Extended changes to "Initial support for RedCap" feature in gNB

Read UE RedCap capabilities.
2025-07-16 08:24:44 +02:00
Bartosz Podrygajlo
5d7c4fe14d NR UE: Enable additional PDU session
Add new command line / config parameter --extra-pdu-id which when
configured creates an extra PDU session.

Rename --default_pdu_id to --default-pdu-id
2025-07-16 06:59:31 +02:00
Bartosz Podrygajlo
7682c407e1 Fix a wraparound bug with equal priority remaining buffer size in MAC 2025-07-16 06:38:37 +02:00
rmagueta
c3f243ca82 Inter-frequency handover documentation update 2025-07-15 16:55:41 +02:00
rmagueta
b443ec4c52 Get measurement of neighboring cells and measurement gaps working after RRCReestablishment 2025-07-15 16:55:41 +02:00
rmagueta
779d2bee52 Get new measConfig and measurementTimingConfiguration for target gNB-DU during handover 2025-07-15 16:55:41 +02:00
rmagueta
d5b9f81285 Send MeasConfig to DU, Receive MeasGapConfig from DU 2025-07-15 16:55:36 +02:00
Robert Schmidt
6c4f6a231e Merge remote-tracking branch 'origin/fix-rfsim-multi-client-out-of-order' into integration_2025_w29 (!3455)
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
2025-07-15 15:44:50 +02:00
Robert Schmidt
c6876ea9f0 Merge remote-tracking branch 'origin/fapi-wls-integration' into integration_2025_w29 (!3346)
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.
2025-07-15 15:44:02 +02:00
fatich
5c52f6dc23 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.
2025-07-15 15:32:00 +02:00
Rúben Soares Silva
d74c620956 Set PNF slot_ahead to 1 when using WLS as the transport mechanism 2025-07-15 13:00:03 +01:00
Rúben Soares Silva
d4c46c5073 Fix compilation for simulators and LTE softmodem
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
2025-07-15 13:00:03 +01:00
Rúben Soares Silva
8d7f2a8fbd Add documentation for different VNF/PNF transport
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
2025-07-15 13:00:03 +01:00
Rajesh Guttula
74a34daf5b Extnded changes to "Initial support for RedCap" feature in gNB
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.
2025-07-15 13:47:30 +02:00
alexjiao
dddf34ac9b Fix PDSCH overlap with ZP CSI-RS case
When PDSCH overlap with ZP CSI-RS, nb_re_pdsch needs to be reduced by number of CSI-RS RE.
2025-07-12 10:29:57 +08:00
rmagueta
5e0307d845 Refactor code, add inter-freq neighbors, avoid mem leak
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.
2025-07-11 18:09:23 +01:00
rmagueta
6ce4d78c19 Refactor get_MeasConfig(): create subfunctions 2025-07-11 18:09:23 +01:00
rmagueta
932b177667 Add logic for measgap scheduling 2025-07-11 18:09:23 +01:00
rmagueta
dfbb6b1509 Handle Measurement Timing Configuration in DU/MAC handler 2025-07-11 14:08:52 +01:00
rmagueta
c2d9fb3589 Add MeasGap Configuration in Radio config
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.
2025-07-11 14:08:01 +01:00
rmagueta
7b8427e101 UE RRC: Print warning that measurement gaps are not supported 2025-07-11 13:46:21 +01:00
rmagueta
a13a8f01af Add F1AP procedures related to measurementTimingConfiguration 2025-07-11 13:46:21 +01:00
Robert Schmidt
621aa3c12e Cleanup possible transmission interrupt states 2025-07-11 13:46:21 +01:00
Jaroslava Fiedlerova
625c8cfd51 CI: move RFSim 5G to acamas 2025-07-11 09:59:37 +00:00
Rúben Soares Silva
43c733dc89 Prevent pulling TLV tag and length over end of the buffer.
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
2025-07-11 10:01:26 +01:00
Rúben Soares Silva
1026b8121f Add VNF callback for ERROR.indication
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.
2025-07-11 10:01:26 +01:00
Rúben Soares Silva
b8a176e38f Use existing VNF functions for P7 messages
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
2025-07-11 10:01:26 +01:00
Rúben Soares Silva
0c21807df9 Change Aerial VNF to use existing functions to process P5 messages
Remove fapi_vnf_p5.c and .h files as they're now unused

Move scheduler functions to fapi_nvIPC.c
2025-07-11 10:01:26 +01:00
Rúben Soares Silva
a340d08bd2 Initial refactoring for P5 messages in Aerial VNF 2025-07-11 10:01:26 +01:00
Rúben Soares Silva
6d05d279b0 Implementation of VNF using WLS as message transport
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
2025-07-11 10:01:26 +01:00
Rúben Soares Silva
3d34917626 Implementation of PNF using WLS as message transport
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
2025-07-11 10:01:26 +01:00
Jaroslava Fiedlerova
e82fde247a Merge branch 'integration_2025_w28' into 'develop'
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
2025-07-11 08:03:04 +00:00
Sakthivel Velumani
7feaea00c2 Fix counting error bits in nr_dlsim
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.
2025-07-10 20:44:23 -04:00
Sakthivel Velumani
abe25a52b3 Fix alignment of LLR buffer in UE 2025-07-10 17:36:02 -04:00
Jaroslava Fiedlerova
bc626c3234 Merge remote-tracking branch 'origin/oran_fhi_f_dpdk_21_plus' into integration_2025_w28 (!3504)
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.
2025-07-09 17:36:18 +02:00
Romain Beurdouche
8e33727c37 feat(oran_fhlib_5g): pkgconfig fix for E release
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.
2025-07-09 14:55:44 +02:00
Romain Beurdouche
486726233d feat(oran_fhlib_5g): Enable to include a BBDEV device while initializing EAL
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.
2025-07-09 14:55:44 +02:00
Romain Beurdouche
d3283c4819 feat(oran_fhlib_5g): F release works with DPDK21+
Modify xran F release patch to make it compile and run with DPDK 21+
(tested with DPDK 22.11)
2025-07-09 14:55:44 +02:00
Robert Schmidt
02bc14d8c1 get xran stats
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>
2025-07-09 14:55:44 +02:00
Robert Schmidt
b7a6b1b7d6 Do not include xran internal data: not needed 2025-07-09 14:55:44 +02:00
Robert Schmidt
cc076eb547 Use locally available data instead of peaking into xran internals
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>
2025-07-09 14:54:52 +02:00
Romain Beurdouche
42b5df351d Split out PRACH-specific functions into separate header
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.
2025-07-09 14:49:03 +02:00
Jaroslava Fiedlerova
dc2e127c1c Merge remote-tracking branch 'origin/bugfix-ambr-is-optional' into integration_2025_w28 (!3498)
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.)
2025-07-09 11:08:25 +02:00
Robert Schmidt
8dcdee85f7 Use buffers as set up by driver
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.
2025-07-09 08:12:48 +00:00
Robert Schmidt
3e3d872268 Avoid use of xran_get_slot_idx_from_tti() and use public API
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.
2025-07-09 08:12:48 +00:00
Rúben Soares Silva
9b71f1d324 Separate VNF socket send functions into separate socket library 2025-07-08 16:42:34 +01:00
Jaroslava Fiedlerova
d71e333329 Merge branch 'ci-rfsim5g-fix' into 'develop' (!3517)
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
2025-07-08 15:05:31 +00:00
Jaroslava Fiedlerova
4a169f6c8a Update documentation for RFSim5G test deployments 2025-07-08 14:05:38 +02:00
Jaroslava Fiedlerova
67474f2246 Merge remote-tracking branch 'origin/issue_975' into integration_2025_w28 (!3503)
DLSCH RB extraction: check DMRS bitmap only in DMRS symbols

Closes #975
2025-07-08 11:37:52 +02:00
Jaroslava Fiedlerova
6ff8d085fb Merge remote-tracking branch 'origin/fix-sss-detection' into integration_2025_w28 (!3501)
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.
2025-07-08 11:36:46 +02:00
Jaroslava Fiedlerova
8ef0bf8462 CI: specify interface names in UPF container 2025-07-08 11:11:58 +02:00
Cedric Roux
080a90c930 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.)
2025-07-08 10:55:34 +02:00
Laurent THOMAS
90cf249018 add telnet commands trace 2025-07-04 09:34:17 +02:00
Cedric Roux
c70e336011 nr rlc: speedup RX path of RLC 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().
2025-07-03 18:57:32 +02:00
Cedric Roux
2b4eb2fb55 nr rlc: discarding a packet when RX buffer is full is a warning
We want to see it. It's not normal, may disturb the system.
2025-07-03 18:46:09 +02:00
Cedric Roux
708dca1ab9 fix compilation of nr rlc tests
./run_tests.sh in openair2/LAYER2/nr_rlc/tests was not functional anymore.
2025-07-03 18:42:30 +02:00
francescomani
d868e2d7cc DLSCH RB extraction bugfix: check DMRS bitmap only in DMRS symbols 2025-06-30 14:50:43 +02:00
Laurent THOMAS
0523bcfbde fix gNB that should always perform tx in case of rfsim (like continuous-tx 2025-06-30 10:21:02 +02:00
Laurent THOMAS
1540ca3ae5 fix bug in rfsim->nb_cnx for client side. it has no usage except a cpu optimisation in case one single rfsim socket and SISO case 2025-06-30 09:06:28 +02:00
Laurent THOMAS
f7598bf528 clarify first transmission to client, split process_recv in 2 functions 2025-06-30 09:06:28 +02:00
Laurent THOMAS
68857114a6 split rfsimulator too long function in smaller ones. Clean code for bad "UE" instead of rfsim client/server. Simplify logic 2025-06-30 09:06:28 +02:00
Laurent THOMAS
b9c066329e trace in 4G RAR processing to debug ci result 2025-06-30 09:06:28 +02:00
Laurent THOMAS
98e6d60337 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.

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.
2025-06-30 09:06:28 +02:00
Laurent THOMAS
fb85a8cda3 clarify and indent correctly the function initial sync 2025-06-27 15:21:47 +02:00
Laurent THOMAS
10ff80815f when we try to detect a specific PCI, and it fails, the SSS detection return successful detection, with wrong frequency offset 2025-06-27 15:21:13 +02:00
Rúben Soares Silva
bfaec58ca5 Separate PNF socket send functions into separate socket library 2025-06-27 09:56:46 +01:00
Rúben Soares Silva
f986f6843a Fix non-SCTP socket communication for P5 messages between PNF and VNF.
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
2025-06-26 16:57:08 +01:00
Rúben Soares Silva
ca940e62f9 Add default PNF timing_info value for when the TLV is not sent
Intended to allow FAPI PNF to work without this nFAPI TLV being sent
2025-06-26 16:57:08 +01:00
Rúben Soares Silva
471b563ac7 Add send function pointers to PNF 2025-06-26 16:57:08 +01:00
Rúben Soares Silva
52a0ceac04 Add send function pointers to VNF 2025-06-26 16:57:08 +01:00
Rúben Soares Silva
2089655a97 Change VNF to use functions pointers to pack/unpack messages.
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.
2025-06-26 16:57:08 +01:00
Rúben Soares Silva
00b5eba192 Change PNF to use functions pointers to pack/unpack messages.
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
2025-06-26 16:57:08 +01:00
Rúben Soares Silva
1ea164468f Refactor fapi_nr_p5_message_unpack to have the same signature as nfapi_nr_p5_message_header_unpack.
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.
2025-06-26 16:57:08 +01:00
Rúben Soares Silva
d66986a23f Use P5 copy function for config.request instead of memcpy 2025-06-26 16:57:08 +01:00
315 changed files with 16927 additions and 5857 deletions

1
.gitignore vendored
View File

@@ -5,7 +5,6 @@
cmake_targets/log/
cmake_targets/*/build/
cmake_targets/ran_build/
cmake_targets/nas_sim_tools/build/
log/
lte_build_oai/

View File

@@ -172,7 +172,7 @@ else ()
endif()
# add autotools definitions that were maybe used!
add_definitions("-DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_FCNTL_H=1 -DHAVE_ARPA_INET_H=1 -DHAVE_SYS_TIME_H=1 -DHAVE_SYS_SOCKET_H=1 -DHAVE_STRERROR=1 -DHAVE_SOCKET=1 -DHAVE_MEMSET=1 -DHAVE_GETTIMEOFDAY=1 -DHAVE_STDLIB_H=1 -DHAVE_MALLOC=1 -DHAVE_LIBSCTP")
add_definitions(-DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_FCNTL_H=1 -DHAVE_ARPA_INET_H=1 -DHAVE_SYS_TIME_H=1 -DHAVE_SYS_SOCKET_H=1 -DHAVE_STRERROR=1 -DHAVE_SOCKET=1 -DHAVE_MEMSET=1 -DHAVE_GETTIMEOFDAY=1 -DHAVE_STDLIB_H=1 -DHAVE_MALLOC=1 -DHAVE_LIBSCTP)
# we need -rdynamic to incorporate all symbols in shared objects, see man page
set(commonOpts "-pipe -fPIC -Wall -fno-strict-aliasing -rdynamic")
@@ -715,6 +715,11 @@ add_library(NFAPI_LIB ${NFAPI_SRC})
target_link_libraries(NFAPI_LIB PUBLIC nfapi_common)
target_link_libraries(NFAPI_LIB PUBLIC nr_fapi_p5 nr_fapi_p7)
if(OAI_WLS)
target_compile_definitions(NFAPI_LIB PRIVATE ENABLE_WLS)
else()
target_compile_definitions(NFAPI_LIB PRIVATE ENABLE_SOCKET)
endif()
include_directories(${NFAPI_DIR}/nfapi/public_inc)
include_directories(${NFAPI_DIR}/nfapi/inc)
@@ -728,6 +733,9 @@ add_library(NFAPI_PNF_LIB ${NFAPI_PNF_SRC})
target_link_libraries(NFAPI_PNF_LIB PRIVATE asn1_lte_rrc_hdrs asn1_nr_rrc_hdrs)
target_link_libraries(NFAPI_PNF_LIB PUBLIC nr_fapi_p7)
if(OAI_WLS)
target_compile_definitions(NFAPI_PNF_LIB PRIVATE ENABLE_WLS)
endif()
include_directories(${NFAPI_DIR}/pnf/public_inc)
include_directories(${NFAPI_DIR}/pnf/inc)
@@ -746,6 +754,9 @@ endif()
include_directories(${NFAPI_DIR}/vnf/public_inc)
include_directories(${NFAPI_DIR}/vnf/inc)
if(OAI_WLS)
target_compile_definitions(NFAPI_VNF_LIB PRIVATE ENABLE_WLS)
endif()
# nFAPI user defined code
#############################
set(NFAPI_USER_SRC
@@ -755,11 +766,15 @@ set(NFAPI_USER_SRC
${NFAPI_USER_DIR}/gnb_ind_vars.c
)
add_library(NFAPI_USER_LIB ${NFAPI_USER_SRC})
if(OAI_WLS)
target_compile_definitions(NFAPI_USER_LIB PRIVATE ENABLE_WLS)
elseif (OAI_AERIAL)
target_compile_definitions(NFAPI_USER_LIB PRIVATE ENABLE_AERIAL)
else()
target_compile_definitions(NFAPI_USER_LIB PRIVATE ENABLE_SOCKET)
endif()
target_link_libraries(NFAPI_USER_LIB PRIVATE asn1_lte_rrc_hdrs asn1_nr_rrc_hdrs UTIL)
target_link_libraries(NFAPI_USER_LIB PRIVATE nr_fapi_p7)
if(OAI_AERIAL)
target_compile_definitions(NFAPI_USER_LIB PRIVATE ENABLE_AERIAL)
endif()
include_directories(${NFAPI_USER_DIR})
# Layer 1
@@ -833,6 +848,7 @@ set(PHY_SRC_COMMON
${OPENAIR1_DIR}/PHY/TOOLS/sqrt.c
${OPENAIR1_DIR}/PHY/TOOLS/get_sin_cos.c
${OPENAIR1_DIR}/PHY/TOOLS/oai_arith_operations.c
${OPENAIR1_DIR}/PHY/log_tools.c
)
set(PHY_SRC
@@ -1047,7 +1063,7 @@ add_library(PHY_NR_COMMON ${PHY_NR_SRC_COMMON})
target_link_libraries(PHY_NR_COMMON PUBLIC UTIL)
add_library(PHY_NR ${PHY_NR_SRC})
target_link_libraries(PHY_NR nr_phy_common nr_common)
target_link_libraries(PHY_NR nr_phy_common nr_common nr_fapi_p5)
add_library(PHY_NR_NO_AVX_256 ${PHY_NR_SRC})
target_link_libraries(PHY_NR_NO_AVX_256 nr_phy_common nr_common)
@@ -1839,6 +1855,12 @@ target_link_libraries(nr-softmodem PRIVATE pthread m CONFIG_LIB rt sctp)
target_link_libraries(nr-softmodem PRIVATE ${T_LIB})
target_link_libraries(nr-softmodem PRIVATE asn1_nr_rrc_hdrs asn1_lte_rrc_hdrs)
target_link_libraries(nr-softmodem PRIVATE asn1_nr_rrc_hdrs asn1_lte_rrc_hdrs)
add_boolean_option(OAI_WLS OFF "Activate OAI's WLS driver" OFF)
if (OAI_WLS)
target_link_libraries(nr-softmodem PUBLIC wls_integration_lib)
else()
target_link_libraries(nr-softmodem PUBLIC nfapi_socket_lib)
endif()
add_boolean_option(OAI_AERIAL OFF "Activate OAI's AERIAL driver" OFF)
if (OAI_AERIAL)
target_compile_definitions(nr-softmodem PUBLIC ENABLE_AERIAL)

View File

@@ -835,11 +835,13 @@ def finalizeSlaveJob(jobName) {
selector: lastCompleted())
if (fileExists(fileName)) {
sh "sed -i -e 's#TEMPLATE_BUILD_TIME#${JOB_TIMESTAMP}#' ${fileName}"
archiveArtifacts artifacts: fileName
// BUILD_URL is like http://server:port/jenkins/job/foo/15/
// no need to add a prefixed '/'
artifactUrl += 'artifact/' + fileName
} else {
sh "echo \"could not copy results from ${jobName}, please check pipeline ${BUILD_URL}\" > ${fileName}"
}
archiveArtifacts artifacts: fileName
// BUILD_URL is like http://server:port/jenkins/job/foo/15/
// no need to add a prefixed '/'
artifactUrl += 'artifact/' + fileName
}
artifactUrl = "\n * [${jobName}](${artifactUrl})"
return artifactUrl

View File

@@ -5,7 +5,7 @@
{
#define N_ANTENNA_DL 1
#define N_ANTENNA_UL 1
#define DL_ARFCN 631296
#define DL_ARFCN 627360
#define TDD 1
log_options: "all.level=debug,all.max_size=0,nas.level=debug,nas.max_size=1,rrc.level=debug,rrc.max_size=1",

View File

@@ -147,12 +147,12 @@ ltebox-nepes:
amarisoft_ue:
Host: amariue
InitScript: /root/lteue-linux-2025-03-15/lteue /root/oaicicd/ran_sa_aw2s_asue/aw2s-multi-00102-20.cfg &
InitScript: /root/lteue-linux-2025-03-15/lteue /root/oaicicd/ran_sa_aw2s_asue_20MHz/aw2s-multi-00102-20.cfg &
TermScript: /root/lteue-linux-2025-03-15/ws.js -t 10 127.0.0.1:9002 '{"message":"quit"}' || killall -KILL lteue-avx2
NetworkScript: ip netns exec ue1 ip a show dev pdn0
amarisoft_ue_2x2:
Host: amariue
InitScript: /root/lteue-linux-2025-03-15/lteue /root/oaicicd/ran_sa_aw2s_asue_2x2/aw2s-multi-00102-2x2-v2.cfg &
InitScript: /root/lteue-linux-2025-03-15/lteue /root/oaicicd/ran_sa_aw2s_asue_20MHz_2x2/aw2s-multi-00102-2x2-v2.cfg &
TermScript: /root/lteue-linux-2025-03-15/ws.js -t 10 127.0.0.1:9002 '{"message":"quit"}' || killall -KILL lteue-avx2
NetworkScript: ip netns exec ue1 ip a show dev pdn0
amarisoft_ue_fhi72:
@@ -301,6 +301,15 @@ rfsim5g_ue:
AttachScript: docker start rfsim5g-oai-nr-ue
DetachScript: docker stop rfsim5g-oai-nr-ue
MTU: 1500
# for tests with second PDU session ID 2, needs to match requested PDU session name
rfsim5g_ue_pdu_2:
Host: "%%current_host%%"
NetworkScript: docker exec rfsim5g-oai-nr-ue ip a show dev oaitun_ue1p2
CmdPrefix: docker exec rfsim5g-oai-nr-ue
IF: oaitun_ue1p2
AttachScript: docker start rfsim5g-oai-nr-ue
DetachScript: docker stop rfsim5g-oai-nr-ue
MTU: 1500
rfsim5g_ue2:
Host: "%%current_host%%"

View File

@@ -30,6 +30,7 @@ import cls_analysis
import constants as CONST
LOG_PATH_PHYSIM = 'phy_sim_logs'
DPDK_PATH = '/opt/dpdk-t2-22.11.0'
class Native():
@@ -39,7 +40,7 @@ class Native():
with cls_cmd.getConnection(host) as ssh:
base = f"{directory}/cmake_targets"
ret = ssh.run(f"{base}/build_oai {options} > {base}/log/build_oai.log", timeout=900)
ret = ssh.run(f"C_INCLUDE_PATH={DPDK_PATH}/include/ PKG_CONFIG_PATH={DPDK_PATH}/lib64/pkgconfig/ {base}/build_oai {options} > {base}/log/build_oai.log", timeout=900)
success = ret.returncode == 0
logs = ssh.run(f"cat {base}/log/build_oai.log", silent=True)
logging.debug(f"build finished with code {ret.returncode}, output:\n{logs.stdout}")
@@ -73,7 +74,7 @@ class Native():
os.system(f'mkdir -p ./{LOG_PATH_PHYSIM}')
runLogFile=f'physim_{HTML.testCase_id}.log'
with cls_cmd.getConnection(host) as cmd:
cmd.run(f'sudo {workSpacePath}/ran_build/build/{physim_test} {options} >> {workSpacePath}/{runLogFile}')
cmd.run(f'sudo LD_LIBRARY_PATH=.:{DPDK_PATH}/lib64/ {workSpacePath}/ran_build/build/{physim_test} {options} >> {workSpacePath}/{runLogFile}')
cmd.copyin(src=f'{workSpacePath}/{runLogFile}', tgt=f'{LOG_PATH_PHYSIM}/{runLogFile}')
success, msg = cls_analysis.Analysis.analyze_physim(f'{LOG_PATH_PHYSIM}/{runLogFile}', physim_test, options, threshold)
if success:

View File

@@ -34,11 +34,9 @@ gNBs =
# downlinkConfigCommon
#frequencyInfoDL
# this is 3600 MHz + 43 PRBs@30kHz SCS (same as initial BWP)
absoluteFrequencySSB = 641280;
absoluteFrequencySSB = 641280; # GSCN: 7929, Freq: 3619.200 MHz
dl_frequencyBand = 78;
# this is 3600 MHz
dl_absoluteFrequencyPointA = 640008;
dl_absoluteFrequencyPointA = 640752; # 3611.280 MHz
#scs-SpecificCarrierList
dl_offstToCarrier = 0;
# subcarrierSpacing
@@ -47,13 +45,12 @@ gNBs =
dl_carrierBandwidth = 106;
#initialDownlinkBWP
#genericParameters
# this is RBstart=27,L=48 (275*(L-1))+RBstart
initialDLBWPlocationAndBandwidth = 28875; # 6366 12925 12956 28875 12952
initialDLBWPlocationAndBandwidth = 13750; # RBstart=0, L=51 (275*(L-1))+RBstart
# subcarrierSpacing
# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
initialDLBWPsubcarrierSpacing = 1;
#pdcch-ConfigCommon
initialDLBWPcontrolResourceSetZero = 12;
initialDLBWPcontrolResourceSetZero = 10;
initialDLBWPsearchSpaceZero = 0;
#uplinkConfigCommon
@@ -68,7 +65,7 @@ gNBs =
pMax = 20;
#initialUplinkBWP
#genericParameters
initialULBWPlocationAndBandwidth = 28875;
initialULBWPlocationAndBandwidth = 13750; # RBstart=0, L=51 (275*(L-1))+RBstart
# subcarrierSpacing
# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
initialULBWPsubcarrierSpacing = 1;
@@ -152,6 +149,18 @@ gNBs =
);
servingCellConfigDedicated = ({
dl_bwp-Id_1 = 1;
dl_bwp1_locationAndBandwidth = 28875; # RBstart=0, L=106 (275*(L-1))+RBstart
dl_bwp1_subcarrierSpacing = 1;
firstActiveDownlinkBWP-Id = 1;
defaultDownlinkBWP-Id = 1;
ul_bwp-Id_1 = 1;
ul_bwp1_locationAndBandwidth = 28875; # RBstart=0, L=106 (275*(L-1))+RBstart
ul_bwp1_subcarrierSpacing = 1;
firstActiveUplinkBWP-Id = 1;
});
# ------- SCTP definitions
SCTP :

View File

@@ -43,19 +43,12 @@ gNBs =
# downlinkConfigCommon
#frequencyInfoDL
# this is 3300.24 + 134*12*30e3 = 3348.48 MHz (5G NR GSCN: 7741)
absoluteFrequencySSB = 649920;
#652860; #should be 649920
#647520;
#647540;
#649920;
#650208;
#647540;
# center frequency = 3350.01 MHz
# selected SSB frequency = 3349.92 MHz
absoluteFrequencySSB = 623328;
dl_frequencyBand = 78;
# this is 3300.24 MHz
dl_absoluteFrequencyPointA = 646724;
#649104;
#646724;
# frequency point A = 3300.87 MHz
dl_absoluteFrequencyPointA = 620058;
#scs-SpecificCarrierList
dl_offstToCarrier = 0;
# subcarrierSpacing

View File

@@ -31,11 +31,11 @@ gNBs =
# downlinkConfigCommon
#frequencyInfoDL
# this is 3319.68 MHz
absoluteFrequencySSB = 621312;
dl_frequencyBand = 78;
# this is 3300.6 MHz
dl_absoluteFrequencyPointA = 620040;
# this is 4412.64 MHz
absoluteFrequencySSB = 694176;
dl_frequencyBand = 79;
# this is 4400.94 MHz
dl_absoluteFrequencyPointA = 693396;
#scs-SpecificCarrierList
dl_offstToCarrier = 0;
# subcarrierSpacing
@@ -55,7 +55,7 @@ gNBs =
#uplinkConfigCommon
#frequencyInfoUL
ul_frequencyBand = 78;
ul_frequencyBand = 79;
#scs-SpecificCarrierList
ul_offstToCarrier = 0;
# subcarrierSpacing

View File

@@ -31,11 +31,11 @@ gNBs =
# downlinkConfigCommon
#frequencyInfoDL
# this is 3600 MHz + 43 PRBs@30kHz SCS (same as initial BWP)
absoluteFrequencySSB = 621312;
dl_frequencyBand = 78;
# this is 3600 MHz
dl_absoluteFrequencyPointA = 620040;
# this is 4435.68 MHz
absoluteFrequencySSB = 695712;
dl_frequencyBand = 79;
# this is 4400.94 MHz
dl_absoluteFrequencyPointA = 693396;
#scs-SpecificCarrierList
dl_offstToCarrier = 0;
# subcarrierSpacing
@@ -55,7 +55,7 @@ gNBs =
#uplinkConfigCommon
#frequencyInfoUL
ul_frequencyBand = 78;
ul_frequencyBand = 79;
#scs-SpecificCarrierList
ul_offstToCarrier = 0;
# subcarrierSpacing

View File

@@ -33,11 +33,11 @@ gNBs =
# downlinkConfigCommon
#frequencyInfoDL
# this is 3600 MHz + 43 PRBs@30kHz SCS (same as initial BWP)
absoluteFrequencySSB = 621312;
dl_frequencyBand = 78;
# this is 3600 MHz
dl_absoluteFrequencyPointA = 620040;
# this is 4458.72 MHz
absoluteFrequencySSB = 697248;
dl_frequencyBand = 79;
# this is 4400.94 MHz
dl_absoluteFrequencyPointA = 693396;
#scs-SpecificCarrierList
dl_offstToCarrier = 0;
# subcarrierSpacing
@@ -57,7 +57,7 @@ gNBs =
#uplinkConfigCommon
#frequencyInfoUL
ul_frequencyBand = 78;
ul_frequencyBand = 79;
#scs-SpecificCarrierList
ul_offstToCarrier = 0;
# subcarrierSpacing

View File

@@ -175,10 +175,10 @@ MACRLCs = ({
tr_n_preference = "local_RRC";
pusch_TargetSNRx10 = 200;
pucch_TargetSNRx10 = 200;
set_analog_beamforming = 1;
set_timedomain_beamforming = 1;
beam_duration = 1;
beams_per_period = 1;
beam_weights = [0]; // single SSB -> one analog beam
beam_weights = [0]; // single SSB -> one TD beam
});
L1s = (

View File

@@ -35,8 +35,8 @@ gNBs =
# downlinkConfigCommon
#frequencyInfoDL
dl_frequencyBand = 78;
absoluteFrequencySSB = 634080;
dl_absoluteFrequencyPointA = 632808;
absoluteFrequencySSB = 628320;
dl_absoluteFrequencyPointA = 627062;
#scs-SpecificCarrierList
dl_offstToCarrier = 0;
# subcarrierSpacing
@@ -197,7 +197,7 @@ RUs = (
local_rf = "yes";
nb_tx = 1;
nb_rx = 1;
att_tx = 0;
att_tx = 10;
att_rx = 0;
bands = [78];
max_pdschReferenceSignalPower = -27;

View File

@@ -34,11 +34,11 @@ gNBs =
# downlinkConfigCommon
#frequencyInfoDL
# this is 3469.44 MHz => 301 REs from PointA 25 PRBs + 1 RE
absoluteFrequencySSB = 631296;
# this is 3410.400 MHz
absoluteFrequencySSB = 627360;
dl_frequencyBand = 78;
# this is 3469.44 - (51*12*30e-3/2) = 3460.26 MHz
dl_absoluteFrequencyPointA = 630684;
# this is 3401.220 MHz
dl_absoluteFrequencyPointA = 626748;
#scs-SpecificCarrierList
dl_offstToCarrier = 0;
# subcarrierSpacing

View File

@@ -108,16 +108,16 @@
<class>Attach_UE</class>
<desc>Attach OAI UE (Wait for IP)</desc>
<id>rfsim4g_ue</id>
<nodes>cacofonix</nodes>
<nodes>acamas</nodes>
</testCase>
<testCase id="020011">
<class>Ping</class>
<desc>Ping Traffic-Gen from LTE-UE</desc>
<id>rfsim4g_ue</id>
<nodes>cacofonix</nodes>
<nodes>acamas</nodes>
<svr_id>rfsim4g_ext_dn</svr_id>
<svr_node>cacofonix</svr_node>
<svr_node>acamas</svr_node>
<ping_args>-c 20</ping_args>
<ping_packetloss_threshold>5</ping_packetloss_threshold>
</testCase>
@@ -126,9 +126,9 @@
<class>Ping</class>
<desc>Ping LTE-UE from Traffic-Gen</desc>
<id>rfsim4g_ext_dn</id>
<nodes>cacofonix</nodes>
<nodes>acamas</nodes>
<svr_id>rfsim4g_ue</svr_id>
<svr_node>cacofonix</svr_node>
<svr_node>acamas</svr_node>
<ping_args>-c 20</ping_args>
<ping_packetloss_threshold>5</ping_packetloss_threshold>
</testCase>
@@ -141,8 +141,8 @@
<iperf_args>-u -t 30 -b 2M -R</iperf_args>
<iperf_packetloss_threshold>25</iperf_packetloss_threshold>
<iperf_bitrate_threshold>80</iperf_bitrate_threshold>
<nodes>cacofonix</nodes>
<svr_node>cacofonix</svr_node>
<nodes>acamas</nodes>
<svr_node>acamas</svr_node>
</testCase>
<testCase id="030011">
@@ -153,8 +153,8 @@
<iperf_args>-u -t 30 -b 1M</iperf_args>
<iperf_packetloss_threshold>25</iperf_packetloss_threshold>
<iperf_bitrate_threshold>80</iperf_bitrate_threshold>
<nodes>cacofonix</nodes>
<svr_node>cacofonix</svr_node>
<nodes>acamas</nodes>
<svr_node>acamas</svr_node>
</testCase>
<testCase id="100011">

View File

@@ -86,9 +86,9 @@
<class>Ping</class>
<desc>Ping Traffic-Gen from LTE-UE</desc>
<id>rfsim4g_ue</id>
<nodes>cacofonix</nodes>
<nodes>acamas</nodes>
<svr_id>rfsim4g_enb_nos1</svr_id>
<svr_node>cacofonix</svr_node>
<svr_node>acamas</svr_node>
<ping_args>-c 20</ping_args>
<ping_packetloss_threshold>5</ping_packetloss_threshold>
</testCase>
@@ -97,9 +97,9 @@
<class>Ping</class>
<desc>Ping LTE-UE from eNB</desc>
<id>rfsim4g_enb_nos1</id>
<nodes>cacofonix</nodes>
<nodes>acamas</nodes>
<svr_id>rfsim4g_ue</svr_id>
<svr_node>cacofonix</svr_node>
<svr_node>acamas</svr_node>
<ping_args>-c 20</ping_args>
<ping_packetloss_threshold>5</ping_packetloss_threshold>
</testCase>
@@ -108,9 +108,9 @@
<class>Iperf</class>
<desc>Iperf UDP DL</desc>
<id>rfsim4g_ue</id>
<nodes>cacofonix</nodes>
<nodes>acamas</nodes>
<svr_id>rfsim4g_enb_nos1</svr_id>
<svr_node>cacofonix</svr_node>
<svr_node>acamas</svr_node>
<iperf_args>-u -t 30 -b 2M -R</iperf_args>
<iperf_packetloss_threshold>25</iperf_packetloss_threshold>
<iperf_bitrate_threshold>80</iperf_bitrate_threshold>
@@ -120,9 +120,9 @@
<class>Iperf</class>
<desc>Iperf UDP UL</desc>
<id>rfsim4g_ue</id>
<nodes>cacofonix</nodes>
<nodes>acamas</nodes>
<svr_id>rfsim4g_enb_nos1</svr_id>
<svr_node>cacofonix</svr_node>
<svr_node>acamas</svr_node>
<iperf_args>-u -t 30 -b 1M</iperf_args>
<iperf_packetloss_threshold>25</iperf_packetloss_threshold>
<iperf_bitrate_threshold>80</iperf_bitrate_threshold>

View File

@@ -108,16 +108,16 @@
<class>Attach_UE</class>
<desc>Attach OAI UE (Wait for IP)</desc>
<id>rfsim4g_ue</id>
<nodes>cacofonix</nodes>
<nodes>acamas</nodes>
</testCase>
<testCase id="020011">
<class>Ping</class>
<desc>Ping Traffic-Gen from LTE-UE</desc>
<id>rfsim4g_ue</id>
<nodes>cacofonix</nodes>
<nodes>acamas</nodes>
<svr_id>rfsim4g_ext_dn</svr_id>
<svr_node>cacofonix</svr_node>
<svr_node>acamas</svr_node>
<ping_args>-c 20</ping_args>
<ping_packetloss_threshold>5</ping_packetloss_threshold>
</testCase>
@@ -126,9 +126,9 @@
<class>Ping</class>
<desc>Ping LTE-UE from Traffic-Gen</desc>
<id>rfsim4g_ext_dn</id>
<nodes>cacofonix</nodes>
<nodes>acamas</nodes>
<svr_id>rfsim4g_ue</svr_id>
<svr_node>cacofonix</svr_node>
<svr_node>acamas</svr_node>
<ping_args>-c 20</ping_args>
<ping_packetloss_threshold>5</ping_packetloss_threshold>
</testCase>
@@ -137,9 +137,9 @@
<class>Iperf</class>
<desc>Iperf UDP DL</desc>
<id>rfsim4g_ue</id>
<nodes>cacofonix</nodes>
<nodes>acamas</nodes>
<svr_id>rfsim4g_ext_dn</svr_id>
<svr_node>cacofonix</svr_node>
<svr_node>acamas</svr_node>
<iperf_args>-u -t 30 -b 2M -R</iperf_args>
<iperf_packetloss_threshold>25</iperf_packetloss_threshold>
<iperf_bitrate_threshold>80</iperf_bitrate_threshold>
@@ -149,9 +149,9 @@
<class>Iperf</class>
<desc>Iperf UDP UL</desc>
<id>rfsim4g_ue</id>
<nodes>cacofonix</nodes>
<nodes>acamas</nodes>
<svr_id>rfsim4g_ext_dn</svr_id>
<svr_node>cacofonix</svr_node>
<svr_node>acamas</svr_node>
<iperf_args>-u -t 30 -b 1M</iperf_args>
<iperf_packetloss_threshold>25</iperf_packetloss_threshold>
<iperf_bitrate_threshold>80</iperf_bitrate_threshold>

View File

@@ -108,16 +108,16 @@
<class>Attach_UE</class>
<desc>Attach OAI UE (Wait for IP)</desc>
<id>rfsim4g_ue</id>
<nodes>cacofonix</nodes>
<nodes>acamas</nodes>
</testCase>
<testCase id="020011">
<class>Ping</class>
<desc>Ping Traffic-Gen from LTE-UE</desc>
<id>rfsim4g_ue</id>
<nodes>cacofonix</nodes>
<nodes>acamas</nodes>
<svr_id>rfsim4g_ext_dn</svr_id>
<svr_node>cacofonix</svr_node>
<svr_node>acamas</svr_node>
<ping_args>-c 20</ping_args>
<ping_packetloss_threshold>5</ping_packetloss_threshold>
</testCase>
@@ -126,9 +126,9 @@
<class>Ping</class>
<desc>Ping LTE-UE from Traffic-Gen</desc>
<id>rfsim4g_ext_dn</id>
<nodes>cacofonix</nodes>
<nodes>acamas</nodes>
<svr_id>rfsim4g_ue</svr_id>
<svr_node>cacofonix</svr_node>
<svr_node>acamas</svr_node>
<ping_args>-c 20</ping_args>
<ping_packetloss_threshold>5</ping_packetloss_threshold>
</testCase>
@@ -137,9 +137,9 @@
<class>Iperf</class>
<desc>Iperf UDP DL</desc>
<id>rfsim4g_ue</id>
<nodes>cacofonix</nodes>
<nodes>acamas</nodes>
<svr_id>rfsim4g_ext_dn</svr_id>
<svr_node>cacofonix</svr_node>
<svr_node>acamas</svr_node>
<iperf_args>-u -t 30 -b 2M -R</iperf_args>
<iperf_packetloss_threshold>25</iperf_packetloss_threshold>
<iperf_bitrate_threshold>80</iperf_bitrate_threshold>
@@ -149,9 +149,9 @@
<class>Iperf</class>
<desc>Iperf UDP UL</desc>
<id>rfsim4g_ue</id>
<nodes>cacofonix</nodes>
<nodes>acamas</nodes>
<svr_id>rfsim4g_ext_dn</svr_id>
<svr_node>cacofonix</svr_node>
<svr_node>acamas</svr_node>
<iperf_args>-u -t 30 -b 1M</iperf_args>
<iperf_packetloss_threshold>25</iperf_packetloss_threshold>
<iperf_bitrate_threshold>80</iperf_bitrate_threshold>

View File

@@ -83,9 +83,9 @@
<class>Iperf2_Unidir</class>
<desc>Iperf2 UDP DL</desc>
<id>rfsim4g_ue_fembms</id>
<nodes>cacofonix</nodes>
<nodes>acamas</nodes>
<svr_id>rfsim4g_enb_fembms</svr_id>
<svr_node>cacofonix</svr_node>
<svr_node>acamas</svr_node>
<iperf_args>-u -t 30 -b 2M</iperf_args>
<iperf_packetloss_threshold>25</iperf_packetloss_threshold>
<iperf_bitrate_threshold>80</iperf_bitrate_threshold>

View File

@@ -83,9 +83,9 @@
<class>Iperf</class>
<desc>Iperf UDP DL</desc>
<id>rfsim4g_ue</id>
<nodes>cacofonix</nodes>
<nodes>acamas</nodes>
<svr_id>rfsim4g_enb_nos1</svr_id>
<svr_node>cacofonix</svr_node>
<svr_node>acamas</svr_node>
<iperf_args>-u -t 30 -b 2M -R</iperf_args>
<iperf_packetloss_threshold>25</iperf_packetloss_threshold>
<iperf_bitrate_threshold>80</iperf_bitrate_threshold>

View File

@@ -108,9 +108,9 @@
<class>Ping</class>
<desc>Ping Traffic-Gen from LTE-UE</desc>
<id>rfsim4g_ue</id>
<nodes>cacofonix</nodes>
<nodes>acamas</nodes>
<svr_id>rfsim4g_ext_dn</svr_id>
<svr_node>cacofonix</svr_node>
<svr_node>acamas</svr_node>
<ping_args>-c 20</ping_args>
<ping_packetloss_threshold>5</ping_packetloss_threshold>
</testCase>
@@ -119,9 +119,9 @@
<class>Ping</class>
<desc>Ping LTE-UE from Traffic-Gen</desc>
<id>rfsim4g_ext_dn</id>
<nodes>cacofonix</nodes>
<nodes>acamas</nodes>
<svr_id>rfsim4g_ue</svr_id>
<svr_node>cacofonix</svr_node>
<svr_node>acamas</svr_node>
<ping_args>-c 20</ping_args>
<ping_packetloss_threshold>5</ping_packetloss_threshold>
</testCase>
@@ -130,9 +130,9 @@
<class>Iperf</class>
<desc>Iperf UDP DL</desc>
<id>rfsim4g_ue</id>
<nodes>cacofonix</nodes>
<nodes>acamas</nodes>
<svr_id>rfsim4g_ext_dn</svr_id>
<svr_node>cacofonix</svr_node>
<svr_node>acamas</svr_node>
<iperf_args>-u -t 30 -b 2M -R</iperf_args>
<iperf_packetloss_threshold>25</iperf_packetloss_threshold>
<iperf_bitrate_threshold>80</iperf_bitrate_threshold>
@@ -142,9 +142,9 @@
<class>Iperf</class>
<desc>Iperf UDP UL</desc>
<id>rfsim4g_ue</id>
<nodes>cacofonix</nodes>
<nodes>acamas</nodes>
<svr_id>rfsim4g_ext_dn</svr_id>
<svr_node>cacofonix</svr_node>
<svr_node>acamas</svr_node>
<iperf_args>-u -t 30 -b 1M</iperf_args>
<iperf_packetloss_threshold>25</iperf_packetloss_threshold>
<iperf_bitrate_threshold>80</iperf_bitrate_threshold>

View File

@@ -80,16 +80,16 @@
<class>Attach_UE</class>
<desc>Attach OAI UE (Wait for IP)</desc>
<id>rfsim5g_ue rfsim5g_ue2 rfsim5g_ue3</id>
<nodes>cacofonix cacofonix cacofonix</nodes>
<nodes>acamas acamas acamas</nodes>
</testCase>
<testCase id="020021">
<class>Ping</class>
<desc>Ping ext-dn from all NR-UEs</desc>
<id>rfsim5g_ue rfsim5g_ue2 rfsim5g_ue3</id>
<nodes>cacofonix cacofonix cacofonix</nodes>
<nodes>acamas acamas acamas</nodes>
<svr_id>rfsim5g_5gc_fixed_ip</svr_id>
<svr_node>cacofonix</svr_node>
<svr_node>acamas</svr_node>
<ping_args>-c 20 -i0.25</ping_args>
<ping_packetloss_threshold>5</ping_packetloss_threshold>
</testCase>

View File

@@ -93,7 +93,7 @@
<testCase id="000030">
<class>IdleSleep</class>
<desc>Sleep</desc>
<idle_sleep_time_in_sec>5</idle_sleep_time_in_sec>
<idle_sleep_time_in_sec>15</idle_sleep_time_in_sec>
</testCase>
<testCase id="000031">
@@ -106,7 +106,7 @@
<class>Attach_UE</class>
<desc>Attach OAI UE (Wait for IP)</desc>
<id>rfsim5g_ue</id>
<nodes>cacofonix</nodes>
<nodes>acamas</nodes>
</testCase>
<testCase id="000024">
@@ -122,9 +122,9 @@
<class>Ping</class>
<desc>Ping ext-dn from all NR-UEs</desc>
<id>rfsim5g_ue</id>
<nodes>cacofonix</nodes>
<nodes>acamas</nodes>
<svr_id>rfsim5g_ext_dn</svr_id>
<svr_node>cacofonix</svr_node>
<svr_node>acamas</svr_node>
<ping_args>-c 20 -i0.25</ping_args>
<ping_packetloss_threshold>5</ping_packetloss_threshold>
</testCase>
@@ -132,8 +132,8 @@
<testCase id="030020">
<class>Custom_Command</class>
<desc>Simulate a DL radio channel with noise (3 dB)</desc>
<node>cacofonix</node>
<command>echo channelmod modify 0 noise_power_dB 3 | nc --send-only 192.168.71.181 8091</command>
<node>acamas</node>
<command>echo channelmod modify 0 noise_power_dB 3 | ncat --send-only 192.168.71.181 8091</command>
</testCase>
<testCase id="030021">
@@ -141,9 +141,9 @@
<desc>Iperf (DL/5Mbps/UDP)(30 sec)</desc>
<iperf_args>-u -b 5M -t 20 -R</iperf_args>
<id>rfsim5g_ue</id>
<nodes>cacofonix</nodes>
<nodes>acamas</nodes>
<svr_id>rfsim5g_ext_dn</svr_id>
<svr_node>cacofonix</svr_node>
<svr_node>acamas</svr_node>
<iperf_packetloss_threshold>5</iperf_packetloss_threshold>
<iperf_bitrate_threshold>90</iperf_bitrate_threshold>
</testCase>
@@ -153,9 +153,9 @@
<desc>Iperf (UL/3Mbps/UDP)(30 sec)</desc>
<iperf_args>-u -b 3M -t 20</iperf_args>
<id>rfsim5g_ue</id>
<nodes>cacofonix</nodes>
<nodes>acamas</nodes>
<svr_id>rfsim5g_ext_dn</svr_id>
<svr_node>cacofonix</svr_node>
<svr_node>acamas</svr_node>
<iperf_packetloss_threshold>5</iperf_packetloss_threshold>
<iperf_bitrate_threshold>90</iperf_bitrate_threshold>
</testCase>
@@ -163,17 +163,17 @@
<testCase id="040001">
<class>Custom_Command</class>
<desc>Trigger Reestablishment</desc>
<node>cacofonix</node>
<command>echo ci force_reestab | nc 192.168.71.171 9090 | grep -E 'Reset RLC counters of UE RNTI [0-9a-f]{4} to trigger reestablishment'</command>
<node>acamas</node>
<command>echo ci force_reestab | ncat 192.168.71.171 9090 | grep -E 'Reset RLC counters of UE RNTI [0-9a-f]{4} to trigger reestablishment'</command>
</testCase>
<testCase id="020022">
<class>Ping</class>
<desc>Ping ext-dn from NR-UE</desc>
<id>rfsim5g_ue</id>
<nodes>cacofonix</nodes>
<nodes>acamas</nodes>
<svr_id>rfsim5g_ext_dn</svr_id>
<svr_node>cacofonix</svr_node>
<svr_node>acamas</svr_node>
<ping_args>-c 20 -i0.5 -w25</ping_args>
<ping_packetloss_threshold>80</ping_packetloss_threshold>
</testCase>
@@ -181,57 +181,57 @@
<testCase id="040002">
<class>Custom_Command</class>
<desc>Verify Reestablishment</desc>
<node>cacofonix</node>
<command>echo ci get_reestab_count | nc 192.168.71.150 9090 | grep -E 'UE RNTI [0-9a-f]{4} reestab 1'</command>
<node>acamas</node>
<command>echo ci get_reestab_count | ncat 192.168.71.150 9090 | grep -E 'UE RNTI [0-9a-f]{4} reestab 1'</command>
</testCase>
<testCase id="040021">
<class>Custom_Command</class>
<desc>Simulate a disruption of DL radio channel (ploss 55)</desc>
<node>cacofonix</node>
<command>echo channelmod modify 0 ploss 55 | nc 192.168.71.181 8091</command>
<node>acamas</node>
<command>echo channelmod modify 0 ploss 55 | ncat 192.168.71.181 8091</command>
</testCase>
<testCase id="040022">
<class>Custom_Command</class>
<desc>Get UE sync state (UE ID 0)</desc>
<node>cacofonix</node>
<command>echo ciUE sync_state 0 | nc 192.168.71.181 8091 | grep -E UE_NOT_SYNC</command>
<node>acamas</node>
<command>echo ciUE sync_state 0 | ncat 192.168.71.181 8091 | grep -E UE_NOT_SYNC</command>
</testCase>
<testCase id="040023">
<class>Custom_Command</class>
<desc>Restoration of the original DL channel conditions (ploss 20)</desc>
<node>cacofonix</node>
<command>echo channelmod modify 0 ploss 20 | nc 192.168.71.181 8091</command>
<node>acamas</node>
<command>echo channelmod modify 0 ploss 20 | ncat 192.168.71.181 8091</command>
</testCase>
<testCase id="040024">
<class>Custom_Command</class>
<desc>Get UE sync state (UE ID 0)</desc>
<node>cacofonix</node>
<command>echo ciUE sync_state 0 | nc 192.168.71.181 8091 | grep -E UE_CONNECTED</command>
<node>acamas</node>
<command>echo ciUE sync_state 0 | ncat 192.168.71.181 8091 | grep -E UE_CONNECTED</command>
</testCase>
<testCase id="040025">
<class>Custom_Command</class>
<desc>Trigger Handover</desc>
<node>cacofonix</node>
<command>echo ci trigger_f1_ho | nc 192.168.71.150 9090</command>
<node>acamas</node>
<command>echo ci trigger_f1_ho | ncat 192.168.71.150 9090</command>
</testCase>
<testCase id="040026">
<class>Custom_Command</class>
<desc>UE (1) connected to DU-PCI 0?</desc>
<node>cacofonix</node>
<command>echo ci fetch_du_by_ue_id 1 | nc 192.168.71.150 9090 | grep "3584"</command>
<node>acamas</node>
<command>echo ci fetch_du_by_ue_id 1 | ncat 192.168.71.150 9090 | grep "3584"</command>
</testCase>
<testCase id="040027">
<class>Custom_Command</class>
<desc>UE (1) connected to DU-PCI 1?</desc>
<node>cacofonix</node>
<command>echo ci fetch_du_by_ue_id 1 | nc 192.168.71.150 9090 | grep "3585"</command>
<node>acamas</node>
<command>echo ci fetch_du_by_ue_id 1 | ncat 192.168.71.150 9090 | grep "3585"</command>
</testCase>
<testCase id="100021">

View File

@@ -73,16 +73,16 @@
<class>Attach_UE</class>
<desc>Attach OAI UE (Wait for IP)</desc>
<id>rfsim5g_ue</id>
<nodes>cacofonix</nodes>
<nodes>acamas</nodes>
</testCase>
<testCase id="020011">
<class>Ping</class>
<desc>Ping ext-dn from NR-UE</desc>
<id>rfsim5g_ue</id>
<nodes>cacofonix</nodes>
<nodes>acamas</nodes>
<svr_id>rfsim5g_ext_dn</svr_id>
<svr_node>cacofonix</svr_node>
<svr_node>acamas</svr_node>
<ping_args>-c 20 -i 0.25</ping_args>
<ping_packetloss_threshold>5</ping_packetloss_threshold>
</testCase>
@@ -91,9 +91,9 @@
<class>Ping</class>
<desc>Ping NR-UE from ext-dn</desc>
<id>rfsim5g_ext_dn</id>
<nodes>cacofonix</nodes>
<nodes>acamas</nodes>
<svr_id>rfsim5g_ue</svr_id>
<svr_node>cacofonix</svr_node>
<svr_node>acamas</svr_node>
<ping_args>-c 20 -i 0.25</ping_args>
<ping_packetloss_threshold>5</ping_packetloss_threshold>
</testCase>
@@ -103,9 +103,9 @@
<desc>Iperf (DL/3Mbps/UDP)(30 sec)</desc>
<iperf_args>-u -b 3M -t 30 -R</iperf_args>
<id>rfsim5g_ue</id>
<nodes>cacofonix</nodes>
<nodes>acamas</nodes>
<svr_id>rfsim5g_ext_dn</svr_id>
<svr_node>cacofonix</svr_node>
<svr_node>acamas</svr_node>
<iperf_packetloss_threshold>5</iperf_packetloss_threshold>
<iperf_bitrate_threshold>90</iperf_bitrate_threshold>
</testCase>
@@ -115,9 +115,9 @@
<desc>Iperf (UL/3Mbps/UDP)(30 sec)</desc>
<iperf_args>-u -b 3M -t 30</iperf_args>
<id>rfsim5g_ue</id>
<nodes>cacofonix</nodes>
<nodes>acamas</nodes>
<svr_id>rfsim5g_ext_dn</svr_id>
<svr_node>cacofonix</svr_node>
<svr_node>acamas</svr_node>
<iperf_packetloss_threshold>5</iperf_packetloss_threshold>
<iperf_bitrate_threshold>90</iperf_bitrate_threshold>
</testCase>

View File

@@ -133,16 +133,16 @@
<class>Attach_UE</class>
<desc>Attach OAI UE (Wait for IP)</desc>
<id>rfsim5g_ue rfsim5g_ue2 rfsim5g_ue3 rfsim5g_ue4 rfsim5g_ue5 rfsim5g_ue6 rfsim5g_ue7 rfsim5g_ue8 rfsim5g_ue9 rfsim5g_ue10</id>
<nodes>cacofonix cacofonix cacofonix cacofonix cacofonix cacofonix cacofonix cacofonix cacofonix cacofonix</nodes>
<nodes>acamas acamas acamas acamas acamas acamas acamas acamas acamas acamas</nodes>
</testCase>
<testCase id="020001">
<class>Ping</class>
<desc>Ping ext-dn from NR-UE</desc>
<id>rfsim5g_ue</id>
<nodes>cacofonix</nodes>
<nodes>acamas</nodes>
<svr_id>rfsim5g_ext_dn</svr_id>
<svr_node>cacofonix</svr_node>
<svr_node>acamas</svr_node>
<ping_args>-c 20 -i 0.25</ping_args>
<ping_packetloss_threshold>5</ping_packetloss_threshold>
</testCase>
@@ -151,9 +151,9 @@
<class>Ping</class>
<desc>Ping NR-UE from ext-dn</desc>
<id>rfsim5g_ext_dn</id>
<nodes>cacofonix</nodes>
<nodes>acamas</nodes>
<svr_id>rfsim5g_ue</svr_id>
<svr_node>cacofonix</svr_node>
<svr_node>acamas</svr_node>
<ping_args>-c 20 -i 0.25</ping_args>
<ping_packetloss_threshold>5</ping_packetloss_threshold>
</testCase>
@@ -162,9 +162,9 @@
<class>Ping</class>
<desc>Ping ext-dn from Second NR-UE</desc>
<id>rfsim5g_ue2</id>
<nodes>cacofonix</nodes>
<nodes>acamas</nodes>
<svr_id>rfsim5g_ext_dn</svr_id>
<svr_node>cacofonix</svr_node>
<svr_node>acamas</svr_node>
<ping_args>-c 20 -i 0.25</ping_args>
<ping_packetloss_threshold>5</ping_packetloss_threshold>
</testCase>
@@ -173,9 +173,9 @@
<class>Ping</class>
<desc>Ping Second NR-UE from ext-dn</desc>
<id>rfsim5g_ext_dn</id>
<nodes>cacofonix</nodes>
<nodes>acamas</nodes>
<svr_id>rfsim5g_ue2</svr_id>
<svr_node>cacofonix</svr_node>
<svr_node>acamas</svr_node>
<ping_args>-c 20 -i 0.25</ping_args>
<ping_packetloss_threshold>5</ping_packetloss_threshold>
</testCase>
@@ -184,9 +184,9 @@
<class>Ping</class>
<desc>Ping ext-dn from both UEs</desc>
<id>rfsim5g_ue rfsim5g_ue2</id>
<nodes>cacofonix cacofonix</nodes>
<nodes>acamas acamas</nodes>
<svr_id>rfsim5g_ext_dn</svr_id>
<svr_node>cacofonix</svr_node>
<svr_node>acamas</svr_node>
<ping_args>-c 20 -i 0.25</ping_args>
<ping_packetloss_threshold>5</ping_packetloss_threshold>
</testCase>
@@ -195,9 +195,9 @@
<class>Ping</class>
<desc>Ping ext-dn from all UEs</desc>
<id>rfsim5g_ue rfsim5g_ue2 rfsim5g_ue3 rfsim5g_ue4 rfsim5g_ue5 rfsim5g_ue6 rfsim5g_ue7 rfsim5g_ue8 rfsim5g_ue9 rfsim5g_ue10</id>
<nodes>cacofonix cacofonix cacofonix cacofonix cacofonix cacofonix cacofonix cacofonix cacofonix cacofonix</nodes>
<nodes>acamas acamas acamas acamas acamas acamas acamas acamas acamas acamas</nodes>
<svr_id>rfsim5g_ext_dn</svr_id>
<svr_node>cacofonix</svr_node>
<svr_node>acamas</svr_node>
<ping_args>-c 20 -i 0.25 -s 1016</ping_args>
<ping_packetloss_threshold>5</ping_packetloss_threshold>
</testCase>
@@ -207,9 +207,9 @@
<desc>Iperf (DL/3Mbps/UDP)(30 sec)</desc>
<iperf_args>-u -b 3M -t 20 -R</iperf_args>
<id>rfsim5g_ue</id>
<nodes>cacofonix</nodes>
<nodes>acamas</nodes>
<svr_id>rfsim5g_ext_dn</svr_id>
<svr_node>cacofonix</svr_node>
<svr_node>acamas</svr_node>
<iperf_packetloss_threshold>5</iperf_packetloss_threshold>
<iperf_bitrate_threshold>90</iperf_bitrate_threshold>
</testCase>
@@ -219,9 +219,9 @@
<desc>Iperf (UL/1Mbps/UDP)(30 sec)</desc>
<iperf_args>-u -b 1M -t 20</iperf_args>
<id>rfsim5g_ue</id>
<nodes>cacofonix</nodes>
<nodes>acamas</nodes>
<svr_id>rfsim5g_ext_dn</svr_id>
<svr_node>cacofonix</svr_node>
<svr_node>acamas</svr_node>
<iperf_packetloss_threshold>5</iperf_packetloss_threshold>
<iperf_bitrate_threshold>90</iperf_bitrate_threshold>
</testCase>
@@ -230,21 +230,21 @@
<class>Attach_UE</class>
<desc>Attach OAI UE 1 and 2</desc>
<id>rfsim5g_ue rfsim5g_ue2</id>
<nodes>cacofonix cacofonix</nodes>
<nodes>acamas acamas</nodes>
</testCase>
<testCase id="444444">
<class>Detach_UE</class>
<desc>Detach OAI UE 1 and 2</desc>
<id>rfsim5g_ue rfsim5g_ue2</id>
<nodes>cacofonix cacofonix</nodes>
<nodes>acamas acamas</nodes>
</testCase>
<testCase id="444445">
<class>Detach_UE</class>
<desc>Detach OAI UE 3 to 10</desc>
<id>rfsim5g_ue3 rfsim5g_ue4 rfsim5g_ue5 rfsim5g_ue6 rfsim5g_ue7 rfsim5g_ue8 rfsim5g_ue9 rfsim5g_ue10</id>
<nodes>cacofonix cacofonix cacofonix cacofonix cacofonix cacofonix cacofonix cacofonix</nodes>
<nodes>acamas acamas acamas acamas acamas acamas acamas acamas</nodes>
</testCase>
<testCase id="100001">

View File

@@ -91,7 +91,7 @@
<class>Attach_UE</class>
<desc>Attach OAI UE (Wait for IP)</desc>
<id>rfsim5g_ue</id>
<nodes>cacofonix</nodes>
<nodes>acamas</nodes>
</testCase>
<testCase id="000004">
@@ -104,9 +104,9 @@
<class>Ping</class>
<desc>Ping ext-dn from NR-UE</desc>
<id>rfsim5g_ue</id>
<nodes>cacofonix</nodes>
<nodes>acamas</nodes>
<svr_id>rfsim5g_ext_dn</svr_id>
<svr_node>cacofonix</svr_node>
<svr_node>acamas</svr_node>
<ping_args> -c 20 -i0.5</ping_args>
<ping_packetloss_threshold>80</ping_packetloss_threshold>
</testCase>
@@ -115,9 +115,9 @@
<class>Ping</class>
<desc>Ping NR-UE from ext-dn</desc>
<id>rfsim5g_ext_dn</id>
<nodes>cacofonix</nodes>
<nodes>acamas</nodes>
<svr_id>rfsim5g_ue</svr_id>
<svr_node>cacofonix</svr_node>
<svr_node>acamas</svr_node>
<ping_args>-c 20 -i0.2</ping_args>
<ping_packetloss_threshold>5</ping_packetloss_threshold>
</testCase>
@@ -127,9 +127,9 @@
<desc>Iperf (DL/3Mbps/UDP)(30 sec)</desc>
<iperf_args>-u -b 3M -t 20 -R</iperf_args>
<id>rfsim5g_ue</id>
<nodes>cacofonix</nodes>
<nodes>acamas</nodes>
<svr_id>rfsim5g_ext_dn</svr_id>
<svr_node>cacofonix</svr_node>
<svr_node>acamas</svr_node>
<iperf_packetloss_threshold>5</iperf_packetloss_threshold>
<iperf_bitrate_threshold>90</iperf_bitrate_threshold>
</testCase>
@@ -139,9 +139,9 @@
<desc>Iperf (UL/1Mbps/UDP)(30 sec)</desc>
<iperf_args>-u -b 1M -t 20</iperf_args>
<id>rfsim5g_ue</id>
<nodes>cacofonix</nodes>
<nodes>acamas</nodes>
<svr_id>rfsim5g_ext_dn</svr_id>
<svr_node>cacofonix</svr_node>
<svr_node>acamas</svr_node>
<iperf_packetloss_threshold>5</iperf_packetloss_threshold>
<iperf_bitrate_threshold>90</iperf_bitrate_threshold>
</testCase>
@@ -149,15 +149,15 @@
<testCase id="040001">
<class>Custom_Command</class>
<desc>Force Msg3 C-RNTI RA</desc>
<node>cacofonix</node>
<command>echo ciUE force_crnti_ra | nc 192.168.71.150 8091</command>
<node>acamas</node>
<command>echo ciUE force_crnti_ra | ncat 192.168.71.150 8091</command>
</testCase>
<testCase id="040002">
<class>Custom_Command</class>
<desc>Force RRC_IDLE (UE ID 0)</desc>
<node>cacofonix</node>
<command>echo ciUE force_RRC_IDLE | nc 192.168.71.150 8091</command>
<node>acamas</node>
<command>echo ciUE force_RRC_IDLE | ncat 192.168.71.150 8091</command>
</testCase>
<testCase id="100001">

View File

@@ -73,16 +73,16 @@
<class>Attach_UE</class>
<desc>Attach OAI UE (Wait for IP)</desc>
<id>rfsim5g_ue</id>
<nodes>cacofonix</nodes>
<nodes>acamas</nodes>
</testCase>
<testCase id="020001">
<class>Ping</class>
<desc>Ping ext-dn from NR-UE</desc>
<id>rfsim5g_ue</id>
<nodes>cacofonix</nodes>
<nodes>acamas</nodes>
<svr_id>rfsim5g_ext_dn</svr_id>
<svr_node>cacofonix</svr_node>
<svr_node>acamas</svr_node>
<ping_args>-c 20 -i 0.25</ping_args>
<ping_packetloss_threshold>5</ping_packetloss_threshold>
</testCase>
@@ -91,9 +91,9 @@
<class>Ping</class>
<desc>Ping NR-UE from ext-dn</desc>
<id>rfsim5g_ext_dn</id>
<nodes>cacofonix</nodes>
<nodes>acamas</nodes>
<svr_id>rfsim5g_ue</svr_id>
<svr_node>cacofonix</svr_node>
<svr_node>acamas</svr_node>
<ping_args>-c 20 -i 0.25</ping_args>
<ping_packetloss_threshold>5</ping_packetloss_threshold>
</testCase>
@@ -103,21 +103,21 @@
<desc>Iperf (DL/10Mbps/UDP)(30 sec)</desc>
<iperf_args>-u -b 10M -t 20 -R</iperf_args>
<id>rfsim5g_ue</id>
<nodes>cacofonix</nodes>
<nodes>acamas</nodes>
<svr_id>rfsim5g_ext_dn</svr_id>
<svr_node>cacofonix</svr_node>
<svr_node>acamas</svr_node>
<iperf_packetloss_threshold>5</iperf_packetloss_threshold>
<iperf_bitrate_threshold>90</iperf_bitrate_threshold>
</testCase>
<testCase id="030002">
<class>Iperf</class>
<desc>Iperf (UL/4Mbps/UDP)(30 sec)</desc>
<iperf_args>-u -b 4M -t 20</iperf_args>
<desc>Iperf (UL/3Mbps/UDP)(30 sec)</desc>
<iperf_args>-u -b 3M -t 20</iperf_args>
<id>rfsim5g_ue</id>
<nodes>cacofonix</nodes>
<nodes>acamas</nodes>
<svr_id>rfsim5g_ext_dn</svr_id>
<svr_node>cacofonix</svr_node>
<svr_node>acamas</svr_node>
<iperf_packetloss_threshold>5</iperf_packetloss_threshold>
<iperf_bitrate_threshold>90</iperf_bitrate_threshold>
</testCase>

View File

@@ -49,7 +49,7 @@
<testCase id="004000">
<class>Custom_Command</class>
<desc>Clean-Up any residual volume</desc>
<node>cacofonix</node>
<node>acamas</node>
<command>docker volume rm 5g_rfsimulator_fdd_phytest_rrc.config -f</command>
</testCase>
<testCase id="800813">
@@ -80,9 +80,9 @@
<class>Ping</class>
<desc>Ping gNB from NR-UE</desc>
<id>rfsim5g_ue</id>
<nodes>cacofonix</nodes>
<nodes>acamas</nodes>
<svr_id>rfsim5g_gnb_nos1</svr_id>
<svr_node>cacofonix</svr_node>
<svr_node>acamas</svr_node>
<ping_args>-c20 -i0.2</ping_args>
<ping_packetloss_threshold>0</ping_packetloss_threshold>
</testCase>
@@ -91,9 +91,9 @@
<class>Ping</class>
<desc>Ping NR-UE from gNB</desc>
<id>rfsim5g_gnb_nos1</id>
<nodes>cacofonix</nodes>
<nodes>acamas</nodes>
<svr_id>rfsim5g_ue</svr_id>
<svr_node>cacofonix</svr_node>
<svr_node>acamas</svr_node>
<ping_args>-c20 -i0.2</ping_args>
<ping_packetloss_threshold>0</ping_packetloss_threshold>
</testCase>
@@ -103,9 +103,9 @@
<desc>Iperf (DL/30kbps/UDP)(30 sec)</desc>
<iperf_args>-u -b 0.03M -t 20 -R -c 10.0.1.1</iperf_args>
<id>rfsim5g_ue</id>
<nodes>cacofonix</nodes>
<nodes>acamas</nodes>
<svr_id>rfsim5g_gnb_nos1</svr_id>
<svr_node>cacofonix</svr_node>
<svr_node>acamas</svr_node>
<iperf_packetloss_threshold>5</iperf_packetloss_threshold>
<iperf_bitrate_threshold>90</iperf_bitrate_threshold>
</testCase>
@@ -115,9 +115,9 @@
<desc>Iperf (UL/30kbps/UDP)(30 sec)</desc>
<iperf_args>-u -b 0.03M -t 20 -c 10.0.1.1</iperf_args>
<id>rfsim5g_ue</id>
<nodes>cacofonix</nodes>
<nodes>acamas</nodes>
<svr_id>rfsim5g_gnb_nos1</svr_id>
<svr_node>cacofonix</svr_node>
<svr_node>acamas</svr_node>
<iperf_packetloss_threshold>5</iperf_packetloss_threshold>
<iperf_bitrate_threshold>90</iperf_bitrate_threshold>
</testCase>

View File

@@ -73,16 +73,16 @@
<class>Attach_UE</class>
<desc>Attach OAI UE (Wait for IP)</desc>
<id>rfsim5g_ue</id>
<nodes>cacofonix</nodes>
<nodes>acamas</nodes>
</testCase>
<testCase id="020001">
<class>Ping</class>
<desc>Ping ext-dn from NR-UE</desc>
<id>rfsim5g_ue</id>
<nodes>cacofonix</nodes>
<nodes>acamas</nodes>
<svr_id>rfsim5g_ext_dn</svr_id>
<svr_node>cacofonix</svr_node>
<svr_node>acamas</svr_node>
<ping_args>-c 20 -i0.2</ping_args>
<ping_packetloss_threshold>0</ping_packetloss_threshold>
</testCase>
@@ -91,9 +91,9 @@
<class>Ping</class>
<desc>Ping NR-UE from ext-dn</desc>
<id>rfsim5g_ext_dn</id>
<nodes>cacofonix</nodes>
<nodes>acamas</nodes>
<svr_id>rfsim5g_ue</svr_id>
<svr_node>cacofonix</svr_node>
<svr_node>acamas</svr_node>
<ping_args>-c 20 -i0.2</ping_args>
<ping_packetloss_threshold>0</ping_packetloss_threshold>
</testCase>

View File

@@ -78,16 +78,16 @@
<class>Attach_UE</class>
<desc>Attach OAI UE (Wait for IP)</desc>
<id>rfsim5g_ue</id>
<nodes>cacofonix</nodes>
<nodes>acamas</nodes>
</testCase>
<testCase id="020001">
<class>Ping</class>
<desc>Ping ext-dn from NR-UE</desc>
<id>rfsim5g_ue</id>
<nodes>cacofonix</nodes>
<nodes>acamas</nodes>
<svr_id>rfsim5g_ext_dn</svr_id>
<svr_node>cacofonix</svr_node>
<svr_node>acamas</svr_node>
<ping_args>-c 20 -i 0.25</ping_args>
<ping_packetloss_threshold>5</ping_packetloss_threshold>
</testCase>
@@ -96,9 +96,9 @@
<class>Ping</class>
<desc>Ping NR-UE from ext-dn</desc>
<id>rfsim5g_ext_dn</id>
<nodes>cacofonix</nodes>
<nodes>acamas</nodes>
<svr_id>rfsim5g_ue</svr_id>
<svr_node>cacofonix</svr_node>
<svr_node>acamas</svr_node>
<ping_args>-c 20 -i 0.25</ping_args>
<ping_packetloss_threshold>5</ping_packetloss_threshold>
</testCase>
@@ -106,8 +106,8 @@
<testCase id="040001">
<class>Custom_Command</class>
<desc>Trigger Reestablishment</desc>
<node>cacofonix</node>
<command>echo ci force_reestab | nc 192.168.71.140 9090 | grep -E 'Reset RLC counters of UE RNTI [0-9a-f]{4} to trigger reestablishment'</command>
<node>acamas</node>
<command>echo ci force_reestab | ncat 192.168.71.140 9090 | grep -E 'Reset RLC counters of UE RNTI [0-9a-f]{4} to trigger reestablishment'</command>
<command_fail>yes</command_fail>
</testCase>
@@ -115,9 +115,9 @@
<class>Ping</class>
<desc>Ping ext-dn from NR-UE</desc>
<id>rfsim5g_ue</id>
<nodes>cacofonix</nodes>
<nodes>acamas</nodes>
<svr_id>rfsim5g_ext_dn</svr_id>
<svr_node>cacofonix</svr_node>
<svr_node>acamas</svr_node>
<ping_args>-c 20 -i0.5 -w25</ping_args>
<ping_packetloss_threshold>80</ping_packetloss_threshold>
</testCase>
@@ -125,8 +125,8 @@
<testCase id="040002">
<class>Custom_Command</class>
<desc>Verify Reestablishment</desc>
<node>cacofonix</node>
<command>echo ci get_reestab_count | nc 192.168.71.140 9090 | grep -E 'UE RNTI [0-9a-f]{4} reestab 1'</command>
<node>acamas</node>
<command>echo ci get_reestab_count | ncat 192.168.71.140 9090 | grep -E 'UE RNTI [0-9a-f]{4} reestab 1'</command>
<command_fail>yes</command_fail>
</testCase>

View File

@@ -73,16 +73,16 @@
<class>Attach_UE</class>
<desc>Attach OAI UE (Wait for IP)</desc>
<id>rfsim5g_ue</id>
<nodes>cacofonix</nodes>
<nodes>acamas</nodes>
</testCase>
<testCase id="020001">
<class>Ping</class>
<desc>Ping ext-dn from NR-UE</desc>
<id>rfsim5g_ue</id>
<nodes>cacofonix</nodes>
<nodes>acamas</nodes>
<svr_id>rfsim5g_ext_dn</svr_id>
<svr_node>cacofonix</svr_node>
<svr_node>acamas</svr_node>
<ping_args>-c 20 -i 0.25</ping_args>
<ping_packetloss_threshold>5</ping_packetloss_threshold>
</testCase>
@@ -91,9 +91,9 @@
<class>Ping</class>
<desc>Ping NR-UE from ext-dn</desc>
<id>rfsim5g_ext_dn</id>
<nodes>cacofonix</nodes>
<nodes>acamas</nodes>
<svr_id>rfsim5g_ue</svr_id>
<svr_node>cacofonix</svr_node>
<svr_node>acamas</svr_node>
<ping_args>-c 20 -i 0.25</ping_args>
<ping_packetloss_threshold>5</ping_packetloss_threshold>
</testCase>

View File

@@ -77,7 +77,7 @@
<testCase id="000005">
<class>Custom_Command</class>
<desc>Check that UE synched</desc>
<node>cacofonix</node>
<node>acamas</node>
<command>docker logs rfsim5g-oai-nr-ue-2 | grep -m 1 "PSBCH RX:OK"</command>
</testCase>

View File

@@ -30,6 +30,7 @@
004000
000000
000001
000030
020001
020002
100001
@@ -48,7 +49,7 @@
<testCase id="004000">
<class>Custom_Command</class>
<desc>Clean-Up any residual volume</desc>
<node>cacofonix</node>
<node>acamas</node>
<command>docker volume rm 5g_rfsimulator_tdd_dora_rrc.config -f</command>
</testCase>
<testCase id="800813">
@@ -75,13 +76,19 @@
<eNB_serverId>0</eNB_serverId>
</testCase>
<testCase id="000030">
<class>IdleSleep</class>
<desc>Sleep</desc>
<idle_sleep_time_in_sec>5</idle_sleep_time_in_sec>
</testCase>
<testCase id="020001">
<class>Ping</class>
<desc>Ping gNB from NR-UE</desc>
<id>rfsim5g_ue</id>
<nodes>cacofonix</nodes>
<nodes>acamas</nodes>
<svr_id>rfsim5g_gnb_nos1</svr_id>
<svr_node>cacofonix</svr_node>
<svr_node>acamas</svr_node>
<ping_args>-c20 -i0.2</ping_args>
<ping_packetloss_threshold>0</ping_packetloss_threshold>
</testCase>
@@ -90,9 +97,9 @@
<class>Ping</class>
<desc>Ping NR-UE from gNB</desc>
<id>rfsim5g_gnb_nos1</id>
<nodes>cacofonix</nodes>
<nodes>acamas</nodes>
<svr_id>rfsim5g_ue</svr_id>
<svr_node>cacofonix</svr_node>
<svr_node>acamas</svr_node>
<ping_args>-c20 -i0.2</ping_args>
<ping_packetloss_threshold>0</ping_packetloss_threshold>
</testCase>

View File

@@ -32,6 +32,8 @@
000003
020001
020002
000004
020003
030001
030002
100001
@@ -73,16 +75,16 @@
<class>Attach_UE</class>
<desc>Attach OAI UE (Wait for IP)</desc>
<id>rfsim5g_ue</id>
<nodes>cacofonix</nodes>
<nodes>acamas</nodes>
</testCase>
<testCase id="020001">
<class>Ping</class>
<desc>Ping ext-dn from NR-UE</desc>
<id>rfsim5g_ue</id>
<nodes>cacofonix</nodes>
<nodes>acamas</nodes>
<svr_id>rfsim5g_ext_dn</svr_id>
<svr_node>cacofonix</svr_node>
<svr_node>acamas</svr_node>
<ping_args>-c 20 -i 0.25</ping_args>
<ping_packetloss_threshold>5</ping_packetloss_threshold>
</testCase>
@@ -91,9 +93,27 @@
<class>Ping</class>
<desc>Ping NR-UE from ext-dn</desc>
<id>rfsim5g_ext_dn</id>
<nodes>cacofonix</nodes>
<nodes>acamas</nodes>
<svr_id>rfsim5g_ue</svr_id>
<svr_node>cacofonix</svr_node>
<svr_node>acamas</svr_node>
<ping_args>-c 20 -i 0.25</ping_args>
<ping_packetloss_threshold>5</ping_packetloss_threshold>
</testCase>
<testCase id="000004">
<class>Attach_UE</class>
<desc>Verify 2nd PDU session is up</desc>
<id>rfsim5g_ue_pdu_2</id>
<nodes>acamas</nodes>
</testCase>
<testCase id="020003">
<class>Ping</class>
<desc>Ping ext-dn from NR-UE on PDU session ID 2</desc>
<id>rfsim5g_ue_pdu_2</id>
<nodes>acamas</nodes>
<svr_id>rfsim5g_ext_dn</svr_id>
<svr_node>acamas</svr_node>
<ping_args>-c 20 -i 0.25</ping_args>
<ping_packetloss_threshold>5</ping_packetloss_threshold>
</testCase>
@@ -103,9 +123,9 @@
<desc>Iperf (DL/3Mbps/UDP)(30 sec)</desc>
<iperf_args>-u -b 3M -t 20 -R</iperf_args>
<id>rfsim5g_ue</id>
<nodes>cacofonix</nodes>
<nodes>acamas</nodes>
<svr_id>rfsim5g_ext_dn</svr_id>
<svr_node>cacofonix</svr_node>
<svr_node>acamas</svr_node>
<iperf_packetloss_threshold>5</iperf_packetloss_threshold>
<iperf_bitrate_threshold>90</iperf_bitrate_threshold>
</testCase>
@@ -115,9 +135,9 @@
<desc>Iperf (UL/1Mbps/UDP)(30 sec)</desc>
<iperf_args>-u -b 1M -t 20</iperf_args>
<id>rfsim5g_ue</id>
<nodes>cacofonix</nodes>
<nodes>acamas</nodes>
<svr_id>rfsim5g_ext_dn</svr_id>
<svr_node>cacofonix</svr_node>
<svr_node>acamas</svr_node>
<iperf_packetloss_threshold>5</iperf_packetloss_threshold>
<iperf_bitrate_threshold>90</iperf_bitrate_threshold>
</testCase>

View File

@@ -35,6 +35,8 @@
000011
000022
000033
200022
300033
000222
222222
333333
@@ -115,6 +117,28 @@
<iperf_bitrate_threshold>80</iperf_bitrate_threshold>
</testCase>
<testCase id="200022">
<class>Iperf</class>
<desc>Optional iperf (DL/UDP/1000M)(30 sec)(single-ue profile)</desc>
<may_fail>true</may_fail>
<iperf_args>-u -b 1000M -t 30 -R</iperf_args>
<svr_id>oc-cn5g-20897-aerial</svr_id>
<id>up2-aerial</id>
<iperf_packetloss_threshold>25</iperf_packetloss_threshold>
<iperf_bitrate_threshold>80</iperf_bitrate_threshold>
</testCase>
<testCase id="300033">
<class>Iperf</class>
<desc>Optional iperf (UL/UDP/90M)(30 sec)(single-ue profile)</desc>
<may_fail>true</may_fail>
<iperf_args>-u -b 90M -t 30 -l 1428</iperf_args>
<svr_id>oc-cn5g-20897-aerial</svr_id>
<id>up2-aerial</id>
<iperf_packetloss_threshold>25</iperf_packetloss_threshold>
<iperf_bitrate_threshold>80</iperf_bitrate_threshold>
</testCase>
<testCase id="000222">
<class>Detach_UE</class>
<always_exec>true</always_exec>

View File

@@ -30,11 +30,10 @@
310000
800813
330101
800814
330102
800815
330103
310001
400001
350000
370001
370000
@@ -147,6 +146,13 @@
<iperf_bitrate_threshold>95</iperf_bitrate_threshold>
</testCase>
<testCase id="400001">
<class>Custom_Command</class>
<desc>Check UE is on dedicated BWP ID 1</desc>
<node>ofqot</node>
<command>echo ci get_current_bwp | nc -N 127.0.0.1 9091 | grep 'DL BWP ID 1 (dedicated) UL BWP ID 1 (dedicated)'</command>
</testCase>
<testCase id="370001">
<class>Iperf</class>
<desc>iperf (UL/8Mbps/UDP)(30 sec)</desc>

View File

@@ -105,8 +105,8 @@
<testCase id="000100">
<class>Iperf</class>
<desc>iperf (DL/20Mbps/UDP)(30 sec)(single-ue profile)</desc>
<iperf_args>-u -b 20M -t 30 -i 1 -R</iperf_args>
<desc>iperf (DL/30Mbps/UDP)(30 sec)</desc>
<iperf_args>-u -b 30M -t 30 -i 1 -R</iperf_args>
<id>oai_ue_caracal</id>
<svr_id>oc-cn5g</svr_id>
<iperf_packetloss_threshold>25</iperf_packetloss_threshold>
@@ -115,8 +115,8 @@
<testCase id="000200">
<class>Iperf</class>
<desc>iperf (UL/5Mbps/UDP)(30 sec)(single-ue profile)</desc>
<iperf_args>-u -b 5M -t 30 -i 1 </iperf_args>
<desc>iperf (UL/20Mbps/UDP)(30 sec)</desc>
<iperf_args>-u -b 20M -t 30 -i 1 </iperf_args>
<id>oai_ue_caracal</id>
<svr_id>oc-cn5g</svr_id>
<iperf_packetloss_threshold>25</iperf_packetloss_threshold>

View File

@@ -45,7 +45,7 @@
<testCase id="090101">
<class>Initialize_eNB</class>
<desc>Initialize gNB USRP</desc>
<Initialize_eNB_args>-O ci-scripts/conf_files/gnb.band78.106prb.usrpn300.phytest-dora.conf --phy-test -q -U 768 -T 106 -t 23 -D 127 -m 28 -M 106 --usrp-tx-thread-config 1 --log_config.global_log_options level,nocolor,time</Initialize_eNB_args>
<Initialize_eNB_args>-O ci-scripts/conf_files/gnb.band79.106prb.usrpn300.phytest-dora.conf --phy-test -q -U 768 -T 106 -t 23 -D 127 -m 28 -M 106 --usrp-tx-thread-config 1 --log_config.global_log_options level,nocolor,time</Initialize_eNB_args>
<rt_stats_cfg>datalog_rt_stats.default.yaml</rt_stats_cfg>
<air_interface>NR</air_interface>
<USRP_IPAddress>192.168.20.2</USRP_IPAddress>

View File

@@ -45,7 +45,7 @@
<testCase id="390101">
<class>Initialize_eNB</class>
<desc>Initialize gNB USRP</desc>
<Initialize_eNB_args>-O ci-scripts/conf_files/gnb.band78.273prb.usrpn300.phytest-dora.conf --phy-test -q -U 768 -T 273 -t 23 -D 127 -m 23 -M 273 -l 2 --usrp-tx-thread-config 1 --log_config.global_log_options level,nocolor,time</Initialize_eNB_args>
<Initialize_eNB_args>-O ci-scripts/conf_files/gnb.band79.273prb.usrpn300.phytest-dora.conf --phy-test -q -U 768 -T 273 -t 23 -D 127 -m 23 -M 273 -l 2 --usrp-tx-thread-config 1 --log_config.global_log_options level,nocolor,time</Initialize_eNB_args>
<rt_stats_cfg>datalog_rt_stats.100.2x2.yaml</rt_stats_cfg>
<air_interface>NR</air_interface>
<USRP_IPAddress>192.168.20.2</USRP_IPAddress>

View File

@@ -45,7 +45,7 @@
<testCase id="190101">
<class>Initialize_eNB</class>
<desc>Initialize gNB USRP</desc>
<Initialize_eNB_args>-O ci-scripts/conf_files/gnb.band78.162prb.usrpn300.phytest-dora.conf --phy-test -q -U 768 -T 162 -t 23 -D 127 -m 23 -M 162 --usrp-tx-thread-config 1 --log_config.global_log_options level,nocolor,time</Initialize_eNB_args>
<Initialize_eNB_args>-O ci-scripts/conf_files/gnb.band79.162prb.usrpn300.phytest-dora.conf --phy-test -q -U 768 -T 162 -t 23 -D 127 -m 23 -M 162 --usrp-tx-thread-config 1 --log_config.global_log_options level,nocolor,time</Initialize_eNB_args>
<rt_stats_cfg>datalog_rt_stats.1x1.60.yaml</rt_stats_cfg>
<air_interface>NR</air_interface>
<USRP_IPAddress>192.168.20.2</USRP_IPAddress>

View File

@@ -45,7 +45,7 @@
<testCase id="290101">
<class>Initialize_eNB</class>
<desc>Initialize gNB USRP</desc>
<Initialize_eNB_args>-O ci-scripts/conf_files/gnb.band78.162prb.usrpn300.phytest-dora.conf --phy-test --gNBs.[0].pdsch_AntennaPorts_XP 2 --RUs.[0].nb_tx 2 --RUs.[0].nb_rx 2 -q -U 768 -T 162 -t 23 -D 127 -m 23 -M 162 -l 2 --usrp-tx-thread-config 1 --log_config.global_log_options level,nocolor,time</Initialize_eNB_args>
<Initialize_eNB_args>-O ci-scripts/conf_files/gnb.band79.162prb.usrpn300.phytest-dora.conf --phy-test --gNBs.[0].pdsch_AntennaPorts_XP 2 --RUs.[0].nb_tx 2 --RUs.[0].nb_rx 2 -q -U 768 -T 162 -t 23 -D 127 -m 23 -M 162 -l 2 --usrp-tx-thread-config 1 --log_config.global_log_options level,nocolor,time</Initialize_eNB_args>
<rt_stats_cfg>datalog_rt_stats.60.2x2.yaml</rt_stats_cfg>
<air_interface>NR</air_interface>
<USRP_IPAddress>192.168.20.2</USRP_IPAddress>

View File

@@ -62,7 +62,7 @@
<always_exec>true</always_exec>
<physim_test>nr_ulsim</physim_test>
<physim_time_threshold>100</physim_time_threshold>
<physim_run_args>-n1000 -s30 -S30.2 -m5 -r106 -R106 -C10 -P --loader.ldpc.shlibversion _t2 --nrLDPC_coding_t2.dpdk_dev d8:00.0 --nrLDPC_coding_t2.dpdk_core_list 11-12</physim_run_args>
<physim_run_args>-n1000 -s30 -S30.2 -m5 -r106 -R106 -C10 -P --loader.ldpc.shlibversion _t2 --nrLDPC_coding_t2.dpdk_dev af:00.0 --nrLDPC_coding_t2.dpdk_core_list 11-12</physim_run_args>
</testCase>
<testCase id="010121">
@@ -80,7 +80,7 @@
<always_exec>true</always_exec>
<physim_test>nr_ulsim</physim_test>
<physim_time_threshold>150</physim_time_threshold>
<physim_run_args>-n1000 -s30 -S30.2 -m15 -r106 -R106 -C10 -P --loader.ldpc.shlibversion _t2 --nrLDPC_coding_t2.dpdk_dev d8:00.0 --nrLDPC_coding_t2.dpdk_core_list 11-12</physim_run_args>
<physim_run_args>-n1000 -s30 -S30.2 -m15 -r106 -R106 -C10 -P --loader.ldpc.shlibversion _t2 --nrLDPC_coding_t2.dpdk_dev af:00.0 --nrLDPC_coding_t2.dpdk_core_list 11-12</physim_run_args>
</testCase>
<testCase id="010131">
@@ -98,7 +98,7 @@
<always_exec>true</always_exec>
<physim_test>nr_ulsim</physim_test>
<physim_time_threshold>250</physim_time_threshold>
<physim_run_args>-n1000 -s30 -S30.2 -m25 -r106 -R106 -C10 -P --loader.ldpc.shlibversion _t2 --nrLDPC_coding_t2.dpdk_dev d8:00.0 --nrLDPC_coding_t2.dpdk_core_list 11-12</physim_run_args>
<physim_run_args>-n1000 -s30 -S30.2 -m25 -r106 -R106 -C10 -P --loader.ldpc.shlibversion _t2 --nrLDPC_coding_t2.dpdk_dev af:00.0 --nrLDPC_coding_t2.dpdk_core_list 11-12</physim_run_args>
</testCase>
<testCase id="010211">
@@ -116,7 +116,7 @@
<always_exec>true</always_exec>
<physim_test>nr_ulsim</physim_test>
<physim_time_threshold>150</physim_time_threshold>
<physim_run_args>-n1000 -s30 -S30.2 -m5 -r273 -R273 -C10 -P --loader.ldpc.shlibversion _t2 --nrLDPC_coding_t2.dpdk_dev d8:00.0 --nrLDPC_coding_t2.dpdk_core_list 11-12</physim_run_args>
<physim_run_args>-n1000 -s30 -S30.2 -m5 -r273 -R273 -C10 -P --loader.ldpc.shlibversion _t2 --nrLDPC_coding_t2.dpdk_dev af:00.0 --nrLDPC_coding_t2.dpdk_core_list 11-12</physim_run_args>
</testCase>
<testCase id="010221">
@@ -134,7 +134,7 @@
<always_exec>true</always_exec>
<physim_test>nr_ulsim</physim_test>
<physim_time_threshold>350</physim_time_threshold>
<physim_run_args>-n1000 -s30 -S30.2 -m15 -r273 -R273 -C10 -P --loader.ldpc.shlibversion _t2 --nrLDPC_coding_t2.dpdk_dev d8:00.0 --nrLDPC_coding_t2.dpdk_core_list 11-12</physim_run_args>
<physim_run_args>-n1000 -s30 -S30.2 -m15 -r273 -R273 -C10 -P --loader.ldpc.shlibversion _t2 --nrLDPC_coding_t2.dpdk_dev af:00.0 --nrLDPC_coding_t2.dpdk_core_list 11-12</physim_run_args>
</testCase>
<testCase id="010231">
@@ -152,7 +152,7 @@
<always_exec>true</always_exec>
<physim_test>nr_ulsim</physim_test>
<physim_time_threshold>550</physim_time_threshold>
<physim_run_args>-n1000 -s30 -S30.2 -m25 -r273 -R273 -C10 -P --loader.ldpc.shlibversion _t2 --nrLDPC_coding_t2.dpdk_dev d8:00.0 --nrLDPC_coding_t2.dpdk_core_list 11-12</physim_run_args>
<physim_run_args>-n1000 -s30 -S30.2 -m25 -r273 -R273 -C10 -P --loader.ldpc.shlibversion _t2 --nrLDPC_coding_t2.dpdk_dev af:00.0 --nrLDPC_coding_t2.dpdk_core_list 11-12</physim_run_args>
</testCase>
<testCase id="010311">
@@ -170,7 +170,7 @@
<always_exec>true</always_exec>
<physim_test>nr_ulsim</physim_test>
<physim_time_threshold>250</physim_time_threshold>
<physim_run_args>-n1000 -s30 -S30.2 -m5 -r273 -R273 -C10 -W2 -z2 -y2 -P --loader.ldpc.shlibversion _t2 --nrLDPC_coding_t2.dpdk_dev d8:00.0 --nrLDPC_coding_t2.dpdk_core_list 11-12</physim_run_args>
<physim_run_args>-n1000 -s30 -S30.2 -m5 -r273 -R273 -C10 -W2 -z2 -y2 -P --loader.ldpc.shlibversion _t2 --nrLDPC_coding_t2.dpdk_dev af:00.0 --nrLDPC_coding_t2.dpdk_core_list 11-12</physim_run_args>
</testCase>
<testCase id="010321">
@@ -188,7 +188,7 @@
<always_exec>true</always_exec>
<physim_test>nr_ulsim</physim_test>
<physim_time_threshold>650</physim_time_threshold>
<physim_run_args>-n1000 -s30 -S30.2 -m15 -r273 -R273 -C10 -W2 -z2 -y2 -P --loader.ldpc.shlibversion _t2 --nrLDPC_coding_t2.dpdk_dev d8:00.0 --nrLDPC_coding_t2.dpdk_core_list 11-12</physim_run_args>
<physim_run_args>-n1000 -s30 -S30.2 -m15 -r273 -R273 -C10 -W2 -z2 -y2 -P --loader.ldpc.shlibversion _t2 --nrLDPC_coding_t2.dpdk_dev af:00.0 --nrLDPC_coding_t2.dpdk_core_list 11-12</physim_run_args>
</testCase>
<testCase id="010331">
@@ -206,7 +206,7 @@
<always_exec>true</always_exec>
<physim_test>nr_ulsim</physim_test>
<physim_time_threshold>1100</physim_time_threshold>
<physim_run_args>-n1000 -s30 -S30.2 -m25 -r273 -R273 -C10 -W2 -z2 -y2 -P --loader.ldpc.shlibversion _t2 --nrLDPC_coding_t2.dpdk_dev d8:00.0 --nrLDPC_coding_t2.dpdk_core_list 11-12</physim_run_args>
<physim_run_args>-n1000 -s30 -S30.2 -m25 -r273 -R273 -C10 -W2 -z2 -y2 -P --loader.ldpc.shlibversion _t2 --nrLDPC_coding_t2.dpdk_dev af:00.0 --nrLDPC_coding_t2.dpdk_core_list 11-12</physim_run_args>
</testCase>
</testCaseList>

View File

@@ -63,7 +63,7 @@
<always_exec>true</always_exec>
<physim_test>nr_dlsim</physim_test>
<physim_time_threshold>100</physim_time_threshold>
<physim_run_args>-n1000 -s30 -S30.2 -e5 -b106 -R106 -X4,5,6,7,8,9 -P --loader.ldpc.shlibversion _t2 --nrLDPC_coding_t2.dpdk_dev d8:00.0 --nrLDPC_coding_t2.dpdk_core_list 11-12</physim_run_args>
<physim_run_args>-n1000 -s30 -S30.2 -e5 -b106 -R106 -X4,5,6,7,8,9 -P --loader.ldpc.shlibversion _t2 --nrLDPC_coding_t2.dpdk_dev af:00.0 --nrLDPC_coding_t2.dpdk_core_list 11-12</physim_run_args>
</testCase>
<testCase id="000121">
@@ -81,7 +81,7 @@
<always_exec>true</always_exec>
<physim_test>nr_dlsim</physim_test>
<physim_time_threshold>100</physim_time_threshold>
<physim_run_args>-n1000 -s30 -S30.2 -e15 -b106 -R106 -X4,5,6,7,8,9 -P --loader.ldpc.shlibversion _t2 --nrLDPC_coding_t2.dpdk_dev d8:00.0 --nrLDPC_coding_t2.dpdk_core_list 11-12</physim_run_args>
<physim_run_args>-n1000 -s30 -S30.2 -e15 -b106 -R106 -X4,5,6,7,8,9 -P --loader.ldpc.shlibversion _t2 --nrLDPC_coding_t2.dpdk_dev af:00.0 --nrLDPC_coding_t2.dpdk_core_list 11-12</physim_run_args>
</testCase>
<testCase id="000131">
@@ -99,7 +99,7 @@
<always_exec>true</always_exec>
<physim_test>nr_dlsim</physim_test>
<physim_time_threshold>200</physim_time_threshold>
<physim_run_args>-n1000 -s30 -S30.2 -e25 -b106 -R106 -X4,5,6,7,8,9 -P --loader.ldpc.shlibversion _t2 --nrLDPC_coding_t2.dpdk_dev d8:00.0 --nrLDPC_coding_t2.dpdk_core_list 11-12</physim_run_args>
<physim_run_args>-n1000 -s30 -S30.2 -e25 -b106 -R106 -X4,5,6,7,8,9 -P --loader.ldpc.shlibversion _t2 --nrLDPC_coding_t2.dpdk_dev af:00.0 --nrLDPC_coding_t2.dpdk_core_list 11-12</physim_run_args>
</testCase>
<testCase id="000211">
@@ -117,7 +117,7 @@
<always_exec>true</always_exec>
<physim_test>nr_dlsim</physim_test>
<physim_time_threshold>150</physim_time_threshold>
<physim_run_args>-n1000 -s30 -S30.2 -e5 -b273 -R273 -X4,5,6,7,8,9 -P --loader.ldpc.shlibversion _t2 --nrLDPC_coding_t2.dpdk_dev d8:00.0 --nrLDPC_coding_t2.dpdk_core_list 11-12</physim_run_args>
<physim_run_args>-n1000 -s30 -S30.2 -e5 -b273 -R273 -X4,5,6,7,8,9 -P --loader.ldpc.shlibversion _t2 --nrLDPC_coding_t2.dpdk_dev af:00.0 --nrLDPC_coding_t2.dpdk_core_list 11-12</physim_run_args>
</testCase>
<testCase id="000221">
@@ -135,7 +135,7 @@
<always_exec>true</always_exec>
<physim_test>nr_dlsim</physim_test>
<physim_time_threshold>250</physim_time_threshold>
<physim_run_args>-n1000 -s30 -S30.2 -e15 -b273 -R273 -X4,5,6,7,8,9 -P --loader.ldpc.shlibversion _t2 --nrLDPC_coding_t2.dpdk_dev d8:00.0 --nrLDPC_coding_t2.dpdk_core_list 11-12</physim_run_args>
<physim_run_args>-n1000 -s30 -S30.2 -e15 -b273 -R273 -X4,5,6,7,8,9 -P --loader.ldpc.shlibversion _t2 --nrLDPC_coding_t2.dpdk_dev af:00.0 --nrLDPC_coding_t2.dpdk_core_list 11-12</physim_run_args>
</testCase>
<testCase id="000231">
@@ -153,7 +153,7 @@
<always_exec>true</always_exec>
<physim_test>nr_dlsim</physim_test>
<physim_time_threshold>400</physim_time_threshold>
<physim_run_args>-n1000 -s30 -S30.2 -e25 -b273 -R273 -X4,5,6,7,8,9 -P --loader.ldpc.shlibversion _t2 --nrLDPC_coding_t2.dpdk_dev d8:00.0 --nrLDPC_coding_t2.dpdk_core_list 11-12</physim_run_args>
<physim_run_args>-n1000 -s30 -S30.2 -e25 -b273 -R273 -X4,5,6,7,8,9 -P --loader.ldpc.shlibversion _t2 --nrLDPC_coding_t2.dpdk_dev af:00.0 --nrLDPC_coding_t2.dpdk_core_list 11-12</physim_run_args>
</testCase>
<testCase id="000311">
@@ -171,7 +171,7 @@
<always_exec>true</always_exec>
<physim_test>nr_dlsim</physim_test>
<physim_time_threshold>200</physim_time_threshold>
<physim_run_args>-n1000 -s30 -S30.2 -e5 -b273 -R273 -X4,5,6,7,8,9 -x2 -z2 -y2 -P --loader.ldpc.shlibversion _t2 --nrLDPC_coding_t2.dpdk_dev d8:00.0 --nrLDPC_coding_t2.dpdk_core_list 11-12</physim_run_args>
<physim_run_args>-n1000 -s30 -S30.2 -e5 -b273 -R273 -X4,5,6,7,8,9 -x2 -z2 -y2 -P --loader.ldpc.shlibversion _t2 --nrLDPC_coding_t2.dpdk_dev af:00.0 --nrLDPC_coding_t2.dpdk_core_list 11-12</physim_run_args>
</testCase>
<testCase id="000321">
@@ -189,7 +189,7 @@
<always_exec>true</always_exec>
<physim_test>nr_dlsim</physim_test>
<physim_time_threshold>500</physim_time_threshold>
<physim_run_args>-n1000 -s30 -S30.2 -e15 -b273 -R273 -X4,5,6,7,8,9 -x2 -z2 -y2 -P --loader.ldpc.shlibversion _t2 --nrLDPC_coding_t2.dpdk_dev d8:00.0 --nrLDPC_coding_t2.dpdk_core_list 11-12</physim_run_args>
<physim_run_args>-n1000 -s30 -S30.2 -e15 -b273 -R273 -X4,5,6,7,8,9 -x2 -z2 -y2 -P --loader.ldpc.shlibversion _t2 --nrLDPC_coding_t2.dpdk_dev af:00.0 --nrLDPC_coding_t2.dpdk_core_list 11-12</physim_run_args>
</testCase>
<testCase id="000331">
@@ -207,7 +207,7 @@
<always_exec>true</always_exec>
<physim_test>nr_dlsim</physim_test>
<physim_time_threshold>500</physim_time_threshold>
<physim_run_args>-n1000 -s30 -S30.2 -e25 -b273 -R273 -X4,5,6,7,8,9 -x2 -z2 -y2 -P --loader.ldpc.shlibversion _t2 --nrLDPC_coding_t2.dpdk_dev d8:00.0 --nrLDPC_coding_t2.dpdk_core_list 11-12</physim_run_args>
<physim_run_args>-n1000 -s30 -S30.2 -e25 -b273 -R273 -X4,5,6,7,8,9 -x2 -z2 -y2 -P --loader.ldpc.shlibversion _t2 --nrLDPC_coding_t2.dpdk_dev af:00.0 --nrLDPC_coding_t2.dpdk_core_list 11-12</physim_run_args>
</testCase>
<testCase id="000411">
@@ -225,7 +225,7 @@
<always_exec>true</always_exec>
<physim_test>nr_dlsim</physim_test>
<physim_time_threshold>200</physim_time_threshold>
<physim_run_args>-n1000 -s30 -S30.2 -e5 -b273 -R273 -X4,5,6,7,8,9 -x2 -z4 -y4 -P --loader.ldpc.shlibversion _t2 --nrLDPC_coding_t2.dpdk_dev d8:00.0 --nrLDPC_coding_t2.dpdk_core_list 11-12</physim_run_args>
<physim_run_args>-n1000 -s30 -S30.2 -e5 -b273 -R273 -X4,5,6,7,8,9 -x2 -z4 -y4 -P --loader.ldpc.shlibversion _t2 --nrLDPC_coding_t2.dpdk_dev af:00.0 --nrLDPC_coding_t2.dpdk_core_list 11-12</physim_run_args>
</testCase>
<testCase id="000421">
@@ -243,7 +243,7 @@
<always_exec>true</always_exec>
<physim_test>nr_dlsim</physim_test>
<physim_time_threshold>300</physim_time_threshold>
<physim_run_args>-n1000 -s30 -S30.2 -e15 -b273 -R273 -X4,5,6,7,8,9 -x2 -z4 -y4 -P --loader.ldpc.shlibversion _t2 --nrLDPC_coding_t2.dpdk_dev d8:00.0 --nrLDPC_coding_t2.dpdk_core_list 11-12</physim_run_args>
<physim_run_args>-n1000 -s30 -S30.2 -e15 -b273 -R273 -X4,5,6,7,8,9 -x2 -z4 -y4 -P --loader.ldpc.shlibversion _t2 --nrLDPC_coding_t2.dpdk_dev af:00.0 --nrLDPC_coding_t2.dpdk_core_list 11-12</physim_run_args>
</testCase>
<testCase id="000431">
@@ -261,6 +261,6 @@
<always_exec>true</always_exec>
<physim_test>nr_dlsim</physim_test>
<physim_time_threshold>450</physim_time_threshold>
<physim_run_args>-n1000 -s30 -S30.2 -e25 -b273 -R273 -X4,5,6,7,8,9 -x2 -z4 -y4 -P --loader.ldpc.shlibversion _t2 --nrLDPC_coding_t2.dpdk_dev d8:00.0 --nrLDPC_coding_t2.dpdk_core_list 11-12</physim_run_args>
<physim_run_args>-n1000 -s30 -S30.2 -e25 -b273 -R273 -X4,5,6,7,8,9 -x2 -z4 -y4 -P --loader.ldpc.shlibversion _t2 --nrLDPC_coding_t2.dpdk_dev af:00.0 --nrLDPC_coding_t2.dpdk_core_list 11-12</physim_run_args>
</testCase>
</testCaseList>

View File

@@ -65,8 +65,10 @@ services:
networks:
public_net:
ipv4_address: 192.168.71.134
interface_name: eth0
traffic_net:
ipv4_address: 192.168.72.134
interface_name: eth1
oai-ext-dn:
privileged: true
@@ -94,6 +96,8 @@ services:
container_name: rfsim5g-oai-cu
cap_drop:
- ALL
cap_add:
- SYS_NICE
environment:
USE_ADDITIONAL_OPTIONS: --log_config.global_log_options level,nocolor,time
--rfsimulator.options chanmod
@@ -121,6 +125,8 @@ services:
container_name: rfsim5g-oai-du-pci0
cap_drop:
- ALL
cap_add:
- SYS_NICE
environment:
USE_ADDITIONAL_OPTIONS: --rfsim
--log_config.global_log_options level,nocolor,time
@@ -150,6 +156,8 @@ services:
container_name: rfsim5g-oai-du-pci1
cap_drop:
- ALL
cap_add:
- SYS_NICE
environment:
USE_ADDITIONAL_OPTIONS: --rfsim
--log_config.global_log_options level,nocolor,time
@@ -186,13 +194,13 @@ services:
cap_add:
- NET_ADMIN # for interface bringup
- NET_RAW # for ping
- SYS_NICE
environment:
USE_ADDITIONAL_OPTIONS: --rfsim --log_config.global_log_options level,nocolor,time
-r 106 --numerology 1 -C 3619200000
--uicc0.imsi 208990100001100
--rfsimulator.options chanmod
--rfsimulator.serveraddr server
--rfsimulator.hanging-workaround 1
--telnetsrv --telnetsrv.shrmod ciUE --telnetsrv.listenaddr 192.168.71.181 --telnetsrv.listenport 8091
--channelmod.modellist_rfsimu_1.[0].model_name rfsimu_channel_ue0
--channelmod.modellist_rfsimu_1.[1].model_name rfsimu_channel_ue1

View File

@@ -65,8 +65,10 @@ services:
networks:
public_net:
ipv4_address: 192.168.71.134
interface_name: eth0
traffic_net:
ipv4_address: 192.168.72.134
interface_name: eth1
oai-ext-dn:
privileged: true
container_name: rfsim5g-oai-ext-dn

View File

@@ -67,6 +67,18 @@ All the following commands **SHALL** be run from the `ci-scripts/yaml_files/5g_r
For a deployment with the gNB split in CU and DU components, please refer to the `../5g_f1_rfsimulator` folder.
For a deployment with the gNB split in CU-CP, CU-UP, and DU components, please refer to the `../5g_rfsimulator_e1` folder.
Note: **These instructions require `docker compose` v2.36.0 or later** due to the
use of the `interface_name` property, which is necessary for ensuring consistent
IP address assignment to the container interface.
If you're using an older version of `docker compose`, you may encounter the following
error:
```
validating docker-compose.yaml: services.oai-upf.networks.public_net Additional property interface_name is not allowed
```
To update to the required version, you can follow the official Docker documentation:
https://docs.docker.com/compose/install/linux/
## 2.1. Deploy OAI 5G Core Network ##
```bash
@@ -546,8 +558,7 @@ section in the file for details. This includes an image build service as well as
code compilation service. This is necessary as the executable has to be linked
against the same libraries that are present in the executing image. This might
take a while the first time but other that that is very fast. Here is a list of
commands (wait between each command). Tested with `docker compose` v2.27.0
commands (wait between each command). Tested with `docker compose` v2.36.2.
This command deploys OAI 5G Core Network
```bash

View File

@@ -65,8 +65,10 @@ services:
networks:
public_net:
ipv4_address: 192.168.71.134
interface_name: eth0
traffic_net:
ipv4_address: 192.168.72.134
interface_name: eth1
oai-ext-dn:
privileged: true
container_name: rfsim5g-oai-ext-dn
@@ -90,6 +92,8 @@ services:
oai-gnb:
image: ${REGISTRY:-oaisoftwarealliance}/${GNB_IMG:-oai-gnb}:${TAG:-develop}
container_name: rfsim5g-oai-gnb
cap_add:
- SYS_NICE
cap_drop:
- ALL
environment:
@@ -117,6 +121,7 @@ services:
cap_add:
- NET_ADMIN # for interface bringup
- NET_RAW # for ping
- SYS_NICE
environment:
USE_ADDITIONAL_OPTIONS: -E --rfsim -r 106 --numerology 1 --uicc0.imsi 208990100001100 -C 3319680000 --rfsimulator.serveraddr 192.168.71.140 --log_config.global_log_options level,nocolor,time
depends_on:
@@ -143,6 +148,7 @@ services:
cap_add:
- NET_ADMIN # for interface bringup
- NET_RAW # for ping
- SYS_NICE
environment:
USE_ADDITIONAL_OPTIONS: -E --rfsim -r 106 --numerology 1 --uicc0.imsi 208990100001101 -C 3319680000 --rfsimulator.serveraddr 192.168.71.140 --log_config.global_log_options level,nocolor,time
depends_on:
@@ -169,6 +175,7 @@ services:
cap_add:
- NET_ADMIN # for interface bringup
- NET_RAW # for ping
- SYS_NICE
environment:
USE_ADDITIONAL_OPTIONS: -E --rfsim -r 106 --numerology 1 --uicc0.imsi 208990100001102 -C 3319680000 --rfsimulator.serveraddr 192.168.71.140 --log_config.global_log_options level,nocolor,time
depends_on:
@@ -195,6 +202,7 @@ services:
cap_add:
- NET_ADMIN # for interface bringup
- NET_RAW # for ping
- SYS_NICE
environment:
USE_ADDITIONAL_OPTIONS: -E --rfsim -r 106 --numerology 1 --uicc0.imsi 208990100001103 -C 3319680000 --rfsimulator.serveraddr 192.168.71.140 --log_config.global_log_options level,nocolor,time
depends_on:
@@ -221,6 +229,7 @@ services:
cap_add:
- NET_ADMIN # for interface bringup
- NET_RAW # for ping
- SYS_NICE
environment:
USE_ADDITIONAL_OPTIONS: -E --rfsim -r 106 --numerology 1 --uicc0.imsi 208990100001104 -C 3319680000 --rfsimulator.serveraddr 192.168.71.140 --log_config.global_log_options level,nocolor,time
depends_on:
@@ -247,6 +256,7 @@ services:
cap_add:
- NET_ADMIN # for interface bringup
- NET_RAW # for ping
- SYS_NICE
environment:
USE_ADDITIONAL_OPTIONS: -E --rfsim -r 106 --numerology 1 --uicc0.imsi 208990100001105 -C 3319680000 --rfsimulator.serveraddr 192.168.71.140 --log_config.global_log_options level,nocolor,time
depends_on:
@@ -273,6 +283,7 @@ services:
cap_add:
- NET_ADMIN # for interface bringup
- NET_RAW # for ping
- SYS_NICE
environment:
USE_ADDITIONAL_OPTIONS: -E --rfsim -r 106 --numerology 1 --uicc0.imsi 208990100001106 -C 3319680000 --rfsimulator.serveraddr 192.168.71.140 --log_config.global_log_options level,nocolor,time
depends_on:
@@ -299,6 +310,7 @@ services:
cap_add:
- NET_ADMIN # for interface bringup
- NET_RAW # for ping
- SYS_NICE
environment:
USE_ADDITIONAL_OPTIONS: -E --rfsim -r 106 --numerology 1 --uicc0.imsi 208990100001107 -C 3319680000 --rfsimulator.serveraddr 192.168.71.140 --log_config.global_log_options level,nocolor,time
depends_on:
@@ -325,6 +337,7 @@ services:
cap_add:
- NET_ADMIN # for interface bringup
- NET_RAW # for ping
- SYS_NICE
environment:
USE_ADDITIONAL_OPTIONS: -E --rfsim -r 106 --numerology 1 --uicc0.imsi 208990100001108 -C 3319680000 --rfsimulator.serveraddr 192.168.71.140 --log_config.global_log_options level,nocolor,time
depends_on:
@@ -351,6 +364,7 @@ services:
cap_add:
- NET_ADMIN # for interface bringup
- NET_RAW # for ping
- SYS_NICE
environment:
USE_ADDITIONAL_OPTIONS: -E --rfsim -r 106 --numerology 1 --uicc0.imsi 208990100001109 -C 3319680000 --rfsimulator.serveraddr 192.168.71.140 --log_config.global_log_options level,nocolor,time
depends_on:

View File

@@ -65,8 +65,10 @@ services:
networks:
public_net:
ipv4_address: 192.168.71.134
interface_name: eth0
traffic_net:
ipv4_address: 192.168.72.134
interface_name: eth1
oai-ext-dn:
privileged: true
container_name: rfsim5g-oai-ext-dn

View File

@@ -65,8 +65,10 @@ services:
networks:
public_net:
ipv4_address: 192.168.71.134
interface_name: eth0
traffic_net:
ipv4_address: 192.168.72.134
interface_name: eth1
oai-ext-dn:
privileged: true
container_name: rfsim5g-oai-ext-dn
@@ -92,6 +94,8 @@ services:
container_name: rfsim5g-oai-gnb
cap_drop:
- ALL
cap_add:
- SYS_NICE
environment:
USE_ADDITIONAL_OPTIONS: --rfsim --log_config.global_log_options level,nocolor,time
ASAN_OPTIONS: detect_leaks=0
@@ -118,6 +122,7 @@ services:
cap_add:
- NET_ADMIN # for interface bringup
- NET_RAW # for ping
- SYS_NICE
environment:
USE_ADDITIONAL_OPTIONS: --rfsim -r 273 --numerology 1 --band 78 -C 3450720000 --ssb 1518 --ue-nb-ant-tx 2 --uicc0.imsi 208990100001100 --ue-nb-ant-rx 2 --uecap_file /opt/oai-nr-ue/etc/uecap.xml --rfsimulator.serveraddr 192.168.71.140 --log_config.global_log_options level,nocolor,time
depends_on:

View File

@@ -65,8 +65,10 @@ services:
networks:
core_net:
ipv4_address: 192.168.71.134
interface_name: eth0
traffic_net:
ipv4_address: 192.168.72.134
interface_name: eth1
oai-cucp:
image: ${REGISTRY:-oaisoftwarealliance}/${GNB_IMG:-oai-gnb}:${TAG:-develop}

View File

@@ -65,8 +65,10 @@ services:
networks:
public_net:
ipv4_address: 192.168.71.134
interface_name: eth0
traffic_net:
ipv4_address: 192.168.72.134
interface_name: eth1
oai-ext-dn:
privileged: true
container_name: rfsim5g-oai-ext-dn

View File

@@ -65,8 +65,10 @@ services:
networks:
public_net:
ipv4_address: 192.168.71.134
interface_name: eth0
traffic_net:
ipv4_address: 192.168.72.134
interface_name: eth1
oai-ext-dn:
privileged: true
container_name: rfsim5g-oai-ext-dn

View File

@@ -63,8 +63,10 @@ services:
networks:
public_net:
ipv4_address: 192.168.71.134
interface_name: eth0
traffic_net:
ipv4_address: 192.168.72.134
interface_name: eth1
oai-ext-dn:
privileged: true
container_name: rfsim5g-oai-ext-dn

View File

@@ -60,11 +60,3 @@ networks:
- subnet: 192.168.71.128/26
driver_opts:
com.docker.network.bridge.name: "rfsim5g-public"
traffic_net:
driver: bridge
name: rfsim5g-oai-traffic-net
ipam:
config:
- subnet: 192.168.72.128/26
driver_opts:
com.docker.network.bridge.name: "rfsim5g-traffic"

View File

@@ -65,8 +65,10 @@ services:
networks:
public_net:
ipv4_address: 192.168.71.134
interface_name: eth0
traffic_net:
ipv4_address: 192.168.72.134
interface_name: eth1
oai-ext-dn:
privileged: true
container_name: rfsim5g-oai-ext-dn
@@ -145,7 +147,7 @@ services:
- NET_ADMIN # for interface bringup
- NET_RAW # for ping
environment:
USE_ADDITIONAL_OPTIONS: --rfsim -r 25 --numerology 0 --uicc0.imsi 208990100001100 --band 66 -C 2152680000 --CO -400000000 --ssb 48 --rfsimulator.serveraddr 192.168.71.141 --log_config.global_log_options level,nocolor,time
USE_ADDITIONAL_OPTIONS: --rfsim -r 25 --numerology 0 --uicc0.imsi 208990100001100 --band 66 -C 2152680000 --CO -400000000 --ssb 48 --rfsimulator.serveraddr 192.168.71.141 --extra-pdu-id 2 --log_config.global_log_options level,nocolor,time
depends_on:
- oai-pnf
networks:

View File

@@ -17,7 +17,7 @@ services:
#entrypoint: /bin/bash -c "sleep infinity"
environment:
TZ: Europe/Paris
USE_ADDITIONAL_OPTIONS: --usrp-args type=n3xx,name=ni-n3xx-31641B9,addr=192.168.10.2 -r 106 --numerology 1 --band 78 -C 3511200000 --ue-fo-compensation --ue-rxgain 65 --tune-offset 20000000 -A 90 --log_config.global_log_options level,nocolor,time --uicc0.imsi 001020000000111 --uicc0.nssai_sd 16777215
USE_ADDITIONAL_OPTIONS: --usrp-args type=n3xx,name=ni-n3xx-31641B9,addr=192.168.10.2 -r 106 --numerology 1 --band 78 -C 3425010000 --ssb 509 --ue-fo-compensation --ue-rxgain 65 --tune-offset 20000000 -A 90 --log_config.global_log_options level,nocolor,time --uicc0.imsi 001020000000111 --uicc0.nssai_sd 16777215
volumes:
- ../../conf_files/ue.sa.conf:/opt/oai-nr-ue/etc/nr-ue.conf
healthcheck:

View File

@@ -34,7 +34,6 @@ source "$THIS_SCRIPT_PATH"/tools/build_helper
set_openair_env
# Variables for UE data generation
gen_nvram_path=$OPENAIR_DIR/cmake_targets/ran_build/build
conf_nvram_path=$OPENAIR_DIR/openair3/NAS/TOOLS/ue_eurecom_test_sfr.conf
HW=""
@@ -93,13 +92,11 @@ Options:
Makes the NR UE softmodem
--UE-conf-nvram [configuration file]
Specify conf_nvram_path (default \"$conf_nvram_path\")
--UE-gen-nvram [output path]
Specify gen_nvram_path (default \"$gen_nvram_path\")
-w | --hardware
USRP, BLADERF, LMSSDR, IRIS, SIMU, AW2SORI, AERIAL, None (Default)
Adds this RF board support (in external packages installation and in compilation)
-t | --transport
Selects the transport protocol type, options: None, Ethernet, benetel4g, benetel5g, oran_fhlib_5g, oran_fhlib_5g_mplane
Selects the transport protocol type, options: None, Ethernet, benetel4g, benetel5g, oran_fhlib_5g, oran_fhlib_5g_mplane, WLS
-P | --phy_simulators
Makes the unitary tests Layer 1 simulators
-s | --check
@@ -244,7 +241,7 @@ function main() {
shift;;
--UE)
UE=1
TARGET_LIST="$TARGET_LIST lte-uesoftmodem"
TARGET_LIST="$TARGET_LIST lte-uesoftmodem conf2uedata usim nvram"
echo_info "Will compile UE"
shift;;
--nrUE)
@@ -259,9 +256,6 @@ function main() {
--UE-conf-nvram)
conf_nvram_path=$(readlink -f "$2")
shift 2;;
--UE-gen-nvram)
gen_nvram_path=$(readlink -f "$2")
shift 2;;
-w | --hardware)
case "$2" in
"USRP" | "BLADERF" | "LMSSDR" | "IRIS")
@@ -308,6 +302,9 @@ function main() {
TARGET_LIST="$TARGET_LIST $2"
CMAKE_CMD="$CMAKE_CMD -DOAI_FHI72=ON -DOAI_FHI72_MPLANE=ON"
;;
"WLS"|"Wls"|"wls")
CMAKE_CMD="$CMAKE_CMD -DOAI_WLS=ON"
;;
"None")
;;
*)
@@ -510,18 +507,7 @@ function main() {
fi
if [ "$UE" = 1 ] ; then
echo_info "Compiling UE specific part"
[ "$CLEAN" = "1" ] && rm -rf $DIR/nas_sim_tools/build
mkdir -p $DIR/nas_sim_tools/build
cd $DIR/nas_sim_tools/build
${CMAKE_CMD% *} ..
compilations nas_sim_tools usim.txt "usim" "${BUILD_TOOL_OPT}"
compilations nas_sim_tools nvram.txt "nvram" "${BUILD_TOOL_OPT}"
compilations nas_sim_tools conf2uedata.txt "conf2uedata" "${BUILD_TOOL_OPT}"
echo_info "Generate LTE USIM default sim content UE specific part"
# generate USIM data
if [ -f conf2uedata ]; then
install_nas_tools $conf_nvram_path $DIR/$BUILD_DIR/build "$DIR/$BUILD_DIR/build/conf2uedata.txt"

View File

@@ -1,79 +0,0 @@
cmake_minimum_required(VERSION 3.5)
project(NAS_SIM_TOOLS)
include(FindPkgConfig)
pkg_search_module(CONFIG libconfig REQUIRED)
include_directories(${CONFIG_INCLUDE_DIRS})
add_definitions(-std=gnu99)
include("../macros.cmake")
ENABLE_LANGUAGE(C)
set(CMAKE_C_FLAGS
"${CMAKE_C_FLAGS} ${C_FLAGS_PROCESSOR} -Werror -Wall -Wstrict-prototypes -g")
set(OPENAIR_DIR $ENV{OPENAIR_DIR})
set(OPENAIR3_DIR $ENV{OPENAIR_DIR}/openair3)
include_directories (${OPENAIR_DIR}/openair2/COMMON)
include_directories (${OPENAIR_DIR})
set(CONF2UEDATA_LIB_SRC
${OPENAIR_DIR}/openair3/NAS/TOOLS/conf_emm.c
${OPENAIR_DIR}/openair3/NAS/TOOLS/conf_user_data.c
${OPENAIR_DIR}/openair3/NAS/TOOLS/conf_usim.c
${OPENAIR_DIR}/openair3/NAS/TOOLS/conf_network.c
${OPENAIR_DIR}/openair3/NAS/TOOLS/conf_user_plmn.c
${OPENAIR_DIR}/openair3/NAS/TOOLS/conf_parser.c
${OPENAIR_DIR}/openair3/NAS/TOOLS/fs.c
${OPENAIR_DIR}/openair3/NAS/TOOLS/display.c
${OPENAIR_DIR}/openair3/NAS/UE/API/USIM/usim_api.c
${OPENAIR_DIR}/openair3/NAS/UE/API/USIM/aka_functions.c
${OPENAIR_DIR}/common/utils/mem/memory.c
${OPENAIR_DIR}/openair3/NAS/COMMON/UTIL/OctetString.c
${OPENAIR_DIR}/common/utils/utils.c
)
include_directories(
${OPENAIR_DIR}/common/utils
${OPENAIR_DIR}/openair3/NAS/UE
${OPENAIR_DIR}/openair3/NAS/COMMON
${OPENAIR_DIR}/openair3/NAS/UE/API/USER
${OPENAIR_DIR}/openair3/NAS/UE/API/USIM
${OPENAIR_DIR}/openair3/NAS/UE/EMM/
${OPENAIR_DIR}/openair3/NAS/UE/ESM/
${OPENAIR_DIR}/openair3/NAS/COMMON/IES/
${OPENAIR_DIR}/openair3/NAS/COMMON/UTIL
)
# conf2uedata binary
set(conf2uedata_SRC
${OPENAIR_DIR}/openair3/NAS/TOOLS/conf2uedata.c
${CONF2UEDATA_LIB_SRC}
)
add_executable(conf2uedata ${conf2uedata_SRC} )
target_link_libraries(conf2uedata ${CONFIG_LIBRARIES})
# usim binary
set(usim_SRC
${OPENAIR_DIR}/openair3/NAS/TOOLS/usim.c
${CONF2UEDATA_LIB_SRC}
)
add_executable(usim ${usim_SRC} )
target_link_libraries(usim ${CONFIG_LIBRARIES})
# nvram binary
set(nvram_SRC
${OPENAIR_DIR}/openair3/NAS/TOOLS/nvram.c
${CONF2UEDATA_LIB_SRC}
)
add_executable(nvram ${nvram_SRC})
target_link_libraries(nvram ${CONFIG_LIBRARIES})

View File

@@ -126,12 +126,9 @@ find_package_handle_standard_args(xran
VERSION_VAR xran_VERSION
)
# in proper usage of cmake, include directory should only contain "api", but not header files under "src" directory;
# however, we use xran_dev_get_ctx() and xran_dev_get_ctx_by_id() functions which are defined in xran_common.h;
# since xran_common.h is under "src" directory, we have to include it in ${xran_INCLUDE_DIRS}
if(xran_FOUND)
set(xran_LIBRARIES ${xran_LIBRARY})
set(xran_INCLUDE_DIRS ${xran_INCLUDE_DIR} ${xran_INCLUDE_DIR}/../src)
set(xran_INCLUDE_DIRS ${xran_INCLUDE_DIR})
endif()
if(xran_FOUND AND NOT TARGET xran::xran)

View File

@@ -177,7 +177,6 @@ clean_all_files() {
dir=$OPENAIR_DIR/cmake_targets
rm -rf $dir/ran_build $dir/ran_build_noLOG
rm -rf $dir/lte-simulators/build
rm -rf $dir/nas_sim_tools/build
rm -rf $dir/oaisim_build_oai/build $dir/oaisim_build_oai/CMakeLists.txt
rm -rf $dir/autotests/bin $dir/autotests/log $dir/autotests/*/build
}

View File

@@ -0,0 +1,209 @@
diff --git a/wls_lib/Makefile b/wls_lib/Makefile
index 2f8e4b2..e657488 100644
--- a/wls_lib/Makefile
+++ b/wls_lib/Makefile
@@ -1,20 +1,6 @@
-###############################################################################
-#
-# Copyright (c) 2021 Intel.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-###############################################################################
+################################################################
+# <COPYRIGHT_TAG>
+################################################################
MYCUSTOMTAB=' '
MYCUSTOMSPACE='============================================================================================'
@@ -24,11 +10,17 @@ MYCUSTOMSPACE1='------------------------------------------------------------'
# Tools configuration
##############################################################
ifeq ($(WIRELESS_SDK_TOOLCHAIN),icc)
-CC := icc
+ CC := icc
CPP := icpc
-AS := as
-AR := ar
-LD := icc
+ AS := as
+ AR := ar
+ LD := icc
+else ifeq ($(WIRELESS_SDK_TOOLCHAIN),gcc)
+ CC := gcc
+ CPP := g++
+ AS := as
+ AR := ar
+ LD := gcc
else ifeq ($(WIRELESS_SDK_TOOLCHAIN),icx)
CC := icx
CPP := icx
@@ -44,9 +36,9 @@ ifeq ($(WIRELESS_SDK_TARGET_ISA),sse)
else ifeq ($(WIRELESS_SDK_TARGET_ISA),avx2)
TARGET_PROCESSOR := -xCORE-AVX2
else ifeq ($(WIRELESS_SDK_TARGET_ISA),avx512)
- TARGET_PROCESSOR := -xCORE-AVX512
+ TARGET_PROCESSOR := -march=skylake-avx512
else ifeq ($(WIRELESS_SDK_TARGET_ISA),snc)
- TARGET_PROCESSOR := -xicelake-server
+ TARGET_PROCESSOR := -march=icelake-server
else ifeq ($(WIRELESS_SDK_TARGET_ISA),spr)
TARGET_PROCESSOR := -march=sapphirerapids
endif
@@ -66,15 +58,38 @@ PROJECT_DIR := ./
BUILDDIR := make
PROJECT_BINARY := $(PROJECT_NAME).so
+PKGCONF ?= pkg-config
+LIBDPDK_VERSION=20.11.3
+
+ifeq ($(shell $(PKGCONF) --modversion "libdpdk = '$(LIBDPDK_VERSION)'"),$(LIBDPDK_VERSION))
+ DPDK_INSTALLED=1
+else
+ DPDK_INSTALLED=0
+endif
+
ifeq ($(RTE_SDK),)
-$(error "Please define RTE_SDK environment variable")
+ifeq ($(DPDK_INSTALLED),0)
+$(error "Please define RTE_SDK environment variable OR install DPDK version $(LIBDPDK_VERSION)")
+endif
endif
-RTE_INC := $(shell PKG_CONFIG_PATH=/usr/lib64/pkgconfig:$(RTE_SDK)/build/meson-uninstalled pkgconf --cflags-only-I libdpdk)
+# At least one of the options is defined
+
+ifneq ($(RTE_SDK),)
+ RTE_INC := $(shell PKG_CONFIG_PATH=/usr/lib64/pkgconfig:$(RTE_SDK)/build/meson-uninstalled pkgconf --cflags-only-I libdpdk)
+else ifeq ($(DPDK_INSTALLED),1)
+ RTE_INC := $(shell PKG_CONFIG_PATH=/usr/lib64/pkgconfig $(PKGCONF) --cflags-only-I libdpdk)
+endif
CC_SRC = wls_lib_dpdk.c \
syslib.c
+CC_HDR = syslib.h \
+ ttypes.h \
+ wls.h \
+ wls_debug.h \
+ wls_lib.h
+
CC_FLAGS += -std=gnu11 -Wall -Wno-deprecated-declarations \
-fdata-sections \
-ffunction-sections \
@@ -84,18 +99,19 @@ CC_FLAGS += -std=gnu11 -Wall -Wno-deprecated-declarations \
-Wimplicit-function-declaration \
-g -O3 -mcmodel=large $(TARGET_PROCESSOR)
-INC := -I$(RTE_INC)
+INC := -I$(RTE_INC) -I../intel_fapi/
DEF :=
AS_FLAGS :=
AR_FLAGS := rc
PROJECT_OBJ_DIR := $(BUILDDIR)/obj
+PROJECT_DEP_DIR := $(PROJECT_OBJ_DIR)/$(PROJECT_NAME).dep.d
CC_OBJS := $(patsubst %.c,%.o,$(CC_SRC))
AS_OBJS := $(patsubst %.s,%.o,$(AS_SRC))
OBJS := $(CC_OBJS) $(AS_OBJS) $(LIBS)
-DIRLIST := $(addprefix $(PROJECT_OBJ_DIR)/,$(sort $(dir $(OBJS))))
+DIRLIST := $(addprefix $(PROJECT_OBJ_DIR)/,$(sort $(dir $(OBJS)))) $(PROJECT_DEP_DIR)
CC_OBJTARGETS := $(addprefix $(PROJECT_OBJ_DIR)/,$(CC_OBJS))
@@ -104,9 +120,7 @@ CC_FLAGS_FULL := $(CC_FLAGS) $(INC) $(DEF)
AS_FLAGS := $(AS_FLAGS) $(INC)
-PROJECT_DEP_FILE := $(PROJECT_OBJ_DIR)/$(PROJECT_NAME).dep
-
-ifeq ($(wildcard $(PROJECT_DEP_FILE)),$(PROJECT_DEP_FILE))
+ifeq ($(wildcard $(PROJECT_DEP_DIR)),$(PROJECT_DEP_DIR))
GENERATE_DEPS :=
else
@@ -119,11 +133,11 @@ all : welcome_line $(PROJECT_BINARY)
.PHONY : clear_dep
clear_dep:
- @$(RM) $(PROJECT_DEP_FILE)
- @echo [DEP] $(subst $(PROJECT_OBJ_DIR)/,,$(PROJECT_DEP_FILE))
+ @echo [DEP] rm $(PROJECT_DEP_DIR)/$(@F).dep
+ @$(RM) $(PROJECT_DEP_DIR)/$(@F).dep
-$(CC_DEPS) :
- @$(CC) -MM $(subst __up__,../,$(subst __dep__,,$@)) -MT $(PROJECT_OBJ_DIR)/$(patsubst %.c,%.o,$(subst __up__,../,$(subst __dep__,,$@))) $(CC_FLAGS_FULL) >> $(PROJECT_DEP_FILE)
+$(CC_DEPS) : $(PROJECT_DEP_DIR)
+ @$(CC) $(CC_FLAGS_FULL) -MM $(subst __up__,../,$(subst __dep__,,$@)) -MT $(PROJECT_OBJ_DIR)/$(patsubst %.c,%.o,$(subst __up__,../,$(subst __dep__,,$@))) >> $(PROJECT_DEP_DIR)/$(@F).dep
.PHONY : generate_deps
generate_deps : clear_dep $(CC_DEPS)
@@ -136,17 +150,17 @@ echo_start_build :
$(DIRLIST) :
-@$(MD) $@
-$(CC_OBJTARGETS) :
+$(CC_OBJTARGETS) : $(GENERATE_DEPS)
@echo [CC] $(subst $(PROJECT_OBJ_DIR)/,,$@)
@$(CC) -c $(CC_FLAGS_FULL) -o"$@" $(patsubst %.o,%.c,$(subst $(PROJECT_OBJ_DIR)/,,$@))
-$(AS_OBJTARGETS) :
+$(AS_OBJTARGETS) : $(CC_OBJTARGETS) $(CPP_OBJTARGETS)
@echo [AS] $(subst $(PROJECT_OBJ_DIR)/,,$@)
@$(AS) $(AS_FLAGS) -o"$@" $(patsubst %.o,%.s,$(subst $(PROJECT_OBJ_DIR)/,,$@))
-ifeq ($(wildcard $(PROJECT_DEP_FILE)),$(PROJECT_DEP_FILE))
+ifeq ($(wildcard $(PROJECT_DEP_DIR)),$(PROJECT_DEP_DIR))
-include $(PROJECT_DEP_FILE)
+include $(PROJECT_DEP_DIR)/*
endif
@@ -156,7 +170,7 @@ clean:
@$(RM) $(CC_OBJTARGETS) $(AS_OBJTARGETS)
ifneq ($(wildcard $(PROJECT_DIR)/$(PROJECT_MAKE)),)
@echo [CLEAN] : $(PROJECT_NAME)
- @$(RM) $(PROJECT_BINARY) $(PROJECT_BINARY_LIB) $(PROJECT_DEP_FILE)
+ @$(RM) -rf $(PROJECT_BINARY) $(PROJECT_BINARY_LIB) $(PROJECT_DEP_DIR)
endif
xclean: clean
@@ -172,7 +186,24 @@ welcome_line :
debug : all
release : all
-$(PROJECT_BINARY) : $(DIRLIST) echo_start_build $(GENERATE_DEPS) $(PRE_BUILD) $(CC_OBJTARGETS) $(AS_OBJTARGETS)
+$(PROJECT_BINARY) : $(DIRLIST) echo_start_build $(GENERATE_DEPS) $(CC_OBJTARGETS) $(AS_OBJTARGETS)
@echo [AR] $(subst $(BUILDDIR)/,,$@)
@$(CC) $(CC_OBJTARGETS) $(AS_OBJTARGETS) -shared -fPIC -o $@
+##############################################################
+# Install configuration
+##############################################################
+
+INSTALL_DIR := /usr/local
+INCLUDE_DIR := $(INSTALL_DIR)/include/
+
+.PHONY : install
+install: $(PROJECT_BINARY) install_headers
+ @echo [INSTALL] : $(PROJECT_BINARY)
+ @$(CP) $(PROJECT_BINARY) $(INSTALL_DIR)/lib
+
+.PHONY : install_headers
+install_headers: $(CC_SRC)
+ @echo [INSTALL] : $(PROJECT_NAME) headers
+ @$(MD) $(INCLUDE_DIR)
+ @$(CP) $(CC_HDR) $(INCLUDE_DIR)

View File

@@ -1,5 +1,5 @@
diff --git a/fhi_lib/app/src/common.h b/fhi_lib/app/src/common.h
index 7508117..ce17ebd 100644
index 7508117..318508b 100644
--- a/fhi_lib/app/src/common.h
+++ b/fhi_lib/app/src/common.h
@@ -28,7 +28,7 @@
@@ -7,12 +7,12 @@ index 7508117..ce17ebd 100644
#include <rte_mbuf.h>
-#define VERSIONX "oran_e_maintenance_release_v1.0"
+#define VERSIONX "oran_e_maintenance_release_v1.5"
+#define VERSIONX "oran_e_maintenance_release_v1.6"
#define APP_O_DU 0
#define APP_O_RU 1
diff --git a/fhi_lib/lib/Makefile b/fhi_lib/lib/Makefile
index de141bf..fa2923f 100644
index de141bf..c2a448d 100644
--- a/fhi_lib/lib/Makefile
+++ b/fhi_lib/lib/Makefile
@@ -23,12 +23,25 @@ MYCUSTOMSPACE1='------------------------------------------------------------'
@@ -50,9 +50,9 @@ index de141bf..fa2923f 100644
-RTE_INC := $(shell PKG_CONFIG_PATH=/usr/lib64/pkgconfig:$(RTE_SDK)/build/meson-uninstalled pkgconf --cflags-only-I libdpdk)
+ifeq ($(TARGET), x86)
+RTE_INC := $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH):/usr/lib64/pkgconfig:$(RTE_SDK)/build/meson-uninstalled pkgconf --cflags-only-I libdpdk)
+RTE_INC := $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH):/usr/lib64/pkgconfig:$(RTE_SDK)/build/meson-uninstalled pkg-config --cflags-only-I libdpdk)
+else ifeq ($(TARGET), armv8)
+RTE_INC := $(pkgconf --cflags-only-I libdpdk)
+RTE_INC := $(shell pkg-config --cflags-only-I libdpdk)
+endif
API_DIR := $(PROJECT_DIR)/api
SRC_DIR := $(PROJECT_DIR)/src
@@ -85,7 +85,7 @@ index de141bf..fa2923f 100644
CC_FLAGS += -std=gnu11 -Wall -Wno-deprecated-declarations \
-fdata-sections \
@@ -112,12 +132,21 @@ CC_FLAGS += -std=gnu11 -Wall -Wno-deprecated-declarations \
@@ -112,14 +132,23 @@ CC_FLAGS += -std=gnu11 -Wall -Wno-deprecated-declarations \
-fPIC \
-Wall \
-Wimplicit-function-declaration \
@@ -110,8 +110,11 @@ index de141bf..fa2923f 100644
+ -Werror -Wno-unused-variable -std=c++14
+endif
INC := -I$(API_DIR) -I$(ETH_DIR) -I$(SRC_DIR) -I$(RTE_INC)
-INC := -I$(API_DIR) -I$(ETH_DIR) -I$(SRC_DIR) -I$(RTE_INC)
+INC := -I$(API_DIR) -I$(ETH_DIR) -I$(SRC_DIR) $(RTE_INC)
DEF :=
ifeq ($(MLOG),1)
INC += -I$(MLOG_DIR)/source
@@ -150,8 +179,13 @@ CPP_SNC_OBJTARGETS := $(addprefix $(PROJECT_OBJ_DIR)/,$(CPP_OBJS_SNC))
AS_OBJTARGETS := $(addprefix $(PROJECT_OBJ_DIR)/,$(AS_OBJS))

View File

@@ -1,5 +1,5 @@
diff --git a/fhi_lib/app/src/common.h b/fhi_lib/app/src/common.h
index ac5f471..9ebbcab 100644
index ac5f471..5efcce3 100644
--- a/fhi_lib/app/src/common.h
+++ b/fhi_lib/app/src/common.h
@@ -28,7 +28,7 @@
@@ -7,12 +7,12 @@ index ac5f471..9ebbcab 100644
#include <rte_mbuf.h>
-#define VERSIONX "oran_f_release_v1.0"
+#define VERSIONX "oran_f_release_v1.3"
+#define VERSIONX "oran_f_release_v1.4"
#define APP_O_DU 0
#define APP_O_RU 1
diff --git a/fhi_lib/lib/Makefile b/fhi_lib/lib/Makefile
index eccc4ae..b1b8f4b 100644
index eccc4ae..a97fdc6 100644
--- a/fhi_lib/lib/Makefile
+++ b/fhi_lib/lib/Makefile
@@ -23,24 +23,46 @@ MYCUSTOMSPACE1='------------------------------------------------------------'
@@ -83,9 +83,9 @@ index eccc4ae..b1b8f4b 100644
RTE_TARGET ?= x86_64-native-linux-icc
-RTE_INC := $(shell PKG_CONFIG_PATH=/usr/lib64/pkgconfig:$(RTE_SDK)/build/meson-uninstalled pkgconf --cflags-only-I libdpdk)
+ifeq ($(TARGET), x86)
+RTE_INC := $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH):/usr/lib64/pkgconfig:$(RTE_SDK)/build/meson-uninstalled pkgconf --cflags-only-I libdpdk)
+RTE_INC := $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH):/usr/lib64/pkgconfig:$(RTE_SDK)/build/meson-uninstalled pkg-config --cflags-only-I libdpdk)
+else ifeq ($(TARGET), armv8)
+RTE_INC := $(pkgconf --cflags-only-I libdpdk)
+RTE_INC := $(shell pkg-config --cflags-only-I libdpdk)
+endif
API_DIR := $(PROJECT_DIR)/api
@@ -147,6 +147,15 @@ index eccc4ae..b1b8f4b 100644
ifeq ($(WIRELESS_SDK_TOOLCHAIN),icc)
CPP_FLAGS += -fp-model fast=2 -no-prec-div -no-prec-sqrt -fast-transcendentals -restrict
@@ -150,7 +187,7 @@ CPP_FLAGS += -fp-model fast -march=icelake-server -mintrinsic-promote -Wno-unus
endif
-INC := -I$(API_DIR) -I$(ETH_DIR) -I$(SRC_DIR) -I$(RTE_INC)
+INC := -I$(API_DIR) -I$(ETH_DIR) -I$(SRC_DIR) $(RTE_INC)
DEF :=
ifeq ($(MLOG),1)
INC += -I$(MLOG_DIR)/source
@@ -186,8 +223,13 @@ CPP_SNC_OBJTARGETS := $(addprefix $(PROJECT_OBJ_DIR)/,$(CPP_OBJS_SNC))
AS_OBJTARGETS := $(addprefix $(PROJECT_OBJ_DIR)/,$(AS_OBJS))
@@ -164,7 +173,7 @@ index eccc4ae..b1b8f4b 100644
CPP_FLAGS_FULL := $(CPP_FLAGS) $(CPP_COMP) $(INC) $(DEF)
CPP_FLAGS_FULL_SNC := $(CPP_FLAGS) $(CPP_COMP_SNC) $(INC) $(DEF)
diff --git a/fhi_lib/lib/api/xran_fh_o_du.h b/fhi_lib/lib/api/xran_fh_o_du.h
index bacf597..8bd7c66 100644
index bacf597..1dd6d66 100644
--- a/fhi_lib/lib/api/xran_fh_o_du.h
+++ b/fhi_lib/lib/api/xran_fh_o_du.h
@@ -141,7 +141,7 @@ extern "C" {
@@ -176,7 +185,15 @@ index bacf597..8bd7c66 100644
#define XRAN_MAX_SET_BFWS (64) /**< Assumed 64Ant, BFP 9bit with 9K jumbo frame */
#define XRAN_MAX_PKT_BURST (448+4) /**< 4x14x8 symbols per ms */
@@ -1193,6 +1193,31 @@ int32_t xran_reg_physide_cb_by_dev_id(void *pHandle, xran_fh_tti_callback_fn Cb,
@@ -419,6 +419,7 @@ struct xran_io_cfg {
uint16_t num_rxq; /**< number of RX queues per VF */
char *dpdk_dev[XRAN_VF_MAX]; /**< VFs devices */
char *bbdev_dev[1]; /**< BBDev dev name */
+ char *bbdev_vfio_vf_token[1]; /**< BBDev dev token */
int32_t bbdev_mode; /**< DPDK for BBDev */
uint32_t dpdkIoVaMode; /**< IOVA Mode */
uint32_t dpdkMemorySize; /**< DPDK max memory allocation */
@@ -1193,6 +1194,31 @@ int32_t xran_reg_physide_cb_by_dev_id(void *pHandle, xran_fh_tti_callback_fn Cb,
*/
int32_t xran_get_slot_idx (uint32_t PortId, uint32_t *nFrameIdx, uint32_t *nSubframeIdx, uint32_t *nSlotIdx, uint64_t *nSecond);
@@ -259,7 +276,7 @@ index 46e0e1d..409ef4b 100644
int xran_prepare_iq_symbol_portion(
struct rte_mbuf *mbuf,
diff --git a/fhi_lib/lib/ethernet/ethdi.c b/fhi_lib/lib/ethernet/ethdi.c
index f5b2fd6..144a65e 100644
index f5b2fd6..8fb0ec2 100644
--- a/fhi_lib/lib/ethernet/ethdi.c
+++ b/fhi_lib/lib/ethernet/ethdi.c
@@ -37,7 +37,10 @@
@@ -273,8 +290,37 @@ index f5b2fd6..144a65e 100644
#include <numa.h>
#include <rte_config.h>
#include <rte_common.h>
@@ -325,8 +328,8 @@ xran_ethdi_init_dpdk_io(char *name, const struct xran_io_cfg *io_cfg,
@@ -185,14 +188,24 @@ static void check_port_link_status(uint8_t portid)
printf("Port %d Link Up - speed %u "
"Mbps - %s\n", (uint8_t)portid,
(unsigned)link.link_speed,
+#if (RTE_VER_YEAR >= 21)
+ (link.link_duplex == RTE_ETH_LINK_FULL_DUPLEX) ?
+ ("full-duplex") : ("half-duplex\n")
+#else
(link.link_duplex == ETH_LINK_FULL_DUPLEX) ?
- ("full-duplex") : ("half-duplex\n"));
+ ("full-duplex") : ("half-duplex\n")
+#endif
+ );
else
printf("Port %d Link Down\n",
(uint8_t)portid);
}
/* clear all_ports_up flag if any link down */
+#if (RTE_VER_YEAR >= 21)
+ if (link.link_status == RTE_ETH_LINK_DOWN) {
+#else
if (link.link_status == ETH_LINK_DOWN) {
+#endif
all_ports_up = 0;
break;
}
@@ -323,10 +336,11 @@ xran_ethdi_init_dpdk_io(char *name, const struct xran_io_cfg *io_cfg,
uint64_t nWorkerCore = 1;
uint32_t coreNum = sysconf(_SC_NPROCESSORS_CONF);
char bbdev_wdev[32] = "";
+ char bbdev_vfio_vf_token[64] = "";
char bbdev_vdev[32] = "";
char iova_mode[32] = "--iova-mode=pa";
- char socket_mem[32] = "--socket-mem=8192";
@@ -284,16 +330,36 @@ index f5b2fd6..144a65e 100644
char ring_name[32] = "";
int32_t xran_port = -1;
queueid_t qi = 0;
@@ -336,7 +339,7 @@ xran_ethdi_init_dpdk_io(char *name, const struct xran_io_cfg *io_cfg,
@@ -336,8 +350,8 @@ xran_ethdi_init_dpdk_io(char *name, const struct xran_io_cfg *io_cfg,
cpu = sched_getcpu();
node = numa_node_of_cpu(cpu);
- char *argv[] = { name, core_mask, "-n2", iova_mode, socket_mem, socket_limit, "--proc-type=auto",
- "--file-prefix", name, "-a0000:00:00.0", bbdev_wdev, bbdev_vdev};
+ char *argv[] = { name, core_mask, "-n2", iova_mode, socket_mem, socket_limit, "--proc-type=auto", "--no-telemetry",
"--file-prefix", name, "-a0000:00:00.0", bbdev_wdev, bbdev_vdev};
+ "--file-prefix", name, "-a0000:00:00.0", bbdev_wdev, bbdev_vdev, bbdev_vfio_vf_token};
if (io_cfg == NULL)
@@ -481,11 +484,13 @@ xran_ethdi_init_dpdk_io(char *name, const struct xran_io_cfg *io_cfg,
return 0;
@@ -347,11 +361,17 @@ xran_ethdi_init_dpdk_io(char *name, const struct xran_io_cfg *io_cfg,
// hw-accelerated bbdev
printf("hw-accelerated bbdev %s\n", io_cfg->bbdev_dev[0]);
snprintf(bbdev_wdev, RTE_DIM(bbdev_wdev), "-a%s", io_cfg->bbdev_dev[0]);
+ if (io_cfg->bbdev_vfio_vf_token[0] != NULL) {
+ snprintf(bbdev_vfio_vf_token, RTE_DIM(bbdev_vfio_vf_token), "--vfio-vf-token=%s", io_cfg->bbdev_vfio_vf_token[0]);
+ }
} else if (io_cfg->bbdev_mode == XRAN_BBDEV_MODE_HW_OFF){
snprintf(bbdev_wdev, RTE_DIM(bbdev_wdev), "%s", "--vdev=baseband_turbo_sw");
} else if (io_cfg->bbdev_mode == XRAN_BBDEV_MODE_HW_SW){
printf("software and hw-accelerated bbdev %s\n", io_cfg->bbdev_dev[0]);
snprintf(bbdev_wdev, RTE_DIM(bbdev_wdev), "-a%s", io_cfg->bbdev_dev[0]);
+ if (io_cfg->bbdev_vfio_vf_token[0] != NULL) {
+ snprintf(bbdev_vfio_vf_token, RTE_DIM(bbdev_vfio_vf_token), "--vfio-vf-token=%s", io_cfg->bbdev_vfio_vf_token[0]);
+ }
snprintf(bbdev_vdev, RTE_DIM(bbdev_vdev), "%s", "--vdev=baseband_turbo_sw");
} else {
rte_panic("Cannot init DPDK incorrect [bbdev_mode %d]\n", io_cfg->bbdev_mode);
@@ -481,11 +501,13 @@ xran_ethdi_init_dpdk_io(char *name, const struct xran_io_cfg *io_cfg,
ctx->tx_ring[i] = rte_ring_create(ring_name, NUM_MBUFS_RING_TRX,
rte_lcore_to_socket_id(*lcore_id), RING_F_SC_DEQ);
PANIC_ON(ctx->tx_ring[i] == NULL, "failed to allocate rx ring");
@@ -307,7 +373,7 @@ index f5b2fd6..144a65e 100644
}
}
} else {
@@ -555,7 +560,7 @@ xran_ethdi_init_dpdk_io(char *name, const struct xran_io_cfg *io_cfg,
@@ -555,7 +577,7 @@ xran_ethdi_init_dpdk_io(char *name, const struct xran_io_cfg *io_cfg,
ctx->up_dl_pkt_gen_ring[i] = rte_ring_create(ring_name, NUM_MBUFS_RING,
rte_lcore_to_socket_id(*lcore_id), /*RING_F_SC_DEQ*/0);
PANIC_ON(ctx->up_dl_pkt_gen_ring[i] == NULL, "failed to allocate dl gen ring");
@@ -317,7 +383,7 @@ index f5b2fd6..144a65e 100644
return 1;
diff --git a/fhi_lib/lib/ethernet/ethernet.c b/fhi_lib/lib/ethernet/ethernet.c
index edda598..791256c 100644
index edda598..77e5ca7 100644
--- a/fhi_lib/lib/ethernet/ethernet.c
+++ b/fhi_lib/lib/ethernet/ethernet.c
@@ -37,7 +37,10 @@
@@ -331,6 +397,78 @@ index edda598..791256c 100644
#include <rte_config.h>
#include <rte_common.h>
#include <rte_log.h>
@@ -149,13 +152,22 @@ void xran_init_port(int p_id, uint16_t num_rxq, uint32_t mtu)
static uint16_t nb_txd = BURST_SIZE;
struct rte_ether_addr addr;
struct rte_eth_rxmode rxmode = {
+#if (RTE_VER_YEAR >= 21)
+ .mtu = MAX_RX_LEN,
+#else
.split_hdr_size = 0,
.max_rx_pkt_len = MAX_RX_LEN,
.offloads = DEV_RX_OFFLOAD_JUMBO_FRAME
+#endif
};
struct rte_eth_txmode txmode = {
+#if (RTE_VER_YEAR >= 21)
+ .mq_mode = RTE_ETH_MQ_TX_NONE,
+ .offloads = RTE_ETH_TX_OFFLOAD_MULTI_SEGS
+#else
.mq_mode = ETH_MQ_TX_NONE,
.offloads = DEV_TX_OFFLOAD_MULTI_SEGS
+#endif
};
struct rte_eth_conf port_conf = {
.rxmode = rxmode,
@@ -174,8 +186,13 @@ void xran_init_port(int p_id, uint16_t num_rxq, uint32_t mtu)
uint32_t num_mbufs = 0;
if (mtu <= 1500) {
+#if (RTE_VER_YEAR >= 21)
+ rxmode.offloads &= ~RTE_ETH_TX_OFFLOAD_IPIP_TNL_TSO;
+ rxmode.mtu = RTE_ETHER_MAX_LEN;
+#else
rxmode.offloads &= ~DEV_RX_OFFLOAD_JUMBO_FRAME;
rxmode.max_rx_pkt_len = RTE_ETHER_MAX_LEN;
+#endif
data_room_size = MBUF_POOL_ELM_SMALL;
}
@@ -184,10 +201,19 @@ void xran_init_port(int p_id, uint16_t num_rxq, uint32_t mtu)
drv_name = dev_info.driver_name;
printf("initializing port %d for TX, drv=%s\n", p_id, drv_name);
- if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE){
+#if (RTE_VER_YEAR >= 21)
+ if (dev_info.tx_offload_capa & RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE)
+#else
+ if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
+#endif
+ {
printf("set DEV_TX_OFFLOAD_MBUF_FAST_FREE\n");
port_conf.txmode.offloads |=
+#if (RTE_VER_YEAR >= 21)
+ RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE;
+#else
DEV_TX_OFFLOAD_MBUF_FAST_FREE;
+#endif
}
rte_eth_macaddr_get(p_id, &addr);
@@ -293,8 +319,13 @@ void xran_add_eth_hdr_vlan(struct rte_ether_addr *dst, uint16_t ethertype, struc
PANIC_ON(h == NULL, "mbuf prepend of ether_hdr failed");
/* Fill in the ethernet header. */
+#if (RTE_VER_YEAR >= 21)
+ rte_eth_macaddr_get(mb->port, &h->src_addr); /* set source addr */
+ h->dst_addr = *dst; /* set dst addr */
+#else
rte_eth_macaddr_get(mb->port, &h->s_addr); /* set source addr */
h->d_addr = *dst; /* set dst addr */
+#endif
h->ether_type = rte_cpu_to_be_16(ethertype); /* ethertype too */
#if 0
struct rte_ether_addr *s = &h->s_addr;
diff --git a/fhi_lib/lib/src/xran_bfp_ref.cpp b/fhi_lib/lib/src/xran_bfp_ref.cpp
index e6d3067..8e0abee 100644
--- a/fhi_lib/lib/src/xran_bfp_ref.cpp
@@ -565,7 +703,7 @@ index 789c6fd..a768efb 100644
#include <rte_common.h>
#include <rte_eal.h>
diff --git a/fhi_lib/lib/src/xran_delay_measurement.c b/fhi_lib/lib/src/xran_delay_measurement.c
index 4c943c8..d9e7983 100644
index 4c943c8..7db51a8 100644
--- a/fhi_lib/lib/src/xran_delay_measurement.c
+++ b/fhi_lib/lib/src/xran_delay_measurement.c
@@ -23,7 +23,10 @@
@@ -579,6 +717,155 @@ index 4c943c8..d9e7983 100644
#include <assert.h>
#include <err.h>
#include <arpa/inet.h>
@@ -572,16 +575,28 @@ int xran_generate_delay_meas(uint16_t port_id, void* handle, uint8_t actionType,
PANIC_ON(h == NULL, "mbuf prepend of ether_hdr failed");
/* Fill in the ethernet header. */
+#if (RTE_VER_YEAR >= 21)
+ rte_eth_macaddr_get(port_id, &h->src_addr); /* set source addr */
+#else
rte_eth_macaddr_get(port_id, &h->s_addr); /* set source addr */
+#endif
if (p_xran_dev_ctx->fh_init.io_cfg.id)
{
// rte_ether_addr_copy( (struct rte_ether_addr *)p_xran_dev_ctx->fh_init.p_o_du_addr[port_id],&h->d_addr);
+#if (RTE_VER_YEAR >= 21)
+ h->dst_addr = ctx->entities[port_id][ID_O_DU]; /* set dst addr */
+#else
h->d_addr = ctx->entities[port_id][ID_O_DU]; /* set dst addr */
+#endif
}
else
{
+#if (RTE_VER_YEAR >= 21)
+ h->dst_addr = ctx->entities[port_id][ID_O_RU]; /* set dst addr */
+#else
h->d_addr = ctx->entities[port_id][ID_O_RU]; /* set dst addr */
+#endif
// rte_ether_addr_copy( (struct rte_ether_addr *)p_xran_dev_ctx->fh_init.p_o_ru_addr[port_id],&h->d_addr);
}
@@ -752,7 +767,11 @@ int xran_generate_delay_meas(uint16_t port_id, void* handle, uint8_t actionType,
int8_t *pa = &p_xran_dev_ctx->fh_init.p_o_du_addr[0];
printf("DST_MAC: %02"PRIx8" %02"PRIx8" %02"PRIx8" %02"PRIx8" %02"PRIx8" %02"PRIx8"\n", pa[0],pa[1],pa[2],pa[3],pa[4],pa[5]);
#endif
+#if (RTE_VER_YEAR >= 21)
+ rte_ether_addr_copy((struct rte_ether_addr *)&p_xran_dev_ctx->fh_init.p_o_du_addr[0], (struct rte_ether_addr *)&h->dst_addr.addr_bytes[0]);
+#else
rte_ether_addr_copy((struct rte_ether_addr *)&p_xran_dev_ctx->fh_init.p_o_du_addr[0], (struct rte_ether_addr *)&h->d_addr.addr_bytes[0]);
+#endif
}
else
@@ -761,13 +780,25 @@ int xran_generate_delay_meas(uint16_t port_id, void* handle, uint8_t actionType,
int8_t *pb = &p_xran_dev_ctx->fh_init.p_o_ru_addr[0];
printf("DST_MAC: %02"PRIx8" %02"PRIx8" %02"PRIx8" %02"PRIx8" %02"PRIx8" %02"PRIx8"\n", pb[0],pb[1],pb[2],pb[3],pb[4],pb[5]);
#endif
+#if (RTE_VER_YEAR >= 21)
+ rte_ether_addr_copy((struct rte_ether_addr *)&p_xran_dev_ctx->fh_init.p_o_ru_addr[0], (struct rte_ether_addr *)&h->dst_addr.addr_bytes[0]);
+#else
rte_ether_addr_copy((struct rte_ether_addr *)&p_xran_dev_ctx->fh_init.p_o_ru_addr[0], (struct rte_ether_addr *)&h->d_addr.addr_bytes[0]);
+#endif
}
#ifdef XRAN_OWD_DEBUG_PKTS
+#if (RTE_VER_YEAR >= 21)
+ uint8_t *pc = &h->src_addr.addr_bytes[0];
+#else
uint8_t *pc = &h->s_addr.addr_bytes[0];
+#endif
printf(" Src MAC from packet: %02"PRIx8" %02"PRIx8" %02"PRIx8" %02"PRIx8" %02"PRIx8" %02"PRIx8"\n", pc[0],pc[1],pc[2],pc[3],pc[4],pc[5]);
+#if (RTE_VER_YEAR >= 21)
+ uint8_t *pd = &h->dst_addr.addr_bytes[0];
+#else
uint8_t *pd = &h->d_addr.addr_bytes[0];
+#endif
printf(" Dst MAC from packet: %02"PRIx8" %02"PRIx8" %02"PRIx8" %02"PRIx8" %02"PRIx8" %02"PRIx8"\n", pd[0],pd[1],pd[2],pd[3],pd[4],pd[5]);
#endif
// Copy dest address from above
@@ -862,9 +893,15 @@ int xran_process_delmeas_request(struct rte_mbuf *pkt, void* handle, struct xran
// 11) Fill the ethernet header properly by swapping src and dest addressed from the copied frame
eth_hdr = rte_pktmbuf_mtod(pkt1, struct rte_ether_hdr *);
/* Swap dest and src mac addresses. */
+#if (RTE_VER_YEAR >= 21)
+ rte_ether_addr_copy(&eth_hdr->dst_addr, &addr);
+ rte_ether_addr_copy(&eth_hdr->src_addr, &eth_hdr->dst_addr);
+ rte_ether_addr_copy(&addr, &eth_hdr->src_addr);
+#else
rte_ether_addr_copy(&eth_hdr->d_addr, &addr);
rte_ether_addr_copy(&eth_hdr->s_addr, &eth_hdr->d_addr);
rte_ether_addr_copy(&addr, &eth_hdr->s_addr);
+#endif
// Still need to check ol_flags state and update if necessary
// Compute the delay td12 and save
// Still need to define the DB to save the info and run averages
@@ -872,9 +909,17 @@ int xran_process_delmeas_request(struct rte_mbuf *pkt, void* handle, struct xran
// 12) Send the response right away
#ifdef XRAN_OWD_DEBUG_PKTS
struct rte_ether_hdr *h = (struct rte_ether_hdr *)rte_pktmbuf_mtod(pkt1, struct rte_ether_hdr*);
+#if (RTE_VER_YEAR >= 21)
+ uint8_t *pc = &h->src_addr.addr_bytes[0];
+#else
uint8_t *pc = &h->s_addr.addr_bytes[0];
+#endif
printf(" Src MAC from packet: %02"PRIx8" %02"PRIx8" %02"PRIx8" %02"PRIx8" %02"PRIx8" %02"PRIx8"\n", pc[0],pc[1],pc[2],pc[3],pc[4],pc[5]);
+#if (RTE_VER_YEAR >= 21)
+ uint8_t *pd = &h->dst_addr.addr_bytes[0];
+#else
uint8_t *pd = &h->d_addr.addr_bytes[0];
+#endif
printf(" Dst MAC from packet: %02"PRIx8" %02"PRIx8" %02"PRIx8" %02"PRIx8" %02"PRIx8" %02"PRIx8"\n", pd[0],pd[1],pd[2],pd[3],pd[4],pd[5]);
// printf("EtherType: %04"PRIx16" \n",&h->ether_type);
#endif
@@ -1100,9 +1145,15 @@ int xran_process_delmeas_rem_request(struct rte_mbuf *pkt, void* handle, struct
// 9) Fill the ethernet header properly by swapping src and dest addressed from the copied frame
eth_hdr = rte_pktmbuf_mtod(pkt1, struct rte_ether_hdr *);
/* Swap dest and src mac addresses. */
+#if (RTE_VER_YEAR >= 21)
+ rte_ether_addr_copy(&eth_hdr->dst_addr, &addr);
+ rte_ether_addr_copy(&eth_hdr->src_addr, &eth_hdr->dst_addr);
+ rte_ether_addr_copy(&addr, &eth_hdr->src_addr);
+#else
rte_ether_addr_copy(&eth_hdr->d_addr, &addr);
rte_ether_addr_copy(&eth_hdr->s_addr, &eth_hdr->d_addr);
rte_ether_addr_copy(&addr, &eth_hdr->s_addr);
+#endif
// 10) Send the response right away
pdm = (struct xran_ecpri_del_meas_pkt*)rte_pktmbuf_mtod_offset(pkt1, struct xran_ecpri_del_meas_pkt *, sizeof(struct rte_ether_hdr) );
pdm->cmnhdr.bits.ecpri_payl_size = 10 + powdc->owdm_PlLength; // 10 correponds to the xran_ecpri_delay_meas_pl minus the dummy_bytes field which now allows the user to select the length for this field to be sent
@@ -1177,9 +1228,15 @@ int xran_process_delmeas_rem_request_w_fup(struct rte_mbuf* pkt, void* handle, s
// 7) Fill the ethernet header properly by swapping src and dest addressed from the copied frame
eth_hdr = rte_pktmbuf_mtod(pkt1, struct rte_ether_hdr *);
/* Swap dest and src mac addresses. */
+#if (RTE_VER_YEAR >= 21)
+ rte_ether_addr_copy(&eth_hdr->dst_addr, &addr);
+ rte_ether_addr_copy(&eth_hdr->src_addr, &eth_hdr->dst_addr);
+ rte_ether_addr_copy(&addr, &eth_hdr->src_addr);
+#else
rte_ether_addr_copy(&eth_hdr->d_addr, &addr);
rte_ether_addr_copy(&eth_hdr->s_addr, &eth_hdr->d_addr);
rte_ether_addr_copy(&addr, &eth_hdr->s_addr);
+#endif
// 8) Duplicate packet to be used for the follow up packet
pkt2 = rte_pktmbuf_copy(pkt1, _eth_mbuf_pool, 0, UINT32_MAX);
// 9) Record the current timestamp when the request with follow up is being sent
@@ -1283,9 +1340,15 @@ int xran_process_delmeas_follow_up(struct rte_mbuf *pkt, void* handle, struct xr
// 9) Fill the ethernet header properly by swapping src and dest addressed from the copied frame
eth_hdr = rte_pktmbuf_mtod(pkt1, struct rte_ether_hdr *);
/* Swap dest and src mac addresses. */
+#if (RTE_VER_YEAR >= 21)
+ rte_ether_addr_copy(&eth_hdr->dst_addr, &addr);
+ rte_ether_addr_copy(&eth_hdr->src_addr, &eth_hdr->dst_addr);
+ rte_ether_addr_copy(&addr, &eth_hdr->src_addr);
+#else
rte_ether_addr_copy(&eth_hdr->d_addr, &addr);
rte_ether_addr_copy(&eth_hdr->s_addr, &eth_hdr->d_addr);
rte_ether_addr_copy(&addr, &eth_hdr->s_addr);
+#endif
pdm = (struct xran_ecpri_del_meas_pkt*)rte_pktmbuf_mtod_offset(pkt1, struct xran_ecpri_del_meas_pkt *, sizeof(struct rte_ether_hdr) );
pdm->cmnhdr.bits.ecpri_payl_size = 10 + powdc->owdm_PlLength; // 10 correponds to the xran_ecpri_delay_meas_pl minus the dummy_bytes field which now allows the user to select the length for this field to be sent
pdm->cmnhdr.bits.ecpri_payl_size = rte_cpu_to_be_16(pdm->cmnhdr.bits.ecpri_payl_size);
diff --git a/fhi_lib/lib/src/xran_dev.c b/fhi_lib/lib/src/xran_dev.c
index 4acade1..c939edc 100644
--- a/fhi_lib/lib/src/xran_dev.c
@@ -1377,7 +1664,7 @@ index 72249bc..6b30084 100644
#include <rte_config.h>
diff --git a/fhi_lib/lib/src/xran_tx_proc.c b/fhi_lib/lib/src/xran_tx_proc.c
index 45a17a8..28c5568 100644
index 45a17a8..85ce6fa 100644
--- a/fhi_lib/lib/src/xran_tx_proc.c
+++ b/fhi_lib/lib/src/xran_tx_proc.c
@@ -35,7 +35,11 @@
@@ -1392,6 +1679,58 @@ index 45a17a8..28c5568 100644
#include <rte_common.h>
#include <rte_eal.h>
@@ -1514,7 +1518,11 @@ xran_process_tx_sym_cp_on_opt(void* pHandle, uint8_t ctx_id, uint32_t tti, int32
mb_oran_hdr_ext->buf_addr = ext_buff;
mb_oran_hdr_ext->buf_iova = ((struct rte_mempool_objhdr*)RTE_PTR_SUB(mb_base, rte_mempool_objhdr_size))->iova + RTE_PTR_DIFF(ext_buff, mb_base);
mb_oran_hdr_ext->buf_len = ext_buff_len;
+#if (RTE_VER_YEAR >= 21)
+ mb_oran_hdr_ext->ol_flags |= RTE_MBUF_F_EXTERNAL;
+#else
mb_oran_hdr_ext->ol_flags |= EXT_ATTACHED_MBUF;
+#endif
mb_oran_hdr_ext->shinfo = p_share_data;
mb_oran_hdr_ext->data_off = (uint16_t)RTE_MIN((uint16_t)RTE_PKTMBUF_HEADROOM, (uint16_t)mb_oran_hdr_ext->buf_len) - rte_ether_hdr_size;
mb_oran_hdr_ext->data_len = (uint16_t)(mb_oran_hdr_ext->data_len + rte_ether_hdr_size);
@@ -1532,8 +1540,13 @@ xran_process_tx_sym_cp_on_opt(void* pHandle, uint8_t ctx_id, uint32_t tti, int32
/* Fill in the ethernet header. */
#ifndef TRANSMIT_BURST
+#if (RTE_VER_YEAR >= 21)
+ rte_eth_macaddr_get(mb_oran_hdr_ext->port, &((struct rte_ether_hdr*)pStart)->src_addr); /* set source addr */
+ ((struct rte_ether_hdr*)pStart)->dst_addr = eth_ctx->entities[vf_id][ID_O_RU]; /* set dst addr */
+#else
rte_eth_macaddr_get(mb_oran_hdr_ext->port, &((struct rte_ether_hdr*)pStart)->s_addr); /* set source addr */
((struct rte_ether_hdr*)pStart)->d_addr = eth_ctx->entities[vf_id][ID_O_RU]; /* set dst addr */
+#endif
((struct rte_ether_hdr*)pStart)->ether_type = ETHER_TYPE_ECPRI_BE; /* ethertype */
#endif
nPktSize = sizeof(struct rte_ether_hdr)
@@ -1878,7 +1891,11 @@ xran_process_tx_srs_cp_on(void* pHandle, uint8_t ctx_id, uint32_t tti, int32_t s
mb_oran_hdr_ext->buf_addr = ext_buff;
mb_oran_hdr_ext->buf_iova = ((struct rte_mempool_objhdr*)RTE_PTR_SUB(mb_base, rte_mempool_objhdr_size))->iova + RTE_PTR_DIFF(ext_buff, mb_base);
mb_oran_hdr_ext->buf_len = ext_buff_len;
+#if (RTE_VER_YEAR >= 21)
+ mb_oran_hdr_ext->ol_flags |= RTE_MBUF_F_EXTERNAL;
+#else
mb_oran_hdr_ext->ol_flags |= EXT_ATTACHED_MBUF;
+#endif
mb_oran_hdr_ext->shinfo = p_share_data;
mb_oran_hdr_ext->data_off = (uint16_t)RTE_MIN((uint16_t)RTE_PKTMBUF_HEADROOM, (uint16_t)mb_oran_hdr_ext->buf_len) - rte_ether_hdr_size;
mb_oran_hdr_ext->data_len = (uint16_t)(mb_oran_hdr_ext->data_len + rte_ether_hdr_size);
@@ -1887,8 +1904,13 @@ xran_process_tx_srs_cp_on(void* pHandle, uint8_t ctx_id, uint32_t tti, int32_t s
pStart = (char*)((char*)mb_oran_hdr_ext->buf_addr + mb_oran_hdr_ext->data_off);
/* Fill in the ethernet header. */
+#if (RTE_VER_YEAR >= 21)
+ rte_eth_macaddr_get(mb_oran_hdr_ext->port, &((struct rte_ether_hdr*)pStart)->src_addr); /* set source addr */
+ ((struct rte_ether_hdr*)pStart)->dst_addr = eth_ctx->entities[vf_id][ID_O_RU]; /* set dst addr */
+#else
rte_eth_macaddr_get(mb_oran_hdr_ext->port, &((struct rte_ether_hdr*)pStart)->s_addr); /* set source addr */
((struct rte_ether_hdr*)pStart)->d_addr = eth_ctx->entities[vf_id][ID_O_RU]; /* set dst addr */
+#endif
((struct rte_ether_hdr*)pStart)->ether_type = ETHER_TYPE_ECPRI_BE; /* ethertype */
nPktSize = sizeof(struct rte_ether_hdr)
diff --git a/fhi_lib/lib/src/xran_up_api.c b/fhi_lib/lib/src/xran_up_api.c
index fe22a1f..3fd369b 100644
--- a/fhi_lib/lib/src/xran_up_api.c

File diff suppressed because it is too large Load Diff

View File

@@ -100,12 +100,14 @@ struct T_header;
/* T macro tricks */
extern int T_stdout;
#define TN(...) TN_N(__VA_ARGS__,39,38,37,36,35,34,33,32,31,30,29,28,27,26, \
25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7, \
6,5,4,3,2,1,0)(__VA_ARGS__)
#define TN_N(n0,n1,n2,n3,n4,n5,n6,n7,n8,n9,n10,n11,n12,n13,n14,n15,n16,n17, \
n18,n19,n20,n21,n22,n23,n24,n25,n26,n27,n28,n29,n30,n31,n32, \
n33,n34,n35,n36,n37,n38,n,...) T##n
#define TN(...) TN_N(__VA_ARGS__,71,70,69,68,67,66,65,64,63,62,61,60,59,58,57,\
56,55,54,53,52,51,50,49,48,47,46,45,44,43,42,41,40,39,38,\
37,36,35,34,33,32,31,30,29,28,27,26,25,24,23,22,21,20,19,\
18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0)(__VA_ARGS__)
#define TN_N(n0,n1,n2,n3,n4,n5,n6,n7,n8,n9,n10,n11,n12,n13,n14,n15,n16,n17,n18,n19,n20,\
n21,n22,n23,n24,n25,n26,n27,n28,n29,n30,n31,n32,n33,n34,n35,n36,n37,n38,\
n39,n40,n41,n42,n43,n44,n45,n46,n47,n48,n49,n50,n51,n52,n53,n54,n55,n56,\
n57,n58,n59,n60,n61,n62,n63,n64,n65,n66,n67,n68,n69,n70,n,...) T##n
#define T(...) do { if (T_stdout == 0 || T_stdout == 2) TN(__VA_ARGS__); } while (0)
/* type used to send arbitrary buffer data */
@@ -620,6 +622,633 @@ extern int *T_active;
} \
} while (0)
#define T41(t,t0,x0,t1,x1,t2,x2,t3,x3,t4,x4,t5,x5,t6,x6,t7,x7,t8,x8,t9,x9,\
t10,x10,t11,x11,t12,x12,t13,x13,t14,x14,t15,x15,t16,x16,t17,x17,\
t18,x18,t19,x19) \
do { \
if (T_ACTIVE(t)) { \
T_LOCAL_DATA \
T_HEADER(t); \
T_PUT_##t0(2, x0); \
T_PUT_##t1(3, x1); \
T_PUT_##t2(4, x2); \
T_PUT_##t3(5, x3); \
T_PUT_##t4(6, x4); \
T_PUT_##t5(7, x5); \
T_PUT_##t6(8, x6); \
T_PUT_##t7(9, x7); \
T_PUT_##t8(10, x8); \
T_PUT_##t9(11, x9); \
T_PUT_##t10(12, x10); \
T_PUT_##t11(13, x11); \
T_PUT_##t12(14, x12); \
T_PUT_##t13(15, x13); \
T_PUT_##t14(16, x14); \
T_PUT_##t15(17, x15); \
T_PUT_##t16(18, x16); \
T_PUT_##t17(19, x17); \
T_PUT_##t18(20, x18); \
T_PUT_##t19(21, x19); \
T_COMMIT(); \
} \
} while (0)
#define T43(t,t0,x0,t1,x1,t2,x2,t3,x3,t4,x4,t5,x5,t6,x6,t7,x7,t8,x8,t9,x9,\
t10,x10,t11,x11,t12,x12,t13,x13,t14,x14,t15,x15,t16,x16,t17,x17,\
t18,x18,t19,x19,t20,x20) \
do { \
if (T_ACTIVE(t)) { \
T_LOCAL_DATA \
T_HEADER(t); \
T_PUT_##t0(2, x0); \
T_PUT_##t1(3, x1); \
T_PUT_##t2(4, x2); \
T_PUT_##t3(5, x3); \
T_PUT_##t4(6, x4); \
T_PUT_##t5(7, x5); \
T_PUT_##t6(8, x6); \
T_PUT_##t7(9, x7); \
T_PUT_##t8(10, x8); \
T_PUT_##t9(11, x9); \
T_PUT_##t10(12, x10); \
T_PUT_##t11(13, x11); \
T_PUT_##t12(14, x12); \
T_PUT_##t13(15, x13); \
T_PUT_##t14(16, x14); \
T_PUT_##t15(17, x15); \
T_PUT_##t16(18, x16); \
T_PUT_##t17(19, x17); \
T_PUT_##t18(20, x18); \
T_PUT_##t19(21, x19); \
T_PUT_##t20(22, x20); \
T_COMMIT(); \
} \
} while (0)
#define T45(t,t0,x0,t1,x1,t2,x2,t3,x3,t4,x4,t5,x5,t6,x6,t7,x7,t8,x8,t9,x9,\
t10,x10,t11,x11,t12,x12,t13,x13,t14,x14,t15,x15,t16,x16,t17,x17,\
t18,x18,t19,x19,t20,x20,t21,x21) \
do { \
if (T_ACTIVE(t)) { \
T_LOCAL_DATA \
T_HEADER(t); \
T_PUT_##t0(2, x0); \
T_PUT_##t1(3, x1); \
T_PUT_##t2(4, x2); \
T_PUT_##t3(5, x3); \
T_PUT_##t4(6, x4); \
T_PUT_##t5(7, x5); \
T_PUT_##t6(8, x6); \
T_PUT_##t7(9, x7); \
T_PUT_##t8(10, x8); \
T_PUT_##t9(11, x9); \
T_PUT_##t10(12, x10); \
T_PUT_##t11(13, x11); \
T_PUT_##t12(14, x12); \
T_PUT_##t13(15, x13); \
T_PUT_##t14(16, x14); \
T_PUT_##t15(17, x15); \
T_PUT_##t16(18, x16); \
T_PUT_##t17(19, x17); \
T_PUT_##t18(20, x18); \
T_PUT_##t19(21, x19); \
T_PUT_##t20(22, x20); \
T_PUT_##t21(23, x21); \
T_COMMIT(); \
} \
} while (0)
#define T47(t,t0,x0,t1,x1,t2,x2,t3,x3,t4,x4,t5,x5,t6,x6,t7,x7,t8,x8,t9,x9,\
t10,x10,t11,x11,t12,x12,t13,x13,t14,x14,t15,x15,t16,x16,t17,x17,\
t18,x18,t19,x19,t20,x20,t21,x21,t22,x22) \
do { \
if (T_ACTIVE(t)) { \
T_LOCAL_DATA \
T_HEADER(t); \
T_PUT_##t0(2, x0); \
T_PUT_##t1(3, x1); \
T_PUT_##t2(4, x2); \
T_PUT_##t3(5, x3); \
T_PUT_##t4(6, x4); \
T_PUT_##t5(7, x5); \
T_PUT_##t6(8, x6); \
T_PUT_##t7(9, x7); \
T_PUT_##t8(10, x8); \
T_PUT_##t9(11, x9); \
T_PUT_##t10(12, x10); \
T_PUT_##t11(13, x11); \
T_PUT_##t12(14, x12); \
T_PUT_##t13(15, x13); \
T_PUT_##t14(16, x14); \
T_PUT_##t15(17, x15); \
T_PUT_##t16(18, x16); \
T_PUT_##t17(19, x17); \
T_PUT_##t18(20, x18); \
T_PUT_##t19(21, x19); \
T_PUT_##t20(22, x20); \
T_PUT_##t21(23, x21); \
T_PUT_##t22(24, x22); \
T_COMMIT(); \
} \
} while (0)
#define T49(t,t0,x0,t1,x1,t2,x2,t3,x3,t4,x4,t5,x5,t6,x6,t7,x7,t8,x8,t9,x9,\
t10,x10,t11,x11,t12,x12,t13,x13,t14,x14,t15,x15,t16,x16,t17,x17,\
t18,x18,t19,x19,t20,x20,t21,x21,t22,x22,t23,x23) \
do { \
if (T_ACTIVE(t)) { \
T_LOCAL_DATA \
T_HEADER(t); \
T_PUT_##t0(2, x0); \
T_PUT_##t1(3, x1); \
T_PUT_##t2(4, x2); \
T_PUT_##t3(5, x3); \
T_PUT_##t4(6, x4); \
T_PUT_##t5(7, x5); \
T_PUT_##t6(8, x6); \
T_PUT_##t7(9, x7); \
T_PUT_##t8(10, x8); \
T_PUT_##t9(11, x9); \
T_PUT_##t10(12, x10); \
T_PUT_##t11(13, x11); \
T_PUT_##t12(14, x12); \
T_PUT_##t13(15, x13); \
T_PUT_##t14(16, x14); \
T_PUT_##t15(17, x15); \
T_PUT_##t16(18, x16); \
T_PUT_##t17(19, x17); \
T_PUT_##t18(20, x18); \
T_PUT_##t19(21, x19); \
T_PUT_##t20(22, x20); \
T_PUT_##t21(23, x21); \
T_PUT_##t22(24, x22); \
T_PUT_##t23(25, x23); \
T_COMMIT(); \
} \
} while (0)
#define T51(t,t0,x0,t1,x1,t2,x2,t3,x3,t4,x4,t5,x5,t6,x6,t7,x7,t8,x8,t9,x9,\
t10,x10,t11,x11,t12,x12,t13,x13,t14,x14,t15,x15,t16,x16,t17,x17,\
t18,x18,t19,x19,t20,x20,t21,x21,t22,x22,t23,x23,t24,x24) \
do { \
if (T_ACTIVE(t)) { \
T_LOCAL_DATA \
T_HEADER(t); \
T_PUT_##t0(2, x0); \
T_PUT_##t1(3, x1); \
T_PUT_##t2(4, x2); \
T_PUT_##t3(5, x3); \
T_PUT_##t4(6, x4); \
T_PUT_##t5(7, x5); \
T_PUT_##t6(8, x6); \
T_PUT_##t7(9, x7); \
T_PUT_##t8(10, x8); \
T_PUT_##t9(11, x9); \
T_PUT_##t10(12, x10); \
T_PUT_##t11(13, x11); \
T_PUT_##t12(14, x12); \
T_PUT_##t13(15, x13); \
T_PUT_##t14(16, x14); \
T_PUT_##t15(17, x15); \
T_PUT_##t16(18, x16); \
T_PUT_##t17(19, x17); \
T_PUT_##t18(20, x18); \
T_PUT_##t19(21, x19); \
T_PUT_##t20(22, x20); \
T_PUT_##t21(23, x21); \
T_PUT_##t22(24, x22); \
T_PUT_##t23(25, x23); \
T_PUT_##t24(26, x24); \
T_COMMIT(); \
} \
} while (0)
#define T53(t,t0,x0,t1,x1,t2,x2,t3,x3,t4,x4,t5,x5,t6,x6,t7,x7,t8,x8,t9,x9,\
t10,x10,t11,x11,t12,x12,t13,x13,t14,x14,t15,x15,t16,x16,t17,x17,\
t18,x18,t19,x19,t20,x20,t21,x21,t22,x22,t23,x23,t24,x24,t25,x25) \
do { \
if (T_ACTIVE(t)) { \
T_LOCAL_DATA \
T_HEADER(t); \
T_PUT_##t0(2, x0); \
T_PUT_##t1(3, x1); \
T_PUT_##t2(4, x2); \
T_PUT_##t3(5, x3); \
T_PUT_##t4(6, x4); \
T_PUT_##t5(7, x5); \
T_PUT_##t6(8, x6); \
T_PUT_##t7(9, x7); \
T_PUT_##t8(10, x8); \
T_PUT_##t9(11, x9); \
T_PUT_##t10(12, x10); \
T_PUT_##t11(13, x11); \
T_PUT_##t12(14, x12); \
T_PUT_##t13(15, x13); \
T_PUT_##t14(16, x14); \
T_PUT_##t15(17, x15); \
T_PUT_##t16(18, x16); \
T_PUT_##t17(19, x17); \
T_PUT_##t18(20, x18); \
T_PUT_##t19(21, x19); \
T_PUT_##t20(22, x20); \
T_PUT_##t21(23, x21); \
T_PUT_##t22(24, x22); \
T_PUT_##t23(25, x23); \
T_PUT_##t24(26, x24); \
T_PUT_##t25(27, x25); \
T_COMMIT(); \
} \
} while (0)
#define T55(t,t0,x0,t1,x1,t2,x2,t3,x3,t4,x4,t5,x5,t6,x6,t7,x7,t8,x8,t9,x9,\
t10,x10,t11,x11,t12,x12,t13,x13,t14,x14,t15,x15,t16,x16,t17,x17,\
t18,x18,t19,x19,t20,x20,t21,x21,t22,x22,t23,x23,t24,x24,t25,x25,\
t26,x26) \
do { \
if (T_ACTIVE(t)) { \
T_LOCAL_DATA \
T_HEADER(t); \
T_PUT_##t0(2, x0); \
T_PUT_##t1(3, x1); \
T_PUT_##t2(4, x2); \
T_PUT_##t3(5, x3); \
T_PUT_##t4(6, x4); \
T_PUT_##t5(7, x5); \
T_PUT_##t6(8, x6); \
T_PUT_##t7(9, x7); \
T_PUT_##t8(10, x8); \
T_PUT_##t9(11, x9); \
T_PUT_##t10(12, x10); \
T_PUT_##t11(13, x11); \
T_PUT_##t12(14, x12); \
T_PUT_##t13(15, x13); \
T_PUT_##t14(16, x14); \
T_PUT_##t15(17, x15); \
T_PUT_##t16(18, x16); \
T_PUT_##t17(19, x17); \
T_PUT_##t18(20, x18); \
T_PUT_##t19(21, x19); \
T_PUT_##t20(22, x20); \
T_PUT_##t21(23, x21); \
T_PUT_##t22(24, x22); \
T_PUT_##t23(25, x23); \
T_PUT_##t24(26, x24); \
T_PUT_##t25(27, x25); \
T_PUT_##t26(28, x26); \
T_COMMIT(); \
} \
} while (0)
#define T57(t,t0,x0,t1,x1,t2,x2,t3,x3,t4,x4,t5,x5,t6,x6,t7,x7,t8,x8,t9,x9,\
t10,x10,t11,x11,t12,x12,t13,x13,t14,x14,t15,x15,t16,x16,t17,x17,\
t18,x18,t19,x19,t20,x20,t21,x21,t22,x22,t23,x23,t24,x24,t25,x25,\
t26,x26,t27,x27) \
do { \
if (T_ACTIVE(t)) { \
T_LOCAL_DATA \
T_HEADER(t); \
T_PUT_##t0(2, x0); \
T_PUT_##t1(3, x1); \
T_PUT_##t2(4, x2); \
T_PUT_##t3(5, x3); \
T_PUT_##t4(6, x4); \
T_PUT_##t5(7, x5); \
T_PUT_##t6(8, x6); \
T_PUT_##t7(9, x7); \
T_PUT_##t8(10, x8); \
T_PUT_##t9(11, x9); \
T_PUT_##t10(12, x10); \
T_PUT_##t11(13, x11); \
T_PUT_##t12(14, x12); \
T_PUT_##t13(15, x13); \
T_PUT_##t14(16, x14); \
T_PUT_##t15(17, x15); \
T_PUT_##t16(18, x16); \
T_PUT_##t17(19, x17); \
T_PUT_##t18(20, x18); \
T_PUT_##t19(21, x19); \
T_PUT_##t20(22, x20); \
T_PUT_##t21(23, x21); \
T_PUT_##t22(24, x22); \
T_PUT_##t23(25, x23); \
T_PUT_##t24(26, x24); \
T_PUT_##t25(27, x25); \
T_PUT_##t26(28, x26); \
T_PUT_##t27(29, x27); \
T_COMMIT(); \
} \
} while (0)
#define T59(t,t0,x0,t1,x1,t2,x2,t3,x3,t4,x4,t5,x5,t6,x6,t7,x7,t8,x8,t9,x9,\
t10,x10,t11,x11,t12,x12,t13,x13,t14,x14,t15,x15,t16,x16,t17,x17,\
t18,x18,t19,x19,t20,x20,t21,x21,t22,x22,t23,x23,t24,x24,t25,x25,\
t26,x26,t27,x27,t28,x28) \
do { \
if (T_ACTIVE(t)) { \
T_LOCAL_DATA \
T_HEADER(t); \
T_PUT_##t0(2, x0); \
T_PUT_##t1(3, x1); \
T_PUT_##t2(4, x2); \
T_PUT_##t3(5, x3); \
T_PUT_##t4(6, x4); \
T_PUT_##t5(7, x5); \
T_PUT_##t6(8, x6); \
T_PUT_##t7(9, x7); \
T_PUT_##t8(10, x8); \
T_PUT_##t9(11, x9); \
T_PUT_##t10(12, x10); \
T_PUT_##t11(13, x11); \
T_PUT_##t12(14, x12); \
T_PUT_##t13(15, x13); \
T_PUT_##t14(16, x14); \
T_PUT_##t15(17, x15); \
T_PUT_##t16(18, x16); \
T_PUT_##t17(19, x17); \
T_PUT_##t18(20, x18); \
T_PUT_##t19(21, x19); \
T_PUT_##t20(22, x20); \
T_PUT_##t21(23, x21); \
T_PUT_##t22(24, x22); \
T_PUT_##t23(25, x23); \
T_PUT_##t24(26, x24); \
T_PUT_##t25(27, x25); \
T_PUT_##t26(28, x26); \
T_PUT_##t27(29, x27); \
T_PUT_##t28(30, x28); \
T_COMMIT(); \
} \
} while (0)
#define T61(t,t0,x0,t1,x1,t2,x2,t3,x3,t4,x4,t5,x5,t6,x6,t7,x7,t8,x8,t9,x9,\
t10,x10,t11,x11,t12,x12,t13,x13,t14,x14,t15,x15,t16,x16,t17,x17,\
t18,x18,t19,x19,t20,x20,t21,x21,t22,x22,t23,x23,t24,x24,t25,x25,\
t26,x26,t27,x27,t28,x28,t29,x29) \
do { \
if (T_ACTIVE(t)) { \
T_LOCAL_DATA \
T_HEADER(t); \
T_PUT_##t0(2, x0); \
T_PUT_##t1(3, x1); \
T_PUT_##t2(4, x2); \
T_PUT_##t3(5, x3); \
T_PUT_##t4(6, x4); \
T_PUT_##t5(7, x5); \
T_PUT_##t6(8, x6); \
T_PUT_##t7(9, x7); \
T_PUT_##t8(10, x8); \
T_PUT_##t9(11, x9); \
T_PUT_##t10(12, x10); \
T_PUT_##t11(13, x11); \
T_PUT_##t12(14, x12); \
T_PUT_##t13(15, x13); \
T_PUT_##t14(16, x14); \
T_PUT_##t15(17, x15); \
T_PUT_##t16(18, x16); \
T_PUT_##t17(19, x17); \
T_PUT_##t18(20, x18); \
T_PUT_##t19(21, x19); \
T_PUT_##t20(22, x20); \
T_PUT_##t21(23, x21); \
T_PUT_##t22(24, x22); \
T_PUT_##t23(25, x23); \
T_PUT_##t24(26, x24); \
T_PUT_##t25(27, x25); \
T_PUT_##t26(28, x26); \
T_PUT_##t27(29, x27); \
T_PUT_##t28(30, x28); \
T_PUT_##t29(31, x29); \
T_COMMIT(); \
} \
} while (0)
#define T63(t,t0,x0,t1,x1,t2,x2,t3,x3,t4,x4,t5,x5,t6,x6,t7,x7,t8,x8,t9,x9,\
t10,x10,t11,x11,t12,x12,t13,x13,t14,x14,t15,x15,t16,x16,t17,x17,\
t18,x18,t19,x19,t20,x20,t21,x21,t22,x22,t23,x23,t24,x24,t25,x25,\
t26,x26,t27,x27,t28,x28,t29,x29,t30,x30) \
do { \
if (T_ACTIVE(t)) { \
T_LOCAL_DATA \
T_HEADER(t); \
T_PUT_##t0(2, x0); \
T_PUT_##t1(3, x1); \
T_PUT_##t2(4, x2); \
T_PUT_##t3(5, x3); \
T_PUT_##t4(6, x4); \
T_PUT_##t5(7, x5); \
T_PUT_##t6(8, x6); \
T_PUT_##t7(9, x7); \
T_PUT_##t8(10, x8); \
T_PUT_##t9(11, x9); \
T_PUT_##t10(12, x10); \
T_PUT_##t11(13, x11); \
T_PUT_##t12(14, x12); \
T_PUT_##t13(15, x13); \
T_PUT_##t14(16, x14); \
T_PUT_##t15(17, x15); \
T_PUT_##t16(18, x16); \
T_PUT_##t17(19, x17); \
T_PUT_##t18(20, x18); \
T_PUT_##t19(21, x19); \
T_PUT_##t20(22, x20); \
T_PUT_##t21(23, x21); \
T_PUT_##t22(24, x22); \
T_PUT_##t23(25, x23); \
T_PUT_##t24(26, x24); \
T_PUT_##t25(27, x25); \
T_PUT_##t26(28, x26); \
T_PUT_##t27(29, x27); \
T_PUT_##t28(30, x28); \
T_PUT_##t29(31, x29); \
T_PUT_##t30(32, x30); \
T_COMMIT(); \
} \
} while (0)
#define T65(t,t0,x0,t1,x1,t2,x2,t3,x3,t4,x4,t5,x5,t6,x6,t7,x7,t8,x8,t9,x9,\
t10,x10,t11,x11,t12,x12,t13,x13,t14,x14,t15,x15,t16,x16,t17,x17,\
t18,x18,t19,x19,t20,x20,t21,x21,t22,x22,t23,x23,t24,x24,t25,x25,\
t26,x26,t27,x27,t28,x28,t29,x29,t30,x30,t31,x31) \
do { \
if (T_ACTIVE(t)) { \
T_LOCAL_DATA \
T_HEADER(t); \
T_PUT_##t0(2, x0); \
T_PUT_##t1(3, x1); \
T_PUT_##t2(4, x2); \
T_PUT_##t3(5, x3); \
T_PUT_##t4(6, x4); \
T_PUT_##t5(7, x5); \
T_PUT_##t6(8, x6); \
T_PUT_##t7(9, x7); \
T_PUT_##t8(10, x8); \
T_PUT_##t9(11, x9); \
T_PUT_##t10(12, x10); \
T_PUT_##t11(13, x11); \
T_PUT_##t12(14, x12); \
T_PUT_##t13(15, x13); \
T_PUT_##t14(16, x14); \
T_PUT_##t15(17, x15); \
T_PUT_##t16(18, x16); \
T_PUT_##t17(19, x17); \
T_PUT_##t18(20, x18); \
T_PUT_##t19(21, x19); \
T_PUT_##t20(22, x20); \
T_PUT_##t21(23, x21); \
T_PUT_##t22(24, x22); \
T_PUT_##t23(25, x23); \
T_PUT_##t24(26, x24); \
T_PUT_##t25(27, x25); \
T_PUT_##t26(28, x26); \
T_PUT_##t27(29, x27); \
T_PUT_##t28(30, x28); \
T_PUT_##t29(31, x29); \
T_PUT_##t30(32, x30); \
T_PUT_##t31(33, x31); \
T_COMMIT(); \
} \
} while (0)
#define T67(t,t0,x0,t1,x1,t2,x2,t3,x3,t4,x4,t5,x5,t6,x6,t7,x7,t8,x8,t9,x9,\
t10,x10,t11,x11,t12,x12,t13,x13,t14,x14,t15,x15,t16,x16,t17,x17,\
t18,x18,t19,x19,t20,x20,t21,x21,t22,x22,t23,x23,t24,x24,t25,x25,\
t26,x26,t27,x27,t28,x28,t29,x29,t30,x30,t31,x31,t32,x32) \
do { \
if (T_ACTIVE(t)) { \
T_LOCAL_DATA \
T_HEADER(t); \
T_PUT_##t0(2, x0); \
T_PUT_##t1(3, x1); \
T_PUT_##t2(4, x2); \
T_PUT_##t3(5, x3); \
T_PUT_##t4(6, x4); \
T_PUT_##t5(7, x5); \
T_PUT_##t6(8, x6); \
T_PUT_##t7(9, x7); \
T_PUT_##t8(10, x8); \
T_PUT_##t9(11, x9); \
T_PUT_##t10(12, x10); \
T_PUT_##t11(13, x11); \
T_PUT_##t12(14, x12); \
T_PUT_##t13(15, x13); \
T_PUT_##t14(16, x14); \
T_PUT_##t15(17, x15); \
T_PUT_##t16(18, x16); \
T_PUT_##t17(19, x17); \
T_PUT_##t18(20, x18); \
T_PUT_##t19(21, x19); \
T_PUT_##t20(22, x20); \
T_PUT_##t21(23, x21); \
T_PUT_##t22(24, x22); \
T_PUT_##t23(25, x23); \
T_PUT_##t24(26, x24); \
T_PUT_##t25(27, x25); \
T_PUT_##t26(28, x26); \
T_PUT_##t27(29, x27); \
T_PUT_##t28(30, x28); \
T_PUT_##t29(31, x29); \
T_PUT_##t30(32, x30); \
T_PUT_##t31(33, x31); \
T_PUT_##t32(34, x32); \
T_COMMIT(); \
} \
} while (0)
#define T69(t,t0,x0,t1,x1,t2,x2,t3,x3,t4,x4,t5,x5,t6,x6,t7,x7,t8,x8,t9,x9,\
t10,x10,t11,x11,t12,x12,t13,x13,t14,x14,t15,x15,t16,x16,t17,x17,\
t18,x18,t19,x19,t20,x20,t21,x21,t22,x22,t23,x23,t24,x24,t25,x25,\
t26,x26,t27,x27,t28,x28,t29,x29,t30,x30,t31,x31,t32,x32,t33,x33) \
do { \
if (T_ACTIVE(t)) { \
T_LOCAL_DATA \
T_HEADER(t); \
T_PUT_##t0(2, x0); \
T_PUT_##t1(3, x1); \
T_PUT_##t2(4, x2); \
T_PUT_##t3(5, x3); \
T_PUT_##t4(6, x4); \
T_PUT_##t5(7, x5); \
T_PUT_##t6(8, x6); \
T_PUT_##t7(9, x7); \
T_PUT_##t8(10, x8); \
T_PUT_##t9(11, x9); \
T_PUT_##t10(12, x10); \
T_PUT_##t11(13, x11); \
T_PUT_##t12(14, x12); \
T_PUT_##t13(15, x13); \
T_PUT_##t14(16, x14); \
T_PUT_##t15(17, x15); \
T_PUT_##t16(18, x16); \
T_PUT_##t17(19, x17); \
T_PUT_##t18(20, x18); \
T_PUT_##t19(21, x19); \
T_PUT_##t20(22, x20); \
T_PUT_##t21(23, x21); \
T_PUT_##t22(24, x22); \
T_PUT_##t23(25, x23); \
T_PUT_##t24(26, x24); \
T_PUT_##t25(27, x25); \
T_PUT_##t26(28, x26); \
T_PUT_##t27(29, x27); \
T_PUT_##t28(30, x28); \
T_PUT_##t29(31, x29); \
T_PUT_##t30(32, x30); \
T_PUT_##t31(33, x31); \
T_PUT_##t32(34, x32); \
T_PUT_##t33(35, x33); \
T_COMMIT(); \
} \
} while (0)
#define T71(t,t0,x0,t1,x1,t2,x2,t3,x3,t4,x4,t5,x5,t6,x6,t7,x7,t8,x8,t9,x9,\
t10,x10,t11,x11,t12,x12,t13,x13,t14,x14,t15,x15,t16,x16,t17,x17,\
t18,x18,t19,x19,t20,x20,t21,x21,t22,x22,t23,x23,t24,x24,t25,x25,\
t26,x26,t27,x27,t28,x28,t29,x29,t30,x30,t31,x31,t32,x32,t33,x33,t34,x34) \
do { \
if (T_ACTIVE(t)) { \
T_LOCAL_DATA \
T_HEADER(t); \
T_PUT_##t0(2, x0); \
T_PUT_##t1(3, x1); \
T_PUT_##t2(4, x2); \
T_PUT_##t3(5, x3); \
T_PUT_##t4(6, x4); \
T_PUT_##t5(7, x5); \
T_PUT_##t6(8, x6); \
T_PUT_##t7(9, x7); \
T_PUT_##t8(10, x8); \
T_PUT_##t9(11, x9); \
T_PUT_##t10(12, x10); \
T_PUT_##t11(13, x11); \
T_PUT_##t12(14, x12); \
T_PUT_##t13(15, x13); \
T_PUT_##t14(16, x14); \
T_PUT_##t15(17, x15); \
T_PUT_##t16(18, x16); \
T_PUT_##t17(19, x17); \
T_PUT_##t18(20, x18); \
T_PUT_##t19(21, x19); \
T_PUT_##t20(22, x20); \
T_PUT_##t21(23, x21); \
T_PUT_##t22(24, x22); \
T_PUT_##t23(25, x23); \
T_PUT_##t24(26, x24); \
T_PUT_##t25(27, x25); \
T_PUT_##t26(28, x26); \
T_PUT_##t27(29, x27); \
T_PUT_##t28(30, x28); \
T_PUT_##t29(31, x29); \
T_PUT_##t30(32, x30); \
T_PUT_##t31(33, x31); \
T_PUT_##t32(34, x32); \
T_PUT_##t33(35, x33); \
T_PUT_##t34(36, x34); \
T_COMMIT(); \
} \
} while (0)
#define T_CALL_ERROR \
do { \
printf("%s:%d:%s: error calling T, you have to use T_INT() or T_XX()\n", \
@@ -645,6 +1274,22 @@ extern int *T_active;
#define T34(...) T_CALL_ERROR
#define T36(...) T_CALL_ERROR
#define T38(...) T_CALL_ERROR
#define T40(...) T_CALL_ERROR
#define T42(...) T_CALL_ERROR
#define T44(...) T_CALL_ERROR
#define T46(...) T_CALL_ERROR
#define T48(...) T_CALL_ERROR
#define T50(...) T_CALL_ERROR
#define T52(...) T_CALL_ERROR
#define T54(...) T_CALL_ERROR
#define T56(...) T_CALL_ERROR
#define T58(...) T_CALL_ERROR
#define T60(...) T_CALL_ERROR
#define T62(...) T_CALL_ERROR
#define T64(...) T_CALL_ERROR
#define T66(...) T_CALL_ERROR
#define T68(...) T_CALL_ERROR
#define T70(...) T_CALL_ERROR
/* special cases for VCD logs */

View File

@@ -111,6 +111,26 @@ ID = GNB_PHY_PUCCH_PUSCH_IQ
DESC = gNodeB input data in the frequency domain for a slot where some PUCCH or PUSCH detection was done
GROUP = ALL:PHY:GRAPHIC:HEAVY:GNB
FORMAT = int,frame : int,slot : buffer,rxdataF
ID = GNB_PHY_UL_FD_PUSCH_IQ
DESC = gNodeB UL PUSCH IQ Data in the frequency domain
GROUP = ALL:PHY:GRAPHIC:HEAVY:GNB
FORMAT = int,frame : int,slot : int,datetime_yyyymmdd : int,datetime_hhmmssmmm : int,frame_type : int,freq_range : int,subcarrier_spacing : int,cyclic_prefix : int,symbols_per_slot : int,Nid_cell : int,rnti : int,rb_size : int,rb_start : int,start_symbol_index : int,nr_of_symbols : int,qam_mod_order : int,mcs_index : int,mcs_table : int,nrOfLayers : int,transform_precoding : int,dmrs_config_type : int,ul_dmrs_symb_pos : int,number_dmrs_symbols : int,dmrs_port : int,dmrs_nscid : int,nb_antennas_rx : int,number_of_bits : buffer,data
ID = GNB_PHY_UL_FD_DMRS
DESC = gNodeB UL DMRS Signal in the frequency domain
GROUP = ALL:PHY:GRAPHIC:HEAVY:GNB
FORMAT = int,frame : int,slot : int,datetime_yyyymmdd : int,datetime_hhmmssmmm : int,frame_type : int,freq_range : int,subcarrier_spacing : int,cyclic_prefix : int,symbols_per_slot : int,Nid_cell : int,rnti : int,rb_size : int,rb_start : int,start_symbol_index : int,nr_of_symbols : int,qam_mod_order : int,mcs_index : int,mcs_table : int,nrOfLayers : int,transform_precoding : int,dmrs_config_type : int,ul_dmrs_symb_pos : int,number_dmrs_symbols : int,dmrs_port : int,dmrs_nscid : int,nb_antennas_rx : int,number_of_bits : buffer,data
ID = GNB_PHY_UL_FD_CHAN_EST_DMRS_POS
DESC = gNodeB channel estimation in the frequency domain based on DMRS and at DMRS pilots location without any further interploation.
GROUP = ALL:PHY:GRAPHIC:HEAVY:GNB
FORMAT = int,frame : int,slot : int,datetime_yyyymmdd : int,datetime_hhmmssmmm : int,frame_type : int,freq_range : int,subcarrier_spacing : int,cyclic_prefix : int,symbols_per_slot : int,Nid_cell : int,rnti : int,rb_size : int,rb_start : int,start_symbol_index : int,nr_of_symbols : int,qam_mod_order : int,mcs_index : int,mcs_table : int,nrOfLayers : int,transform_precoding : int,dmrs_config_type : int,ul_dmrs_symb_pos : int,number_dmrs_symbols : int,dmrs_port : int,dmrs_nscid : int,nb_antennas_rx : int,number_of_bits : buffer,data
ID = GNB_PHY_UL_FD_CHAN_EST_DMRS_INTERPL
DESC = gNodeB channel estimation in the frequency domain based on DMRS and interploation.
GROUP = ALL:PHY:GRAPHIC:HEAVY:GNB
FORMAT = int,frame : int,slot : int,datetime_yyyymmdd : int,datetime_hhmmssmmm : int,frame_type : int,freq_range : int,subcarrier_spacing : int,cyclic_prefix : int,symbols_per_slot : int,Nid_cell : int,rnti : int,rb_size : int,rb_start : int,start_symbol_index : int,nr_of_symbols : int,qam_mod_order : int,mcs_index : int,mcs_table : int,nrOfLayers : int,transform_precoding : int,dmrs_config_type : int,ul_dmrs_symb_pos : int,number_dmrs_symbols : int,dmrs_port : int,dmrs_nscid : int,nb_antennas_rx : int,number_of_bits : buffer,dataI
ID = GNB_PHY_UL_PAYLOAD_RX_BITS
DESC = gNodeB slot payload after decoder
GROUP = ALL:PHY:GRAPHIC:HEAVY:GNB
FORMAT = int,frame : int,slot : int,datetime_yyyymmdd : int,datetime_hhmmssmmm : int,frame_type : int,freq_range : int,subcarrier_spacing : int,cyclic_prefix : int,symbols_per_slot : int,Nid_cell : int,rnti : int,rb_size : int,rb_start : int,start_symbol_index : int,nr_of_symbols : int,qam_mod_order : int,mcs_index : int,mcs_table : int,nrOfLayers : int,transform_precoding : int,dmrs_config_type : int,ul_dmrs_symb_pos : int,number_dmrs_symbols : int,dmrs_port : int,dmrs_nscid : int,nb_antennas_rx : int,number_of_bits : buffer,data
ID = GNB_PHY_UL_FREQ_CHANNEL_ESTIMATE
DESC = gNodeB channel estimation in the frequency domain
GROUP = ALL:PHY:GRAPHIC:HEAVY:GNB
@@ -1352,6 +1372,14 @@ ID = UE_PHY_MEAS
DESC = UE PHY measurements
GROUP = ALL:PHY:GRAPHIC:HEAVY:UE
FORMAT = int,eNB_ID : int,frame : int,subframe : int,rsrp : int,rssi : int,snr: int,rx_power: int,noise_power: int,w_cqi: int,freq_offset
ID = UE_PHY_UL_PAYLOAD_TX_BITS
DESC = UE UL Tx bits in one slot before decoder and scrambler
GROUP = ALL:PHY:GRAPHIC:HEAVY:UE
FORMAT = int,frame : int,slot : int,datetime_yyyymmdd : int,datetime_hhmmssmmm : int,frame_type : int,freq_range : int,subcarrier_spacing : int,cyclic_prefix : int,symbols_per_slot : int,Nid_cell : int,rnti : int,rb_size : int,rb_start : int,start_symbol_index : int,nr_of_symbols : int,qam_mod_order : int,mcs_index : int,mcs_table : int,nrOfLayers : int,transform_precoding : int,dmrs_config_type : int,ul_dmrs_symb_pos : int,number_dmrs_symbols : int,dmrs_port : int,dmrs_nscid : int,nb_antennas_tx : int,number_of_bits : buffer,data
ID = UE_PHY_UL_SCRAMBLED_TX_BITS
DESC = UE UL Tx bits in one slot after scrambler
GROUP = ALL:PHY:GRAPHIC:HEAVY:UE
FORMAT = int,frame : int,slot : int,datetime_yyyymmdd : int,datetime_hhmmssmmm : int,frame_type : int,freq_range : int,subcarrier_spacing : int,cyclic_prefix : int,symbols_per_slot : int,Nid_cell : int,rnti : int,rb_size : int,rb_start : int,start_symbol_index : int,nr_of_symbols : int,qam_mod_order : int,mcs_index : int,mcs_table : int,nrOfLayers : int,transform_precoding : int,dmrs_config_type : int,ul_dmrs_symb_pos : int,number_dmrs_symbols : int,dmrs_port : int,dmrs_nscid : int,nb_antennas_tx : int,number_of_bits : buffer,data
#for debug/test - not used
ID = first

View File

@@ -8,7 +8,7 @@ XLIBS=-lX11 -lpng -lXft
all: record replay extract_config textlog enb ue vcd macpdu2wireshark \
extract_input_subframe extract_output_subframe to_vcd extract multi \
gnb
gnb t_tracer_app_gnb t_tracer_app_ue
record: utils.o record.o database.o configuration.o
$(CC) $(CFLAGS) -o record $^ $(LIBS)
@@ -65,6 +65,14 @@ gnb: utils.o gnb.o database.o event.o handler.o configuration.o \
filter/filter.a
$(CC) $(CFLAGS) -o gnb $^ $(LIBS) $(XLIBS)
t_tracer_app_gnb: utils.o t_tracer_app_gnb.o database.o event.o handler.o configuration.o \
logger/logger.a filter/filter.a
$(CC) $(CFLAGS) -o t_tracer_app_gnb $^ $(LIBS) $(XLIBS)
t_tracer_app_ue: utils.o t_tracer_app_ue.o database.o event.o handler.o configuration.o \
logger/logger.a filter/filter.a
$(CC) $(CFLAGS) -o t_tracer_app_ue $^ $(LIBS) $(XLIBS)
multi.o: ../incgen/T_IDs.h
../incgen/T_IDs.h: ../T_messages.txt
@@ -90,7 +98,7 @@ filter/filter.a:
clean:
rm -f *.o core tracer_remote textlog enb ue vcd record replay
rm -f extract_config macpdu2wireshark extract_input_subframe
rm -f extract_output_subframe to_vcd extract multi gnb
rm -f extract_output_subframe to_vcd extract multi gnb t_tracer_app_gnb t_tracer_app_ue
cd gui && $(MAKE) clean
cd view && $(MAKE) clean
cd logger && $(MAKE) clean

View File

@@ -8,7 +8,7 @@
#endif
/* maximum number of arguments for the T macro */
#define T_MAX_ARGS 32
#define T_MAX_ARGS 72
enum event_arg_type {
EVENT_INT,

View File

@@ -0,0 +1,64 @@
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file common/utils/T/tracer/shared_memory_config.h
* \brief shared memory to store data captured by T-Tracer services to be processed by data recording application
* \author Abdo Gaber
* \date 2024
* \version 1.0
* \company Emerson, NI Test and Measurement
* \email:
* \note
* \warning
*/
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <sys/ipc.h>
#include <sys/shm.h>
#include <fcntl.h>
#ifndef _SHARED_MEMORY_CONFIG_H_
#define _SHARED_MEMORY_CONFIG_H_
#define SHMSIZE ((122.88e6 / (100 * 20)) * 1000 * 8) // Assume capture in 1000, each I+Q represented by 8 byts
// 122.88e6: 10ms at 100 MHz BW of 5G NR
// 20: 20 slots in 10ms
// subcarrier spacing: 30 KHz
// for gNB T Tracer App
#define GETKEYDIR1_gNB ("/tmp/gnb_app1")
#define GETKEYDIR2_gNB ("/tmp/gnb_app2")
#define PROJECTID_gNB (2335)
// for UET Tracer App
#define GETKEYDIR1_UE ("/tmp/ue_app1")
#define GETKEYDIR2_UE ("/tmp/ue_app2")
#define PROJECTID_UE (2336)
void err_exit(char *buf);
int create_shm(char **addrN, const char *pathname, int projectId);
void del_shm(char *addr, int shm_id);
#endif /* _SHARED_MEMORY_CONFIG_H_ */

View File

@@ -0,0 +1,973 @@
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file common/utils/T/tracer/t_tracer_app_gnb.c
* \brief T-Tracer gnb service to capture tracee Messages from gNB, it is used by data recording application
* \author Abdo Gaber
* \date 2025
* \version 1.0
* \company Emerson, NI Test and Measurement
* \email:
* \note
* \warning
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <pthread.h>
#include <signal.h>
#include "database.h"
#include "event.h"
#include "handler.h"
#include "logger/logger.h"
#include "utils.h"
#include "event_selector.h"
#include "configuration.h"
#include "shared_memory_config.h"
#include <time.h>
#include <sys/time.h>
#include <unistd.h>
#include <stdint.h>
#include <stdbool.h>
#include <stddef.h>
#include <poll.h>
#define MAX_FRAME_INDEX 1023
#define MAX_SLOT_INDEX 19
#define DEBUG_T_Tracer
#define DEBUG_BUFFER
// Duration to discard recording in milliseconds to mitigate reading data from
// the buffer in the stack from the previous record
#define DISCARD_RECORD_DURATION_MS 10
// Combine bytes in - little-endian format
int combine_bytes(const uint8_t *bytes, size_t num_bytes)
{
int result = 0;
for (size_t i = 0; i < num_bytes; ++i) {
result |= (bytes[i] << (i * 8));
}
return result;
}
// Convert an integer to an array of bytes - little-endian format
void int_to_bytes(int num, uint8_t *bytes, size_t num_bytes)
{
for (size_t i = 0; i < num_bytes; ++i) {
bytes[i] = (num >> (i * 8)) & 0xFF;
}
}
// Check if the message is in the list of bits messages
bool is_bits_messages(int traces_bits_support_data_Collection_format_idx[], int n_bits_msgs, int msg_id)
{
for (int i = 0; i < n_bits_msgs; i++) {
if (msg_id == traces_bits_support_data_Collection_format_idx[i]) {
return true;
}
}
return false;
}
// Get the current time
struct timespec get_current_time()
{
struct timespec time;
clock_gettime(CLOCK_MONOTONIC, &time);
return time;
}
// Function to convert timespec to microseconds
long long timespec_to_microseconds(struct timespec time)
{
return (time.tv_sec * 1000000LL) + (time.tv_nsec / 1000);
}
// Calculate the time difference in milliseconds
double calculate_time_difference(struct timespec start, struct timespec end)
{
double start_ms = start.tv_sec * 1000.0 + start.tv_nsec / 1000000.0;
double end_ms = end.tv_sec * 1000.0 + end.tv_nsec / 1000000.0;
return end_ms - start_ms;
}
// Get Time Stamp in microseconds in YYYYMMDDHHMMSSmmmuuu format
char *get_time_stamp_usec(char time_stamp_str[])
{
// initialization to measure time stamp --This part should be moved to inilization part
time_t my_time;
struct tm *timeinfo;
time(&my_time);
struct timeval tv;
// get time stamp
timeinfo = localtime(&my_time);
gettimeofday(&tv, NULL);
// Add time stamp: yyyy mm dd hh mm ss usec
uint16_t year = timeinfo->tm_year + 1900;
uint8_t mon = timeinfo->tm_mon + 1;
uint8_t mday = timeinfo->tm_mday;
uint8_t hour = timeinfo->tm_hour;
uint8_t min = timeinfo->tm_min;
uint8_t sec = timeinfo->tm_sec;
uint16_t usec = (tv.tv_usec);
// printf ("Time stamp: %d_%d_%d_%d_%d_%d_%d \n",year,mon,mday,hour,min,sec,usec);
// sprintf(time_stamp_str, "%d_%d_%d_%d_%d_%d_%d",year,mon,mday,hour,min,sec,usec);
sprintf(time_stamp_str, "%04d%02d%02d%02d%02d%02d%06d", year, mon, mday, hour, min, sec, usec);
return time_stamp_str;
}
// Convert timestamp string to integer
int convert_time_stamp_to_int(const char *timestamp)
{
return atoi(timestamp);
}
// Split timestamp string and convert to integer
int split_time_stamp_and_convert_to_int(char time_stamp_str[], int shift, int length)
{
char time_part[length + 1]; // Buffer to hold the date part YYYYMMDD or HHMMSSmmm
// Copy the first 8 or 9 characters (YYYYMMDD) to HHMMSSmmm
strncpy(time_part, time_stamp_str + shift, length);
time_part[length] = '\0'; // Null-terminate the string
// Convert timestamp string to integer
return convert_time_stamp_to_int(time_part);
}
void err_exit(char *buf)
{
fprintf(stderr, "%s\n", buf);
exit(1);
}
// create shared memory
int create_shm(char **addrN, const char *shm_path, int projectId)
{
key_t key;
if (-1 != open(shm_path, O_CREAT, 0777)) {
key = ftok(shm_path, projectId);
} else {
err_exit("Error: open shared memory");
}
if (key < 0) {
err_exit("Error: ftok error");
}
int shm_id;
shm_id = shmget(key, SHMSIZE, IPC_CREAT | IPC_EXCL | 0664);
if (shm_id == -1) {
if (errno == EEXIST) {
printf("Error: shared memeory already exist\n");
shm_id = shmget(key, 0, 0);
printf("reference shm_id = %d\n", shm_id);
} else {
perror("errno");
err_exit("shmget error");
}
}
char *addr;
// address to attach - attach for read & write
if ((addr = shmat(shm_id, 0, 0)) == (void *)-1) {
if (shmctl(shm_id, IPC_RMID, NULL) == -1)
err_exit("Error: shmctl error");
else {
printf("Attach shared memory failed\n");
printf("remove shared memory identifier successful\n");
}
err_exit("shmat error");
}
*addrN = addr;
return shm_id;
}
// delete shared memory
void del_shm(char *addr, int shm_id)
{
if (shmdt(addr) < 0)
err_exit("shmdt error");
if (shmctl(shm_id, IPC_RMID, NULL) == -1)
err_exit("shmctl error");
else {
printf("Remove shared memory identifier successful\n");
}
}
/* this function sends the activated traces to the nr-softmodem */
void activate_traces(int socket, int number_of_events, int *is_on)
{
char t = 1;
if (socket_send(socket, &t, 1) == -1 || socket_send(socket, &number_of_events, sizeof(int)) == -1
|| socket_send(socket, is_on, number_of_events * sizeof(int)) == -1)
abort();
}
void usage(void)
{
printf(
"options:\n"
" -d <database file> this option is mandatory\n"
" -ip <host> connect to given IP address (default %s)\n"
" -p <port> connect to given port (default %d)\n",
DEFAULT_REMOTE_IP,
DEFAULT_REMOTE_PORT);
exit(1);
}
// class to store the message and the action to enable capture selected data
// 0: do not record message
// 1: record message
struct trace_struct {
char on_off_name[100];
int on_off_action;
};
// struct for trace message based on Data Collection Trace Messages Structure
// you need to define the vararibles of each message
typedef struct {
/* Data Collection Trace Message Structure */
int frame;
int slot;
int datetime_yyyymmdd;
int datetime_hhmmssmmm;
int frame_type, freq_range, subcarrier_spacing, cyclic_prefix, symbols_per_slot;
int Nid_cell, rnti;
int rb_size, rb_start, start_symbol_index, nr_of_symbols;
int qam_mod_order, mcs_index, mcs_table, nrOfLayers, transform_precoding;
int dmrs_config_type, ul_dmrs_symb_pos, number_dmrs_symbols;
int dmrs_port, dmrs_nscid, nb_antennas_rx, number_of_bits;
int data_size, data;
} event_trace_msg_data;
void setup_trace_msg_data(event_trace_msg_data *d, void *database)
{
database_event_format f;
int i;
/* Data Collection Trace Message Structure */
// FORMAT = int,frame : int,slot : int,datetime_yyyymmdd : int,datetime_hhmmssmmm :
// int,frame_type : int,freq_range : int,subcarrier_spacing : int,cyclic_prefix : int,symbols_per_slot :
// int,Nid_cell : int,rnti :
// int,rb_size : int,rb_start : int,start_symbol_index : int,nr_of_symbols :
// int,qam_mod_order : int,mcs_index : int,mcs_table : int,nrOfLayers :
// int,transform_precoding : int,dmrs_config_type : int,ul_dmrs_symb_pos : int,number_dmrs_symbols :
// int,dmrs_port : int,dmrs_nscid :
// int,nb_antennas_rx : int,number_of_bits : buffer,data
// Initialize the data structure
d->frame = -1;
d->slot = -1;
d->datetime_yyyymmdd = -1;
d->datetime_hhmmssmmm = -1;
d->frame_type = -1;
d->freq_range = -1;
d->subcarrier_spacing = -1;
d->cyclic_prefix = -1;
d->symbols_per_slot = -1;
d->Nid_cell = -1;
d->rnti = -1;
d->rb_size = -1;
d->rb_start = -1;
d->start_symbol_index = -1;
d->nr_of_symbols = -1;
d->qam_mod_order = -1;
d->mcs_index = -1;
d->mcs_table = -1;
d->nrOfLayers = -1;
d->transform_precoding = -1;
d->dmrs_config_type = -1;
d->ul_dmrs_symb_pos = -1;
d->number_dmrs_symbols = -1;
d->dmrs_port = -1;
d->dmrs_nscid = -1;
d->nb_antennas_rx = -1;
d->number_of_bits = -1;
d->data = -1;
/* this macro looks for a particular element and checks its type */
#define G(var_name, var_type, var) \
if (!strcmp(f.name[i], var_name)) { \
if (strcmp(f.type[i], var_type)) { \
printf("Error: Trace Message has a bad type for %s\n", var_name); \
exit(1); \
} \
var = i; \
continue; \
}
/* ------------------------------*/
/* Create Macro for Data Collection Trace Message */
/* ------------------------------*/
// Data Collection Trace Message Structure
// Example: GNB_PHY_UL_FD_PUSCH_IQ, GNB_PHY_UL_FD_DMRS_ID,
// GNB_PHY_UL_FD_CHAN_EST_DMRS_POS, GNB_PHY_UL_FD_CHAN_EST_DMRS_INTERPL
// GNB_PHY_UL_PAYLOAD_RX_BITS
// UE_PHY_UL_SCRAMBLED_TX_BITS
// UE_PHY_UL_PAYLOAD_TX_BITS
// Get a template of any message based on Data Collection Trace Messages Structure
int Trace_MSG_ID = event_id_from_name(database, "GNB_PHY_UL_FD_PUSCH_IQ");
f = get_format(database, Trace_MSG_ID);
/* get the elements of the trace
* the value is an index in the event, see below */
// FORMAT = int,frame : int,slot : int,datetime_yyyymmdd : int,datetime_hhmmssmmm :
// int,frame_type : int,freq_range : int,subcarrier_spacing : int,cyclic_prefix : int,symbols_per_slot :
// int,Nid_cell : int,rnti :
// int,rb_size : int,rb_start : int,start_symbol_index : int,nr_of_symbols :
// int,qam_mod_order : int,mcs_index : int,mcs_table : int,nrOfLayers :
// int,transform_precoding : int,dmrs_config_type : int,ul_dmrs_symb_pos : int,number_dmrs_symbols :
// int,dmrs_port : int,dmrs_nscid :
// int,nb_antennas_rx : int,number_of_bits : buffer,data
for (i = 0; i < f.count; i++) {
G("frame", "int", d->frame)
G("slot", "int", d->slot)
G("datetime_yyyymmdd", "int", d->datetime_yyyymmdd)
G("datetime_hhmmssmmm", "int", d->datetime_hhmmssmmm)
G("frame_type", "int", d->frame_type)
G("freq_range", "int", d->freq_range)
G("subcarrier_spacing", "int", d->subcarrier_spacing)
G("cyclic_prefix", "int", d->cyclic_prefix)
G("symbols_per_slot", "int", d->symbols_per_slot)
G("Nid_cell", "int", d->Nid_cell)
G("rnti", "int", d->rnti)
G("rb_size", "int", d->rb_size)
G("rb_start", "int", d->rb_start)
G("start_symbol_index", "int", d->start_symbol_index)
G("nr_of_symbols", "int", d->nr_of_symbols)
G("qam_mod_order", "int", d->qam_mod_order)
G("mcs_index", "int", d->mcs_index)
G("mcs_table", "int", d->mcs_table)
G("nrOfLayers", "int", d->nrOfLayers)
G("transform_precoding", "int", d->transform_precoding)
G("dmrs_config_type", "int", d->dmrs_config_type)
G("ul_dmrs_symb_pos", "int", d->ul_dmrs_symb_pos)
G("number_dmrs_symbols", "int", d->number_dmrs_symbols)
G("dmrs_port", "int", d->dmrs_port)
G("dmrs_nscid", "int", d->dmrs_nscid)
G("nb_antennas_rx", "int", d->nb_antennas_rx)
G("number_of_bits", "int", d->number_of_bits)
G("data", "buffer", d->data)
}
// if (d->frame == -1 || d->slot == -1) goto error;
#undef G
return;
}
// Function to check if a value is in the array
int isValueInArray(int value, int arr[], int size)
{
for (int i = 0; i < size; i++) {
if (arr[i] == value) {
return 1; // Value found
}
}
return 0; // Value not found
}
void reestablish_connection(int *socket, char *ip, int port, int number_of_events, int *is_on)
{
clear_remote_config();
if (*socket != -1)
close(*socket);
/* connect to the nr-softmodem */
*socket = connect_to(ip, port);
if (*socket == -1) {
printf("\n Failed to connect to nr-softmodem. Retrying...\n");
return;
}
printf("\n Connected");
/* activate the traces in the nr-softmodem */
activate_traces(*socket, number_of_events, is_on);
printf("\n Activated Traces in nr-softmodem");
}
int main(int n, char **v)
{
// Define and initialize an array of strings to list
// trace_msgs_support_data_Collection_format
// it is used to parse the requested messages if it is based
// on Data Collection Trace Messages Structure and supported tracer messages indices
char *traces_iq_support_data_Collection_format[] = {"GNB_PHY_UL_FD_PUSCH_IQ",
"GNB_PHY_UL_FD_DMRS",
"GNB_PHY_UL_FD_CHAN_EST_DMRS_POS",
"GNB_PHY_UL_FD_CHAN_EST_DMRS_INTERPL"};
char *traces_bits_support_data_Collection_format[] = {"GNB_PHY_UL_PAYLOAD_RX_BITS",
"UE_PHY_UL_SCRAMBLED_TX_BITS",
"UE_PHY_UL_PAYLOAD_TX_BITS"};
// extra number of records to simlify Sync between base station and UE synchronization records.
// if you have network delay, you can increase the number of records to capture
int max_sync_offset = 6; // 6 frames ~ 60 ms
// all supported messages
// Calculate the size of the combined array
int n_iq_msgs = sizeof(traces_iq_support_data_Collection_format) / sizeof(traces_iq_support_data_Collection_format[0]);
int n_bits_msgs = sizeof(traces_bits_support_data_Collection_format) / sizeof(traces_bits_support_data_Collection_format[0]);
int n_msgs_based_data_Collection_format = n_iq_msgs + n_bits_msgs;
// Create the combined array
char *traces_support_data_Collection_format[n_msgs_based_data_Collection_format];
// Copy IQ messages to the combined array
for (int i = 0; i < n_iq_msgs; i++) {
traces_support_data_Collection_format[i] = traces_iq_support_data_Collection_format[i];
}
// Copy Bits messages to the combined array
for (int i = 0; i < n_bits_msgs; i++) {
traces_support_data_Collection_format[i + n_iq_msgs] = traces_bits_support_data_Collection_format[i];
}
uint16_t msg_id = 0;
uint16_t start_frame_number = 0;
uint32_t number_records = 0; // number of records to capture, it is number of slots
// array to store the requested tracer messages indices
int req_tracer_msgs_indices[100] = {0};
// define variables --> to do: add all of them to be class of pointers
char *database_filename = NULL;
void *database;
char *ip = DEFAULT_REMOTE_IP;
char ip_address[16]; // max IP address length is 15 + 1 for null terminator
int port = DEFAULT_REMOTE_PORT;
int *is_on;
int number_of_events;
int i;
int socket = -1;
char trace_time_stamp_str[30];
// data structure for the trace messages based on Data Collection Trace Messages Structure
event_trace_msg_data trace_msg_data;
// initlization variables
unsigned int bufIdx_wr = 0;
unsigned int bufIdx_rd = 0;
uint8_t num_req_tracer_msgs = 0;
// initilaze shared memory
char *addr_wr, *addr_rd;
printf("\n Data Collection Service: Initializing shared memory ...");
printf("\n Directory 1: %s, Directory 2: %s", GETKEYDIR1_gNB, GETKEYDIR2_gNB);
printf("\n Project ID: %d\n", PROJECTID_gNB);
int shm_id_wr = create_shm(&addr_wr, GETKEYDIR1_gNB, PROJECTID_gNB);
int shm_id_rd = create_shm(&addr_rd, GETKEYDIR2_gNB, PROJECTID_gNB);
del_shm(addr_wr, shm_id_wr);
del_shm(addr_rd, shm_id_rd);
shm_id_wr = create_shm(&addr_wr, GETKEYDIR1_gNB, PROJECTID_gNB);
shm_id_rd = create_shm(&addr_rd, GETKEYDIR2_gNB, PROJECTID_gNB);
/* write on a socket fails if the other end is closed and we get SIGPIPE */
if (signal(SIGPIPE, SIG_IGN) == SIG_ERR)
abort();
/* parse command line options */
// Port number and IP address are given via API and not via command line
for (i = 1; i < n; i++) {
if (!strcmp(v[i], "-h") || !strcmp(v[i], "--help"))
usage();
if (!strcmp(v[i], "-d")) {
if (i > n - 2)
usage();
database_filename = v[++i];
continue;
}
if (!strcmp(v[i], "-ip")) {
if (i > n - 2)
usage();
ip = v[++i];
continue;
}
if (!strcmp(v[i], "-p")) {
if (i > n - 2)
usage();
port = atoi(v[++i]);
continue;
}
usage();
}
if (database_filename == NULL) {
printf("ERROR: Provide a database file (-d)\n");
exit(1);
}
/* load the database T_messages.txt */
database = parse_database(database_filename);
load_config_file(database_filename);
/* an array of int for all the events defined in the database is needed */
number_of_events = number_of_ids(database);
is_on = calloc(number_of_events, sizeof(int));
if (is_on == NULL)
abort();
// Set first byte of the shared memory to 0
addr_rd[0] = 0; // important to check if we have new requested messages
// read requested tracer msg indices from memory
printf("\n Data Collection Service: Waiting for messages request ...\n");
// 0: Wait
// 1: config
// 2: record
// 3: stop
// Wait for Action Config
while (1) {
if ((uint8_t)(addr_rd[0]) == 0) {
usleep(50); // sleep for 50 us: 0.5 ms slot duration
}
// config state
else if ((uint8_t)(addr_rd[0]) == 1) {
get_time_stamp_usec(trace_time_stamp_str);
printf("\n Received config message. Time Stamp: %s", trace_time_stamp_str);
// get the IP address length in bytes
bufIdx_rd = 1;
uint8_t ip_address_length = addr_rd[bufIdx_rd];
bufIdx_rd += 1; // + 1 byte = IP address length
// read the IP address
for (int i = 0; i < ip_address_length; i++) {
ip_address[i] = addr_rd[bufIdx_rd];
bufIdx_rd += 1;
}
ip = ip_address;
// get the array bytes of the port number : 2 bytes
uint8_t port_number_bytes[2] = {addr_rd[bufIdx_rd], addr_rd[bufIdx_rd + 1]};
bufIdx_rd += 2; // + 2 bytes = start frame number
port = combine_bytes(port_number_bytes, 2);
printf("\n Parameters: IP Address length: %d, IP Address: %s, Port Number: %d \n", ip_address_length, ip_address, port);
addr_rd[0] = 0; // reset memory : to wait for record action
break;
}
}
// Establish connection to the nr-softmodem
clear_remote_config();
if (socket != -1)
close(socket);
/* connect to the nr-softmodem */
socket = connect_to(ip, port);
printf("\n Connected to nr-softmodem");
// Read Action record or stop
printf("\n Data Collection Service: Waiting for record message ...\n");
while (1) {
// wait for Action record
if ((uint8_t)(addr_rd[0]) == 0) {
usleep(50); // sleep for 50 us: 0.5 ms slot duration
}
// quit state
else if ((uint8_t)(addr_rd[0]) == 3) {
printf("\n Received 'stop' command. Exiting...");
printf("\n ");
// Clean up and exit
break;
}
// record state
else if ((uint8_t)(addr_rd[0]) == 2) {
// clear remote buffer if there is
clear_remote_config();
get_time_stamp_usec(trace_time_stamp_str);
printf("\n Received record message. Time Stamp: %s", trace_time_stamp_str);
// read number of requested messages
bufIdx_rd = 1;
num_req_tracer_msgs = addr_rd[bufIdx_rd];
bufIdx_rd += 1;
printf("\n Number of requested tracer messages: %d,", num_req_tracer_msgs);
// reset memory : action to wait for next record action
addr_rd[0] = 0;
// read tracer msg IDs - every message ID has been stored in two bytes
for (uint8_t msg_n = 0; msg_n < num_req_tracer_msgs; msg_n++) {
// get the array bytes of the tracer message ID: 2 bytes
uint8_t msg_id_bytes[2] = {addr_rd[bufIdx_rd], addr_rd[bufIdx_rd + 1]};
bufIdx_rd += 2; // + 2 bytes = message ID
msg_id = combine_bytes(msg_id_bytes, 2);
req_tracer_msgs_indices[msg_n] = msg_id;
printf(" msg_id: %d, ", msg_id);
}
// get the array bytes of the number of records: 4 bytes
uint8_t number_records_bytes[4] = {addr_rd[bufIdx_rd],
addr_rd[bufIdx_rd + 1],
addr_rd[bufIdx_rd + 2],
addr_rd[bufIdx_rd + 3]};
bufIdx_rd += 4; // + 4 bytes = number of records
number_records = combine_bytes(number_records_bytes, 4);
printf("num_records: %d, ", number_records);
// get the array bytes of the start frame number : 2 bytes
uint8_t start_frame_number_bytes[2] = {addr_rd[bufIdx_rd], addr_rd[bufIdx_rd + 1]};
bufIdx_rd += 2; // + 2 bytes = start frame number
start_frame_number = combine_bytes(start_frame_number_bytes, 2);
printf("start_frame: %d\n", start_frame_number);
/* activate the trace in this array */
printf("\n Activate Tracer messages in on_off array: ");
for (i = 0; i < num_req_tracer_msgs; i++) {
char *on_off_name = event_name_from_id(database, req_tracer_msgs_indices[i]);
on_off(database, on_off_name, is_on, 1);
printf("%d, %s, ", req_tracer_msgs_indices[i], on_off_name);
// on_off(database, "GNB_PHY_DL_OUTPUT_SIGNAL", is_on, 1);
}
// get the event IDs for the bit messages
int traces_bits_support_data_Collection_format_idx[n_bits_msgs];
for (int i = 0; i < n_bits_msgs; i++) {
traces_bits_support_data_Collection_format_idx[i] =
event_id_from_name(database, traces_bits_support_data_Collection_format[i]);
}
// all supported messages
int traces_support_data_Collection_format_idx[n_msgs_based_data_Collection_format];
for (int i = 0; i < n_msgs_based_data_Collection_format; i++) {
traces_support_data_Collection_format_idx[i] = event_id_from_name(database, traces_support_data_Collection_format[i]);
}
// setup data for the trace messages
setup_trace_msg_data(&trace_msg_data, database);
printf("\n Setup Trace Data Done");
// Get the start time
struct timespec start_time = get_current_time();
/* activate the tracee in the nr-softmodem */
activate_traces(socket, number_of_events, is_on);
printf("\n Activated Traces in nr-softmodem");
/* a buffer needed to receive events from the nr-softmodem */
OBUF ebuf = {osize : 0, omaxsize : 0, obuf : NULL};
/* read events */
int nrecord_idx = 0;
bufIdx_wr = 0;
// logic to be sure that we have a complete slot record
bool start_recording = false;
bool got_ref_frame_slot = false;
int ref_slot = 0;
int ref_frame = 0;
int slot_difference = 0;
int frame_difference = 0;
int current_frame = 0, prev_frame = 0, current_slot = 0, prev_slot = 0;
// offset to sync between base station and UE synchronization records or power measurements
int sync_offset_index = 0; // increase the index only if the index of frame changes after getting all records
// since we will use the frame differece to do extra records, we should be sure that the last slot is recorded completely
printf("\n\n Data Collection Service: Start reading messages ...");
struct pollfd event_poll_fd;
event_poll_fd.fd = socket;
event_poll_fd.events = POLLIN;
while (1) {
// stop if number of records is done
if ((nrecord_idx >= number_records) && (sync_offset_index >= max_sync_offset)) {
// We added one to the number of records to capture the last record completely if
// we have several messages enabled per slot
break;
}
int poll_ret = poll(&event_poll_fd, 1, 1); // 1 ms timeout for poll
if (poll_ret > 0 && (event_poll_fd.revents & POLLIN)) {
event e = get_event(socket, &ebuf, database);
if (e.type == -1) {
printf("\n Link broken or unexpected message received. Re-establishing connection...\n");
reestablish_connection(&socket, ip, port, number_of_events, is_on);
continue; // Skip further processing and retry
}
//-------------------------
// GNB_PHY_UL_FD_PUSCH_IQ, GNB_PHY_UL_FD_DMRS_ID, GNB_PHY_UL_FD_CHAN_EST_DMRS_POS,
// UE_PHY_UL_SCRAMBLED_TX_BITS, GNB_PHY_UL_PAYLOAD_RX_BITS, UE_PHY_UL_PAYLOAD_TX_BITS
//-------------------------
// is it a requested message
if (isValueInArray(e.type, req_tracer_msgs_indices, num_req_tracer_msgs)) {
// is it based on Data Collection Trace Messages Structure
if (isValueInArray(e.type, traces_support_data_Collection_format_idx, n_msgs_based_data_Collection_format)) {
// Start recording from the next slot to mitigate capturing partial data
// check if the current frame and slot are different from the previous frame and slot
// Then, increase the record index
if (start_recording == false) {
if (got_ref_frame_slot == false) {
ref_frame = e.e[trace_msg_data.frame].i;
ref_slot = e.e[trace_msg_data.slot].i;
printf("\nMessage Info: msg_id %s (%d) \n", event_name_from_id(database, e.type), e.type);
got_ref_frame_slot = true;
}
current_frame = e.e[trace_msg_data.frame].i;
current_slot = e.e[trace_msg_data.slot].i;
frame_difference = (current_frame - ref_frame + MAX_FRAME_INDEX + 1) % (MAX_FRAME_INDEX + 1);
slot_difference = (current_slot - ref_slot + MAX_SLOT_INDEX + 1) % (MAX_SLOT_INDEX + 1);
printf("\n First frame.slot: %d.%d, current frame.slot: %d.%d, diff frame.slot: %d.%d",
ref_frame,
ref_slot,
current_frame,
current_slot,
frame_difference,
slot_difference);
if ((ref_frame != current_frame) || (ref_slot != current_slot)) {
start_recording = true;
printf("\n Start recording from frame: %d, slot: %d ", e.e[trace_msg_data.frame].i, e.e[trace_msg_data.slot].i);
}
}
// start recording from the next frame to mitigate capturing partial data
if (start_recording == true) {
/* this is how to access the elements of the Data Collection trace messages.
* we use e.e[<element>] and then the correct suffix, here
* it's .i for the integer and .b for the buffer and .bsize for the buffer size
* see in event.h the structure event_arg
*/
unsigned char *buf = e.e[trace_msg_data.data].b;
printf("\n\nRecord number: %d", nrecord_idx);
#ifdef DEBUG_BUFFER
printf("\nBuffer index in bytes: %d", bufIdx_wr);
#endif
// add general message header: message ID,
// T-Tracer Message format
// FORMAT = int,frame : int,slot : int,datetime_yyyymmdd : int,datetime_hhmmssmmm :
// int,frame_type : int,freq_range : int,subcarrier_spacing : int,cyclic_prefix : int,symbols_per_slot :
// int,Nid_cell : int,rnti :
// int,rb_size : int,rb_start : int,start_symbol_index : int,nr_of_symbols :
// int,qam_mod_order : int,mcs_index : int,mcs_table : int,nrOfLayers :
// int,transform_precoding : int,dmrs_config_type : int,ul_dmrs_symb_pos : int,number_dmrs_symbols :
// int,dmrs_port : int,dmrs_nscid :
// int,nb_antennas_rx : int,number_of_bits : buffer,data
memcpy(&addr_wr[bufIdx_wr], &e.type, sizeof(uint16_t));
bufIdx_wr += sizeof(uint16_t);
memcpy(&addr_wr[bufIdx_wr], &e.e[trace_msg_data.frame].i, sizeof(uint16_t));
bufIdx_wr += sizeof(uint16_t);
memcpy(&addr_wr[bufIdx_wr], &e.e[trace_msg_data.slot].i, sizeof(uint8_t));
bufIdx_wr += sizeof(uint8_t);
memcpy(&addr_wr[bufIdx_wr], &e.e[trace_msg_data.datetime_yyyymmdd].i, sizeof(uint32_t));
bufIdx_wr += sizeof(uint32_t);
memcpy(&addr_wr[bufIdx_wr], &e.e[trace_msg_data.datetime_hhmmssmmm].i, sizeof(uint32_t));
bufIdx_wr += sizeof(uint32_t);
memcpy(&addr_wr[bufIdx_wr], &e.e[trace_msg_data.frame_type].i, sizeof(uint8_t));
bufIdx_wr += sizeof(uint8_t);
memcpy(&addr_wr[bufIdx_wr], &e.e[trace_msg_data.freq_range].i, sizeof(uint8_t));
bufIdx_wr += sizeof(uint8_t);
memcpy(&addr_wr[bufIdx_wr], &e.e[trace_msg_data.subcarrier_spacing].i, sizeof(uint8_t));
bufIdx_wr += sizeof(uint8_t);
memcpy(&addr_wr[bufIdx_wr], &e.e[trace_msg_data.cyclic_prefix].i, sizeof(uint8_t));
bufIdx_wr += sizeof(uint8_t);
memcpy(&addr_wr[bufIdx_wr], &e.e[trace_msg_data.symbols_per_slot].i, sizeof(uint8_t));
bufIdx_wr += sizeof(uint8_t);
memcpy(&addr_wr[bufIdx_wr], &e.e[trace_msg_data.Nid_cell].i, sizeof(uint16_t));
bufIdx_wr += sizeof(uint16_t);
memcpy(&addr_wr[bufIdx_wr], &e.e[trace_msg_data.rnti].i, sizeof(uint16_t));
bufIdx_wr += sizeof(uint16_t);
memcpy(&addr_wr[bufIdx_wr], &e.e[trace_msg_data.rb_size].i, sizeof(uint16_t));
bufIdx_wr += sizeof(uint16_t);
memcpy(&addr_wr[bufIdx_wr], &e.e[trace_msg_data.rb_start].i, sizeof(uint16_t));
bufIdx_wr += sizeof(uint16_t);
memcpy(&addr_wr[bufIdx_wr], &e.e[trace_msg_data.start_symbol_index].i, sizeof(uint8_t));
bufIdx_wr += sizeof(uint8_t);
memcpy(&addr_wr[bufIdx_wr], &e.e[trace_msg_data.nr_of_symbols].i, sizeof(uint8_t));
bufIdx_wr += sizeof(uint8_t);
memcpy(&addr_wr[bufIdx_wr], &e.e[trace_msg_data.qam_mod_order].i, sizeof(uint8_t));
bufIdx_wr += sizeof(uint8_t);
memcpy(&addr_wr[bufIdx_wr], &e.e[trace_msg_data.mcs_index].i, sizeof(uint8_t));
bufIdx_wr += sizeof(uint8_t);
memcpy(&addr_wr[bufIdx_wr], &e.e[trace_msg_data.mcs_table].i, sizeof(uint8_t));
bufIdx_wr += sizeof(uint8_t);
memcpy(&addr_wr[bufIdx_wr], &e.e[trace_msg_data.nrOfLayers].i, sizeof(uint8_t));
bufIdx_wr += sizeof(uint8_t);
memcpy(&addr_wr[bufIdx_wr], &e.e[trace_msg_data.transform_precoding].i, sizeof(uint8_t));
bufIdx_wr += sizeof(uint8_t);
memcpy(&addr_wr[bufIdx_wr], &e.e[trace_msg_data.dmrs_config_type].i, sizeof(uint8_t));
bufIdx_wr += sizeof(uint8_t);
memcpy(&addr_wr[bufIdx_wr], &e.e[trace_msg_data.ul_dmrs_symb_pos].i, sizeof(uint16_t));
bufIdx_wr += sizeof(uint16_t);
memcpy(&addr_wr[bufIdx_wr], &e.e[trace_msg_data.number_dmrs_symbols].i, sizeof(uint8_t));
bufIdx_wr += sizeof(uint8_t);
memcpy(&addr_wr[bufIdx_wr], &e.e[trace_msg_data.dmrs_port].i, sizeof(uint16_t));
bufIdx_wr += sizeof(uint16_t);
memcpy(&addr_wr[bufIdx_wr], &e.e[trace_msg_data.dmrs_nscid].i, sizeof(uint16_t));
bufIdx_wr += sizeof(uint16_t);
memcpy(&addr_wr[bufIdx_wr], &e.e[trace_msg_data.nb_antennas_rx].i, sizeof(uint8_t));
bufIdx_wr += sizeof(uint8_t);
memcpy(&addr_wr[bufIdx_wr], &e.e[trace_msg_data.number_of_bits].i, sizeof(uint32_t));
bufIdx_wr += sizeof(uint32_t);
printf("\nTime Stamp: %d_%d", e.e[trace_msg_data.datetime_yyyymmdd].i, e.e[trace_msg_data.datetime_hhmmssmmm].i);
// add message body: length in bytes + recorded data
memcpy(&addr_wr[bufIdx_wr], &e.e[trace_msg_data.data].bsize, sizeof(uint32_t));
bufIdx_wr += sizeof(uint32_t);
// read data from buffer and convert from unsigned char * array to int 16 using the right endianness
// T-tracer: Little Endian
// For BITS Messages, example: UE_PHY_UL_SCRAMBLED_TX_BITS: data in bytes
if (is_bits_messages(traces_bits_support_data_Collection_format_idx, n_bits_msgs, e.type)) {
for (int byte_idx = 0; byte_idx < e.e[trace_msg_data.data].bsize; byte_idx += 1) {
// printf("%d, ", buf[byte_idx]);
memcpy(&addr_wr[bufIdx_wr], &buf[byte_idx], sizeof(uint8_t));
bufIdx_wr += sizeof(uint8_t);
}
} else {
for (int byte_idx = 0; byte_idx < e.e[trace_msg_data.data].bsize; byte_idx += 2) {
// For a little-endian system:
memcpy(&addr_wr[bufIdx_wr], &buf[byte_idx], sizeof(uint8_t));
bufIdx_wr += sizeof(uint8_t);
memcpy(&addr_wr[bufIdx_wr], &buf[byte_idx + 1], sizeof(uint8_t));
bufIdx_wr += sizeof(uint8_t);
}
}
/*
for (int byte_idx_i = 0; byte_idx_i < e.e[d.nr_ul_fd_dmrs_data].bsize; byte_idx_i+=4) {
int16_t I = buf[byte_idx_i] | (buf[byte_idx_i+1] << 8);
int16_t Q = buf[byte_idx_i+2] | (buf[byte_idx_i+3] << 8);
printf ("idx %d, ", byte_idx_i);
printf ("\n%d", I);
printf ("\n%d", Q);
}
*/
// check if the current frame and slot are different from the previous frame and slot
// Then, increase the record index
current_frame = e.e[trace_msg_data.frame].i;
current_slot = e.e[trace_msg_data.slot].i;
// increase sync offset index if the current frame is different from the previous frame
if ((current_frame != prev_frame) && nrecord_idx >= number_records) {
sync_offset_index++;
}
if (current_frame != prev_frame || current_slot != prev_slot) {
nrecord_idx++;
// Update previous frame and slot numbers
prev_frame = current_frame;
prev_slot = current_slot;
}
#ifdef DEBUG_T_Tracer
printf("\nMessage Info: msg_id %s (%d) \n", event_name_from_id(database, e.type), e.type);
printf("frame %d, slot %d, datetime %d_%d\n",
e.e[trace_msg_data.frame].i,
e.e[trace_msg_data.slot].i,
e.e[trace_msg_data.datetime_yyyymmdd].i,
e.e[trace_msg_data.datetime_hhmmssmmm].i);
printf("frame_type %d, freq_range %d, subcarrier_spacing %d, cyclic_prefix %d, symbols_per_slot %d\n",
e.e[trace_msg_data.frame_type].i,
e.e[trace_msg_data.freq_range].i,
e.e[trace_msg_data.subcarrier_spacing].i,
e.e[trace_msg_data.cyclic_prefix].i,
e.e[trace_msg_data.symbols_per_slot].i);
printf("Nid_cell %d, rnti %d, rb_size %d, rb_start %d, start_symbol_index %d, nr_of_symbols %d\n",
e.e[trace_msg_data.Nid_cell].i,
e.e[trace_msg_data.rnti].i,
e.e[trace_msg_data.rb_size].i,
e.e[trace_msg_data.rb_start].i,
e.e[trace_msg_data.start_symbol_index].i,
e.e[trace_msg_data.nr_of_symbols].i);
printf("qam_mod_order %d, mcs_index %d, mcs_table %d, nrOfLayers %d, transform_precoding %d\n",
e.e[trace_msg_data.qam_mod_order].i,
e.e[trace_msg_data.mcs_index].i,
e.e[trace_msg_data.mcs_table].i,
e.e[trace_msg_data.nrOfLayers].i,
e.e[trace_msg_data.transform_precoding].i);
printf("dmrs_config_type %d, ul_dmrs_symb_pos %d, number_dmrs_symbols %d, dmrs_port %d, dmrs_nscid %d\n",
e.e[trace_msg_data.dmrs_config_type].i,
e.e[trace_msg_data.ul_dmrs_symb_pos].i,
e.e[trace_msg_data.number_dmrs_symbols].i,
e.e[trace_msg_data.dmrs_port].i,
e.e[trace_msg_data.dmrs_nscid].i);
printf("nb_antennas_rx %d, number_of_bits %d, data size %d\n",
e.e[trace_msg_data.nb_antennas_rx].i,
e.e[trace_msg_data.number_of_bits].i,
e.e[trace_msg_data.data].bsize);
#endif
} // End of start recording flag
} // end of if statement for the supported messages based on Data Collection Trace Messages Structure
else {
printf("ERROR: Requested Message is not based on Data Collection Trace Messages Structure\n");
printf("ERROR: Requested Message ID: %d\n", e.type);
}
} // end of if statement for the requested messages
} // end while loop of reading events
else {
// No data, just loop and check time
usleep(100); // optional: avoid busy-waiting
}
} // End of while loop to read events
// de-activate the tracee in the nr-softmodem
printf("\n De-activated Tracer message:\n");
for (i = 0; i < num_req_tracer_msgs; i++) {
char *on_off_name = event_name_from_id(database, req_tracer_msgs_indices[i]);
on_off(database, on_off_name, is_on, 0);
// printf("\n %d, %s, ", req_tracer_msgs_indices[i], on_off_name);
// on_off(database, "GNB_PHY_DL_OUTPUT_SIGNAL", is_on, 1);
}
// De-activate the tracee in the nr-softmodem
activate_traces(socket, number_of_events, is_on);
printf("\n De-activated Traces");
// Get the end time
struct timespec end_time = get_current_time();
// Calculate the time difference
double time_diff = calculate_time_difference(start_time, end_time);
printf("Total Time difference: %.2f ms\n", time_diff);
printf("Time difference per record: %.2f ms\n", time_diff / (number_records + max_sync_offset));
// discard stale or previous record data for the first DISCARD_RECORD_DURATION_MS
struct timespec record_start, record_now;
clock_gettime(CLOCK_MONOTONIC, &record_start);
while (1) {
clock_gettime(CLOCK_MONOTONIC, &record_now);
double elapsed_ms = calculate_time_difference(record_start, record_now);
if (elapsed_ms >= DISCARD_RECORD_DURATION_MS) {
break; // Stop after 10ms
}
int poll_ret = poll(&event_poll_fd, 1, 1); // 1 ms timeout for poll
if (poll_ret > 0 && (event_poll_fd.revents & POLLIN)) {
event e = get_event(socket, &ebuf, database);
printf("%d", e.type);
if (e.type == -1) {
printf("\n Link broken or unexpected message received. Re-establishing connection...\n");
reestablish_connection(&socket, ip, port, number_of_events, is_on);
continue;
}
} else {
// No data, just loop and check time
usleep(100); // optional: avoid busy-waiting
}
} // End of while loop to discard stale records
}
} // End a while loop to check for the "stop" command
// de-activate the tracee in the nr-softmodem
free_database(database);
free(is_on);
close(socket);
return 0;
}

View File

@@ -0,0 +1,976 @@
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file common/utils/T/tracer/t_tracer_app_ue.c
* \brief T-Tracer UE service to capture tracee Messages from UE, it is used by data recording application
* \author Abdo Gaber
* \date 2025
* \version 1.0
* \company Emerson, NI Test and Measurement
* \email:
* \note
* \warning
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <pthread.h>
#include <signal.h>
#include "database.h"
#include "event.h"
#include "handler.h"
#include "logger/logger.h"
#include "utils.h"
#include "event_selector.h"
#include "configuration.h"
#include "shared_memory_config.h"
#include <time.h>
#include <sys/time.h>
#include <unistd.h>
#include <stdint.h>
#include <stdbool.h>
#include <stddef.h>
#include <poll.h>
#define MAX_FRAME_INDEX 1023
#define MAX_SLOT_INDEX 19
#define DEBUG_T_Tracer
#define DEBUG_BUFFER
// Duration to discard recording in milliseconds to mitigate stale or previous record data
#define DISCARD_RECORD_DURATION_MS 10
// #include <linux/time.h>
// Combine bytes in little-endian format
int combine_bytes(const uint8_t *bytes, size_t num_bytes)
{
int result = 0;
for (size_t i = 0; i < num_bytes; ++i) {
result |= (bytes[i] << (i * 8));
}
return result;
}
// Convert an integer to an array of bytes in little-endian format
void int_to_bytes(int num, uint8_t *bytes, size_t num_bytes)
{
for (size_t i = 0; i < num_bytes; ++i) {
bytes[i] = (num >> (i * 8)) & 0xFF;
}
}
// Check if the message is in the list of bits messages
bool is_bits_messages(int traces_bits_support_data_Collection_format_idx[], int n_bits_msgs, int msg_id)
{
for (int i = 0; i < n_bits_msgs; i++) {
if (msg_id == traces_bits_support_data_Collection_format_idx[i]) {
return true;
}
}
return false;
}
// Get the current time
struct timespec get_current_time()
{
struct timespec time;
clock_gettime(CLOCK_MONOTONIC, &time);
return time;
}
// Function to convert timespec to microseconds
long long timespec_to_microseconds(struct timespec time)
{
return (time.tv_sec * 1000000LL) + (time.tv_nsec / 1000);
}
// Calculate the time difference in milliseconds
double calculate_time_difference(struct timespec start, struct timespec end)
{
double start_ms = start.tv_sec * 1000.0 + start.tv_nsec / 1000000.0;
double end_ms = end.tv_sec * 1000.0 + end.tv_nsec / 1000000.0;
return end_ms - start_ms;
}
// Get Time Stamp in microseconds in YYYYMMDDHHMMSSmmmuuu format
char *get_time_stamp_usec(char time_stamp_str[])
{
// initialization to measure time stamp --This part should be moved to inilization part
time_t my_time;
struct tm *timeinfo;
time(&my_time);
struct timeval tv;
// get time stamp
timeinfo = localtime(&my_time);
gettimeofday(&tv, NULL);
// Add time stamp: yyyy mm dd hh mm ss usec
uint16_t year = timeinfo->tm_year + 1900;
uint8_t mon = timeinfo->tm_mon + 1;
uint8_t mday = timeinfo->tm_mday;
uint8_t hour = timeinfo->tm_hour;
uint8_t min = timeinfo->tm_min;
uint8_t sec = timeinfo->tm_sec;
uint16_t usec = (tv.tv_usec);
// printf ("Time stamp: %d_%d_%d_%d_%d_%d_%d \n",year,mon,mday,hour,min,sec,usec);
// sprintf(time_stamp_str, "%d_%d_%d_%d_%d_%d_%d",year,mon,mday,hour,min,sec,usec);
sprintf(time_stamp_str, "%04d%02d%02d%02d%02d%02d%06d", year, mon, mday, hour, min, sec, usec);
return time_stamp_str;
}
// Convert timestamp string to integer
int convert_time_stamp_to_int(const char *timestamp)
{
return atoi(timestamp);
}
// Split timestamp string and convert to integer
int split_time_stamp_and_convert_to_int(char time_stamp_str[], int shift, int length)
{
char time_part[length + 1]; // Buffer to hold the date part YYYYMMDD or HHMMSSmmm
// Copy the first 8 or 9 characters (YYYYMMDD) to HHMMSSmmm
strncpy(time_part, time_stamp_str + shift, length);
time_part[length] = '\0'; // Null-terminate the string
// Convert timestamp string to integer
return convert_time_stamp_to_int(time_part);
}
void err_exit(char *buf)
{
fprintf(stderr, "%s\n", buf);
exit(1);
}
// create shared memory
int create_shm(char **addrN, const char *shm_path, int projectId)
{
key_t key;
if (-1 != open(shm_path, O_CREAT, 0777)) {
key = ftok(shm_path, projectId);
} else {
err_exit("Error: open shared memory");
}
if (key < 0) {
err_exit("Error: ftok error");
}
int shm_id;
shm_id = shmget(key, SHMSIZE, IPC_CREAT | IPC_EXCL | 0664);
if (shm_id == -1) {
if (errno == EEXIST) {
printf("Error: shared memeory already exist\n");
shm_id = shmget(key, 0, 0);
printf("reference shm_id = %d\n", shm_id);
} else {
perror("errno");
err_exit("shmget error");
}
}
char *addr;
// address to attach - attach for read & write
if ((addr = shmat(shm_id, 0, 0)) == (void *)-1) {
if (shmctl(shm_id, IPC_RMID, NULL) == -1)
err_exit("Error: shmctl error");
else {
printf("Attach shared memory failed\n");
printf("remove shared memory identifier successful\n");
}
err_exit("shmat error");
}
*addrN = addr;
return shm_id;
}
// delete shared memory
void del_shm(char *addr, int shm_id)
{
if (shmdt(addr) < 0)
err_exit("shmdt error");
if (shmctl(shm_id, IPC_RMID, NULL) == -1)
err_exit("shmctl error");
else {
printf("Remove shared memory identifier successful\n");
}
}
/* this function sends the activated traces to the nr-softmodem */
void activate_traces(int socket, int number_of_events, int *is_on)
{
char t = 1;
if (socket_send(socket, &t, 1) == -1 || socket_send(socket, &number_of_events, sizeof(int)) == -1
|| socket_send(socket, is_on, number_of_events * sizeof(int)) == -1)
abort();
}
void usage(void)
{
printf(
"options:\n"
" -d <database file> this option is mandatory\n"
" -ip <host> connect to given IP address (default %s)\n"
" -p <port> connect to given port (default %d)\n",
DEFAULT_REMOTE_IP,
DEFAULT_REMOTE_PORT);
exit(1);
}
// class to store the message and the action to enable capture selected data
// 0: do not record message
// 1: record message
struct trace_struct {
char on_off_name[100];
int on_off_action;
};
// struct for trace message based on Data Collection Trace Messages Structure
// you need to define the vararibles of each message
typedef struct {
/* Data Collection Trace Message Structure */
int frame;
int slot;
int datetime_yyyymmdd;
int datetime_hhmmssmmm;
int frame_type, freq_range, subcarrier_spacing, cyclic_prefix, symbols_per_slot;
int Nid_cell, rnti;
int rb_size, rb_start, start_symbol_index, nr_of_symbols;
int qam_mod_order, mcs_index, mcs_table, nrOfLayers, transform_precoding;
int dmrs_config_type, ul_dmrs_symb_pos, number_dmrs_symbols;
int dmrs_port, dmrs_nscid, nb_antennas_tx, number_of_bits;
int data_size, data;
} event_trace_msg_data;
void setup_trace_msg_data(event_trace_msg_data *d, void *database)
{
database_event_format f;
int i;
/* Data Collection Trace Message Structure */
// FORMAT = int,frame : int,slot : int,datetime_yyyymmdd : int,datetime_hhmmssmmm :
// int,frame_type : int,freq_range : int,subcarrier_spacing : int,cyclic_prefix : int,symbols_per_slot :
// int,Nid_cell : int,rnti :
// int,rb_size : int,rb_start : int,start_symbol_index : int,nr_of_symbols :
// int,qam_mod_order : int,mcs_index : int,mcs_table : int,nrOfLayers :
// int,transform_precoding : int,dmrs_config_type : int,ul_dmrs_symb_pos : int,number_dmrs_symbols :
// int,dmrs_port : int,dmrs_nscid :
// int,nb_antennas_tx : int,number_of_bits : buffer,data
// Initialize the data structure
d->frame = -1;
d->slot = -1;
d->datetime_yyyymmdd = -1;
d->datetime_hhmmssmmm = -1;
d->frame_type = -1;
d->freq_range = -1;
d->subcarrier_spacing = -1;
d->cyclic_prefix = -1;
d->symbols_per_slot = -1;
d->Nid_cell = -1;
d->rnti = -1;
d->rb_size = -1;
d->rb_start = -1;
d->start_symbol_index = -1;
d->nr_of_symbols = -1;
d->qam_mod_order = -1;
d->mcs_index = -1;
d->mcs_table = -1;
d->nrOfLayers = -1;
d->transform_precoding = -1;
d->dmrs_config_type = -1;
d->ul_dmrs_symb_pos = -1;
d->number_dmrs_symbols = -1;
d->dmrs_port = -1;
d->dmrs_nscid = -1;
d->nb_antennas_tx = -1;
d->number_of_bits = -1;
d->data = -1;
/* this macro looks for a particular element and checks its type */
#define G(var_name, var_type, var) \
if (!strcmp(f.name[i], var_name)) { \
if (strcmp(f.type[i], var_type)) { \
printf("Error: Trace Message has a bad type for %s\n", var_name); \
exit(1); \
} \
var = i; \
continue; \
}
/* ------------------------------*/
/* Create Macro for Data Collection Trace Message */
/* ------------------------------*/
// Data Collection Trace Message Structure
// Example: GNB_PHY_UL_FD_PUSCH_IQ, GNB_PHY_UL_FD_DMRS_ID,
// GNB_PHY_UL_FD_CHAN_EST_DMRS_POS, GNB_PHY_UL_FD_CHAN_EST_DMRS_INTERPL
// GNB_PHY_UL_PAYLOAD_RX_BITS
// UE_PHY_UL_SCRAMBLED_TX_BITS
// UE_PHY_UL_PAYLOAD_TX_BITS
// Get a template of any message based on Data Collection Trace Messages Structure
int Trace_MSG_ID = event_id_from_name(database, "GNB_PHY_UL_FD_PUSCH_IQ");
f = get_format(database, Trace_MSG_ID);
/* get the elements of the trace
* the value is an index in the event, see below */
// FORMAT = int,frame : int,slot : int,datetime_yyyymmdd : int,datetime_hhmmssmmm :
// int,frame_type : int,freq_range : int,subcarrier_spacing : int,cyclic_prefix : int,symbols_per_slot :
// int,Nid_cell : int,rnti :
// int,rb_size : int,rb_start : int,start_symbol_index : int,nr_of_symbols :
// int,qam_mod_order : int,mcs_index : int,mcs_table : int,nrOfLayers :
// int,transform_precoding : int,dmrs_config_type : int,ul_dmrs_symb_pos : int,number_dmrs_symbols :
// int,dmrs_port : int,dmrs_nscid :
// int,nb_antennas_tx : int,number_of_bits : buffer,data
for (i = 0; i < f.count; i++) {
G("frame", "int", d->frame)
G("slot", "int", d->slot)
G("datetime_yyyymmdd", "int", d->datetime_yyyymmdd)
G("datetime_hhmmssmmm", "int", d->datetime_hhmmssmmm)
G("frame_type", "int", d->frame_type)
G("freq_range", "int", d->freq_range)
G("subcarrier_spacing", "int", d->subcarrier_spacing)
G("cyclic_prefix", "int", d->cyclic_prefix)
G("symbols_per_slot", "int", d->symbols_per_slot)
G("Nid_cell", "int", d->Nid_cell)
G("rnti", "int", d->rnti)
G("rb_size", "int", d->rb_size)
G("rb_start", "int", d->rb_start)
G("start_symbol_index", "int", d->start_symbol_index)
G("nr_of_symbols", "int", d->nr_of_symbols)
G("qam_mod_order", "int", d->qam_mod_order)
G("mcs_index", "int", d->mcs_index)
G("mcs_table", "int", d->mcs_table)
G("nrOfLayers", "int", d->nrOfLayers)
G("transform_precoding", "int", d->transform_precoding)
G("dmrs_config_type", "int", d->dmrs_config_type)
G("ul_dmrs_symb_pos", "int", d->ul_dmrs_symb_pos)
G("number_dmrs_symbols", "int", d->number_dmrs_symbols)
G("dmrs_port", "int", d->dmrs_port)
G("dmrs_nscid", "int", d->dmrs_nscid)
// bug in T-Tracer Framework, need to be checked that is why we are getting
// the right tx antennas only if we set to rx "nb_antennas_rx"
G("nb_antennas_rx", "int", d->nb_antennas_tx)
G("number_of_bits", "int", d->number_of_bits)
G("data", "buffer", d->data)
}
// if (d->frame == -1 || d->slot == -1) goto error;
#undef G
return;
}
// Function to check if a value is in the array
int isValueInArray(int value, int arr[], int size)
{
for (int i = 0; i < size; i++) {
if (arr[i] == value) {
return 1; // Value found
}
}
return 0; // Value not found
}
void reestablish_connection(int *socket, char *ip, int port, int number_of_events, int *is_on)
{
clear_remote_config();
if (*socket != -1)
close(*socket);
/* connect to the nr-softmodem */
*socket = connect_to(ip, port);
if (*socket == -1) {
printf("\n Failed to connect to nr-softmodem. Retrying...\n");
return;
}
printf("\n Connected");
/* activate the traces in the nr-softmodem */
activate_traces(*socket, number_of_events, is_on);
printf("\n Activated Traces in nr-softmodem");
}
int main(int n, char **v)
{
// Define and initialize an array of strings to list
// trace_msgs_support_data_Collection_format
// it is used to parse the requested messages if it is based
// on Data Collection Trace Messages Structure and supported tracer messages indices
char *traces_iq_support_data_Collection_format[] = {"GNB_PHY_UL_FD_PUSCH_IQ",
"GNB_PHY_UL_FD_DMRS",
"GNB_PHY_UL_FD_CHAN_EST_DMRS_POS",
"GNB_PHY_UL_FD_CHAN_EST_DMRS_INTERPL"};
char *traces_bits_support_data_Collection_format[] = {"GNB_PHY_UL_PAYLOAD_RX_BITS",
"UE_PHY_UL_SCRAMBLED_TX_BITS",
"UE_PHY_UL_PAYLOAD_TX_BITS"};
// extra number of records to simlify Sync between base station and UE synchronization records.
// if you have network delay, you can increase the number of records to capture
int max_sync_offset = 6; // 6 frames ~ 60 ms
// all supported messages
// Calculate the size of the combined array
int n_iq_msgs = sizeof(traces_iq_support_data_Collection_format) / sizeof(traces_iq_support_data_Collection_format[0]);
int n_bits_msgs = sizeof(traces_bits_support_data_Collection_format) / sizeof(traces_bits_support_data_Collection_format[0]);
int n_msgs_based_data_Collection_format = n_iq_msgs + n_bits_msgs;
// Create the combined array
char *traces_support_data_Collection_format[n_msgs_based_data_Collection_format];
// Copy IQ messages to the combined array
for (int i = 0; i < n_iq_msgs; i++) {
traces_support_data_Collection_format[i] = traces_iq_support_data_Collection_format[i];
}
// Copy Bits messages to the combined array
for (int i = 0; i < n_bits_msgs; i++) {
traces_support_data_Collection_format[i + n_iq_msgs] = traces_bits_support_data_Collection_format[i];
}
uint16_t msg_id = 0;
uint16_t start_frame_number = 0;
uint32_t number_records = 0; // number of records to capture, it is number of slots
// array to store the requested tracer messages indices
int req_tracer_msgs_indices[100] = {0};
// define variables --> to do: add all of them to be class of pointers
char *database_filename = NULL;
void *database;
char *ip = DEFAULT_REMOTE_IP;
char ip_address[16]; // max IP address length is 15 + 1 for null terminator
int port = DEFAULT_REMOTE_PORT;
int *is_on;
int number_of_events;
int i;
int socket = -1;
char trace_time_stamp_str[30];
// data structure for the trace messages based on Data Collection Trace Messages Structure
event_trace_msg_data trace_msg_data;
// initlization variables
unsigned int bufIdx_wr = 0;
unsigned int bufIdx_rd = 0;
uint8_t num_req_tracer_msgs = 0;
// initilaze shared memory
char *addr_wr, *addr_rd;
printf("\n Data Collection Service: Initializing shared memory ...");
printf("\n Directory 1: %s, Directory 2: %s", GETKEYDIR1_UE, GETKEYDIR2_UE);
printf("\n Project ID: %d\n", PROJECTID_UE);
int shm_id_wr = create_shm(&addr_wr, GETKEYDIR1_UE, PROJECTID_UE);
int shm_id_rd = create_shm(&addr_rd, GETKEYDIR2_UE, PROJECTID_UE);
del_shm(addr_wr, shm_id_wr);
del_shm(addr_rd, shm_id_rd);
shm_id_wr = create_shm(&addr_wr, GETKEYDIR1_UE, PROJECTID_UE);
shm_id_rd = create_shm(&addr_rd, GETKEYDIR2_UE, PROJECTID_UE);
/* write on a socket fails if the other end is closed and we get SIGPIPE */
if (signal(SIGPIPE, SIG_IGN) == SIG_ERR)
abort();
/* parse command line options */
// Port number and IP address are given via API and not via command line
for (i = 1; i < n; i++) {
if (!strcmp(v[i], "-h") || !strcmp(v[i], "--help"))
usage();
if (!strcmp(v[i], "-d")) {
if (i > n - 2)
usage();
database_filename = v[++i];
continue;
}
if (!strcmp(v[i], "-ip")) {
if (i > n - 2)
usage();
ip = v[++i];
continue;
}
if (!strcmp(v[i], "-p")) {
if (i > n - 2)
usage();
port = atoi(v[++i]);
continue;
}
usage();
}
if (database_filename == NULL) {
printf("ERROR: Provide a database file (-d)\n");
exit(1);
}
/* load the database T_messages.txt */
database = parse_database(database_filename);
load_config_file(database_filename);
/* an array of int for all the events defined in the database is needed */
number_of_events = number_of_ids(database);
is_on = calloc(number_of_events, sizeof(int));
if (is_on == NULL)
abort();
// Set first byte of the shared memory to 0
addr_rd[0] = 0; // important to check if we have new requested messages
// read requested tracer msg indices from memory
printf("\n Data Collection Service: Waiting for messages request ...\n");
// 0: Wait
// 1: config
// 2: record
// 3: stop
// Wait for Action Config
while (1) {
if ((uint8_t)(addr_rd[0]) == 0) {
usleep(50); // sleep for 50 us: 0.5 ms slot duration
}
// config state
else if ((uint8_t)(addr_rd[0]) == 1) {
get_time_stamp_usec(trace_time_stamp_str);
printf("\n Received config message. Time Stamp: %s", trace_time_stamp_str);
// get the IP address length in bytes
bufIdx_rd = 1;
uint8_t ip_address_length = addr_rd[bufIdx_rd];
bufIdx_rd += 1; // + 1 byte = IP address length
// read the IP address
for (int i = 0; i < ip_address_length; i++) {
ip_address[i] = addr_rd[bufIdx_rd];
bufIdx_rd += 1;
}
ip = ip_address;
// get the array bytes of the port number : 2 bytes
uint8_t port_number_bytes[2] = {addr_rd[bufIdx_rd], addr_rd[bufIdx_rd + 1]};
bufIdx_rd += 2; // + 2 bytes = start frame number
port = combine_bytes(port_number_bytes, 2);
printf("\n Parameters: IP Address length: %d, IP Address: %s, Port Number: %d \n", ip_address_length, ip_address, port);
addr_rd[0] = 0; // reset memory : to wait for record action
break;
}
}
// Establish connection to the nr-softmodem
clear_remote_config();
if (socket != -1)
close(socket);
/* connect to the nr-softmodem */
socket = connect_to(ip, port);
printf("\n Connected to nr-UEsoftmodem");
// Read Action record or stop
printf("\n Data Collection Service: Waiting for record message ...\n");
while (1) {
// wait for Action record
if ((uint8_t)(addr_rd[0]) == 0) {
usleep(50); // sleep for 50 us: 0.5 ms slot duration
}
// quit state
else if ((uint8_t)(addr_rd[0]) == 3) {
printf("\n Received 'stop' command. Exiting...");
printf("\n ");
// Clean up and exit
break;
}
// record state
else if ((uint8_t)(addr_rd[0]) == 2) {
// clear remote buffer if there is
clear_remote_config();
get_time_stamp_usec(trace_time_stamp_str);
printf("\n Received record message. Time Stamp: %s", trace_time_stamp_str);
// read number of requested messages
bufIdx_rd = 1;
num_req_tracer_msgs = addr_rd[bufIdx_rd];
bufIdx_rd += 1;
printf("\n Number of requested tracer messages: %d,", num_req_tracer_msgs);
// reset memory : action to wait for next record action
addr_rd[0] = 0;
// read tracer msg IDs - every message ID has been stored in two bytes
for (uint8_t msg_n = 0; msg_n < num_req_tracer_msgs; msg_n++) {
// get the array bytes of the tracer message ID: 2 bytes
uint8_t msg_id_bytes[2] = {addr_rd[bufIdx_rd], addr_rd[bufIdx_rd + 1]};
bufIdx_rd += 2; // + 2 bytes = message ID
msg_id = combine_bytes(msg_id_bytes, 2);
req_tracer_msgs_indices[msg_n] = msg_id;
printf(" msg_id: %d, ", msg_id);
}
// get the array bytes of the number of records: 4 bytes
uint8_t number_records_bytes[4] = {addr_rd[bufIdx_rd],
addr_rd[bufIdx_rd + 1],
addr_rd[bufIdx_rd + 2],
addr_rd[bufIdx_rd + 3]};
bufIdx_rd += 4; // + 4 bytes = number of records
number_records = combine_bytes(number_records_bytes, 4);
printf("num_records: %d, ", number_records);
// get the array bytes of the start frame number : 2 bytes
uint8_t start_frame_number_bytes[2] = {addr_rd[bufIdx_rd], addr_rd[bufIdx_rd + 1]};
bufIdx_rd += 2; // + 2 bytes = start frame number
start_frame_number = combine_bytes(start_frame_number_bytes, 2);
printf("start_frame: %d\n", start_frame_number);
/* activate the trace in this array */
printf("\n Activate Tracer messages in on_off array: \n");
for (i = 0; i < num_req_tracer_msgs; i++) {
char *on_off_name = event_name_from_id(database, req_tracer_msgs_indices[i]);
on_off(database, on_off_name, is_on, 1);
printf("%d, %s, ", req_tracer_msgs_indices[i], on_off_name);
// on_off(database, "GNB_PHY_DL_OUTPUT_SIGNAL", is_on, 1);
}
// get the event IDs for the bit messages
int traces_bits_support_data_Collection_format_idx[n_bits_msgs];
for (int i = 0; i < n_bits_msgs; i++) {
traces_bits_support_data_Collection_format_idx[i] =
event_id_from_name(database, traces_bits_support_data_Collection_format[i]);
}
// all supported messages
int traces_support_data_Collection_format_idx[n_msgs_based_data_Collection_format];
for (int i = 0; i < n_msgs_based_data_Collection_format; i++) {
traces_support_data_Collection_format_idx[i] = event_id_from_name(database, traces_support_data_Collection_format[i]);
}
// setup data for the trace messages
setup_trace_msg_data(&trace_msg_data, database);
printf("\n Setup Trace Data Done");
// Get the start time
struct timespec start_time = get_current_time();
/* activate the tracee in the nr-softmodem */
activate_traces(socket, number_of_events, is_on);
printf("\n Activated Traces in nr-UEsoftmodem");
/* a buffer needed to receive events from the nr-softmodem */
OBUF ebuf = {osize : 0, omaxsize : 0, obuf : NULL};
/* read events */
int nrecord_idx = 0;
bufIdx_wr = 0;
// logic to be sure that we have a complete slot record
bool start_recording = false;
bool got_ref_frame_slot = false;
int ref_slot = 0;
int ref_frame = 0;
int slot_difference = 0;
int frame_difference = 0;
int current_frame = 0, prev_frame = 0, current_slot = 0, prev_slot = 0;
// offset to sync between base station and UE synchronization records or power measurements
int sync_offset_index = 0; // increase the index only if the index of frame changes after getting all records
// since we will use the frame differece to do extra records, we should be sure that the last slot is recorded completely
printf("\n\n Data Collection Service: Start reading messages ...");
struct pollfd event_poll_fd;
event_poll_fd.fd = socket;
event_poll_fd.events = POLLIN;
while (1) {
// stop if number of records is done
if ((nrecord_idx >= number_records) && (sync_offset_index >= max_sync_offset)) {
// We added one to the number of records to capture the last record completely
// if we have several messages enabled per slot
break;
}
int poll_ret = poll(&event_poll_fd, 1, 1); // 1 ms timeout for poll
if (poll_ret > 0 && (event_poll_fd.revents & POLLIN)) {
event e = get_event(socket, &ebuf, database);
if (e.type == -1) {
printf("\n Link broken or unexpected message received. Re-establishing connection...\n");
reestablish_connection(&socket, ip, port, number_of_events, is_on);
continue; // Skip further processing and retry
}
//-------------------------
// GNB_PHY_UL_FD_PUSCH_IQ, GNB_PHY_UL_FD_DMRS_ID, GNB_PHY_UL_FD_CHAN_EST_DMRS_POS,
// UE_PHY_UL_SCRAMBLED_TX_BITS, GNB_PHY_UL_PAYLOAD_RX_BITS, UE_PHY_UL_PAYLOAD_TX_BITS
//-------------------------
// is it a requested message
if (isValueInArray(e.type, req_tracer_msgs_indices, num_req_tracer_msgs)) {
// is it based on Data Collection Trace Messages Structure
if (isValueInArray(e.type, traces_support_data_Collection_format_idx, n_msgs_based_data_Collection_format)) {
// Start recording from the next slot to mitigate capturing partial data
// check if the current frame and slot are different from the previous frame and slot
// Then, increase the record index
if (start_recording == false) {
if (got_ref_frame_slot == false) {
ref_frame = e.e[trace_msg_data.frame].i;
ref_slot = e.e[trace_msg_data.slot].i;
printf("\nMessage Info: msg_id %s (%d) \n", event_name_from_id(database, e.type), e.type);
got_ref_frame_slot = true;
}
current_frame = e.e[trace_msg_data.frame].i;
current_slot = e.e[trace_msg_data.slot].i;
frame_difference = (current_frame - ref_frame + MAX_FRAME_INDEX + 1) % (MAX_FRAME_INDEX + 1);
slot_difference = (current_slot - ref_slot + MAX_SLOT_INDEX + 1) % (MAX_SLOT_INDEX + 1);
printf("\n First frame.slot: %d.%d, current frame.slot: %d.%d, diff frame.slot: %d.%d",
ref_frame,
ref_slot,
current_frame,
current_slot,
frame_difference,
slot_difference);
if ((ref_frame != current_frame) || (ref_slot != current_slot)) {
start_recording = true;
printf("\n Start recording from frame: %d, slot: %d ", e.e[trace_msg_data.frame].i, e.e[trace_msg_data.slot].i);
}
}
// start recording from the next frame to mitigate capturing partial data
if (start_recording == true) {
/* this is how to access the elements of the Data Collection trace messages.
* we use e.e[<element>] and then the correct suffix, here
* it's .i for the integer and .b for the buffer and .bsize for the buffer size
* see in event.h the structure event_arg
*/
unsigned char *buf = e.e[trace_msg_data.data].b;
printf("\n\nRecord number: %d", nrecord_idx);
#ifdef DEBUG_BUFFER
printf("\nBuffer index in bytes: %d", bufIdx_wr);
#endif
// add general message header: message ID,
// T-Tracer Message format
// FORMAT = int,frame : int,slot : int,datetime_yyyymmdd : int,datetime_hhmmssmmm :
// int,frame_type : int,freq_range : int,subcarrier_spacing : int,cyclic_prefix : int,symbols_per_slot :
// int,Nid_cell : int,rnti :
// int,rb_size : int,rb_start : int,start_symbol_index : int,nr_of_symbols :
// int,qam_mod_order : int,mcs_index : int,mcs_table : int,nrOfLayers :
// int,transform_precoding : int,dmrs_config_type : int,ul_dmrs_symb_pos : int,number_dmrs_symbols :
// int,dmrs_port : int,dmrs_nscid :
// int,nb_antennas_tx : int,number_of_bits : buffer,data
// printf("\nTX : %d", e.e[trace_msg_data.nb_antennas_tx].i);
memcpy(&addr_wr[bufIdx_wr], &e.type, sizeof(uint16_t));
bufIdx_wr += sizeof(uint16_t);
memcpy(&addr_wr[bufIdx_wr], &e.e[trace_msg_data.frame].i, sizeof(uint16_t));
bufIdx_wr += sizeof(uint16_t);
memcpy(&addr_wr[bufIdx_wr], &e.e[trace_msg_data.slot].i, sizeof(uint8_t));
bufIdx_wr += sizeof(uint8_t);
memcpy(&addr_wr[bufIdx_wr], &e.e[trace_msg_data.datetime_yyyymmdd].i, sizeof(uint32_t));
bufIdx_wr += sizeof(uint32_t);
memcpy(&addr_wr[bufIdx_wr], &e.e[trace_msg_data.datetime_hhmmssmmm].i, sizeof(uint32_t));
bufIdx_wr += sizeof(uint32_t);
memcpy(&addr_wr[bufIdx_wr], &e.e[trace_msg_data.frame_type].i, sizeof(uint8_t));
bufIdx_wr += sizeof(uint8_t);
memcpy(&addr_wr[bufIdx_wr], &e.e[trace_msg_data.freq_range].i, sizeof(uint8_t));
bufIdx_wr += sizeof(uint8_t);
memcpy(&addr_wr[bufIdx_wr], &e.e[trace_msg_data.subcarrier_spacing].i, sizeof(uint8_t));
bufIdx_wr += sizeof(uint8_t);
memcpy(&addr_wr[bufIdx_wr], &e.e[trace_msg_data.cyclic_prefix].i, sizeof(uint8_t));
bufIdx_wr += sizeof(uint8_t);
memcpy(&addr_wr[bufIdx_wr], &e.e[trace_msg_data.symbols_per_slot].i, sizeof(uint8_t));
bufIdx_wr += sizeof(uint8_t);
memcpy(&addr_wr[bufIdx_wr], &e.e[trace_msg_data.Nid_cell].i, sizeof(uint16_t));
bufIdx_wr += sizeof(uint16_t);
memcpy(&addr_wr[bufIdx_wr], &e.e[trace_msg_data.rnti].i, sizeof(uint16_t));
bufIdx_wr += sizeof(uint16_t);
memcpy(&addr_wr[bufIdx_wr], &e.e[trace_msg_data.rb_size].i, sizeof(uint16_t));
bufIdx_wr += sizeof(uint16_t);
memcpy(&addr_wr[bufIdx_wr], &e.e[trace_msg_data.rb_start].i, sizeof(uint16_t));
bufIdx_wr += sizeof(uint16_t);
memcpy(&addr_wr[bufIdx_wr], &e.e[trace_msg_data.start_symbol_index].i, sizeof(uint8_t));
bufIdx_wr += sizeof(uint8_t);
memcpy(&addr_wr[bufIdx_wr], &e.e[trace_msg_data.nr_of_symbols].i, sizeof(uint8_t));
bufIdx_wr += sizeof(uint8_t);
memcpy(&addr_wr[bufIdx_wr], &e.e[trace_msg_data.qam_mod_order].i, sizeof(uint8_t));
bufIdx_wr += sizeof(uint8_t);
memcpy(&addr_wr[bufIdx_wr], &e.e[trace_msg_data.mcs_index].i, sizeof(uint8_t));
bufIdx_wr += sizeof(uint8_t);
memcpy(&addr_wr[bufIdx_wr], &e.e[trace_msg_data.mcs_table].i, sizeof(uint8_t));
bufIdx_wr += sizeof(uint8_t);
memcpy(&addr_wr[bufIdx_wr], &e.e[trace_msg_data.nrOfLayers].i, sizeof(uint8_t));
bufIdx_wr += sizeof(uint8_t);
memcpy(&addr_wr[bufIdx_wr], &e.e[trace_msg_data.transform_precoding].i, sizeof(uint8_t));
bufIdx_wr += sizeof(uint8_t);
memcpy(&addr_wr[bufIdx_wr], &e.e[trace_msg_data.dmrs_config_type].i, sizeof(uint8_t));
bufIdx_wr += sizeof(uint8_t);
memcpy(&addr_wr[bufIdx_wr], &e.e[trace_msg_data.ul_dmrs_symb_pos].i, sizeof(uint16_t));
bufIdx_wr += sizeof(uint16_t);
memcpy(&addr_wr[bufIdx_wr], &e.e[trace_msg_data.number_dmrs_symbols].i, sizeof(uint8_t));
bufIdx_wr += sizeof(uint8_t);
memcpy(&addr_wr[bufIdx_wr], &e.e[trace_msg_data.dmrs_port].i, sizeof(uint16_t));
bufIdx_wr += sizeof(uint16_t);
memcpy(&addr_wr[bufIdx_wr], &e.e[trace_msg_data.dmrs_nscid].i, sizeof(uint16_t));
bufIdx_wr += sizeof(uint16_t);
memcpy(&addr_wr[bufIdx_wr], &e.e[trace_msg_data.nb_antennas_tx].i, sizeof(uint8_t));
bufIdx_wr += sizeof(uint8_t);
memcpy(&addr_wr[bufIdx_wr], &e.e[trace_msg_data.number_of_bits].i, sizeof(uint32_t));
bufIdx_wr += sizeof(uint32_t);
printf("\nTime Stamp: %d_%d", e.e[trace_msg_data.datetime_yyyymmdd].i, e.e[trace_msg_data.datetime_hhmmssmmm].i);
// add message body: length in bytes + recorded data
memcpy(&addr_wr[bufIdx_wr], &e.e[trace_msg_data.data].bsize, sizeof(uint32_t));
bufIdx_wr += sizeof(uint32_t);
// read data from buffer and convert from unsigned char * array to int 16 using the right endianness
// T-tracer: Little Endian
// For BITS Messages, example: UE_PHY_UL_SCRAMBLED_TX_BITS: data in bytes
if (is_bits_messages(traces_bits_support_data_Collection_format_idx, n_bits_msgs, e.type)) {
for (int byte_idx = 0; byte_idx < e.e[trace_msg_data.data].bsize; byte_idx += 1) {
// printf("%d, ", buf[byte_idx]);
memcpy(&addr_wr[bufIdx_wr], &buf[byte_idx], sizeof(uint8_t));
bufIdx_wr += sizeof(uint8_t);
}
} else {
for (int byte_idx = 0; byte_idx < e.e[trace_msg_data.data].bsize; byte_idx += 2) {
// For a little-endian system:
memcpy(&addr_wr[bufIdx_wr], &buf[byte_idx], sizeof(uint8_t));
bufIdx_wr += sizeof(uint8_t);
memcpy(&addr_wr[bufIdx_wr], &buf[byte_idx + 1], sizeof(uint8_t));
bufIdx_wr += sizeof(uint8_t);
}
}
/*
for (int byte_idx_i = 0; byte_idx_i < e.e[d.nr_ul_fd_dmrs_data].bsize; byte_idx_i+=4) {
int16_t I = buf[byte_idx_i] | (buf[byte_idx_i+1] << 8);
int16_t Q = buf[byte_idx_i+2] | (buf[byte_idx_i+3] << 8);
printf ("idx %d, ", byte_idx_i);
printf ("\n%d", I);
printf ("\n%d", Q);
}
*/
// check if the current frame and slot are different from the previous frame and slot
// Then, increase the record index
current_frame = e.e[trace_msg_data.frame].i;
current_slot = e.e[trace_msg_data.slot].i;
// increase sync offset index if the current frame is different from the previous frame
if ((current_frame != prev_frame) && nrecord_idx >= number_records) {
sync_offset_index++;
}
if (current_frame != prev_frame || current_slot != prev_slot) {
nrecord_idx++;
// Update previous frame and slot numbers
prev_frame = current_frame;
prev_slot = current_slot;
}
#ifdef DEBUG_T_Tracer
printf("\nMessage Info: msg_id %s (%d) \n", event_name_from_id(database, e.type), e.type);
printf("frame %d, slot %d, datetime %d_%d\n",
e.e[trace_msg_data.frame].i,
e.e[trace_msg_data.slot].i,
e.e[trace_msg_data.datetime_yyyymmdd].i,
e.e[trace_msg_data.datetime_hhmmssmmm].i);
printf("frame_type %d, freq_range %d, subcarrier_spacing %d, cyclic_prefix %d, symbols_per_slot %d\n",
e.e[trace_msg_data.frame_type].i,
e.e[trace_msg_data.freq_range].i,
e.e[trace_msg_data.subcarrier_spacing].i,
e.e[trace_msg_data.cyclic_prefix].i,
e.e[trace_msg_data.symbols_per_slot].i);
printf("Nid_cell %d, rnti %d, rb_size %d, rb_start %d, start_symbol_index %d, nr_of_symbols %d\n",
e.e[trace_msg_data.Nid_cell].i,
e.e[trace_msg_data.rnti].i,
e.e[trace_msg_data.rb_size].i,
e.e[trace_msg_data.rb_start].i,
e.e[trace_msg_data.start_symbol_index].i,
e.e[trace_msg_data.nr_of_symbols].i);
printf("qam_mod_order %d, mcs_index %d, mcs_table %d, nrOfLayers %d, transform_precoding %d\n",
e.e[trace_msg_data.qam_mod_order].i,
e.e[trace_msg_data.mcs_index].i,
e.e[trace_msg_data.mcs_table].i,
e.e[trace_msg_data.nrOfLayers].i,
e.e[trace_msg_data.transform_precoding].i);
printf("dmrs_config_type %d, ul_dmrs_symb_pos %d, number_dmrs_symbols %d, dmrs_port %d, dmrs_nscid %d\n",
e.e[trace_msg_data.dmrs_config_type].i,
e.e[trace_msg_data.ul_dmrs_symb_pos].i,
e.e[trace_msg_data.number_dmrs_symbols].i,
e.e[trace_msg_data.dmrs_port].i,
e.e[trace_msg_data.dmrs_nscid].i);
printf("nb_antennas_tx %d, number_of_bits %d, data size %d\n",
e.e[trace_msg_data.nb_antennas_tx].i,
e.e[trace_msg_data.number_of_bits].i,
e.e[trace_msg_data.data].bsize);
#endif
} // End of start recording flag
} // end of if statement for the supported messages based on Data Collection Trace Messages Structure
else {
printf("ERROR: Requested Message is not based on Data Collection Trace Messages Structure\n");
printf("ERROR: Requested Message ID: %d\n", e.type);
}
} // end of if statement for the requested messages
} // end while loop of reading events
else {
// No data, just loop and check time
usleep(100); // optional: avoid busy-waiting
}
} // End of while loop to read messages
// de-activate the tracee in the nr-softmodem
printf("\n De-activated Tracer message:\n");
for (i = 0; i < num_req_tracer_msgs; i++) {
char *on_off_name = event_name_from_id(database, req_tracer_msgs_indices[i]);
on_off(database, on_off_name, is_on, 0);
// printf("\n %d, %s, ", req_tracer_msgs_indices[i], on_off_name);
// on_off(database, "GNB_PHY_DL_OUTPUT_SIGNAL", is_on, 1);
}
// De-activate the tracee in the nr-softmodem
activate_traces(socket, number_of_events, is_on);
printf("\n De-activated Traces");
// Get the end time
struct timespec end_time = get_current_time();
// Calculate the time difference
double time_diff = calculate_time_difference(start_time, end_time);
printf("Total Time difference: %.2f ms\n", time_diff);
printf("Time difference per record: %.2f ms\n", time_diff / (number_records + max_sync_offset));
// discard stale or previous record data for the first DISCARD_RECORD_DURATION_MS
struct timespec record_start, record_now;
clock_gettime(CLOCK_MONOTONIC, &record_start);
while (1) {
clock_gettime(CLOCK_MONOTONIC, &record_now);
double elapsed_ms = calculate_time_difference(record_start, record_now);
if (elapsed_ms >= DISCARD_RECORD_DURATION_MS) {
break; // Stop after 10ms
}
int poll_ret = poll(&event_poll_fd, 1, 1); // 1 ms timeout for poll
if (poll_ret > 0 && (event_poll_fd.revents & POLLIN)) {
event e = get_event(socket, &ebuf, database);
printf("%d", e.type);
if (e.type == -1) {
printf("\n Link broken or unexpected message received. Re-establishing connection...\n");
reestablish_connection(&socket, ip, port, number_of_events, is_on);
continue;
}
} else {
// No data, just loop and check time
usleep(100); // optional: avoid busy-waiting
}
} // End of while loop to discard stale records
}
} // End a while loop to check for the "stop" command
// de-activate the tracee in the nr-softmodem
// free_database(database); //Do on one app, for example on gNB App
free(is_on);
close(socket);
return 0;
}

View File

@@ -0,0 +1,84 @@
{
"id": 0,
"test_config": {
"test_scenario_id": "",
"test_name": "phy_ul_bler_test",
"test_mode": "rf_real_time",
"dut_type": "trad_rx"
},
"environment_emulation": {
"target_link_config": {
"ran_config": {
"uplink": {
"ul_used_signal_BW_MHz": 2.16
}
},
"wireless_channel": {
"downlink": {
"type": "rf_cable"
},
"uplink": {
"type": "statistical_var",
"statistical": {
"var_power_delay_profile": "tdl_d",
"speed_mps": 5.0,
"delay_spread_ns": 50.0,
"snr_db": 20.0,
"predef_channel_profile": null
}
},
"carrierFreqValueList_hz": [
3319680000.0
],
"ul_used_signal_BW_MHz": 2.16
}
}
},
"data_recording_config": {
"data_storage_path": "/home/user/workarea/oai_recorded_data/",
"data_file_format": "SigMF",
"enable_saving_tracer_messages_sigmf": true,
"num_records": 5,
"t_tracer_message_definition_file": "../T/T_messages.txt",
"parameter_map_file": "config/wireless_link_parameter_map.yaml",
"start_frame_number": 5,
"base_station": {
"requested_tracer_messages": [
"GNB_PHY_UL_FD_PUSCH_IQ",
"GNB_PHY_UL_FD_DMRS",
"GNB_PHY_UL_FD_CHAN_EST_DMRS_POS",
"GNB_PHY_UL_FD_CHAN_EST_DMRS_INTERPL",
"GNB_PHY_UL_PAYLOAD_RX_BITS"
],
"meta_data":{
"num_rx_antennas": 1,
"tx_gain": 48.0,
"rx_gain": 30.0,
"hw_type": "USRP X410",
"hw_subtype": "ZBX",
"seid": "328AB35"
}
},
"user_equipment": {
"requested_tracer_messages": [
"UE_PHY_UL_SCRAMBLED_TX_BITS",
"UE_PHY_UL_PAYLOAD_TX_BITS"
],
"meta_data":{
"num_tx_antennas": 1,
"tx_gain": 48.0,
"rx_gain": 40.0,
"hw_type": "USRP X410",
"hw_subtype": "ZBX",
"seid": "323F75F"
}
},
"common_meta_data": {
"sample_rate": 61440000.0,
"bandwidth": 40000000.0,
"clock_reference": "external"
},
"tracer_service_baseStation_address": "127.0.0.1:2021",
"tracer_service_userEquipment_address": "127.0.0.1:2023"
}
}

View File

@@ -0,0 +1,375 @@
#/*
# * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
# * contributor license agreements. See the NOTICE file distributed with
# * this work for additional information regarding copyright ownership.
# * The OpenAirInterface Software Alliance licenses this file to You under
# * the OAI Public License, Version 1.1 (the "License"); you may not use this file
# * except in compliance with the License.
# * You may obtain a copy of the License at
# *
# * http://www.openairinterface.org/?page_id=698
# *
# * Unless required by applicable law or agreed to in writing, software
# * distributed under the License is distributed on an "AS IS" BASIS,
# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# * See the License for the specific language governing permissions and
# * limitations under the License.
# *-------------------------------------------------------------------------------
# * For more information about the OpenAirInterface (OAI) Software Alliance:
# * contact@openairinterface.org
# */
#---------------------------------------------------------------------
# file common/utils/data_recording/config/wireless_link_parameter_map.yaml
# brief Wireless Link Parameter Map Dictionary
# author Abdo Gaber
# date 2024
# version 1.0
# company Emerson, NI Test and Measurement
# email:
# note
# warning
# Wireless Link Parameter Map
# Components:
# Transmitter: list of waveform configuration based on standard
# Parameters pair is given via this parameter map dictionary (Parameter name in Waveform creator vs that in the API ~ SigMF meta-data)
# Having a separate dictionary ease of adoption in case of:
# - Adding new parameters
# - Use different waveform creator that has Different naming scheme
# - Define your own customized standard or new wireless system
# - All changes are limited to parameter map dictionary
# the parameter name of waveform generator has the following style:
# StandardName_WaveformGenerator_parameter, i.e.
# if standard = 5gnr, WaveformGenerator: ni_rfmx_rfws, then the parameter name: 5gnr_ni_rfmx_rfws_parameter
# =====================================================================================
# ======== list of parameter pairs between waveform config and API ~ SigMF Meta-Data ===
# =====================================================================================
# List of waveform generators that generate waveforms
# key:
# standard: "name"
# generator: "link or text ... etc"
# key: Used to create parameter names in wireless_link_parameter_map
# Recommended name for each waveform generator to be given as: standard_WaveformGenerator
# Example: 5g NR waveform created using RFmx with RFWS config file: "5gnr_ni_rfmx_rfws"
# Note: The suffix "_parameter" will be added automatically
# standard name: occur in meta-data
# generator: generator description to occur in meta-data
waveform_generator:
# waveform_source: standard
5gnr_oai: # Generated using OAI
standard: "5gnr"
generator: "OpenAirInterface: https://www.openairinterface.org/"
5gnr_ni_rfmx_rfws: # Generated using NI RFmx Tool
standard: "5gnr"
generator: "NI RFmx Waveform Creator: https://www.ni.com/en-ca/shop/wireless-design-test/application-software-for-wireless-design-test-category/what-is-rfmx.html"
transmitter:
# 5G NR subfield
5gnr:
# frame number
- sigmf_parameter_name: "frame"
description: "5G NR frame number"
5gnr_oai_parameter:
name: "frame"
# slot number
- sigmf_parameter_name: "slot"
description: "5G NR slot number"
5gnr_oai_parameter:
name: "slot"
# bandwidth
- sigmf_parameter_name: "bandwidth"
description: "5G NR bandwidth"
5gnr_ni_rfmx_rfws_parameter:
name: "Bandwidth (Hz)"
5gnr_oai_parameter:
name: "bandwidth"
# Frame structure
- sigmf_parameter_name: "frame_structure"
description: "5G NR duplexing scheme FDD, TDD, user defined"
5gnr_ni_rfmx_rfws_parameter:
name: "Duplex Scheme" # not exact, since it depends if the waveform is for UL or DL
5gnr_oai_parameter:
name: "frame_type"
value_map: # simu value : SigMF value
0: "fdd"
1: "tdd"
# Link direction
- sigmf_parameter_name: "link_direction"
description: "Link direction"
5gnr_ni_rfmx_rfws_parameter:
name: "Link Direction"
# Frequency Range
- sigmf_parameter_name: "frequency_range"
description: "Frequency Range"
5gnr_ni_rfmx_rfws_parameter:
name: "Frequency Range"
value_map: # simu value : SigMF value
"Range 1": "fr1"
"Range 2": "fr2"
5gnr_oai_parameter:
name: "freq_range"
value_map: # simu value : SigMF value
0: "fr1"
1: "fr2"
# Subcarrier spacing in Hz
- sigmf_parameter_name: "subcarrier_spacing"
description: "Subcarrier spacing in Hz"
5gnr_ni_rfmx_rfws_parameter:
name: Subcarrier Spacing (Hz)
5gnr_oai_parameter:
name: subcarrier_spacing
value_map: # simu value : SigMF value
0: 15000
1: 30000
2: 60000
3: 120000
# Sampling rate in Hz
- sigmf_parameter_name: "sample_rate"
description: "Sampling rate in Hz"
5gnr_ni_rfmx_rfws_parameter:
name: "sample_rate_hz"
5gnr_oai_parameter:
name: "sample_rate"
# Cyclic prefix mode
- sigmf_parameter_name: "cp_mode"
description: "Cyclic prefix mode"
5gnr_ni_rfmx_rfws_parameter:
name: "Cyclic Prefix Mode"
5gnr_oai_parameter:
name: "cyclic_prefix"
value_map: # simu value : SigMF value
0: "normal"
1: "extended"
# cell ID
- sigmf_parameter_name: "cell_id"
description: "cell ID"
5gnr_ni_rfmx_rfws_parameter:
name: "Cell ID"
5gnr_oai_parameter:
name: "Nid_cell"
# rnti
- sigmf_parameter_name: "rnti"
description: "RNTI"
5gnr_ni_rfmx_rfws_parameter:
name: "rnti"
5gnr_oai_parameter:
name: "rnti"
# Symbols per slot
- sigmf_parameter_name: "symbols_per_slot"
description: "Symbols per slot"
5gnr_oai_parameter:
name: "symbols_per_slot"
# PUSCH: content
- sigmf_parameter_name: "pusch:content"
description: "PUSCH: content"
# PUSCH: channel code
- sigmf_parameter_name: "pusch:channel_code"
description: "PUSCH: channel code"
# PUSCH: number of PRBs
- sigmf_parameter_name: "pusch:num_prb"
description: "PUSCH Resource Block Size"
5gnr_oai_parameter:
name: "rb_size"
# PUSCH RB Start index
- sigmf_parameter_name: "pusch:start_prb"
description: "PUSCH Resource Block Start"
5gnr_oai_parameter:
name: "rb_start"
# PUSCH MAPPING type
- sigmf_parameter_name: "pusch:mapping_type"
description: "PUSCH Mapping Type"
5gnr_oai_parameter:
name: "mappingType"
value_map: # simu value : SigMF value
"NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeA": "A"
"NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB": "B"
# PUSCH: OFDM symbol start index within slot
- sigmf_parameter_name: "pusch:start_ofdm_symbol"
description: "PUSCH: OFDM symbol start index within slot"
5gnr_oai_parameter:
name: "start_symbol_index"
# PUSCH: number of OFDM symbols in one slot
- sigmf_parameter_name: "pusch:num_ofdm_symbols"
description: "PUSCH: number of OFDM symbols in one slot"
5gnr_oai_parameter:
name: "nr_of_symbols"
# PUSCH: modulation
- sigmf_parameter_name: "pusch:modulation"
description: "PUSCH: modulation"
5gnr_ni_rfmx_rfws_parameter:
name: "UL Modulation Type"
value_map: # simu value : SigMF value
"8PSK": "8_psk"
"QPSK": "qpsk"
"QAM16": "16_qam"
"QAM64": "64_qam"
"QAM256": "256_qam"
"QAM1024": "1024_qam"
"Standard": ""
5gnr_oai_parameter:
name: "qam_mod_order"
value_map: # simu value : SigMF value
2 : "qpsk"
4 : "16_qam"
6 : "64_qam"
8 : "256_qam"
"Standard": ""
# PUSCH MCS Index
- sigmf_parameter_name: "pusch:mcs"
description: "PUSCH MCS Index"
5gnr_oai_parameter:
name: "mcs_index"
# PUSCH MCS Index Table
- sigmf_parameter_name: "pusch:mcs_table_index"
description: "PUSCH MCS Table Index"
5gnr_oai_parameter:
name: "mcs_table"
# PUSCH: number of transmission layers
- sigmf_parameter_name: "pusch:num_layer"
description: "PUSCH: number of transmission layers"
5gnr_oai_parameter:
name: "nrOfLayers"
# Transform Precoding
- sigmf_parameter_name: "pusch:transform_precoding"
description: "PUSCH Transform Precoding"
5gnr_oai_parameter:
name: "transform_precoding"
value_map: # simu value : SigMF value
0: "enabled"
1: "disabled"
# PUSCH DMRS: content
- sigmf_parameter_name: "pusch_dmrs:content"
description: "PUSCH DMRS: content"
#"none": "none"
#"random_qpsk": "random_qpsk"
#"compliant": "compliant"
# PUSCH DMRS: resource map configuration
- sigmf_parameter_name: "pusch_dmrs:resource_map_config"
description: "PUSCH DMRS: resource map configuration"
5gnr_oai_parameter:
name: "dmrs_config_type"
value_map:
0: "5g nr type 1"
1: "5g nr type 2"
# PUSCH DMRS: OFDM symbol start index within slot
- sigmf_parameter_name: "pusch_dmrs:start_ofdm_symbol"
description: "PUSCH DMRS: OFDM symbol start index within slot"
5gnr_oai_parameter:
# to be derived from this OAI parameter
name: "ul_dmrs_symb_pos"
# PUSCH DMRS: DMRS duration in number of OFDM symbols
- sigmf_parameter_name: "pusch_dmrs:duration_num_ofdm_symbols"
description: "PUSCH DMRS: DMRS duration in number of OFDM symbols"
5gnr_oai_parameter:
# to be derived from this OAI parameter
name: "ul_dmrs_symb_pos"
# PUSCH DMRS: OFDM symbol indices within resource grid
- sigmf_parameter_name: "pusch_dmrs:ofdm_symbol_idx"
description: "PUSCH DMRS: OFDM symbol indices within resource grid"
5gnr_oai_parameter:
# to be derived from this OAI parameter
name: "ul_dmrs_symb_pos"
# PUSCH DMRS: number of additional PUSCH DMRS positions
- sigmf_parameter_name: "pusch_dmrs:num_add_positions"
description: "PUSCH DMRS: number of additional PUSCH DMRS positions"
5gnr_oai_parameter:
# to be derived from this OAI parameter
name: "ul_dmrs_symb_pos"
# PUSCH DMRS: antenna port
- sigmf_parameter_name: "pusch_dmrs:antennna_port"
description: "PUSCH DMRS: antenna port"
5gnr_oai_parameter:
name: "dmrs_port"
# PUSCH DMRS: scrambler initialization
- sigmf_parameter_name: "pusch_dmrs:nscid"
description: "PUSCH DMRS: scrambler initialization"
5gnr_oai_parameter:
name: "dmrs_nscid"
# number of rx antennas
- sigmf_parameter_name: "num_rx_antennas"
description: "Number of Rx antennas"
5gnr_oai_parameter:
name: "nb_antennas_rx"
# number of tx antennas
- sigmf_parameter_name: "num_tx_antennas"
description: "Number of Tx antennas"
5gnr_oai_parameter:
name: "nb_antennas_tx"
channel:
# Signal-to-noise ratio (Es/N0) in dB
- sigmf_parameter_name: "snr_esn0_db"
description: "Signal-to-noise ratio (Es/N0) in dB"
# Signal-to-noise ratio (Eb/N0) in dB
- sigmf_parameter_name: "snr_ebn0_db"
description: "Signal-to-noise ratio (Eb/N0) in dB"
# Channel model
- sigmf_parameter_name: "channel_model"
description: "Fading channel model"
# Number of channel taps
- sigmf_parameter_name: "num_channel_taps"
description: "Number of channel taps"
# Channel attenuation level in dB
- sigmf_parameter_name: "channel_attenuation_db"
description: "Channel attenuation level in dB"
# Nominal delay spread in s
- sigmf_parameter_name: "delay_spread"
description: "Nominal delay spread in s"
# UE speed in m/s
- sigmf_parameter_name: "speed"
description: "UE speed in m/s"
# Carrier frequency in Hz
- sigmf_parameter_name: "carrier_frequency"
description: "Carrier frequency in Hz"
receiver:
# Frequency domain interpolation method for channel estimation
- sigmf_parameter_name: "channel_estimation_freq_interpolation"
description: "Frequency domain interpolation method for channel estimation"
# Time domain interpolation method for channel estimation
- sigmf_parameter_name: "channel_estimation_time_interpolation"
description: "Time domain interpolation method for channel estimation"
# Channel equalization method
- sigmf_parameter_name: "channel_equalization_method"
description: "Channel equalization method"
# Symbol demapping method
- sigmf_parameter_name: "symbol_demapping_method"
description: "Symbol demapping method"
# Manufacturer of the hardware used to receive the signal
- sigmf_parameter_name: "manufacturer"
description: "Manufacturer"
# Unique ID of the emitter, USRP serial number --> usrp_mboard_serial
- sigmf_parameter_name: "seid"
description: "Emitter ID (USRP serial number)"
# For USRP, use “daughterboard ID, a string read out from the device shortened by the hex ID e.g. (0x0085)
- sigmf_parameter_name: "hw_subtype"
description: "Hardware subtype (for USRP: daughterboard ID)"
# RX sync reference source ("internal", "external", "gpsdo")
- sigmf_parameter_name: "clock_reference"
description: "RX clock reference"
required_field: false
# Estimated SNR in dB
- sigmf_parameter_name: "snr_estimate_db"
description: "SNR estimate in dB"
required_field: false
# Result of coarse PSS-based timing estimation (used for synchronization)
- sigmf_parameter_name: "timing_estimate_coarse"
description: "Coarse timing estimate in samples"
required_field: false"
# Result of coarse PSS-based frequency offset estimation (used for synchronization)
- sigmf_parameter_name: "cfo_estimate_coarse"
description: "Coarse frequency estimate in Hz"
required_field: false
# Result of fine CRS-based frequency offset estimation (used for synchronization)
- sigmf_parameter_name: "cfo_estimate_fine"
description: "Fine frequency estimate in Hz"
required_field: false
# Number of transmitted payload bits
- sigmf_parameter_name: "num_payload_bits"
description: "Number of transmitted payload bits"
required_field: false
# Number of bit errors when applying traditional RX processing
- sigmf_parameter_name: "bit_errors_trad_rx"
description: "Bit errors"
required_field: false

View File

@@ -0,0 +1,829 @@
# /*
# * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
# * contributor license agreements. See the NOTICE file distributed with
# * this work for additional information regarding copyright ownership.
# * The OpenAirInterface Software Alliance licenses this file to You under
# * the OAI Public License, Version 1.1 (the "License"); you may not use this file
# * except in compliance with the License.
# * You may obtain a copy of the License at
# *
# * http://www.openairinterface.org/?page_id=698
# *
# * Unless required by applicable law or agreed to in writing, software
# * distributed under the License is distributed on an "AS IS" BASIS,
# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# * See the License for the specific language governing permissions and
# * limitations under the License.
# *-------------------------------------------------------------------------------
# * For more information about the OpenAirInterface (OAI) Software Alliance:
# * contact@openairinterface.org
# */
# ---------------------------------------------------------------------
# file common/utils/data_recording/data_recording_app_v1.0.py
# brief main application of synchronized real-time data recording
# author Abdo Gaber
# date 2025
# version 1.0
# company Emerson, NI Test and Measurement
# email:
# note
# warning
import sysv_ipc as ipc
import struct
import time
from datetime import datetime
from termcolor import colored
import numpy as np
import json
import concurrent.futures
# from concurrent import futures
import threading
# import related functions
from lib import sigmf_interface
# import library functions
from lib import sync_service
from lib import data_recording_messages_def
from lib import common_utils
from lib import config_interface
DEBUG_WIRELESS_RECORDED_DATA = True
DEBUG_BUFFER_READING = False
# globally applicable metadata
global_info = {
"author": "Abdo Gaber",
"description": "Synchronized Real-Time Data Recording",
"timestamp": 0,
"collection_file_prefix": "data-collection", # collection file name prefix "deap-rx + str(...)"
"collection_file": "", # Reserved to be created in the code: “data-collection_rec-0_TIME-STAMP”
"datetime_offset": "", # datetime offset between current location and UTC/Zulu timezone
# Example: "+01:00" for Berlin, Germany
"save_config_data_recording_app_json": True,
"waveform_generator": "5gnr_oai",
"extensions": {},
}
# Supported OAI Trace messages
# UL receiver messages
# gNB IQ Msgs: "GNB_PHY_UL_FD_PUSCH_IQ", "GNB_PHY_UL_FD_DMRS", "GNB_PHY_UL_FD_CHAN_EST_DMRS_POS",
# "GNB_PHY_UL_FD_CHAN_EST_DMRS_INTERPL"
# gNB BITS Msgs: "GNB_PHY_UL_PAYLOAD_RX_BITS"
# UE BITS Msgs: "UE_PHY_UL_SCRAMBLED_TX_BITS", "UE_PHY_UL_PAYLOAD_TX_BITS"
supported_oai_tracer_messages = {
# gNB messages
"GNB_PHY_UL_FD_PUSCH_IQ": {
"file_name_prefix": "rx-fd-data",
"scope": "gNB",
"description": "Frequency-domain RX data",
"serialization_scheme": ["subcarriers", "ofdm_symbols"],
},
"GNB_PHY_UL_FD_DMRS": {
"file_name_prefix": "tx-pilots-fd-data",
"scope": "gNB",
"description": "Frequency-domain TX PUSCH DMRS data",
"serialization_scheme": ["subcarriers", "ofdm_symbols"],
},
"GNB_PHY_UL_FD_CHAN_EST_DMRS_POS": {
"file_name_prefix": "raw-ce-fd-data",
"scope": "gNB",
"description": "Frequency-domain raw channel estimates (at DMRS positions)",
"serialization_scheme": ["subcarriers", "ofdm_symbols"],
},
"GNB_PHY_UL_FD_CHAN_EST_DMRS_INTERPL": {
"file_name_prefix": "raw-inter-ce-fd-data",
"scope": "gNB",
"description": "Interpolcated Frequency-domain raw channel estimates",
"serialization_scheme": ["subcarriers", "ofdm_symbols"],
},
"GNB_PHY_UL_PAYLOAD_RX_BITS": {
"file_name_prefix": "rx-payload-bits",
"scope": "gNB",
"description": "Received PUSCH payload bits",
"serialization_scheme": ["bits", "subcarriers", "ofdm_symbols"],
},
# UE messages
"UE_PHY_UL_SCRAMBLED_TX_BITS": {
"file_name_prefix": "tx-scrambled-bits",
"scope": "UE",
"description": "Transmitted scrambled PUSCH bits",
"serialization_scheme": ["bits", "subcarriers", "ofdm_symbols"],
},
"UE_PHY_UL_PAYLOAD_TX_BITS": {
"file_name_prefix": "tx-payload-bits",
"scope": "UE",
"description": "Transmitted PUSCH payload bits",
"serialization_scheme": ["bits", "subcarriers", "ofdm_symbols"],
},
}
# -------------------------------------------
# System configuration: gNB
project_id_gnb = 2335
read_shm_path_gnb = "/tmp/gnb_app1"
write_shm_path_gnb = "/tmp/gnb_app2"
# System configuration: UE
project_id_ue = 2336
read_shm_path_ue = "/tmp/ue_app1"
write_shm_path_ue = "/tmp/ue_app2"
# initialize shared memory
def attach_shm(shm_path, project_id):
key = ipc.ftok(shm_path, project_id)
shm = ipc.SharedMemory(key, 0, 0)
# I found if we do not attach ourselves
# it will attach as ReadOnly.
shm.attach(0, 0)
return shm
def detach_shm(shm):
try:
shm.detach()
print("Shared memory detached successfully.")
except ipc.ExistentialError:
print("Shared memory segment does not exist.")
def remove_shm(shm):
try:
shm.remove()
print("Shared memory removed successfully.")
except ipc.ExistentialError:
print("Shared memory segment does not exist.")
# check data if avalible in the shared memory
def is_data_available_in_memory(shm, bufIdx, general_message_header_length, timeout=20):
start_time = time.time()
while True:
buf = shm.read(bufIdx + general_message_header_length)
n_bytes = sum(buf)
print("Data Recording App: Waiting for Measurements!")
if n_bytes > 0:
print("There is data in memory, n_bytes: ", n_bytes)
return True
if (time.time() - start_time) > timeout:
break
time.sleep(1)
return False
# Read data from Shared memory based Data Conversion Service message structure
def read_data_from_shm(shm, bufIdx, tracer_msgs_identities):
# print buffer index
if DEBUG_BUFFER_READING:
print("Buffer Index: ", bufIdx)
# get general message header list
general_msg_header_list, general_message_header_length = data_recording_messages_def.get_general_msg_header_list()
buf = shm.read(bufIdx + general_message_header_length)
n_bytes = sum(buf)
if n_bytes == 0:
raise Exception('ERROR: No data available in memory')
msg_id = struct.unpack('<H', buf[bufIdx:bufIdx+general_msg_header_list.get("msg_id")])[0]
bufIdx += general_msg_header_list.get("msg_id")
frame = struct.unpack('<H', buf[bufIdx:bufIdx+general_msg_header_list.get("frame")])[0]
bufIdx += general_msg_header_list.get("frame")
slot = struct.unpack('B', buf[bufIdx:bufIdx+general_msg_header_list.get("slot")])[0]
bufIdx += general_msg_header_list.get("slot")
# get time stamp: yyyy mm dd hh mm ss msec
nr_trace_time_stamp_yyymmdd = \
struct.unpack('<i', buf[bufIdx:bufIdx+general_msg_header_list.get("datetime_yyyymmdd")])[0]
bufIdx += general_msg_header_list.get("datetime_yyyymmdd")
nr_trace_time_stamp_hhmmssmmm = \
struct.unpack('<i', buf[bufIdx:bufIdx+general_msg_header_list.get("datetime_hhmmssmmm")])[0]
bufIdx += general_msg_header_list.get("datetime_hhmmssmmm")
time_stamp_milli_sec = str(nr_trace_time_stamp_yyymmdd)+"_"+str(nr_trace_time_stamp_hhmmssmmm)
# get frame type
frame_type = struct.unpack('B', buf[bufIdx:bufIdx+general_msg_header_list.get("frame_type")])[0]
bufIdx += general_msg_header_list.get("frame_type")
# get frequency range
freq_range = struct.unpack('B', buf[bufIdx:bufIdx+general_msg_header_list.get("freq_range")])[0]
bufIdx += general_msg_header_list.get("freq_range")
# get subcarrier spacing
subcarrier_spacing = struct.unpack('B', buf[bufIdx:bufIdx+general_msg_header_list.get("subcarrier_spacing")])[0]
bufIdx += general_msg_header_list.get("subcarrier_spacing")
# get cyclic prefix
cyclic_prefix = struct.unpack('B', buf[bufIdx:bufIdx+general_msg_header_list.get("cyclic_prefix")])[0]
bufIdx += general_msg_header_list.get("cyclic_prefix")
# get symbols per slot
symbols_per_slot = struct.unpack('B', buf[bufIdx:bufIdx+general_msg_header_list.get("symbols_per_slot")])[0]
bufIdx += general_msg_header_list.get("symbols_per_slot")
# get Nid cell
Nid_cell = struct.unpack('<H', buf[bufIdx:bufIdx+general_msg_header_list.get("Nid_cell")])[0]
bufIdx += general_msg_header_list.get("Nid_cell")
# get rnti
rnti = struct.unpack('<H', buf[bufIdx:bufIdx+general_msg_header_list.get("rnti")])[0]
bufIdx += general_msg_header_list.get("rnti")
# get rb size
rb_size = struct.unpack('<H', buf[bufIdx:bufIdx+general_msg_header_list.get("rb_size")])[0]
bufIdx += general_msg_header_list.get("rb_size")
# get rb start
rb_start = struct.unpack('<H', buf[bufIdx:bufIdx+general_msg_header_list.get("rb_start")])[0]
bufIdx += general_msg_header_list.get("rb_start")
# get start symbol index
start_symbol_index = struct.unpack('B', buf[bufIdx:bufIdx+general_msg_header_list.get("start_symbol_index")])[0]
bufIdx += general_msg_header_list.get("start_symbol_index")
# get number of symbols
nr_of_symbols = struct.unpack('B', buf[bufIdx:bufIdx+general_msg_header_list.get("nr_of_symbols")])[0]
bufIdx += general_msg_header_list.get("nr_of_symbols")
# get qam modulation order
qam_mod_order = struct.unpack('B', buf[bufIdx:bufIdx+general_msg_header_list.get("qam_mod_order")])[0]
bufIdx += general_msg_header_list.get("qam_mod_order")
# get mcs index
mcs_index = struct.unpack('B', buf[bufIdx:bufIdx+general_msg_header_list.get("mcs_index")])[0]
bufIdx += general_msg_header_list.get("mcs_index")
# get mcs table
mcs_table = struct.unpack('B', buf[bufIdx:bufIdx+general_msg_header_list.get("mcs_table")])[0]
bufIdx += general_msg_header_list.get("mcs_table")
# get number of layers
nrOfLayers = struct.unpack('B', buf[bufIdx:bufIdx+general_msg_header_list.get("nrOfLayers")])[0]
bufIdx += general_msg_header_list.get("nrOfLayers")
# get transform precoding
transform_precoding = struct.unpack('B', buf[bufIdx:bufIdx+general_msg_header_list.get("transform_precoding")])[0]
bufIdx += general_msg_header_list.get("transform_precoding")
# get dmrs config type
dmrs_config_type = struct.unpack('B', buf[bufIdx:bufIdx+general_msg_header_list.get("dmrs_config_type")])[0]
bufIdx += general_msg_header_list.get("dmrs_config_type")
# get ul dmrs symb pos
ul_dmrs_symb_pos = struct.unpack('<H', buf[bufIdx:bufIdx+general_msg_header_list.get("ul_dmrs_symb_pos")])[0]
bufIdx += general_msg_header_list.get("ul_dmrs_symb_pos")
# get number dmrs symbols
number_dmrs_symbols = struct.unpack('B', buf[bufIdx:bufIdx+general_msg_header_list.get("number_dmrs_symbols")])[0]
bufIdx += general_msg_header_list.get("number_dmrs_symbols")
# get dmrs port
dmrs_port = struct.unpack('<H', buf[bufIdx:bufIdx+general_msg_header_list.get("dmrs_port")])[0]
bufIdx += general_msg_header_list.get("dmrs_port")
# get dmrs scid
dmrs_scid = struct.unpack('<H', buf[bufIdx:bufIdx+general_msg_header_list.get("dmrs_scid")])[0]
bufIdx += general_msg_header_list.get("dmrs_scid")
# get nb antennas rx for gNB or nb antennas tx for UE
nb_antennas = struct.unpack('B', buf[bufIdx:bufIdx+general_msg_header_list.get("nb_antennas")])[0]
bufIdx += general_msg_header_list.get("nb_antennas")
# get number of bits
number_of_bits = struct.unpack('<I', buf[bufIdx:bufIdx+general_msg_header_list.get("number_of_bits")])[0]
bufIdx += general_msg_header_list.get("number_of_bits")
# get length of bytes
length_bytes = struct.unpack('<I', buf[bufIdx:bufIdx+general_msg_header_list.get("length_bytes")])[0]
bufIdx += general_msg_header_list.get("length_bytes")
# print all captured data
if DEBUG_WIRELESS_RECORDED_DATA:
print(" ")
print(f"Time stamp: {time_stamp_milli_sec}")
print(f"MSG ID: {msg_id:<5} MSG Name: {tracer_msgs_identities[msg_id]}")
print(f"Frame: {frame:<5} Slot: {slot:<5}")
print(f"Frame Type: {frame_type:<5} Frequency Range: {freq_range:<5}"
f"Subcarrier Spacing: {subcarrier_spacing:<5} Cyclic Prefix: {cyclic_prefix:<5} "
f"Symbols per Slot: {symbols_per_slot:<5}")
print(f"Nid Cell: {Nid_cell:<5} RNTI: {rnti:<5}")
print(f"RB Size: {rb_size:<5} RB Start: {rb_start:<5} Start Symbol Index: {start_symbol_index:<5} "
f"Number of Symbols: {nr_of_symbols:<5}")
print(f"QAM Modulation Order: {qam_mod_order:<5} MCS Index: {mcs_index:<5} "
f"MCS Table: {mcs_table:<5}")
print(f"Number of Layers: {nrOfLayers:<5} Transform Precoding: {transform_precoding:<5}")
print(f"DMRS Config Type: {dmrs_config_type:<5} UL DMRS Symbol Position: {ul_dmrs_symb_pos:<5} "
f"Number of DMRS Symbols: {number_dmrs_symbols:<5}")
print(f"DMRS Port: {dmrs_port:<5} DMRS SCID: {dmrs_scid:<5} "
f"Number of Antennas: {nb_antennas:<5}")
print(f"Number of bits: {number_of_bits:<5} Length of bytes: {length_bytes:<5}")
# raise exception if time stamp is zero, it means that the data is not recorded yet
if nr_trace_time_stamp_yyymmdd == 0 and nr_trace_time_stamp_hhmmssmmm == 0:
raise Exception("ERROR: Time stamp is zero, data is not recorded yet or something wrong, check logs!")
# get recorded data
buf = shm.read(bufIdx + length_bytes)
# bit_msg_index = get_index_of_id(tracer_msgs_identities, "GNB_PHY_UL_PAYLOAD_RX_BITS")
captured_data = {}
# If message is bit message, store data in bytes
# then the field number_of_bits should be not zero
if "_BITS" in tracer_msgs_identities[msg_id]:
# recorded_data = buf[bufIdx:bufIdx + length_bytes]
recorded_data = struct.unpack("<" + int(length_bytes) * 'B', buf[bufIdx:bufIdx + length_bytes])
bufIdx += length_bytes
# convert data in bytes to bits
bits_vector = []
for byte in recorded_data:
bits_vector.extend([int(bit) for bit in format(int(byte), '08b')])
captured_data["sigmf_data_type"] = "ri8_le"
# convert to uint8
captured_data["recorded_data"] = np.asarray(bits_vector).astype(np.uint8)
# recorded_data_formated = recorded_data.astype(np.complex64) # convert to complex64
else:
recorded_data = struct.unpack("<" + int(length_bytes/2) * 'h', buf[bufIdx:bufIdx + length_bytes])
bufIdx += length_bytes
# print("IQ data I/Q: ", recorded_data)
# Convert real data to complext data
# converting list to array
recorded_data = np.asarray(recorded_data)
# recorded_data_complex = recorded_data
recorded_data_complex = common_utils.real_to_complex(recorded_data)
captured_data["sigmf_data_type"] = "cf32_le"
# convert to complex64
captured_data["recorded_data"] = recorded_data_complex.astype(np.complex64)
# print("Recorded Data: ", captured_data["recorded_data"])
# store data in dictonary
captured_data["message_id"] = msg_id
captured_data["message_type"] = tracer_msgs_identities[msg_id]
captured_data["frame"] = frame
captured_data["slot"] = slot
captured_data["time_stamp"] = time_stamp_milli_sec
captured_data["frame_type"] = frame_type
captured_data["freq_range"] = freq_range
captured_data["subcarrier_spacing"] = subcarrier_spacing
captured_data["cyclic_prefix"] = cyclic_prefix
# captured_data["symbols_per_slot"] = symbols_per_slot ... not used
captured_data["Nid_cell"] = Nid_cell
captured_data["rnti"] = rnti
captured_data["rb_size"] = rb_size
captured_data["rb_start"] = rb_start
captured_data["start_symbol_index"] = start_symbol_index
captured_data["nr_of_symbols"] = nr_of_symbols
captured_data["qam_mod_order"] = qam_mod_order
captured_data["mcs_index"] = mcs_index
captured_data["mcs_table"] = mcs_table
captured_data["nrOfLayers"] = nrOfLayers
captured_data["transform_precoding"] = transform_precoding
captured_data["dmrs_config_type"] = dmrs_config_type
captured_data["ul_dmrs_symb_pos"] = ul_dmrs_symb_pos
captured_data["number_dmrs_symbols"] = number_dmrs_symbols
captured_data["dmrs_port"] = dmrs_port
captured_data["dmrs_scid"] = dmrs_scid
captured_data["nb_antennas"] = nb_antennas
captured_data["number_of_bits"] = number_of_bits
return captured_data, bufIdx
# Synchronize data between gNB and UE
def sync_data_conversion_service(
shm_reading_gnb, shm_reading_ue, sync_info, config_meta_data, gnb_args, ue_args):
# Initialize variables
record_idx = 0
prev_frame = -1
prev_slot = -1
ue_bufIdx = 0
gnb_bufIdx = 0
gnb_args.num_requested_tracer_msgs = len(
config_meta_data["data_recording_config"]["base_station"][
"requested_tracer_messages"])
ue_args.num_requested_tracer_msgs = len(
config_meta_data["data_recording_config"]["user_equipment"][
"requested_tracer_messages"])
tracer_msgs_identities = config_meta_data["data_recording_config"][
"tracer_msgs_identities"]
global_info = config_meta_data["data_recording_config"]["global_info"]
# Get UE data based on the sync data
bufIdx = 0
timeout_sync = time.time() + 5 # 5 seconds if no sync data found, stop the process
while True:
# wait for the next record
# To do: check if we need to add exta waiting times between different events in case of
# data streaming via network such as on UE side or gNB side
time.sleep(0.0035) # 2.3 ms = latency of T tracer to capture data from the RAN
ue_bufIdx = bufIdx
captured_data, bufIdx = read_data_from_shm(shm_reading_ue, bufIdx, tracer_msgs_identities)
if (captured_data["frame"] == sync_info["frame"]
and captured_data["slot"] == sync_info["slot"]):
break
if time.time() > timeout_sync:
raise Exception(
"ERROR: Data Recording NO Sync Found, check Tracer Services if they are connected!")
# Get gNB data based on the sync data
bufIdx = 0
while True:
time.sleep(0.0035)
gnb_bufIdx = bufIdx
captured_data, bufIdx = read_data_from_shm(
shm_reading_gnb, bufIdx, tracer_msgs_identities)
if (captured_data["frame"] == sync_info["frame"]
and captured_data["slot"] == sync_info["slot"]):
break
# Read Synchronized data between gNB and UE
while True: # read all records
print("\nRecord number: ", record_idx)
if DEBUG_BUFFER_READING:
print(f"Buffer Index gNB: {gnb_bufIdx}, Buffer Index UE: {ue_bufIdx}")
# wait for the next record
# To do: check if we need to add exta waiting times between different events in case of
# data streaming via network such as on UE side or gNB side
time.sleep(0.0035) # 2.3 ms = latency of T tracer to capture data from the RAN
collected_metafiles = []
# Read data from gNB T-tracer Application
for idx in range(gnb_args.num_requested_tracer_msgs):
time.sleep(0.0015)
if DEBUG_WIRELESS_RECORDED_DATA:
print(f"\nRecord number: {record_idx}, Reading MSG data ", idx)
captured_data, gnb_bufIdx = read_data_from_shm(
shm_reading_gnb, gnb_bufIdx, tracer_msgs_identities)
# drive the collection file time stamp from the first message per record
if idx == 0:
# Get time stamp
time_stamp_ms, time_stamp_ms_file_name = (
sigmf_interface.time_stamp_formating(
captured_data["time_stamp"], global_info["datetime_offset"]))
global_info["collection_file"] = (
global_info["collection_file_prefix"]
+ "-rec-"
+ str(record_idx)
+ "-"
+ str(time_stamp_ms_file_name)
)
global_info["timestamp"] = time_stamp_ms
# Write data into files with the given format
if config_meta_data["data_recording_config"]["enable_saving_tracer_messages_sigmf"]:
collected_metafiles.append(
sigmf_interface.write_recorded_data_to_sigmf(
captured_data, config_meta_data, global_info, record_idx))
# Read data from UE T-tracer Application
for idx in range(ue_args.num_requested_tracer_msgs):
time.sleep(0.0015)
if DEBUG_WIRELESS_RECORDED_DATA:
print(f"\nRecord number: {record_idx}, Reading MSG data ", idx)
captured_data, ue_bufIdx = read_data_from_shm(
shm_reading_ue, ue_bufIdx, tracer_msgs_identities)
# Write data into files with the given format
if config_meta_data["data_recording_config"]["enable_saving_tracer_messages_sigmf"]:
collected_metafiles.append(
sigmf_interface.write_recorded_data_to_sigmf(
captured_data, config_meta_data, global_info, record_idx))
# generate SigMF collection file
if config_meta_data["data_recording_config"]["enable_saving_tracer_messages_sigmf"]:
data_storage_path = config_meta_data["data_recording_config"][
"data_storage_path"]
description = global_info["description"]
sigmf_interface.save_sigmf_collection(
collected_metafiles, global_info, description, data_storage_path)
frame = captured_data["frame"]
slot = captured_data["slot"]
# Check for changes in frame or slot
if frame != prev_frame or slot != prev_slot:
record_idx += 1
# We have reached the end of the data. Break the loop
if record_idx >= config_meta_data["data_recording_config"]["num_records"]:
break
# Update previous frame and slot
prev_frame = frame
prev_slot = slot
# data conversion service
def data_conversion_service(shm_reading, config_meta_data, args, sync_info, do_sync):
# Initialize variables
record_idx = 0
prev_frame = -1
prev_slot = -1
bufIdx = 0
# Read data from T-tracer Application
print("Data Conversion Service: Reading data from T-tracer Application")
print("Requested Tracer Messages: ", args.num_requested_tracer_msgs)
if args.num_requested_tracer_msgs > 0:
num_requested_tracer_msgs = args.num_requested_tracer_msgs
else:
raise Exception("ERROR: No requested tracer messages found!")
tracer_msgs_identities = config_meta_data["data_recording_config"][
"tracer_msgs_identities"]
global_info = config_meta_data["data_recording_config"]["global_info"]
if do_sync:
print(" Find Memory Index of NR MSGs based on Sync info")
while True:
time.sleep(0.0035)
station_bufIdx = bufIdx
captured_data, bufIdx = read_data_from_shm(
shm_reading, bufIdx, tracer_msgs_identities)
print("*Sync Status: NR Captured Data (Frame, slot): (", captured_data["frame"],
", ", captured_data["slot"], "), Sync Info (Frame, slot): (", sync_info["frame"],
", ", sync_info["slot"]," )")
if (captured_data["frame"] == sync_info["frame"]
and captured_data["slot"] == sync_info["slot"]):
print("*sync Pass")
break
print("*sync Fail")
bufIdx = station_bufIdx
# Read data from T-tracer Application
while True: # read all records
print("\nRecord number: ", record_idx)
if DEBUG_BUFFER_READING:
print(f"Buffer Index: {bufIdx}")
# wait for the next record
# To do: check if we need to add exta waiting times between different events in case of
# data streaming via network such as on UE side or gNB side
time.sleep(0.0035) # 2.3 ms = latency of T tracer to capture data from the RAN
collected_metafiles = []
for idx in range(num_requested_tracer_msgs):
time.sleep(0.0015)
if DEBUG_WIRELESS_RECORDED_DATA:
print(f"\nRecord number: {record_idx}, Reading MSG data ", idx)
captured_data, bufIdx = read_data_from_shm(
shm_reading, bufIdx, tracer_msgs_identities)
# derive the collection file time stamp from the first message per record
if idx == 0:
# Get time stamp
time_stamp_ms, time_stamp_ms_file_name = (
sigmf_interface.time_stamp_formating(
captured_data["time_stamp"], global_info["datetime_offset"]))
global_info["collection_file"] = (
global_info["collection_file_prefix"]
+ "-rec-"
+ str(record_idx)
+ "-"
+ str(time_stamp_ms_file_name))
global_info["timestamp"] = time_stamp_ms
# Write data into files with the given format
if config_meta_data["data_recording_config"]["enable_saving_tracer_messages_sigmf"]:
collected_metafiles.append(
sigmf_interface.write_recorded_data_to_sigmf(
captured_data, config_meta_data, global_info, record_idx))
frame = captured_data["frame"]
slot = captured_data["slot"]
# generate SigMF collection file
if config_meta_data["data_recording_config"]["enable_saving_tracer_messages_sigmf"]:
data_storage_path = config_meta_data["data_recording_config"][
"data_storage_path"]
description = global_info["description"]
sigmf_interface.save_sigmf_collection(
collected_metafiles, global_info, description, data_storage_path)
# Check for changes in frame or slot
if frame != prev_frame or slot != prev_slot:
record_idx += 1
# We have reached the end of the data. Break the loop
if record_idx >= config_meta_data["data_recording_config"]["num_records"]:
break
# Update previous frame and slot
prev_frame = frame
prev_slot = slot
# Write Tracer Control Message
def write_shm(shm, args):
# Note: Big Endian >, Little Endian <
# Note: unsigned char B, signed char b, short h, int I, long long q
# Note: float f, double d, string s, char c, bool ?
# 1: config
# 2: record
# 3: quit
print("Write Shared Memory: ", args.action)
if args.action == "config":
# Determine the length of the IP address
ip_length = len(args.bytes_IPaddress) + 1 # String terminator
# Construct the format string dynamically
format_string = f"{ip_length}s"
shm.write(
# Config action
struct.pack("<B", 1) +
struct.pack("<B", ip_length) +
struct.pack(format_string, args.bytes_IPaddress) +
struct.pack("<h", int(args.port))
)
print("T-Tracer Config IP: ", args.bytes_IPaddress, " port: ", args.port)
elif args.action == "record":
shm.write(
# Record action
struct.pack("<B", int(2)) +
struct.pack("<B", args.num_requested_tracer_msgs) +
struct.pack(
"<{}h".format(len(args.req_tracer_msgs_indices)),
*args.req_tracer_msgs_indices,) +
struct.pack("<I", args.num_records) +
struct.pack("<h", args.start_frame_number)
)
print("T-Tracer Record: N Messags: ", args.num_requested_tracer_msgs,
", Msg IDs: ", args.req_tracer_msgs_indices,
", Num records: ", args.num_records,
", Start Frame: ", args.start_frame_number,
)
elif args.action == "quit":
shm.write(struct.pack("<B", int(3))) # Quit action
print("T-Tracer Quit")
else:
print("Unknown action for data recording system!")
# write shared memory task
def write_shm_task(barrier, shm_id, args):
# Wait for threads to be ready
barrier.wait()
# send request to related T-Tracer Application
write_shm(shm_id, args)
if __name__ == "__main__":
# -------------------------------------------
# ------------- Configuration --------------
# ------------------------------------------
# Data Recording Configuration
data_recording_config_file = "config/config_data_recording.json"
# -------------------------------------------
# Configuration
# -------------------------------------------
# First: get the configuration mode either local or remote
# Second: get data recording configuration
# Read and parse the JSON file
with open(data_recording_config_file, "r") as file:
config_meta_data = json.load(file)
# get Configuration parameters
config_meta_data, gnb_args, ue_args = config_interface.get_data_recording_config(config_meta_data)
# check if lists of requested tracer messages IDs are not empty
if not gnb_args.requested_tracer_messages and \
not ue_args.requested_tracer_messages:
raise Exception("ERROR: No requested tracer messages are provided")
# check if gnb_requested_tracer_messages is not empty, attach to the shared memory
if gnb_args.requested_tracer_messages:
# attach to the shared memory
shm_writing_gnb = attach_shm(write_shm_path_gnb, project_id_gnb)
shm_reading_gnb = attach_shm(read_shm_path_gnb, project_id_gnb)
# check if ue_requested_tracer_messages is not empty, attach to the shared memory
if ue_args.requested_tracer_messages:
# attach to the shared memory
shm_writing_ue = attach_shm(write_shm_path_ue, project_id_ue)
shm_reading_ue = attach_shm(read_shm_path_ue, project_id_ue)
# get general message header list
general_msg_header_list, general_message_header_length = \
data_recording_messages_def.get_general_msg_header_list()
# Add supported OAI Tracer Messages
config_meta_data["data_recording_config"]["supported_oai_tracer_messages"] = supported_oai_tracer_messages
# Add global info
config_meta_data["data_recording_config"]["global_info"] = global_info
# -------------------------------------------
# Initialization
# -------------------------------------------
# -------------------------------------------
# send Tracer Control Message request to T-Tracers Apps
# -------------------------------------------
# It consists of the following fields:
# Config action
# IP address length
# IP address
# Port Number
# check if gnb_requested_tracer_messages is not empty, config T-Tracer gNB via shared memory
if gnb_args.requested_tracer_messages:
# Config T-Tracer via shared memory
gnb_args.action = "config"
write_shm(shm_writing_gnb, gnb_args)
# check if ue_requested_tracer_messages is not empty, config T-Tracer UE via shared memory
if ue_args.requested_tracer_messages:
# Config T-Tracer via shared memory
ue_args.action = "config"
write_shm(shm_writing_ue, ue_args)
time.sleep(0.5) # wait for the config to be applied
# -------------------------------------------
# Execution
# -------------------------------------------
# send Tracer Control Message request to T-Tracers Apps
# -------------------------------------------
# It consists of the following fields:
# Record action
# Number of requested Tracer Messages
# Requested Tracer Messages ID 1, …, ID N
# Number of records to be recorded in slots
# Start SFN: Frame Index to start data collection from it, useful for future
# data sync between gNB and UE but not yet used
print("Args:")
if gnb_args.requested_tracer_messages:
gnb_args.action = "record"
print("gnb_args: ", gnb_args)
if ue_args.requested_tracer_messages:
ue_args.action = "record"
print("ue_args: ", ue_args)
start_time = time.time()
print("Send data logging request us:", datetime.now().strftime("%Y%m%d-%H%M%S%f"))
# if requested: gNB and UE Tracer Messages
# gNB + UE Tracer Messages
if gnb_args.requested_tracer_messages and ue_args.requested_tracer_messages:
# Create a barrier to synchronize the threads
barrier = threading.Barrier(2)
with concurrent.futures.ThreadPoolExecutor() as executor:
tracer_ue = executor.submit(write_shm_task, barrier, shm_writing_ue, ue_args)
tracer_gnb = executor.submit(write_shm_task, barrier, shm_writing_gnb, gnb_args)
# Wait for both functions to complete
concurrent.futures.wait([tracer_ue, tracer_gnb])
# gNB Tracer Messages
elif gnb_args.requested_tracer_messages:
write_shm(shm_writing_gnb, gnb_args)
# UE Tracer Messages
elif ue_args.requested_tracer_messages:
write_shm(shm_writing_ue, ue_args)
else:
raise Exception("ERROR: No requested tracer messages IDs are provided")
# -------------------------------------------
# Read data from gNB and UE T-tracer Application
# -------------------------------------------
# Check if data is available in memory
# Initialize variables
bufIdx = 0
timeout = 10 # 10 seconds from now
# If gNB MSGs are requested
if gnb_args.requested_tracer_messages:
# Check if data is available in gNB memory
is_gnb_data_in_memory = is_data_available_in_memory(
shm_reading_gnb, bufIdx, general_message_header_length, timeout)
# Report the status of gNB T-Tracer APP locally
if not is_gnb_data_in_memory:
print("Error: gNB: Check t-Tracer APP of gNB, check IPs and Ports")
print("Error: gNB: If IPs and Ports are correct, re-run the hanging app.")
print("It seems the socket was not closed properly")
raise Exception("ERROR: Time out, check if gNB T-Tracer APP connected to stack")
# If UE MSGs are requested
if ue_args.requested_tracer_messages:
# Check if data is available in UE memory
is_ue_data_in_memory = is_data_available_in_memory(
shm_reading_ue, bufIdx, general_message_header_length, timeout)
# Report the status of UE T-Tracer APP locally
if not is_ue_data_in_memory:
print("Error: UE: Check t-Tracer APP of UE, check IPs and Ports")
print("Error: UE: If IPs and Ports are correct, re-run the hanging app.")
print("It seems the socket was not closed properly")
raise Exception("ERROR: Time out, check if UE T-Tracer APP connected to stack")
# -------------------------------------------
# Sync data between gNB and UE
# -------------------------------------------
# write JSON file
common_utils.write_config_data_recording_app_json(config_meta_data)
sync_info = {}
if gnb_args.requested_tracer_messages and ue_args.requested_tracer_messages:
# Sync data between gNB and UE
sync_info = sync_service.sync_gnb_ue_captured_data(shm_reading_gnb, shm_reading_ue)
print("\n***Sync data between gNB and UE: ", sync_info)
# Read data from gNB and UE T-tracer Applications
sync_data_conversion_service(
shm_reading_gnb, shm_reading_ue, sync_info, config_meta_data, gnb_args, ue_args)
elif gnb_args.requested_tracer_messages:
# Read data from gNB T-tracer Application
data_conversion_service(
shm_reading_gnb, config_meta_data, gnb_args, sync_info, do_sync=False)
elif ue_args.requested_tracer_messages:
# Read data from UE T-tracer Application
data_conversion_service(
shm_reading_ue, config_meta_data, ue_args, sync_info, do_sync=False)
else:
raise Exception("ERROR: No requested tracer messages IDs are provided")
# measure Elapsed time
time_elapsed = time.time() - start_time
time_elapsed_ms = int(time_elapsed * 1000)
print(
"Elapsed time of getting Requested Messages and writing data and meta data files:",
colored(time_elapsed_ms, "yellow"), "ms",)
# Stop T-Tracer Application function
if gnb_args.requested_tracer_messages:
gnb_args.action = "quit"
write_shm(shm_writing_gnb, gnb_args)
# Add Sleep time to ensure that the message sent to the UE T-tracer application is received
# before the shared memory is detached
time.sleep(0.5)
# Clean shared memory
detach_shm(shm_reading_gnb)
detach_shm(shm_writing_gnb)
remove_shm(shm_reading_gnb)
remove_shm(shm_writing_gnb)
if ue_args.requested_tracer_messages:
ue_args.action = "quit"
write_shm(shm_writing_ue, ue_args)
# Add Sleep time to ensure that the message sent to the UE T-tracer application is received
# before the shared memory is detached
time.sleep(0.5)
# Clean shared memory
detach_shm(shm_reading_ue)
detach_shm(shm_writing_ue)
remove_shm(shm_reading_ue)
remove_shm(shm_writing_ue)
print("End of the RF Data Recording API")
pass

View File

@@ -0,0 +1,32 @@
#/*
# * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
# * contributor license agreements. See the NOTICE file distributed with
# * this work for additional information regarding copyright ownership.
# * The OpenAirInterface Software Alliance licenses this file to You under
# * the OAI Public License, Version 1.1 (the "License"); you may not use this file
# * except in compliance with the License.
# * You may obtain a copy of the License at
# *
# * http://www.openairinterface.org/?page_id=698
# *
# * Unless required by applicable law or agreed to in writing, software
# * distributed under the License is distributed on an "AS IS" BASIS,
# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# * See the License for the specific language governing permissions and
# * limitations under the License.
# *-------------------------------------------------------------------------------
# * For more information about the OpenAirInterface (OAI) Software Alliance:
# * contact@openairinterface.org
# */
#---------------------------------------------------------------------
# file common/utils/data_recording/lib/__init__.py
# brief for package initialization and code execution
# author Abdo Gaber
# date 2024
# version 1.0
# company Emerson, NI Test and Measurement
# email:
# note
# warning
# This file is important in python to call functions from the lib folder.

View File

@@ -0,0 +1,74 @@
# /*
# * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
# * contributor license agreements. See the NOTICE file distributed with
# * this work for additional information regarding copyright ownership.
# * The OpenAirInterface Software Alliance licenses this file to You under
# * the OAI Public License, Version 1.1 (the "License"); you may not use this file
# * except in compliance with the License.
# * You may obtain a copy of the License at
# *
# * http://www.openairinterface.org/?page_id=698
# *
# * Unless required by applicable law or agreed to in writing, software
# * distributed under the License is distributed on an "AS IS" BASIS,
# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# * See the License for the specific language governing permissions and
# * limitations under the License.
# *-------------------------------------------------------------------------------
# * For more information about the OpenAirInterface (OAI) Software Alliance:
# * contact@openairinterface.org
# */
# ---------------------------------------------------------------------
# file common/utils/data_recording/lib/common_utils.py
# brief Data Recording common utilities
# author Abdo Gaber
# date 2025
# version 1.0
# company Emerson, NI Test and Measurement
# email:
# note
# warning
import os
import json
def real_to_complex(real_vector):
# Ensure the length of the real vector is even
if len(real_vector) % 2 != 0:
raise ValueError("The length of the real vector must be even.")
# Split the real vector into real and imaginary parts
real_part = real_vector[::2]
imag_part = real_vector[1::2]
# Combine the real and imaginary parts to form a complex vector
complex_vector = real_part + 1j * imag_part
return complex_vector
def write_config_data_recording_app_json(config_meta_data):
if config_meta_data["data_recording_config"]["global_info"][
"save_config_data_recording_app_json"
]:
try:
json.dumps(config_meta_data)
except (TypeError, ValueError) as e:
print(f"data_recording_config_meta_json is not JSON serializable: {e}")
# Specify the file name
output_file = (
config_meta_data["data_recording_config"]["data_storage_path"]
+ "config_data_recording_app.json"
)
# Ensure the directory exists
os.makedirs(os.path.dirname(output_file), exist_ok=True)
# Write the JSON data to the file
with open(output_file, "w") as file:
try:
json.dump(config_meta_data, file, indent=4)
print(f"JSON file created successfully at {output_file}")
except Exception as e:
print(f"Failed to create JSON file: {e}")

View File

@@ -0,0 +1,150 @@
# /*
# * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
# * contributor license agreements. See the NOTICE file distributed with
# * this work for additional information regarding copyright ownership.
# * The OpenAirInterface Software Alliance licenses this file to You under
# * the OAI Public License, Version 1.1 (the "License"); you may not use this file
# * except in compliance with the License.
# * You may obtain a copy of the License at
# *
# * http://www.openairinterface.org/?page_id=698
# *
# * Unless required by applicable law or agreed to in writing, software
# * distributed under the License is distributed on an "AS IS" BASIS,
# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# * See the License for the specific language governing permissions and
# * limitations under the License.
# *-------------------------------------------------------------------------------
# * For more information about the OpenAirInterface (OAI) Software Alliance:
# * contact@openairinterface.org
# */
# ---------------------------------------------------------------------
# file common/utils/data_recording/lib/config_interface.py
# brief Data Recording App Configuration Interface
# author Abdo Gaber
# date 2025
# version 1.0
# company Emerson, NI Test and Measurement
# email:
# note
# warning
import yaml
import json
import argparse
# Function to read the main configuration file in JSON format
def read_main_config_file_json(main_config_file: str) -> dict:
"""
Reads main config file.
"""
# read general parameter set from yaml config file
with open(main_config_file, "r") as file:
main_config = json.load(file)
return main_config
# Function to read the main configuration file in YAML format
def read_main_config_file(main_config_file: str) -> dict:
"""
Reads main config file.
"""
# read general parameter set from yaml config file
with open(main_config_file, "r") as file:
main_config = yaml.load(file, Loader=yaml.Loader)
return main_config
# Function to parse the OAI T_messages file and get the index of a given string
def parse_message_file(file_path):
with open(file_path, "r") as file:
content = file.readlines()
# Extract lines that start with 'ID' and remove the 'ID = ' prefix
tracer_msgs_identities = [
line.strip().replace("ID = ", "")
for line in content
if line.strip().startswith("ID")
]
return tracer_msgs_identities
# Function to get the index of a given string in the list of ID lines
def get_index_of_id(tracer_msgs_identities, message_id):
try:
return tracer_msgs_identities.index(message_id)
except ValueError:
return -1 # Return -1 if the string is not found
# Function to get the indices of requested tracer messages
def get_requested_tracer_msgs_indices(requested_tracer_messages, tracer_msgs_identities):
# get requested tracer messages indices
req_tracer_msgs_indices = []
for idx, value in enumerate(requested_tracer_messages):
msg_index = get_index_of_id(tracer_msgs_identities, value)
req_tracer_msgs_indices.append(msg_index)
print("Requested Traces IDs: ", req_tracer_msgs_indices)
return req_tracer_msgs_indices
# Function to get the data recording configuration
def get_data_recording_config(config_meta_data):
parser = argparse.ArgumentParser(description="request messages IDs")
ue_args = parser.parse_args()
gnb_args = parser.parse_args()
# get Tracer Messages IDs from the T-Tracer Messages file
# MSG list order should be similar to the T-Tracer Messages txt file
# Be sure that you are using the same T_messages file that is used in the OAI project
# OAI Path: .../common/utils/T/T_messages.txt
# Parse the T_messages file
tracer_msgs_identities = parse_message_file(
config_meta_data["data_recording_config"]["t_tracer_message_definition_file"])
config_meta_data["data_recording_config"]["tracer_msgs_identities"] = tracer_msgs_identities
# get requested tracer messages indices for gNB
gnb_args.requested_tracer_messages = \
config_meta_data["data_recording_config"]["base_station"]["requested_tracer_messages"]
# get requested tracer messages indices for UE
ue_args.requested_tracer_messages = \
config_meta_data["data_recording_config"]["user_equipment"]["requested_tracer_messages"]
# check if gnb_requested_tracer_messages is not empty
if gnb_args.requested_tracer_messages:
config_meta_data["data_recording_config"]["base_station"][
"req_tracer_msgs_indices"] = get_requested_tracer_msgs_indices(
gnb_args.requested_tracer_messages, tracer_msgs_identities)
# get gNB Trace Messages
gnb_args.num_records = config_meta_data["data_recording_config"]["num_records"]
gnb_args.start_frame_number = config_meta_data["data_recording_config"]["start_frame_number"]
gnb_args.req_tracer_msgs_indices = \
config_meta_data["data_recording_config"]["base_station"]["req_tracer_msgs_indices"]
gnb_args.num_requested_tracer_msgs = len(gnb_args.req_tracer_msgs_indices)
# Split the string into IP and port
gnb_args.IPaddress, gnb_args.port = config_meta_data["data_recording_config"][
"tracer_service_baseStation_address"].split(":")
gnb_args.bytes_IPaddress = bytes(gnb_args.IPaddress, "utf-8")
# check if ue_requested_tracer_messages is not empty
if ue_args.requested_tracer_messages:
config_meta_data["data_recording_config"]["user_equipment"][
"req_tracer_msgs_indices"] = get_requested_tracer_msgs_indices(
ue_args.requested_tracer_messages, tracer_msgs_identities)
# get UE Trace Messages
ue_args.num_records = config_meta_data["data_recording_config"]["num_records"]
ue_args.start_frame_number = config_meta_data["data_recording_config"]["start_frame_number"]
ue_args.req_tracer_msgs_indices = \
config_meta_data["data_recording_config"]["user_equipment"]["req_tracer_msgs_indices"]
ue_args.num_requested_tracer_msgs = len(ue_args.req_tracer_msgs_indices)
ue_args.IPaddress, ue_args.port = config_meta_data["data_recording_config"][
"tracer_service_userEquipment_address"].split(":")
ue_args.bytes_IPaddress = bytes(ue_args.IPaddress, "utf-8")
return config_meta_data, gnb_args, ue_args

View File

@@ -0,0 +1,107 @@
# /*
# * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
# * contributor license agreements. See the NOTICE file distributed with
# * this work for additional information regarding copyright ownership.
# * The OpenAirInterface Software Alliance licenses this file to You under
# * the OAI Public License, Version 1.1 (the "License"); you may not use this file
# * except in compliance with the License.
# * You may obtain a copy of the License at
# *
# * http://www.openairinterface.org/?page_id=698
# *
# * Unless required by applicable law or agreed to in writing, software
# * distributed under the License is distributed on an "AS IS" BASIS,
# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# * See the License for the specific language governing permissions and
# * limitations under the License.
# *-------------------------------------------------------------------------------
# * For more information about the OpenAirInterface (OAI) Software Alliance:
# * contact@openairinterface.org
# */
# ---------------------------------------------------------------------
# file common/utils/data_recording/lib/data_recording_messages_def.py
# brief defination of captured data recording messages
# author Abdo Gaber
# date 2025
# version 1.0
# company Emerson, NI Test and Measurement
# email:
# note
# warning
# Data Collection Trace Messages - General message structure - number of bytes
def get_general_msg_header_list():
"""
shared memory layout written from the app:
=================================
msg_id (uint8) message type ID
frame (uint16)
slot (uint8)
datetime_yyyymmdd (uint32)
datetime_hhmmssmmm (uint32)
frame_type (uint8)
freq_range (uint8)
subcarrier_spacing (uint8)
cyclic_prefix (uint8)
symbols_per_slot (uint8)
Nid_cell (uint16)
rnti (uint16)
rb_size (uint16)
rb_start (uint16)
start_symbol_index (uint8)
nr_of_symbols (uint8)
qam_mod_order (uint8)
mcs_index (uint8)
mcs_table (uint8)
nrOfLayers (uint8)
transform_precoding (uint8)
dmrs_config_type (uint8)
ul_dmrs_symb_pos (uint16)
number_dmrs_symbols (uint8)
dmrs_port (uint16)
dmrs_scid (uint16)
nb_antennas (uint8)
number_of_bits (uint32)
length_bytes (uint32)
For IQ Data: IQ samples: I0, Q0, I1, Q1, ... I_x, Q_x (int16)
For bit data: bits: b0, b1, b2, ... b_x (uint8)
"""
# Data Collection Trace Messages - General message structure - number of bytes
general_msg_header_list = {
"msg_id": 2,
"frame": 2,
"slot": 1,
"datetime_yyyymmdd": 4,
"datetime_hhmmssmmm": 4,
"frame_type": 1,
"freq_range": 1,
"subcarrier_spacing": 1,
"cyclic_prefix": 1,
"symbols_per_slot": 1,
"Nid_cell": 2,
"rnti": 2,
"rb_size": 2,
"rb_start": 2,
"start_symbol_index": 1,
"nr_of_symbols": 1,
"qam_mod_order": 1,
"mcs_index": 1,
"mcs_table": 1,
"nrOfLayers": 1,
"transform_precoding": 1,
"dmrs_config_type": 1,
"ul_dmrs_symb_pos": 2,
"number_dmrs_symbols": 1,
"dmrs_port": 2,
"dmrs_scid": 2,
"nb_antennas": 1, # for gNB or nb_antennas_tx for UE
"number_of_bits": 4,
"length_bytes": 4,
}
# initial number of bytes to read to get data
general_message_header_length = 0
for key, value in general_msg_header_list.items():
general_message_header_length = general_message_header_length + value
return general_msg_header_list, general_message_header_length

View File

@@ -0,0 +1,580 @@
# /*
# * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
# * contributor license agreements. See the NOTICE file distributed with
# * this work for additional information regarding copyright ownership.
# * The OpenAirInterface Software Alliance licenses this file to You under
# * the OAI Public License, Version 1.1 (the "License"); you may not use this file
# * except in compliance with the License.
# * You may obtain a copy of the License at
# *
# * http://www.openairinterface.org/?page_id=698
# *
# * Unless required by applicable law or agreed to in writing, software
# * distributed under the License is distributed on an "AS IS" BASIS,
# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# * See the License for the specific language governing permissions and
# * limitations under the License.
# *-------------------------------------------------------------------------------
# * For more information about the OpenAirInterface (OAI) Software Alliance:
# * contact@openairinterface.org
# */
# ---------------------------------------------------------------------
# file common/utils/data_recording/lib/sigmf_interface.py
# brief SigMF Interface to Write data and meta-data to files in SigMF format
# author Abdo Gaber
# date 2025
# version 1.0
# company Emerson, NI Test and Measurement
# email:
# note
# warning
import os
import sigmf
from sigmf import SigMFFile
# from sigmf.utils import get_data_type_str
import numpy as np
from datetime import datetime
import yaml
from sigmf import SigMFCollection
"""
SERIALIZATION_SCHEMES = {
# gnb
"rx-fd-data": ["subcarriers", "ofdm_symbols"],
"tx-pilots-fd-data": ["subcarriers", "ofdm_symbols"],
"raw-ce-fd-data": ["subcarriers", "ofdm_symbols"],
"rx-payload-bits": ["bits", "subcarriers", "ofdm_symbols"],
# ue
"tx-scrambled-bits": ["bits", "subcarriers", "ofdm_symbols"],
"tx-payload-bits": ["bits", "subcarriers", "ofdm_symbols"],
}
"""
STANDARDS = {"5gnr_oai": "5gnr"}
def time_stamp_formating(time_stamp, datetime_offset):
# Parse the input string into a datetime object
time_stamp_ms_obj = datetime.strptime(time_stamp, "%Y%m%d_%H%M%S%f")
# Format the datetime object into the desired output format with milliseconds
time_stamp_ms_iso = (
time_stamp_ms_obj.strftime("%Y_%m_%dT%H:%M:%S.%f")[:-3] + datetime_offset
)
time_stamp_ms = time_stamp_ms_iso
time_stamp_ms_file_name = time_stamp_ms_iso.replace(":", "_").replace(".", "_")
return time_stamp_ms, time_stamp_ms_file_name
def create_serialization_metadata(serialization_scheme, data_source: str,
link_sim_parameters: dict) -> dict:
"""Creates dict that specifies the serialization metadata."""
# retrieve parameter from LinkSimulator config
if data_source == "5gnr_oai":
num_ofdm_symbol = link_sim_parameters["nr_of_symbols"]
num_subcarriers = link_sim_parameters["rb_size"] * 12
num_bits_per_symbol = link_sim_parameters["qam_mod_order"]
else:
raise Exception(
f"Invalid data source string '{data_source}'! Only '5gnr_oai' is valid!"
)
# create array with scheme dimensions
if len(serialization_scheme) == 2:
counts = [num_subcarriers, num_ofdm_symbol]
elif len(serialization_scheme) == 3:
counts = [num_bits_per_symbol, num_subcarriers, num_ofdm_symbol]
else:
raise Exception(
f"Invalid number of elements in serialization scheme: {len(serialization_scheme)}")
# create metadata dict
serialization_dict = {
"serialization:scheme": serialization_scheme,
"serialization:counts": counts,
}
return serialization_dict
def map_metadata_to_sigmf_format(scope, waveform_generator, parameter_map_file, captured_data):
"""
Maps metadata from Waveform creator to API and SigMF format.
The used parameters and the mapping pairs are specified in a separate YAML file
that must be provided as well.
"""
# read waveform parameter map from yaml file
dir_path = os.path.dirname(__file__)
src_path = os.path.split(dir_path)[0]
with open(os.path.join(src_path, parameter_map_file), "r") as file:
parameter_map_dic = yaml.load(file, Loader=yaml.Loader)
# preallocate target dict
sigmf_metadata_dict = {}
# get standard and name of generator
standard_key = parameter_map_dic["waveform_generator"][waveform_generator]
generator = standard_key["generator"]
if scope == "tx":
parameter_map_dic = parameter_map_dic["transmitter"][
STANDARDS[waveform_generator]
]
elif scope == "channel":
parameter_map_dic = parameter_map_dic["channel"]
elif scope == "rx":
parameter_map_dic = parameter_map_dic["receiver"]
else:
raise Exception(
f"Invalid mapping scope '{scope}'! Only 'tx', 'channel' and 'rx' are valid!"
)
# check if standard key is given
if parameter_map_dic is None:
raise Exception(
"Invalid standard key: "
"Name should be corrected or added to wireless_link_parameter_map.yaml, given: "
f"{waveform_generator}"
)
for parameter_pair in parameter_map_dic:
# check if key for chosen simulator even exists
if waveform_generator + "_parameter" in parameter_pair.keys():
# only continue with mapping from file if direct equivalent exists
if parameter_pair[waveform_generator + "_parameter"]["name"]:
# It is not necessary to get all parameters from wireless_link_parameter_map.yaml
# in captured_data since some parameters related to DL or UL only
if (parameter_pair[waveform_generator + "_parameter"]["name"] in captured_data.keys()):
# extract value from waveform config source
value = captured_data[
parameter_pair[waveform_generator + "_parameter"]["name"]]
# additional mapping if parameter values should come from a discrete set of values
if ("value_map" in parameter_pair[waveform_generator + "_parameter"].keys()):
value = parameter_pair[waveform_generator + "_parameter"]["value_map"][value]
# write to target dictionary for SigMF
sigmf_metadata_dict[parameter_pair["sigmf_parameter_name"]] = value
else:
raise Exception(
f"Incomplete specification in field '{waveform_generator}_parameter'!")
# else: # fill_non_explicit_fields
# waveform_config[parameter_pair["sigmf_parameter_name"]] = "none"
if not sigmf_metadata_dict:
raise Exception(
"""ERROR: Check captured meta-data or provided config and meta data """)
# check for non-JSON-serializable data types
def isfloat(NumberString):
try:
float(NumberString)
return True
except ValueError:
return False
for key, value in sigmf_metadata_dict.items():
if isinstance(value, np.integer):
sigmf_metadata_dict[key] = int(value)
elif isinstance(value, (np.float16, np.float32, np.float64)):
sigmf_metadata_dict[key] = np.format_float_positional(value, trim="-")
elif isinstance(value, int):
sigmf_metadata_dict[key] = int(value)
elif isinstance(value, float):
# store value in decimal and not in scientific notation
sigmf_metadata_dict[key] = float(value)
elif isinstance(value, str) and key != "standard":
# convert string to lower case
sigmf_metadata_dict[key] = value.lower()
if isfloat(value):
if value.isdigit():
sigmf_metadata_dict[key] = int(float(value))
elif value.replace(".", "", 1).isdigit() and value.count(".") < 2:
sigmf_metadata_dict[key] = float(value)
return sigmf_metadata_dict, generator
def create_system_components_metadata(waveform_generator, parameter_map_file, captured_data):
"""Creates system components (TX, channel, RX) metadata that will reside in the annotations."""
# map metadata of waveform generator to SigMF format
signal_info, generator = map_metadata_to_sigmf_format(
"tx", waveform_generator, parameter_map_file, captured_data
)
tx_metadata = {
"signal:detail": {
"standard": STANDARDS[waveform_generator],
"generator": generator,
STANDARDS[waveform_generator]: signal_info,
}
}
channel_metadata = {} # will be filled later
rx_metadata = {} # will be filled later
return tx_metadata, channel_metadata, rx_metadata
def write_recorded_data_to_sigmf(captured_data, config_meta_data, global_info, idx):
"""
Compiles and saves provided data and metadata into SigMF file format.
"""
# get meta data from config file
base_station_meta_data = config_meta_data["data_recording_config"]["base_station"][
"meta_data"]
user_equipment_meta_data = config_meta_data["data_recording_config"][
"user_equipment"]["meta_data"]
# Check the receive target path is valid, else create folder
data_storage_path = config_meta_data["data_recording_config"]["data_storage_path"]
if not os.path.isdir(data_storage_path):
print("Create new folder for recorded data: " + str(data_storage_path))
os.makedirs(data_storage_path)
# Write recorded data to file
# Get time stamp
time_stamp_ms, time_stamp_ms_file_name = time_stamp_formating(
captured_data["time_stamp"], global_info["datetime_offset"])
# Map OAI Message Name to SigMF Message Name
file_name_prefix = config_meta_data["data_recording_config"][
"supported_oai_tracer_messages"][captured_data["message_type"]]["file_name_prefix"]
recorded_data_file_name = (
file_name_prefix + "-rec-" + str(idx) + "-" + time_stamp_ms_file_name)
dataset_filename = recorded_data_file_name + ".sigmf-data"
dataset_file_path = os.path.join(data_storage_path, dataset_filename)
print(dataset_file_path)
captured_data["recorded_data"].tofile(dataset_file_path)
# map OAI config data to SigMF metadata
waveform_generator = config_meta_data["data_recording_config"]["global_info"][
"waveform_generator"]
parameter_map_file = config_meta_data["data_recording_config"]["parameter_map_file"]
tx_metadata, channel_metadata, rx_metadata = create_system_components_metadata(
waveform_generator, parameter_map_file, captured_data)
# Add other OAI metadata to SigMF metadata
# ----------------------------------------------------
# Set 1: Parameters needs to be derived from OAI message
# ----------------------------------------------------
# PUSCH DMRS: OFDM symbol start index within slot
get_pusch_dmrs_start_ofdm_symbol = 0
tx_metadata["signal:detail"][STANDARDS[waveform_generator]][
"pusch_dmrs:ofdm_symbol_idx"] = []
for symbol in range(captured_data["start_symbol_index"],
captured_data["start_symbol_index"] + captured_data["nr_of_symbols"]):
dmrs_symbol_flag = (captured_data["ul_dmrs_symb_pos"] >> symbol) & 0x01
if dmrs_symbol_flag and not get_pusch_dmrs_start_ofdm_symbol:
get_pusch_dmrs_start_ofdm_symbol = 1
tx_metadata["signal:detail"][STANDARDS[waveform_generator]][
"pusch_dmrs:start_ofdm_symbol"] = symbol
if dmrs_symbol_flag:
tx_metadata["signal:detail"][STANDARDS[waveform_generator]][
"pusch_dmrs:ofdm_symbol_idx"].append(symbol) # Append symbol to the list
tx_metadata["signal:detail"][STANDARDS[waveform_generator]][
"pusch_dmrs:duration_num_ofdm_symbols"] = 1
tx_metadata["signal:detail"][STANDARDS[waveform_generator]][
"pusch_dmrs:num_add_positions"] = (captured_data["number_dmrs_symbols"] - 1)
# If the message is a BIT message, add number of bits to the signal info
# "UE_PHY_UL_SCRAMBLED_TX_BITS", "GNB_PHY_UL_PAYLOAD_RX_BITS", "UE_PHY_UL_PAYLOAD_TX_BITS"
if "_BITS" in captured_data["message_type"]:
# if "BIT" in captured_data["message_type"]:
tx_metadata["signal:detail"][STANDARDS[waveform_generator]]["num_bits"] = (
captured_data["number_of_bits"])
# If the message is captured from UE, it is UPLink message,
# so number of antennas is num of Tx antennas
# number of antennas on Rx side should be read from global_info given by user
if "UE" in captured_data["message_type"]:
tx_metadata["signal:detail"][STANDARDS[waveform_generator]][
"num_tx_antennas"
] = captured_data["nb_antennas"]
rx_metadata.update(
{"num_rx_antennas": base_station_meta_data["num_rx_antennas"]}
)
# If the message is captured from gNB, it is UPLink message,
# so number of antennas is num of Rx antennas
# number of antennas on Tx side should be read from global_info given by user
else:
tx_metadata["signal:detail"][STANDARDS[waveform_generator]][
"num_tx_antennas"] = user_equipment_meta_data["num_tx_antennas"]
rx_metadata.update({"num_rx_antennas": captured_data["nb_antennas"]})
# Check if the message type contains "UL"
if "UL" in captured_data["message_type"]:
tx_metadata["signal:detail"][STANDARDS[waveform_generator]][
"link_direction"] = "uplink"
else:
tx_metadata["signal:detail"][STANDARDS[waveform_generator]][
"link_direction"] = "downlink"
# ----------------------------------------------------
# Set 2: Parameters that is hardcoded
# ----------------------------------------------------
tx_metadata["signal:detail"][STANDARDS[waveform_generator]][
"pusch:content"] = "compliant"
tx_metadata["signal:detail"][STANDARDS[waveform_generator]][
"pusch:mapping_type"] = "B"
tx_metadata["signal:detail"][STANDARDS[waveform_generator]]["num_slots"] = 1
if config_meta_data["test_config"]["test_mode"] == "rf_simulation":
tx_metadata["signal:detail"][STANDARDS[waveform_generator]][
"pusch:payload_bit_pattern"] = "random"
elif config_meta_data["test_config"]["test_mode"] == "rf_real_time":
tx_metadata["signal:detail"][STANDARDS[waveform_generator]][
"pusch:payload_bit_pattern"] = "zeros"
else:
raise Exception("ERROR: Test mode is not supported in SigMF formatting")
# ----------------------------------------------------
# Read mean parameters
freq = config_meta_data["environment_emulation"]["target_link_config"][
"wireless_channel"]["carrierFreqValueList_hz"][0]
bandwidth = config_meta_data["data_recording_config"]["common_meta_data"][
"bandwidth"]
# used_signal_bandwidth = (
# pow(10, 6) * config_meta_data["environment_emulation"]["target_link_config"]["ran_config"][
# "uplink"]["ul_used_signal_BW_MHz"])
sample_rate = config_meta_data["data_recording_config"]["common_meta_data"][
"sample_rate"]
# get signal emitter info
signal_emitter = {
"manufacturer": "NI",
"seid": user_equipment_meta_data["seid"], # Unique ID of the emitter
"hw": user_equipment_meta_data["hw_type"],
"hw_subtype": user_equipment_meta_data["hw_subtype"],
"frequency": freq,
"sample_rate": sample_rate,
"bandwidth": bandwidth,
"gain_tx": user_equipment_meta_data["tx_gain"],
"clock_reference": config_meta_data["data_recording_config"][
"common_meta_data"
]["clock_reference"],
}
# ----------------------------------------------------
# get channel metadata
# ----------------------------------------------------
# get downlink channel info
# ch_downlink_config = config_meta_data["environment_emulation"]["target_link_config"]["wireless_channel"]["downlink"]
# ch_downlink ={"channel_model": ch_downlink_config["type"]}
# ch_downlink_model = {"channel_model": "AWGN"}
# get uplink channel info
ch_uplink_config = config_meta_data["environment_emulation"]["target_link_config"][
"wireless_channel"
]["uplink"]
# Real Time RF Emulation
if config_meta_data["test_config"]["test_mode"] == "rf_real_time":
channel_metadata.update({"emulation_mode": "ni rf real time"})
if ch_uplink_config["type"] == "statistical_predefined":
channel_metadata.update(
{
"channel_model": ch_uplink_config["statistical"]["predef_channel_profile"],
"snr_esn0_db": ch_uplink_config["statistical"]["snr_db"],
}
)
elif ch_uplink_config["type"] == "statistical_var":
channel_metadata.update(
{
"channel_model": ch_uplink_config["statistical"]["var_power_delay_profile"],
"snr_esn0_db": ch_uplink_config["statistical"]["snr_db"],
"delay_spread": ch_uplink_config["statistical"]["delay_spread_ns"] * pow(10, -9),
"speed": ch_uplink_config["statistical"]["speed_mps"],
}
)
else:
raise Exception("ERROR: channel type is not supported in SigMF formatting")
# RF Simulation
elif config_meta_data["test_config"]["test_mode"] == "rf_simulation":
channel_metadata.update({"emulation_mode": "oai rf simulation"})
channel_metadata.update(
{
"channel_model": ch_uplink_config["statistical"]["predef_channel_profile"],
"snr_esn0_db": ch_uplink_config["statistical"]["snr_db"],
"delay_spread": ch_uplink_config["statistical"]["delay_spread_ns"]
* pow(10, -9), "speed": ch_uplink_config["statistical"]["speed_mps"],
}
)
else:
raise Exception(
"ERROR: Channel Emulation mode is not supported in SigMF formatting")
channel_metadata["carrier_frequency"] = config_meta_data["environment_emulation"][
"target_link_config"]["wireless_channel"]["carrierFreqValueList_hz"][0]
# ----------------------------------------------------
# get rx metadata
# ----------------------------------------------------
rx_metadata.update(
{
"bandwidth": bandwidth,
"gain": base_station_meta_data["rx_gain"],
"manufacturer": "NI",
"seid": base_station_meta_data["seid"],
"hw_subtype": base_station_meta_data["hw_subtype"],
"clock_reference": config_meta_data["data_recording_config"][
"common_meta_data"
]["clock_reference"],
"phy_freq_domain_receiver_type": config_meta_data["test_config"][
"dut_type"
],
}
)
# ----------------------------------------------------
# get test config
# ----------------------------------------------------
"""
test_config = {
"test_name": config_meta_data["test_config"]["test_name"],
"test_mode": config_meta_data["test_config"]["test_mode"],
"dut_type": config_meta_data["test_config"]["dut_type"],
}
"""
# Create sigmf metadata
# ----------------------
# Add global parameters to SigMF metadata
# ----------------------
meta = SigMFFile(
data_file=dataset_file_path, # extension is optional
global_info={
SigMFFile.DATATYPE_KEY: captured_data[
"sigmf_data_type"
], # "cf32_le", # get_data_type_str(rx_data) - 'cf64_le' is not supported yet
SigMFFile.SAMPLE_RATE_KEY: sample_rate,
SigMFFile.NUM_CHANNELS_KEY: 1,
SigMFFile.AUTHOR_KEY: global_info["author"],
SigMFFile.DESCRIPTION_KEY: config_meta_data["data_recording_config"][
"supported_oai_tracer_messages"
][captured_data["message_type"]]["description"],
SigMFFile.RECORDER_KEY: "NI Data Recording Application for OAI",
SigMFFile.LICENSE_KEY: "MIT License",
# Since we are focusing on 5G NR UL, the base station is the receiver
SigMFFile.HW_KEY: base_station_meta_data["hw_type"],
# Disable DATASET key to mitigate the warning when read SIGMF data although it is given in the spec.
# It seems SIGMF still has bug here
SigMFFile.DATASET_KEY: dataset_filename,
SigMFFile.VERSION_KEY: sigmf.__version__,
sigmf.SigMFFile.COLLECTION_KEY: global_info["collection_file"],
},
)
# ----------------------
# Add capture parameters to SigMF metadata
# ----------------------
serialization_scheme = config_meta_data["data_recording_config"][
"supported_oai_tracer_messages"
][captured_data["message_type"]]["serialization_scheme"]
capture_metadata = {
sigmf.SigMFFile.DATETIME_KEY: time_stamp_ms,
SigMFFile.FREQUENCY_KEY: freq,
**create_serialization_metadata(
serialization_scheme, waveform_generator, captured_data
),
}
meta.add_capture(start_index=0, metadata=capture_metadata) # Sample Start
# create annotations dict
system_components_dict = {
"system_components:transmitter": [
{
"transmitter_id": "tx_0",
**tx_metadata,
"signal:emitter": signal_emitter,
}
]
}
system_components_dict["system_components:channel"] = [
{"transmitter_id": "tx_0", **channel_metadata}]
system_components_dict["system_components:receiver"] = rx_metadata
# ----------------------
# Add annotation parameters to SigMF metadata
# ----------------------
meta.add_annotation(
start_index=0, # Sample Start
length=len(captured_data["recorded_data"]), # Sample count
metadata={
# SigMFFile.FLO_KEY: freq - sample_rate/ 2, # args.freq - args.rate / 2,
# SigMFFile.FHI_KEY: freq + sample_rate/ 2, # args.freq + args.rate / 2,
# SigMFFile.LABEL_KEY: label,
# SigMFFile.COMMENT_KEY: general_config["comment"],
"num_transmitters": 1,
**system_components_dict,
},
)
# Write Meta Data to file
dataset_meta_filename = recorded_data_file_name + ".sigmf-meta"
dataset_meta_file_path = os.path.join(data_storage_path, dataset_meta_filename)
meta.tofile(dataset_meta_file_path) # extension is optional
print(dataset_meta_file_path)
return dataset_meta_file_path
def save_sigmf_collection(streams: list, global_info: dict, description: str, storage_path: str):
"""Save metadata and links to SigMF data/metadata files to SigMF collection file."""
# construct path
storage_path = os.path.expanduser(storage_path)
collection_filepath = os.path.join(storage_path, global_info["collection_file"])
# statically configure Collection metadata
collection = SigMFCollection(
streams,
metadata={
SigMFCollection.COLLECTION_KEY: {
SigMFCollection.VERSION_KEY: sigmf.__version__,
SigMFCollection.DESCRIPTION_KEY: description,
SigMFCollection.AUTHOR_KEY: global_info["author"],
# SigMFCollection.LICENSE_KEY: "License",
# SigMFCollection.EXTENSIONS_KEY: global_info["extensions"],
SigMFCollection.STREAMS_KEY: [],
}
},
)
# save collection file
collection.tofile(collection_filepath)
print("")
print(collection_filepath + ".sigmf-collection")
def load_sigmf(filename: str, storage_path: str, scope: str):
"""
Loads metadata and data from SigMF file.
"""
# construct path
storage_path = os.path.expanduser(storage_path)
filepath = os.path.join(storage_path, filename)
# load SigMF file
signal = sigmf.sigmffile.fromfile(filepath)
# get metadata fields
global_metadata = signal.get_global_info()
annotations_metadata = signal.get_annotations()
# we only consider single annotations metadata element per SigMF file
annotation_start_idx = annotations_metadata[0][sigmf.SigMFFile.START_INDEX_KEY]
annotation_length = annotations_metadata[0][sigmf.SigMFFile.LENGTH_INDEX_KEY]
# get capture metadata
capture_metadata = signal.get_capture_info(annotation_start_idx)
# from source code: sigmffile.py
# "autoscale : bool, default True
# If dataset is in a fixed-point representation, scale samples from (min, max) to (-1.0, 1.0)
# raw_components : bool, default False
# If True read and return the sample components (individual I & Q for complex, samples for real)
# with no conversions or interleaved channels.""
# TODO: problem: raw_components flag is not used at all! changes in source code required!
# TODO: data is always converted to float32 after being read
# read actual data
data = signal.read_samples(
annotation_start_idx, annotation_length, autoscale=False, raw_components=True)
return data, global_metadata, annotations_metadata

View File

@@ -0,0 +1,150 @@
# /*
# * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
# * contributor license agreements. See the NOTICE file distributed with
# * this work for additional information regarding copyright ownership.
# * The OpenAirInterface Software Alliance licenses this file to You under
# * the OAI Public License, Version 1.1 (the "License"); you may not use this file
# * except in compliance with the License.
# * You may obtain a copy of the License at
# *
# * http://www.openairinterface.org/?page_id=698
# *
# * Unless required by applicable law or agreed to in writing, software
# * distributed under the License is distributed on an "AS IS" BASIS,
# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# * See the License for the specific language governing permissions and
# * limitations under the License.
# *-------------------------------------------------------------------------------
# * For more information about the OpenAirInterface (OAI) Software Alliance:
# * contact@openairinterface.org
# */
# ---------------------------------------------------------------------
# file common/utils/data_recording/lib/sync_service.py
# brief Sync service between captured Data from 5GNR gNB and UE
# author Abdo Gaber
# date 2025
# version 1.0
# company Emerson, NI Test and Measurement
# email:
# note
# warning
import struct
from lib import data_recording_messages_def
DEBUG_POW_MEAS_SYNC = True
# check if first frame ahead:
def is_frame_ahead(frame1, frame2, max_frame=1023):
"""
Check if frame1 is ahead of frame2, considering wrap-around from max_frame to 0.
Args:
frame1 (int): The first frame number.
frame2 (int): The second frame number.
max_frame (int): The maximum frame number before wrap-around. Default is 1023.
Returns:
bool: True if frame1 is ahead of frame2, False otherwise.
"""
# Calculate the difference considering wrap-around
diff = (frame1 - frame2 + (max_frame + 1)) % (max_frame + 1)
# If the difference is less than half the range, frame1 is ahead
return diff < (max_frame + 1) // 2
# find the frame and slot start
def find_frame_slot_start(dataset1_start, dataset2_start):
"""
Function to find the frame and slot start for data sync
Args:
dataset1_start_info: Dictionary containing the start information of dataset1
dataset2_start_info: Dictionary containing the start information of dataset2
Returns:
sync_info: Dictionary containing the sync information
sync_info["frame"] = frame_start
sync_info["slot"] = slot_start
"""
sync_info = {}
if dataset1_start["frame"] == dataset2_start["frame"]:
frame_diff = 0
frame_start = dataset1_start["frame"]
slot_start = max(dataset1_start["slot"], dataset2_start["slot"])
elif is_frame_ahead(dataset1_start["frame"], dataset2_start["frame"]):
frame_start = dataset1_start["frame"]
slot_start = dataset1_start["slot"]
frame_diff = (dataset1_start["frame"]- dataset2_start["frame"] + 1024) % 1024
elif is_frame_ahead(dataset2_start["frame"], dataset1_start["frame"]):
frame_start = dataset2_start["frame"]
slot_start = dataset2_start["slot"]
frame_diff = (dataset2_start["frame"] - dataset1_start["frame"] + 1024) % 1024
# check first if the delta time between the two datasets is larger than expected offset time.
# So, the sync will not be applied
# check during the calculation of the frame the ramp-around from 1023 to 0
if abs(frame_diff) > 6:
raise Exception(
f"Frame difference between dataset1 and dataset2 is too large: {frame_diff}. "
"This may indicate a problem with the data collection or synchronization."
)
# Determine the starting frame and slot for data sync
sync_info["frame"] = frame_start
sync_info["slot"] = slot_start
return sync_info
# Read data from gNB T-tracer Application
def get_frame_slot_start(shm_reading, bufIdx, general_msg_header_list,
general_message_header_length):
buf = shm_reading.read(bufIdx + general_message_header_length)
msg_id = struct.unpack("<H", buf[bufIdx: bufIdx + general_msg_header_list.get("msg_id")])[0]
bufIdx += general_msg_header_list.get("msg_id")
frame = struct.unpack("<H", buf[bufIdx: bufIdx + general_msg_header_list.get("frame")])[0]
bufIdx += general_msg_header_list.get("frame")
slot = struct.unpack("B", buf[bufIdx: bufIdx + general_msg_header_list.get("slot")])[0]
return frame, slot
# Sync data between gNB and UE
def sync_gnb_ue_captured_data(shm_reading_gnb, shm_reading_ue):
"""
Function to get the sync (frame, slot) data between gNB and UE
Args:
shm_reading_gnb: Shared memory for gNB
shm_reading_ue: Shared memory for UE
Returns:
sync_info: Dictionary containing the sync information between gNB and UE
sync_info["frame"] = frame_start
sync_info["slot"] = slot_start
"""
# get general message header list
general_msg_header_list, general_message_header_length = (
data_recording_messages_def.get_general_msg_header_list())
# Read data from gNB T-tracer Application
bufIdx = 0
frame_gnb, slot_gnb = get_frame_slot_start(
shm_reading_gnb, bufIdx, general_msg_header_list, general_message_header_length)
# Read data from UE T-tracer Application
bufIdx = 0
frame_ue, slot_ue = get_frame_slot_start(
shm_reading_ue, bufIdx, general_msg_header_list, general_message_header_length)
dataset1_start = {}
dataset1_start["frame"] = frame_gnb
dataset1_start["slot"] = slot_gnb
dataset2_start = {}
dataset2_start["frame"] = frame_ue
dataset2_start["slot"] = slot_ue
# Sync data between gNB and UE
# We noticed that the maximum difference between the frame number of gNB and UE is 3 frames
# Calculate the frame difference considering the wrap-around from 1023 to 0
sync_info = find_frame_slot_start(dataset1_start, dataset2_start)
print(" gNB Start info: ", dataset1_start)
print(" UE Start info: ", dataset2_start)
print(" gNB and UE Sync info: ", sync_info)
return sync_info

View File

@@ -0,0 +1,5 @@
sigmf==1.2.1
termcolor
bitarray
pandas
numpy==1.23

View File

@@ -0,0 +1,150 @@
# /*
# * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
# * contributor license agreements. See the NOTICE file distributed with
# * this work for additional information regarding copyright ownership.
# * The OpenAirInterface Software Alliance licenses this file to You under
# * the OAI Public License, Version 1.1 (the "License"); you may not use this file
# * except in compliance with the License.
# * You may obtain a copy of the License at
# *
# * http://www.openairinterface.org/?page_id=698
# *
# * Unless required by applicable law or agreed to in writing, software
# * distributed under the License is distributed on an "AS IS" BASIS,
# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# * See the License for the specific language governing permissions and
# * limitations under the License.
# *-------------------------------------------------------------------------------
# * For more information about the OpenAirInterface (OAI) Software Alliance:
# * contact@openairinterface.org
# */
# ---------------------------------------------------------------------
# file common/utils/data_recording/sync_validation_demo.py
# brief simple application to validate sync between payload captured on gNB and UE
# author Abdo Gaber
# date 2025
# version 1.0
# company Emerson, NI Test and Measurement
# email:
# note
# warning
import numpy as np
import os
import glob
import matplotlib.pyplot as plt
from lib import sigmf_interface
from lib import config_interface
import sigmf
def calculate_ber(capture_subdir: str, scope: str):
"""
Iteratively counts all bit errors from data and finally calculates the BER for a given Eb/N0.
"""
print("Start to calculate BER for subdirectory", capture_subdir)
# get all collection files in the specified directory
file_list = glob.glob(os.path.join(capture_subdir, "*.sigmf-collection"))
print("Found Collection files:", len(file_list))
bit_errors_total = 0
num_bits_total = 0
for idx, file in enumerate(file_list):
print("Processing file:", file)
# read SigMF collection file
collection_file = sigmf.sigmffile.fromfile(file)
print(" ")
print("Collection file:", file)
# extract filenames
stream_files = collection_file.get_stream_names()
print("Stream files:", stream_files)
# extract filename from list of streams
tx_bits_filename = next(
filename for filename in stream_files if "tx-payload-bits" in filename
)
rx_bits_ref_rx_real_ce_filename = next(
filename for filename in stream_files if "rx-payload-bits" in filename
)
# extract data and deserialized data (not used here)
tx_bits, _, _ = sigmf_interface.load_sigmf(
tx_bits_filename, capture_subdir, scope="tx-payload-bits"
)
rx_bits, _, rx_annotations = (
sigmf_interface.load_sigmf(
rx_bits_ref_rx_real_ce_filename, capture_subdir, scope="rx-payload-bits"
)
)
# calculate bit errors
bit_diffs = np.logical_xor(tx_bits, rx_bits)
bit_errors = np.count_nonzero(bit_diffs)
# increment total bit/symbol errors
print("Current bit errors:", bit_errors / len(tx_bits))
bit_errors_total += bit_errors
num_bits_total += len(tx_bits)
# plot "tx_bits" and "rx_bits_ref_rx_real_ce" for debugging purposes
# Calculate the differences
differences = np.array(tx_bits) - np.array(rx_bits)
# Plot TX and RX bits using a scatter plot
fig = plt.figure(figsize=(15, 6))
indices = np.arange(len(tx_bits))
plt.scatter(indices, tx_bits, label="TX bits", color="blue", marker="o", s=80)
plt.scatter(indices, rx_bits, label="RX bits", color="red", marker="x", s=80)
# Highlight differences
for i in range(len(differences)):
if differences[i] != 0:
plt.scatter(i, 1.1, color="red", marker="|", s=100)
plt.xlabel("Bit Index")
plt.ylabel("Bit Value")
plt.title(
"TX vs RX Bits, Record "
+ str(idx)
+ ", Number of bits mismatchs: "
+ str(bit_errors),
fontsize=16,
)
plt.legend()
plt.grid(True)
plt.ylim(-0.1, 1.2)
plt.xlim(200, 250)
plt.show(block=False)
# Sleep for a specified amount of time (e.g., 5 seconds)
plt.pause(6)
plt.close(plt.gcf()) # Close the figure
# Keep the script running to display the plots
# input("Press Enter to continue...")
# calculate BER
ber = bit_errors_total / num_bits_total
print("Total bit errors = ", ber)
def calculate_stats(main_config_file: str):
scope = "real-world"
print(f"Starting to generate statistics with data scope: {scope}")
# read main config
main_config = config_interface.read_main_config_file_json(main_config_file)
# get paths for recorded captures
capture_path = main_config["data_recording_config"]["data_storage_path"]
calculate_ber(capture_path, scope)
if __name__ == "__main__":
main_config = "/home/user/workarea/oai_recorded_data/config_data_recording_app.json"
# calculate BER stats
calculate_stats(main_config)

View File

@@ -1415,6 +1415,11 @@ uint32_t nr_timer_elapsed_time(const NR_timer_t *timer)
return timer->counter;
}
uint32_t nr_timer_remaining_time(const NR_timer_t *timer)
{
return timer->target - timer->counter;
}
void nr_timer_setup(NR_timer_t *timer, const uint32_t target, const uint32_t step)
{
timer->target = target;

View File

@@ -222,6 +222,12 @@ bool nr_timer_is_active(const NR_timer_t *timer);
* @return Time passed since start of timer
*/
uint32_t nr_timer_elapsed_time(const NR_timer_t *timer);
/**
* @brief To return how much time is left until the timer expires
* @param timer Timer to be checked
* @return Time left until the timer expires
*/
uint32_t nr_timer_remaining_time(const NR_timer_t *timer);
int set_default_nta_offset(frequency_range_t freq_range, uint32_t samples_per_subframe);
@@ -246,6 +252,12 @@ static __attribute__((always_inline)) inline int count_bits64(uint64_t v)
return __builtin_popcountll(v);
}
static __attribute__((always_inline)) inline int count_bits64_with_mask(uint64_t v, int start, int num)
{
uint64_t mask = ((1LL << num) - 1) << start;
return count_bits64(v & mask);
}
uint64_t reverse_bits(uint64_t in, int n_bits);
void reverse_bits_u8(uint8_t const* in, size_t sz, uint8_t* out);

View File

@@ -692,8 +692,8 @@ void run_telnetsrv(void) {
break;
}
if (telnetparams.telnetdbg > 0)
TELNET_LOG("Command received: readc %i filled %i \"%s\"\n", readc, filled, buf);
//if (telnetparams.telnetdbg > 0)
TELNET_LOG("Command received: readc %i filled %i \"%s\"\n", readc, filled, buf);
if (buf[0] == '!') {
if (buf[1] == '!') {

View File

@@ -42,7 +42,7 @@
#define TELNETSERVERCODE
#include "telnetsrv.h"
#define ERROR_MSG_RET(mSG, aRGS...) do { prnt(mSG, ##aRGS); return 1; } while (0)
#define ERROR_MSG_RET(mSG, aRGS...) do { prnt(mSG, ##aRGS); return -1; } while (0)
static int get_single_ue_rnti_mac(void)
{
@@ -136,6 +136,8 @@ int trigger_reestab(char *buf, int debug, telnet_printfunc_t prnt)
if (!RC.nrmac)
ERROR_MSG_RET("no MAC/RLC present, cannot trigger reestablishment\n");
int rnti = fetch_rnti(buf, prnt);
if (rnti < 0)
ERROR_MSG_RET("could not identify UE (no UE, no such RNTI, or multiple UEs)\n");
nr_rlc_test_trigger_reestablishment(rnti);
prnt("Reset RLC counters of UE RNTI %04x to trigger reestablishment\n", rnti);
return 0;
@@ -199,6 +201,8 @@ int force_ul_failure(char *buf, int debug, telnet_printfunc_t prnt)
if (!RC.nrmac)
ERROR_MSG_RET("no MAC/RLC present, force_ul_failure failed\n");
int rnti = fetch_rnti(buf, prnt);
if (rnti < 0)
ERROR_MSG_RET("could not identify UE (no UE, no such RNTI, or multiple UEs)\n");
NR_UE_info_t *UE = find_nr_UE(&RC.nrmac[0]->UE_info, rnti);
nr_mac_trigger_ul_failure(&UE->UE_sched_ctrl, UE->current_UL_BWP.scs);
return 0;
@@ -208,6 +212,8 @@ int force_ue_release(char *buf, int debug, telnet_printfunc_t prnt)
{
force_ul_failure(buf, debug, prnt);
int rnti = fetch_rnti(buf, prnt);
if (rnti < 0)
ERROR_MSG_RET("could not identify UE (no UE, no such RNTI, or multiple UEs)\n");
NR_UE_info_t *UE = find_nr_UE(&RC.nrmac[0]->UE_info, rnti);
NR_UE_sched_ctrl_t *sched_ctrl = &UE->UE_sched_ctrl;
sched_ctrl->ul_failure_timer = 2;
@@ -215,6 +221,21 @@ int force_ue_release(char *buf, int debug, telnet_printfunc_t prnt)
return 0;
}
static int get_current_bwp(char *buf, int debug, telnet_printfunc_t prnt)
{
int rnti = fetch_rnti(buf, prnt);
if (rnti < 0)
ERROR_MSG_RET("could not identify UE (no UE, no such RNTI, or multiple UEs)\n");
NR_UE_info_t *UE = find_nr_UE(&RC.nrmac[0]->UE_info, rnti);
int dl_bwp = UE->current_DL_BWP.bwp_id;
const char *dl_bwp_text = dl_bwp > 0 ? "dedicated" : "initial";
int ul_bwp = UE->current_UL_BWP.bwp_id;
const char *ul_bwp_text = ul_bwp > 0 ? "dedicated" : "initial";
prnt("UE %04x DL BWP ID %d (%s) UL BWP ID %d (%s)\n", UE->rnti, dl_bwp, dl_bwp_text, ul_bwp, ul_bwp_text);
return 0;
}
static telnetshell_cmddef_t cicmds[] = {
{"get_single_rnti", "", get_single_rnti},
{"force_reestab", "[rnti(hex,opt)]", trigger_reestab},
@@ -223,6 +244,7 @@ static telnetshell_cmddef_t cicmds[] = {
{"force_ul_failure", "[rnti(hex,opt)]", force_ul_failure},
{"trigger_f1_ho", "[rrc_ue_id(int,opt)]", rrc_gNB_trigger_f1_ho},
{"fetch_du_by_ue_id", "[rrc_ue_id(int,opt)]", fetch_du_by_ue_id},
{"get_current_bwp", "[rnti(hex,opt)]", get_current_bwp},
{"", "", NULL},
};

View File

@@ -120,7 +120,7 @@ static bool setInterfaceParameter(int sock_fd, const char *ifn, int af, const ch
{
DevAssert(af == AF_INET || af == AF_INET6);
struct ifreq ifr = {0};
strncpy(ifr.ifr_name, ifn, sizeof(ifr.ifr_name));
strncpy(ifr.ifr_name, ifn, sizeof(ifr.ifr_name) - 1);
struct in6_ifreq ifr6 = {0};
void *ioctl_opt = NULL;
@@ -167,7 +167,7 @@ static bool change_interface_state(int sock_fd, const char *ifn, if_action_t if_
const char *action = if_action == INTERFACE_DOWN ? "DOWN" : "UP";
struct ifreq ifr = {0};
strncpy(ifr.ifr_name, ifn, sizeof(ifr.ifr_name));
strncpy(ifr.ifr_name, ifn, sizeof(ifr.ifr_name) - 1);
/* get flags of this interface: see netdevice(7) */
bool success = ioctl(sock_fd, SIOCGIFFLAGS, (caddr_t)&ifr) == 0;

View File

@@ -41,12 +41,12 @@ PTP enabled switches and grandmaster clock we have tested with:
These are the radio units we've used for testing:
| Vendor | Software Version |
|-------------|------------------|
| Foxconn RPQN-7801E RU | 2.6.9r254 |
| Foxconn RPQN-7801E RU | 3.1.15_0p4 |
| Foxconn RPQN-7801E RU | v3.2.0q.551.12.E.rc2.srs-AIO |
| Vendor | Software Version |
|-----------------------|-----------------------------|
| Foxconn RPQN-7801E RU | 2.6.9r254 |
| Foxconn RPQN-7801E RU | 3.1.15_0p4 |
| Foxconn RPQN-7801E RU | 3.2.0q.551.12.E.rc2.srs-AIO |
| WNC R1220-078LE | 1.9.0 |
The UEs that have been tested and confirmed working with Aerial are the following:
@@ -80,7 +80,7 @@ To set up the L1 and install the components manually refer to this [instructions
| Applicative Threads | Allocated CPUs |
|------------------------|----------------|
| PTP & PHC2SYS Services | 41 |
| OAI `nr-softmodem` | 13-20 |
| OAI `nr-softmodem` | 13-14 |
## PTP configuration
@@ -230,10 +230,10 @@ After preparing the L1 software, the container needs to be committed to create a
In this file the RU MAC address needs to be specified before commiting the image.
```bash
~$ docker commit nv-cubb cubb-build:24-3
~$ docker commit nv-cubb cubb-build:25-1
~$ docker image ls
..
cubb-build 24-3 824156e0334c 2 weeks ago 23.9GB
cubb-build 25-1 824156e0334c 2 weeks ago 23.9GB
-..
```

View File

@@ -389,8 +389,8 @@ into the RLC via `enqueue_rlc_data_req()`, or (f1ap) sends a GTP message
through the GTP API.
In the DU in DL, assuming the GTP-U tunnel exists, GTP decapsulates the packet
and calls the reception call back `du_rlc_data_req()`, which calls
`enqueue_rlc_data_req()` in turn.
and calls the reception call back `nr_rlc_data_req()`, which enqueues the
packet into the UE's RLC buffer.
## Tunnel Setup

View File

@@ -139,6 +139,10 @@ These modes of operation are supported:
- evaluation of CQI report
- MAC scheduling of SR reception
- Intra-frequency handover
- Inter-frequency handover
- Measurement gaps are automatically computed at the DU if the CU has neighbor information and the configured
neighbors include cells operating on different frequencies
- DUs must be synchronized with each other for the measurements to be properly performed
- Initial support for RedCap
- Scheduling of SIBs (2, 19)

View File

@@ -218,8 +218,8 @@ In the `MACRLCs` section of the gNB/DU configuration file:
`ulsch_max_frame_inactivity`) or after scheduling request (SR)
* `identity_precoding_matrix` (default 0=false): flag to enable to use only
the identity precoding matrix in DL precoding
* `set_analog_beamforming` (default 0=false): flag to enable analog
beamforming (for more information [`analog_beamforming.md`](../analog_beamforming.md))
* `set_timedomain_beamforming` (default 0=false): flag to enable time domain
beamforming (for more information [`time_domain_beamforming.md`](../time_domain_beamforming.md))
* `beam_duration` (default 1): duration/number of consecutive slots for a given set of
beams, depending on hardware switching performance
* `beams_per_period` (default 1): set of beams that can be simultaneously allocated in a

View File

@@ -1,53 +1,90 @@
# global
This document describes the broad way in which the VNF and PNF work internally,
from configuration, to P5 and P7 message exchange and processing.
Their internal processing is broadly independent on which transport mechanism
is responsible for exchanging data between the 2 components.
xnf is pnf or vnf
To read more about the transport mechanisms available, and how to run the split, please refer to
[this file](./nfapi.md).
The xnf starting functions are configure_nfapi_xnf()
[[_TOC_]]
The OAI code that read the configuration parameters call these functions that will create autonomous thread for xnf control part
# VNF/PNF Split
These control threads create a SCTP socket by Linux API call (no use of OpenAir internal architecture with SCTP itti thread).
The gNB is split into VNF(L2+) and PNF(L1)
The main() function of softmodem has to create and start the other threads+loop on event for appropriate work: RF Rx in pnf, NGAP, GTP-U, X2, RLC, PDCP for vnf
These component are configured via the functions:
NFAPI has it's own code directly on Linux+Posix, it doesn't reuse any piece of the OpenAir framework: SCTP thread, thread creation and management, ...
- configure_nr_nfapi_vnf()
- configure_nr_nfapi_pnf()
## signaling (P5) xnf main loop
These functions initialize the configuration appropriate for the transport mechanism selected ( setting the
pack/unpack function pointers, as well as the appropriate send functions )
nfapi_vnf_start() create the SCTP socket, then do event waiting in a infinite loop while(vnf->terminate == 0). It accepts the pnf connections, then process the messages on reception
After this, a thread is created for the P5 receive loop, which initializes the transport and receive loop
nfapi_pnf_start() initiate connection to vnf until it has a link. Then it enter a similar infinite loop in pnf_message_pump()
This created thread may be only for P5 messages, or P5 and P7, depending on the transport type
After some checks, when a message is obtained, it calls pnf_handle_p5_message() or vnf_handle_p4_p5_message() that have a switch on each p5 message types: the enum nfapi_message_id_e
- When using socket-based communication (which uses nFAPI encoding), the receiving loop for P7 messages is separate from
P5, it starts upon the PNF_START exchange
- In the other transport mechanisms (WLS and nvIPC, which use FAPI encoding), the receiving loop is the same for P5 and
P7 messages, the P7 configuration is done immediately after the P5 configuration.
Since the first P7 messages is only sent/received after the START exchange, we can logically treat the loops as separate
, we won't receive P7 messages before finishing the P5 ones ( except for the STOP exchange )
## P5 interface main loop
After the P5 configuration, both the VNF and PNF have a thread waiting to "consume" (n)FAPI messages exchanged between
them
Upon the reception of a message (whether in its entirety or segmented in the case of nFAPI), the messages are sent to
the appropriate handler:
- pnf_nr_handle_p5_message
- vnf_nr_handle_p4_p5_message
In each of these functions, there's a switch calling the appropriate handler according to the message ID, for example:
Each message type has it's own processing function in the switch, like
```
case NFAPI_START_RESPONSE:
vnf_handle_start_response(pRecvMsg, recvMsgLen, config, p5_idx);
break;
case NFAPI_NR_PHY_MSG_TYPE_START_RESPONSE:
vnf_nr_handle_start_response(pRecvMsg, recvMsgLen, config, p5_idx);
break;
```
These loops are autonomous in their thread waiting incoming message.
## P7 xnf main loop
## P7 interface main loop
When the p5 interface receives appropriate message, it starts the p7 interface by launching a thread (see the calls to pthread_create() in nfapi/oai_integration/nfapi_xnf.c)
- Note: As explained before, the P7 reception loop is the same as the P5 messages when not using socket-based
communication
The p7 main loops starting is a bit simpler, thanks to UDP non connected protocol. The xnf_dispatch_p7_message() do p7 fragments re-assembly, then
calls xnf_dispatch_p7_message() that have the big switch on message type (as in p5 above description)
In this case, when the P5 interface receives appropriate message, it starts the p7 interface by launching a thread
So, we have the logic for UL reception in vnf, and DL reception in pnf
- On the PNF, this is done in the START.request handler ( nr_start_request(...) )
- On the VNF, this is done in ( configure_nr_p7_vnf(...) )
Much in the same way as when processing P5 messages, the following functions are called to unpack and process them:
- pnf_nr_handle_p7_message
- vnf_nr_handle_p7_message
```
case NFAPI_NR_PHY_MSG_TYPE_SLOT_INDICATION:
vnf_handle_nr_slot_indication(pRecvMsg, recvMsgLen, vnf_p7);
break;
```
## P7 UL transmission by PNF
RF samples are received, and decoding is done by the PNF using control data transmitted by the VNF to the PNF through downlink p7 messages (UL_TTI_req and UL_DCI_req).
RF samples are received, and decoding is done by the PNF using control data transmitted by the VNF to the PNF through
downlink p7 messages (UL_TTI.request and UL_DCI.request).
After decoding, results are accumulated into the xNB->UL_INFO structure at the PNF.
After decoding, results are accumulated into the gNB->UL_INFO structure at the PNF.
The data in the UL_INFO struct is transmitted through a socket in the form of 'uplink indication functions' from the PNF to the VNF. Each uplink indication message is transmitted from their respective handle functions in NR_UL_indication(). For example,
The data in the UL_INFO struct is transmitted through the configured send function pointer (send_p7_msg), which packs
the message into a buffer according to the encoding and sends it to the VNF
```
void handle_nr_rach(NR_UL_IND_t *UL_info) {
if(NFAPI_MODE == NFAPI_MODE_PNF) {
if (UL_info->rach_ind.number_of_pdus>0) {
@@ -56,67 +93,186 @@ void handle_nr_rach(NR_UL_IND_t *UL_info) {
}
}
```
....
## P7 UL reception at VNF
int oai_nfapi_nr_rach_indication(nfapi_nr_rach_indication_t *ind) {
ind->header.phy_id = 1; // HACK TODO FIXME - need to pass this around!!!!
ind->header.message_id = NFAPI_NR_PHY_MSG_TYPE_RACH_INDICATION;
return nfapi_pnf_p7_nr_rach_ind(p7_config_g, ind);
}
Through the infinite loop [while(vnf_p7->terminate == 0)] running in nfapi_nr_vnf_p7_start(), the VNF receives and unpacks the uplink indication message received on its socket. Based on the unpacked messages, UL_INFO struct on the VNF side gets populated.
.....
```
// have a p7 message
if(FD_ISSET(vnf_p7->socket, &rfds))
{
vnf_nr_p7_read_dispatch_message(vnf_p7);
}
```
vnf_nr_dispatch_p7_message() is the function that contains the switch on various message headers so that the appropriate unpack function is called.
## P7 DL Transmission by VNF
DL messages are scheduled at the VNF, through NR_UL_indication(). NR_UL_indication() is called when the SFN/slot in the UL_info structure changes (this acts as a trigger for next slot processing, instead of running a separate clock at the VNF). The SFN/slot at the VNF in UL_info is updated using the slot_indication uplink p7 message, which is sent at the beginning of every slot by the PNF. The slot_indication message contains SFN/slot of the TX_thread, so that the scheduler operates slot_ahead slots ahead of the RX thread. This ensures that UL_tti_req is received before RX slot processing at the PNF.
The function NR_schedule_response calls oai_nfapi_[DL P7 msg]_req(), which contains the routines for packing + transmission of scheduled messages through the socket to the PNF. For example, to send the 'TX_data_req' p7 message
```
if (Sched_INFO->TX_req->Number_of_PDUs > 0)
int nfapi_pnf_p7_nr_rach_ind(nfapi_pnf_p7_config_t* config, nfapi_nr_rach_indication_t* ind)
{
oai_nfapi_tx_data_req(Sched_INFO->TX_req);
if(config == NULL || ind == NULL)
{
NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: invalid input params\n", __FUNCTION__);
return -1;
}
pnf_p7_t* _this = (pnf_p7_t*)(config);
AssertFatal(_this->_public.send_p7_msg, "Function pointer must be configured|");
return _this->_public.send_p7_msg(_this, (nfapi_nr_p7_message_header_t*)ind, sizeof(nfapi_nr_rach_indication_t));
}
```
## P7 UL reception at VNF
Through the P7 reception loop, the VNF receives a buffer containing the messages, which it handles by the following
process:
- Unpack the header by use of the hdr_unpack_func function pointer
- According to the Message ID in the header, send the buffer to the appropriate handler by use of a switch statement:
```
case NFAPI_NR_PHY_MSG_TYPE_SLOT_INDICATION:
vnf_handle_nr_slot_indication(pRecvMsg, recvMsgLen, vnf_p7);
break;
```
- In the handler function, unpack the entire message, by using the unpack_func function pointer.
- If the unpack procedure is successful, call the previously configure callback for that message type:
```
nfapi_nr_slot_indication_scf_t ind = {0};
const bool result = vnf_p7->_public.unpack_func(pRecvMsg, recvMsgLen, &ind, sizeof(ind), &vnf_p7->_public.codec_config);
if(!result)
{
NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: Failed to unpack message\n", __FUNCTION__);
}
else
{
NFAPI_TRACE(NFAPI_TRACE_DEBUG, "%s: Handling NR SLOT Indication\n", __FUNCTION__);
if(vnf_p7->_public.nr_slot_indication)
{
(vnf_p7->_public.nr_slot_indication)(&ind);
}
free_slot_indication(&ind);
}
```
vnf_nr_dispatch_p7_message() is the function that contains the switch on various message headers so that the appropriate
unpack function is called.
## P7 DL Transmission by VNF
DL messages are scheduled at the VNF, through gNB_dlsch_ulsch_scheduler(). gNB_dlsch_ulsch_scheduler() is called when
handling a SLOT.indication message in trigger_scheduler().
The function trigger_scheduler(nfapi_nr_slot_indication_scf_t *slot_ind) calls the functions oai_nfapi_[DL P7 msg]_
req(), calling in turn call the send_p7_msg function pointer, which contain the logic to pack the message into a buffer
and send it to the PNF.
Finally, NR_UL_indication is called to process the other P7 messages received from the PNF that were put in theire
respective queues.
For example, the TX_DATA.request message is sent in the following manner:
```
if (g_sched_resp.TX_req.Number_of_PDUs > 0)
oai_nfapi_tx_data_req(&g_sched_resp.TX_req);
...
int oai_nfapi_tx_data_req(nfapi_nr_tx_data_request_t *tx_data_req)
{
LOG_D(NR_PHY, "Entering oai_nfapi_nr_tx_data_req sfn:%d,slot:%d\n", tx_data_req->SFN, tx_data_req->Slot);
nfapi_vnf_p7_config_t *p7_config = vnf.p7_vnfs[0].config;
tx_data_req->header.phy_id = 1; // HACK TODO FIXME - need to pass this around!!!!
tx_data_req->header.message_id = NFAPI_NR_PHY_MSG_TYPE_TX_DATA_REQUEST;
//LOG_D(PHY, "[VNF] %s() TX_REQ sfn_sf:%d number_of_pdus:%d\n", __FUNCTION__, NFAPI_SFNSF2DEC(tx_req->sfn_sf), tx_req->tx_request_body.number_of_pdus);
bool retval = nfapi_vnf_p7_tx_data_req(p7_config, tx_data_req);
if (!retval) {
LOG_E(PHY, "%s() Problem sending retval:%d\n", __FUNCTION__, retval);
} else {
tx_data_req->Number_of_PDUs = 0;
}
return retval;
}
...
bool nfapi_vnf_p7_tx_data_req(nfapi_vnf_p7_config_t* config, nfapi_nr_tx_data_request_t* req)
{
if(config == 0 || req == 0)
return -1;
vnf_p7_t* vnf_p7 = (vnf_p7_t*)config;
AssertFatal(config->send_p7_msg, "Function pointer must be configured|");
return config->send_p7_msg(vnf_p7, &req->header);
}
```
## VNF functional flowchart
```mermaid
graph TD
pselect[VNF socket pselect] -- timed out : end of slot --> call_sched[Call Scheduler NR_UL_indication] -- oai_nfapi_***_req sends the DL p7 msg--> slot_inc[Increment sfn/slot];
pselect[VNF socket pselect] -- UL p7 xyz msg recvd --> msg_recvd[Read message vnf_nr_p7_read_dispatch_message] --> header_unpack[Unpack Header] -- switch cases on header --> unpack_msg[Handle Message vnf_handle_nr_xyz] --> fill_ul_info[Fill UL info struct with fn pointer vnf_p7->_public.nr_rx_xyz];
fill_ul_info -- update pselect_timeout: next_slot_start - time_xyz_msg_recvd-->pselect;
slot_inc -- next slot --> pselect
softmodem_start[nr-softmodem init] --> P5_configuration[configure_nr_nfapi_vnf] --> transport_init[Transport mechanism init] --> send_first_msg[Send first P5 message to PNF]
transport_init[Transport mechanism init] --> P5_recv_loop[P5 receive loop] -- P5 Message processing --> P5_recv_loop[P5 receive loop]
P5_recv_loop[P5 receive loop] -- Start.response callback called --> P7_config[P7 Configuration] --> P7_loop[P7 Loop] --> P7_msg_recv[P7 message received] --> call_vnf_handle_p7[Call vnf_nr_handle_p7_msg] --> hdr_unpack[Unpack header] --> call_specific_p7_handler[Call specific P7 message handler] --> slot_ind[Is a SLOT.indication?] -- Yes --> trig_scheduler[Call trigger_scheduler] --> gNB_ulsch_dlsch_sched[Call gNB_dlsch_ulsch_scheduler] --> send_p7_dl[Process and send P7 messages to PNF] --> call_ul_ind[Call NR_UL_indication] --> proc_p7[Process P7 messages in queue] --> P7_loop[P7 Loop]
slot_ind[Is a SLOT.indication?] -- No --> put_queue[Put message in queue] --> P7_loop[P7 Loop];
```
Note that since DL P7 message reception and TX/RX processing are done on separate threads, there is the issue of the L1 processing threads trying to do their job before the required P7 message is received. In the case of RX processing, since the scheduler operates slot_ahead slots ahead of the RX thread, the required messages conveniently arrive earlier than they are required. However, in the case of TX processing, this cannot be ensured if the scheduler is exactly in sync with the TX thread.
Therefore, we operate the VNF vnf_slot_ahead (which is currently 2) slots ahead of the PNF. This is to ensure that the DL fapi structures for a particular TX slot are all received before TX processing for that slot.
## P7 DL Reception at PNF
## P7 DL Reception at PNF
Through the infinite loop [while(pnf_p7->terminate == 0)] running in pnf_nr_p7_message_pump(), the PNF receives and
unpacks the downlink P7 message received on its socket. Based on the unpacked message, the appropriate message
structures are filled in the PNF, and these are used further down the pipeline for processing.
Through the P7 reception loop, the PNF receives a buffer containing a P7 message from the VNF, which it processes the
following way:
Through the infinite loop [while(pnf_p7->terminate == 0)] running in pnf_nr_p7_message_pump(), the PNF receives and unpacks the downlink P7 message received on its socket. Based on the unpacked message, the appropriate message structures are filled in the PNF, and these are used further down the pipeline for processing.
- Unpack the header by use of the hdr_unpack_func function pointer
- According to the Message ID in the header, send the buffer to the appropriate handler by use of a switch statement:
While receiving the DL P7 message, we check whether the message was received within a timing window from which it was sent. The duration of the window can be set by the user (set as a parameter for xnf in the p5 messages). Note that the DL information must be received by the PNF within a timing window at least lesser than the duration of slot_ahead variable (timing_window <= slot_ahead * slot_duration).
```
case NFAPI_NR_PHY_MSG_TYPE_DL_TTI_REQUEST:
pnf_handle_dl_tti_request(pRecvMsg, recvMsgLen, pnf_p7);
break;
```
- In the handler function, the SFN and Slot are peeked from the message
- The SFN and slot are checked to determine if the message is inside the appropriate timing window
- If so, the message is unpacked into the P7 Slot buffer:
```
pnf_p7->slot_buffer[buffer_index].sfn = frame;
pnf_p7->slot_buffer[buffer_index].slot = slot;
nfapi_nr_dl_tti_request_t *req = &pnf_p7->slot_buffer[buffer_index].dl_tti_req;
pnf_p7->nr_stats.dl_tti.ontime++;
NFAPI_TRACE(NFAPI_TRACE_DEBUG,
"POPULATE DL_TTI_REQ current tx sfn/slot:%d.%d p7 msg sfn/slot: %d.%d buffer_index:%d\n",
pnf_p7->sfn,
pnf_p7->slot,
frame,
slot,
buffer_index);
const bool result = pnf_p7->_public.unpack_func(pRecvMsg, recvMsgLen, req, sizeof(*req), &(pnf_p7->_public.codec_config));
```
- The messages are later processed in the NR_slot_indication function, which is called in the tx_func function (
L1_tx_thread )
## PNF functional flowchart
```mermaid
graph TB
pselect[PNF socket pselect] -- timed out : end of slot --> slot_inc[Increment sfn/slot];
pselect[PNF socket pselect] -- DL p7 xyz msg recvd --> msg_recvd[Read message pnf_nr_nfapi_p7_read_dispatch_message] --> header_unpack[Unpack Header] -- switch cases on header --> unpack_msg[Unpack Message pnf_handle_nr_xyz] --> fill_pnf_p7[Fill pnf_p7 global structure pnf_handle_nr_xyz] --Data from pnf_p7 struct copied to fapi structures using pnf_phy_***_req. Called every slot from handle_nr_slot_ind-->pselect;
slot_inc -- next slot --> pselect
graph TD
softmodem_start[nr-softmodem init] --> init_l1_tx_thread[Init L1 TX Thread] --> tx_func[Call tx_func] --> nr_slot_ind[Call NR_slot_indication] --> pnf_slot_ind[Call handle_nr_slot_ind] --> send_slot_ind[Send SLOT.ind to VNF] --> get_from_slot_buffer[Get P7 messages from slot_buffer] --> proc_p7_dl[Process P7 messages from VNF] --> tx_func
softmodem_start[nr-softmodem init] --> init_l1_rx_thread[Init L1 RX Thread] --> rx_func[Call rx_func] --> nr_ul_ind[Call NR_UL_indication] --> send_p7_vnf[Send P7 messages to VNF] --> rx_func
softmodem_start[nr-softmodem init] --> P5_configuration[configure_nr_nfapi_pnf] --> transport_init[Transport mechanism init] --> p5_loop[P5 Loop] -- Process P5 messages --> p5_loop
p5_loop -- START.request callback called --> p7_config[P7 Configuration] --> l1_north_init_gnb[Call l1_north_init_gNB] --> nr_if_module_init[Call NR_IF_Module_Init] --> install_slot_ind_cb[Install NR_slot_indication callback]
p7_config[P7 Configuration] --> p7_loop[P7 Loop] --> p7_recv[Receive P7 message] --> pnf_handle_p7[Call pnf_nr_handle_p7_message] --> hdr_unpack[Unpack header with hdr_unpack] --> p7_handler[Call pnf_handle_<msg_type>] --> peek_sfn[Peek SFN/Slot and check if in timing window] --> p7_unpack[Unpack message into slot_buffer] --> p7_loop
```
Once the messages are received, they are filled into slot buffers, and are stored until the processing of the slot that they were meant for.

View File

@@ -57,7 +57,7 @@ There is some general information in the [OpenAirInterface Gitlab Wiki](https://
- [How to use the L2 simulator](./L2NFAPI.md)
- [How to use the OAI channel simulator](../openair1/SIMULATION/TOOLS/DOC/channel_simulation.md)
- [How to use multiple BWPs](./RUN_NR_multiple_BWPs.md)
- [How to run OAI-VNF and OAI-PNF](./nfapi.md): how to run the nFAPI split,
- [How to run OAI-VNF and OAI-PNF](./nfapi.md): how to run the FAPI/nFAPI split,
including some general remarks on FAPI/nFAPI.
- [How to use the positioning reference signal (PRS)](./RUN_NR_PRS.md)
- [How to use device-to-device communication (D2D, 4G)](./d2d_emulator_setup.txt)
@@ -85,7 +85,7 @@ Legacy unmaintained files:
- [L1 threads in NR-UE](./nr-ue-design.md)
- [Information on gNB MAC](./MAC/mac-usage.md)
- [Information on gNB RRC](./RRC/rrc-usage.md)
- [Information on analog beamforming implementation](./analog_beamforming.md)
- [Information on time domain beamforming implementation](./time_domain_beamforming.md)
- [Information on the UE 5G NAS implementation](./5Gnas.md)
# Building and running from images

View File

@@ -291,7 +291,7 @@ Note that while 38.331 requires only one RRC transaction to happen at a time,
the 5G RRC does not actually ensure this; it only tries to prevent it by
chaining of transactions and some checks. For instance, the Security Mode
procedure is followed by a UE capability procedure, and some procedures are not
executed if others are ongoing (ex.: handover if there is reconfiguratio).
executed if others are ongoing (ex.: handover if there is reconfiguration).
However, it might be possible to trigger a procedure while another is ongoing.
As of now, no queueing mechanims exists to ensure only one operation is
@@ -303,7 +303,7 @@ Handover-related data is stored in a per-UE structure of type
`nr_handover_context_t`. It is a pointer and only set during handover
operation. This data structure has in turn two pointers, one to the source CU
(`nr_ho_source_cu_t`), and one to the target CU (`nr_ho_target_cu_t`). In F1,
both are present. In N2 and Xn, only one pointer is supposed to be set a the
both are present. In N2 and Xn, only one pointer is supposed to be set at the
corresponding CU.
`nr_ho_source_cu_t` contains notably a function pointer `ho_cancel` for

View File

@@ -23,6 +23,7 @@
| matix | Matix | gNB (n77) | N310 |
| gracehopper1-oai | Gracehopper1 | gNB (n78, PNF/Nvidia CUBB + VNF) | Foxconn RU, _Nvidia Aerial integration_ |
| gracehopper3-oai | Gracehopper3 | build | -- |
| acamas | Acamas | 4G and 5G rfsimulator| -- |
Note: The available resources, and their current usage, is indicated here:
- [Lockable resources of jenkins-oai](https://jenkins-oai.eurecom.fr/lockable-resources/):
@@ -178,11 +179,11 @@ information on how the images are built.
- see [`./physical-simulators.md`](./physical-simulators.md) for an overview
- [RAN-RF-Sim-Test-4G](https://jenkins-oai.eurecom.fr/job/RAN-RF-Sim-Test-4G/)
~4G-LTE
- cacofonix (eNB, lteUE, OAI EPC)
- acamas (eNB, lteUE, OAI EPC)
- uses RFsimulator, for FDD 5, 10, 20MHz with core, 5MHz noS1
- [RAN-RF-Sim-Test-5G](https://jenkins-oai.eurecom.fr/job/RAN-RF-Sim-Test-5G/)
~5G-NR ~nrUE
- cacofonix (gNB, nrUE, OAI 5GC)
- acamas (gNB, nrUE, OAI 5GC)
- uses RFsimulator, TDD 40MHz, FDD 40MHz, F1 split
- [RAN-SA-AW2S-CN5G](https://jenkins-oai.eurecom.fr/job/RAN-SA-AW2S-CN5G/)
~5G-NR

488
doc/data_recording.md Normal file
View File

@@ -0,0 +1,488 @@
# Synchronized Real-Time Data Recording Application
The Data Recording Application runs in parallel to the system components on one of the LINUX servers. It makes use of OAI T-tracer framework. It is able to communicate with the Base station (gNB) and User terminal (UE).
In addition, it synchronizes and combines data traces and control information (metadata) from Base station and User terminal into consistent [Signal Metadata Format (SigMF) format](https://github.com/gnuradio/SigMF) data sets. SigMF is an open-source standard that specifies a way to describe sets of recorded digital signal samples with metadata (data properties and scenario descriptions) provided in [JSON](http://www.json.org/) files. These recorded data sets have a wide range of uses in research and applications.
## Data Recording Application Architecture
Data Recording Application designed to have multiple services in different simulation environments:
- Data Control Service (Python)
- Data collection (T-Tracer) Service (C)
- Data Conversion Service (Python)
Regarding to the APIs between different services, they are such as the following:
- Data Control Service -> Data Collection (TTracer) Service: The API is based on a shared memory.
- Data Collection (TTracer) Service -> 5G NR Stack: T-Tracer Framework, ethernet connection.
- Data Collection (TTracer) Service -> Data Conversion Service: The API is based on a shared memory.
The following figure shows OAI gNB and UE with the Data Recording App system architecture.
<img src="images/data_recording_arch.svg" alt="OAI gNB and UE with the Data Recording App system architectur" width="1000">
## Required Packages
Install all required system packages with the following commands:
```bash
sudo apt-get update
sudo apt-get install -y python3-sysv-ipc libxft-dev
```
Then, install all required python packages with the following commands:
```bash
python3 -m pip install sigmf==1.2.1 termcolor bitarray pandas numpy==1.23
```
User can install all required python packages also using the `requirements.txt` file:
```bash
python3 -m pip install -r common/utils/data_recording/requirements.txt
```
## Configuration Files
### Main Data Recording JSON Configuration File
The Data Recording application provides configuration file in [JSON](http://www.json.org/) format. It is stored in [common/utils/data_recording/config/config_data_recording.json](../common/utils/data_recording/config/config_data_recording.json) folder. The main parameters are:
- **data_storage_path**: Path to directory for data storage
- **num_records**: Number of requested data records in slots
- **t_tracer_message_definition_file**: T-Tracer message definition file
- **parameter_map_file**: Parameter mapping dictionary (OAI parameters to standardized metadata). It is located here: [common/utils/data_recording/config/wireless_link_parameter_map.yaml](../common/utils/data_recording/config/wireless_link_parameter_map.yaml)
- **start_frame_number**: It can be used to start the recording from a specific frame, but it is not yet supported.
- **base_station**:
- requested_tracer_messages: Requested base station data traces. The supported messages are:
- GNB_PHY_UL_FD_PUSCH_IQ
- GNB_PHY_UL_FD_DMRS
- GNB_PHY_UL_FD_CHAN_EST_DMRS_POS
- GNB_PHY_UL_FD_CHAN_EST_DMRS_INTERPL
- GNB_PHY_UL_PAYLOAD_RX_BITS
- meta_data: Additional base station metadata (additional fixed base station parameters that cannot be read from the system yet, but shall be included into the SigMF metadata)
- **user_equipment**
- requested_tracer_messages: Requested user equipment data traces. The supported messages are:
- UE_PHY_UL_SCRAMBLED_TX_BITS
- UE_PHY_UL_PAYLOAD_TX_BITS
- meta_data: Additional user equipment metadata (additional fixed UE parameters that are not read from the system yet, but shall be included into the SigMF metadata)
- **common_meta_data**: Common metadata parameters that are not read from the system yet, but shall be included into the SigMF metadata such as the sampling rate, the bandwidth, and the clock reference of USRP.
- **tracer_service_baseStation_address**: The IP address and port number of base station server. If the Data Recording App and the Data Collection (TTracer) Service are running on the same server of base station, the IP address and port number are : `127.0.0.1:2021`
- **tracer_service_userEquipment_address**: The IP address and port number of UE server.
**Notes**:
- The data can be recorded from base station and UE or from base station only or UE only. To disable the recording from any station, make the list of `requested_tracer_messages` empty such as: `requested_tracer_messages:[]`
The figure below illustrates an example of a JSON Data Recording App configuration file.
```json
{
"data_recording_config": {
"data_storage_path": "/home/user/workarea/oai_recorded_data/",
"data_file_format": "SigMF",
"enable_saving_tracer_messages_sigmf": true,
"num_records": 5,
"t_tracer_message_definition_file": "../T/T_messages.txt",
"parameter_map_file": "config/wireless_link_parameter_map.yaml",
"start_frame_number": 5,
"base_station": {
"requested_tracer_messages": [
"GNB_PHY_UL_FD_PUSCH_IQ",
"GNB_PHY_UL_FD_DMRS",
"GNB_PHY_UL_FD_CHAN_EST_DMRS_POS",
"GNB_PHY_UL_FD_CHAN_EST_DMRS_INTERPL",
"GNB_PHY_UL_PAYLOAD_RX_BITS"
],
"meta_data":{
"num_rx_antennas": 1,
"tx_gain": 48.0,
"rx_gain": 30.0,
"hw_type": "USRP X410",
"hw_subtype": "ZBX",
"seid": "328AB35"
}
},
"user_equipment": {
"requested_tracer_messages": [
"UE_PHY_UL_SCRAMBLED_TX_BITS",
"UE_PHY_UL_PAYLOAD_TX_BITS"
],
"meta_data":{
"num_tx_antennas": 1,
"tx_gain": 48.0,
"rx_gain": 40.0,
"hw_type": "USRP X410",
"hw_subtype": "ZBX",
"seid": "323F75F"
}
},
"common_meta_data": {
"sample_rate": 61440000.0,
"bandwidth": 40000000.0,
"clock_reference": "external"
},
"tracer_service_baseStation_address": "127.0.0.1:2021",
"tracer_service_userEquipment_address": "127.0.0.1:2023"
}
}
```
### Wireless Link Parameter Map Dictionary
Since every signal recorder has related configuration with different naming scheme, the [common/utils/data_recording/config/wireless_link_parameter_map.yaml](../common/utils/data_recording/config/wireless_link_parameter_map.yaml) is a dictionary to do the parameters pair between the signal configuration and the SigMF metadata (e.g. OAI parameter name vs. SigMF metadata parameter name). It eases of adoption in case of adding new parameters. In case of changing the name of given parameters in OAI and we need to get those parameters in metadata, the required changes need to be done in the parameter map dictionary.
The following figure shows an example of Wireless Link Parameter Map Dictionary. For example, the frequency range is called in standardized SigMF metadata `frequency_range` while it is called in OAI `freq_range` and it is called in NI 5G NR RFmx `frequency range`.
```yaml
# Frequency Range
- sigmf_parameter_name: "frequency_range"
description: "Frequency Range"
5gnr_ni_rfmx_rfws_parameter:
name: "Frequency Range"
value_map: # simu value : SigMF value
"Range 1": "fr1"
"Range 2": "fr2"
5gnr_oai_parameter:
name: "freq_range"
value_map: # simu value : SigMF value
0: "fr1"
1: "fr2"
```
### Global Metadata
There are some metadata parameters that the user may need to change only once. Those parameters have been hard coded in the Data Recording App header.
[common/utils/data_recording/data_recording_app_v1.0.py](../common/utils/data_recording/data_recording_app_v1.0.py). Those are:
- The global metadata such as: author, description, sigmf collection file prefix, datetime_offset, enable saving config Data Recording App in json file with recorded data, and name of signal generator (i.e. 5gnr_oai). The name of signal generator is used for parameter mapping dictionary (OAI parameters to standardized metadata).
- The mapping between supported OAI messages and file_name_prefix, scope, and description.
The following figure shows an example of global metadata.
```python
# globally applicable metadata
global_info = {
"author": "Abdo Gaber",
"description": "Synchronized Real-Time Data Recording",
"timestamp": 0,
"collection_file_prefix": "data-collection", # collection file name prefix "deap-rx + str(...)"
"collection_file": "", # Reserved to be created in the code: “data-collection_rec-0_TIME-STAMP”
"datetime_offset": "", # datetime offset between current location and UTC/Zulu timezone
# Example: "+01:00" for Berlin, Germany
"save_config_data_recording_app_json": True,
"waveform_generator": "5gnr_oai",
"extensions": {},
}
```
The following figure shows an example of mapping between supported OAI messages by Data recorrding App and file_name_prefix.
```python
supported_oai_tracer_messages = {
# gNB messages
"GNB_PHY_UL_FD_PUSCH_IQ": {
"file_name_prefix": "rx-fd-data",
"scope": "gNB",
"description": "Frequency-domain RX data",
"serialization_scheme": ["subcarriers", "ofdm_symbols"],
},
"GNB_PHY_UL_FD_DMRS": {
"file_name_prefix": "tx-pilots-fd-data",
"scope": "gNB",
"description": "Frequency-domain TX PUSCH DMRS data",
"serialization_scheme": ["subcarriers", "ofdm_symbols"],
},
"GNB_PHY_UL_FD_CHAN_EST_DMRS_POS": {
"file_name_prefix": "raw-ce-fd-data",
"scope": "gNB",
"description": "Frequency-domain raw channel estimates (at DMRS positions)",
"serialization_scheme": ["subcarriers", "ofdm_symbols"],
},
"GNB_PHY_UL_FD_CHAN_EST_DMRS_INTERPL": {
"file_name_prefix": "raw-inter-ce-fd-data",
"scope": "gNB",
"description": "Interpolcated Frequency-domain raw channel estimates",
"serialization_scheme": ["subcarriers", "ofdm_symbols"],
},
"GNB_PHY_UL_PAYLOAD_RX_BITS": {
"file_name_prefix": "rx-payload-bits",
"scope": "gNB",
"description": "Received PUSCH payload bits",
"serialization_scheme": ["bits", "subcarriers", "ofdm_symbols"],
},
# UE messages
"UE_PHY_UL_SCRAMBLED_TX_BITS": {
"file_name_prefix": "tx-scrambled-bits",
"scope": "UE",
"description": "Transmitted scrambled PUSCH bits",
"serialization_scheme": ["bits", "subcarriers", "ofdm_symbols"],
},
"UE_PHY_UL_PAYLOAD_TX_BITS": {
"file_name_prefix": "tx-payload-bits",
"scope": "UE",
"description": "Transmitted PUSCH payload bits",
"serialization_scheme": ["bits", "subcarriers", "ofdm_symbols"],
},
}
```
## How to run Data Recording Application
The data recording application can be hosted on the gNB Server or in another server (for example the data lake server). The T-Tracer framework is a Network socket-based (TCP) communication between OAI 5G RAN stack and external tracer program.
### Step1: Run NR gNB Softmodem with enabling T-Tracer Option
It is worth mentioning that there is no need to set the T-Tracer port number via NR gNB Softmodem command, the default port `2021` is going to be used. If the Data Recording App is running on the same server of gNB, the parameter `tracer_service_baseStation_address` should be `"tracer_service_baseStation_address": "127.0.0.1:2021`. The gNB T-tracer App will read captured data then from port `2021`.
For the test simplicity, user can run the system in PHY-test mode. We will show how to run using PHY-Test mode:
Run NR gNB Softmodem with USRP:
```
sudo ./cmake_targets/ran_build/build/nr-softmodem -O ./targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.band78.sa.fr1.106PRB.1x1.usrpx410_3300MHz.conf --gNBs.[0].min_rxtxtime 6 --usrp-tx-thread-config 1 --phy-test -d --T_stdout 2 --T_nowait
```
Run NR gNB Softmodem in RF Simulation:
```
sudo ./cmake_targets/ran_build/build/nr-softmodem -O ./targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.band78.sa.fr1.106PRB.1x1.usrpx410_3300MHz.conf --gNBs.[0].min_rxtxtime 6 --rfsim --rfsimulator.serveraddr server --phy-test -d --T_stdout 2 --T_nowait
```
Note: User needs to change the name of gNB config file to your gNB config file.
It is worth mentioning that the possible values for T-tracer control options
- --T_stdout option: default 1
- --T_stdout = 0: Disable output on the terminal and only use the T tracer
- --T_stdout = 1: Disable the T tracer and only output on the terminal
- --T_stdout = 2: Both Eeable the T tracer and output on the terminal
- --T_nowait: Starting gNB without waiting for T-Tracer to be connected
- --T_port [port]: Default port 2021
### Step2: Run NR UE Softmodem with enabling T-Tracer Option
User needs to set the T-Tracer port number via NR UE Softmodem command, assume `2023`. The UE T-tracer App will read captured data then from port `2023`. The IP address and port number are configured in JSON file via the parameter: `"tracer_service_userEquipment_address": "192.168.100.3:2023”`, where the IP address `192.168.100.3` is the IP address of the UE server.
In OAI PHY-test mode, after running the NR gNB softmodem, copy from gNB Server the following two RRC files `reconfig.raw` and `rbconfig.raw` to UE Server (assume to `/home/user/workarea/rrc_files/`):
Run OAI Soft UE with USRP:
```
sudo ./cmake_targets/ran_build/build/nr-uesoftmodem --usrp-args "type=x4xx,addr=192.168.10.2,second_addr=192.168.11.2,clock_source=external,time_source=external" --phy-test -O ./targets/PROJECTS/GENERIC-NR-5GC/CONF/ue.conf --reconfig-file /home/user/workarea/rrc_files/reconfig.raw --rbconfig-file /home/user/workarea/rrc_files/rbconfig.raw --ue-rxgain 40 --ue-txgain 12 --T_stdout 2 --T_nowait --T_port 2023
```
Run OAI Soft UE in RF Simulation, assume the IP address of gNB server is `192.168.100.2`:
```
sudo ./cmake_targets/ran_build/build/nr-uesoftmodem --rfsim --rfsimulator.serveraddr 192.168.100.2 --phy-test -O ./targets/PROJECTS/GENERIC-NR-5GC/CONF/ue.conf --reconfig-file /home/user/workarea/rrc_files/reconfig.raw --rbconfig-file /home/user/workarea/rrc_files/rbconfig.raw --T_stdout 2 --T_nowait --T_port 2023
```
### Step3: Run Data Recording Application Services
First, compile the Data Collection (T-Tracer) Services:
- Go to: `common/utils/T/tracer`
- Compile gNB and UE Data Collection Services (T-Tracer Apps)
```
make t_tracer_app_gnb
make t_tracer_app_ue
```
Run gNB Data Collection service on one terminal:
```
./t_tracer_app_gnb -d ../T_messages.txt
```
Run UE Data Collection service on another terminal:
```
./t_tracer_app_ue -d ../T_messages.txt
```
Second, run main Data Recording Application:
- Go to: `common/utils/data_recording`
Run the following python script:
```
python3 data_recording_app_v1.0.py
```
The recorded data set will be stored in the configured path, assume `/home/user/workarea/oai_recorded_data/`.
The following figure shows an example of recorded data set.
<img src="images/sigmf_dataset.svg" alt="Example from SigMF recorded data set" width="600">
## Overview on Collected Data Set
SigMF supports heterogeneous data via SigMF collections. It is used to bundle multiple SigMF files into one recording.
A heterogeneous data set generated for a certain scenario is stored in a SigMF collection which consists of (as it is shown in the figure above)
- One SigMF collection file per each record, e.g.
- data-collection-rec-idx-timestamp.sigmf-collection
- SigMF recordings (.sigmf-meta file + .sigmf-data file). Per each message, there are two files:
- rx-fd-data-rec-idx-timestamp.sigmf-meta
- rx-fd-data-rec-idx-timestamp.sigmf-data
- tx-pilots-fd-data-rec-idx-timestamp.sigmf-meta
- tx-pilots-fd-data-rec-idx-timestamp.sigmf-data
- raw-ce-fd-data-rec-idx-timestamp.sigmf-meta
- raw-ce-fd-data-rec-idx-timestamp.sigmf-data
- tx-scrambled-bits-rec-idx-timestamp.sigmf-meta
- tx-scrambled-bits-rec-idx-timestamp.sigmf-data
The following figure shows an example of SigMF collection file and how it bundles multiple SigMF files of a single record.
```json
{
"collection": {
"core:author": "Abdo Gaber",
"core:description": "Synchronized Real-Time Data Recording",
"core:streams": [
{
"hash": "0a39edb03eb86fb0d368a0511f17b0e99d3314d09b1d271c8bc893dffbb6b06b8987362bd15a334f8da40091ca83f6201218084fc602b562b5b012933bc4608a",
"name": "/home/user/workarea/oai_recorded_data/tx-pilots-fd-data-rec-0-2025_06_19T11_19_00_037"
},
{
"hash": "f2062ff3a7020e2569c9d1d3c5a8403dacf83a1e842b126f889262d56a1b2efc818962d198cd5219bf563aba5e0709e80eba40bd973de95787319e8380d339ba",
"name": "/home/user/workarea/oai_recorded_data/raw-ce-fd-data-rec-0-2025_06_19T11_19_00_037"
},
{
"hash": "283b62908321db17db6a53c77d41a385360e9f11128627934f4f41746b797b77e41dbc18e72d096126673766edb5d4a9408712f5071d064fae0a792644c16bdd",
"name": "/home/user/workarea/oai_recorded_data/rx-fd-data-rec-0-2025_06_19T11_19_00_037"
},
{
"hash": "e72f2d6ea3e353d666e7635726ea6a5bd096e6fc14c965c7c2803705bcd0cf934ac9dc3a0c12f190171afc2db7d4b3fd7d5acc8e18796c48d5ee6e7bbd0551b7",
"name": "/home/user/workarea/oai_recorded_data/raw-inter-ce-fd-data-rec-0-2025_06_19T11_19_00_037"
},
{
"hash": "7eddf8eb4564c03a1505e3288052cc583416617158dbff0bad942af7cc2477449c6c7ff2f02a55849449ba6956800b446f5c0880d418d80fffc24fb236038ef3",
"name": "/home/user/workarea/oai_recorded_data/rx-payload-bits-rec-0-2025_06_19T11_19_00_037"
},
{
"hash": "ec128fd8691975995df84f96db3740b773cb060d9803f1ae2664e0d081011e59d623f7fe909552e807a4e63cb02e7f9005e8a19ab2a680004d8af9f6b49fff06",
"name": "/home/user/workarea/oai_recorded_data/tx-payload-bits-rec-0-2025_06_19T11_19_00_029"
},
{
"hash": "d8300b206ede81639c0d8f25030d85ff3b4e848456a7d73c706350fbc2b4ce7b114cddf29173e069335fcf4aeab37818129259afacf0fd02efa34b9b6d985edb",
"name": "/home/user/workarea/oai_recorded_data/tx-scrambled-bits-rec-0-2025_06_19T11_19_00_029"
}
],
"core:version": "1.2.1"
}
}
```
Each SigMF metadata has three sections:
- global: The standardized global parameters are presented here to understand and read the binary data.
- captures: The standardized capture parameters provide details about the capture process.
- annotations: It provides details about the recording scenario.
The following figure shows an example of SigMF metadata file, for example for the frequency-domain RX data.
```json
{
"global": {
"core:author": "Abdo Gaber",
"core:collection": "data-collection-rec-0-2025_06_19T11_19_00_037",
"core:dataset": "raw-ce-fd-data-rec-0-2025_06_19T11_19_00_037.sigmf-data",
"core:datatype": "cf32_le",
"core:description": "Frequency-domain raw channel estimates (at DMRS positions)",
"core:hw": "USRP X410",
"core:license": "MIT License",
"core:num_channels": 1,
"core:recorder": "NI Data Recording Application for OAI",
"core:sample_rate": 61440000.0,
"core:sha512": "55ae5bc81b4812e68f6e1c195600f240fc3ca71113c732271ee42a5524da98636c3c7ac587c46fd87c6d1b9253ca6504a4b94eafba8f4065099096fc7721228c",
"core:version": "1.2.1"
},
"captures": [
{
"core:datetime": "2025_06_19T11:19:00.037",
"core:frequency": 3319680000.0,
"core:sample_start": 0,
"serialization:counts": [
600,
13
],
"serialization:scheme": [
"subcarriers",
"ofdm_symbols"
]
}
],
"annotations": [
{
"core:sample_count": 7800,
"core:sample_start": 0,
"num_transmitters": 1,
"system_components:channel": [
{
"carrier_frequency": 3319680000.0,
"channel_model": "tdl_d",
"delay_spread": 5.0000000000000004e-08,
"emulation_mode": "ni rf real time",
"snr_esn0_db": 20.0,
"speed": 5.0,
"transmitter_id": "tx_0"
}
],
"system_components:receiver": {
"bandwidth": 40000000.0,
"clock_reference": "external",
"gain": 30.0,
"hw_subtype": "ZBX",
"manufacturer": "NI",
"num_rx_antennas": 1,
"phy_freq_domain_receiver_type": "trad_rx",
"seid": "328AB35"
},
"system_components:transmitter": [
{
"signal:detail": {
"5gnr": {
"cell_id": 0,
"cp_mode": "normal",
"frame": 785,
"frame_structure": "tdd",
"frequency_range": "fr1",
"link_direction": "uplink",
"num_slots": 1,
"num_tx_antennas": 1,
"pusch:content": "compliant",
"pusch:mapping_type": "B",
"pusch:mcs": 9,
"pusch:mcs_table_index": 0,
"pusch:modulation": "qpsk",
"pusch:num_layer": 1,
"pusch:num_ofdm_symbols": 13,
"pusch:num_prb": 50,
"pusch:payload_bit_pattern": "zeros",
"pusch:start_ofdm_symbol": 0,
"pusch:start_prb": 0,
"pusch:transform_precoding": "disabled",
"pusch_dmrs:antennna_port": 0,
"pusch_dmrs:duration_num_ofdm_symbols": 1,
"pusch_dmrs:num_add_positions": 2,
"pusch_dmrs:ofdm_symbol_idx": [
0,
5,
10
],
"pusch_dmrs:resource_map_config": "5g nr type 1",
"pusch_dmrs:start_ofdm_symbol": 0,
"rnti": 4660,
"slot": 8,
"subcarrier_spacing": 30000
},
"generator": "OpenAirInterface: https://www.openairinterface.org/",
"standard": "5gnr"
},
"signal:emitter": {
"bandwidth": 40000000.0,
"clock_reference": "external",
"frequency": 3319680000.0,
"gain_tx": 48.0,
"hw": "USRP X410",
"hw_subtype": "ZBX",
"manufacturer": "NI",
"sample_rate": 61440000.0,
"seid": "323F75F"
},
"transmitter_id": "tx_0"
}
]
}
]
}
```
## Synchronization Validation
For synchronization validation and to show how to read SigMF metadata, a simple script `common/utils/data_recording/sync_validation_demo.py` has been created to validate that, for example: the recorded bits from gNB and UE are in sync.
## Data Recording Application Limitation
- MIMO Support: The data recording app is ready, tested and validated for SISO. For MIMO, it should be enhanced, tested, and validated.
- It supports the uplink gNB and UE messages listed above. If the user would like to record another message for example from DL, the user needs to define the required meta-data. User can use the existing meta-data definition of UL as a template. Then, add those messages to the headers of different Data Recording App services.
- Data serialization in Tx scrambled bits message without considering location of DMRS symbols: Only captured valid data bits is stored. It means the location of DMRS symbols are not considered and filled with zeros and stored as it is in the grid presented on the figure below. For example:
- Number of bits per IQ Symbol = 4
- Number of subcarrier = 72
- Number of OFDM symbols = 13
- So, the valid number of bits in the transport block (slot) is: 3312 bits. If we will fill DMRS locations by zeros, the number of bits is: 3744 bits, but it is not done due to the real-timing issues. For Tx scrambled bits data de-serialization, the user can reconstruct the Tx Scrambled Bits Grid (2D Grid) by using the captured DMRS grid or Channel Estimates Grid as a reference and no need to derive the DMRS symbols locations based on 5G NR config parameters.
<img src="images/data_serialization_tx_scrambled_bit_message.svg" alt="Data serialization " width="500">
### To Do List:
- Provide an overview about the different services of the Data Recording App (Data Control Service, Data collection (T-Tracer) Service, Data Conversion Service) and the APIs definition between them.

View File

@@ -123,7 +123,7 @@ You can do handover across DUs with a COTS UE. Note that these DUs should be
separated by at least multiple meters to ensure that the UE will receive
different signal strengths when moving between cells.
We only support intra-frequency handovers yet. We have verified with USRPs
We support both intra-frequency and inter-frequency handovers. We have verified with USRPs
only, although other radios should work as well.
For UEs, we verified Quectel modules and iPhones. Note, though, that not all

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 105 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 120 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 184 KiB

Some files were not shown because too many files have changed in this diff Show More