Ns3 TapBridge Error Device does not support SendFrom

362 views
Skip to first unread message

c127...@mydit.ie

unread,
Apr 29, 2015, 11:43:48 AM4/29/15
to ns-3-...@googlegroups.com
Hi guys,

So I have a PC with two network card installed. Each of them are connected to PC's(cross-over cable). I was told to connect both PC's using a simulated network (NS-3) by using tap-bridge. Diagram below to make it clear:

PC(Server) -------- (PC to run NS-3 Simulation) --------- PC(Client)

I have started playing with tap-bridge UseLocal configuration but I have no success on it. I modified first.cc as my starting point and attached the tap-bridge helper configurations on the nodes.

So I created a tap0 and tap1 from the instructions https://www.nsnam.org/docs/release/3.9/doxygen/group___tap_bridge_model.html
 *   sudo tunctl -t tap0
 *   sudo ifconfig tap0 hw ether 00:10:4b:ad:91:b8  
 *   sudo ifconfig tap0 192.168.1.1 netmask 255.255.255.0 up
* sudo tunctl -t tap1 * sudo ifconfig tap1 hw ether 00:50:da:b2:e4:75 * sudo ifconfig tap0 192.168.1.2 netmask 255.255.255.0 up


So now I modified first.cc to:

#include "ns3/core-module.h"
#include "ns3/network-module.h"
#include "ns3/internet-module.h"
#include "ns3/point-to-point-module.h"
#include "ns3/applications-module.h"
#include "ns3/tap-bridge-module.h"
using namespace ns3;

NS_LOG_COMPONENT_DEFINE ("FirstScriptExample");

int
main (int argc, char *argv[])
{
  Time::SetResolution (Time::NS);
  LogComponentEnable ("UdpEchoClientApplication", LOG_LEVEL_INFO);
  LogComponentEnable ("UdpEchoServerApplication", LOG_LEVEL_INFO);

  NodeContainer nodes;
  nodes.Create (2);

  PointToPointHelper pointToPoint;
  pointToPoint.SetDeviceAttribute ("DataRate", StringValue ("5Mbps"));
  pointToPoint.SetChannelAttribute ("Delay", StringValue ("2ms"));

  NetDeviceContainer devices;
  devices = pointToPoint.Install (nodes);

  InternetStackHelper stack;
  stack.Install (nodes);

  Ipv4AddressHelper address;
  address.SetBase ("10.1.1.0", "255.255.255.0");

  Ipv4InterfaceContainer interfaces = address.Assign (devices);

  UdpEchoServerHelper echoServer (9);

  ApplicationContainer serverApps = echoServer.Install (nodes.Get (1));
  serverApps.Start (Seconds (1.0));
  serverApps.Stop (Seconds (10.0)); 
  // Use the TapBridgeHelper to connect to the pre-configured tap devices for
  // the left side.  We go with "UseBridge" mode since the CSMA devices support
  // promiscuous mode and can therefore make it appear that the bridge is
  // extended into ns-3.  The install method essentially bridges the specified
  // tap to the specified CSMA device.
  //
  TapBridgeHelper tapBridge;
  tapBridge.SetAttribute ("Mode", StringValue ("UseLocal"));
  tapBridge.SetAttribute ("DeviceName", StringValue ("tap0"));
  tapBridge.Install (nodes.Get (1), devices.Get (1));


  UdpEchoClientHelper echoClient (interfaces.GetAddress (1), 9);
  echoClient.SetAttribute ("MaxPackets", UintegerValue (1));
  echoClient.SetAttribute ("Interval", TimeValue (Seconds (1.0)));
  echoClient.SetAttribute ("PacketSize", UintegerValue (1024));

  ApplicationContainer clientApps = echoClient.Install (nodes.Get (0));
  clientApps.Start (Seconds (2.0));
  clientApps.Stop (Seconds (10.0));
  // Connect the right side tap to the right side CSMA device on the right-side
  // ghost node.
  //
  tapBridge.SetAttribute ("DeviceName", StringValue ("tap1"));
  tapBridge.Install (nodes.Get (0), devices.Get (0));

  Simulator::Run ();
  Simulator::Destroy ();
  return 0;
}
Am I going the wrong way here ? I have little knowledge of both NS-3 and Linux so I am a bit confused here. Any help would be appreciated.
I have approached using lxc containers and had no issues except I couldnt install an Apache server on one of the containers.

This email originated from DIT. If you received this email in error, please delete it from your system. Please note that if you are not the named addressee, disclosing, copying, distributing or taking any action based on the contents of this email or attachments is prohibited. www.dit.ie

Is ó ITBÁC a tháinig an ríomhphost seo. Má fuair tú an ríomhphost seo trí earráid, scrios de do chóras é le do thoil. Tabhair ar aird, mura tú an seolaí ainmnithe, go bhfuil dianchosc ar aon nochtadh, aon chóipeáil, aon dáileadh nó ar aon ghníomh a dhéanfar bunaithe ar an ábhar atá sa ríomhphost nó sna hiatáin seo. www.dit.ie

Tá ITBÁC ag aistriú go Gráinseach Ghormáin – DIT is on the move to Grangegorman

Tommaso Pecorella

unread,
Apr 29, 2015, 12:25:37 PM4/29/15
to ns-3-...@googlegroups.com
Hi,

would you use a Corvette repair manual to fix a Dodge ?
I doubt so. They're both cars, they both have 4 weeks and an engine, but that's it.

You're using the instructions for ns-3.9, and I doubt you're using that version.
My suggestions are:
1) use the latest ns-3. Either ns-3.22 or ns-3-dev.
2) use the manual for the installed version
3) use FdNetDevice.

Cheers,

T.

PS: also... 4) use an appropriate message topic.
Reply all
Reply to author
Forward
0 new messages