Emulation: simulated network + real network

86 views
Skip to first unread message

Jason Song

unread,
Dec 17, 2019, 7:17:13 PM12/17/19
to ns-3-users
Hi guys,

I want to build a topology with both simulated network and real network. Specifically, I want to connect 2 VMs to an ns-3 topology, then route the traffic to real network.

What I've tested and worked: multiple VMs connect to ns-3 using tap bridge; fq tap ping example. I tried combining this 2 approach but it doesn't work. Could anyone comment on this solution or give me some hint of a possible approach? Thanks!

Haopeng Wang

unread,
Apr 18, 2021, 7:24:12 PM4/18/21
to ns-3-users
Hi Jason,
I want to build a same topology. Could you give me some suggestion?
Thanks 

Jason Song

unread,
Apr 25, 2021, 10:23:35 PM4/25/21
to ns-3-users
Hi Haopeng,

You can create bridges in the local host first. Then in VM you can create interfaces and connect to those bridges, and in ns-3 you can use the tap bridge model to connect an ns-3 virtual node to a real tap which is attached to those bridges. Basically it's something like:

TapBridgeHelper tbh;
tbh.SetAttribute ("Mode", StringValue ("UseBridge"));
tbh.SetAttribute ("DeviceName", StringValue (tap_left));
tbh.Install (endNode.Get (0), device.Get (0));

tbh.SetAttribute ("DeviceName", StringValue (tap_right));
tbh.Install (endNode.Get (1), device.Get (3));

I think all you need to know is in that link, and make sure you use the correct device name and the right mode in ns-3. Besides, you may need to configure the routes in the VM using route or ip route.

Hope it helps. 

Best,
Jason

Haopeng Wang

unread,
May 2, 2021, 6:54:33 PM5/2/21
to ns-3-users
Picture2.png
Thanks for your reply.

I am trying to use ns3 connect VMs with tapbridge model, but it does not work, the structure is just like, VM1(left)<enp0s3>(192.168.1.11)<--><enp0s3>(192.168.1.10)<br-left>(192.168.1.1)<tap-left> VM2(ns3)<tap-right><br- right>(192.168.2.1)<enp0s8>(192.168.2.10)<--><enp0s8>(192.168.2.12) VM2 (right). But when the interfaces in VM2 are bridged, they cannot ping from VM1 and VM3. Do you have any idea?

Thanks
Haopeng

Jason Song

unread,
May 2, 2021, 7:01:15 PM5/2/21
to ns-3-...@googlegroups.com
Did you check the routing table in each VM? I think that is the most probable part. I remember that you can first ping from VM to the local tap like tap-left/tap-right to test partial link of your setting, which should help. Thanks.

Best,
Jason

-- 
Posting to this group should follow these guidelines https://www.nsnam.org/wiki/Ns-3-users-guidelines-for-posting
--- 
You received this message because you are subscribed to a topic in the Google Groups "ns-3-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ns-3-users/E5wVbZh7jJA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ns-3-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ns-3-users/c424e577-97ef-447c-a7f8-d64aeaac9e35n%40googlegroups.com.
<Picture2.png>

Haopeng Wang

unread,
May 2, 2021, 11:13:48 PM5/2/21
to ns-3-users
Thank you.
But 192.168.1.11 in VM1 and 192.168.1.10 VM2 are the same subnet, when 192.168.1.10 is bridged, I cannot ping from .11 to .10. I don't think there should be a route table for this. 

Thanks
Best regards
Haopeng

Haopeng Wang

unread,
May 2, 2021, 11:41:59 PM5/2/21
to ns-3-users
I can ping to 192.168.1.10 from VM1 192.168.1.11, but cannot ping to the NS3 node, and I use the topo in tap-wifi-dumbbell.cc. And the NS3 is in the same subnet with 192.168.1.0/24.
Reply all
Reply to author
Forward
0 new messages