21 #include "mesh-helper.h"
22 #include "ns3/simulator.h"
23 #include "ns3/mesh-point-device.h"
24 #include "ns3/wifi-net-device.h"
25 #include "ns3/minstrel-wifi-manager.h"
26 #include "ns3/mesh-wifi-interface-mac.h"
31 m_spreadChannelPolicy (ZERO_CHANNEL),
43 m_spreadChannelPolicy = policy;
57 m_stackFactory.
Set (n0, v0);
58 m_stackFactory.
Set (n1, v1);
59 m_stackFactory.
Set (n2, v2);
60 m_stackFactory.
Set (n3, v3);
61 m_stackFactory.
Set (n4, v4);
62 m_stackFactory.
Set (n5, v5);
63 m_stackFactory.
Set (n6, v6);
64 m_stackFactory.
Set (n7, v7);
76 m_nInterfaces = nInterfaces;
83 for (NodeContainer::Iterator i = c.
Begin (); i != c.
End (); ++i)
90 for (uint32_t i = 0; i < m_nInterfaces; ++i)
93 if (m_spreadChannelPolicy == ZERO_CHANNEL)
97 if (m_spreadChannelPolicy == SPREAD_CHANNELS)
102 mp->AddInterface (iface);
104 if (!m_stack->InstallStack (mp))
132 m_mac.
SetTypeId (
"ns3::MeshWifiInterfaceMac");
155 m_stationManager.
Set (n0, v0);
156 m_stationManager.
Set (n1, v1);
157 m_stationManager.
Set (n2, v2);
158 m_stationManager.
Set (n3, v3);
159 m_stationManager.
Set (n4, v4);
160 m_stationManager.
Set (n5, v5);
161 m_stationManager.
Set (n6, v6);
162 m_stationManager.
Set (n7, v7);
167 m_standard = standard;
177 mac->SetSsid (
Ssid ());
182 mac->ConfigureStandard (m_standard);
183 phy->ConfigureStandard (m_standard);
184 device->SetMac (mac);
185 device->SetPhy (phy);
186 device->SetRemoteStationManager (manager);
188 mac->SwitchFrequencyChannel (channelId);
197 std::vector<Ptr<NetDevice> > ifaces = mp->GetInterfaces ();
200 m_stack->Report (mp, os);
201 os <<
"</MeshPointDevice>\n";
209 m_stack->ResetStats (mp);
214 int64_t currentStream = stream;
216 for (NetDeviceContainer::Iterator i = c.
Begin (); i != c.
End (); ++i)
225 std::vector<Ptr<NetDevice> > ifaces = mpd->GetInterfaces ();
226 for (std::vector<
Ptr<NetDevice> >::iterator i = ifaces.begin (); i != ifaces.end (); i++)
228 wifi = DynamicCast<WifiNetDevice> (*i);
231 currentStream += wifi->GetPhy ()->AssignStreams (currentStream);
238 currentStream += minstrel->AssignStreams (currentStream);
241 mac = DynamicCast<MeshWifiInterfaceMac> (wifi->GetMac ());
244 currentStream += mac->AssignStreams (currentStream);
249 return (currentStream - stream);
Iterator Begin(void) const
Get an iterator which refers to the first NetDevice in the container.
Hold a value for an Attribute.
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())
#define NS_ASSERT(condition)
void SetTypeId(TypeId tid)
Iterator End(void) const
Get an iterator which indicates past-the-last Node in the container.
Ptr< WifiNetDevice > CreateInterface(const WifiPhyHelper &phyHelper, Ptr< Node > node, uint16_t channelId) const
void Report(const ns3::Ptr< ns3::NetDevice > &, std::ostream &)
Print statistics.
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.
#define NS_FATAL_ERROR(msg)
fatal error handling
double GetSeconds(void) const
static Mac48Address Allocate(void)
Ptr< Object > Create(void) const
void Add(NetDeviceContainer other)
Append the contents of another NetDeviceContainer to the end of this container.
holds a vector of ns3::NetDevice pointers
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.
keep track of a set of node pointers.
Iterator Begin(void) const
Get an iterator which refers to the first Node in the container.
void Set(std::string name, const AttributeValue &value)
virtual Ptr< WifiPhy > Create(Ptr< Node > node, Ptr< WifiNetDevice > device) const =0
void SetSpreadInterfaceChannels(ChannelPolicy)
set the channel policy
int64_t AssignStreams(NetDeviceContainer c, int64_t stream)
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 > &)
Reset statistics.
Virtual net device modeling mesh point.
void SetStandard(enum WifiPhyStandard standard)
instantiate subclasses of ns3::Object.
uint32_t AddDevice(Ptr< NetDevice > device)
NetDeviceContainer Install(const WifiPhyHelper &phyHelper, NodeContainer c) const
Install 802.11s mesh device & protocols on given node list.
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.
Iterator End(void) const
Get an iterator which indicates past-the-last NetDevice in the container.
Ptr< T > GetObject(void) const
Basic MAC of mesh point Wi-Fi interface. Its function is extendable through plugins mechanism...