Assigning tap to server node.

272 views
Skip to first unread message

Anthony Galpo

unread,
Apr 15, 2015, 10:53:32 AM4/15/15
to ns-3-...@googlegroups.com
I have created two containers one left and one right. I had a code given to me and was asked to attached left to one of csma nodes and right to one of the server nodes. So below I attached the left tap to one of the csma nodes.
  NetDeviceContainer csmaDevices;
  csmaDevices = csma.Install (csmaNodes);
  // 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 ("UseBridge"));
  tapBridge.SetAttribute ("DeviceName", StringValue ("tap-left"));
  tapBridge.Install (csmaNodes.Get (0), csmaDevices.Get (0));

I had no issue attaching left to one of the csmaNodes(Client).
My issue is on the server side.
// set remote Servers
  TimeValue val (Time("0ms"));
 
  std::vector<NetDeviceContainer> derDeviceAdjacencyList (N);
  for(uint32_t i=0; i<derDeviceAdjacencyList.size (); ++i)
    {
      std::ostringstream delaySt;
      delaySt << 15 + (i) * 35 << "ms";
      std::ostringstream dataRate;
      dataRate << 15 - (i) * 3 << "Mbps";
      val.Set(Time(delaySt.str())); // required for delays

      p2p.SetDeviceAttribute ("DataRate", StringValue (dataRate.str()));
      p2p.SetDeviceAttribute ("Mtu", UintegerValue (1500));
      p2p.SetChannelAttribute ("Delay", val);
      derDeviceAdjacencyList[i] = p2p.Install (derAdjacencyList[i]);
      //csmaDevices = csma.Install (csmaNodes);

    }
 
  TapBridgeHelper tapBridge;
  tapBridge.SetAttribute ("DeviceName", StringValue ("tap-right"));
  tapBridge.Install (derNodes.Get (1), derDeviceAdjacencyList[1].Get(1));


This is the output I get from the terminal :
Waf: Entering directory `/home/dt0803/repos/ns-3-allinone/ns-3-dev/build'
[ 885/2299] cxx: scratch/Topology.cc -> build/scratch/Topology.cc.4.o
[2272/2299] cxxprogram: build/scratch/Topology.cc.4.o -> build/scratch/Topology
Waf: Leaving directory `/home/dt0803/repos/ns-3-allinone/ns-3-dev/build'
'build' finished successfully (5.413s)
Create nodes.
Create channels.
MTU P2P 1500
msg="TapBridge::SetBridgedDevice: Device does not support SendFrom: cannot be added to bridge.", file=../src/tap-bridge/model/tap-bridge.cc, line=901
terminate called without an active exception
Command ['/home/dt0803/repos/ns-3-allinone/ns-3-dev/build/scratch/Topology'] terminated with signal SIGIOT. Run it under a debugger to get more information (./waf --run <program> --command-template="gdb --args %s <args>").


Topology.cc

Tom Henderson

unread,
Apr 15, 2015, 12:51:35 PM4/15/15
to ns-3-...@googlegroups.com
This is happening because you are trying to use the TapBridge in
'UseBridge' mode with a PointToPointNetDevice, which doesn't support
bridging.

Some documentation about the different modes is here:
https://www.nsnam.org/docs/models/html/tap.html#

I recommend reconfiguring your topology a bit (even if you have to
insert an additional node/LAN) so that you can instead bind a Csma
device to this tap bridge. I don't think PointToPoint will work well
because it is not a device type that uses 48-bit MAC addresses.

- Tom


Reply all
Reply to author
Forward
0 new messages