To start the testbed, inside *ci-scripts/yaml_files/5g_rfsimulator* , run the following commands:
- Start the 5g core:
docker compose up -d mysql oai-amf oai-smf oai-upf oai-ext-dnWait until all containers are healthy. You can check the containers using the following command
docker compose ps -a- Deploy OAI gNB in RF simulator mode and in Standalone Mode
docker compose up -d oai-gnbwait until the containers are running and healthy
- Deploy OAI NR-UE in RF simulator mode and in Standalone Mode
docker compose up -d oai-nr-ueBefore proceeding with the experiments and measurements, there are a few preliminary steps that need to be followed:
In order to run the next experiments with the PCAP files, a preliminary fix of changing the Source and Destination MAC addresses is needed, following these steps:
- Access EXT-DN entity and check MAC address for eth0 interface using either
ifconfigorip a
$ docker exec -it rfsim5g-oai-ext-dn bash
root@03cb73d7b6ad:/tmp# ifconfig
*eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.72.135 netmask 255.255.255.192 broadcast 192.168.72.191
**ether aa:8e:94:be:7b:c0** txqueuelen 0 (Ethernet)
RX packets 435 bytes 70301 (70.3 KB)*
- Access UPF entity and check MAC address for eth1 interface using either
ifconfigorip a:
$ docker exec -it rfsim5g-oai-upf bash
root@f96643d2d39b:/openair-upf# ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.71.134 netmask 255.255.255.192 broadcast 192.168.71.191
ether 16:3e:02:a7:bc:a7 txqueuelen 0 (Ethernet)
RX packets 396 bytes 56585 (56.5 KB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 299 bytes 15595 (15.5 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
eth1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.72.134 netmask 255.255.255.192 broadcast 192.168.72.191
ether **a2:95:24:81:e0:6e** txqueuelen 0 (Ethernet)
RX packets 495 bytes 75533 (75.5 KB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 417 bytes 35882 (35.8 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
- Install python3, pip and scapy if not already installed.
$ sudo apt install python3
$ sudo apt install python3-pip
$ pip install scapy- Change modify_pcap.py file accordingly with the source and destination MAC addresses. The IP addresses and Ports should remain the same if using the default configuration.
# ...
# IP addresses
new_src_ip = '192.168.72.135' # EXT-DN (Private)
new_dst_ip = '12.1.1.2' # NR-UE (Public)
# MAC addresses
new_src_mac = 'aa:8e:94:be:7b:c0' #ext--dn MAC
new_dst_mac = 'a2:95:24:81:e0:6e' # upf MAC - for NIC: eth1 192.168.72.134
# Ports
new_src_port = 59082
new_dst_port = 12345
# ...- Execute modify_pcap.py, which will create a folder
./pcap_outputswith the modified PCAPs. Do not forget to modify the location of input folder./pcapif its location was changed.
$ python3 modify_pcap.py
./pcaps/haptic/vr/haptic.pcap: 3199/3199
Processed: ./pcaps/haptic/vr/haptic.pcap, Errors: 0
./pcaps/haptic/teleoperation/haptic.pcap: 5233/5233
Processed: ./pcaps/haptic/teleoperation/haptic.pcap, Errors: 0
./pcaps/control/vr/contro.pcap: 3201/3201
Processed: ./pcaps/control/vr/contro.pcap, Errors: 0
./pcaps/control/teleoperation/control.pcap: 5233/5233
Processed: ./pcaps/control/teleoperation/control.pcap, Errors: 0
./pcaps/audio/teleoperation/IMG_4147_20250303134545_audio_sent.pcap: 8301/8301
Processed: ./pcaps/audio/teleoperation/IMG_4147_20250303134545_audio_sent.pcap, Errors: 0
./pcaps/video/vr/video0_4k_60fps_20250303161901_video_sent.pcap: 106509/106509
Processed: ./pcaps/video/vr/video0_4k_60fps_20250303161901_video_sent.pcap, Errors: 0
./pcaps/video/teleoperation/IMG_4147_20250303134545_video_sent.pcap: 299655/299655
Processed: ./pcaps/video/teleoperation/IMG_4147_20250303134545_video_sent.pcap, Errors: 0
[DONE] Processing complete.
### Sent and Received PCAPs
Install required dependencies on EXT-DN:
```bash
docker exec -it rfsim5g-oai-ext-dn bash
root@03cb73d7b6ad:/tmp# sudo apt install tcpdump
root@03cb73d7b6ad:/tmp# sudo apt install tcpreplayInstall required dependencies on UE:
docker exec -it rfsim5g-oai-nr-ue bash
root@03cb73d7b6ad:/tmp# sudo apt install tcpdump
root@03cb73d7b6ad:/tmp# sudo apt install tcpreplaySpecify the Containers and PCAPs involved in the process:
NR_UE_CONTAINER="rfsim5g-oai-nr-ue"
EXT_DN_CONTAINER="rfsim5g-oai-ext-dn"
LOCAL_PCAP_DIR="./pcaps_output" # Input PCAP directory (host)
LOCAL_OUTPUT_DIR="./output" # Output directory (host)
CONTAINER_PCAP_DIR="/opt/oai-ext-dn/ext-dn_files/pcaps" # Mounted path inside the container
N=2 # Number of iterations per pcap file
DURATION=5 # Duration in seconds for capturing packetsRun the experiment script to split the PCAPs into Sent and Received PCAPs:
$ . run_expirement.shIf everything is correct, the following structure should result from the experiment operation:
output
├── audio
│ └── teleoperation
│ ├── IMG_4147_20250303134545_audio_sent_iteration1_received.pcap
│ ├── IMG_4147_20250303134545_audio_sent_iteration1_sent.pcap
│ ├── IMG_4147_20250303134545_audio_sent_iteration2_received.pcap
│ └── IMG_4147_20250303134545_audio_sent_iteration2_sent.pcap
├── control
│ ├── teleoperation
│ │ ├── control_iteration1_received.pcap
│ │ ├── control_iteration1_sent.pcap
│ │ ├── control_iteration2_received.pcap
│ │ └── control_iteration2_sent.pcap
│ └── vr
│ ├── contro_iteration1_received.pcap
│ ├── contro_iteration1_sent.pcap
│ ├── contro_iteration2_received.pcap
│ └── contro_iteration2_sent.pcap
├── haptic
│ ├── teleoperation
│ │ ├── haptic_iteration1_received.pcap
│ │ ├── haptic_iteration1_sent.pcap
│ │ ├── haptic_iteration2_received.pcap
│ │ └── haptic_iteration2_sent.pcap
│ └── vr
│ ├── haptic_iteration1_received.pcap
│ ├── haptic_iteration1_sent.pcap
│ ├── haptic_iteration2_received.pcap
│ └── haptic_iteration2_sent.pcap
└── video
├── teleoperation
│ ├── IMG_4147_20250303134545_video_sent_iteration1_received.pcap
│ ├── IMG_4147_20250303134545_video_sent_iteration1_sent.pcap
│ ├── IMG_4147_20250303134545_video_sent_iteration2_received.pcap
│ └── IMG_4147_20250303134545_video_sent_iteration2_sent.pcap
└── vr
├── video0_4k_60fps_20250303161901_video_sent_iteration1_received.pcap
├── video0_4k_60fps_20250303161901_video_sent_iteration1_sent.pcap
├── video0_4k_60fps_20250303161901_video_sent_iteration2_received.pcap
└── video0_4k_60fps_20250303161901_video_sent_iteration2_sent.pcap
Note that the MAC addresses of each entity change every time you do “compose down” and then “compose up”.
### Fixing Resulting PCAPs
Install required dependencies on EXT-DN:
```bash
$ sudo apt install pcapfix
Run script for fixing PCAPs from /output folder and saving the fixed PCAPs on same folder:
$ . fix_pcaps.sh output
Creating a backup of the input folder: ./output_backup
Backup successfully created at: ./output_backup
Processing file: output/haptic/vr/haptic_iteration1_received.pcap
pcapfix 1.1.7 (c) 2012-2021 Robert Krause
[*] Reading from file: output/haptic/vr/haptic_iteration1_received.pcap
[*] Writing to file: output/haptic/vr/haptic_iteration1_received.pcap
[*] File size: 1245689 bytes.
[+] This is a PCAP file.
[*] Analyzing Global Header...
[+] The global pcap header seems to be fine!
[*] Analyzing packets...
[*] Progress: 20.01 %
[*] Progress: 40.00 %
[*] Progress: 60.00 %
[*] Progress: 80.01 %
[*] Progress: 100.00 %
[*] Your pcap file looks proper. Nothing to fix!
Processing file: output/haptic/vr/haptic_iteration1_sent.pcap
pcapfix 1.1.7 (c) 2012-2021 Robert Krause
[*] Reading from file: output/haptic/vr/haptic_iteration1_sent.pcap
[*] Writing to file: output/haptic/vr/haptic_iteration1_sent.pcap
[*] File size: 2607139 bytes.
[+] This is a PCAP file.
[*] Analyzing Global Header...
[+] The global pcap header seems to be fine!
[*] Analyzing packets...
[*] Progress: 20.00 %
[*] Progress: 40.01 %
[*] Progress: 60.01 %
[*] Progress: 80.00 %
[*] Progress: 100.00 %
[*] Your pcap file looks proper. Nothing to fix!
Processing file: output/haptic/vr/haptic_iteration2_received.pcap
pcapfix 1.1.7 (c) 2012-2021 Robert Krause
[*] Reading from file: output/haptic/vr/haptic_iteration2_received.pcap
[*] Writing to file: output/haptic/vr/haptic_iteration2_received.pcap
[*] File size: 654578 bytes.
[+] This is a PCAP file.
[*] Analyzing Global Header...
[+] The global pcap header seems to be fine!
[*] Analyzing packets...
[*] Progress: 20.01 %
[*] Progress: 40.02 %
[*] Progress: 60.00 %
[*] Progress: 80.01 %
[*] Progress: 100.00 %
[*] Your pcap file looks proper. Nothing to fix!
Processing file: output/haptic/vr/haptic_iteration2_sent.pcap
pcapfix 1.1.7 (c) 2012-2021 Robert Krause
[*] Reading from file: output/haptic/vr/haptic_iteration2_sent.pcap
[*] Writing to file: output/haptic/vr/haptic_iteration2_sent.pcap
[*] File size: 696320 bytes.
[+] This is a PCAP file.
[*] Analyzing Global Header...
[+] The global pcap header seems to be fine!
[*] Analyzing packets...
[*] Progress: 20.00 %
[*] Progress: 40.01 %
[*] Progress: 60.02 %
[*] Progress: 80.02 %
[+] CORRECTED Packet #3186 at position 696270 (1751371596 | 264644 | 34 | 205).
[*] Progress: 100.00 %
[*] Wrote 3186 packets to file.
[+] SUCCESS: 1 Corruption(s) fixed!Copy the fixed PCAP files on the /output folder to /tmp folder for later processing.
$ sudo cp -R output /tmppython measure_latency.py
Output: A CSV file for audio and/or video and/or control and/or haptic will be saved, with the following format:
Sender_Time,Receiver_Time,Latency_ms
1742040927.312693,1742040927.313672,0.9789466857910156
1742040927.313705,1742040927.314399,0.6940364837646484
1742040927.314425,1742040927.315299,0.8740425109863281
1742040927.315099,1742040927.315939,0.8399486541748047
1742040927.31573,1742040927.316487,0.7569789886474609
1742040927.316351,1742040927.317101,0.7500648498535156
1742040927.316975,1742040927.317692,0.7169246673583984
1742040927.317717,1742040927.318623,0.9059906005859375
1742040927.318333,1742040927.319266,0.9331703186035156
1742040927.318911,1742040927.319754,0.8428096771240234
1742040927.319518,1742040927.32031,0.7920265197753906
1742040927.320118,1742040927.321103,0.9851455688476562
1742040927.320705,1742040927.321667,0.9620189666748047
1742040927.321302,1742040927.322236,0.9341239929199219
1742040927.321924,1742040927.322747,0.8230209350585938