simulations/scratch/bus-topology.cc
void
BusTopology::CreateDevices()
{
	std::cout << "Creating and configuring devices" << std::endl;
	std::string phyMode("DsssRate1Mbps");
	// disable fragmentation for frames below 2200 bytes
	Config::SetDefault ("ns3::WifiRemoteStationManager::FragmentationThreshold", StringValue ("2000"));
	// turn off RTS/CTS for frames below 500 bytes
	Config::SetDefault ("ns3::WifiRemoteStationManager::RtsCtsThreshold", StringValue ("500"));
	// Fix non-unicast data rate to be the same as that of unicast
	Config::SetDefault ("ns3::WifiRemoteStationManager::NonUnicastMode", StringValue (phyMode));

	WifiHelper wifi;

	YansWifiPhyHelper wifiPhy = YansWifiPhyHelper::Default();
	wifiPhy.Set("RxGain", DoubleValue(-10));
	// NS-3 supports RadioTap and Prism tracing extensions for 802.11b
	wifiPhy.SetPcapDataLinkType(YansWifiPhyHelper::DLT_IEEE802_11_RADIO);

	YansWifiChannelHelper wifiChannel;
	wifiChannel.SetPropagationDelay ("ns3::ConstantSpeedPropagationDelayModel");
	wifiChannel.AddPropagationLoss ("ns3::RangePropagationLossModel","MaxRange", DoubleValue (maxRange));
	wifiPhy.SetChannel (wifiChannel.Create ());


	QosWifiMacHelper wifiMac = QosWifiMacHelper::Default ();
	wifiMac.SetType ("ns3::AdhocWifiMac");

	wifi.SetStandard (WIFI_PHY_STANDARD_80211b);
	wifi.SetRemoteStationManager ("ns3::ConstantRateWifiManager",
			"DataMode",StringValue (phyMode),
			"ControlMode",StringValue (phyMode));
	// Set it to adhoc mode
	devices = wifi.Install (wifiPhy, wifiMac, nodes);

	wifiChannel.AddPropagationLoss ("ns3::RangePropagationLossModel","MaxRange", DoubleValue (maxRange));
}
/**
 * Set up the network: configure the physical mode, the wi-fi parameters (seting an adhoc wifi), etc.
 */
Set up the network: configure the physical mode, the wi-fi parameters (seting an adhoc wifi), etc.
Set up the network : configure the physical mode the wi - fi parameters ( seting an adhoc wifi ) etc .
void
BusTopology::CreateDevices()
{
	std::cout << "Creating and configuring devices" << std::endl;
	std::string phyMode("DsssRate1Mbps");
	Config::SetDefault ("ns3::WifiRemoteStationManager::FragmentationThreshold", StringValue ("2000"));
	Config::SetDefault ("ns3::WifiRemoteStationManager::RtsCtsThreshold", StringValue ("500"));
	Config::SetDefault ("ns3::WifiRemoteStationManager::NonUnicastMode", StringValue (phyMode));
	WifiHelper wifi;
	YansWifiPhyHelper wifiPhy = YansWifiPhyHelper::Default();
	wifiPhy.Set("RxGain", DoubleValue(-10));
	wifiPhy.SetPcapDataLinkType(YansWifiPhyHelper::DLT_IEEE802_11_RADIO);
	YansWifiChannelHelper wifiChannel;
	wifiChannel.SetPropagationDelay ("ns3::ConstantSpeedPropagationDelayModel");
	wifiChannel.AddPropagationLoss ("ns3::RangePropagationLossModel","MaxRange", DoubleValue (maxRange));
	wifiPhy.SetChannel (wifiChannel.Create ());
	QosWifiMacHelper wifiMac = QosWifiMacHelper::Default ();
	wifiMac.SetType ("ns3::AdhocWifiMac");
	wifi.SetStandard (WIFI_PHY_STANDARD_80211b);
	wifi.SetRemoteStationManager ("ns3::ConstantRateWifiManager",
			"DataMode",StringValue (phyMode),
			"ControlMode",StringValue (phyMode));
	devices = wifi.Install (wifiPhy, wifiMac, nodes);
	wifiChannel.AddPropagationLoss ("ns3::RangePropagationLossModel","MaxRange", DoubleValue (maxRange));
}
void BusTopology :: CreateDevices ( ) { std :: cout << " " << std :: endl ; std :: string phyMode ( " " ) ; Config :: SetDefault ( " " , StringValue ( " " ) ) ; Config :: SetDefault ( " " , StringValue ( " " ) ) ; Config :: SetDefault ( " " , StringValue ( phyMode ) ) ; WifiHelper wifi ; YansWifiPhyHelper wifiPhy = YansWifiPhyHelper :: Default ( ) ; wifiPhy . Set ( " " , DoubleValue ( -10 ) ) ; wifiPhy . SetPcapDataLinkType ( YansWifiPhyHelper :: DLT_IEEE802_11_RADIO ) ; YansWifiChannelHelper wifiChannel ; wifiChannel . SetPropagationDelay ( " " ) ; wifiChannel . AddPropagationLoss ( " " , " " , DoubleValue ( maxRange ) ) ; wifiPhy . SetChannel ( wifiChannel . Create ( ) ) ; QosWifiMacHelper wifiMac = QosWifiMacHelper :: Default ( ) ; wifiMac . SetType ( " " ) ; wifi . SetStandard ( WIFI_PHY_STANDARD_80211b ) ; wifi . SetRemoteStationManager ( " " , " " , StringValue ( phyMode ) , " " , StringValue ( phyMode ) ) ; devices = wifi . Install ( wifiPhy , wifiMac , nodes ) ; wifiChannel . AddPropagationLoss ( " " , " " , DoubleValue ( maxRange ) ) ; }
Set up the network: configure the physical mode, the wi-fi parameters (seting an adhoc wifi), etc.
Set up the network : configure the physical mode the wi - fi parameters ( seting an adhoc wifi ) etc .
// disable fragmentation for frames below 2200 bytes // turn off RTS/CTS for frames below 500 bytes // Fix non-unicast data rate to be the same as that of unicast // NS-3 supports RadioTap and Prism tracing extensions for 802.11b // Set it to adhoc mode