23 #include "ns3/fcfs-wifi-queue-scheduler.h"
24 #include "ns3/frame-exchange-manager.h"
25 #include "ns3/mesh-point-device.h"
26 #include "ns3/mesh-wifi-interface-mac.h"
27 #include "ns3/minstrel-wifi-manager.h"
28 #include "ns3/pointer.h"
29 #include "ns3/simulator.h"
30 #include "ns3/wifi-default-ack-manager.h"
31 #include "ns3/wifi-default-protection-manager.h"
32 #include "ns3/wifi-helper.h"
33 #include "ns3/wifi-net-device.h"
39 m_spreadChannelPolicy(ZERO_CHANNEL),
67 for (
auto i = c.
Begin(); i != c.
End(); ++i)
86 mp->AddInterface(iface);
116 uint16_t channelId)
const
123 std::vector<Ptr<WifiPhy>> phys = phyHelper.
Create(node, device);
131 mac->SetDevice(device);
137 mac->SetMacQueueScheduler(CreateObject<FcfsWifiQueueScheduler>());
143 protectionManager->SetWifiMac(
mac);
144 fem->SetProtectionManager(protectionManager);
147 ackManager->SetWifiMac(
mac);
148 fem->SetAckManager(ackManager);
150 mac->SwitchFrequencyChannel(channelId);
161 std::vector<Ptr<NetDevice>> ifaces = mp->GetInterfaces();
165 os <<
"</MeshPointDevice>\n";
180 int64_t currentStream = stream;
182 for (
auto i = c.
Begin(); i != c.
End(); ++i)
190 currentStream += mpd->AssignStreams(currentStream);
192 std::vector<Ptr<NetDevice>> ifaces = mpd->GetInterfaces();
193 for (
auto i = ifaces.begin(); i != ifaces.end(); i++)
195 wifi = DynamicCast<WifiNetDevice>(*i);
198 currentStream +=
wifi->GetPhy()->AssignStreams(currentStream);
205 currentStream += minstrel->AssignStreams(currentStream);
208 mac = DynamicCast<MeshWifiInterfaceMac>(
wifi->GetMac());
209 currentStream +=
mac->AssignStreams(currentStream);
212 mac->GetAttribute(
"Txop", ptr);
216 mac->GetAttribute(
"VO_Txop", ptr);
220 mac->GetAttribute(
"VI_Txop", ptr);
224 mac->GetAttribute(
"BE_Txop", ptr);
228 mac->GetAttribute(
"BK_Txop", ptr);
234 return (currentStream - stream);
static Mac48Address ConvertFrom(const Address &address)
static Mac48Address Allocate()
Allocate a new Mac48Address.
Helper to create IEEE 802.11s mesh networks.
void SetRemoteStationManager(std::string type, Ts &&... args)
Set the remote station manager type and Attributes.
void SetStandard(WifiStandard standard)
Set 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 SetSpreadInterfaceChannels(ChannelPolicy policy)
set the channel policy
ObjectFactory m_mac
the MAC
ChannelPolicy m_spreadChannelPolicy
spread channel policy
static void EnableLogComponents()
Helper to enable all MeshPointDevice log components with one statement.
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.
void SetMacType(Ts &&... args)
Set the Mac Attributes.
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.
WifiStandard m_standard
standard
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.
Basic MAC of mesh point Wi-Fi interface.
holds a vector of ns3::NetDevice pointers
Iterator Begin() const
Get an iterator which refers to the first NetDevice in the container.
Iterator End() const
Get an iterator which indicates past-the-last NetDevice in the container.
keep track of a set of node pointers.
Iterator End() const
Get an iterator which indicates past-the-last Node in the container.
Iterator Begin() const
Get an iterator which refers to the first Node in the container.
uint32_t AddDevice(Ptr< NetDevice > device)
Associate a NetDevice to this node.
Instantiate subclasses of ns3::Object.
Ptr< Object > Create() const
Create an Object instance of the configured TypeId.
void Set(const std::string &name, const AttributeValue &value, Args &&... args)
Set an attribute to be set during construction.
Ptr< T > GetObject() 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()
Return the current simulation virtual time.
The IEEE 802.11 SSID Information Element.
double GetSeconds() 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.
static void EnableLogComponents()
Helper to enable all WifiNetDevice log components with one statement.
void SetMac(const Ptr< WifiMac > mac)
void SetRemoteStationManager(const Ptr< WifiRemoteStationManager > manager)
void SetPhy(const Ptr< WifiPhy > phy)
virtual std::vector< Ptr< WifiPhy > > Create(Ptr< Node > node, Ptr< WifiNetDevice > 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.
#define NS_ABORT_IF(cond)
Abnormal program termination if a condition is true.
WifiStandard
Identifies the IEEE 802.11 specifications that a Wifi device can be configured to use.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
void LogComponentEnable(const std::string &name, LogLevel level)
Enable the logging output associated with that log component.
@ LOG_LEVEL_ALL
Print everything.