ns3 emulation TapBridge

576 views
Skip to first unread message

El Kinani Youssef

unread,
Jul 8, 2015, 4:53:45 AM7/8/15
to ns-3-...@googlegroups.com
Hi everybody,

I want to use emulation/simulation with ns3 like in the image. I want to have a real sender host (Virtual Machine) connected to a simulated ns3 network (with p2p and wifi channels).
I read about emulation overview here: https://www.nsnam.org/docs/release/3.11/models/html/emulation-overview.html
and about TapBridge: https://www.nsnam.org/docs/release/3.9/doxygen/group___tap_bridge_model.html

What I can't get is how to configure my environnement before starting any simulation/emu.

Thanks in advance
Cheers
Message has been deleted

Konstantinos

unread,
Jul 8, 2015, 5:31:35 AM7/8/15
to ns-3-...@googlegroups.com, yousssef...@gmail.com
Hi,

Please use the latest documentation for those modules. The links you provided as for ns-3.11 and ns-3.9.

El Kinani Youssef

unread,
Jul 8, 2015, 7:06:14 AM7/8/15
to ns-3-...@googlegroups.com, yousssef...@gmail.com
Hi,

Thank you Konstantinos, but I still confused on how to configure my Virtual Machines, is there any doc or tutorial for that???

Cheers

Konstantinos

unread,
Jul 8, 2015, 7:15:53 AM7/8/15
to ns-3-...@googlegroups.com, yousssef...@gmail.com

El Kinani Youssef

unread,
Jul 13, 2015, 11:34:22 AM7/13/15
to ns-3-...@googlegroups.com, yousssef...@gmail.com
Hi Konstantinos, 

I'm sorry for this late response, I was working on something else. For the link you gave me I tried it, but I'm not sure about how to connect the remote host (Virtual machine) to the taps I created in the Virtual Machine containing ns3 

Cheers

El Kinani Youssef

unread,
Jul 20, 2015, 5:36:10 AM7/20/15
to ns-3-...@googlegroups.com
Hi everybody,

I'm still stuck in this emulation scheme. So my scenario I'm gonna give the details of my scenario, and I hope that someone can help:


https://www.nsnam.org/docs/release/3.23/doxygen/tap-wifi-virtual-machine_8cc_source.html
https://www.nsnam.org/docs/release/3.23/doxygen/tap-csma-virtual-machine_8cc.html

I want to reproduce one of this simulation, but with 3 VM. One VM for each virtual Host (left and right) and the third VM for ns3 channel.

Configuration:

VM1 (left-host)    <eth0>        <-------------->       <eth1>  <br-left>  <tap-left>      VM2 (ns3)   <tap-right>  <br-right>   <eth2>    <------------->     <eth0>      VM3 (right-host)
       
                    VMnet1(Host-Only)                             Vmnet2 (Host-Only)                        
                      10.1.1.0/24                                   10.1.2.0/24

ns3-VM:                                    

sudo brctl addbr br-left
sudo brctl addbr br-right

sudo tunctl -t tap-left
sudo tunctl -t tap-right

sudo ifconfig tap-left 0.0.0.0 promisc up
sudo ifconfig tap-right 0.0.0.0 promisc up
"sudo ifconfig eth1 0.0.0.0 promisc up" // I tried this also
"sudo ifconfig eth2 0.0.0.0 promisc up" // I tried this also

sudo brctl addif br-left tap-left
sudo brctl addif br-right tap-right
sudo brctl addif br-left eth1
sudo brctl addif br-right eth2


ifconfig br-left 10.1.1.1 netmask 255.255.255.0 up
ifconfig br-right 10.1.2.1 netmask 255.255.255.0 up

left-host VM:

eth0: 10.1.1.130
route add -net 10.1.2.0 netmask 255.255.255.0 gw 10.1.1.1 dev eth0

right-host VM:

eth0: 10.1.2.129
route add -net 10.1.1.0 netmask 255.255.255.0 gw 10.1.2.1 dev eth0

I tried to ping from one VM to The other, but no way! I see the pings arriving to the br-left interface with wireshark, but they don't get through the tap-left and ns3 ?
I tried with https://www.nsnam.org/docs/release/3.23/doxygen/tap-wifi-dumbbell_8cc.html  and I can ping the simulated nodes, and I get that in pcaps?
What's wrong with the sceanrio ?? I know that wifi does not support Usebridge, but even with csma I can't get into ns3!!

Thanks in advance for any help.

Cheers
.





 

Mohammad Abu Shattal

unread,
Jul 27, 2015, 1:37:09 PM7/27/15
to ns-3-users, yousssef...@gmail.com
Hello Youssef,

You need to configure routing correctly on nodes in ns3 to direct packet correctly to tap bridges and outer VMs.
further more, you need to be SURE which mode of the tap bridges modes you need to use. "Configure Local", "Use Local", "Use Bridge" everyone has its configuration issues. It is scenario specific ...

hope this is useful,
Mohammad

El Kinani Youssef

unread,
Jul 27, 2015, 2:57:24 PM7/27/15
to ns-3-users, eng...@gmail.com
Hello Mohammad,

Thank you very much for this reply, I'm still working in this ! And I will try your suggestion about routing in ns3, it's probably the problem. 

And if you've tried this once, have you any script, configuration or examples that can help ?

Thank you again
Cheers
Youssef

Meenal Chougule

unread,
May 4, 2018, 6:59:28 AM5/4/18
to ns-3-users
Any luck on this mate?
Reply all
Reply to author
Forward
0 new messages