22 #ifndef THREE_GPP_HTTP_CLIENT_H 23 #define THREE_GPP_HTTP_CLIENT_H 25 #include <ns3/application.h> 26 #include <ns3/address.h> 27 #include <ns3/traced-callback.h> 28 #include <ns3/three-gpp-http-header.h> 36 class ThreeGppHttpVariables;
Time m_objectServerTs
The server time stamp of the ThreeGppHttpHeader from the last received packet.
void NormalCloseCallback(Ptr< Socket > socket)
Invoked when connection between m_socket and the web sever is terminated.
Time m_objectClientTs
The client time stamp of the ThreeGppHttpHeader from the last received packet.
Simulation virtual time values and global simulation resolution.
User reading a web page that has just been received.
ns3::TracedCallback< Ptr< const Packet > > m_rxEmbeddedObjectPacketTrace
The TxEmbeddedObjectPacket trace source.
void EnterReadingTime()
Becomes idle for a randomly determined amount of time, and then triggers RequestMainObject().
uint32_t m_objectBytesToBeReceived
According to the content length specified by the ThreeGppHttpHeader.
Forward calls to a chain of Callback.
void OpenConnection()
Initialize m_socket to connect to the destination web server at m_remoteServerAddress and m_remoteSer...
Parsing a main object that has just been received.
State_t GetState() const
Returns the current state of the application.
void ReceiveMainObject(Ptr< Packet > packet, const Address &from)
Receive a packet of main object from the destination web server.
Sent the server a request for a main object and waiting to receive the packets.
void ErrorCloseCallback(Ptr< Socket > socket)
Invoked when connection between m_socket and the web sever is terminated.
static TypeId GetTypeId()
Returns the object TypeId.
a polymophic address class
ns3::TracedCallback< Ptr< const Packet > > m_txEmbeddedObjectRequestTrace
The TxEmbeddedObjectRequest trace source.
ns3::TracedCallback< Ptr< const ThreeGppHttpClient > > m_connectionEstablishedTrace
The ConnectionEstablished trace source.
The base class for all ns3 applications.
Model application which simulates the traffic of a web browser.
ns3::TracedCallback< Ptr< const Packet >, const Address & > m_rxTrace
The Rx trace source.
ns3::TracedCallback< const Time &, const Address & > m_rxDelayTrace
The RxDelay trace source.
State_t m_state
The current state of the client application. Begins with NOT_STARTED.
ns3::TracedCallback< Ptr< const Packet > > m_txMainObjectRequestTrace
The TxMainObjectRequest trace source.
void ReceiveEmbeddedObject(Ptr< Packet > packet, const Address &from)
Receive a packet of embedded object from the destination web server.
EventId m_eventRequestMainObject
An event of either RequestMainObject() or OpenConnection(), scheduled to trigger after a connection h...
void RequestMainObject()
Send a request object for a main object to the destination web server.
void ParseMainObject()
Randomly determines the number of embedded objects in the main object.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
void ReceivedDataCallback(Ptr< Socket > socket)
Invoked when m_socket receives some packet data.
Ptr< ThreeGppHttpVariables > m_httpVariables
The Variables attribute.
Before StartApplication() is invoked.
std::string GetStateString() const
Returns the current state of the application in string format.
void EnterParsingTime()
Becomes idle for a randomly determined amount of time, and then triggers ParseMainObject().
State_t
The possible states of the application.
void SwitchToState(State_t state)
Change the state of the client.
void RequestEmbeddedObject()
Send a request object for an embedded object to the destination web server.
ns3::TracedCallback< Ptr< const ThreeGppHttpClient >, Ptr< const Packet > > m_rxMainObjectTrace
The TxMainObject trace source.
Sent the server a connection request and waiting for the server to be accept it.
ns3::TracedCallback< const Time &, const Address & > m_rxRttTrace
The RxRtt trace source.
void Receive(Ptr< Packet > packet)
Simulate a consumption of the received packet by subtracting the packet size from the internal counte...
An identifier for simulation events.
Ptr< Packet > m_constructedPacket
The packet constructed of one or more parts with ThreeGppHttpHeader.
ns3::TracedCallback< Ptr< const Packet > > m_rxMainObjectPacketTrace
The TxMainObjectPacket trace source.
virtual void StartApplication()
Application specific startup code.
ns3::TracedCallback< Ptr< const ThreeGppHttpClient >, Ptr< const Packet > > m_rxEmbeddedObjectTrace
The TxEmbeddedObject trace source.
Ptr< Socket > GetSocket() const
Returns a pointer to the associated socket.
ns3::TracedCallback< Ptr< const ThreeGppHttpClient > > m_connectionClosedTrace
The ConnectionClosed trace source.
Address m_remoteServerAddress
The RemoteServerAddress attribute. The address of the web server.
uint16_t m_remoteServerPort
The RemoteServerPort attribute.
EventId m_eventRequestEmbeddedObject
An event of either RequestEmbeddedObject() or OpenConnection().
void CancelAllPendingEvents()
Cancels m_eventRequestMainObject, m_eventRequestEmbeddedObject, and m_eventParseMainObject.
ThreeGppHttpClient()
Creates a new instance of HTTP client application.
virtual void StopApplication()
Application specific shutdown code.
Sent the server a request for an embedded object and waiting to receive the packets.
ns3::TracedCallback< Ptr< const Packet > > m_txTrace
The Tx trace source.
void ConnectionFailedCallback(Ptr< Socket > socket)
Invoked when m_socket cannot establish a connection with the web server.
uint32_t m_embeddedObjectsToBeRequested
Determined after parsing the main object.
a unique identifier for an interface.
void ConnectionSucceededCallback(Ptr< Socket > socket)
Invoked when a connection is established successfully on m_socket.
Ptr< Socket > m_socket
The socket for sending and receiving packets to/from the web server.
virtual void DoDispose()
Destructor implementation.
EventId m_eventParseMainObject
An event of ParseMainObject(), scheduled to trigger after parsing time has elapsed.
After StopApplication() is invoked.
ns3::TracedCallback< const std::string &, const std::string & > m_stateTransitionTrace
The StateTransition trace source.