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/frame-exchange-manager.h"
31 #include "ns3/wifi-default-protection-manager.h"
32 #include "ns3/wifi-default-ack-manager.h"
38 m_spreadChannelPolicy (ZERO_CHANNEL),
109 mp->AddInterface (iface);
111 if (!
m_stack->InstallStack (mp))
192 mac->SetDevice (device);
200 if (wifiMac != 0 && (fem = wifiMac->GetFrameExchangeManager ()) != 0)
203 protectionManager->SetWifiMac (wifiMac);
204 fem->SetProtectionManager (protectionManager);
207 ackManager->SetWifiMac (wifiMac);
208 fem->SetAckManager (ackManager);
210 phy->ConfigureStandardAndBand (it->second.phyStandard, it->second.phyBand);
215 mac->SwitchFrequencyChannel (channelId);
225 std::vector<Ptr<NetDevice> > ifaces = mp->GetInterfaces ();
229 os <<
"</MeshPointDevice>\n";
242 int64_t currentStream = stream;
253 std::vector<Ptr<NetDevice> > ifaces = mpd->GetInterfaces ();
254 for (std::vector<
Ptr<NetDevice> >::iterator i = ifaces.begin (); i != ifaces.end (); i++)
256 wifi = DynamicCast<WifiNetDevice> (*i);
259 currentStream +=
wifi->GetPhy ()->AssignStreams (currentStream);
266 currentStream += minstrel->AssignStreams (currentStream);
269 mac = DynamicCast<MeshWifiInterfaceMac> (
wifi->GetMac ());
272 currentStream +=
mac->AssignStreams (currentStream);
278 rmac->GetAttribute (
"Txop", ptr);
282 rmac->GetAttribute (
"VO_Txop", ptr);
286 rmac->GetAttribute (
"VI_Txop", ptr);
290 rmac->GetAttribute (
"BE_Txop", ptr);
294 rmac->GetAttribute (
"BK_Txop", ptr);
301 return (currentStream - stream);
Hold a value for an Attribute.
static Mac48Address Allocate(void)
Allocate a new Mac48Address.
static Mac48Address ConvertFrom(const Address &address)
Helper to create IEEE 802.11s mesh networks.
ObjectFactory m_stackFactory
stack factory
enum WifiStandard m_standard
standard
Ptr< WifiNetDevice > CreateInterface(const WifiPhyHelper &phyHelper, Ptr< Node > node, uint16_t channelId) const
Ptr< MeshStack > m_stack
stack
~MeshHelper()
Destroy a MeshHelper.
uint32_t m_nInterfaces
number of interfaces
ObjectFactory m_stationManager
the station manager
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())
void SetSpreadInterfaceChannels(ChannelPolicy policy)
set the channel policy
ObjectFactory m_mac
the MAC
ChannelPolicy m_spreadChannelPolicy
spread channel policy
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())
void SetStandard(enum WifiStandard standard)
Set standard.
MeshHelper()
Construct a MeshHelper used to make life easier when creating 802.11s networks.
int64_t AssignStreams(NetDeviceContainer c, int64_t stream)
Assign a fixed random variable stream number to the random variables used by this model.
static MeshHelper Default()
Set the helper to the default values for the MAC type, remote station manager and channel policy.
NetDeviceContainer Install(const WifiPhyHelper &phyHelper, NodeContainer c) const
Install 802.11s mesh device & protocols on given node list.
ChannelPolicy
Spread/not spread frequency channels of MP interfaces.
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())
void ResetStats(const ns3::Ptr< ns3::NetDevice > &device)
Reset statistics.
void Report(const ns3::Ptr< ns3::NetDevice > &device, std::ostream &os)
Print statistics.
void SetNumberOfInterfaces(uint32_t nInterfaces)
Set a number of interfaces in a mesh network.
Virtual net device modeling mesh point.
Prototype for class, which helps to install MAC-layer routing stack to ns3::MeshPointDevice.
Basic MAC of mesh point Wi-Fi interface.
holds a vector of ns3::NetDevice pointers
Iterator End(void) const
Get an iterator which indicates past-the-last NetDevice in the container.
std::vector< Ptr< NetDevice > >::const_iterator Iterator
NetDevice container iterator.
Iterator Begin(void) const
Get an iterator which refers to the first NetDevice in the container.
keep track of a set of node pointers.
Iterator Begin(void) const
Get an iterator which refers to the first Node in the container.
Iterator End(void) const
Get an iterator which indicates past-the-last Node in the container.
std::vector< Ptr< Node > >::const_iterator Iterator
Node container iterator.
uint32_t AddDevice(Ptr< NetDevice > device)
Associate a NetDevice to this node.
Instantiate subclasses of ns3::Object.
void Set(const std::string &name, const AttributeValue &value, Args &&... args)
Set an attribute to be set during construction.
Ptr< Object > Create(void) const
Create an Object instance of the configured TypeId.
void SetTypeId(TypeId tid)
Set the TypeId of the Objects to be created by this factory.
Ptr< T > GetObject(void) const
Get a pointer to the requested aggregated Object.
Hold objects of type Ptr<T>.
Handle packet fragmentation and retransmissions for QoS data frames as well as MSDU aggregation (A-MS...
static Time Now(void)
Return the current simulation virtual time.
The IEEE 802.11 SSID Information Element.
double GetSeconds(void) const
Get an approximation of the time stored in this instance in the indicated unit.
Handle packet fragmentation and retransmissions for data and management frames.
int64_t AssignStreams(int64_t stream)
Assign a fixed random variable stream number to the random variables used by this model.
void SetMac(const Ptr< WifiMac > mac)
void SetRemoteStationManager(const Ptr< WifiRemoteStationManager > manager)
void SetPhy(const Ptr< WifiPhy > phy)
virtual Ptr< WifiPhy > Create(Ptr< Node > node, Ptr< NetDevice > device) const =0
hold a list of per-remote-station state.
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
WifiStandard
Identifies the allowed configurations that a Wifi device is configured to use.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
const std::map< WifiStandard, WifiStandardInfo > wifiStandards
map a given standard configured by the user to the corresponding WifiStandardInfo