|
A Discrete-Event Network Simulator
|
API
|
Go to the documentation of this file.
21 #include "ns3/core-module.h"
22 #include "ns3/network-module.h"
23 #include "ns3/internet-module.h"
24 #include "ns3/point-to-point-module.h"
25 #include "ns3/applications-module.h"
34 NS_LOG_INFO (
"Client has established a connection to the server.");
40 NS_LOG_INFO (
"Server generated a main object of " << size <<
" bytes.");
46 NS_LOG_INFO (
"Server generated an embedded object of " << size <<
" bytes.");
70 NS_LOG_INFO (
"Client has successfully received a main object of "
75 NS_LOG_INFO (
"Client failed to parse a main object. ");
88 NS_LOG_INFO (
"Client has successfully received an embedded object of "
93 NS_LOG_INFO (
"Client failed to parse an embedded object. ");
98 main (
int argc,
char *argv[])
100 double simTimeSec = 300;
102 cmd.AddValue (
"SimulationTime",
"Length of simulation in seconds.", simTimeSec);
103 cmd.Parse (argc, argv);
127 address.SetBase (
"10.1.1.0",
"255.255.255.0");
holds a vector of ns3::NetDevice pointers
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Parse command-line arguments.
uint32_t GetSize(void) const
Returns the the size in bytes of the packet (including the zero-filled initial payload).
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Helper to make it easier to instantiate an ThreeGppHttpServer on a set of nodes.
A helper class to make life easier while doing simple IPv4 address assignment in scripts.
void EmbeddedObjectGenerated(uint32_t size)
void LogComponentEnable(char const *name, enum LogLevel level)
Enable the logging output associated with that log component.
void LogComponentEnableAll(enum LogLevel level)
Enable the logging output for all registered log components.
Ipv4 addresses are stored in host order in this class.
Hold objects of type Ptr<T>.
void ClientEmbeddedObjectReceived(Ptr< const ThreeGppHttpClient >, Ptr< const Packet > packet)
Model application which simulates the traffic of a web browser.
void SetMainObjectSizeMean(uint32_t mean)
Smart pointer class similar to boost::intrusive_ptr.
void ClientMainObjectReceived(Ptr< const ThreeGppHttpClient >, Ptr< const Packet > packet)
void SetMainObjectSizeStdDev(uint32_t stdDev)
a polymophic address class
void GetAttribute(std::string name, AttributeValue &value) const
Get the value of an attribute, raising fatal errors if unsuccessful.
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
void ClientRx(Ptr< const Packet > packet, const Address &address)
uint32_t RemoveHeader(Header &header)
Deserialize and remove the header from the internal buffer.
holds a vector of std::pair of Ptr<Ipv4> and interface index.
void MainObjectGenerated(uint32_t size)
void ServerConnectionEstablished(Ptr< const ThreeGppHttpServer >, Ptr< Socket >)
Callback< R, Ts... > MakeCallback(R(T::*memPtr)(Ts...), OBJ objPtr)
Build Callbacks for class method members which take varying numbers of arguments and potentially retu...
static void Run(void)
Run the simulation.
Hold variables of type string.
@ LOG_PREFIX_TIME
Prefix all trace prints with simulation time.
Model application which simulates the traffic of a web server.
Container of various random variables to assist in generating web browsing traffic pattern.
Time Seconds(double value)
Construct a Time in the indicated unit.
Ptr< Packet > Copy(void) const
performs a COW copy of the packet.
static void Destroy(void)
Execute the events scheduled with ScheduleDestroy().
holds a vector of ns3::Application pointers.
Build a set of PointToPointNetDevice objects.
keep track of a set of node pointers.
bool TraceConnectWithoutContext(std::string name, const CallbackBase &cb)
Connect a TraceSource to a Callback without a context.
Helper to make it easier to instantiate an ThreeGppHttpClient on a set of nodes.
aggregate IP/TCP/UDP functionality to existing Nodes.
void ServerTx(Ptr< const Packet > packet)
static void SetResolution(enum Unit resolution)
@ LOG_INFO
Informational messages (e.g., banners).