标签:tco examples xml文件 字节 web https str scratch uda
存档使用,ns3及netanim安装过程不赘述。
sudo vi myfirst.cc
在myfirst.cc里面,加上头文件:
#include "ns3/netanim-module.h"
run前面加上三句代码( 第二三行是描绘两个节点的坐标,也可以不要):
AnimationInterface anim("myfirst.xml");
anim.SetConstantPosition(nodes.Get(0), 1.0, 2.0);
anim.SetConstantPosition(nodes.Get(1), 2.0, 3.0);
Simulator::Run();
Simulator::Destroy();
return 0
ns3编译有两种方法(示例编译first)
./waf clean
./waf -d debug --enable-examples --enable-tests configure
./waf --run first
cp examples/tutorial/first.cc scratch/myfirst.cc //将脚本复制到scratch目录下
./waf --run scratch/myfirst
‘build‘ finished successfully (46m21.851s)
At time 2s client sent 1024 bytes to 10.1.1.2 port 9
At time 2.00369s server received 1024 bytes from 10.1.1.1 port 49153
At time 2.00369s server sent 1024 bytes to 10.1.1.1 port 49153
At time 2.00737s client received 1024 bytes from 10.1.1.2 port 9
./NetAnim
参考资料 https://blog.csdn.net/qq_31676673/article/details/87992757
标签:tco examples xml文件 字节 web https str scratch uda
原文地址:https://www.cnblogs.com/poziiey/p/12631434.html