The SatUtScheduler is responsible of getting a packet of proper size from higher protocol layer. More...
#include "satellite-ut-scheduler.h"
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< SatLowerLayerServiceConf > | m_llsConf |
The configured lower layer service configuration for this UT MAC. More... | |
Ptr< SatNodeInfo > | m_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... | |
The SatUtScheduler is responsible of getting a packet of proper size from higher protocol layer.
Two callbacks to LLC layer have been configured:
Definition at line 87 of file satellite-ut-scheduler.h.
typedef std::vector<uint32_t> ns3::SatUtScheduler::ByteCounterContainer_t |
Byte counter container.
uint8_t | RC index |
uint32_t | Byte counter |
Definition at line 153 of file satellite-ut-scheduler.h.
typedef Callback<void, std::vector<Ptr<SatSchedulingObject> >&> ns3::SatUtScheduler::SchedContextCallback |
Callback to get scheduling contexts from upper layer.
vector | of scheduling contexts |
Definition at line 134 of file satellite-ut-scheduler.h.
typedef Callback<Ptr<Packet>, uint32_t, Mac48Address, uint8_t, uint32_t&, uint32_t&> ns3::SatUtScheduler::TxOpportunityCallback |
Callback to notify upper layer about Tx opportunity.
uint32_t | payload size in bytes |
Mac48Address | address |
uint8_t | RC index |
uint32_t& | Bytes left |
uint32_t& | Next min TxO |
Definition at line 146 of file satellite-ut-scheduler.h.
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.
ns3::SatUtScheduler::SatUtScheduler | ( | ) |
Default constructor.
Definition at line 69 of file satellite-ut-scheduler.cc.
ns3::SatUtScheduler::SatUtScheduler | ( | Ptr< SatLowerLayerServiceConf > | lls | ) |
Used constructor.
lls | Lower 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.
|
virtual |
Destructor.
Definition at line 99 of file satellite-ut-scheduler.cc.
|
virtual |
Dispose of SatUtScheduler.
Definition at line 105 of file satellite-ut-scheduler.cc.
References m_llsConf, m_nodeInfo, m_schedContextCallback, and m_txOpportunityCallback.
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.
packets | Vector of packets to be sent in a time slot |
payloadBytes | Maximum payload of a time slot |
type | Time slot type |
rcIndex | RC index |
policy | Compliance policy of the scheduling process |
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.
|
private |
Do scheduling for a given RC index.
packets | Reference to a vector of packets to be sent |
payloadBytes | Payload bytes available for this time slot |
rcIndex | RC index to be scheduled |
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().
|
virtual |
Derived from Object.
Definition at line 62 of file satellite-ut-scheduler.cc.
References GetTypeId().
|
private |
Get a prioritized order of the available RC indices for LOOSE policy UT scheduling.
Definition at line 262 of file satellite-ut-scheduler.cc.
References m_rcIndices, and m_utScheduledByteCounters.
Referenced by DoScheduling().
|
static |
Derived from Object.
Definition at line 42 of file satellite-ut-scheduler.cc.
References m_framePduHeaderSizeInBytes, and m_prioritizeControl.
Referenced by GetInstanceTypeId().
|
virtual |
Set the node info.
nodeInfo | containing node specific information |
Definition at line 254 of file satellite-ut-scheduler.cc.
References m_nodeInfo.
void ns3::SatUtScheduler::SetSchedContextCallback | ( | SatUtScheduler::SchedContextCallback | cb | ) |
Method to set Tx opportunity callback.
cb | callback 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.
void ns3::SatUtScheduler::SetTxOpportunityCallback | ( | SatUtScheduler::TxOpportunityCallback | cb | ) |
Method to set Tx opportunity callback.
cb | callback 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.
|
private |
Frame PDU header size.
Frame PDU
Definition at line 238 of file satellite-ut-scheduler.h.
Referenced by DoSchedulingForRcIndex(), and GetTypeId().
|
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().
|
private |
Node information.
Definition at line 243 of file satellite-ut-scheduler.h.
Referenced by DoDispose(), DoSchedulingForRcIndex(), and SetNodeInfo().
|
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().
|
private |
Available RC indices for scheduling.
Definition at line 256 of file satellite-ut-scheduler.h.
Referenced by SatUtScheduler(), and GetPrioritizedRcIndexOrder().
|
private |
The scheduling context getter callback.
Definition at line 215 of file satellite-ut-scheduler.h.
Referenced by DoDispose(), and SetSchedContextCallback().
|
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().
|
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().