Make it easy to create and manage PHY objects for the yans model. More...
#include "yans-wifi-helper.h"
Public Types | |
enum | SupportedPcapDataLinkTypes { DLT_IEEE802_11 = PcapHelper::DLT_IEEE802_11, DLT_PRISM_HEADER = PcapHelper::DLT_PRISM_HEADER, DLT_IEEE802_11_RADIO = PcapHelper::DLT_IEEE802_11_RADIO } |
An enumeration of the pcap data link types (DLTs) which this helper supports. More... | |
Public Member Functions | |
YansWifiPhyHelper () | |
Create a phy helper without any parameter set. More... | |
uint32_t | GetPcapDataLinkType (void) const |
Get the data link type of PCAP traces to be used. More... | |
void | Set (std::string name, const AttributeValue &v) |
void | SetChannel (Ptr< YansWifiChannel > channel) |
void | SetChannel (std::string channelName) |
void | SetErrorRateModel (std::string name, 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()) |
void | SetPcapDataLinkType (enum SupportedPcapDataLinkTypes dlt) |
Set the data link type of PCAP traces to be used. More... | |
![]() | |
virtual | ~WifiPhyHelper () |
![]() | |
PcapHelperForDevice () | |
Construct a PcapHelperForDevice. More... | |
virtual | ~PcapHelperForDevice () |
Destroy a PcapHelperForDevice. More... | |
void | EnablePcap (std::string prefix, Ptr< NetDevice > nd, bool promiscuous=false, bool explicitFilename=false) |
Enable pcap output the indicated net device. More... | |
void | EnablePcap (std::string prefix, std::string ndName, bool promiscuous=false, bool explicitFilename=false) |
Enable pcap output the indicated net device using a device previously named using the ns-3 object name service. More... | |
void | EnablePcap (std::string prefix, NetDeviceContainer d, bool promiscuous=false) |
Enable pcap output on each device in the container which is of the appropriate type. More... | |
void | EnablePcap (std::string prefix, NodeContainer n, bool promiscuous=false) |
Enable pcap output on each device (which is of the appropriate type) in the nodes provided in the container. More... | |
void | EnablePcap (std::string prefix, uint32_t nodeid, uint32_t deviceid, bool promiscuous=false) |
Enable pcap output on the device specified by a global node-id (of a previously created node) and associated device-id. More... | |
void | EnablePcapAll (std::string prefix, bool promiscuous=false) |
Enable pcap output on each device (which is of the appropriate type) in the set of all nodes created in the simulation. More... | |
![]() | |
AsciiTraceHelperForDevice () | |
Construct an AsciiTraceHelperForDevice. More... | |
virtual | ~AsciiTraceHelperForDevice () |
Destroy an AsciiTraceHelperForDevice. More... | |
void | EnableAscii (std::string prefix, Ptr< NetDevice > nd, bool explicitFilename=false) |
Enable ascii trace output on the indicated net device. More... | |
void | EnableAscii (Ptr< OutputStreamWrapper > stream, Ptr< NetDevice > nd) |
Enable ascii trace output on the indicated net device. More... | |
void | EnableAscii (std::string prefix, std::string ndName, bool explicitFilename=false) |
Enable ascii trace output the indicated net device using a device previously named using the ns-3 object name service. More... | |
void | EnableAscii (Ptr< OutputStreamWrapper > stream, std::string ndName) |
Enable ascii trace output the indicated net device using a device previously named using the ns-3 object name service. More... | |
void | EnableAscii (std::string prefix, NetDeviceContainer d) |
Enable ascii trace output on each device in the container which is of the appropriate type. More... | |
void | EnableAscii (Ptr< OutputStreamWrapper > stream, NetDeviceContainer d) |
Enable ascii trace output on each device in the container which is of the appropriate type. More... | |
void | EnableAscii (std::string prefix, NodeContainer n) |
Enable ascii trace output on each device (which is of the appropriate type) in the nodes provided in the container. More... | |
void | EnableAscii (Ptr< OutputStreamWrapper > stream, NodeContainer n) |
Enable ascii trace output on each device (which is of the appropriate type) in the nodes provided in the container. More... | |
void | EnableAscii (std::string prefix, uint32_t nodeid, uint32_t deviceid, bool explicitFilename) |
Enable ascii trace output on the device specified by a global node-id (of a previously created node) and associated device-id. More... | |
void | EnableAscii (Ptr< OutputStreamWrapper > stream, uint32_t nodeid, uint32_t deviceid) |
Enable ascii trace output on the device specified by a global node-id (of a previously created node) and associated device-id. More... | |
void | EnableAsciiAll (std::string prefix) |
Enable ascii trace output on each device (which is of the appropriate type) in the set of all nodes created in the simulation. More... | |
void | EnableAsciiAll (Ptr< OutputStreamWrapper > stream) |
Enable ascii trace output on each device (which is of the appropriate type) in the set of all nodes created in the simulation. More... | |
Static Public Member Functions | |
static YansWifiPhyHelper | Default (void) |
Create a phy helper in a default working state. More... | |
Private Member Functions | |
virtual Ptr< WifiPhy > | Create (Ptr< Node > node, Ptr< NetDevice > device) const |
virtual void | EnableAsciiInternal (Ptr< OutputStreamWrapper > stream, std::string prefix, Ptr< NetDevice > nd, bool explicitFilename) |
Enable ascii trace output on the indicated net device. More... | |
virtual void | EnablePcapInternal (std::string prefix, Ptr< NetDevice > nd, bool promiscuous, bool explicitFilename) |
Enable pcap output the indicated net device. More... | |
Private Attributes | |
Ptr< YansWifiChannel > | m_channel |
ObjectFactory | m_errorRateModel |
uint32_t | m_pcapDlt |
ObjectFactory | m_phy |
Make it easy to create and manage PHY objects for the yans model.
The yans PHY model is described in "Yet Another Network Simulator", http://cutebugs.net/files/wns2-yans.pdf
The Pcap and ascii traces generated by the EnableAscii and EnablePcap methods defined in this class correspond to PHY-level traces and come to us via WifiPhyHelper
Definition at line 160 of file yans-wifi-helper.h.
An enumeration of the pcap data link types (DLTs) which this helper supports.
See http://wiki.wireshark.org/Development/LibpcapFileFormat for more information on these formats.
Enumerator | |
---|---|
DLT_IEEE802_11 |
IEEE 802.11 Wireless LAN headers on packets. |
DLT_PRISM_HEADER |
Include Prism monitor mode information. |
DLT_IEEE802_11_RADIO |
Include Radiotap link layer information. |
Definition at line 231 of file yans-wifi-helper.h.
ns3::YansWifiPhyHelper::YansWifiPhyHelper | ( | ) |
Create a phy helper without any parameter set.
The user must set them all to be able to call Install later.
Definition at line 183 of file yans-wifi-helper.cc.
References m_phy, and ns3::ObjectFactory::SetTypeId().
|
privatevirtual |
node | the node on which we wish to create a wifi PHY |
device | the device within which this PHY will be created |
This method implements the pure virtual method defined in ns3::WifiPhyHelper.
Implements ns3::WifiPhyHelper.
Definition at line 241 of file yans-wifi-helper.cc.
References ns3::ObjectFactory::Create(), m_channel, m_errorRateModel, m_phy, third::phy, ns3::YansWifiPhy::SetChannel(), ns3::YansWifiPhy::SetDevice(), and ns3::YansWifiPhy::SetErrorRateModel().
|
static |
Create a phy helper in a default working state.
Definition at line 191 of file yans-wifi-helper.cc.
References SetErrorRateModel().
Referenced by BatteryLifetimeTest::ConstantLoadTest(), BasicEnergyDepletionTest::DepletionTestCase(), ns3::aodv::LoopbackTestCase::DoRun(), experiment(), and BatteryLifetimeTest::VariableLoadTest().
|
privatevirtual |
Enable ascii trace output on the indicated net device.
NetDevice-specific implementation mechanism for hooking the trace and writing to the trace file.
stream | The output stream object to use when logging ascii traces. |
prefix | Filename prefix to use for ascii trace files. |
nd | Net device for which you want to enable tracing. |
explicitFilename | Treat the prefix as an explicit filename if true |
Implements ns3::AsciiTraceHelperForDevice.
Reimplemented in ns3::YansWavePhyHelper.
Definition at line 701 of file yans-wifi-helper.cc.
References ns3::AsciiPhyReceiveSinkWithContext(), ns3::AsciiPhyReceiveSinkWithoutContext(), ns3::AsciiPhyTransmitSinkWithContext(), ns3::AsciiPhyTransmitSinkWithoutContext(), ns3::Config::Connect(), ns3::Config::ConnectWithoutContext(), ns3::AsciiTraceHelper::CreateFileStream(), ns3::Packet::EnablePrinting(), ns3::AsciiTraceHelper::GetFilenameFromDevice(), ns3::MakeBoundCallback(), and NS_LOG_INFO.
|
privatevirtual |
Enable pcap output the indicated net device.
NetDevice-specific implementation mechanism for hooking the trace and writing to the trace file.
prefix | Filename prefix to use for pcap files. |
nd | Net device for which you want to enable tracing. |
promiscuous | If true capture all possible packets available at the device. |
explicitFilename | Treat the prefix as an explicit filename if true |
Implements ns3::PcapHelperForDevice.
Reimplemented in ns3::YansWavePhyHelper.
Definition at line 667 of file yans-wifi-helper.cc.
References ns3::PcapHelper::CreateFile(), ns3::PcapHelper::GetFilenameFromDevice(), m_pcapDlt, ns3::MakeBoundCallback(), NS_ABORT_MSG_IF, NS_LOG_INFO, ns3::PcapSniffRxEvent(), ns3::PcapSniffTxEvent(), third::phy, and ns3::ObjectBase::TraceConnectWithoutContext().
uint32_t ns3::YansWifiPhyHelper::GetPcapDataLinkType | ( | void | ) | const |
Get the data link type of PCAP traces to be used.
Definition at line 661 of file yans-wifi-helper.cc.
References m_pcapDlt.
Referenced by ns3::YansWavePhyHelper::EnablePcapInternal().
void ns3::YansWifiPhyHelper::Set | ( | std::string | name, |
const AttributeValue & | v | ||
) |
name | the name of the attribute to set |
v | the value of the attribute |
Set an attribute of the underlying PHY object.
Definition at line 212 of file yans-wifi-helper.cc.
References m_phy, and ns3::ObjectFactory::Set().
Referenced by BatteryLifetimeTest::ConstantLoadTest(), BasicEnergyDepletionTest::DepletionTestCase(), RoutingExperiment::Run(), VanetRoutingExperiment::SetupAdhocDevices(), BatteryLifetimeTest::VariableLoadTest(), and WifiInterferenceTestCase::WifiSimpleInterference().
void ns3::YansWifiPhyHelper::SetChannel | ( | Ptr< YansWifiChannel > | channel | ) |
channel | the channel to associate to this helper |
Every PHY created by a call to Install is associated to this channel.
Definition at line 199 of file yans-wifi-helper.cc.
References third::channel, and m_channel.
Referenced by OcbWifiMacTestCase::ConfigureAdhocMode(), OcbWifiMacTestCase::ConfigureApStaMode(), OcbWifiMacTestCase::ConfigureOcbMode(), BatteryLifetimeTest::ConstantLoadTest(), PeerManagementProtocolRegressionTest::CreateDevices(), Bug772ChainTest::CreateDevices(), FlameRegressionTest::CreateDevices(), HwmpProactiveRegressionTest::CreateDevices(), AodvExample::CreateDevices(), HwmpDoRfRegressionTest::CreateDevices(), DsdvManetExample::CreateDevices(), HwmpSimplestRegressionTest::CreateDevices(), HwmpReactiveRegressionTest::CreateDevices(), ChainRegressionTest::CreateDevices(), MeshTest::CreateNodes(), WaveNetDeviceExample::CreateWaveNodes(), TestCaseHelper::CreatWaveDevice(), BasicEnergyDepletionTest::DepletionTestCase(), WifiMsduAggregatorThroughputTest::DoRun(), ns3::aodv::LoopbackTestCase::DoRun(), Bug730TestCase::DoRun(), experiment(), Experiment::Run(), RoutingExperiment::Run(), VanetRoutingExperiment::SetupAdhocDevices(), BatteryLifetimeTest::VariableLoadTest(), and WifiInterferenceTestCase::WifiSimpleInterference().
void ns3::YansWifiPhyHelper::SetChannel | ( | std::string | channelName | ) |
channelName | The name of the channel to associate to this helper |
Every PHY created by a call to Install is associated to this channel.
Definition at line 205 of file yans-wifi-helper.cc.
References third::channel, and m_channel.
void ns3::YansWifiPhyHelper::SetErrorRateModel | ( | std::string | name, |
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 () |
||
) |
name | the name of the error rate model to set. |
n0 | the name of the attribute to set |
v0 | the value of the attribute to set |
n1 | the name of the attribute to set |
v1 | the value of the attribute to set |
n2 | the name of the attribute to set |
v2 | the value of the attribute to set |
n3 | the name of the attribute to set |
v3 | the value of the attribute to set |
n4 | the name of the attribute to set |
v4 | the value of the attribute to set |
n5 | the name of the attribute to set |
v5 | the value of the attribute to set |
n6 | the name of the attribute to set |
v6 | the value of the attribute to set |
n7 | the name of the attribute to set |
v7 | the value of the attribute to set |
Set the error rate model and its attributes to use when Install is called.
Definition at line 218 of file yans-wifi-helper.cc.
References m_errorRateModel, ns3::ObjectFactory::Set(), and ns3::ObjectFactory::SetTypeId().
Referenced by Bug772ChainTest::CreateDevices(), HwmpProactiveRegressionTest::CreateDevices(), FlameRegressionTest::CreateDevices(), HwmpDoRfRegressionTest::CreateDevices(), HwmpReactiveRegressionTest::CreateDevices(), ChainRegressionTest::CreateDevices(), ns3::YansWavePhyHelper::Default(), and Default().
void ns3::YansWifiPhyHelper::SetPcapDataLinkType | ( | enum SupportedPcapDataLinkTypes | dlt | ) |
Set the data link type of PCAP traces to be used.
This function has to be called before EnablePcap(), so that the header of the pcap file can be written correctly.
dlt | The data link type of the pcap file (and packets) to be used |
Definition at line 642 of file yans-wifi-helper.cc.
References ns3::PcapHelper::DLT_IEEE802_11, DLT_IEEE802_11, ns3::PcapHelper::DLT_IEEE802_11_RADIO, DLT_IEEE802_11_RADIO, ns3::PcapHelper::DLT_PRISM_HEADER, DLT_PRISM_HEADER, m_pcapDlt, and NS_ABORT_MSG.
Referenced by BatteryLifetimeTest::ConstantLoadTest(), WaveNetDeviceExample::CreateWaveNodes(), BasicEnergyDepletionTest::DepletionTestCase(), VanetRoutingExperiment::SetupAdhocDevices(), BatteryLifetimeTest::VariableLoadTest(), and WifiInterferenceTestCase::WifiSimpleInterference().
|
private |
Definition at line 302 of file yans-wifi-helper.h.
Referenced by Create(), and SetChannel().
|
private |
Definition at line 301 of file yans-wifi-helper.h.
Referenced by Create(), and SetErrorRateModel().
|
private |
Definition at line 303 of file yans-wifi-helper.h.
Referenced by EnablePcapInternal(), GetPcapDataLinkType(), and SetPcapDataLinkType().
|
private |
Definition at line 300 of file yans-wifi-helper.h.
Referenced by Create(), Set(), and YansWifiPhyHelper().