tap-bridge not working in wifi AP mode

100 views
Skip to first unread message

Abdul Sikandar

unread,
May 12, 2015, 2:13:18 PM5/12/15
to ns-3-...@googlegroups.com
I have installed correctly 3 linux container. Container are able to ping each other when connected in Adhoc mode using example code of tap-wifi-virtual-machine.cc. I have extended the same and connected the node in AP mode but not able to ping any container. Here is my code :

  GlobalValue::Bind ("SimulatorImplementationType", StringValue ("ns3::RealtimeSimulatorImpl"));
  GlobalValue::Bind ("ChecksumEnabled", BooleanValue (true));

 
  NodeContainer nodes;
  nodes.Create(3);

  YansWifiChannelHelper channel = YansWifiChannelHelper::Default ();
  YansWifiPhyHelper phy = YansWifiPhyHelper::Default ();
  phy.SetChannel (channel.Create ());

  WifiHelper wifi;
  wifi.SetStandard (WIFI_PHY_STANDARD_80211g );
  StringValue DataRate = StringValue("ErpOfdmRate6Mbps");
  wifi.SetRemoteStationManager ("ns3::ConstantRateWifiManager","DataMode", DataRate);
 
  QosWifiMacHelper mac = QosWifiMacHelper::Default ();
 
  Ssid ssid = Ssid ("TestAp");
  mac.SetType ("ns3::ApWifiMac",
                   "Ssid", SsidValue (ssid));
                  
  NetDeviceContainer devices;
  devices = wifi.Install (phy, mac, nodes.Get(0));
 
  mac.SetType ("ns3::StaWifiMac",
               "Ssid", SsidValue (ssid),
               "ActiveProbing", BooleanValue (true));

  devices.Add( wifi.Install (phy, mac, NodeContainer ( nodes.Get (1) , nodes.Get (2) ) ) );
 
  MobilityHelper mobilitySta;
  mobilitySta.SetPositionAllocator ("ns3::GridPositionAllocator",
                                 "MinX", DoubleValue (0.0),
                                 "MinY", DoubleValue (0.0),
                                 "DeltaX", DoubleValue (1.0),
                                 "DeltaY", DoubleValue (1.0),
                                 "GridWidth", UintegerValue (10),
                                 "LayoutType", StringValue ("RowFirst"));


  mobilitySta.SetMobilityModel ("ns3::ConstantPositionMobilityModel");
  mobilitySta.Install (nodes);
 
  TapBridgeHelper tapBridge;
  tapBridge.SetAttribute ("Mode", StringValue ("UseLocal"));
 
  tapBridge.SetAttribute ("DeviceName", StringValue ("tap-0"));
  tapBridge.Install (nodes.Get (0), devices.Get (0));
 
  tapBridge.SetAttribute ("DeviceName", StringValue ("tap-1"));
  tapBridge.Install (nodes.Get (1), devices.Get (1));
 
  tapBridge.SetAttribute ("DeviceName", StringValue ("tap-2"));
  tapBridge.Install (nodes.Get (2), devices.Get (2));

  Simulator::Stop (Seconds (300.));
  Simulator::Run ();
  Simulator::Destroy ();
Reply all
Reply to author
Forward
0 new messages