ns3gym与ns3ai的安装方法

编译运行的常用命令
1,针对ns3主项目的编译命令
分两步:第一,./waf ;第二,./waf(或者./waf build)
详见《开源网络模拟器ns3》P13
2,针对多脚本同时运行的编译命令
ns3-ai的相关笔记
安装方法
基本要求:一定要检查系统的版本是否是或以上,否则无法安装ns3-ai的- 。ns3-ai适配的ns3版本为ns-3.30(务必使用ns-3.30),应先在系统下(以 16.04为例)成功安装并编译好ns-3.30后再进行下列操作步骤 。
参考资料:
1,ns3-ai文献:Yin H, Liu P, Liu K, et al. ns3-ai:for[C]// of the 2020on ns-3. 2020: 57-64.
2,ns3-ai在NS3 App Store上的网页介绍(推荐使用,结合下面的详细安装步骤即可)
ns-3 App Store - ns3-ai
3,ns3-ai在上的开源代码网页(也可成功安装)
- hust-/ns3-ai:thens-3 andusing , which mean you can train and test your AIin ns-3anyyou are using now!
详细安装步骤:
1,将网上下载的源码(推荐使用“参考资料2”中的源码)解压后再添加到ns-3.30中的目录下,并重新命名为ns3-ai
2,重新编译ns-3.30
./waf
./waf
3,Add
3.1,( is used and )
cd $//ns3-ai/
setup.py--user
步骤3.1完成后,则安装完毕
3.2,Baisc usage(此处应该是介绍 的用途,以下代码在安装步骤中不需要执行)
.Init(1234, 4096) # key
v = (233, c_int*10)
with v as o:
for i in range(10):
o[i] = c_int(i)
print(*o)
.()
4,测试是否成功安装
RL-TCP (ns3和ai是在两个终端窗口上运行的)
4.1,Run ns-3 (终端窗口1):
cp -r contrib/ns3-ai/example/rl-tcp scratch/./waf --run "rl-tcp"
4.2,Runcode(终端窗口2):
cd contrib/ns3-ai/example/rl-tcp/python testtcp.py
NOTE:the RL test inis not fully ,soon.
问题:目前在4.2步骤中运行命令后无反应,问题待解决(可查阅相关issue中的问答记录)
ns3-gym的相关笔记
安装方法
基本要求:ns3-gym适配的ns3版本为ns-3.29(务必使用ns-3.29),ns3-gym官网上示意.04为例进行介绍安装步骤的(不排除可兼容更高版本的系统) 。应先在系统下成功安装并编译好ns-3.29后再进行下列操作步骤 。
参考资料:
1,ns3-gym文献:Gaw?owicz P, Zubow A. Ns-3 meetsgym: Theforin[C]// of the 22ndACMon ,andofand. 2019: 113-120.
2,ns3-gym在NS3 App Store上的网页介绍(推荐使用,结合下面的详细安装步骤即可)
ns-3 App Store - ns3-gym:Gym
3,ns3-gym在上的开源代码网页(编译时会出现ZMQ报错,可查阅上的 寻找解决方法)
- tkn-tub/ns3-gym: ns3-gym - Theforin
详细安装步骤:
1,from the
the(推荐使用“参考资料2”中的源码) andit:
tar -xzf ns3-gym-1.0.0.tar.gz
Move (and ) the ns3-gym-1.0.0to(将解压后的文件重命名为,并放置到目录内):
ns-3.29//
注:放置到src目录内也可以安装成功
2,ZMQ andlibs:
Note: to-3.6 on16.04, run:
sudo add-apt- ppa:-/
sudo apt-get
Then:

ns3gym与ns3ai的安装方法

文章插图
sudo apt-get-dev -y
sudo apt-get-dev -y
sudo apt-get- -y
3,and build ns-3 :
Note: if you use,theseit.
Note:(C++ and ) are build.
./waf---
./waf build
(成功运行上述命令后,可以看到控制台输出的 built列表中包含了)
4,.
Note:is .
4.1,(notif ./wafwas ):
(如果第3步中使用./waf 命令编译,未加上---,则无需进行4.1步骤)
cd ./ns-3.29///
-I=./model/ --=./model// ./model/.proto