22 #include "ns3/core-module.h"
23 #include "ns3/config-store-module.h"
24 #include "ns3/network-module.h"
25 #include "ns3/wifi-module.h"
55 int main (
int argc,
char *argv[])
57 uint32_t testCase = 0;
58 bool printAttributes =
false;
61 cmd.
AddValue (
"testCase",
"Test case", testCase);
62 cmd.
AddValue (
"printAttributes",
"If true, print out attributes", printAttributes);
63 cmd.
Parse (argc, argv);
78 ssid =
Ssid (
"wifi-phy-configuration");
80 macSta.
SetType (
"ns3::StaWifiMac",
84 macAp.
SetType (
"ns3::ApWifiMac",
99 phySta = CreateObject<YansWifiPhy> ();
113 staDevice = wifi.
Install (phy, macSta, wifiStaNode.
Get(0));
114 apDevice = wifi.
Install (phy, macAp, wifiApNode.
Get(0));
124 staDevice = wifi.
Install (phy, macSta, wifiStaNode.
Get(0));
125 apDevice = wifi.
Install (phy, macAp, wifiApNode.
Get(0));
135 staDevice = wifi.
Install (phy, macSta, wifiStaNode.
Get(0));
136 apDevice = wifi.
Install (phy, macAp, wifiApNode.
Get(0));
146 staDevice = wifi.
Install (phy, macSta, wifiStaNode.
Get(0));
147 apDevice = wifi.
Install (phy, macAp, wifiApNode.
Get(0));
157 staDevice = wifi.
Install (phy, macSta, wifiStaNode.
Get(0));
158 apDevice = wifi.
Install (phy, macAp, wifiApNode.
Get(0));
168 staDevice = wifi.
Install (phy, macSta, wifiStaNode.
Get(0));
169 apDevice = wifi.
Install (phy, macAp, wifiApNode.
Get(0));
179 staDevice = wifi.
Install (phy, macSta, wifiStaNode.
Get(0));
180 apDevice = wifi.
Install (phy, macAp, wifiApNode.
Get(0));
190 staDevice = wifi.
Install (phy, macSta, wifiStaNode.
Get(0));
191 apDevice = wifi.
Install (phy, macAp, wifiApNode.
Get(0));
202 staDevice = wifi.
Install (phy, macSta, wifiStaNode.
Get(0));
203 apDevice = wifi.
Install (phy, macAp, wifiApNode.
Get(0));
214 staDevice = wifi.
Install (phy, macSta, wifiStaNode.
Get(0));
215 apDevice = wifi.
Install (phy, macAp, wifiApNode.
Get(0));
227 staDevice = wifi.
Install (phy, macSta, wifiStaNode.
Get(0));
228 apDevice = wifi.
Install (phy, macAp, wifiApNode.
Get(0));
231 Config::Set (
"/NodeList/0/DeviceList/*/$ns3::WifiNetDevice/Phy/$ns3::YansWifiPhy/ChannelNumber",
UintegerValue(40));
232 Config::Set (
"/NodeList/1/DeviceList/*/$ns3::WifiNetDevice/Phy/$ns3::YansWifiPhy/ChannelNumber",
UintegerValue(40));
243 staDevice = wifi.
Install (phy, macSta, wifiStaNode.
Get(0));
244 apDevice = wifi.
Install (phy, macAp, wifiApNode.
Get(0));
260 staDevice = wifi.
Install (phy, macSta, wifiStaNode.
Get(0));
261 apDevice = wifi.
Install (phy, macAp, wifiApNode.
Get(0));
279 staDevice = wifi.
Install (phy, macSta, wifiStaNode.
Get(0));
280 apDevice = wifi.
Install (phy, macAp, wifiApNode.
Get(0));
294 staDevice = wifi.
Install (phy, macSta, wifiStaNode.
Get (0));
295 apDevice = wifi.
Install (phy, macAp, wifiApNode.
Get (0));
307 staDevice = wifi.
Install (phy, macSta, wifiStaNode.
Get (0));
308 apDevice = wifi.
Install (phy, macAp, wifiApNode.
Get (0));
320 staDevice = wifi.
Install (phy, macSta, wifiStaNode.
Get(0));
321 apDevice = wifi.
Install (phy, macAp, wifiApNode.
Get(0));
348 staDevice = wifi.
Install (phy, macSta, wifiStaNode.
Get(0));
349 apDevice = wifi.
Install (phy, macAp, wifiApNode.
Get(0));
385 std::cerr <<
"Invalid testcase number " << testCase << std::endl;
ERP-OFDM PHY (Clause 19, Section 19.5)
void Set(std::string name, const AttributeValue &v)
Introspection did not find any typical Config paths.
OFDM PHY for the 5 GHz band (Clause 17 with 5 MHz channel bandwidth)
AttributeValue implementation for Boolean.
HT OFDM PHY for the 5 GHz band (clause 20)
Ptr< YansWifiChannel > Create(void) const
void SetRemoteStationManager(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())
Ptr< T > GetObject(void) const
Get a pointer to the requested aggregated Object.
Hold variables of type string.
Ptr< NetDevice > Get(uint32_t i) const
Get the Ptr stored in this container at a given index.
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 OFDM 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
virtual NetDeviceContainer Install(const WifiPhyHelper &phy, const WifiMacHelper &mac, NodeContainer c) const
void SetChannel(Ptr< YansWifiChannel > channel)
Ptr< WifiPhy > GetPhy(void) const
virtual uint16_t GetChannelNumber(void) const
Return current channel number.
AttributeValue implementation for Time.
bool DefineChannelNumber(uint16_t channelNumber, enum WifiPhyStandard standard, uint32_t frequency, uint32_t channelWidth)
Add a channel definition to the WifiPhy.
Hold an unsigned integer type.
holds a vector of ns3::NetDevice pointers
virtual void SetStandard(enum WifiPhyStandard standard)
Hold together all Wifi-related objects.
virtual uint32_t GetFrequency(void) const
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...
virtual uint32_t GetChannelWidth(void) const
Every class exported by the ns3 library is enclosed in the ns3 namespace.
keep track of a set of node pointers.
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.
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)
void AddValue(const std::string &name, const std::string &help, T &value)
Add a program argument, assigning to POD.
Ptr< Node > Get(uint32_t i) const
Get the Ptr stored in this container at a given index.
AttributeValue implementation for Ssid.
void SetDefault(std::string name, const AttributeValue &value)
void Parse(int argc, char *argv[])
Parse the program arguments.
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.