ns3中loopback接口是在什么时候创建的?
来源:互联网 发布:现代软件学院 编辑:程序博客网 时间:2024/05/16 06:06
参考定位的地方:
Breakpoint 3, ns3::Node::GetNDevices (this=0x6617f0) at ../src/network/model/node.cc:146
146 return m_devices.size ();
(gdb) bt
#0 ns3::Node::GetNDevices (this=0x6617f0) at ../src/network/model/node.cc:146
#1 0x00007ffff6cb8c7c in ns3::Ipv4L3Protocol::SetupLoopback (this=0x662cf0) at ../src/internet/model/ipv4-l3-protocol.cc:265
#2 0x00007ffff6cb7a24 in ns3::Ipv4L3Protocol::SetNode (this=0x662cf0, node=...) at ../src/internet/model/ipv4-l3-protocol.cc:156
#3 0x00007ffff6cb8077 in ns3::Ipv4L3Protocol::NotifyNewAggregate (this=0x662cf0) at ../src/internet/model/ipv4-l3-protocol.cc:197
#4 0x00007ffff73714e3 in ns3::Object::AggregateObject (this=0x6617f0, o=...) at ../src/core/model/object.cc:306
#5 0x00007ffff6ee4784 in ns3::InternetStackHelper::CreateAndAggregateObjectFromTypeId (node=..., typeId=...) at ../src/internet/helper/internet-stack-helper.cc:419
#6 0x00007ffff6ee49f9 in ns3::InternetStackHelper::Install (this=0x7fffffffd320, node=...) at ../src/internet/helper/internet-stack-helper.cc:435
#7 0x00007ffff6ee4632 in ns3::InternetStackHelper::Install (this=0x7fffffffd320, c=...) at ../src/internet/helper/internet-stack-helper.cc:403
#8 0x000000000040f43c in main (argc=1, argv=0x7fffffffdc98) at ../myscripts/ns-3-dce-quagga/example/dce-quagga-isisd.cc:98
(gdb) p m_devices.size()
$3 = 1
(gdb)
寻迹象找到的创建lo接口的地方如下,
// First check whether an existing LoopbackNetDevice exists on the node for (uint32_t i = 0; i < m_node->GetNDevices (); i++) { if ((device = DynamicCast<LoopbackNetDevice> (m_node->GetDevice (i)))) { break; } } if (device == 0) { device = CreateObject<LoopbackNetDevice> (); m_node->AddDevice (device); }
通常创建的方法是,
Ipv4AddressHelper ipv4AddrHelper; // Internet stack install InternetStackHelper stack; // IPv4 is required for GlobalRouteMan Ipv4DceRoutingHelper ipv4RoutingHelper; stack.SetRoutingHelper (ipv4RoutingHelper); stack.Install (nodes);
这里的routingHelper可以是别的routingHelper,而非一定是dce的。
stack.Install(nodes)调用的顺序会影响接口ifIndex的值。
节点计算ifIndex的方法是:累加
uint32_t index = m_devices.size (); m_devices.push_back (device); device->SetNode (this); device->SetIfIndex (index);
- ns3中loopback接口是在什么时候创建的?
- ns3为协议默认安装的loopback接口
- 在Linux中创建回环设备(loopback device)的方法
- 在JavaScript中什么时候使用==是正确的?
- Loopback接口的主要作用
- loopback接口的具体作用
- 对象是在什么时候被release的?
- 对象是在什么时候被release的?
- MBA调剂是在什么时候进行的?
- Loopback 接口
- springmvc中拦截器,HandlerInterceptor接口的三个方法分别在什么时候拦截
- 在eclipse中配置ns3
- 在NS3中添加新的VANET模块
- loopback(本地回环)接口的作用
- Android view的getHeight()是在什么时候有值的
- delphi 全局变量 HInstance 到底是在什么时候赋值的?
- loadView, viewDidLoad, viewDidUnLoad,分别是在什么时候被调用的.
- static 是在什么时候加载的(代码验证)
- CF #312.div2 -Amr and Chemistry-暴力+位运算
- 1711.Number Sequence(KMP模板)
- 操作系统 linux 内核的三种进程调度方法
- Objective-C Associated Objects 的实现原理
- 向量几何在游戏编程中的使用
- ns3中loopback接口是在什么时候创建的?
- 使用Jenkins配置自动化构建
- C#处理配置文件
- ORACLE 视图
- 某一天,忽然发现自己坚持不下去了。(无关计算机,只是一些自己的困惑和感想)
- poj 2524 Ubiquitous Religions
- mtk modem编译
- 利用typedef定义函数指针
- php:验证码