21 #include "ns3/gnuplot.h" 22 #include "ns3/command-line.h" 23 #include "ns3/config.h" 24 #include "ns3/uinteger.h" 25 #include "ns3/string.h" 27 #include "ns3/yans-wifi-helper.h" 28 #include "ns3/mobility-helper.h" 29 #include "ns3/ipv4-address-helper.h" 30 #include "ns3/on-off-helper.h" 31 #include "ns3/yans-wifi-channel.h" 32 #include "ns3/mobility-model.h" 33 #include "ns3/packet-socket-helper.h" 34 #include "ns3/packet-socket-address.h" 102 while ((packet = socket->
Recv ()))
111 TypeId tid = TypeId::LookupByName (
"ns3::PacketSocketFactory");
138 positionAlloc->
Add (Vector (0.0, 0.0, 0.0));
139 positionAlloc->
Add (Vector (5.0, 0.0, 0.0));
140 mobility.SetPositionAllocator (positionAlloc);
141 mobility.SetMobilityModel (
"ns3::ConstantPositionMobilityModel");
163 Simulator::Destroy ();
168 int main (
int argc,
char *argv[])
171 cmd.Parse (argc, argv);
183 wifiMac.
SetType (
"ns3::AdhocWifiMac");
187 wifi.SetRemoteStationManager (
"ns3::ConstantRateWifiManager",
194 wifi.SetRemoteStationManager (
"ns3::ConstantRateWifiManager",
201 wifi.SetRemoteStationManager (
"ns3::ConstantRateWifiManager",
208 wifi.SetRemoteStationManager (
"ns3::ConstantRateWifiManager",
215 wifi.SetRemoteStationManager (
"ns3::ConstantRateWifiManager",
222 wifi.SetRemoteStationManager (
"ns3::ConstantRateWifiManager",
229 wifi.SetRemoteStationManager (
"ns3::ConstantRateWifiManager",
236 wifi.SetRemoteStationManager (
"ns3::ConstantRateWifiManager",
243 gnuplot =
Gnuplot (
"rate-control.png");
248 wifi.SetRemoteStationManager (
"ns3::ArfWifiManager");
254 wifi.SetRemoteStationManager (
"ns3::AarfWifiManager");
260 wifi.SetRemoteStationManager (
"ns3::AarfcdWifiManager");
266 wifi.SetRemoteStationManager (
"ns3::CaraWifiManager");
272 wifi.SetRemoteStationManager (
"ns3::RraaWifiManager");
278 wifi.SetRemoteStationManager (
"ns3::IdealWifiManager");
Helper class for UAN CW MAC example.
holds a vector of ns3::Application pointers.
uint32_t m_bytesTotal
Total bytes received.
Vector GetPosition(Ptr< Node > node)
static void AdvancePosition(Ptr< Node > node)
Class to represent a 2D points plot.
uint32_t GetSize(void) const
Returns the the size in bytes of the packet (including the zero-filled initial payload).
Hold variables of type string.
Make it easy to create and manage PHY objects for the yans model.
static Vector GetPosition(Ptr< Node > node)
an address for a packet socket
void ReceivePacket(Ptr< Socket > socket)
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
void AddDataset(const GnuplotDataset &dataset)
helps to create WifiNetDevice objects
void ReceivePacket(Ptr< Socket > socket)
A helper to make it easier to instantiate an ns3::OnOffApplication on a set of nodes.
Give ns3::PacketSocket powers to ns3::Node.
void SetSingleDevice(uint32_t device)
Set the address to match only a specified NetDevice.
static void SetPosition(Ptr< Node > node, Vector position)
a polymophic address class
Ptr< YansWifiChannel > Create(void) const
Class for representing data rates.
Keep track of the current position and velocity of an object.
ApplicationContainer Install(NodeContainer c) const
Install an ns3::OnOffApplication on each node of the input container configured with all the attribut...
double Run(Parameters params)
a simple class to generate gnuplot-ready plotting commands from a set of datasets.
Hold an unsigned integer type.
holds a vector of ns3::NetDevice pointers
Callback< R > MakeCallback(R(T::*memPtr)(void), OBJ objPtr)
void GenerateOutput(std::ostream &os)
Writes gnuplot commands and data values to a single output stream.
void Add(double x, double y)
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.
This is intended to be the configuration used in this paper: Gavin Holland, Nitin Vaidya and Paramvir...
Ptr< T > GetObject(void) const
Get a pointer to the requested aggregated Object.
Ptr< Socket > SetupPacketReceive(Ptr< Node > node)
OFDM PHY for the 5 GHz band (Clause 17)
Every class exported by the ns3 library is enclosed in the ns3 namespace.
void SetConstantRate(DataRate dataRate, uint32_t packetSize=512)
Helper function to set a constant rate source.
void SetPhysicalAddress(const Address address)
Set the destination address.
keep track of a set of node pointers.
virtual Ptr< Packet > Recv(uint32_t maxSize, uint32_t flags)=0
Read data from the socket.
Gnuplot2dDataset m_output
manage and create wifi channel objects for the yans model.
create MAC layers for a ns3::WifiNetDevice.
void SetStyle(enum Style style)
virtual void SetType(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(), std::string n8="", const AttributeValue &v8=EmptyAttributeValue(), std::string n9="", const AttributeValue &v9=EmptyAttributeValue(), std::string n10="", const AttributeValue &v10=EmptyAttributeValue())
Helper class used to assign positions and mobility models to nodes.
void Stop(Time stop)
Arrange for all of the Applications in this container to Stop() at the Time given as a parameter...
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
Time Seconds(double value)
Construct a Time in the indicated unit.
void SetProtocol(uint16_t protocol)
Set the protocol.
void Add(Vector v)
Add a position to the list of positions.
Ptr< Node > Get(uint32_t i) const
Get the Ptr<Node> stored in this container at a given index.
void Install(Ptr< Node > node) const
Aggregate an instance of a ns3::PacketSocketFactory onto the provided node.
void Create(uint32_t n)
Create n nodes and append pointers to them to the end of this NodeContainer.
void AdvancePosition(Ptr< Node > node)
void SetPosition(Ptr< Node > node, Vector position)
a unique identifier for an interface.
Ptr< Socket > SetupPacketReceive(Ptr< Node > node)
void SetAttribute(std::string name, const AttributeValue &value)
Helper function used to set the underlying application attributes.
void experiment(bool enableCtsRts, std::string wifiManager)
Run single 10 seconds experiment.