A Discrete-Event Network Simulator
API
ns3::GtpcHeader Class Reference

Header of the GTPv2-C protocol. More...

#include "epc-gtpc-header.h"

+ Inheritance diagram for ns3::GtpcHeader:
+ Collaboration diagram for ns3::GtpcHeader:

Classes

struct  Fteid_t
 FTEID structure. More...
 

Public Types

enum  InterfaceType_t {
  S1U_ENB_GTPU = 0, S5_SGW_GTPU = 4, S5_PGW_GTPU = 5, S5_SGW_GTPC = 6,
  S5_PGW_GTPC = 7, S11_MME_GTPC = 10
}
 Interface Type enumeration. More...
 
enum  MessageType_t {
  Reserved = 0, CreateSessionRequest = 32, CreateSessionResponse = 33, ModifyBearerRequest = 34,
  ModifyBearerResponse = 35, DeleteSessionRequest = 36, DeleteSessionResponse = 37, DeleteBearerCommand = 66,
  DeleteBearerRequest = 99, DeleteBearerResponse = 100
}
 Message Type enumeration. More...
 

Public Member Functions

 GtpcHeader ()
 
virtual ~GtpcHeader ()
 
void ComputeMessageLength (void)
 
virtual uint32_t Deserialize (Buffer::Iterator start)
 
virtual TypeId GetInstanceTypeId (void) const
 Get the most derived TypeId for this Object. More...
 
uint16_t GetMessageLength () const
 Get message length. More...
 
virtual uint32_t GetMessageSize (void) const
 
uint8_t GetMessageType () const
 Get message type. More...
 
uint32_t GetSequenceNumber () const
 Get sequence number. More...
 
virtual uint32_t GetSerializedSize (void) const
 
uint32_t GetTeid () const
 Get TEID. More...
 
virtual void Print (std::ostream &os) const
 
virtual void Serialize (Buffer::Iterator start) const
 
void SetIesLength (uint16_t iesLength)
 Set IEs length. More...
 
void SetMessageLength (uint16_t messageLength)
 Set message length. More...
 
void SetMessageType (uint8_t messageType)
 Set message type. More...
 
void SetSequenceNumber (uint32_t sequenceNumber)
 Set sequence number. More...
 
void SetTeid (uint32_t teid)
 Set TEID. More...
 
- 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 (void)
 Get the type ID. 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...
 

Protected Member Functions

uint32_t PreDeserialize (Buffer::Iterator &i)
 Deserialize the GTP-C header in the GTP-C messages. More...
 
void PreSerialize (Buffer::Iterator &i) const
 Serialize the GTP-C header in the GTP-C messages. More...
 
- 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...
 

Private Attributes

uint16_t m_messageLength
 Message length field. More...
 
uint8_t m_messageType
 Message type field. More...
 
uint32_t m_sequenceNumber
 GTP Sequence number field. More...
 
uint32_t m_teid
 Tunnel Endpoint Identifier (TEID) field. More...
 
bool m_teidFlag
 TEID flag. More...
 

Additional Inherited Members

Detailed Description

Header of the GTPv2-C protocol.


Introspection did not find any typical Config paths.

Implementation of the GPRS Tunnelling Protocol for Control Plane (GTPv2-C) header according to the 3GPP TS 29.274 document


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

Definition at line 38 of file epc-gtpc-header.h.

Member Enumeration Documentation

◆ InterfaceType_t

Interface Type enumeration.

Enumerator
S1U_ENB_GTPU 
S5_SGW_GTPU 
S5_PGW_GTPU 
S5_SGW_GTPC 
S5_PGW_GTPC 
S11_MME_GTPC 

Definition at line 106 of file epc-gtpc-header.h.

◆ MessageType_t

Message Type enumeration.

Enumerator
Reserved 
CreateSessionRequest 
CreateSessionResponse 
ModifyBearerRequest 
ModifyBearerResponse 
DeleteSessionRequest 
DeleteSessionResponse 
DeleteBearerCommand 
DeleteBearerRequest 
DeleteBearerResponse 

Definition at line 125 of file epc-gtpc-header.h.

Constructor & Destructor Documentation

◆ GtpcHeader()

ns3::GtpcHeader::GtpcHeader ( )

Definition at line 43 of file epc-gtpc-header.cc.

◆ ~GtpcHeader()

ns3::GtpcHeader::~GtpcHeader ( )
virtual

Definition at line 52 of file epc-gtpc-header.cc.

Member Function Documentation

◆ ComputeMessageLength()

◆ Deserialize()

uint32_t ns3::GtpcHeader::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.

Reimplemented in ns3::GtpcDeleteBearerResponseMessage, ns3::GtpcDeleteBearerRequestMessage, ns3::GtpcDeleteBearerCommandMessage, ns3::GtpcModifyBearerResponseMessage, ns3::GtpcModifyBearerRequestMessage, ns3::GtpcCreateSessionResponseMessage, and ns3::GtpcCreateSessionRequestMessage.

Definition at line 88 of file epc-gtpc-header.cc.

References PreDeserialize(), and visualizer.core::start().

+ Here is the call graph for this function:

◆ GetInstanceTypeId()

TypeId ns3::GtpcHeader::GetInstanceTypeId ( void  ) 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.

Reimplemented in ns3::GtpcDeleteBearerResponseMessage, ns3::GtpcDeleteBearerRequestMessage, ns3::GtpcDeleteBearerCommandMessage, ns3::GtpcModifyBearerResponseMessage, ns3::GtpcModifyBearerRequestMessage, ns3::GtpcCreateSessionResponseMessage, and ns3::GtpcCreateSessionRequestMessage.

Definition at line 57 of file epc-gtpc-header.cc.

References GetTypeId().

+ Here is the call graph for this function:

◆ GetMessageLength()

uint16_t ns3::GtpcHeader::GetMessageLength ( ) const

Get message length.

Returns
the message length

Definition at line 143 of file epc-gtpc-header.cc.

References m_messageLength.

◆ GetMessageSize()

◆ GetMessageType()

uint8_t ns3::GtpcHeader::GetMessageType ( ) const

Get message type.

Returns
the message type

Definition at line 137 of file epc-gtpc-header.cc.

References m_messageType.

Referenced by ns3::EpcSgwApplication::RecvFromS11Socket(), ns3::EpcMmeApplication::RecvFromS11Socket(), ns3::EpcPgwApplication::RecvFromS5cSocket(), and ns3::EpcSgwApplication::RecvFromS5cSocket().

+ Here is the caller graph for this function:

◆ GetSequenceNumber()

uint32_t ns3::GtpcHeader::GetSequenceNumber ( void  ) const

Get sequence number.

Returns
the sequence number

Definition at line 155 of file epc-gtpc-header.cc.

References m_sequenceNumber.

◆ GetSerializedSize()

◆ GetTeid()

◆ GetTypeId()

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

Get the type ID.

Returns
the object TypeId

Definition at line 34 of file epc-gtpc-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:

◆ PreDeserialize()

◆ PreSerialize()

◆ Print()

void ns3::GtpcHeader::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.

Reimplemented in ns3::GtpcDeleteBearerResponseMessage, ns3::GtpcDeleteBearerRequestMessage, ns3::GtpcDeleteBearerCommandMessage, ns3::GtpcModifyBearerResponseMessage, ns3::GtpcModifyBearerRequestMessage, ns3::GtpcCreateSessionResponseMessage, and ns3::GtpcCreateSessionRequestMessage.

Definition at line 124 of file epc-gtpc-header.cc.

References m_messageLength, m_messageType, m_sequenceNumber, and m_teid.

◆ Serialize()

void ns3::GtpcHeader::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.

Reimplemented in ns3::GtpcDeleteBearerResponseMessage, ns3::GtpcDeleteBearerRequestMessage, ns3::GtpcDeleteBearerCommandMessage, ns3::GtpcModifyBearerResponseMessage, ns3::GtpcModifyBearerRequestMessage, ns3::GtpcCreateSessionResponseMessage, and ns3::GtpcCreateSessionRequestMessage.

Definition at line 69 of file epc-gtpc-header.cc.

References NS_FATAL_ERROR.

◆ SetIesLength()

void ns3::GtpcHeader::SetIesLength ( uint16_t  iesLength)

Set IEs length.

It is used to compute the message length

Parameters
iesLengththe IEs length

Definition at line 187 of file epc-gtpc-header.cc.

References m_messageLength, and m_teidFlag.

Referenced by ComputeMessageLength().

+ Here is the caller graph for this function:

◆ SetMessageLength()

void ns3::GtpcHeader::SetMessageLength ( uint16_t  messageLength)

Set message length.

Parameters
messageLengththe message length

Definition at line 167 of file epc-gtpc-header.cc.

References m_messageLength.

◆ SetMessageType()

◆ SetSequenceNumber()

◆ SetTeid()

Member Data Documentation

◆ m_messageLength

uint16_t ns3::GtpcHeader::m_messageLength
private

Message length field.

This field indicates the length of the message in octets excluding the mandatory part of the GTP-C header (the first 4 octets)

Definition at line 156 of file epc-gtpc-header.h.

Referenced by GetMessageLength(), PreDeserialize(), PreSerialize(), Print(), SetIesLength(), SetMessageLength(), and SetTeid().

◆ m_messageType

uint8_t ns3::GtpcHeader::m_messageType
private

Message type field.

It can be one of the values of MessageType_t

Definition at line 150 of file epc-gtpc-header.h.

Referenced by GetMessageType(), PreDeserialize(), PreSerialize(), Print(), and SetMessageType().

◆ m_sequenceNumber

uint32_t ns3::GtpcHeader::m_sequenceNumber
private

GTP Sequence number field.

Definition at line 164 of file epc-gtpc-header.h.

Referenced by GetSequenceNumber(), PreDeserialize(), PreSerialize(), Print(), and SetSequenceNumber().

◆ m_teid

uint32_t ns3::GtpcHeader::m_teid
private

Tunnel Endpoint Identifier (TEID) field.

Definition at line 160 of file epc-gtpc-header.h.

Referenced by GetTeid(), PreDeserialize(), PreSerialize(), Print(), and SetTeid().

◆ m_teidFlag

bool ns3::GtpcHeader::m_teidFlag
private

TEID flag.

This flag indicates if TEID field is present or not

Definition at line 145 of file epc-gtpc-header.h.

Referenced by GetSerializedSize(), PreDeserialize(), SetIesLength(), and SetTeid().


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