35 #include "ns3/core-module.h"
36 #include "ns3/network-module.h"
37 #include "ns3/csma-module.h"
38 #include "ns3/applications-module.h"
53 main (
int argc,
char *argv[])
60 cmd.
Parse (argc, argv);
62 g_os.open (
"csma-packet-socket-sink.tr",std::ios_base::binary | std::ios_base::out);
93 apps.
Start (Seconds (1.0));
94 apps.
Stop (Seconds (10.0));
101 apps.
Start (Seconds (1.0));
102 apps.
Stop (Seconds (10.0));
108 apps.
Start (Seconds (0.0));
109 apps.
Stop (Seconds (20.0));
holds a vector of ns3::Application pointers.
Manage ASCII trace files for device models.
NS_LOG_COMPONENT_DEFINE("GrantedTimeWindowMpiInterface")
hold variables of type string
Ptr< NetDevice > Get(uint32_t i) const
Get the Ptr stored in this container at a given index.
an address for a packet socket
static void Run(void)
Run the simulation until one of:
uint32_t GetSize(void) const
NetDeviceContainer Install(Ptr< Node > node) const
This method creates an ns3::CsmaChannel with the attributes configured by CsmaHelper::SetChannelAttri...
A helper to make it easier to instantiate an ns3::PacketSinkApplication on a set of nodes...
Ptr< OutputStreamWrapper > CreateFileStream(std::string filename, std::ios::openmode filemode=std::ios::out)
Create and initialize an output stream object we'll use to write the traced bits. ...
void Connect(std::string path, const CallbackBase &cb)
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)
a polymophic address class
int main(int argc, char *argv[])
Class for representing data rates.
hold objects of type ns3::Time
holds a vector of ns3::NetDevice pointers
Callback< R > MakeCallback(R(T::*memPtr)(void), OBJ objPtr)
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.
static void Destroy(void)
Every event scheduled by the Simulator::insertAtDestroy method is invoked.
void SetConstantRate(DataRate dataRate, uint32_t packetSize=512)
Helper function to set a constant rate source.
void SetPhysicalAddress(const Address address)
keep track of a set of node pointers.
void Install(Ptr< Node > node) const
Aggregate an instance of a ns3::PacketSocketFactory onto the provided node.
build a set of CsmaNetDevice objects
void SetDeviceAttribute(std::string n1, const AttributeValue &v1)
hold objects of type ns3::Address
void Stop(Time stop)
Arrange for all of the Applications in this container to Stop() at the Time given as a parameter...
hold objects of type ns3::DataRate
Ptr< Node > Get(uint32_t i) const
Get the Ptr stored in this container at a given index.
void SetProtocol(uint16_t protocol)
ApplicationContainer Install(NodeContainer c) const
Install an ns3::PacketSinkApplication on each node of the input container configured with all the att...
void Parse(int argc, char *argv[])
Parse the program arguments.
void EnableAsciiAll(std::string prefix)
Enable ascii trace output on each device (which is of the appropriate type) in the set of all nodes c...
void Create(uint32_t n)
Create n nodes and append pointers to them to the end of this NodeContainer.
static void SinkRx(std::string path, Ptr< const Packet > p, const Address &address)
ApplicationContainer Install(NodeContainer c) const
Install an ns3::OnOffApplication on each node of the input container configured with all the attribut...
void SetAttribute(std::string name, const AttributeValue &value)
Helper function used to set the underlying application attributes.
void LogComponentEnable(char const *name, enum LogLevel level)