A NS3 topology generator for massive nodes, by Star-of-Star topology
hybrid-virtual-routing, for VLC-RF Backended Wi-Fi Relay Network
Tech-Tag: ns3
rapidjson
root-tree
describe the network from-top-to-bottom in JSON format, self-recursive and iterable
Demo
graph TB
subgraph GroupB
A1[Router1]-.VLC.->B1_0[Relay_1_0]
B1_0-.WiFi.->A1
A1-.VLC.->B1_1[Relay_1_1]
B1_1-.WiFi.->A1
end
subgraph GroupA
A0[Router0]-.VLC.->B0_0[Relay_0_0]
B0_0-.WiFi.->A0
A0-.VLC.->B0_1[Relay_0_1]
B0_1-.WiFi.->A0
end
B0_0---C0[UE Group]
B0_1---C1[UE Group]
B1_0---C2[UE Group]
B1_1---C3[UE Group]
build ns3
following official tutorial;
ln -s <this-repo-full-path> <your-ns3-full-path>/examples/main
add following code in your ~/.zshrc
or ~/.bashrc
:
# Waf section
WAF_PATH=<your-ns3-full-path>
WAF_EDITOR=<your-prefered-editor>
export PATH=$WAF_PATH:$PATH
function wafls() {
ls $WAF_PATH/$1 ${${*}#${1}}
}
function wafcd() {
cd $WAF_PATH/$1 ${${*}#${1}}
}
function wafed() {
$WAF_EDITOR $WAF_PATH/$1 ${${*}#${1}}
}
function wafbuild() {
local pwd_tmp=$PWD
cd $WAF_PATH && ./waf
cd $pwd_tmp
}
function wafrun() {
local pwd_tmp=$PWD
cd $WAF_PATH && waf --run $*
cd $pwd_tmp
}
function wafgdb() {
local pwd_tmp=$PWD
cd $WAF_PATH && waf --run $1 --command-template="gdb ${${*}#${1}}"
cd $pwd_tmp
}
function wafpcap_mv() {
rm -rf ./$1-\*.pcap && mv -f $WAF_PATH/$1-*.pcap ./$1-pcap/
}
source
the configuration file
wafrun main
to run the main simulation