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

This class implements a testing loopback MAC layer. More...

#include "lte-test-entities.h"

+ Inheritance diagram for ns3::LteTestMac:
+ Collaboration diagram for ns3::LteTestMac:

Public Types

enum  RlcHeaderType_t { UM_RLC_HEADER = 0, AM_RLC_HEADER = 1 }
 RCL Header Type enumeration. More...
 
enum  TxOpportunityMode_t { MANUAL_MODE = 0, AUTOMATIC_MODE = 1, RANDOM_MODE = 2 }
 Transmit opportunity mode enumeration. More...
 

Public Member Functions

 LteTestMac (void)
 
virtual ~LteTestMac (void)
 
virtual void DoDispose (void)
 Destructor implementation. More...
 
std::string GetDataReceived (void)
 Get data received function. More...
 
LteMacSapProviderGetLteMacSapProvider (void)
 Get the MAC SAP provider. More...
 
uint32_t GetRxBytes (void)
 Get the receive bytes. More...
 
uint32_t GetRxPdus (void)
 Get the receive PDUs. More...
 
uint32_t GetTxBytes (void)
 Get the transmit bytes. More...
 
uint32_t GetTxPdus (void)
 Get the transmit PDUs. More...
 
bool Receive (Ptr< NetDevice > nd, Ptr< const Packet > p, uint16_t protocol, const Address &addr)
 the Receive function More...
 
void SendTxOpportunity (Time time, uint32_t bytes)
 Send transmit opportunity function. More...
 
void SetDevice (Ptr< NetDevice > device)
 Set the device function. More...
 
void SetLteMacLoopback (Ptr< LteTestMac > s)
 Set the other side of the MAC Loopback. More...
 
void SetLteMacSapUser (LteMacSapUser *s)
 Set the MAC SAP user. More...
 
void SetPdcpHeaderPresent (bool present)
 Set PDCP header present function. More...
 
void SetRlcHeaderType (uint8_t rlcHeaderType)
 Set RLC header type. More...
 
void SetTxOpportunityMode (uint8_t mode)
 Set transmit opportunity mode. More...
 
void SetTxOppSize (uint32_t txOppSize)
 Set transmit opportunity time. More...
 
void SetTxOppTime (Time txOppTime)
 Set transmit opportunity time. More...
 
- Public Member Functions inherited from ns3::Object
 Object ()
 Constructor. More...
 
virtual ~Object ()
 Destructor. More...
 
void AggregateObject (Ptr< Object > other)
 Aggregate two Objects together. More...
 
void Dispose (void)
 Dispose of this Object. More...
 
AggregateIterator GetAggregateIterator (void) const
 Get an iterator to the Objects aggregated to this one. More...
 
virtual TypeId GetInstanceTypeId (void) const
 Get the most derived TypeId for this Object. More...
 
template<typename T >
Ptr< T > GetObject (void) const
 Get a pointer to the requested aggregated Object. More...
 
template<typename T >
Ptr< T > GetObject (TypeId tid) const
 Get a pointer to the requested aggregated Object by TypeId. More...
 
void Initialize (void)
 Invoke DoInitialize on all Objects aggregated to this one. More...
 
bool IsInitialized (void) const
 Check if the object has been initialized. More...
 
- Public Member Functions inherited from ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter >
 SimpleRefCount ()
 Default constructor. More...
 
 SimpleRefCount (const SimpleRefCount &o)
 Copy constructor. More...
 
uint32_t GetReferenceCount (void) const
 Get the reference count of the object. More...
 
SimpleRefCountoperator= (const SimpleRefCount &o)
 Assignment operator. More...
 
void Ref (void) const
 Increment the reference count. More...
 
void Unref (void) const
 Decrement the reference count. 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::Object
static TypeId GetTypeId (void)
 Register this type. More...
 
- Static Public Member Functions inherited from ns3::ObjectBase
static TypeId GetTypeId (void)
 Get the type ID. More...
 

Private Member Functions

void DoReportBufferStatus (LteMacSapProvider::ReportBufferStatusParameters params)
 Report buffer status function. More...
 
void DoTransmitPdu (LteMacSapProvider::TransmitPduParameters params)
 Transmit PDU. More...
 

Private Attributes

Ptr< NetDevicem_device
 the device More...
 
Ptr< LteTestMacm_macLoopback
 MAC loopback. More...
 
LteMacSapProviderm_macSapProvider
 MAC SAP provider. More...
 
LteMacSapUserm_macSapUser
 MAC SAP user. More...
 
EventId m_nextTxOpp
 next transmit opportunity event More...
 
std::list< EventIdm_nextTxOppList
 next transmit opportunity list More...
 
bool m_pdcpHeaderPresent
 PDCP header present? More...
 
std::string m_receivedData
 the received data string More...
 
uint8_t m_rlcHeaderType
 RLC header type. More...
 
uint32_t m_rxBytes
 the number of receive bytes More...
 
uint32_t m_rxPdus
 the number of receive PDUs More...
 
uint32_t m_txBytes
 the number of transmit bytes More...
 
uint8_t m_txOpportunityMode
 transmit opportunity mode More...
 
uint32_t m_txOppSize
 transmit opportunity size More...
 
Time m_txOppTime
 transmit opportunity time More...
 
uint32_t m_txPdus
 the number of transmit PDUs More...
 

Friends

class EnbMacMemberLteMacSapProvider< LteTestMac >
 allow EnbMacMemberLteMacSapProvider<LteTestMac> class friend access More...
 

Additional Inherited Members

- Protected Member Functions inherited from ns3::Object
 Object (const Object &o)
 Copy an Object. More...
 
virtual void DoInitialize (void)
 Initialize() implementation. More...
 
virtual void NotifyNewAggregate (void)
 Notify all Objects aggregated to this one of a new Object being aggregated. 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...
 

Detailed Description

This class implements a testing loopback MAC layer.

Definition at line 240 of file lte-test-entities.h.

Member Enumeration Documentation

◆ RlcHeaderType_t

RCL Header Type enumeration.

Enumerator
UM_RLC_HEADER 
AM_RLC_HEADER 

Definition at line 318 of file lte-test-entities.h.

◆ TxOpportunityMode_t

Transmit opportunity mode enumeration.

Enumerator
MANUAL_MODE 
AUTOMATIC_MODE 
RANDOM_MODE 

Definition at line 330 of file lte-test-entities.h.

Constructor & Destructor Documentation

◆ LteTestMac()

ns3::LteTestMac::LteTestMac ( void  )

◆ ~LteTestMac()

ns3::LteTestMac::~LteTestMac ( void  )
virtual

Definition at line 394 of file lte-test-entities.cc.

References NS_LOG_FUNCTION.

Member Function Documentation

◆ DoDispose()

void ns3::LteTestMac::DoDispose ( void  )
virtual

Destructor implementation.

This method is called by Dispose() or by the Object's destructor, whichever comes first.

Subclasses are expected to implement their real destruction code in an overridden version of this method and chain up to their parent's implementation once they are done. i.e, for simplicity, the destructor of every subclass should be empty and its content should be moved to the associated DoDispose() method.

It is safe to call GetObject() from within this method.

Reimplemented from ns3::Object.

Definition at line 400 of file lte-test-entities.cc.

References m_device, m_macSapProvider, and NS_LOG_FUNCTION.

◆ DoReportBufferStatus()

◆ DoTransmitPdu()

◆ GetDataReceived()

std::string ns3::LteTestMac::GetDataReceived ( void  )

Get data received function.

Returns
the received data string

Definition at line 437 of file lte-test-entities.cc.

References m_receivedData, and NS_LOG_FUNCTION.

Referenced by LteRlcUmTransmitterTestCase::DoCheckDataReceived(), and LteRlcAmTransmitterTestCase::DoCheckDataReceived().

+ Here is the caller graph for this function:

◆ GetLteMacSapProvider()

LteMacSapProvider * ns3::LteTestMac::GetLteMacSapProvider ( void  )

Get the MAC SAP provider.

Returns
a pointer to the SAP provider of the MAC

Definition at line 425 of file lte-test-entities.cc.

References m_macSapProvider.

Referenced by LteRlcUmTransmitterTestCase::DoRun(), LteRlcAmTransmitterTestCase::DoRun(), ns3::LteSimpleHelper::InstallSingleEnbDevice(), and ns3::LteSimpleHelper::InstallSingleUeDevice().

+ Here is the caller graph for this function:

◆ GetRxBytes()

uint32_t ns3::LteTestMac::GetRxBytes ( void  )

Get the receive bytes.

Returns
the number of bytes received

Definition at line 466 of file lte-test-entities.cc.

References m_rxBytes, and NS_LOG_FUNCTION.

◆ GetRxPdus()

uint32_t ns3::LteTestMac::GetRxPdus ( void  )

Get the receive PDUs.

Returns
the number of receive PDUS

Definition at line 459 of file lte-test-entities.cc.

References m_rxPdus, and NS_LOG_FUNCTION.

Referenced by LteRlcAmE2eTestCase::DoRun().

+ Here is the caller graph for this function:

◆ GetTxBytes()

uint32_t ns3::LteTestMac::GetTxBytes ( void  )

Get the transmit bytes.

Returns
the number of bytes transmitted

Definition at line 452 of file lte-test-entities.cc.

References m_txBytes, and NS_LOG_FUNCTION.

◆ GetTxPdus()

uint32_t ns3::LteTestMac::GetTxPdus ( void  )

Get the transmit PDUs.

Returns
the number of transmit PDUS

Definition at line 445 of file lte-test-entities.cc.

References m_txPdus, and NS_LOG_FUNCTION.

Referenced by LteRlcAmE2eTestCase::DoRun().

+ Here is the caller graph for this function:

◆ GetTypeId()

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

Get the type ID.

Returns
the object TypeId

Definition at line 360 of file lte-test-entities.cc.

References ns3::TypeId::SetParent().

+ Here is the call graph for this function:

◆ Receive()

bool ns3::LteTestMac::Receive ( Ptr< NetDevice nd,
Ptr< const Packet p,
uint16_t  protocol,
const Address addr 
)

the Receive function

Parameters
ndthe device
pthe packet
protocolthe protocol
addrthe address
Returns
true if successful

Definition at line 659 of file lte-test-entities.cc.

References ns3::Packet::Copy(), ns3::Packet::GetSize(), ns3::LteMacSapUser::ReceivePduParameters::lcid, m_macSapUser, m_rxBytes, m_rxPdus, NS_LOG_FUNCTION, ns3::LteMacSapUser::ReceivePduParameters::p, ns3::LteMacSapUser::ReceivePdu(), and ns3::LteMacSapUser::ReceivePduParameters::rnti.

Referenced by ns3::LteSimpleHelper::InstallSingleEnbDevice(), and ns3::LteSimpleHelper::InstallSingleUeDevice().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SendTxOpportunity()

◆ SetDevice()

void ns3::LteTestMac::SetDevice ( Ptr< NetDevice device)

Set the device function.

Parameters
devicethe device

Definition at line 413 of file lte-test-entities.cc.

References m_device.

Referenced by ns3::LteSimpleHelper::InstallSingleEnbDevice(), and ns3::LteSimpleHelper::InstallSingleUeDevice().

+ Here is the caller graph for this function:

◆ SetLteMacLoopback()

void ns3::LteTestMac::SetLteMacLoopback ( Ptr< LteTestMac s)

Set the other side of the MAC Loopback.

Parameters
sa pointer to the other side of the MAC loopback

Definition at line 431 of file lte-test-entities.cc.

References m_macLoopback.

◆ SetLteMacSapUser()

void ns3::LteTestMac::SetLteMacSapUser ( LteMacSapUser s)

Set the MAC SAP user.

Parameters
sa pointer to the MAC SAP user

Definition at line 419 of file lte-test-entities.cc.

References m_macSapUser.

Referenced by LteRlcUmTransmitterTestCase::DoRun(), LteRlcAmTransmitterTestCase::DoRun(), ns3::LteSimpleHelper::InstallSingleEnbDevice(), and ns3::LteSimpleHelper::InstallSingleUeDevice().

+ Here is the caller graph for this function:

◆ SetPdcpHeaderPresent()

void ns3::LteTestMac::SetPdcpHeaderPresent ( bool  present)

Set PDCP header present function.

Parameters
presenttrue iif PDCP header present

Definition at line 514 of file lte-test-entities.cc.

References m_pdcpHeaderPresent, and NS_LOG_FUNCTION.

◆ SetRlcHeaderType()

void ns3::LteTestMac::SetRlcHeaderType ( uint8_t  rlcHeaderType)

Set RLC header type.

Parameters
rlcHeaderTypethe RLC header type

Definition at line 521 of file lte-test-entities.cc.

References m_rlcHeaderType, and NS_LOG_FUNCTION.

Referenced by LteRlcUmTransmitterTestCase::DoRun(), and LteRlcAmTransmitterTestCase::DoRun().

+ Here is the caller graph for this function:

◆ SetTxOpportunityMode()

void ns3::LteTestMac::SetTxOpportunityMode ( uint8_t  mode)

Set transmit opportunity mode.

Parameters
modethe transmit opportunity mode

Definition at line 528 of file lte-test-entities.cc.

References m_txOpportunityMode, m_txOppSize, m_txOppTime, NS_LOG_FUNCTION, RANDOM_MODE, ns3::Seconds(), and SendTxOpportunity().

Referenced by LteRlcUmE2eTestCase::DoRun(), and LteRlcAmE2eTestCase::DoRun().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetTxOppSize()

void ns3::LteTestMac::SetTxOppSize ( uint32_t  txOppSize)

Set transmit opportunity time.

Parameters
txOppSizethe transmit opportunity size

Definition at line 550 of file lte-test-entities.cc.

References m_txOppSize, and NS_LOG_FUNCTION.

Referenced by LteRlcUmE2eTestCase::DoRun(), and LteRlcAmE2eTestCase::DoRun().

+ Here is the caller graph for this function:

◆ SetTxOppTime()

void ns3::LteTestMac::SetTxOppTime ( Time  txOppTime)

Set transmit opportunity time.

Parameters
txOppTimethe transmit opportunity time

Definition at line 543 of file lte-test-entities.cc.

References m_txOppTime, and NS_LOG_FUNCTION.

Referenced by LteRlcUmE2eTestCase::DoRun(), and LteRlcAmE2eTestCase::DoRun().

+ Here is the caller graph for this function:

Friends And Related Function Documentation

◆ EnbMacMemberLteMacSapProvider< LteTestMac >

friend class EnbMacMemberLteMacSapProvider< LteTestMac >
friend

allow EnbMacMemberLteMacSapProvider<LteTestMac> class friend access

Definition at line 244 of file lte-test-entities.h.

Member Data Documentation

◆ m_device

Ptr<NetDevice> ns3::LteTestMac::m_device
private

the device

Definition at line 392 of file lte-test-entities.h.

Referenced by DoDispose(), DoTransmitPdu(), LteTestMac(), SendTxOpportunity(), and SetDevice().

◆ m_macLoopback

Ptr<LteTestMac> ns3::LteTestMac::m_macLoopback
private

MAC loopback.

Definition at line 384 of file lte-test-entities.h.

Referenced by DoTransmitPdu(), LteTestMac(), and SetLteMacLoopback().

◆ m_macSapProvider

LteMacSapProvider* ns3::LteTestMac::m_macSapProvider
private

MAC SAP provider.

Definition at line 382 of file lte-test-entities.h.

Referenced by DoDispose(), GetLteMacSapProvider(), and LteTestMac().

◆ m_macSapUser

LteMacSapUser* ns3::LteTestMac::m_macSapUser
private

◆ m_nextTxOpp

EventId ns3::LteTestMac::m_nextTxOpp
private

next transmit opportunity event

Definition at line 395 of file lte-test-entities.h.

◆ m_nextTxOppList

std::list<EventId> ns3::LteTestMac::m_nextTxOppList
private

next transmit opportunity list

Definition at line 398 of file lte-test-entities.h.

Referenced by DoReportBufferStatus().

◆ m_pdcpHeaderPresent

bool ns3::LteTestMac::m_pdcpHeaderPresent
private

PDCP header present?

Definition at line 389 of file lte-test-entities.h.

Referenced by DoTransmitPdu(), LteTestMac(), and SetPdcpHeaderPresent().

◆ m_receivedData

std::string ns3::LteTestMac::m_receivedData
private

the received data string

Definition at line 386 of file lte-test-entities.h.

Referenced by DoTransmitPdu(), and GetDataReceived().

◆ m_rlcHeaderType

uint8_t ns3::LteTestMac::m_rlcHeaderType
private

RLC header type.

Definition at line 388 of file lte-test-entities.h.

Referenced by DoTransmitPdu(), LteTestMac(), and SetRlcHeaderType().

◆ m_rxBytes

uint32_t ns3::LteTestMac::m_rxBytes
private

the number of receive bytes

Definition at line 404 of file lte-test-entities.h.

Referenced by GetRxBytes(), LteTestMac(), and Receive().

◆ m_rxPdus

uint32_t ns3::LteTestMac::m_rxPdus
private

the number of receive PDUs

Definition at line 403 of file lte-test-entities.h.

Referenced by GetRxPdus(), LteTestMac(), and Receive().

◆ m_txBytes

uint32_t ns3::LteTestMac::m_txBytes
private

the number of transmit bytes

Definition at line 402 of file lte-test-entities.h.

Referenced by DoTransmitPdu(), GetTxBytes(), and LteTestMac().

◆ m_txOpportunityMode

uint8_t ns3::LteTestMac::m_txOpportunityMode
private

transmit opportunity mode

Definition at line 390 of file lte-test-entities.h.

Referenced by DoReportBufferStatus(), LteTestMac(), SendTxOpportunity(), and SetTxOpportunityMode().

◆ m_txOppSize

uint32_t ns3::LteTestMac::m_txOppSize
private

transmit opportunity size

Definition at line 397 of file lte-test-entities.h.

Referenced by DoReportBufferStatus(), LteTestMac(), SendTxOpportunity(), SetTxOpportunityMode(), and SetTxOppSize().

◆ m_txOppTime

Time ns3::LteTestMac::m_txOppTime
private

transmit opportunity time

Definition at line 396 of file lte-test-entities.h.

Referenced by DoReportBufferStatus(), LteTestMac(), SendTxOpportunity(), SetTxOpportunityMode(), and SetTxOppTime().

◆ m_txPdus

uint32_t ns3::LteTestMac::m_txPdus
private

the number of transmit PDUs

Definition at line 401 of file lte-test-entities.h.

Referenced by DoTransmitPdu(), GetTxPdus(), and LteTestMac().


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