ns3--TapBridge, TapNetDevice,FdNetDevice等
2016-11-01 17:37
141 查看
在
其拓扑图为:
默认为
1) 程序编译运行之后在得到的shell中ping某个与AP在同一个WIFI网络的节点 10.1.1.3
我是说怎么能在代码编译之后用
这些结果就是想表明,
一个实际的linux主机可以ping一个在ns-3中的节点!!!。
注意这里的编译运行的时候,要用
这次之所以无法ping通是因为之前已经用那个源文件里的第四步配置了一个bridge。
2) 在linux主机上配置一条路由,以便使AP(10.1.1.1)ping得通CSMA网络的10.1.3.4
发现,当ping一个CSMA节点(即通过P2P连接之后的节点)时,延迟非常大,达到了几百ms。
这里是AP(10.1.1.1)将10.1.1.2设置为其ping 10.1.3.4时的临时『网关』,从这里(10.1.1.2)路由到10.1.3.4 这里的10.1.1.2是与AP同一个节点n0的另外一个网卡。
The Tap Bridge lives in a kind of a gray world somewhere between a Linux host and an ns-3 bridge device. From the Linux perspective, this code appears as the user mode handler for a TAP net device. In ConfigureLocal mode, this Tap device is automatically created by the ns-3 simulation. When the Linux host writes to one of these automatically created /dev/tap devices, the write is redirected into the TapBridge that lives in the ns-3 world; and from this perspective, the packet write on Linux becomes a packet read in the Tap Bridge. In other words, a Linux process writes a packet to a tap device and this packet is redirected by the network tap mechanism toan ns-3 process where it is received by the TapBridge as a result of a read operation there. The TapBridge then writes the packet to the ns-3 net device to which it is bridged; and therefore it appears as if the Linux host sent a packet directly through an ns-3 net device onto an ns-3 network.
Tap Bridge存在于某个在Linux主机与ns-3的Bridge Device之间的灰色空间。从Linux角度看,代码看起来像Tap NetDevice的处理器。在
参考:
https://www.nsnam.org/docs/release/3.17/models/singlehtml/index.html#emulation-overview
tunctl添加虚拟网卡TUN/TAP与brctl添加网桥
./src/tap-bridge/examples/tap-wifi-dumbbell.cc目录下的这个文件,
其拓扑图为:
默认为
ConfigureLocal模式
1) 程序编译运行之后在得到的shell中ping某个与AP在同一个WIFI网络的节点 10.1.1.3
$ ./waf --run tap-wifi-dumbbell& $ ping 10.1.1.3
我是说怎么能在代码编译之后用
ping 10.1.1.3呢,原来是在编译成功之后得到的一个shell中就配置好了一个名叫
thetap的网卡设备,IP为
10.1.1.1,相当于它是AP,然后就可以通过它来ping与它同网段的
10.1.1.3了。
这些结果就是想表明,
一个实际的linux主机可以ping一个在ns-3中的节点!!!。
注意这里的编译运行的时候,要用
sudo,因为涉及到操作网卡,要用高权限的
sudo。
这次之所以无法ping通是因为之前已经用那个源文件里的第四步配置了一个bridge。
2) 在linux主机上配置一条路由,以便使AP(10.1.1.1)ping得通CSMA网络的10.1.3.4
$ ./waf --run tap-wifi-dumbbell& $ sudo route add -net 10.1.3.0 netmask 255.255.255.0 dev thetap gw 10.1.1.2 $ ping 10.1.3.4
发现,当ping一个CSMA节点(即通过P2P连接之后的节点)时,延迟非常大,达到了几百ms。
这里是AP(10.1.1.1)将10.1.1.2设置为其ping 10.1.3.4时的临时『网关』,从这里(10.1.1.2)路由到10.1.3.4 这里的10.1.1.2是与AP同一个节点n0的另外一个网卡。
The Tap Bridge lives in a kind of a gray world somewhere between a Linux host and an ns-3 bridge device. From the Linux perspective, this code appears as the user mode handler for a TAP net device. In ConfigureLocal mode, this Tap device is automatically created by the ns-3 simulation. When the Linux host writes to one of these automatically created /dev/tap devices, the write is redirected into the TapBridge that lives in the ns-3 world; and from this perspective, the packet write on Linux becomes a packet read in the Tap Bridge. In other words, a Linux process writes a packet to a tap device and this packet is redirected by the network tap mechanism toan ns-3 process where it is received by the TapBridge as a result of a read operation there. The TapBridge then writes the packet to the ns-3 net device to which it is bridged; and therefore it appears as if the Linux host sent a packet directly through an ns-3 net device onto an ns-3 network.
Tap Bridge存在于某个在Linux主机与ns-3的Bridge Device之间的灰色空间。从Linux角度看,代码看起来像Tap NetDevice的处理器。在
ConfigureLocal模式下,这个Tap NetDevice是由ns-3模拟器自动创建的。。。。(未完待续)
参考:
https://www.nsnam.org/docs/release/3.17/models/singlehtml/index.html#emulation-overview
tunctl添加虚拟网卡TUN/TAP与brctl添加网桥
相关文章推荐
- (OK) NS-3 - Emulation Overview - FdNetDevice - TapBridge
- ns3通过TapBridge连接外部控制器floodlight
- (五)NS3中示例:网桥模块示例csma-bridge.cc程序的注释
- OpenStack Neutron解析---Linux Bridge Tun Tap
- (OK)(OK) running two Android-x86 in VirtualBox, they connect to NS3(MANETs) via "ethernet bridge"
- 虚拟机网卡和linux bridge上tap设备的关系
- (OK)(OK) NS3 - MANET - OLSR can not work in bridge NODE
- linux 中网络设备的那些事 bridge TAP Veth Vlan br
- tap interfaces disabled in linux bridge - Carrier (IFF_RUNNING) <NO-CARRIER,BROADCAST,MULTICAST,UP>
- TAP/TUN、NAT、Linux Bridge、VLAN等技术实现云中网络
- NS3网络仿真(13): FdNetDevice的问题
- PointToPointNetDevice doesn't support TapBridgeHelper
- (五岁以下儿童)NS3样本演示:桥模块演示样品csma-bridge.cc凝视程序
- 对虚机设备Bridge ,Vlan, VETH, TAP详细介绍
- (OK)(OK)(All in CLI) running two Android-x86 which connect to NS3(MANETs) via "ethernet bridge"
- (OK) 手动 添加 删除 bridge tap — tunctl — brctl
- Java设计模式--桥梁模式【Bridge Pattern】
- [iOS] 使用WebViewJavascriptBridge实现OC与JS交互
- ubuntu安装NS3
- 桥接模式Bridge