我正在尝试修改 aodv 协议,以在 NS-3 中的 MANET 中实施洪水攻击预防方案,这是我从已经发表的论文中获得的第一个任务。该方法是为了防止恶意节点通过其邻居转发过多的 RREQ 数据包。入侵者节点的邻居记录其行为并通过信任函数检查其信任。一旦达到 RREQ 限制的固定阈值,节点就会拒绝来自恶意节点的任何 RREQ。
我正处于学习 NS-3 的初级阶段,比如如何编辑协议并使更改生效。这是我第一次体验像 NS-3 这样的模拟器工具。我真的找不到有用的资源材料来学习 NS-3 的基础知识。
最初在学习从我新创建的文件夹中运行 .cc 文件时,ns-3/ns-allinone-3.19/ns-3.19/src
我尝试了以下操作:
复制该位置中的 aodv 文件夹
ns-3/ns-allinone-3.19/ns-3.19/src
并将该文件夹重命名为test
.然后我将
aodv.cc
文件重命名ns-3/ns-allinone-3.19/ns-3.19/src/test/examples
为aodv1.cc
.
-下我取代了所有出现aodv.cc
与aodv1.cc
在wscript
文件中。
-接下来我尝试aodv1.cc
使用命令运行./waf --run aodv1.cc
;我得到以下信息:
Waf: Entering directory `.../ns-3/ns-allinone-3.19/ns-3.19/build'
Could not find a task generator for the name 'ns3-test'
任何人都可以帮助修改 NS-3 中的协议的基本步骤,特别是与重命名和编辑文件时在 NS-3 中的其他文件中所做的更改有关的内容说aodv.cc
. 即使学习 NS-3 的这些基础知识,我也真的很困惑。
截图:
....:~/ns-3/ns-allinone-3.19/ns-3.19$ ./waf distclean
'distclean' finished successfully (0.198s)
....:~/ns-3/ns-allinone-3.19/ns-3.19$ ./waf configure
Setting top to : ..../ns-3/ns-allinone-3.19/ns-3.19
Setting out to : ..../ns-3/ns-allinone-3.19/ns-3.19/build
Checking for 'gcc' (c compiler) : /usr/bin/gcc
Checking for cc version : 4.7.3
Checking for 'g++' (c++ compiler) : /usr/bin/g++
Checking for compilation flag -Wl,--soname=foo... support : ok
Checking for program python : /usr/bin/python
Checking for python version : (2, 7, 4, 'final', 0)
Checking for library python2.7 in LIBDIR : yes
Checking for program /usr/bin/python-config,python2.7-config,python-config-2.7,python2.7m-config : /usr/bin/python-config
Checking for header Python.h : yes
Checking for compilation flag -fvisibility=hidden... support : ok
Checking for compilation flag -Wno-array-bounds... support : ok
Checking for pybindgen location : ../pybindgen-0.16.0.834 (guessed)
Python module pybindgen : ok
Checking for pybindgen version : 0.16.0.834
Checking for types uint64_t and unsigned long equivalence : yes
Checking for types uint64_t and unsigned long long equivalence : no
Checking for the apidefs that can be used for Python bindings : gcc-LP64
Checking for internal GCC cxxabi : complete
Python module pygccxml : not found
Checking boost includes : 1_49
Checking boost libs : ok
Checking for boost linkage : ok
Checking for click location : not found
Checking for program pkg-config : /usr/bin/pkg-config
Checking for 'gtk+-2.0' >= 2.12 : yes
Checking for 'libxml-2.0' >= 2.7 : yes
Checking for type uint128_t : not found
Checking for type __uint128_t : yes
Checking high precision time implementation : 128-bit integer
Checking for header stdint.h : yes
Checking for header inttypes.h : yes
Checking for header sys/inttypes.h : not found
Checking for header sys/types.h : yes
Checking for header sys/stat.h : yes
Checking for header dirent.h : yes
Checking for header stdlib.h : yes
Checking for header signal.h : yes
Checking for header pthread.h : yes
Checking for header stdint.h : yes
Checking for header inttypes.h : yes
Checking for header sys/inttypes.h : not found
Checking for library rt : yes
Checking for header netpacket/packet.h : yes
Checking for header sys/ioctl.h : yes
Checking for header net/if.h : yes
Checking for header net/ethernet.h : yes
Checking for header linux/if_tun.h : yes
Checking for header netpacket/packet.h : yes
Checking for NSC location : not found
Checking for OpenFlow location : ../openflow (guessed)
Checking for library dl : yes
Checking for library xml2 : yes
Checking for library openflow : yes
Checking for 'sqlite3' : yes
Checking for header linux/if_tun.h : yes
Python module gtk : ok
Python module goocanvas : not found
Python module pygraphviz : not found
Checking for program sudo : /usr/bin/sudo
Checking for program valgrind : /usr/bin/valgrind
Checking for 'gsl' : yes
Checking for compilation flag -Wno-error=deprecated-d... support : ok
Checking for compilation flag -Wno-error=deprecated-d... support : ok
Checking for compilation flag -fstrict-aliasing... support : ok
Checking for compilation flag -fstrict-aliasing... support : ok
Checking for compilation flag -Wstrict-aliasing... support : ok
Checking for compilation flag -Wstrict-aliasing... support : ok
Checking for program doxygen : /usr/bin/doxygen
---- Summary of optional NS-3 features:
Python Bindings : enabled
Python API Scanning Support : not enabled (Missing 'pygccxml' Python module)
BRITE Integration : not enabled (BRITE not enabled (see option --with-brite))
NS-3 Click Integration : not enabled (nsclick not enabled (see option --with-nsclick))
GtkConfigStore : enabled
XmlIo : enabled
Threading Primitives : enabled
Real Time Simulator : enabled
Emulated Net Device : enabled
File descriptor NetDevice : enabled
Tap FdNetDevice : enabled
Emulation FdNetDevice : enabled
PlanetLab FdNetDevice : not enabled (PlanetLab operating system not detected (see option --force-planetlab))
Network Simulation Cradle : not enabled (NSC not found (see option --with-nsc))
MPI Support : not enabled (option --enable-mpi not selected)
NS-3 OpenFlow Integration : enabled
SQlite stats data output : enabled
Tap Bridge : enabled
PyViz visualizer : not enabled (Missing python modules: goocanvas, pygraphviz)
Use sudo to set suid bit : not enabled (option --enable-sudo not selected)
Build tests : not enabled (defaults to disabled)
Build examples : not enabled (defaults to disabled)
GNU Scientific Library (GSL) : enabled
'configure' finished successfully (10.951s)
...:~/ns-3/ns-allinone-3.19/ns-3.19$ ./waf
Waf: Entering directory `..../ns-3/ns-allinone-3.19/ns-3.19/build'
Could not find a task generator for the name 'ns3-test'
....:~/ns-3/ns-allinone-3.19/ns-3.19$