This class implements a testing loopback MAC layer. More...
#include "lte-test-entities.h"
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 () | |
~LteTestMac () override | |
void | DoDispose () override |
Destructor implementation. More... | |
std::string | GetDataReceived () |
Get data received function. More... | |
LteMacSapProvider * | GetLteMacSapProvider () |
Get the MAC SAP provider. More... | |
uint32_t | GetRxBytes () |
Get the receive bytes. More... | |
uint32_t | GetRxPdus () |
Get the receive PDUs. More... | |
uint32_t | GetTxBytes () |
Get the transmit bytes. More... | |
uint32_t | GetTxPdus () |
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... | |
~Object () override | |
Destructor. More... | |
void | AggregateObject (Ptr< Object > other) |
Aggregate two Objects together. More... | |
void | Dispose () |
Dispose of this Object. More... | |
AggregateIterator | GetAggregateIterator () const |
Get an iterator to the Objects aggregated to this one. More... | |
TypeId | GetInstanceTypeId () const override |
Get the most derived TypeId for this Object. More... | |
template<typename T > | |
Ptr< T > | GetObject () const |
Get a pointer to the requested aggregated Object. More... | |
template<> | |
Ptr< Object > | GetObject () const |
Specialization of () for objects of type ns3::Object. More... | |
template<typename T > | |
Ptr< T > | GetObject (TypeId tid) const |
Get a pointer to the requested aggregated Object by TypeId. More... | |
template<> | |
Ptr< Object > | GetObject (TypeId tid) const |
Specialization of (TypeId tid) for objects of type ns3::Object. More... | |
void | Initialize () |
Invoke DoInitialize on all Objects aggregated to this one. More... | |
bool | IsInitialized () 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[[maybe_unused]]) | |
Copy constructor. More... | |
uint32_t | GetReferenceCount () const |
Get the reference count of the object. More... | |
SimpleRefCount & | operator= (const SimpleRefCount &o[[maybe_unused]]) |
Assignment operator. More... | |
void | Ref () const |
Increment the reference count. More... | |
void | Unref () 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 errors. 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 () |
Get the type ID. More... | |
Static Public Member Functions inherited from ns3::Object | |
static TypeId | GetTypeId () |
Register this type. More... | |
Static Public Member Functions inherited from ns3::ObjectBase | |
static TypeId | GetTypeId () |
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< NetDevice > | m_device |
the device More... | |
Ptr< LteTestMac > | m_macLoopback |
MAC loopback. More... | |
LteMacSapProvider * | m_macSapProvider |
MAC SAP provider. More... | |
LteMacSapUser * | m_macSapUser |
MAC SAP user. More... | |
EventId | m_nextTxOpp |
next transmit opportunity event More... | |
std::list< EventId > | m_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 () |
Initialize() implementation. More... | |
virtual void | NotifyNewAggregate () |
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 () |
Notifier called once the ObjectBase is fully constructed. More... | |
Related Functions inherited from ns3::ObjectBase | |
static TypeId | GetObjectIid () |
Ensure the TypeId for ObjectBase gets fully configured to anchor the inheritance tree properly. More... | |
This class implements a testing loopback MAC layer.
Definition at line 233 of file lte-test-entities.h.
RCL Header Type enumeration.
Enumerator | |
---|---|
UM_RLC_HEADER | |
AM_RLC_HEADER |
Definition at line 311 of file lte-test-entities.h.
Transmit opportunity mode enumeration.
Enumerator | |
---|---|
MANUAL_MODE | |
AUTOMATIC_MODE | |
RANDOM_MODE |
Definition at line 324 of file lte-test-entities.h.
ns3::LteTestMac::LteTestMac | ( | ) |
Definition at line 360 of file lte-test-entities.cc.
References EnbMacMemberLteMacSapProvider< LteTestMac >, m_device, m_macLoopback, m_macSapProvider, m_macSapUser, m_pdcpHeaderPresent, m_rlcHeaderType, m_rxBytes, m_rxPdus, m_txBytes, m_txOpportunityMode, m_txOppSize, m_txOppTime, m_txPdus, MANUAL_MODE, NS_LOG_FUNCTION, ns3::Seconds(), and UM_RLC_HEADER.
|
override |
Definition at line 384 of file lte-test-entities.cc.
References NS_LOG_FUNCTION.
|
overridevirtual |
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 390 of file lte-test-entities.cc.
References m_device, m_macSapProvider, and NS_LOG_FUNCTION.
|
private |
Report buffer status function.
params | LteMacSapProvider::ReportBufferStatusParameters |
Definition at line 619 of file lte-test-entities.cc.
References AUTOMATIC_MODE, ns3::LteMacSapUser::TxOpportunityParameters::bytes, ns3::LteMacSapUser::TxOpportunityParameters::componentCarrierId, ns3::LteMacSapUser::TxOpportunityParameters::harqId, ns3::LteMacSapUser::TxOpportunityParameters::layer, ns3::LteMacSapUser::TxOpportunityParameters::lcid, m_macSapUser, m_nextTxOppList, m_txOpportunityMode, m_txOppSize, m_txOppTime, ns3::LteMacSapUser::NotifyTxOpportunity(), NS_LOG_FUNCTION, two-ray-to-three-gpp-ch-calibration::params, ns3::LteMacSapUser::TxOpportunityParameters::rnti, and ns3::Simulator::Schedule().
|
private |
Transmit PDU.
MAC SAP.
params | LteMacSapProvider::TransmitPduParameters |
Definition at line 558 of file lte-test-entities.cc.
References AM_RLC_HEADER, ns3::LteMacSapUser::ReceivePduParameters::lcid, m_device, m_macLoopback, m_macSapUser, m_pdcpHeaderPresent, m_receivedData, m_rlcHeaderType, m_txBytes, m_txPdus, NS_LOG_FUNCTION, NS_LOG_LOGIC, ns3::LteMacSapUser::ReceivePduParameters::p, two-ray-to-three-gpp-ch-calibration::params, ns3::LteMacSapUser::ReceivePdu(), ns3::LteMacSapUser::ReceivePduParameters::rnti, ns3::Simulator::Schedule(), and ns3::Seconds().
std::string ns3::LteTestMac::GetDataReceived | ( | ) |
Get data received function.
Definition at line 427 of file lte-test-entities.cc.
References m_receivedData, and NS_LOG_FUNCTION.
Referenced by LteRlcAmTransmitterTestCase::DoCheckDataReceived(), and LteRlcUmTransmitterTestCase::DoCheckDataReceived().
LteMacSapProvider * ns3::LteTestMac::GetLteMacSapProvider | ( | ) |
Get the MAC SAP provider.
Definition at line 415 of file lte-test-entities.cc.
References m_macSapProvider.
Referenced by LteRlcAmTransmitterTestCase::DoRun(), LteRlcUmTransmitterTestCase::DoRun(), ns3::LteSimpleHelper::InstallSingleEnbDevice(), and ns3::LteSimpleHelper::InstallSingleUeDevice().
uint32_t ns3::LteTestMac::GetRxBytes | ( | ) |
Get the receive bytes.
Definition at line 456 of file lte-test-entities.cc.
References m_rxBytes, and NS_LOG_FUNCTION.
uint32_t ns3::LteTestMac::GetRxPdus | ( | ) |
Get the receive PDUs.
Definition at line 449 of file lte-test-entities.cc.
References m_rxPdus, and NS_LOG_FUNCTION.
uint32_t ns3::LteTestMac::GetTxBytes | ( | ) |
Get the transmit bytes.
Definition at line 442 of file lte-test-entities.cc.
References m_txBytes, and NS_LOG_FUNCTION.
uint32_t ns3::LteTestMac::GetTxPdus | ( | ) |
Get the transmit PDUs.
Definition at line 435 of file lte-test-entities.cc.
References m_txPdus, and NS_LOG_FUNCTION.
|
static |
Get the type ID.
Definition at line 353 of file lte-test-entities.cc.
References ns3::TypeId::SetParent().
bool ns3::LteTestMac::Receive | ( | Ptr< NetDevice > | nd, |
Ptr< const Packet > | p, | ||
uint16_t | protocol, | ||
const Address & | addr | ||
) |
the Receive function
nd | the device |
p | the packet |
protocol | the protocol |
addr | the address |
Definition at line 655 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().
void ns3::LteTestMac::SendTxOpportunity | ( | Time | time, |
uint32_t | bytes | ||
) |
Send transmit opportunity function.
time | the time |
bytes | the number of bytes |
Definition at line 463 of file lte-test-entities.cc.
References ns3::LteMacSapUser::TxOpportunityParameters::bytes, ns3::LteMacSapUser::TxOpportunityParameters::componentCarrierId, ns3::Node::GetId(), ns3::LteMacSapUser::TxOpportunityParameters::harqId, ns3::LteMacSapUser::TxOpportunityParameters::layer, ns3::LteMacSapUser::TxOpportunityParameters::lcid, m_device, m_macSapUser, m_txOpportunityMode, m_txOppSize, m_txOppTime, ns3::LteMacSapUser::NotifyTxOpportunity(), NS_LOG_FUNCTION, RANDOM_MODE, ns3::LteMacSapUser::TxOpportunityParameters::rnti, ns3::Simulator::Schedule(), ns3::Simulator::ScheduleWithContext(), and ns3::Seconds().
Referenced by LteRlcAmTransmitterOneSduTestCase::DoRun(), LteRlcAmTransmitterSegmentationTestCase::DoRun(), LteRlcAmTransmitterConcatenationTestCase::DoRun(), LteRlcAmTransmitterReportBufferStatusTestCase::DoRun(), LteRlcUmTransmitterOneSduTestCase::DoRun(), LteRlcUmTransmitterSegmentationTestCase::DoRun(), LteRlcUmTransmitterConcatenationTestCase::DoRun(), LteRlcUmTransmitterReportBufferStatusTestCase::DoRun(), and SetTxOpportunityMode().
Set the device function.
device | the device |
Definition at line 403 of file lte-test-entities.cc.
References m_device.
Referenced by ns3::LteSimpleHelper::InstallSingleEnbDevice(), and ns3::LteSimpleHelper::InstallSingleUeDevice().
void ns3::LteTestMac::SetLteMacLoopback | ( | Ptr< LteTestMac > | s | ) |
Set the other side of the MAC Loopback.
s | a pointer to the other side of the MAC loopback |
Definition at line 421 of file lte-test-entities.cc.
References m_macLoopback.
void ns3::LteTestMac::SetLteMacSapUser | ( | LteMacSapUser * | s | ) |
Set the MAC SAP user.
s | a pointer to the MAC SAP user |
Definition at line 409 of file lte-test-entities.cc.
References m_macSapUser.
Referenced by LteRlcAmTransmitterTestCase::DoRun(), LteRlcUmTransmitterTestCase::DoRun(), ns3::LteSimpleHelper::InstallSingleEnbDevice(), and ns3::LteSimpleHelper::InstallSingleUeDevice().
void ns3::LteTestMac::SetPdcpHeaderPresent | ( | bool | present | ) |
Set PDCP header present function.
present | true iif PDCP header present |
Definition at line 511 of file lte-test-entities.cc.
References m_pdcpHeaderPresent, and NS_LOG_FUNCTION.
void ns3::LteTestMac::SetRlcHeaderType | ( | uint8_t | rlcHeaderType | ) |
Set RLC header type.
rlcHeaderType | the RLC header type |
Definition at line 518 of file lte-test-entities.cc.
References m_rlcHeaderType, and NS_LOG_FUNCTION.
Referenced by LteRlcAmTransmitterTestCase::DoRun(), and LteRlcUmTransmitterTestCase::DoRun().
void ns3::LteTestMac::SetTxOpportunityMode | ( | uint8_t | mode | ) |
Set transmit opportunity mode.
mode | the transmit opportunity mode |
Definition at line 525 of file lte-test-entities.cc.
References m_txOpportunityMode, m_txOppSize, m_txOppTime, NS_LOG_FUNCTION, RANDOM_MODE, ns3::Seconds(), and SendTxOpportunity().
void ns3::LteTestMac::SetTxOppSize | ( | uint32_t | txOppSize | ) |
Set transmit opportunity time.
txOppSize | the transmit opportunity size |
Definition at line 547 of file lte-test-entities.cc.
References m_txOppSize, and NS_LOG_FUNCTION.
void ns3::LteTestMac::SetTxOppTime | ( | Time | txOppTime | ) |
Set transmit opportunity time.
txOppTime | the transmit opportunity time |
Definition at line 540 of file lte-test-entities.cc.
References m_txOppTime, and NS_LOG_FUNCTION.
|
friend |
allow EnbMacMemberLteMacSapProvider<LteTestMac> class friend access
Definition at line 223 of file lte-test-entities.h.
Referenced by LteTestMac().
the device
Definition at line 387 of file lte-test-entities.h.
Referenced by LteTestMac(), DoDispose(), DoTransmitPdu(), SendTxOpportunity(), and SetDevice().
|
private |
MAC loopback.
Definition at line 379 of file lte-test-entities.h.
Referenced by LteTestMac(), DoTransmitPdu(), and SetLteMacLoopback().
|
private |
MAC SAP provider.
Definition at line 377 of file lte-test-entities.h.
Referenced by LteTestMac(), DoDispose(), and GetLteMacSapProvider().
|
private |
MAC SAP user.
Definition at line 378 of file lte-test-entities.h.
Referenced by LteTestMac(), DoReportBufferStatus(), DoTransmitPdu(), Receive(), SendTxOpportunity(), and SetLteMacSapUser().
|
private |
next transmit opportunity event
Definition at line 390 of file lte-test-entities.h.
next transmit opportunity list
Definition at line 393 of file lte-test-entities.h.
Referenced by DoReportBufferStatus().
|
private |
PDCP header present?
Definition at line 384 of file lte-test-entities.h.
Referenced by LteTestMac(), DoTransmitPdu(), and SetPdcpHeaderPresent().
|
private |
the received data string
Definition at line 381 of file lte-test-entities.h.
Referenced by DoTransmitPdu(), and GetDataReceived().
|
private |
RLC header type.
Definition at line 383 of file lte-test-entities.h.
Referenced by LteTestMac(), DoTransmitPdu(), and SetRlcHeaderType().
|
private |
the number of receive bytes
Definition at line 399 of file lte-test-entities.h.
Referenced by LteTestMac(), GetRxBytes(), and Receive().
|
private |
the number of receive PDUs
Definition at line 398 of file lte-test-entities.h.
Referenced by LteTestMac(), GetRxPdus(), and Receive().
|
private |
the number of transmit bytes
Definition at line 397 of file lte-test-entities.h.
Referenced by LteTestMac(), DoTransmitPdu(), and GetTxBytes().
|
private |
transmit opportunity mode
Definition at line 385 of file lte-test-entities.h.
Referenced by LteTestMac(), DoReportBufferStatus(), SendTxOpportunity(), and SetTxOpportunityMode().
|
private |
transmit opportunity size
Definition at line 392 of file lte-test-entities.h.
Referenced by LteTestMac(), DoReportBufferStatus(), SendTxOpportunity(), SetTxOpportunityMode(), and SetTxOppSize().
|
private |
transmit opportunity time
Definition at line 391 of file lte-test-entities.h.
Referenced by LteTestMac(), DoReportBufferStatus(), SendTxOpportunity(), SetTxOpportunityMode(), and SetTxOppTime().
|
private |
the number of transmit PDUs
Definition at line 396 of file lte-test-entities.h.
Referenced by LteTestMac(), DoTransmitPdu(), and GetTxPdus().