ns-3仿真可视化工具

来源:互联网 发布:潍坊学院网络信息门户 编辑:程序博客网 时间:2024/05/10 16:44

PyViz工具使用参考网址:http://www.nsnam.org/wiki/index.php/PyViz

1)PyViz安装

  • 安装依赖包
[html]view plaincopy
  1. sudo apt-get install python-dev python-pygraphviz python-kiwi python-pygoocanvas  python-gnome2 python-gnomedesktop python-rsvg 

安装python-gnomedesktop时遇到问题,我的系统是linuxmint17.3

正在读取软件包列表... 完成
正在分析软件包的依赖关系树       
正在读取状态信息... 完成       
E: 未发现软件包 python-gnomedesktop
于是在网上找到相应的包,下载链接,下载下来手动安装。
  • 安装交互python使得GUI上有控制台按钮
[html]view plaincopy
  1. sudo apt-get install ipython  
安装pygccxml 模块  sudo apt-get install python-pygccxml

2)PyViz测试
  • C++脚本
[html]view plaincopy
  1. ./waf --run scratch/second --vis

NetAnim工具使用参考网址:http://www.nsnam.org/wiki/index.php/NetAnim

1)安装NetAnim

  • 安装依赖包并下载
[html]view plaincopy
  1. sudo apt-get install mercurial  
  2. sudo apt-get install qt4-dev-tools 
  3. cd ~/workspace/NS3/ns-allinone-3.25(推荐将netanim放到ns3目录下)
  4. (ns-allinone-3.25里已经有netanim-3.107,无需再下载)hg clone http://code.nsnam.org/netanim
  • 安装NetAnim
[html]view plaincopy
  1. cd netanim
  2. qmake NetAnim.pro  (For MAC Users: qmake -spec macx-g++ NetAnim.pro) 
    //报错,qmake: could not exec '/usr/lib/x86_64-linux-gnu/qt4/bin/qmake': No such file or directory
    ,尝试sudo apt-get install qt5-default,然后重复步骤2,搞定。
  3. make  

  • 运行实例产生.xml文件供NetAnim解析
[html]view plaincopy
  1. ./waf --run scratch/wireless-animation(wireless-animation原文件在src/netanim/examples目录下)
  • 解析.xml
进入NetAnim安装目录中,执行./NetAnim,出现图形用户界面。点击文件打开按钮(左上角),加载上述生成的.xml文件,就能出现网络拓扑的可视化界面。


0 0
原创粉丝点击