ns3::SatUtScheduler Class Reference

The SatUtScheduler is responsible of getting a packet of proper size from higher protocol layer. More...

#include "satellite-ut-scheduler.h"

+ Inheritance diagram for ns3::SatUtScheduler:
+ Collaboration diagram for ns3::SatUtScheduler:

Public Types

typedef std::vector< uint32_t > ByteCounterContainer_t
 Byte counter container. More...
 
enum  SatCompliancePolicy_t { STRICT = 0 , LOOSE = 1 }
 Enum describing the wanted scheduler policy. More...
 
typedef Callback< void, std::vector< Ptr< SatSchedulingObject > > & > SchedContextCallback
 Callback to get scheduling contexts from upper layer. More...
 
typedef Callback< Ptr< Packet >, uint32_t, Mac48Address, uint8_t, uint32_t &, uint32_t & > TxOpportunityCallback
 Callback to notify upper layer about Tx opportunity. More...
 

Public Member Functions

 SatUtScheduler ()
 Default constructor. More...
 
 SatUtScheduler (Ptr< SatLowerLayerServiceConf > lls)
 Used constructor. More...
 
virtual ~SatUtScheduler ()
 Destructor. More...
 
virtual void DoDispose (void)
 Dispose of SatUtScheduler. More...
 
void DoScheduling (std::vector< Ptr< Packet >> &packets, uint32_t payloadBytes, SatTimeSlotConf::SatTimeSlotType_t type, uint8_t rcIndex, SatCompliancePolicy_t policy)
 UT scheduling is responsible of selecting with which RC index to use when requesting packets from higher layer. More...
 
virtual TypeId GetInstanceTypeId (void) const
 Derived from Object. More...
 
virtual void SetNodeInfo (Ptr< SatNodeInfo > nodeInfo)
 Set the node info. More...
 
void SetSchedContextCallback (SatUtScheduler::SchedContextCallback cb)
 Method to set Tx opportunity callback. More...
 
void SetTxOpportunityCallback (SatUtScheduler::TxOpportunityCallback cb)
 Method to set Tx opportunity callback. More...
 

Static Public Member Functions

static TypeId GetTypeId (void)
 Derived from Object. More...
 

Private Member Functions

uint32_t DoSchedulingForRcIndex (std::vector< Ptr< Packet >> &packets, uint32_t &payloadBytes, uint8_t rcIndex)
 Do scheduling for a given RC index. More...
 
std::vector< uint8_t > GetPrioritizedRcIndexOrder ()
 Get a prioritized order of the available RC indices for LOOSE policy UT scheduling. More...
 

Private Attributes

uint32_t m_framePduHeaderSizeInBytes
 Frame PDU header size. More...
 
Ptr< SatLowerLayerServiceConfm_llsConf
 The configured lower layer service configuration for this UT MAC. More...
 
Ptr< SatNodeInfom_nodeInfo
 Node information. More...
 
bool m_prioritizeControl
 Strictly prioritize the control message scheduling regardless of the time slot information given from MAC layer. More...
 
std::vector< uint8_t > m_rcIndices
 Available RC indices for scheduling. More...
 
SatUtScheduler::SchedContextCallback m_schedContextCallback
 The scheduling context getter callback. More...
 
SatUtScheduler::TxOpportunityCallback m_txOpportunityCallback
 Callback to notify the txOpportunity to upper layer Returns a packet Attributes: payload in bytes. More...
 
ByteCounterContainer_t m_utScheduledByteCounters
 Byte counters for RC indices. More...
 

Detailed Description

The SatUtScheduler is responsible of getting a packet of proper size from higher protocol layer.

Two callbacks to LLC layer have been configured:

  • TxOpportunity callback
  • Scheduling requests callback

Definition at line 87 of file satellite-ut-scheduler.h.

Member Typedef Documentation

◆ ByteCounterContainer_t

typedef std::vector<uint32_t> ns3::SatUtScheduler::ByteCounterContainer_t

Byte counter container.

Parameters
uint8_tRC index
uint32_tByte counter

Definition at line 153 of file satellite-ut-scheduler.h.

◆ SchedContextCallback

typedef Callback<void, std::vector<Ptr<SatSchedulingObject> >&> ns3::SatUtScheduler::SchedContextCallback

Callback to get scheduling contexts from upper layer.

Parameters
vectorof scheduling contexts

Definition at line 134 of file satellite-ut-scheduler.h.

◆ TxOpportunityCallback

typedef Callback<Ptr<Packet>, uint32_t, Mac48Address, uint8_t, uint32_t&, uint32_t&> ns3::SatUtScheduler::TxOpportunityCallback

Callback to notify upper layer about Tx opportunity.

Parameters
uint32_tpayload size in bytes
Mac48Addressaddress
uint8_tRC index
uint32_t&Bytes left
uint32_t&Next min TxO
Returns
packet Packet to be transmitted to PHY

Definition at line 146 of file satellite-ut-scheduler.h.

Member Enumeration Documentation

◆ SatCompliancePolicy_t

Enum describing the wanted scheduler policy.

STRICT = UT scheduler schedules only from the given RC index LOOSE = UT scheduler may schedule also from other RC indices if needed

Enumerator
STRICT 
LOOSE 

Definition at line 111 of file satellite-ut-scheduler.h.

Constructor & Destructor Documentation

◆ SatUtScheduler() [1/2]

ns3::SatUtScheduler::SatUtScheduler ( )

Default constructor.

Definition at line 69 of file satellite-ut-scheduler.cc.

◆ SatUtScheduler() [2/2]

ns3::SatUtScheduler::SatUtScheduler ( Ptr< SatLowerLayerServiceConf lls)

Used constructor.

Parameters
llsLower layer service conf

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

References m_llsConf, m_rcIndices, m_utScheduledByteCounters, and ns3::SatEnums::NUM_FIDS.

◆ ~SatUtScheduler()

ns3::SatUtScheduler::~SatUtScheduler ( )
virtual

Destructor.

Definition at line 99 of file satellite-ut-scheduler.cc.

Member Function Documentation

◆ DoDispose()

void ns3::SatUtScheduler::DoDispose ( void  )
virtual

◆ DoScheduling()

void ns3::SatUtScheduler::DoScheduling ( std::vector< Ptr< Packet >> &  packets,
uint32_t  payloadBytes,
SatTimeSlotConf::SatTimeSlotType_t  type,
uint8_t  rcIndex,
SatCompliancePolicy_t  policy 
)

UT scheduling is responsible of selecting with which RC index to use when requesting packets from higher layer.

If RC index is set, then it just utilizes it.

Parameters
packetsVector of packets to be sent in a time slot
payloadBytesMaximum payload of a time slot
typeTime slot type
rcIndexRC index
policyCompliance policy of the scheduling process
Returns
Ptr<Packet> Packet fetched from higher layer

Definition at line 133 of file satellite-ut-scheduler.cc.

References ns3::SatEnums::CONTROL_FID, DoSchedulingForRcIndex(), GetPrioritizedRcIndexOrder(), LOOSE, m_prioritizeControl, m_utScheduledByteCounters, ns3::SatTimeSlotConf::SLOT_TYPE_C, and ns3::SatTimeSlotConf::SLOT_TYPE_TRC.

+ Here is the call graph for this function:

◆ DoSchedulingForRcIndex()

uint32_t ns3::SatUtScheduler::DoSchedulingForRcIndex ( std::vector< Ptr< Packet >> &  packets,
uint32_t &  payloadBytes,
uint8_t  rcIndex 
)
private

Do scheduling for a given RC index.

Parameters
packetsReference to a vector of packets to be sent
payloadBytesPayload bytes available for this time slot
rcIndexRC index to be scheduled
Returns
Scheduled bytes

Definition at line 201 of file satellite-ut-scheduler.cc.

References ns3::SatEnums::CONTROL_FID, m_framePduHeaderSizeInBytes, m_nodeInfo, and m_txOpportunityCallback.

Referenced by DoScheduling().

+ Here is the caller graph for this function:

◆ GetInstanceTypeId()

TypeId ns3::SatUtScheduler::GetInstanceTypeId ( void  ) const
virtual

Derived from Object.

Definition at line 62 of file satellite-ut-scheduler.cc.

References GetTypeId().

+ Here is the call graph for this function:

◆ GetPrioritizedRcIndexOrder()

std::vector< uint8_t > ns3::SatUtScheduler::GetPrioritizedRcIndexOrder ( )
private

Get a prioritized order of the available RC indices for LOOSE policy UT scheduling.

Returns
Vector of RC indices

Definition at line 262 of file satellite-ut-scheduler.cc.

References m_rcIndices, and m_utScheduledByteCounters.

Referenced by DoScheduling().

+ Here is the caller graph for this function:

◆ GetTypeId()

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

Derived from Object.

Definition at line 42 of file satellite-ut-scheduler.cc.

References m_framePduHeaderSizeInBytes, and m_prioritizeControl.

Referenced by GetInstanceTypeId().

+ Here is the caller graph for this function:

◆ SetNodeInfo()

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

Set the node info.

Parameters
nodeInfocontaining node specific information

Definition at line 254 of file satellite-ut-scheduler.cc.

References m_nodeInfo.

◆ SetSchedContextCallback()

void ns3::SatUtScheduler::SetSchedContextCallback ( SatUtScheduler::SchedContextCallback  cb)

Method to set Tx opportunity callback.

Parameters
cbcallback to invoke whenever a packet has been received and must be forwarded to the higher layers.

Definition at line 118 of file satellite-ut-scheduler.cc.

References m_schedContextCallback.

◆ SetTxOpportunityCallback()

void ns3::SatUtScheduler::SetTxOpportunityCallback ( SatUtScheduler::TxOpportunityCallback  cb)

Method to set Tx opportunity callback.

Parameters
cbcallback to invoke whenever a packet has been received and must be forwarded to the higher layers.

Definition at line 125 of file satellite-ut-scheduler.cc.

References m_txOpportunityCallback.

Member Data Documentation

◆ m_framePduHeaderSizeInBytes

uint32_t ns3::SatUtScheduler::m_framePduHeaderSizeInBytes
private

Frame PDU header size.

Frame PDU

Definition at line 238 of file satellite-ut-scheduler.h.

Referenced by DoSchedulingForRcIndex(), and GetTypeId().

◆ m_llsConf

Ptr<SatLowerLayerServiceConf> ns3::SatUtScheduler::m_llsConf
private

The configured lower layer service configuration for this UT MAC.

Definition at line 227 of file satellite-ut-scheduler.h.

Referenced by SatUtScheduler(), and DoDispose().

◆ m_nodeInfo

Ptr<SatNodeInfo> ns3::SatUtScheduler::m_nodeInfo
private

Node information.

Definition at line 243 of file satellite-ut-scheduler.h.

Referenced by DoDispose(), DoSchedulingForRcIndex(), and SetNodeInfo().

◆ m_prioritizeControl

bool ns3::SatUtScheduler::m_prioritizeControl
private

Strictly prioritize the control message scheduling regardless of the time slot information given from MAC layer.

Definition at line 233 of file satellite-ut-scheduler.h.

Referenced by DoScheduling(), and GetTypeId().

◆ m_rcIndices

std::vector<uint8_t> ns3::SatUtScheduler::m_rcIndices
private

Available RC indices for scheduling.

Definition at line 256 of file satellite-ut-scheduler.h.

Referenced by SatUtScheduler(), and GetPrioritizedRcIndexOrder().

◆ m_schedContextCallback

SatUtScheduler::SchedContextCallback ns3::SatUtScheduler::m_schedContextCallback
private

The scheduling context getter callback.

Definition at line 215 of file satellite-ut-scheduler.h.

Referenced by DoDispose(), and SetSchedContextCallback().

◆ m_txOpportunityCallback

SatUtScheduler::TxOpportunityCallback ns3::SatUtScheduler::m_txOpportunityCallback
private

Callback to notify the txOpportunity to upper layer Returns a packet Attributes: payload in bytes.

Definition at line 222 of file satellite-ut-scheduler.h.

Referenced by DoDispose(), DoSchedulingForRcIndex(), and SetTxOpportunityCallback().

◆ m_utScheduledByteCounters

ByteCounterContainer_t ns3::SatUtScheduler::m_utScheduledByteCounters
private

Byte counters for RC indices.

The counters are updated, when UT has decided to schedule some other RC index than the given one. Reason for this might be that the given RC index queue is empty or does not contain enough bytes.

Definition at line 251 of file satellite-ut-scheduler.h.

Referenced by SatUtScheduler(), DoScheduling(), and GetPrioritizedRcIndexOrder().


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