47 #include "ns3/core-module.h"
48 #include "ns3/internet-module.h"
49 #include "ns3/network-module.h"
50 #include "ns3/applications-module.h"
51 #include "ns3/wifi-module.h"
52 #include "ns3/mesh-module.h"
53 #include "ns3/mobility-module.h"
54 #include "ns3/mesh-helper.h"
69 void Configure (
int argc,
char ** argv);
97 void InstallInternetStack ();
99 void InstallApplication ();
109 m_packetInterval (0.1),
115 m_root (
"ff:ff:ff:ff:ff:ff")
122 cmd.
AddValue (
"x-size",
"Number of nodes in a row grid. [6]",
m_xSize);
124 cmd.
AddValue (
"step",
"Size of edge in our grid, meters. [100 m]",
m_step);
133 cmd.
AddValue (
"interfaces",
"Number of radio interfaces used by each mesh point. [1]",
m_nIfaces);
134 cmd.
AddValue (
"channels",
"Use different frequency channels for different interfaces. [0]",
m_chan);
135 cmd.
AddValue (
"pcap",
"Enable PCAP traces on interfaces. [0]",
m_pcap);
136 cmd.
AddValue (
"stack",
"Type of protocol stack. ns3::Dot11sStack by default",
m_stack);
137 cmd.
AddValue (
"root",
"Mac address of root mesh point in HWMP",
m_root);
139 cmd.
Parse (argc, argv);
159 mesh = MeshHelper::Default ();
203 address.
SetBase (
"10.1.1.0",
"255.255.255.0");
211 serverApps.
Start (Seconds (0.0));
218 clientApps.
Start (Seconds (0.0));
230 Simulator::Destroy ();
239 std::ostringstream os;
240 os <<
"mp-report-" << n <<
".xml";
241 std::cerr <<
"Printing mesh point device #" << n <<
" diagnostics to " << os.str () <<
"\n";
243 of.open (os.str ().c_str ());
246 std::cerr <<
"Error: Can't open file " << os.str () <<
"\n";
holds a vector of ns3::Application pointers.
Iterator Begin(void) const
Get an iterator which refers to the first NetDevice in the container.
NS_LOG_COMPONENT_DEFINE("GrantedTimeWindowMpiInterface")
holds a vector of std::pair of Ptr and interface index.
Ptr< YansWifiChannel > Create(void) const
hold variables of type string
Make it easy to create and manage PHY objects for the yans model.
Create an application which sends a UDP packet and waits for an echo of this packet.
aggregate IP/TCP/UDP functionality to existing Nodes.
int main(int argc, char *argv[])
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.
ApplicationContainer Install(Ptr< Node > node) const
Create a UdpEchoServerApplication on the specified Node.
void SetChannel(Ptr< YansWifiChannel > channel)
Create a server application which waits for input UDP packets and sends them back to the original sen...
NetDeviceContainer meshDevices
List of all mesh point devices.
void Install(Ptr< Node > node) const
"Layout" a single node according to the current position allocator type.
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 ...
hold objects of type ns3::Time
Hold an unsigned integer type.
holds a vector of ns3::NetDevice pointers
void Start(Time start)
Arrange for all of the Applications in this container to Start() at the Time given as a parameter...
Parse command-line arguments.
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 InstallApplication()
Install applications.
keep track of a set of node pointers.
void SetMobilityModel(std::string type, 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(), std::string n8="", const AttributeValue &v8=EmptyAttributeValue(), std::string n9="", const AttributeValue &v9=EmptyAttributeValue())
void CreateNodes()
Create nodes and setup their mobility.
void Install(std::string nodeName) const
Aggregate implementations of the ns3::Ipv4, ns3::Ipv6, ns3::Udp, and ns3::Tcp classes onto the provid...
manage and create wifi channel objects for the yans model.
void SetSpreadInterfaceChannels(ChannelPolicy)
set the channel policy
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())
Helper class used to assign positions and mobility models to nodes.
Ipv4InterfaceContainer interfaces
void Configure(int argc, char **argv)
Configure test from command line arguments.
void Stop(Time stop)
Arrange for all of the Applications in this container to Stop() at the Time given as a parameter...
Ipv4InterfaceContainer Assign(const NetDeviceContainer &c)
Assign IP addresses to the net devices specified in the container based on the current network prefix...
NetDeviceContainer Install(const WifiPhyHelper &phyHelper, NodeContainer c) const
Install 802.11s mesh device & protocols on given node list.
hold objects of type ns3::Mac48Address
void AddValue(const std::string &name, const std::string &help, T &value)
Add a program argument, assigning to POD.
Ptr< Node > Get(uint32_t i) const
Get the Ptr stored in this container at a given index.
std::vector< Ptr< NetDevice > >::const_iterator Iterator
#define NS_LOG_DEBUG(msg)
void Parse(int argc, char *argv[])
Parse the program arguments.
A helper class to make life easier while doing simple IPv4 address assignment in scripts.
void Create(uint32_t n)
Create n nodes and append pointers to them to the end of this NodeContainer.
Helper to create IEEE 802.11s mesh networks.
void SetPositionAllocator(Ptr< PositionAllocator > allocator)
Set the position allocator which will be used to allocate the initial position of every node initiali...
Iterator End(void) const
Get an iterator which indicates past-the-last NetDevice in the container.
NodeContainer nodes
List of network nodes.
Hold a floating point type.
void InstallInternetStack()
Install internet m_stack on nodes.
void Report()
Print mesh devices diagnostics.
void SetBase(Ipv4Address network, Ipv4Mask mask, Ipv4Address base="0.0.0.1")
Set the base network number, network mask and base address.
Ipv4Address GetAddress(uint32_t i, uint32_t j=0) const