A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
ns3::GtpuHeader Class Reference

Implementation of the GTPv1-U Release 10 as per 3Gpp TS 29.281 document. More...

#include <epc-gtpu-header.h>

+ Inheritance diagram for ns3::GtpuHeader:
+ Collaboration diagram for ns3::GtpuHeader:

Public Member Functions

 GtpuHeader ()
 
virtual ~GtpuHeader ()
 
virtual uint32_t Deserialize (Buffer::Iterator start)
 
bool GetExtensionHeaderFlag () const
 
virtual TypeId GetInstanceTypeId (void) const
 
uint16_t GetLength () const
 
uint8_t GetMessageType () const
 
uint8_t GetNextExtensionType () const
 
uint8_t GetNPduNumber () const
 
bool GetNPduNumberFlag () const
 
bool GetProtocolType () const
 
uint16_t GetSequenceNumber () const
 
bool GetSequenceNumberFlag () const
 
virtual uint32_t GetSerializedSize (void) const
 
uint32_t GetTeid () const
 
uint8_t GetVersion () const
 
bool operator== (const GtpuHeader &b) const
 
virtual void Print (std::ostream &os) const
 
virtual void Serialize (Buffer::Iterator start) const
 
void SetExtensionHeaderFlag (bool m_extensionHeaderFlag)
 
void SetLength (uint16_t m_length)
 
void SetMessageType (uint8_t m_messageType)
 
void SetNextExtensionType (uint8_t m_nextExtensionType)
 
void SetNPduNumber (uint8_t m_nPduNumber)
 
void SetNPduNumberFlag (bool m_nPduNumberFlag)
 
void SetProtocolType (bool m_protocolType)
 
void SetSequenceNumber (uint16_t m_sequenceNumber)
 
void SetSequenceNumberFlag (bool m_sequenceNumberFlag)
 
void SetTeid (uint32_t m_teid)
 
void SetVersion (uint8_t m_version)
 
- Public Member Functions inherited from ns3::Header
virtual ~Header ()
 
- Public Member Functions inherited from ns3::ObjectBase
virtual ~ObjectBase ()
 Virtual destructor. More...
 
void GetAttribute (std::string name, AttributeValue &value) const
 
bool GetAttributeFailSafe (std::string name, AttributeValue &attribute) const
 
void SetAttribute (std::string name, const AttributeValue &value)
 
bool SetAttributeFailSafe (std::string name, const AttributeValue &value)
 
bool TraceConnect (std::string name, std::string context, const CallbackBase &cb)
 
bool TraceConnectWithoutContext (std::string name, const CallbackBase &cb)
 
bool TraceDisconnect (std::string name, std::string context, const CallbackBase &cb)
 
bool TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb)
 

Static Public Member Functions

static TypeId GetTypeId (void)
 
- 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

bool m_extensionHeaderFlag
 This flag indicates the presence of a meaningful value of the Next Extension Header field. More...
 
uint16_t m_length
 This field indicates the length in octets of the payload, i.e. More...
 
uint8_t m_messageType
 This field indicates the type of GTP-U message. More...
 
uint8_t m_nextExtensionType
 This field defines the type of Extension Header that follows this field in the GTP-PDU. More...
 
uint8_t m_nPduNumber
 This field is used at the Inter SGSN Routeing Area Update procedure and some inter-system handover procedures (e.g. More...
 
bool m_nPduNumberFlag
 This flag indicates the presence of a meaningful value of the N-PDU Number field. More...
 
bool m_protocolType
 This bit is used as a protocol discriminator between GTP (when PT is '1') and GTP' (when PT is '0'). More...
 
uint16_t m_sequenceNumber
 If Sequence Number field is used for G-PDUs (T-PDUs+headers), an increasing sequence number for T-PDUs is transmitted via GTP-U tunnels, when transmission order must be preserved. More...
 
bool m_sequenceNumberFlag
 This flag indicates the presence of a meaningful value of the Sequence Number field. More...
 
uint32_t m_teid
 This field unambiguously identifies a tunnel endpoint in the receiving GTP-U protocol entity. More...
 
uint8_t m_version
 This field is used to determine the version of the GTPU-U protocol. More...
 

Additional Inherited Members

- Protected Member Functions inherited from ns3::ObjectBase
void ConstructSelf (const AttributeConstructionList &attributes)
 
virtual void NotifyConstructionCompleted (void)
 This method is invoked once all member attributes have been initialized. More...
 

Detailed Description

Implementation of the GTPv1-U Release 10 as per 3Gpp TS 29.281 document.

Doxygen introspection did not find any typical Config paths.


No Attributes are defined for this type.
No TraceSources are defined for this type.

Definition at line 39 of file epc-gtpu-header.h.

Constructor & Destructor Documentation

ns3::GtpuHeader::GtpuHeader ( )

Definition at line 44 of file epc-gtpu-header.cc.

ns3::GtpuHeader::~GtpuHeader ( )
virtual

Definition at line 60 of file epc-gtpu-header.cc.

Member Function Documentation

uint32_t ns3::GtpuHeader::Deserialize ( Buffer::Iterator  start)
virtual
Parameters
startan iterator which points to where the header should written.
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.

Implements ns3::Header.

Definition at line 91 of file epc-gtpu-header.cc.

References GetSerializedSize(), m_extensionHeaderFlag, m_length, m_messageType, m_nextExtensionType, m_nPduNumber, m_nPduNumberFlag, m_protocolType, m_sequenceNumber, m_sequenceNumberFlag, m_teid, m_version, ns3::Buffer::Iterator::ReadNtohU16(), ns3::Buffer::Iterator::ReadNtohU32(), ns3::Buffer::Iterator::ReadU8(), and visualizer.core::start().

+ Here is the call graph for this function:

bool ns3::GtpuHeader::GetExtensionHeaderFlag ( ) const

Definition at line 134 of file epc-gtpu-header.cc.

References m_extensionHeaderFlag.

TypeId ns3::GtpuHeader::GetInstanceTypeId ( void  ) const
virtual
Returns
the TypeId associated to the most-derived type of this instance.

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

Implements ns3::ObjectBase.

Definition at line 65 of file epc-gtpu-header.cc.

References GetTypeId().

+ Here is the call graph for this function:

uint16_t ns3::GtpuHeader::GetLength ( ) const

Definition at line 140 of file epc-gtpu-header.cc.

References m_length.

uint8_t ns3::GtpuHeader::GetMessageType ( ) const

Definition at line 146 of file epc-gtpu-header.cc.

References m_messageType.

uint8_t ns3::GtpuHeader::GetNextExtensionType ( ) const

Definition at line 164 of file epc-gtpu-header.cc.

References m_nextExtensionType.

uint8_t ns3::GtpuHeader::GetNPduNumber ( ) const

Definition at line 152 of file epc-gtpu-header.cc.

References m_nPduNumber.

bool ns3::GtpuHeader::GetNPduNumberFlag ( ) const

Definition at line 158 of file epc-gtpu-header.cc.

References m_nPduNumberFlag.

bool ns3::GtpuHeader::GetProtocolType ( ) const

Definition at line 170 of file epc-gtpu-header.cc.

References m_protocolType.

uint16_t ns3::GtpuHeader::GetSequenceNumber ( void  ) const

Definition at line 176 of file epc-gtpu-header.cc.

References m_sequenceNumber.

bool ns3::GtpuHeader::GetSequenceNumberFlag ( ) const

Definition at line 182 of file epc-gtpu-header.cc.

References m_sequenceNumberFlag.

uint32_t ns3::GtpuHeader::GetSerializedSize ( void  ) 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 71 of file epc-gtpu-header.cc.

Referenced by Deserialize(), ns3::EpcX2::DoSendUeData(), and ns3::EpcSgwPgwApplication::SendToS1uSocket().

+ Here is the caller graph for this function:

uint32_t ns3::GtpuHeader::GetTeid ( ) const

Definition at line 188 of file epc-gtpu-header.cc.

References m_teid.

Referenced by ns3::EpcSgwPgwApplication::RecvFromS1uSocket(), ns3::EpcEnbApplication::RecvFromS1uSocket(), and ns3::EpcX2::RecvFromX2uSocket().

+ Here is the caller graph for this function:

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

Definition at line 36 of file epc-gtpu-header.cc.

References ns3::TypeId::SetParent().

Referenced by GetInstanceTypeId().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

uint8_t ns3::GtpuHeader::GetVersion ( void  ) const

Definition at line 194 of file epc-gtpu-header.cc.

References m_version.

void ns3::GtpuHeader::Print ( std::ostream &  os) const
virtual
Parameters
osoutput stream This method is used by Packet::Print to print the content of a trailer as ascii data to a c++ output stream. Although the trailer 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 109 of file epc-gtpu-header.cc.

References m_extensionHeaderFlag, m_length, m_messageType, m_nextExtensionType, m_nPduNumber, m_nPduNumberFlag, m_protocolType, m_sequenceNumber, m_sequenceNumberFlag, m_teid, and m_version.

void ns3::GtpuHeader::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 76 of file epc-gtpu-header.cc.

References m_extensionHeaderFlag, m_length, m_messageType, m_nextExtensionType, m_nPduNumber, m_nPduNumberFlag, m_protocolType, m_sequenceNumber, m_sequenceNumberFlag, m_teid, m_version, visualizer.core::start(), ns3::Buffer::Iterator::WriteHtonU16(), ns3::Buffer::Iterator::WriteHtonU32(), and ns3::Buffer::Iterator::WriteU8().

+ Here is the call graph for this function:

void ns3::GtpuHeader::SetExtensionHeaderFlag ( bool  m_extensionHeaderFlag)

Definition at line 200 of file epc-gtpu-header.cc.

References m_extensionHeaderFlag.

Referenced by EpsGtpuHeaderTestCase::DoRun().

+ Here is the caller graph for this function:

void ns3::GtpuHeader::SetLength ( uint16_t  m_length)

Definition at line 206 of file epc-gtpu-header.cc.

References m_length.

Referenced by EpsGtpuHeaderTestCase::DoRun(), ns3::EpcX2::DoSendUeData(), and ns3::EpcSgwPgwApplication::SendToS1uSocket().

+ Here is the caller graph for this function:

void ns3::GtpuHeader::SetMessageType ( uint8_t  m_messageType)

Definition at line 212 of file epc-gtpu-header.cc.

References m_messageType.

Referenced by EpsGtpuHeaderTestCase::DoRun().

+ Here is the caller graph for this function:

void ns3::GtpuHeader::SetNextExtensionType ( uint8_t  m_nextExtensionType)

Definition at line 230 of file epc-gtpu-header.cc.

References m_nextExtensionType.

Referenced by EpsGtpuHeaderTestCase::DoRun().

+ Here is the caller graph for this function:

void ns3::GtpuHeader::SetNPduNumber ( uint8_t  m_nPduNumber)

Definition at line 218 of file epc-gtpu-header.cc.

References m_nPduNumber.

Referenced by EpsGtpuHeaderTestCase::DoRun().

+ Here is the caller graph for this function:

void ns3::GtpuHeader::SetNPduNumberFlag ( bool  m_nPduNumberFlag)

Definition at line 224 of file epc-gtpu-header.cc.

References m_nPduNumberFlag.

Referenced by EpsGtpuHeaderTestCase::DoRun().

+ Here is the caller graph for this function:

void ns3::GtpuHeader::SetProtocolType ( bool  m_protocolType)

Definition at line 236 of file epc-gtpu-header.cc.

References m_protocolType.

Referenced by EpsGtpuHeaderTestCase::DoRun().

+ Here is the caller graph for this function:

void ns3::GtpuHeader::SetSequenceNumber ( uint16_t  m_sequenceNumber)

Definition at line 242 of file epc-gtpu-header.cc.

References m_sequenceNumber.

Referenced by EpsGtpuHeaderTestCase::DoRun().

+ Here is the caller graph for this function:

void ns3::GtpuHeader::SetSequenceNumberFlag ( bool  m_sequenceNumberFlag)

Definition at line 248 of file epc-gtpu-header.cc.

References m_sequenceNumberFlag.

Referenced by EpsGtpuHeaderTestCase::DoRun().

+ Here is the caller graph for this function:

void ns3::GtpuHeader::SetTeid ( uint32_t  m_teid)

Definition at line 254 of file epc-gtpu-header.cc.

References m_teid.

Referenced by EpsGtpuHeaderTestCase::DoRun(), ns3::EpcX2::DoSendUeData(), ns3::EpcSgwPgwApplication::SendToS1uSocket(), and ns3::EpcEnbApplication::SendToS1uSocket().

+ Here is the caller graph for this function:

void ns3::GtpuHeader::SetVersion ( uint8_t  m_version)

Definition at line 260 of file epc-gtpu-header.cc.

Referenced by EpsGtpuHeaderTestCase::DoRun().

+ Here is the caller graph for this function:

Member Data Documentation

bool ns3::GtpuHeader::m_extensionHeaderFlag
private

This flag indicates the presence of a meaningful value of the Next Extension Header field.

When it is set to '0', the Next Extension Header field either is not present or, if present, shall not be interpreted. When it is set to '1', the Next Extension Header field is present, and shall be interpreted

Definition at line 95 of file epc-gtpu-header.h.

Referenced by Deserialize(), GetExtensionHeaderFlag(), operator==(), Print(), Serialize(), and SetExtensionHeaderFlag().

uint16_t ns3::GtpuHeader::m_length
private

This field indicates the length in octets of the payload, i.e.

the rest of the packet following the mandatory part of the GTP header (that is the first 8 octets). The Sequence Number, the N-PDU Number or any Extension headers shall be considered to be part of the payload, i.e. included in the length count

Definition at line 121 of file epc-gtpu-header.h.

Referenced by Deserialize(), GetLength(), operator==(), Print(), Serialize(), and SetLength().

uint8_t ns3::GtpuHeader::m_messageType
private

This field indicates the type of GTP-U message.

Definition at line 114 of file epc-gtpu-header.h.

Referenced by Deserialize(), GetMessageType(), operator==(), Print(), Serialize(), and SetMessageType().

uint8_t ns3::GtpuHeader::m_nextExtensionType
private

This field defines the type of Extension Header that follows this field in the GTP-PDU.

Definition at line 146 of file epc-gtpu-header.h.

Referenced by Deserialize(), GetNextExtensionType(), operator==(), Print(), Serialize(), and SetNextExtensionType().

uint8_t ns3::GtpuHeader::m_nPduNumber
private

This field is used at the Inter SGSN Routeing Area Update procedure and some inter-system handover procedures (e.g.

between 2G and 3G radio access networks). This field is used to co-ordinate the data transmission for acknowledged mode of communication between the MS and the SGSN

Definition at line 141 of file epc-gtpu-header.h.

Referenced by Deserialize(), GetNPduNumber(), operator==(), Print(), Serialize(), and SetNPduNumber().

bool ns3::GtpuHeader::m_nPduNumberFlag
private

This flag indicates the presence of a meaningful value of the N-PDU Number field.

When it is set to '0', the N-PDU Number field either is not present, or, if present, shall not be interpreted. When it is set to '1', the N-PDU Number field is present, and shall be interpreted

Definition at line 110 of file epc-gtpu-header.h.

Referenced by Deserialize(), GetNPduNumberFlag(), operator==(), Print(), Serialize(), and SetNPduNumberFlag().

bool ns3::GtpuHeader::m_protocolType
private

This bit is used as a protocol discriminator between GTP (when PT is '1') and GTP' (when PT is '0').

Definition at line 87 of file epc-gtpu-header.h.

Referenced by Deserialize(), GetProtocolType(), operator==(), Print(), Serialize(), and SetProtocolType().

uint16_t ns3::GtpuHeader::m_sequenceNumber
private

If Sequence Number field is used for G-PDUs (T-PDUs+headers), an increasing sequence number for T-PDUs is transmitted via GTP-U tunnels, when transmission order must be preserved.

Definition at line 134 of file epc-gtpu-header.h.

Referenced by Deserialize(), GetSequenceNumber(), operator==(), Print(), Serialize(), and SetSequenceNumber().

bool ns3::GtpuHeader::m_sequenceNumberFlag
private

This flag indicates the presence of a meaningful value of the Sequence Number field.

When it is set to '0', the Sequence Number field either is not present or, if present, shall not be interpreted. When it is set to '1', the Sequence Number field is present, and shall be interpreted

Definition at line 103 of file epc-gtpu-header.h.

Referenced by Deserialize(), GetSequenceNumberFlag(), operator==(), Print(), Serialize(), and SetSequenceNumberFlag().

uint32_t ns3::GtpuHeader::m_teid
private

This field unambiguously identifies a tunnel endpoint in the receiving GTP-U protocol entity.

The receiving end side of a GTP tunnel locally assigns the TEID value the transmitting side has to use.

Definition at line 128 of file epc-gtpu-header.h.

Referenced by Deserialize(), GetTeid(), operator==(), Print(), Serialize(), and SetTeid().

uint8_t ns3::GtpuHeader::m_version
private

This field is used to determine the version of the GTPU-U protocol.

The version number shall be set to 1.

Definition at line 81 of file epc-gtpu-header.h.

Referenced by Deserialize(), GetVersion(), operator==(), Print(), and Serialize().


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