ndn挖坑记(一)

时间:2022-07-22
本文章向大家介绍ndn挖坑记(一),主要内容包括其使用实例、应用技巧、基本知识点总结和需要注意事项,具有一定的参考价值,需要的朋友可以参考一下。

NDN是什么(简单记录)

NDN是命名数据网络的缩写,简单来是说以数据命名取代IP 的主体地位,数据名称取代了IP 作为网络中的唯一标识在网络层的数据请求、路由、转发以上层应用直接关心的数据名称作为第一语义,而不用关心数据所在位置。

更多详情:NDN

ndnSIM的安装

关于NDN的仿真必须在ndnSIM上面跑,所以安装这个是必不可少的。

环境:ubuntu 18.04 LTS + ndnSIM2.7

ndnSIM是有自己的官网教程的,遇到问题应该优先查找文档寻找解决。

编译运行的错误记录

Traceback (most recent call last):
File "<string>", line 3, in <module>
File "/usr/lib/python2.7/py_compile.py", line 117, in compile
   raise py_exc
py_compile.PyCompileError:   File
"/usr/local/lib/python2.7/dist-packages/visualizer/base.py", line 139
   print("Plugin %r has no 'register' function" % name,file=sys.stderr)
SyntaxError: invalid syntax

python语法错误,估计是版本不兼容问题,所以去掉上面文件中第139行的的file=即可

首先把/ndnSIM/ns-3/src/visualizer/visualizer/hub.py"文件中修改开头部分的"from . import core"为“import core",然后运行下面的命令行。

No visualization support,对于可视化模块启动失败,在官网教程中也有提及 https://ndnsim.net/current/best-practices.html

在 How to run the simulation scenarios (with visualizer) 中提到 To run a scenario with the visualizer, you will have to setup some python environment variables to find the visualizer module. The easiest way to do so is by using the following commands:

cd ns-dev/ns-3   //即ns-3所在的文件夹
./waf shell

就是进入即ns-3所在的文件夹,然会运行./waf shell之后在启动可视化模块就可以了。