23 #include "ns3/simulator.h" 24 #include "ns3/pointer.h" 25 #include "ns3/mesh-point-device.h" 26 #include "ns3/wifi-net-device.h" 27 #include "ns3/minstrel-wifi-manager.h" 28 #include "ns3/mesh-wifi-interface-mac.h" 29 #include "ns3/wifi-helper.h" 30 #include "ns3/wifi-ack-policy-selector.h" 36 m_spreadChannelPolicy (ZERO_CHANNEL),
107 mp->AddInterface (iface);
109 if (!
m_stack->InstallStack (mp))
209 mac->SetDevice (device);
220 mac->SwitchFrequencyChannel (channelId);
225 mac->GetAttributeFailSafe (
"BE_Txop", ptr);
227 ackSelector->SetQosTxop (ptr.
Get<
QosTxop> ());
228 ptr.
Get<
QosTxop> ()->SetAckPolicySelector (ackSelector);
230 mac->GetAttributeFailSafe (
"BK_Txop", ptr);
232 ackSelector->SetQosTxop (ptr.
Get<
QosTxop> ());
233 ptr.
Get<
QosTxop> ()->SetAckPolicySelector (ackSelector);
235 mac->GetAttributeFailSafe (
"VI_Txop", ptr);
237 ackSelector->SetQosTxop (ptr.
Get<
QosTxop> ());
238 ptr.
Get<
QosTxop> ()->SetAckPolicySelector (ackSelector);
240 mac->GetAttributeFailSafe (
"VO_Txop", ptr);
242 ackSelector->SetQosTxop (ptr.
Get<
QosTxop> ());
243 ptr.
Get<
QosTxop> ()->SetAckPolicySelector (ackSelector);
253 std::vector<Ptr<NetDevice> > ifaces = mp->GetInterfaces ();
257 os <<
"</MeshPointDevice>\n";
270 int64_t currentStream = stream;
281 std::vector<Ptr<NetDevice> > ifaces = mpd->GetInterfaces ();
282 for (std::vector<
Ptr<NetDevice> >::iterator i = ifaces.begin (); i != ifaces.end (); i++)
284 wifi = DynamicCast<WifiNetDevice> (*i);
287 currentStream +=
wifi->GetPhy ()->AssignStreams (currentStream);
294 currentStream += minstrel->AssignStreams (currentStream);
297 mac = DynamicCast<MeshWifiInterfaceMac> (
wifi->GetMac ());
300 currentStream +=
mac->AssignStreams (currentStream);
306 rmac->GetAttribute (
"Txop", ptr);
310 rmac->GetAttribute (
"VO_Txop", ptr);
314 rmac->GetAttribute (
"VI_Txop", ptr);
318 rmac->GetAttribute (
"BE_Txop", ptr);
322 rmac->GetAttribute (
"BK_Txop", ptr);
329 return (currentStream - stream);
Ptr< WifiNetDevice > CreateInterface(const WifiPhyHelper &phyHelper, Ptr< Node > node, uint16_t channelId) const
std::vector< Ptr< Node > >::const_iterator Iterator
Node container iterator.
Iterator End(void) const
Get an iterator which indicates past-the-last NetDevice in the container.
ObjectFactory m_ackPolicySelector[4]
ack policy selector for all ACs
Hold a value for an Attribute.
void Report(const ns3::Ptr< ns3::NetDevice > &device, std::ostream &os)
Print statistics.
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())
ChannelPolicy m_spreadChannelPolicy
spread channel policy
Handle packet fragmentation and retransmissions for QoS data frames as well as MSDU aggregation (A-MS...
double GetSeconds(void) const
Get an approximation of the time stored in this instance in the indicated unit.
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file...
void SetTypeId(TypeId tid)
Set the TypeId of the Objects to be created by this factory.
void SetAckPolicySelectorForAc(AcIndex ac, 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())
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
Iterator End(void) const
Get an iterator which indicates past-the-last Node in the container.
void SetNumberOfInterfaces(uint32_t nInterfaces)
Set a number of interfaces in a mesh network.
Prototype for class, which helps to install MAC-layer routing stack to ns3::MeshPointDevice.
MeshHelper()
Construct a MeshHelper used to make life easier when creating 802.11s networks.
WifiPhyStandard
Identifies the PHY specification that a Wifi device is configured to use.
void SetSpreadInterfaceChannels(ChannelPolicy policy)
set the channel policy
uint32_t m_nInterfaces
number of interfaces
static Mac48Address Allocate(void)
Allocate a new Mac48Address.
Ptr< Object > Create(void) const
Create an Object instance of the configured TypeId.
void SetMac(const Ptr< WifiMac > mac)
int64_t AssignStreams(int64_t stream)
Assign a fixed random variable stream number to the random variables used by this model...
Iterator Begin(void) const
Get an iterator which refers to the first NetDevice in the container.
ObjectFactory m_mac
the MAC
holds a vector of ns3::NetDevice pointers
ObjectFactory m_stackFactory
stack factory
Ptr< MeshStack > m_stack
stack
hold a list of per-remote-station state.
void SetMacType(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())
static Mac48Address ConvertFrom(const Address &address)
ChannelPolicy
Spread/not spread frequency channels of MP interfaces.
Ptr< T > GetObject(void) const
Get a pointer to the requested aggregated Object.
OFDM PHY for the 5 GHz band (Clause 17)
Every class exported by the ns3 library is enclosed in the ns3 namespace.
keep track of a set of node pointers.
Hold objects of type Ptr<T>.
ObjectFactory m_stationManager
the station manager
void ResetStats(const ns3::Ptr< ns3::NetDevice > &device)
Reset statistics.
void Set(std::string name, const AttributeValue &value)
Set an attribute to be set during construction.
static Time Now(void)
Return the current simulation virtual time.
int64_t AssignStreams(NetDeviceContainer c, int64_t stream)
Assign a fixed random variable stream number to the random variables used by this model...
void SetStackInstaller(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())
Virtual net device modeling mesh point.
The IEEE 802.11 SSID Information Element.
void SetStandard(enum WifiPhyStandard standard)
Set PHY standard.
Instantiate subclasses of ns3::Object.
void SetPhy(const Ptr< WifiPhy > phy)
NetDeviceContainer Install(const WifiPhyHelper &phyHelper, NodeContainer c) const
Install 802.11s mesh device & protocols on given node list.
virtual Ptr< WifiPhy > Create(Ptr< Node > node, Ptr< NetDevice > device) const =0
uint32_t AddDevice(Ptr< NetDevice > device)
Associate a NetDevice to this node.
std::vector< Ptr< NetDevice > >::const_iterator Iterator
NetDevice container iterator.
static MeshHelper Default()
Set the helper to the default values for the MAC type, remote station manager and channel policy...
Helper to create IEEE 802.11s mesh networks.
enum WifiPhyStandard m_standard
phy standard
~MeshHelper()
Destroy a MeshHelper.
WifiAckPolicySelector is in charge of selecting the acknowledgment policy for PSDUs containing QoS Da...
Basic MAC of mesh point Wi-Fi interface.
AcIndex
This enumeration defines the Access Categories as an enumeration with values corresponding to the AC ...
Iterator Begin(void) const
Get an iterator which refers to the first Node in the container.
void SetRemoteStationManager(const Ptr< WifiRemoteStationManager > manager)
Handle packet fragmentation and retransmissions for data and management frames.