27 #include "ns3/command-line.h" 28 #include "ns3/config-store.h" 29 #include "ns3/config.h" 30 #include "ns3/boolean.h" 31 #include "ns3/uinteger.h" 32 #include "ns3/string.h" 34 #include "ns3/yans-wifi-phy.h" 35 #include "ns3/yans-wifi-helper.h" 36 #include "ns3/wifi-net-device.h" 60 int main (
int argc,
char *argv[])
62 uint32_t testCase = 0;
63 bool printAttributes =
false;
66 cmd.AddValue (
"testCase",
"Test case", testCase);
67 cmd.AddValue (
"printAttributes",
"If true, print out attributes", printAttributes);
68 cmd.Parse (argc, argv);
79 wifi.SetRemoteStationManager (
"ns3::IdealWifiManager");
83 ssid =
Ssid (
"wifi-phy-configuration");
85 macSta.
SetType (
"ns3::StaWifiMac",
89 macAp.
SetType (
"ns3::ApWifiMac",
104 phySta = CreateObject<YansWifiPhy> ();
118 staDevice =
wifi.Install (
phy, macSta, wifiStaNode.
Get (0));
129 staDevice =
wifi.Install (
phy, macSta, wifiStaNode.
Get (0));
140 staDevice =
wifi.Install (
phy, macSta, wifiStaNode.
Get (0));
151 staDevice =
wifi.Install (
phy, macSta, wifiStaNode.
Get (0));
162 staDevice =
wifi.Install (
phy, macSta, wifiStaNode.
Get (0));
173 staDevice =
wifi.Install (
phy, macSta, wifiStaNode.
Get (0));
184 staDevice =
wifi.Install (
phy, macSta, wifiStaNode.
Get (0));
195 staDevice =
wifi.Install (
phy, macSta, wifiStaNode.
Get (0));
207 staDevice =
wifi.Install (
phy, macSta, wifiStaNode.
Get (0));
219 staDevice =
wifi.Install (
phy, macSta, wifiStaNode.
Get (0));
232 staDevice =
wifi.Install (
phy, macSta, wifiStaNode.
Get (0));
236 Config::Set (
"/NodeList/0/DeviceList/*/$ns3::WifiNetDevice/Phy/$ns3::YansWifiPhy/ChannelNumber",
UintegerValue (40));
237 Config::Set (
"/NodeList/1/DeviceList/*/$ns3::WifiNetDevice/Phy/$ns3::YansWifiPhy/ChannelNumber",
UintegerValue (40));
248 staDevice =
wifi.Install (
phy, macSta, wifiStaNode.
Get (0));
252 Config::Set (
"/NodeList/0/DeviceList/*/$ns3::WifiNetDevice/Phy/$ns3::YansWifiPhy/ChannelWidth",
UintegerValue (40));
253 Config::Set (
"/NodeList/1/DeviceList/*/$ns3::WifiNetDevice/Phy/$ns3::YansWifiPhy/ChannelWidth",
UintegerValue (40));
265 staDevice =
wifi.Install (
phy, macSta, wifiStaNode.
Get (0));
269 Config::Set (
"/NodeList/0/DeviceList/*/$ns3::WifiNetDevice/Phy/$ns3::YansWifiPhy/ChannelWidth",
UintegerValue (40));
270 Config::Set (
"/NodeList/1/DeviceList/*/$ns3::WifiNetDevice/Phy/$ns3::YansWifiPhy/ChannelWidth",
UintegerValue (40));
284 staDevice =
wifi.Install (
phy, macSta, wifiStaNode.
Get (0));
299 staDevice =
wifi.Install (
phy, macSta, wifiStaNode.
Get (0));
312 staDevice =
wifi.Install (
phy, macSta, wifiStaNode.
Get (0));
325 staDevice =
wifi.Install (
phy, macSta, wifiStaNode.
Get (0));
353 staDevice =
wifi.Install (
phy, macSta, wifiStaNode.
Get (0));
390 std::cerr <<
"Invalid testcase number " << testCase << std::endl;
ERP-OFDM PHY (Clause 19, Section 19.5)
Introspection did not find any typical Config paths.
Ptr< NetDevice > Get(uint32_t i) const
Get the Ptr<NetDevice> stored in this container at a given index.
OFDM PHY for the 5 GHz band (Clause 17 with 5 MHz channel bandwidth)
bool DefineChannelNumber(uint8_t channelNumber, WifiPhyStandard standard, uint16_t frequency, uint16_t channelWidth)
Add a channel definition to the WifiPhy.
AttributeValue implementation for Boolean.
HT PHY for the 5 GHz band (clause 20)
Hold variables of type string.
Make it easy to create and manage PHY objects for the yans model.
static YansWifiChannelHelper Default(void)
Create a channel helper in a default working state.
void Set(std::string path, const AttributeValue &value)
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file...
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
OFDM PHY for the 5 GHz band (Clause 17 with 10 MHz channel bandwidth)
void PrintAttributesIfEnabled(bool enabled)
HT PHY for the 2.4 GHz band (clause 20)
static YansWifiPhyHelper Default(void)
Create a phy helper in a default working state.
helps to create WifiNetDevice objects
uint16_t GetChannelWidth(void) const
AttributeValue implementation for Time.
Hold an unsigned integer type.
holds a vector of ns3::NetDevice pointers
Hold together all Wifi-related objects.
Parse command-line arguments.
static void Destroy(void)
Execute the events scheduled with ScheduleDestroy().
This is intended to be the configuration used in this paper: Gavin Holland, Nitin Vaidya and Paramvir...
Ptr< T > GetObject(void) const
Get a pointer to the requested aggregated Object.
Ptr< WifiPhy > GetPhy(void) const
Every class exported by the ns3 library is enclosed in the ns3 namespace.
keep track of a set of node pointers.
uint16_t GetFrequency(void) const
802.11 PHY layer modelThis PHY implements a model of 802.11a.
DSSS PHY (Clause 15) and HR/DSSS PHY (Clause 18)
Ptr< YansWifiPhy > GetYansWifiPhyPtr(const NetDeviceContainer &nc)
manage and create wifi channel objects for the yans model.
uint8_t GetChannelNumber(void) const
Return current channel number.
create MAC layers for a ns3::WifiNetDevice.
The IEEE 802.11 SSID Information Element.
virtual void SetType(std::string type, std::string n0="", const AttributeValue &v0=EmptyAttributeValue(), std::string n1="", const AttributeValue &v1=EmptyAttributeValue(), std::string n2="", const AttributeValue &v2=EmptyAttributeValue(), std::string n3="", const AttributeValue &v3=EmptyAttributeValue(), std::string n4="", const AttributeValue &v4=EmptyAttributeValue(), std::string n5="", const AttributeValue &v5=EmptyAttributeValue(), std::string n6="", const AttributeValue &v6=EmptyAttributeValue(), std::string n7="", const AttributeValue &v7=EmptyAttributeValue(), std::string n8="", const AttributeValue &v8=EmptyAttributeValue(), std::string n9="", const AttributeValue &v9=EmptyAttributeValue(), std::string n10="", const AttributeValue &v10=EmptyAttributeValue())
void ConfigureAttributes(void)
Configure the attribute values.
AttributeValue implementation for Ssid.
void SetDefault(std::string name, const AttributeValue &value)
Ptr< Node > Get(uint32_t i) const
Get the Ptr<Node> stored in this container at a given index.
Time MicroSeconds(uint64_t value)
Construct a Time in the indicated unit.
void Create(uint32_t n)
Create n nodes and append pointers to them to the end of this NodeContainer.
void SetAttribute(std::string name, const AttributeValue &value)
Set a single attribute, raising fatal errors if unsuccessful.