On 11/13/2014 08:17 AM, Bernhard Blieninger wrote:
> Hey guys,
>
> we try to use ns3 for network simulation for a mesh network between qemu
> nodes.
> I just tried to experiment with the basics but did not succeed.
Hi Bernhard, I am not a user of QEMU but I'd be interested in helping to
debug this.
>
> Can someone explain to me how i should configure my system to fire up
> tap-csma-virtual-machine.cc example with two bridges at the same host
> machine connected to two VMs.
>
> So my setup is: VM0 - tap0 - bridge (br0) - tap-left - (ns3) - tap-right
> - bridge (br1) - tap1 - VM1
>
> VM0 and VM1 have IP addresses on the same network and br0 and br1 are
> also configured to work on the same network but ping will go trough,
> because of the functionality of linux bridges, even if i deactivate STP
> protocol.
this is the intended configuration for the example you cite. I just
tested this, and found that if I followed these steps on the wiki:
http://www.nsnam.org/wiki/HOWTO_Use_Linux_Containers_to_set_up_virtual_networks#HOWTO_Use_Linux_Containers_to_set_up_virtual_networks
I could get it to work as expected. In particular, the wiki describes
an lxc use case, but if you ignore that and just follow the steps for:
- configuring tap-left and tap-right on the host
- configuring br-left and br-right on the host
- add tap devices to bridge devices
- disable iptables filtering flags in /proc/sys/net/bridge
and then run the example, you should be able to tcpdump on the bridge
devices or tap devices and look for traffic (assuming you hook your
other VMs to the bridge).
Where do your pings stop getting through, in your topology?
>
> My second approach is to use tap-csma example to configure an internal
> network with more than one external device connected to it.
>
> The Problem here is that i want to use my qemu vm instead of the Linux
> host interface. Therefore i want to use „UseLocal“ mode in ns-3 because
> this should listen to the tap device to which qemu is writing and
> listening. But it tells me that ns-3 cannot fire up because the device
> is blocked. Starting ns-3 first will block qemu start.
this example is designed more for either using the native host with
ns-3, or for VM environments where you can later push the tap device
(which is created by ns-3) into the VM.
Have you looked at 'tap-wifi-virtual-machine.cc' which is a provided
example that uses 'UseLocal" mode?
to help with debugging, it may be useful to enable some logging, so
could you set some environment variables and capture the output?
such as
sudo bash
NS_LOG="CsmaNetDevice:TapBridge" ./waf --run tap-csma-virtual-machine
>
> Our main goal is to set up a 5-6 qemu vm’s that will connect via wired
> mesh through the ns-3 network in realtime( RealtimeEthernetProtoco, e.g.
> Ethernet Powerlink or TTEthernet), so we can control the network while
> the simulation is running and see the behavior of our qemu nodes.
This sounds interesting, I hope we can get it to work and then document
the steps taken.
- Tom