Example Scenarios 2 - nps-ros2/ns3_testbed GitHub Wiki
See Setup for setup.
NOTE: This is a preliminary DRAFT. Graphs look wrong. Math needs evaluated. 802.11 MAC traffic needs evaluated.
Sensor QoS
This example models one robot talking to four robots using Sensor QoS, as follows:
The scenario setup file for this example defines 10-byte messages at 2 Hz using QoS history=keep_last, depth=5, reliability=best_effort, and durability=volatile. It is at https://github.com/nps-ros2/ns3_testbed/blob/master/csv_setup/example_keep_last_5.csv and is shown here:
Publish,,,,,,,
Node,Subscription,Frequency,Size,History,Depth,Reliability,Durability
R1,odometry,2,10,keep_last,5,best_effort,volatile
,,,,,,,
Subscribe,,,,,,,
Node,Subscription,History,Depth,Reliability,Durability,,
R2-5,odometry,keep_last,5,best_effort,volatile,,
The ns-3 setup file for this example is at https://github.com/nps-ros2/ns3_testbed/blob/master/csv_setup/ns3_25_7.csv and is shown here:
mobility,,,
Node,X,Y,Walks
R1,0,0,false
R2,25.7,0,false
R3,0,25.7,false
R4,-25.7,0,false
R5,0,-25.7,false
Run
-
Start the Testbed Monitor, specifying to write output to file
sensor.csv
:cd ~/gits/ns3_testbed/testbed_monitor ./testbed_monitor.py -o sensor.csv
-
Start the ns-3 simulator program, providing setup file
ns3_25_7.csv
:cd ~/gits/ns3_testbed/ns3_programs/build ./ns3_mobility -s ns3_25_7.csv
-
Start the robots, providing setup file
example_keep_last_5.csv
:sudo /bin/bash cd ~/gits/ns3_testbed/cpp_testbed_runner/build/cpp_testbed_runner ./testbed_runner -c 5 -i example_keep_last_5.csv -n -p
-
Allow the simulation to run for a few minutes, then stop the started programs.
Analysis
When we ran the testbed monitor, it created output in CSV file sensor.csv
. We post-processed this output using the plot_analytics.py
program, specifying the output name, plot title text, maximum latency, and the root name of the output file to write to:
cd ~/gits/ns3_testbed/testbed_monitor
./plot_analytics.py sensor.csv "keep last 5, best_effort, volatile", -m 100 -w sensor
Here are the results:
Latency point plot:
Latency:
Loss:
Throughput:
3V3
3v3 consists of 7 robots: two teams, three drones each, 1 ground station. Mobility is random walk, in range, and QoS is the ROS2 Sensor QoS model.
Configuration
Scenario setup in example_3v3.csv
:
Publish,,,,,,,
Node,Subscription,Frequency,Size,History,Depth,Reliability,Durability
R1,heartbeat,1,20,keep_last,0,best_effort,volatile
R2-7,flight status,2,48,keep_lst,0,best_effort,volatile
R2-7,pose,10,56,keep_last,0,best_effort,volatile
R1,red pose,10,40,keep_last,0,best_effort,volatile
,,,,,,, and QoS is random walk drones, in range, Sensor QoS.
Subscribe,,,,,,,
Node,Subscription,History,Depth,Reliability,Durability,,
R2-7,heartbeat,keep_last,0,best_effort,volatile
R1,flight status,keep_last,0,best_effort,volatile
R1,pose,keep_last,0,best_effort,volatile
R2-7,red pose,keep_last,0,best_effort,volatile
ns-3 setup in ns3_1_gs.csv
:
mobility,,,
Node,X,Y,Walks
R1,0,0,false
R2-99,0,0,true
Run
Testbed monitor, output to 3v3.csv:
cd ~/gits/ns3_testbed/testbed_monitor
./testbed_monitor.py -o 3v3.csv
ns-3 simulator for 1 GS and random-walk nodes:
cd ~/gits/ns3_testbed/ns3_programs/build
./ns3_mobility -c 7 -l 10 -s ns3_1_gs.csv
Robots running the 3v3 scenario:
sudo /bin/bash
cd ~/gits/ns3_testbed/cpp_testbed_runner/build/cpp_testbed_runner
./testbed_runner -c 7 -i example_3v3.csv -n -p
Allow the simulation to run for a while.
Analysis
Create plots:
cd ~/gits/ns3_testbed/testbed_monitor
./plot_analytics.py 3v3.csv "3v3" -m 175 -w 3v3
Latency point plot:
Latency:
Loss:
Throughput:
6v6
Run
Testbed monitor, output to 6v6.csv:
cd ~/gits/ns3_testbed/testbed_monitor
./testbed_monitor.py -o 6v6.csv
ns-3 simulator for 1 GS and random-walk nodes:
cd ~/gits/ns3_testbed/ns3_programs/build
./ns3_mobility -c 13 -l 10 -s ns3_1_gs.csv
Robots running the 6v6 scenario:
sudo /bin/bash
cd ~/gits/ns3_testbed/cpp_testbed_runner/build/cpp_testbed_runner
./testbed_runner -c 13 -i example_6v6.csv -n -p -s
Allow the simulation to run for a while.
Analysis
Create plots:
cd ~/gits/ns3_testbed/testbed_monitor
./plot_analytics.py 6v6.csv "6v6" -m 30 -w 6v6
Note that robots are started at staggered intervals. Otherwise, it takes several minutes for traffic to stabilize.
Latency point plot:
Latency:
Loss:
Throughput: