参考:
https://www.nsnam.org/docs/dce/manual/html/dce-user-newapps.html
ns3 DCE Introduction
//https://www.nsnam.org/docs/dce/manual/html/intro.html
下面这个更全面:
https://www.nsnam.org/docs/dce/release/1.0/manual/singlehtml/index.html
Tested environment
这里并没有ubuntu-14.04
以及以上的。我在ubuntu-14.04
和ubuntu-16.04
上都尝试了多遍安装都没有成功,最后在ubuntu-12.04
中安装成功了。其中ccnx的下载非常慢。可以直接找到ccnx下载的url用wget下载,校验一下hash值确保正确即可。
User’s Guide
https://www.nsnam.org/docs/dce/manual/html/dce-user-doc.html
Quick Start
https://www.nsnam.org/docs/dce/manual/html/getting-started.html
需要用到的类
- DceManagerHelpe
#include "ns3/dce-manager-helper.h"
- DceApplicationHelper
#include "ns3/dce-application-helper.h"
- LinuxStackHelper
#include "ns3/linux-stack-helper.h"
- CcnClientHelper
#inlcude "ns3/ccn-client-helper.h"
- QuaggaHelper
#inlcude "ns3/quagga-helper.h"
但是实际上如果要在ns3中使用DCE,只需要 #include "ns3/dce-module.h"
即可。
写一个ns3脚本
在DCE的主目录ns-3-dce
下有一个myscripts
目录。这个目录是用来放你要运行的scripts的。要创建一个新的script,你得在myscripts
目录下创建一个新的目录, 然后把你script的源文件和一个配置文件供waf编译系统使用,并且这个配置文件要已wscript
为名。可以参考myscripts/ping
目录。
编译这个脚本
只需要执行waf命令即可编译脚本。结果会在build/bin/myscripts/foo/bar
目录下。其中foo
是你刚才为了那个脚本创建的目录,bar
是根据你写的wscript
的内容,你的用来执行的脚本。
运行这个脚本
就像运行其他程序一样。
$ ./waf --run bar
结果
The execution of the apps using DCE generates special files which reflect the execution thereof. On each node DCE creates a directory /var/log, this directory will contain subdirectory whose name is a number. This number is the pid of a process. Each of these directories contains the following files cmdline, status, stdout, stderr. The file cmdline recalls the name of the executable run followed arguments. The file status contains an account of the execution and dating of the start; optionally if the execution is completed there is the date of the stop and the return code. The files stdout and stderr correspond to the standard output of the process in question.
Realistic ICN experimentation using Direct Code Execution and ns-3(Hands-on DCE)
http://www.comelec.telecom-paristech.fr/uploads/tx_dbcomelec/20140206.pdf