A Discrete-Event Network Simulator
API
Public Types | Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
ns3::ThreeGppHttpHeader Class Reference

Header used by web browsing applications to transmit information about content type, content length and timestamps for delay statistics. More...

#include "three-gpp-http-header.h"

+ Inheritance diagram for ns3::ThreeGppHttpHeader:

Public Types

enum  ContentType_t { NOT_SET, MAIN_OBJECT, EMBEDDED_OBJECT }
 The possible types of content (default = NOT_SET). More...
 

Public Member Functions

 ThreeGppHttpHeader ()
 Creates an empty instance . More...
 
virtual uint32_t Deserialize (Buffer::Iterator start)
 
Time GetClientTs () const
 
uint32_t GetContentLength () const
 
ContentType_t GetContentType () const
 
virtual TypeId GetInstanceTypeId () const
 Get the most derived TypeId for this Object. More...
 
virtual uint32_t GetSerializedSize () const
 
Time GetServerTs () const
 
virtual void Print (std::ostream &os) const
 
virtual void Serialize (Buffer::Iterator start) const
 
void SetClientTs (Time clientTs)
 
void SetContentLength (uint32_t contentLength)
 
void SetContentType (ContentType_t contentType)
 
void SetServerTs (Time serverTs)
 
std::string ToString () const
 
- Public Member Functions inherited from ns3::Header
virtual ~Header ()
 
virtual uint32_t Deserialize (Buffer::Iterator start, Buffer::Iterator end)
 Deserialize the object from a buffer iterator. More...
 
virtual uint32_t Deserialize (Buffer::Iterator start)=0
 Deserialize the object from a buffer iterator. More...
 
- Public Member Functions inherited from ns3::Chunk
virtual uint32_t Deserialize (Buffer::Iterator start, Buffer::Iterator end)
 Deserialize the object from a buffer iterator. More...
 
- Public Member Functions inherited from ns3::ObjectBase
virtual ~ObjectBase ()
 Virtual destructor. More...
 
void GetAttribute (std::string name, AttributeValue &value) const
 Get the value of an attribute, raising fatal errors if unsuccessful. More...
 
bool GetAttributeFailSafe (std::string name, AttributeValue &value) const
 Get the value of an attribute without raising erros. More...
 
void SetAttribute (std::string name, const AttributeValue &value)
 Set a single attribute, raising fatal errors if unsuccessful. More...
 
bool SetAttributeFailSafe (std::string name, const AttributeValue &value)
 Set a single attribute without raising errors. More...
 
bool TraceConnect (std::string name, std::string context, const CallbackBase &cb)
 Connect a TraceSource to a Callback with a context. More...
 
bool TraceConnectWithoutContext (std::string name, const CallbackBase &cb)
 Connect a TraceSource to a Callback without a context. More...
 
bool TraceDisconnect (std::string name, std::string context, const CallbackBase &cb)
 Disconnect from a TraceSource a Callback previously connected with a context. More...
 
bool TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb)
 Disconnect from a TraceSource a Callback previously connected without a context. More...
 

Static Public Member Functions

static TypeId GetTypeId ()
 Returns the object TypeId. More...
 
- Static Public Member Functions inherited from ns3::Header
static TypeId GetTypeId (void)
 Get the type ID. More...
 
- Static Public Member Functions inherited from ns3::Chunk
static TypeId GetTypeId (void)
 Get the type ID. More...
 
- Static Public Member Functions inherited from ns3::ObjectBase
static TypeId GetTypeId (void)
 Get the type ID. More...
 

Private Attributes

uint64_t m_clientTs
 " Client time stamp field (in time step unit). More...
 
uint32_t m_contentLength
 " Content length field (in bytes unit). More...
 
uint16_t m_contentType
 " Content type field in integer format. More...
 
uint64_t m_serverTs
 " Server time stamp field (in time step unit). More...
 

Additional Inherited Members

- Protected Member Functions inherited from ns3::ObjectBase
void ConstructSelf (const AttributeConstructionList &attributes)
 Complete construction of ObjectBase; invoked by derived classes. More...
 
virtual void NotifyConstructionCompleted (void)
 Notifier called once the ObjectBase is fully constructed. More...
 

Detailed Description

Header used by web browsing applications to transmit information about content type, content length and timestamps for delay statistics.


Introspection did not find any typical Config paths.

The header contains the following fields (and their respective size when serialized):

The header is attached to every packet transmitted by ThreeGppHttpClient and ThreeGppHttpServer applications. In received, split packets, only the first packet of transmitted object contains the header, which helps to identify how many bytes are left to be received.

The last 2 fields allow the applications to compute the propagation delay of each packet. The client TS field indicates the time when the request packet is sent by the ThreeGppHttpClient, while the server TS field indicates the time when the response packet is sent by the ThreeGppHttpServer.


No Attributes are defined for this type.
No TraceSources are defined for this type.
Size of this type is 32 bytes (on a 64-bit architecture).

Definition at line 55 of file three-gpp-http-header.h.

Member Enumeration Documentation

◆ ContentType_t

The possible types of content (default = NOT_SET).

Enumerator
NOT_SET 

Integer equivalent = 0.

MAIN_OBJECT 

Integer equivalent = 1.

EMBEDDED_OBJECT 

Integer equivalent = 2.

Definition at line 82 of file three-gpp-http-header.h.

Constructor & Destructor Documentation

◆ ThreeGppHttpHeader()

ns3::ThreeGppHttpHeader::ThreeGppHttpHeader ( )

Creates an empty instance .

Definition at line 33 of file three-gpp-http-header.cc.

References NS_LOG_FUNCTION.

Member Function Documentation

◆ Deserialize()

uint32_t ns3::ThreeGppHttpHeader::Deserialize ( Buffer::Iterator  start)
virtual
Parameters
startan iterator which points to where the header should read from.
Returns
the number of bytes read.

This method is used by Packet::RemoveHeader to re-create a header from the byte buffer of a packet. The data read is expected to match bit-for-bit the representation of this header in real networks.

Note that data is not actually removed from the buffer to which the iterator points. Both Packet::RemoveHeader() and Packet::PeekHeader() call Deserialize(), but only the RemoveHeader() has additional statements to remove the header bytes from the underlying buffer and associated metadata.

Implements ns3::Header.

Definition at line 82 of file three-gpp-http-header.cc.

References m_clientTs, m_contentLength, m_contentType, m_serverTs, NS_LOG_FUNCTION, and visualizer.core::start().

◆ GetClientTs()

Time ns3::ThreeGppHttpHeader::GetClientTs ( ) const

◆ GetContentLength()

uint32_t ns3::ThreeGppHttpHeader::GetContentLength ( ) const

◆ GetContentType()

ThreeGppHttpHeader::ContentType_t ns3::ThreeGppHttpHeader::GetContentType ( ) const

◆ GetInstanceTypeId()

TypeId ns3::ThreeGppHttpHeader::GetInstanceTypeId ( ) const
virtual

Get the most derived TypeId for this Object.

This method is typically implemented by ns3::Object::GetInstanceTypeId but some classes which derive from ns3::ObjectBase directly have to implement it themselves.

Returns
The TypeId associated to the most-derived type of this instance.

Implements ns3::ObjectBase.

Definition at line 57 of file three-gpp-http-header.cc.

References GetTypeId().

◆ GetSerializedSize()

uint32_t ns3::ThreeGppHttpHeader::GetSerializedSize ( ) const
virtual
Returns
the expected size of the header.

This method is used by Packet::AddHeader to store a header into the byte buffer of a packet. This method should return the number of bytes which are needed to store the full header data by Serialize.

Implements ns3::Header.

Definition at line 64 of file three-gpp-http-header.cc.

Referenced by ns3::ThreeGppHttpServer::ServeFromTxBuffer().

◆ GetServerTs()

Time ns3::ThreeGppHttpHeader::GetServerTs ( ) const

◆ GetTypeId()

TypeId ns3::ThreeGppHttpHeader::GetTypeId ( void  )
static

Returns the object TypeId.

Returns
The object TypeId.

Definition at line 46 of file three-gpp-http-header.cc.

References ns3::TypeId::SetParent().

Referenced by GetInstanceTypeId().

◆ Print()

void ns3::ThreeGppHttpHeader::Print ( std::ostream &  os) const
virtual
Parameters
osoutput stream This method is used by Packet::Print to print the content of a header as ascii data to a c++ output stream. Although the header is free to format its output as it wishes, it is recommended to follow a few rules to integrate with the packet pretty printer: start with flags, small field values located between a pair of parens. Values should be separated by whitespace. Follow the parens with the important fields, separated by whitespace. i.e.: (field1 val1 field2 val2 field3 val3) field4 val4 field5 val5

Implements ns3::Header.

Definition at line 108 of file three-gpp-http-header.cc.

References ns3::Time::GetSeconds(), m_clientTs, m_contentLength, m_contentType, m_serverTs, NS_LOG_FUNCTION, and ns3::TimeStep().

Referenced by ToString().

◆ Serialize()

void ns3::ThreeGppHttpHeader::Serialize ( Buffer::Iterator  start) const
virtual
Parameters
startan iterator which points to where the header should be written.

This method is used by Packet::AddHeader to store a header into the byte buffer of a packet. The data written is expected to match bit-for-bit the representation of this header in a real network.

Implements ns3::Header.

Definition at line 71 of file three-gpp-http-header.cc.

References m_clientTs, m_contentLength, m_contentType, m_serverTs, NS_LOG_FUNCTION, and visualizer.core::start().

◆ SetClientTs()

void ns3::ThreeGppHttpHeader::SetClientTs ( Time  clientTs)

◆ SetContentLength()

void ns3::ThreeGppHttpHeader::SetContentLength ( uint32_t  contentLength)
Parameters
contentLengthThe content length (in bytes).

Definition at line 174 of file three-gpp-http-header.cc.

References m_contentLength, and NS_LOG_FUNCTION.

Referenced by ns3::ThreeGppHttpClient::RequestEmbeddedObject(), ns3::ThreeGppHttpClient::RequestMainObject(), and ns3::ThreeGppHttpServer::ServeFromTxBuffer().

◆ SetContentType()

void ns3::ThreeGppHttpHeader::SetContentType ( ThreeGppHttpHeader::ContentType_t  contentType)

◆ SetServerTs()

void ns3::ThreeGppHttpHeader::SetServerTs ( Time  serverTs)
Parameters
serverTsThe server time stamp.

Definition at line 204 of file three-gpp-http-header.cc.

References ns3::Time::GetSeconds(), ns3::Time::GetTimeStep(), m_serverTs, and NS_LOG_FUNCTION.

Referenced by ns3::ThreeGppHttpServer::ServeFromTxBuffer().

◆ ToString()

std::string ns3::ThreeGppHttpHeader::ToString ( ) const
Returns
The string representation of the header.

Definition at line 119 of file three-gpp-http-header.cc.

References NS_LOG_FUNCTION, and Print().

Member Data Documentation

◆ m_clientTs

uint64_t ns3::ThreeGppHttpHeader::m_clientTs
private

" Client time stamp field (in time step unit).

Definition at line 132 of file three-gpp-http-header.h.

Referenced by Deserialize(), GetClientTs(), Print(), Serialize(), and SetClientTs().

◆ m_contentLength

uint32_t ns3::ThreeGppHttpHeader::m_contentLength
private

" Content length field (in bytes unit).

Definition at line 131 of file three-gpp-http-header.h.

Referenced by Deserialize(), GetContentLength(), Print(), Serialize(), and SetContentLength().

◆ m_contentType

uint16_t ns3::ThreeGppHttpHeader::m_contentType
private

" Content type field in integer format.

Definition at line 130 of file three-gpp-http-header.h.

Referenced by Deserialize(), GetContentType(), Print(), Serialize(), and SetContentType().

◆ m_serverTs

uint64_t ns3::ThreeGppHttpHeader::m_serverTs
private

" Server time stamp field (in time step unit).

Definition at line 133 of file three-gpp-http-header.h.

Referenced by Deserialize(), GetServerTs(), Print(), Serialize(), and SetServerTs().


The documentation for this class was generated from the following files: