Compare commits

...

101 Commits

Author SHA1 Message Date
Abdelkhalek Beraoud
9b1907db0b Update figure link in rfsim_pub_sub.md 2025-02-13 10:12:29 +00:00
Amiiiiine
1749b35664 Updated build : fixing -w USRP 2025-02-12 10:14:56 +01:00
Amiiiiine
cced8752f2 Removed unnecessary build variable 2025-02-12 09:55:24 +01:00
Amiiiiine
c8206efb1c Updated build: building two rfsim libraries 2025-02-12 09:41:19 +01:00
beraoudabdelkhalek
b00585ecf0 Follow clang-format 2025-02-10 15:24:41 +01:00
beraoudabdelkhalek
a7597732ac Fix new lines 2025-02-10 12:27:00 +01:00
beraoudabdelkhalek
c1d060c9ef Remove new line from nr_polar_decoder.c and fix POLAR_CODING_DEBUG error 2025-02-10 11:58:18 +01:00
beraoudabdelkhalek
36c9f1b9fb Remove whitespace from nr_pbch.c 2025-02-10 11:50:43 +01:00
beraoudabdelkhalek
d00edb4c27 Add new line at the end to simulator.c and simulator_pub_sub.c 2025-02-10 11:35:34 +01:00
beraoudabdelkhalek
796533ab6f Add newline in broker.c 2025-02-10 11:28:50 +01:00
Amiiiiine
37e62e6243 Merge branch 'rfsim-pubsub' of gitlab.eurecom.fr:oai/openairinterface5g into rfsim-pubsub 2025-02-10 11:17:58 +01:00
Amiiiiine
5567bfcd59 Omitted unecessary turn offs in build OAI 2025-02-10 11:17:26 +01:00
beraoudabdelkhalek
813f0924db Add license banner 2025-02-10 10:58:30 +01:00
beraoudabdelkhalek
2026835546 Change diagram to svg 2025-02-10 10:43:04 +01:00
Amiiiiine
d8c6d61fbd Merge branch 'rfsim-pubsub' of gitlab.eurecom.fr:oai/openairinterface5g into rfsim-pubsub 2025-02-10 10:16:23 +01:00
Amiiiiine
89703fd45b Corrected simulator.c, Changed build directive 2025-02-10 10:15:54 +01:00
Abdelkhalek Beraoud
c3ee384036 Update gnb.sa.band77.fr1.273PRB.usrpx300.conf 2025-02-07 20:31:44 +00:00
Amiiiiine
30bc83483a Rebased 2025-02-07 10:18:46 +01:00
beraoudabdelkhalek
ca19267dd2 Added contributors 2025-02-07 10:14:08 +01:00
AMINE ADJOU
2e12fc199b Update rfsim_pub_sub.md 2025-02-07 10:14:08 +01:00
beraoudabdelkhalek
8f6f165f6e Updated figure in rfsimulator_pubsub.md 2025-02-07 10:14:08 +01:00
beraoudabdelkhalek
20bcc81b8c Updated max UE and figure in rfsimulator_pub_sub.md 2025-02-07 10:14:08 +01:00
beraoudabdelkhalek
eae8863a16 Updated test script 2025-02-07 10:14:08 +01:00
beraoudabdelkhalek
91f1e76f7d Updated build command 2025-02-07 10:14:08 +01:00
beraoudabdelkhalek
55b7ad64f1 Updated architecture section in rfsim_pub_sub.md 2025-02-07 10:14:08 +01:00
beraoudabdelkhalek
a1acd001f6 rfsim_pub_sub.md 2025-02-07 10:14:08 +01:00
Amiiiiine
2c2e6e0dee Changed max ues 2025-02-07 10:14:08 +01:00
Amiiiiine
081fdcad1f Fixed rfsim pub sub md file, Added config file modifications 2025-02-07 10:13:38 +01:00
Amiiiiine
a83ac94aa2 Fixed last typos 2025-02-07 10:13:38 +01:00
beraoudabdelkhalek
081be162fc Updated rfsim_pub_sub.md 2025-02-07 10:13:38 +01:00
Amiiiiine
2a1af1a169 Fixed typos 2025-02-07 10:13:38 +01:00
beraoudabdelkhalek
3bcd05d621 Updated headings in rfsimu_pub_sub.md 2025-02-07 10:13:35 +01:00
beraoudabdelkhalek
f8eed46b40 Updated architecture section 2025-02-07 10:12:57 +01:00
Amiiiiine
e8cd07c88d Added ping testing in rfsim pub sub md file 2025-02-07 10:12:54 +01:00
Amiiiiine
df683b284a Fixed typos in rfsim md file 2025-02-07 10:12:16 +01:00
Amiiiiine
375471ce5f Fixed rfsim md 2025-02-07 10:11:45 +01:00
Amiiiiine
5dc499e467 fixed typos 2025-02-07 10:11:45 +01:00
beraoudabdelkhalek
5648d6a92f Updated Scenario section in rfsim_pub_sub.md 2025-02-07 10:11:45 +01:00
Amiiiiine
fc7afc5ad3 Added doc CN5G 2025-02-07 10:11:45 +01:00
Amiiiiine
3eb578258e Added zmq auto installation, Added necessary scripts, updated readme 2025-02-07 10:11:42 +01:00
beraoudabdelkhalek
9cc9691622 Added details for multi UE in rfsim_pub_sub.md 2025-02-07 10:08:48 +01:00
beraoudabdelkhalek
4ba99012f4 Removed header checking code 2025-02-07 10:08:48 +01:00
beraoudabdelkhalek
63fc9b6462 Fixed first message handeling 2025-02-07 10:08:48 +01:00
beraoudabdelkhalek
074a58150a Added more I/O threads in broker and gNB 2025-02-07 10:08:48 +01:00
beraoudabdelkhalek
4e8b163720 Fixed error checking in flushinput 2025-02-07 10:08:48 +01:00
Amiiiiine
19df5e5ae5 Set max ues to 64 2025-02-07 10:08:48 +01:00
beraoudabdelkhalek
cfa86e1cbf Cleaned code 2025-02-07 10:08:48 +01:00
beraoudabdelkhalek
133785dbc0 Cleaning code 2025-02-07 10:08:48 +01:00
beraoudabdelkhalek
e79f2e1d61 Fixed rfsim_pub_sub.md 2025-02-07 10:08:48 +01:00
Amiiiiine
6533f81f58 Added rfsim md file 2025-02-07 10:08:48 +01:00
Amiiiiine
e365d392c0 Testing with 64 UEs 2025-02-07 10:08:48 +01:00
beraoudabdelkhalek
bb7bdcb3e7 Cleaning comments 2025-02-07 10:08:48 +01:00
Amiiiiine
305962ac72 Merged 2025-02-07 10:08:45 +01:00
beraoudabdelkhalek
ea3038b6c9 Fixed segfault 2025-02-07 10:04:55 +01:00
Amiiiiine
3ccc283aad Added zmq build 2025-02-07 10:04:55 +01:00
beraoudabdelkhalek
dc06f10399 updated mincirsize 2025-02-07 10:04:55 +01:00
beraoudabdelkhalek
22c867a811 Protect zmq_poll 2025-02-07 10:04:55 +01:00
beraoudabdelkhalek
07bc3c87bf Fixed killing process with Ctrl-C 2025-02-07 10:04:48 +01:00
Amiiiiine
06e99b2fb3 Added sub sock check 2025-02-07 10:02:41 +01:00
beraoudabdelkhalek
416c60e1d6 Fixed uninitialized pointers 2025-02-07 10:02:39 +01:00
beraoudabdelkhalek
0866d97de1 cleaning code 2025-02-07 10:02:08 +01:00
Amiiiiine
9cce0c2653 Prepared for tests 2025-02-07 10:00:26 +01:00
Amiiiiine
46505bec55 Fixed support for multiple UEs 2025-02-07 10:00:26 +01:00
Amiiiiine
1b3d1ad8d9 Fixed one gNb one UE but not multiple UEs 2025-02-07 10:00:26 +01:00
Amiiiiine
db1dbf5a94 Modified support for multiple UEs - not tested 2025-02-07 10:00:26 +01:00
Amiiiiine
29f2accf71 Adding support for multiple UEs - seg faulted 2025-02-07 10:00:23 +01:00
Amiiiiine
6b47aba0f1 Fixed AllocCirBuf, add_buff_to_id_mapping 2025-02-07 09:59:42 +01:00
beraoudabdelkhalek
5b43544568 Fixed Alloccirbuf 2025-02-07 09:59:42 +01:00
beraoudabdelkhalek
d2e585c543 Checking connection with fd_sub_sock in write_internal 2025-02-07 09:59:42 +01:00
Amiiiiine
ab356d2cf0 Added broker to rfsim 2025-02-07 09:59:42 +01:00
beraoudabdelkhalek
4bca77f847 Changed send/recv operations to non blocking mode 2025-02-07 09:59:42 +01:00
Amiiiiine
4785b823d0 Fixed minCirSize 2025-02-07 09:59:42 +01:00
Amiiiiine
4619e0cc73 Deleted write_output 2025-02-07 09:59:42 +01:00
Amiiiiine
579a5ab3b7 fixed device init 2025-02-07 09:59:42 +01:00
beraoudabdelkhalek
1324240a3a Fixed flush input, alloccirbuf when first connection 2025-02-07 09:59:42 +01:00
beraoudabdelkhalek
e200d02a2c Fixed removecirbuf 2025-02-07 09:59:42 +01:00
beraoudabdelkhalek
828ec31d59 Fixed buffer size in alloccirbuf 2025-02-07 09:59:42 +01:00
beraoudabdelkhalek
0b2c8f56a5 Fixed alloccirbuf in start server 2025-02-07 09:59:42 +01:00
beraoudabdelkhalek
5ab799f867 replace conn sock operation 2025-02-07 09:59:39 +01:00
beraoudabdelkhalek
055ac7a3c8 Fixed channel modeling functions 2025-02-07 09:58:32 +01:00
beraoudabdelkhalek
097c1ee8c8 Added support for many devices and connection detection 2025-02-07 09:56:28 +01:00
Amiiiiine
49c51f4cdb Clean logs 2025-02-07 09:56:28 +01:00
beraoudabdelkhalek
ccf3f0fcfc cleaning LOGs 2025-02-07 09:56:28 +01:00
beraoudabdelkhalek
55cddf2ab1 fixed flushinput 2025-02-07 09:56:28 +01:00
Amiiiiine
13f17a76f6 IT WORKS! 2025-02-07 09:56:28 +01:00
Amiiiiine
8d154cf3f3 Stuck in rfsimulator_read have_to_wait loop 2025-02-07 09:56:28 +01:00
Amiiiiine
026812a0cb Fixed FlushInput, Added Def rfsimulator_write 2025-02-07 09:56:28 +01:00
beraoudabdelkhalek
79b998d975 added rfsimulator_write_internal, fullwrite, removecirbuf 2025-02-07 09:56:28 +01:00
beraoudabdelkhalek
576a214abc removed casting in zmq_recv 2025-02-07 09:56:28 +01:00
Amiiiiine
8ac684ecdb Fixing flushInput 2025-02-07 09:56:28 +01:00
Amiiiiine
3806b49c68 Added flushInputv2 2025-02-07 09:56:28 +01:00
beraoudabdelkhalek
a5f4702ea8 change 2025-02-07 09:56:28 +01:00
Amiiiiine
2ec3938e62 Kept changes 2025-02-07 09:56:28 +01:00
Amiiiiine
d035ab698c Fixed flushInput 2025-02-07 09:56:28 +01:00
Amiiiiine
a490fc65b3 Added rfsimulator_read and flushInput 2025-02-07 09:56:28 +01:00
beraoudabdelkhalek
427be66a57 fixed wait timing 2025-02-07 09:56:28 +01:00
beraoudabdelkhalek
3ec9f7553c added previous pubsub changes adapted to develop 2025-02-07 09:56:28 +01:00
Amiiiiine
eae89d8c66 .. 2025-02-07 09:56:28 +01:00
Amiiiiine
81b82c7e6f Added Pub-Sub Files and Prepared for Tests 2025-02-07 09:56:28 +01:00
Amiiiiine
a850ea4dbc Added rfsimulator_read 2025-02-07 09:56:27 +01:00
Amiiiiine
cc85a641a8 history + pubsub version 2025-02-07 09:56:27 +01:00
15 changed files with 1799 additions and 30 deletions

View File

@@ -152,6 +152,7 @@ Options:
Enable the thread sanitizer on all targets
-h | --help
Print this help"
}
@@ -271,7 +272,7 @@ function main() {
;;
"SIMU")
HW="OAI_"$2
TARGET_LIST="$TARGET_LIST rfsimulator"
TARGET_LIST="$TARGET_LIST rfsimulator rfsimulator_zmq broker"
CMAKE_CMD="$CMAKE_CMD -DOAI_$2=ON"
;;
"AW2SORI")
@@ -485,7 +486,8 @@ function main() {
# add some default libraries that should always be built
# for eNB, gNB, UEs, simulators
if [[ $gNB == 1 || $eNB == 1 || $UE == 1 || $nrUE == 1 || $SIMUS_PHY == 1 || $RU == 1 ]]; then
TARGET_LIST="$TARGET_LIST params_libconfig coding rfsimulator dfts params_yaml"
TARGET_LIST="$TARGET_LIST params_libconfig coding dfts params_yaml rfsimulator rfsimulator_zmq broker"
fi
mkdir -p $DIR/$BUILD_DIR/build

View File

@@ -595,7 +595,9 @@ check_install_oai_software() {
openssl \
zlib1g-dev \
xxd \
libyaml-cpp-dev
libzmq3-dev \
libyaml-cpp-dev
elif [[ "$OS_BASEDISTRO" == "fedora" ]]; then
if [[ "$OS_DISTRO" == "rhel" ]] || [[ "$OS_DISTRO" == "centos" ]] || [[ "$OS_DISTRO" == "rocky" ]]; then
@@ -629,6 +631,7 @@ check_install_oai_software() {
blas-devel \
vim-common \
zlib-devel \
zeromq-devel \
yaml-cpp-devel
fi

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 102 KiB

View File

@@ -0,0 +1,161 @@
# Overview
The original implementation of the RF simulator has certain limitations, particularly with regard to sidelink and mobility features. This is due to its client-server architecture, which was implemented using BSD sockets. To overcome these constraints, we transitioned to a publisher-subscriber paradigm using the ZMQ library. This new approach enhances scalability, enabling support for a larger number of devices.
# Architecture
The main components in the new architecture are:
**Broker**: The broker is built using XSUB and XPUB sockets, and the [zmq proxy](http://api.zeromq.org/4-2:zmq-proxy) function to route traffic between the two sockets.
For more details about XSUB and XPUB sockets refer to:
- [XPUB and XSUB socket types](https://zeromq.org/socket-api/)
- [Pub Sub with broker](https://zguide.zeromq.org/docs/chapter2/)
The gNB and the UE both have 2 sockets, a subscriber socket that connects to XPUB socket of the broker and a publisher socket that connects to XSUB socket of the broker.
**UE**: Subscribes to **downlink** and **first** topic.
**gNB**: Subscribes to **uplink** topic, and **join** topic to detect connections from UEs.
## Topics
**Downlink**: a topic used to publish data from gNB to UE.
**Uplink**: a topic used to publish data from UE to gNB.
**First**: a topic used to publish the first message from gNB to UE.
**Join**: a topic used to publish a join message from UE to gNB, when the UE is first connected to the broker.
See the following diagram:
![Rfsim pubsub architecture](rfsim-pubsub-architecture.svg)
This setup was tested with up to 40 UEs running on a machine with an Intel(R) Xeon(R) Silver 4216 CPU @ 2.10GHz, 64 CPUs (2 NUMA nodes, each with 16 physical cores and 2 threads per core) and 128 GB of RAM.
# Build
NB : If you want to test with higher number of UEs than 16 UEs, In `<path to oai sources>/openairinterface5g/common/openairinterface5g_limits.h`
Set MAX_MOBILES_PER_GNB to 64
```
# define MAX_MOBILES_PER_GNB 64
```
## Using build_oai
It's possible to build the rfsimulator device in its traditional implementation, whether by itself or with the OAI gNb or OAI UE
```
cd <path to oai sources>/openairinterface5g/cmake_targets
./build_oai -c -C --gNB --nrUE -w SIMU --ninja -I
```
to build the publisher-subscriber version you need to add "--zmq" option,
```
./build_oai --gNB --nrUE --zmq -I
```
to rebuild the rfsimulator only:
```
./build_oai -w SIMU --zmq
```
# Usage
## 1. Setup and Start OAI CN5G
for more details, refer to [CN5G setup](../NR_SA_Tutorial_OAI_CN5G.md).
To test with multiple UEs, add more records to the `AuthenticationSubscription` table of the core network database.
You can replace your current file with [this one](../../tools/oai_db.sql) containing 64 records.
## 2. Launch the broker
Similar to the client-server rfsimulator, you can run the UEs and gNB. However, in the publisher-subscriber version, you must launch the broker first, then the gNB.
```
cd <path to oai sources>/openairinterface5g/cmake_targets/ran_build/build
./broker
```
## 3. Launch the gNB
```
sudo ./nr-softmodem -O ../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band77.fr1.273PRB.usrpx300.conf --gNBs.[0].min_rxtxtime 6 --rfsim
```
## 4. Launch the UE
```bash
sudo ./nr-uesoftmodem -r 273 --numerology 1 --band 77 -C 3949740000 --ssb 1492 --uicc0.imsi 001010000000001 --rfsim --device_id 1
```
## 5. Launch multiple UEs
### Scenario
This section is about how to configure and run multiple OAI nrUE in the same end-to-end OAI 5G setup with RFsimulator.
### Pre-requisites
This section is assuming that OAI CN5G and OAI RAN are already deployed. To learn how to deploy and run a basic setup with OAI nrUE, please refer to [NR_SA_Tutorial_OAI_nrUE.md](NR_SA_Tutorial_OAI_nrUE.md).
RFsimulator:
- RFsimulator tutorial [rfsimulator/README.md](../radio/rfsimulator/README.md)
### Multiple nrUEs with namespaces
Important notes:
* This should be run on the same host as the OAI gNB
* Use the script [multi_ue.sh](../tools/scripts/multi-ue.sh) to make namespaces for multiple UEs.
* For each UE, a namespace shall be created, each one has a different address that will be used as the broker address
* Each UE shall have a different IMSI, which shall be present in the relevant tables of the MySQL database
* Each UE shall have a different device id (from 0 to 249)
1. For the first UE, create the namespace ue1 (`-c 1`), then execute shell inside (`-o 1`, "open"):
```bash
sudo ./multi-ue.sh -c 1
sudo ./multi-ue.sh -o 1
```
2. After entering the bash environment, run the following command to deploy your first UE
```bash
sudo ./nr-uesoftmodem -r 273 --numerology 1 --band 77 -C 3949740000 --ssb 1492 --uicc0.imsi 001010000000001 --rfsim --device_id 1 --brokerip 10.201.1.10
```
3. For the second UE, create the namespace ue2 (`-c 2`), then execute shell inside (`-o 2`, "open"):
```bash
sudo ./multi-ue.sh -c 2
sudo ./multi-ue.sh -o 2
```
4. After entering the bash environment, run the following command to deploy your second UE:
```bash
sudo ./nr-uesoftmodem -r 273 --numerology 1 --band 77 -C 3949740000 --ssb 1492 --uicc0.imsi 001010000000002 --rfsim --device_id 2 --brokerip 10.202.1.10
```
In the command above, please note that the IMSI and the device id changed.
For each UE specify its device id as well as the accessible broker IP from its namespace.
Make sure that the device id for each UE running is different.
# Ping :
To test the ping from UE_x
```
<path to oai sources>/openairinterface5g/tools/scripts/multi-ue.sh -o x
ping 192.168.70.135 -I oaitun_ue1
```
# Test Automation :
You can use the following script to automatically launch a large number of UEs and monitor the gNB logs as they attach.
Before running the script, make sure to start the core network and the broker. Then, execute the following command:
```
sudo <path to oai sources>/openairinterface5g/tools/scripts/test_automation.sh --nb-ue 20
```
You can find all the logs in `<path to oai sources>/openairinterface5g/logs`.
# TODO
- Handle connection teardown.
- Make memory management more efficient.
- Add more features to the broker.

View File

@@ -1407,15 +1407,6 @@ void kill_NR_RU_proc(int inst) {
pthread_mutex_lock(&proc->mutex_fep[0]);
proc->instance_cnt_fep[0] = 0;
pthread_cond_broadcast(&proc->cond_fep[0]);
pthread_mutex_unlock( &proc->mutex_fep[0] );
pthread_join(proc->pthread_FH, NULL);
if (cpu_meas_enabled) {
LOG_D(PHY, "Joining ru_stats_thread\n");
pthread_join(ru->ru_stats_thread, NULL);
}
// everything should be stopped now, we can safely stop the RF device
if (ru->stop_rf == NULL) {
LOG_W(PHY, "No stop_rf() for RU %d defined, cannot stop RF!\n", ru->idx);
return;
@@ -1425,6 +1416,12 @@ void kill_NR_RU_proc(int inst) {
LOG_W(PHY, "stop_rf() returned %d, RU %d RF device did not stop properly!\n", rc, ru->idx);
return;
}
pthread_mutex_unlock( &proc->mutex_fep[0] );
pthread_join(proc->pthread_FH, NULL);
if (cpu_meas_enabled) {
LOG_D(PHY, "Joining ru_stats_thread\n");
pthread_join(ru->ru_stats_thread, NULL);
}
LOG_I(PHY, "RU %d RF device stopped\n",ru->idx);
}

View File

@@ -835,8 +835,8 @@ uint32_t polar_decoder_int16(int16_t *input,
Ar,
B[1],
B[0],
Cprime[1],
Cprime[0],
// Cprime[1],
// Cprime[0],
crc,
rxcrc,
crc ^ rxcrc,

View File

@@ -71,7 +71,7 @@ int nr_generate_sss( c16_t *txdataF,
k-=frame_parms->ofdm_symbol_size;
}
#ifdef NR_SSS_DEBUG
// write_output("sss_0.m", "sss_0", (void*)txdataF[0][l*frame_parms->ofdm_symbol_size], frame_parms->ofdm_symbol_size, 1, 1);
write_output("sss_0.m", "sss_0", (void*)txdataF[0][l*frame_parms->ofdm_symbol_size], frame_parms->ofdm_symbol_size, 1, 1);
#endif
return 0;

View File

@@ -401,7 +401,7 @@ static int nr_ue_pbch_procedures(PHY_VARS_NR_UE *ue,
&symb_offset,
ue->frame_parms.samples_per_frame_wCP,
rxdataF);
// LOG_I(PHY, "ret value : %d \n", ret);
if (ret==0) {
T(T_NRUE_PHY_MIB, T_INT(frame_rx), T_INT(nr_slot_rx),
T_INT(ssb_index), T_BUFFER(result.decoded_output, 3));

View File

@@ -29,10 +29,16 @@ if(OAI_LMSSDR)
endif()
add_boolean_option(OAI_SIMU ON "Activate OAI's rfsimulator driver" OFF)
add_boolean_option(OAI_ZMQ ON "Activate OAI's rfsimulator pub sub driver" OFF)
if(OAI_SIMU)
add_subdirectory(rfsimulator)
endif()
# add_boolean_option(OAI_ZMQ ON "Activate OAI's rfsimulator_pub_sub driver" OFF)
# if(OAI_ZMQ)
# add_subdirectory(rfsimulator_pub_sub)
# endif()
add_boolean_option(OAI_USRP OFF "Activate OAI's USRP driver" OFF)
if(OAI_USRP)
add_subdirectory(USRP)

View File

@@ -46,7 +46,7 @@
/* name of shared library implementing a third-party transport */
#define OAI_THIRDPARTY_TP_LIBNAME "thirdparty_transpro"
/* name of shared library implementing the rf simulator */
#define OAI_RFSIM_LIBNAME "rfsimulator"
#define OAI_RFSIM_LIBNAME "rfsimulator_zmq"
/* name of shared library implementing the iq player */
#define OAI_IQPLAYER_LIBNAME "oai_iqplayer"

View File

@@ -1,10 +1,31 @@
add_library(rfsimulator MODULE
simulator.c
apply_channelmod.c
../../openair1/PHY/TOOLS/signal_energy.c
)
target_link_libraries(rfsimulator PRIVATE SIMU HASHTABLE)
set_target_properties(rfsimulator PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
# if(OAI_ZMQ)
find_library(ZeroMQ zmq REQUIRED)
add_library(rfsimulator_zmq MODULE
simulator_pub_sub.c
apply_channelmod.c
../../openair1/PHY/TOOLS/signal_energy.c
)
find_package(PkgConfig REQUIRED)
add_executable(replay_node stored_node.c)
target_link_libraries (replay_node minimal_lib)
pkg_check_modules(ZMQ REQUIRED libzmq)
target_include_directories(rfsimulator_zmq PRIVATE ${ZMQ_INCLUDE_DIRS})
set_target_properties(rfsimulator_zmq PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
target_link_libraries(rfsimulator_zmq PRIVATE SIMU ${ZMQ_LIBRARIES})
add_executable(broker broker.c)
target_link_libraries(broker PRIVATE ${ZMQ_LIBRARIES})
set_target_properties(broker PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
# else()
add_library(rfsimulator MODULE
simulator.c
apply_channelmod.c
../../openair1/PHY/TOOLS/signal_energy.c
)
target_link_libraries(rfsimulator PRIVATE SIMU HASHTABLE)
set_target_properties(rfsimulator PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
# endif()

View File

@@ -0,0 +1,56 @@
/*
* 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
*
* Author and copyright: Abdelkhalek Beraoud, Amine Adjou, eurecom.fr
*
* 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
*/
#include <zmq.h>
#include <stdio.h>
#include <stdlib.h>
int main(void)
{
void *context = zmq_ctx_new();
int io_threads = 4;
zmq_ctx_set(context, ZMQ_IO_THREADS, io_threads);
printf("Running with %d I/O threads, %s\n",
io_threads,
(zmq_ctx_get(context, ZMQ_IO_THREADS) == io_threads) ? "success" : "fail");
// XSUB socket for publishers
void *xsub_socket = zmq_socket(context, ZMQ_XSUB);
zmq_bind(xsub_socket, "tcp://0.0.0.0:5555");
// XPUB socket for subscribers
void *xpub_socket = zmq_socket(context, ZMQ_XPUB);
zmq_bind(xpub_socket, "tcp://0.0.0.0:5556");
printf("Broker is running using zmq proxy\n");
// Proxy between XSUB and XPUB sockets
zmq_proxy(xsub_socket, xpub_socket, NULL);
// Clean up
zmq_close(xsub_socket);
zmq_close(xpub_socket);
zmq_ctx_destroy(context);
return 0;
}

File diff suppressed because it is too large Load Diff

View File

@@ -19,7 +19,7 @@ gNBs = (
pdsch_AntennaPorts_XP = 1;
pusch_AntennaPorts = 1;
do_CSIRS = 1;
do_SRS = 1;
do_SRS = 0;
ul_prbblacklist = "135,136,137,138"
servingCellConfigCommon = (
@@ -157,12 +157,12 @@ gNBs = (
////////// AMF parameters:
amf_ip_address = ({ ipv4 = "192.168.80.132"; });
amf_ip_address = ({ ipv4 = "192.168.70.132"; });
NETWORK_INTERFACES :
{
GNB_IPV4_ADDRESS_FOR_NG_AMF = "192.168.80.129/24";
GNB_IPV4_ADDRESS_FOR_NGU = "192.168.80.129/24";
GNB_IPV4_ADDRESS_FOR_NG_AMF = "192.168.70.129/24";
GNB_IPV4_ADDRESS_FOR_NGU = "192.168.70.129/24";
GNB_PORT_FOR_S1U = 2152; # Spec 2152
}

View File

@@ -0,0 +1,99 @@
#!/bin/bash
# Include helper functions
THIS_SCRIPT_PATH=$(dirname $(readlink -f "$0"))
source "$THIS_SCRIPT_PATH"/../../cmake_targets/tools/build_helper
# Set environment variables (OPENAIR_HOME, ...)
set_openair_env
echo $OPENAIR_DIR
NB_UE=0
CLEAN=false
for arg in "$@"; do
case $arg in
--nb-ue)
NB_UE="$2"
shift 2
;;
-c)
CLEAN=true
shift
;;
*)
;;
esac
done
cleanup() {
echo "Cleaning up namespaces and stopping processes..."
# Stop all namespaces for UEs
if [[ $NB_UE -gt 0 ]]; then
for ((i=1; i<=NB_UE; i++)); do
echo "Deleting namespace for UE $i..."
$OPENAIR_DIR/tools/scripts/multi-ue.sh -d "$i"
done
fi
# Kill gNB and UE processes
echo "Stopping gNB and UE processes..."
pkill -f nr-softmodem
pkill -f nr-uesoftmodem
echo "Cleanup complete."
}
if $CLEAN; then
cleanup
exit 0
fi
if [[ $NB_UE -le 0 ]]; then
echo "Usage: $0 --nb-ue <number_of_ues> [-c]"
exit 1
fi
run_command() {
"$@" &
}
sudo mkdir -p $OPENAIR_DIR/logs
echo "Starting the gNB..."
cd $OPENAIR_DIR/cmake_targets/ran_build/build || exit
run_command sudo ./nr-softmodem -O ../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band77.fr1.273PRB.usrpx300.conf\
--gNBs.[0].min_rxtxtime 6 --rfsim > $OPENAIR_DIR/logs/gNB_output.log 2>&1
sleep 5
echo "Launching $NB_UE UEs..."
for ((i=1; i<=NB_UE; i++)); do
echo "Launching UE $i in its namespace..."
if ! ip netns list | grep -q "ue$i"; then
echo "Namespace ue$i does not exist. Creating it..."
sudo $OPENAIR_DIR/tools/scripts/multi-ue.sh -c $i
else
echo "Namespace ue$i already exists."
fi
IMSI=$(printf "%015d" $((1010000000000 + i)))
BROKER_IP="10.$((200 + i)).1.100"
LOG_FILE="$OPENAIR_DIR/logs/UE_${i}.log"
ip netns exec "ue$i" bash -c "
cd $OPENAIR_DIR/cmake_targets/ran_build/build
sudo ./nr-uesoftmodem -r 273 --numerology 1 --band 77 -C 3949740000 --ssb 1492 \
--uicc0.imsi $IMSI --rfsim --device_id $i --brokerip \"$BROKER_IP\" \
> \"$LOG_FILE\" 2>&1 &
"
sleep 7
echo "Exiting namespace for UE $i."
done
echo "Displaying gNB output:"
tail -f $OPENAIR_DIR/logs/gNB_output.log