ns3::SatUtLlc Class Reference

SatUtLlc holds the UT implementation of LLC layer. More...

#include "satellite-ut-llc.h"

+ Inheritance diagram for ns3::SatUtLlc:
+ Collaboration diagram for ns3::SatUtLlc:

Public Member Functions

 SatUtLlc ()
 Construct a SatUtLlc, should not be used. More...
 
 SatUtLlc (SatEnums::RegenerationMode_t forwardLinkRegenerationMode, SatEnums::RegenerationMode_t returnLinkRegenerationMode)
 Construct a SatUtLlc. More...
 
virtual ~SatUtLlc ()
 Destroy a SatUtLlc. More...
 
virtual bool Enque (Ptr< Packet > packet, Address dest, uint8_t flowId)
 Called from higher layer (SatNetDevice) to enque packet to LLC. More...
 
virtual uint32_t GetNBytesInQueue (Mac48Address utAddress) const
 Get the number of (new) bytes at LLC queue for a certain UT. More...
 
virtual uint32_t GetNPacketsInQueue (Mac48Address utAddress) const
 Get the number of (new) packets at LLC queues for a certain UT. More...
 
virtual uint32_t GetNumSmallerPackets (uint32_t maxPacketSizeBytes) const
 Method checks how many packets are smaller or equal in size than the maximum packets size threshold specified as an argument. More...
 
Ptr< SatRequestManagerGetRequestManager () const
 Getter for the request manager. More...
 
virtual Ptr< Packet > NotifyTxOpportunity (uint32_t bytes, Mac48Address utAddr, uint8_t rcIndex, uint32_t &bytesLeft, uint32_t &nextMinTxO)
 Called from lower layer (MAC) to inform a Tx opportunity of certain amount of bytes. More...
 
void SetGwAddress (Mac48Address address)
 Set the GW address. More...
 
void SetMacQueueEventCallback (SatQueue::QueueEventCallback cb)
 
virtual void SetNodeInfo (Ptr< SatNodeInfo > nodeInfo)
 Set the node info. More...
 
void SetQueueStatisticsCallbacks ()
 Set queue statistics callbacks for each UT packet queue. More...
 
void SetRequestManager (Ptr< SatRequestManager > rm)
 Set a request manager for UT's LLC instance. More...
 
- Public Member Functions inherited from ns3::SatLlc
 SatLlc ()
 Construct a SatLlc, should not be used. More...
 
 SatLlc (SatEnums::RegenerationMode_t forwardLinkRegenerationMode, SatEnums::RegenerationMode_t returnLinkRegenerationMode)
 Construct a SatLlc. More...
 
virtual ~SatLlc ()
 Destroy a SatLlc. More...
 
void AddDecap (Mac48Address source, Mac48Address dest, uint8_t flowId, Ptr< SatBaseEncapsulator > dec)
 Add an decapsulator entry for the LLC. More...
 
void AddEncap (Mac48Address source, Mac48Address dest, uint8_t flowId, Ptr< SatBaseEncapsulator > enc)
 Add an encapsulator entry for the LLC. More...
 
virtual bool BuffersEmpty () const
 Are buffers empty? More...
 
virtual bool ControlBuffersEmpty () const
 Are buffers empty? More...
 
virtual uint32_t GetNBytesInQueue () const
 Get the total number of (new) bytes in all encapsulators. More...
 
virtual uint32_t GetNPacketsInQueue () const
 Get the total number of (new) packets in all encapsulators. More...
 
virtual void Receive (Ptr< Packet > packet, Mac48Address source, Mac48Address dest)
 Receive user data packet from lower layer. More...
 
virtual void ReceiveHigherLayerPdu (Ptr< Packet > packet, Mac48Address source, Mac48Address dest)
 Receive HL PDU from encapsulator/decapsulator entity. More...
 
void SetAdditionalHeaderSize (uint32_t additionalHeaderSize)
 Set the additional header size. More...
 
void SetCtrlMsgCallback (SatBaseEncapsulator::SendCtrlCallback cb)
 
void SetReadCtrlCallback (SatLlc::ReadCtrlMsgCallback cb)
 Method to set read control message callback. More...
 
void SetReceiveCallback (SatLlc::ReceiveCallback cb)
 Set Receive callback to forward packet to upper layer. More...
 
virtual void SetSatelliteAddress (Mac48Address address)
 Set the SAT address. More...
 

Static Public Member Functions

static TypeId GetTypeId (void)
 Derived form Object. More...
 
- Static Public Member Functions inherited from ns3::SatLlc
static TypeId GetTypeId (void)
 Derived from Object. More...
 

Protected Member Functions

virtual void CreateDecap (Ptr< EncapKey > key)
 Virtual method to create a new decapsulator 'on-a-need-basis' dynamically. More...
 
virtual void CreateEncap (Ptr< EncapKey > key)
 Virtual method to create a new encapsulator 'on-a-need-basis' dynamically. More...
 
virtual void CreateEncap (Ptr< EncapKey > key, Ptr< SatQueue > providedQueue)
 Virtual method to create a new encapsulator 'on-a-need-basis' dynamically. More...
 
void DoDispose ()
 Dispose of SatUtLLc. More...
 
virtual SatEnums::SatLinkDir_t GetSatLinkRxDir ()
 Get the link RX direction. More...
 
virtual SatEnums::SatLinkDir_t GetSatLinkTxDir ()
 Get the link TX direction. More...
 
virtual void GetSchedulingContexts (std::vector< Ptr< SatSchedulingObject >> &output) const
 Create and fill the scheduling objects based on LLC layer information. More...
 
- Protected Member Functions inherited from ns3::SatLlc
virtual void ReceiveAck (Ptr< SatArqAckMessage > ack, Mac48Address source, Mac48Address dest)
 Receive a control msg (ARQ ACK) from lower layer. More...
 

Private Attributes

SatQueue::QueueEventCallback m_macQueueEventCb
 Callback to send queue events to e.g. More...
 
Ptr< SatRequestManagerm_requestManager
 Request manager handling the capacity requests. More...
 

Additional Inherited Members

- Public Types inherited from ns3::SatLlc
typedef std::map< Ptr< EncapKey >, Ptr< SatBaseEncapsulator >, EncapKeyCompareEncapContainer_t
 Key = Ptr<EncapKey> (source, dest, flowId) Value = Ptr<SatBaseEncapsulator> Compare class = EncapKeyCompare. More...
 
typedef Callback< Ptr< SatControlMessage >, uint32_t > ReadCtrlMsgCallback
 Callback to read control messages from container storing control messages. More...
 
typedef Callback< void, Ptr< const Packet > > ReceiveCallback
 Receive callback used for sending packet to netdevice layer. More...
 
- Protected Attributes inherited from ns3::SatLlc
uint32_t m_additionalHeaderSize
 Additional header size to add to encapsulation/decapsulation. More...
 
EncapContainer_t m_decaps
 Map of decapsulator base pointers. More...
 
EncapContainer_t m_encaps
 Map of encapsulator base pointers. More...
 
SatEnums::RegenerationMode_t m_forwardLinkRegenerationMode
 Regeneration mode on forward link. More...
 
bool m_fwdLinkArqEnabled
 Is FWD link ARQ enabled. More...
 
Mac48Address m_gwAddress
 GW address. More...
 
Ptr< SatNodeInfom_nodeInfo
 Node info containing node related information, such as node type, node id and MAC address (of the SatNetDevice) More...
 
TracedCallback< Time, SatEnums::SatPacketEvent_t, SatEnums::SatNodeType_t, uint32_t, Mac48Address, SatEnums::SatLogLevel_t, SatEnums::SatLinkDir_t, std::string > m_packetTrace
 Trace callback used for packet tracing: More...
 
SatLlc::ReadCtrlMsgCallback m_readCtrlCallback
 The read control message callback. More...
 
SatEnums::RegenerationMode_t m_returnLinkRegenerationMode
 Regeneration mode on return link. More...
 
bool m_rtnLinkArqEnabled
 Is RTN link ARQ enabled. More...
 
ReceiveCallback m_rxCallback
 The upper layer package receive callback. More...
 
Mac48Address m_satelliteAddress
 SAT address, used in case of network regeneration. More...
 
SatBaseEncapsulator::SendCtrlCallback m_sendCtrlCallback
 Callback to send control messages. More...
 

Detailed Description

SatUtLlc holds the UT implementation of LLC layer.

SatUtLlc is inherited from SatLlc base class and implements the needed changes from the base class related to UT LLC packet transmissions and receptions.

Definition at line 45 of file satellite-ut-llc.h.

Constructor & Destructor Documentation

◆ SatUtLlc() [1/2]

ns3::SatUtLlc::SatUtLlc ( )

Construct a SatUtLlc, should not be used.

Definition at line 64 of file satellite-ut-llc.cc.

◆ SatUtLlc() [2/2]

ns3::SatUtLlc::SatUtLlc ( SatEnums::RegenerationMode_t  forwardLinkRegenerationMode,
SatEnums::RegenerationMode_t  returnLinkRegenerationMode 
)

Construct a SatUtLlc.

Parameters
forwardLinkRegenerationModeForward link regeneration model
returnLinkRegenerationModeReturn link regeneration model

Definition at line 71 of file satellite-ut-llc.cc.

◆ ~SatUtLlc()

ns3::SatUtLlc::~SatUtLlc ( )
virtual

Destroy a SatUtLlc.

This is the destructor for the SatLlc.

Definition at line 79 of file satellite-ut-llc.cc.

Member Function Documentation

◆ CreateDecap()

void ns3::SatUtLlc::CreateDecap ( Ptr< EncapKey key)
protectedvirtual

Virtual method to create a new decapsulator 'on-a-need-basis' dynamically.

Parameters
keyEncapsulator key class

Implements ns3::SatLlc.

Definition at line 362 of file satellite-ut-llc.cc.

References ns3::SatLlc::m_additionalHeaderSize, ns3::SatLlc::m_decaps, ns3::SatLlc::m_fwdLinkArqEnabled, ns3::SatLlc::m_sendCtrlCallback, and ns3::SatLlc::ReceiveHigherLayerPdu().

+ Here is the call graph for this function:

◆ CreateEncap() [1/2]

void ns3::SatUtLlc::CreateEncap ( Ptr< EncapKey key)
protectedvirtual

Virtual method to create a new encapsulator 'on-a-need-basis' dynamically.

Parameters
keyEncapsulator key class

Implements ns3::SatLlc.

Definition at line 289 of file satellite-ut-llc.cc.

Referenced by Enque(), and SetGwAddress().

+ Here is the caller graph for this function:

◆ CreateEncap() [2/2]

void ns3::SatUtLlc::CreateEncap ( Ptr< EncapKey key,
Ptr< SatQueue providedQueue 
)
protectedvirtual

Virtual method to create a new encapsulator 'on-a-need-basis' dynamically.

Parameters
keyEncapsulator key class
providedQueueExisting queue to use for this encapsulator, if need be

Definition at line 295 of file satellite-ut-llc.cc.

References ns3::SatQueue::GetQueueStatistics(), ns3::SatLlc::m_additionalHeaderSize, ns3::SatLlc::m_encaps, m_macQueueEventCb, m_requestManager, ns3::SatLlc::m_returnLinkRegenerationMode, ns3::SatLlc::m_rtnLinkArqEnabled, ns3::SatRequestManager::ReceiveQueueEvent(), and ns3::SatEnums::REGENERATION_NETWORK.

+ Here is the call graph for this function:

◆ DoDispose()

void ns3::SatUtLlc::DoDispose ( void  )
protectedvirtual

Dispose of SatUtLLc.

Reimplemented from ns3::SatLlc.

Definition at line 85 of file satellite-ut-llc.cc.

References ns3::SatLlc::DoDispose(), m_macQueueEventCb, and m_requestManager.

+ Here is the call graph for this function:

◆ Enque()

bool ns3::SatUtLlc::Enque ( Ptr< Packet >  packet,
Address  dest,
uint8_t  flowId 
)
virtual

Called from higher layer (SatNetDevice) to enque packet to LLC.

Parameters
packetpacket sent from above down to SatMac
destDestination MAC address of the packet
flowIdFlow identifier
Returns
Boolean indicating whether the enque operation succeeded

Encapsulator not found, thus create a new one. This method is implemented in the inherited classes, which knows which type of encapsulator to create.

Reimplemented from ns3::SatLlc.

Definition at line 101 of file satellite-ut-llc.cc.

References CreateEncap(), ns3::SatUtils::GetPacketInfo(), ns3::SatEnums::LD_RETURN, ns3::SatEnums::LL_LLC, ns3::SatLlc::m_encaps, ns3::SatLlc::m_gwAddress, ns3::SatLlc::m_nodeInfo, ns3::SatLlc::m_packetTrace, ns3::SatLlc::m_returnLinkRegenerationMode, ns3::SatLlc::m_satelliteAddress, ns3::SatEnums::PACKET_ENQUE, ns3::SatEnums::REGENERATION_NETWORK, ns3::SatAddressE2ETag::SetE2EDestAddress(), and ns3::SatAddressE2ETag::SetE2ESourceAddress().

+ Here is the call graph for this function:

◆ GetNBytesInQueue()

uint32_t ns3::SatUtLlc::GetNBytesInQueue ( Mac48Address  utAddress) const
virtual

Get the number of (new) bytes at LLC queue for a certain UT.

Method checks only the SatQueue for packets, thus it does not count possible packets buffered at the encapsulator (e.g. in case of ARQ).

Parameters
utAddressthe MAC address that identifies a particular UT node.
Returns
Number of bytes currently queued in the encapsulator(s) associated with the UT.

Implements ns3::SatLlc.

Definition at line 407 of file satellite-ut-llc.cc.

References ns3::SatLlc::m_encaps.

◆ GetNPacketsInQueue()

uint32_t ns3::SatUtLlc::GetNPacketsInQueue ( Mac48Address  utAddress) const
virtual

Get the number of (new) packets at LLC queues for a certain UT.

Method checks only the SatQueue for packets, thus it does not count possible packets buffered at the encapsulator (e.g. in case of ARQ).

Parameters
utAddressthe MAC address that identifies a particular UT node.
Returns
Number of packets currently queued in the encapsulator(s) associated with the UT.

Implements ns3::SatLlc.

Definition at line 428 of file satellite-ut-llc.cc.

References ns3::SatLlc::m_encaps.

◆ GetNumSmallerPackets()

uint32_t ns3::SatUtLlc::GetNumSmallerPackets ( uint32_t  maxPacketSizeBytes) const
virtual

Method checks how many packets are smaller or equal in size than the maximum packets size threshold specified as an argument.

Note, that each queue is gone through from the front up until there is first packet larger than threshold.

Parameters
maxPacketSizeBytesMaximum packet size threshold in Bytes
Returns
uint32_t Number of packets

Definition at line 267 of file satellite-ut-llc.cc.

References ns3::SatLlc::m_encaps.

◆ GetRequestManager()

Ptr< SatRequestManager > ns3::SatUtLlc::GetRequestManager ( ) const

Getter for the request manager.

Returns
Pointer to SatRequestManager

Definition at line 244 of file satellite-ut-llc.cc.

References m_requestManager.

Referenced by GetTypeId().

+ Here is the caller graph for this function:

◆ GetSatLinkRxDir()

SatEnums::SatLinkDir_t ns3::SatUtLlc::GetSatLinkRxDir ( )
protectedvirtual

Get the link RX direction.

Must be implemented by child clases.

Returns
The link RX direction

Reimplemented from ns3::SatLlc.

Definition at line 466 of file satellite-ut-llc.cc.

References ns3::SatEnums::LD_FORWARD.

◆ GetSatLinkTxDir()

SatEnums::SatLinkDir_t ns3::SatUtLlc::GetSatLinkTxDir ( )
protectedvirtual

Get the link TX direction.

Must be implemented by child clases.

Returns
The link TX direction

Reimplemented from ns3::SatLlc.

Definition at line 460 of file satellite-ut-llc.cc.

References ns3::SatEnums::LD_RETURN.

◆ GetSchedulingContexts()

void ns3::SatUtLlc::GetSchedulingContexts ( std::vector< Ptr< SatSchedulingObject >> &  output) const
protectedvirtual

Create and fill the scheduling objects based on LLC layer information.

Scheduling objects may be used at the MAC layer to assist in scheduling.

Parameters
outputreference to an output vector that will be filled with pointer to scheduling objects

This is not yet implemented to the UT LLC

Implements ns3::SatLlc.

Definition at line 449 of file satellite-ut-llc.cc.

◆ GetTypeId()

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

Derived form Object.

Definition at line 50 of file satellite-ut-llc.cc.

References GetRequestManager(), and SetRequestManager().

+ Here is the call graph for this function:

◆ NotifyTxOpportunity()

Ptr< Packet > ns3::SatUtLlc::NotifyTxOpportunity ( uint32_t  bytes,
Mac48Address  utAddr,
uint8_t  rcIndex,
uint32_t &  bytesLeft,
uint32_t &  nextMinTxO 
)
virtual

Called from lower layer (MAC) to inform a Tx opportunity of certain amount of bytes.

Parameters
utAddrMAC address of the UT with Tx opportunity
bytesSize of the Tx opportunity
rcIndexRC index
&bytesLeftBytes left after TxOpportunity
&nextMinTxOMinimum TxO after this TxO
Returns
Pointer to packet to be transmitted

Implements ns3::SatLlc.

Definition at line 186 of file satellite-ut-llc.cc.

References ns3::SatUtils::GetPacketInfo(), ns3::SatEnums::LD_RETURN, ns3::SatEnums::LL_LLC, ns3::SatLlc::m_encaps, ns3::SatLlc::m_gwAddress, ns3::SatLlc::m_nodeInfo, ns3::SatLlc::m_packetTrace, ns3::SatLlc::m_returnLinkRegenerationMode, ns3::SatLlc::m_satelliteAddress, ns3::SatEnums::PACKET_SENT, and ns3::SatEnums::REGENERATION_NETWORK.

Referenced by ns3::SatUtHelper::InstallDvb().

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

◆ SetGwAddress()

void ns3::SatUtLlc::SetGwAddress ( Mac48Address  address)
virtual

Set the GW address.

Parameters
addressGW MAC address

Reimplemented from ns3::SatLlc.

Definition at line 480 of file satellite-ut-llc.cc.

References CreateEncap(), ns3::SatLlc::m_encaps, ns3::SatLlc::m_gwAddress, ns3::SatLlc::m_nodeInfo, m_requestManager, and ns3::SatLlc::SetGwAddress().

Referenced by ns3::SatUtHelper::InstallDvb().

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

◆ SetMacQueueEventCallback()

void ns3::SatUtLlc::SetMacQueueEventCallback ( SatQueue::QueueEventCallback  cb)
Parameters
cbcallback to send control messages.

Definition at line 472 of file satellite-ut-llc.cc.

References m_macQueueEventCb.

◆ SetNodeInfo()

void ns3::SatUtLlc::SetNodeInfo ( Ptr< SatNodeInfo nodeInfo)
virtual

Set the node info.

Parameters
nodeInfocontaining node specific information

Reimplemented from ns3::SatLlc.

Definition at line 280 of file satellite-ut-llc.cc.

References m_requestManager, and ns3::SatLlc::SetNodeInfo().

+ Here is the call graph for this function:

◆ SetQueueStatisticsCallbacks()

void ns3::SatUtLlc::SetQueueStatisticsCallbacks ( )

Set queue statistics callbacks for each UT packet queue.

Callbacks are passed on to request manager.

Definition at line 252 of file satellite-ut-llc.cc.

References ns3::SatQueue::GetQueueStatistics(), ns3::SatLlc::m_encaps, and m_requestManager.

+ Here is the call graph for this function:

◆ SetRequestManager()

void ns3::SatUtLlc::SetRequestManager ( Ptr< SatRequestManager rm)

Set a request manager for UT's LLC instance.

Parameters
rmPtr to request manager

Definition at line 237 of file satellite-ut-llc.cc.

References m_requestManager.

Referenced by GetTypeId().

+ Here is the caller graph for this function:

Member Data Documentation

◆ m_macQueueEventCb

SatQueue::QueueEventCallback ns3::SatUtLlc::m_macQueueEventCb
private

Callback to send queue events to e.g.

MAC layer. Note, that this is not actually used by the LLC but the encapsulators. It is just stored here.

Definition at line 221 of file satellite-ut-llc.h.

Referenced by CreateEncap(), DoDispose(), and SetMacQueueEventCallback().

◆ m_requestManager

Ptr<SatRequestManager> ns3::SatUtLlc::m_requestManager
private

Request manager handling the capacity requests.

Definition at line 214 of file satellite-ut-llc.h.

Referenced by CreateEncap(), DoDispose(), GetRequestManager(), SetGwAddress(), SetNodeInfo(), SetQueueStatisticsCallbacks(), and SetRequestManager().


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