9#include "ns3/applications-module.h"
10#include "ns3/core-module.h"
11#include "ns3/internet-module.h"
12#include "ns3/network-module.h"
13#include "ns3/point-to-point-module.h"
22 NS_LOG_INFO(
"Client has established a connection to the server.");
28 NS_LOG_INFO(
"Server generated a main object of " << size <<
" bytes.");
34 NS_LOG_INFO(
"Server generated an embedded object of " << size <<
" bytes.");
40 NS_LOG_INFO(
"Server sent a packet of " << packet->GetSize() <<
" bytes.");
46 NS_LOG_INFO(
"Client received a packet of " << packet->GetSize() <<
" bytes from " << address);
54 p->RemoveHeader(header);
58 NS_LOG_INFO(
"Client has successfully received a main object of " << p->GetSize()
63 NS_LOG_INFO(
"Client failed to parse a main object. ");
72 p->RemoveHeader(header);
76 NS_LOG_INFO(
"Client has successfully received an embedded object of " << p->GetSize()
81 NS_LOG_INFO(
"Client failed to parse an embedded object. ");
92 <<
" ms to load with " << numObjects <<
" objects and " << numBytes
97main(
int argc,
char* argv[])
99 double simTimeSec = 300;
101 cmd.AddValue(
"SimulationTime",
"Length of simulation in seconds.", simTimeSec);
102 cmd.Parse(argc, argv);
126 address.SetBase(
"10.1.1.0",
"255.255.255.0");
140 httpServer->TraceConnectWithoutContext(
"ConnectionEstablished",
143 httpServer->TraceConnectWithoutContext(
"EmbeddedObject",
149 httpServer->GetAttribute(
"Variables", varPtr);
151 httpVariables->SetMainObjectSizeMean(102400);
152 httpVariables->SetMainObjectSizeStdDev(40960);
163 httpClient->TraceConnectWithoutContext(
"RxEmbeddedObject",
a polymophic address class
holds a vector of ns3::Application pointers.
Parse command-line arguments.
aggregate IP/TCP/UDP functionality to existing Nodes.
A helper class to make life easier while doing simple IPv4 address assignment in scripts.
Ipv4 addresses are stored in host order in this class.
holds a vector of std::pair of Ptr<Ipv4> and interface index.
holds a vector of ns3::NetDevice pointers
keep track of a set of node pointers.
void Create(uint32_t n)
Create n nodes and append pointers to them to the end of this NodeContainer.
Ptr< Node > Get(uint32_t i) const
Get the Ptr<Node> stored in this container at a given index.
Build a set of PointToPointNetDevice objects.
AttributeValue implementation for Pointer.
Smart pointer class similar to boost::intrusive_ptr.
static void Destroy()
Execute the events scheduled with ScheduleDestroy().
static void Run()
Run the simulation.
Hold variables of type string.
Helper to make it easier to instantiate an ThreeGppHttpClient on a set of nodes.
Model application which simulates the traffic of a web browser.
Helper to make it easier to instantiate an ThreeGppHttpServer on a set of nodes.
Model application which simulates the traffic of a web server.
Container of various random variables to assist in generating web browsing traffic pattern.
Simulation virtual time values and global simulation resolution.
TimeWithUnit As(const Unit unit=Time::AUTO) const
Attach a unit to a Time, to facilitate output in a specific unit.
static void SetResolution(Unit resolution)
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
Time Seconds(double value)
Construct a Time in the indicated unit.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
void LogComponentEnable(const std::string &name, LogLevel level)
Enable the logging output associated with that log component.
Callback< R, Args... > MakeCallback(R(T::*memPtr)(Args...), OBJ objPtr)
Build Callbacks for class method members which take varying numbers of arguments and potentially retu...
@ LOG_PREFIX_TIME
Prefix all trace prints with simulation time.
@ LOG_INFO
Something happened to change state.
void LogComponentEnableAll(LogLevel level)
Enable the logging output for all registered log components.
void MainObjectGenerated(uint32_t size)
void ServerTx(Ptr< const Packet > packet)
void ClientPageReceived(Ptr< const ThreeGppHttpClient > client, const Time &time, uint32_t numObjects, uint32_t numBytes)
void ClientRx(Ptr< const Packet > packet, const Address &address)
void ServerConnectionEstablished(Ptr< const ThreeGppHttpServer >, Ptr< Socket >)
void ClientEmbeddedObjectReceived(Ptr< const ThreeGppHttpClient >, Ptr< const Packet > packet)
void ClientMainObjectReceived(Ptr< const ThreeGppHttpClient >, Ptr< const Packet > packet)
void EmbeddedObjectGenerated(uint32_t size)