mirror of
https://gitlab.eurecom.fr/oai/openairinterface5g.git
synced 2026-07-14 13:10:28 +00:00
Compare commits
101 Commits
pre-commit
...
rfsim-pubs
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9b1907db0b | ||
|
|
1749b35664 | ||
|
|
cced8752f2 | ||
|
|
c8206efb1c | ||
|
|
b00585ecf0 | ||
|
|
a7597732ac | ||
|
|
c1d060c9ef | ||
|
|
36c9f1b9fb | ||
|
|
d00edb4c27 | ||
|
|
796533ab6f | ||
|
|
37e62e6243 | ||
|
|
5567bfcd59 | ||
|
|
813f0924db | ||
|
|
2026835546 | ||
|
|
d8c6d61fbd | ||
|
|
89703fd45b | ||
|
|
c3ee384036 | ||
|
|
30bc83483a | ||
|
|
ca19267dd2 | ||
|
|
2e12fc199b | ||
|
|
8f6f165f6e | ||
|
|
20bcc81b8c | ||
|
|
eae8863a16 | ||
|
|
91f1e76f7d | ||
|
|
55b7ad64f1 | ||
|
|
a1acd001f6 | ||
|
|
2c2e6e0dee | ||
|
|
081fdcad1f | ||
|
|
a83ac94aa2 | ||
|
|
081be162fc | ||
|
|
2a1af1a169 | ||
|
|
3bcd05d621 | ||
|
|
f8eed46b40 | ||
|
|
e8cd07c88d | ||
|
|
df683b284a | ||
|
|
375471ce5f | ||
|
|
5dc499e467 | ||
|
|
5648d6a92f | ||
|
|
fc7afc5ad3 | ||
|
|
3eb578258e | ||
|
|
9cc9691622 | ||
|
|
4ba99012f4 | ||
|
|
63fc9b6462 | ||
|
|
074a58150a | ||
|
|
4e8b163720 | ||
|
|
19df5e5ae5 | ||
|
|
cfa86e1cbf | ||
|
|
133785dbc0 | ||
|
|
e79f2e1d61 | ||
|
|
6533f81f58 | ||
|
|
e365d392c0 | ||
|
|
bb7bdcb3e7 | ||
|
|
305962ac72 | ||
|
|
ea3038b6c9 | ||
|
|
3ccc283aad | ||
|
|
dc06f10399 | ||
|
|
22c867a811 | ||
|
|
07bc3c87bf | ||
|
|
06e99b2fb3 | ||
|
|
416c60e1d6 | ||
|
|
0866d97de1 | ||
|
|
9cce0c2653 | ||
|
|
46505bec55 | ||
|
|
1b3d1ad8d9 | ||
|
|
db1dbf5a94 | ||
|
|
29f2accf71 | ||
|
|
6b47aba0f1 | ||
|
|
5b43544568 | ||
|
|
d2e585c543 | ||
|
|
ab356d2cf0 | ||
|
|
4bca77f847 | ||
|
|
4785b823d0 | ||
|
|
4619e0cc73 | ||
|
|
579a5ab3b7 | ||
|
|
1324240a3a | ||
|
|
e200d02a2c | ||
|
|
828ec31d59 | ||
|
|
0b2c8f56a5 | ||
|
|
5ab799f867 | ||
|
|
055ac7a3c8 | ||
|
|
097c1ee8c8 | ||
|
|
49c51f4cdb | ||
|
|
ccf3f0fcfc | ||
|
|
55cddf2ab1 | ||
|
|
13f17a76f6 | ||
|
|
8d154cf3f3 | ||
|
|
026812a0cb | ||
|
|
79b998d975 | ||
|
|
576a214abc | ||
|
|
8ac684ecdb | ||
|
|
3806b49c68 | ||
|
|
a5f4702ea8 | ||
|
|
2ec3938e62 | ||
|
|
d035ab698c | ||
|
|
a490fc65b3 | ||
|
|
427be66a57 | ||
|
|
3ec9f7553c | ||
|
|
eae89d8c66 | ||
|
|
81b82c7e6f | ||
|
|
a850ea4dbc | ||
|
|
cc85a641a8 |
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
4
doc/rfsimulator_pub_sub/rfsim-pubsub-architecture.svg
Executable file
4
doc/rfsimulator_pub_sub/rfsim-pubsub-architecture.svg
Executable file
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 102 KiB |
161
doc/rfsimulator_pub_sub/rfsim_pub_sub.md
Normal file
161
doc/rfsimulator_pub_sub/rfsim_pub_sub.md
Normal 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:
|
||||

|
||||
|
||||
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.
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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));
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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"
|
||||
|
||||
|
||||
@@ -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()
|
||||
|
||||
56
radio/rfsimulator/broker.c
Normal file
56
radio/rfsimulator/broker.c
Normal 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;
|
||||
}
|
||||
1420
radio/rfsimulator/simulator_pub_sub.c
Normal file
1420
radio/rfsimulator/simulator_pub_sub.c
Normal file
File diff suppressed because it is too large
Load Diff
@@ -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
|
||||
}
|
||||
|
||||
|
||||
99
tools/scripts/test_automation.sh
Normal file
99
tools/scripts/test_automation.sh
Normal 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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user