21 #include "ns3/core-module.h"
22 #include "ns3/config-store-module.h"
23 #include "ns3/wifi-module.h"
53 int main (
int argc,
char *argv[])
55 uint32_t testCase = 0;
56 bool printAttributes =
false;
59 cmd.
AddValue (
"testCase",
"Test case", testCase);
60 cmd.
AddValue (
"printAttributes",
"If true, print out attributes", printAttributes);
61 cmd.
Parse (argc, argv);
76 ssid =
Ssid (
"wifi-phy-configuration");
78 macSta.
SetType (
"ns3::StaWifiMac",
82 macAp.
SetType (
"ns3::ApWifiMac",
97 phySta = CreateObject<YansWifiPhy> ();
111 staDevice = wifi.
Install (phy, macSta, wifiStaNode.
Get(0));
112 apDevice = wifi.
Install (phy, macAp, wifiApNode.
Get(0));
122 staDevice = wifi.
Install (phy, macSta, wifiStaNode.
Get(0));
123 apDevice = wifi.
Install (phy, macAp, wifiApNode.
Get(0));
133 staDevice = wifi.
Install (phy, macSta, wifiStaNode.
Get(0));
134 apDevice = wifi.
Install (phy, macAp, wifiApNode.
Get(0));
144 staDevice = wifi.
Install (phy, macSta, wifiStaNode.
Get(0));
145 apDevice = wifi.
Install (phy, macAp, wifiApNode.
Get(0));
155 staDevice = wifi.
Install (phy, macSta, wifiStaNode.
Get(0));
156 apDevice = wifi.
Install (phy, macAp, wifiApNode.
Get(0));
166 staDevice = wifi.
Install (phy, macSta, wifiStaNode.
Get(0));
167 apDevice = wifi.
Install (phy, macAp, wifiApNode.
Get(0));
177 staDevice = wifi.
Install (phy, macSta, wifiStaNode.
Get(0));
178 apDevice = wifi.
Install (phy, macAp, wifiApNode.
Get(0));
188 staDevice = wifi.
Install (phy, macSta, wifiStaNode.
Get(0));
189 apDevice = wifi.
Install (phy, macAp, wifiApNode.
Get(0));
200 staDevice = wifi.
Install (phy, macSta, wifiStaNode.
Get(0));
201 apDevice = wifi.
Install (phy, macAp, wifiApNode.
Get(0));
212 staDevice = wifi.
Install (phy, macSta, wifiStaNode.
Get(0));
213 apDevice = wifi.
Install (phy, macAp, wifiApNode.
Get(0));
225 staDevice = wifi.
Install (phy, macSta, wifiStaNode.
Get(0));
226 apDevice = wifi.
Install (phy, macAp, wifiApNode.
Get(0));
229 Config::Set (
"/NodeList/0/DeviceList/*/$ns3::WifiNetDevice/Phy/$ns3::YansWifiPhy/ChannelNumber",
UintegerValue(40));
230 Config::Set (
"/NodeList/1/DeviceList/*/$ns3::WifiNetDevice/Phy/$ns3::YansWifiPhy/ChannelNumber",
UintegerValue(40));
241 staDevice = wifi.
Install (phy, macSta, wifiStaNode.
Get(0));
242 apDevice = wifi.
Install (phy, macAp, wifiApNode.
Get(0));
258 staDevice = wifi.
Install (phy, macSta, wifiStaNode.
Get(0));
259 apDevice = wifi.
Install (phy, macAp, wifiApNode.
Get(0));
277 staDevice = wifi.
Install (phy, macSta, wifiStaNode.
Get(0));
278 apDevice = wifi.
Install (phy, macAp, wifiApNode.
Get(0));
292 staDevice = wifi.
Install (phy, macSta, wifiStaNode.
Get (0));
293 apDevice = wifi.
Install (phy, macAp, wifiApNode.
Get (0));
305 staDevice = wifi.
Install (phy, macSta, wifiStaNode.
Get (0));
306 apDevice = wifi.
Install (phy, macAp, wifiApNode.
Get (0));
318 staDevice = wifi.
Install (phy, macSta, wifiStaNode.
Get(0));
319 apDevice = wifi.
Install (phy, macAp, wifiApNode.
Get(0));
346 staDevice = wifi.
Install (phy, macSta, wifiStaNode.
Get(0));
347 apDevice = wifi.
Install (phy, macAp, wifiApNode.
Get(0));
383 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.
uint8_t GetChannelNumber(void) const
Return current channel number.
OFDM PHY for the 5 GHz band (Clause 17 with 5 MHz channel bandwidth)
AttributeValue implementation for Boolean.
HT 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 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 GetFrequency(void) const
void SetChannel(Ptr< YansWifiChannel > channel)
Ptr< WifiPhy > GetPhy(void) const
AttributeValue implementation for Time.
Hold an unsigned integer type.
holds a vector of ns3::NetDevice pointers
virtual void SetStandard(enum WifiPhyStandard standard)
virtual NetDeviceContainer Install(const WifiPhyHelper &phy, const WifiMacHelper &mac, NodeContainer::Iterator first, NodeContainer::Iterator last) const
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...
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())
uint8_t GetChannelWidth(void) const
void ConfigureAttributes(void)
Configure the attribute values.
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)
bool DefineChannelNumber(uint8_t channelNumber, WifiPhyStandard standard, uint16_t frequency, uint8_t channelWidth)
Add a channel definition to the WifiPhy.
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.