WifiHelper wifi;
YansWifiPhyHelper wifiPhy1 = YansWifiPhyHelper::Default ();
wifiPhy1.SetPcapDataLinkType (YansWifiPhyHelper::DLT_IEEE802_11);
YansWifiPhyHelper wifiPhy2 = YansWifiPhyHelper::Default ();
wifiPhy2.SetPcapDataLinkType (YansWifiPhyHelper::DLT_IEEE802_11);
YansWifiChannelHelper wifiChannel1 ;
YansWifiChannelHelper wifiChannel2 ;
wifiChannel1.SetPropagationDelay ("ns3::ConstantSpeedPropagationDelayModel");
wifiChannel2.SetPropagationDelay ("ns3::ConstantSpeedPropagationDelayModel");
wifiChannel1.AddPropagationLoss ("ns3::TwoRayGroundPropagationLossModel","SystemLoss", DoubleValue(1), "HeightAboveZ", DoubleValue(1.5));
wifiChannel2.AddPropagationLoss ("ns3::TwoRayGroundPropagationLossModel","SystemLoss", DoubleValue(1), "HeightAboveZ", DoubleValue(1.5));
wifi.SetStandard (WIFI_PHY_STANDARD_80211b);
wifi.SetRemoteStationManager ("ns3::ConstantRateWifiManager", "DataMode",StringValue(phyMode), "ControlMode",StringValue(phyMode));
Ssid ssid = Ssid ("ns-3-ssid");
NqosWifiMacHelper wifiMac1 = NqosWifiMacHelper::Default ();
NqosWifiMacHelper wifiMac2 = NqosWifiMacHelper::Default ();
wifiMac1.SetType ("ns3::AdhocWifiMac");
wifiMac2.SetType ("ns3::AdhocWifiMac");
wifiPhy1.Set("ChannelNumber",UintegerValue(1));
wifiPhy1.SetChannel (wifiChannel1.Create ());
NetDeviceContainer devices1 = wifi.Install (wifiPhy1, wifiMac1, m_nodes);
wifiPhy2.Set("ChannelNumber",UintegerValue(6));
wifiPhy2.SetChannel (wifiChannel2.Create ());
NetDeviceContainer devices2 = wifi.Install (wifiPhy2, wifiMac2, m_nodes);
InternetStackHelper internet;
internet.Install (m_nodes);