SatBbFrame class implements functionality for BB frames. More...
#include "satellite-bbframe.h"
Public Types | |
typedef void(* | BbFrameCallback) (Ptr< SatBbFrame > bbFrame) |
Callback signature for Ptr<SatBbFrame>. More... | |
typedef void(* | BbFrameMergeCallback) (Ptr< SatBbFrame > to, Ptr< SatBbFrame > from) |
Callback signature for merging of two instances of SatBbFrame. More... | |
typedef std::vector< Ptr< Packet > > | SatBbFramePayload_t |
Define type SatBbFramePayload_t. More... | |
Public Member Functions | |
SatBbFrame () | |
Default constructor. More... | |
SatBbFrame (SatEnums::SatModcod_t modCod, SatEnums::SatBbFrameType_t type, Ptr< SatBbFrameConf > conf) | |
Constructor to create BB frame according to given type and MODCOD, type and BB frame configuration. More... | |
virtual | ~SatBbFrame () |
Destructor fro BB frame. More... | |
uint32_t | AddPayload (Ptr< Packet > packet) |
Add payload (packet) to transmit buffer of this BB Frame info. More... | |
Time | Extend (Ptr< SatBbFrameConf > conf) |
Extent BB frame to the longest type. More... | |
Time | GetDuration () const |
Get duration of the frame transmission. More... | |
uint32_t | GetFrameHeaderSize () const |
Get header size of the frame. More... | |
SatEnums::SatBbFrameType_t | GetFrameType () const |
Get type of the frame. More... | |
uint32_t | GetMaxSpaceInBytes () const |
Get the maximum size of the BB Frame transmit buffer in bytes. More... | |
SatEnums::SatModcod_t | GetModcod () const |
Get type of the frame. More... | |
double | GetOccupancy () const |
Get the occupancy of the of the BB Frame. More... | |
double | GetOccupancyIfMerged (Ptr< SatBbFrame > mergedFrame) const |
Checks occupancy of the frame if given frame would been merged with this frame. More... | |
const SatBbFramePayload_t & | GetPayload () |
Get the data in the BB Frame info as container of the packet pointers. More... | |
uint8_t | GetSliceId () const |
Get the slice ID of the BBFrame. More... | |
uint32_t | GetSpaceLeftInBytes () const |
Get space left in BB frame transmit buffer in bytes. More... | |
uint32_t | GetSpaceUsedInBytes () const |
Get space used in BB frame transmit buffer in bytes. More... | |
double | GetSpectralEfficiency (double carrierBandwidthInHz) const |
Get spectra efficiency of the frame. More... | |
bool | MergeWithFrame (Ptr< SatBbFrame > mergedFrame, TracedCallback< Ptr< SatBbFrame >, Ptr< SatBbFrame >> mergeTraceCb) |
Merge given frame with this frame. More... | |
void | SetSliceId (uint8_t sliceId) |
Set the slice ID of the BBFrame. More... | |
Time | Shrink (Ptr< SatBbFrameConf > conf) |
Shrink BB frame to the shortest type possible according to current load in the frame. More... | |
Private Attributes | |
Time | m_duration |
SatBbFramePayload_t | m_framePayload |
SatEnums::SatBbFrameType_t | m_frameType |
uint32_t | m_freeSpaceInBytes |
uint32_t | m_headerSizeInBytes |
uint32_t | m_maxSpaceInBytes |
SatEnums::SatModcod_t | m_modCod |
uint8_t | m_sliceId |
SatBbFrame class implements functionality for BB frames.
Holds information of a BB Frame for forward link scheduling. It also provides methods to query information of the frame and methods to modify frames like shrink, extend and merge.
Definition at line 47 of file satellite-bbframe.h.
typedef void(* ns3::SatBbFrame::BbFrameCallback) (Ptr< SatBbFrame > bbFrame) |
Callback signature for Ptr<SatBbFrame>.
bbFrame | The BB frame. |
Definition at line 214 of file satellite-bbframe.h.
typedef void(* ns3::SatBbFrame::BbFrameMergeCallback) (Ptr< SatBbFrame > to, Ptr< SatBbFrame > from) |
Callback signature for merging of two instances of SatBbFrame.
to | The frame merged to. |
to | The frame merged from. |
Definition at line 221 of file satellite-bbframe.h.
typedef std::vector<Ptr<Packet> > ns3::SatBbFrame::SatBbFramePayload_t |
Define type SatBbFramePayload_t.
Definition at line 53 of file satellite-bbframe.h.
ns3::SatBbFrame::SatBbFrame | ( | ) |
Default constructor.
Constructs BB frame with default ModCod and default frame type.
Definition at line 33 of file satellite-bbframe.cc.
ns3::SatBbFrame::SatBbFrame | ( | SatEnums::SatModcod_t | modCod, |
SatEnums::SatBbFrameType_t | type, | ||
Ptr< SatBbFrameConf > | conf | ||
) |
Constructor to create BB frame according to given type and MODCOD, type and BB frame configuration.
modCod | Used ModCod |
type | Type of the frame |
conf | Pointer to BBFrame configuration |
Dummy frame is assumed to be a short frame but with no valid data.
Definition at line 44 of file satellite-bbframe.cc.
References ns3::SatConstVariables::BITS_PER_BYTE, ns3::SatEnums::DUMMY_FRAME, ns3::SatEnums::DVB_S2, ns3::SatEnums::DVB_S2X, m_duration, m_freeSpaceInBytes, m_headerSizeInBytes, m_maxSpaceInBytes, ns3::SatEnums::NORMAL_FRAME, and ns3::SatEnums::SHORT_FRAME.
|
virtual |
Destructor fro BB frame.
Definition at line 93 of file satellite-bbframe.cc.
uint32_t ns3::SatBbFrame::AddPayload | ( | Ptr< Packet > | packet | ) |
Add payload (packet) to transmit buffer of this BB Frame info.
packet | Pointer to packet wanted to add to transmit buffer |
Definition at line 106 of file satellite-bbframe.cc.
References GetSpaceLeftInBytes(), m_framePayload, and m_freeSpaceInBytes.
Time ns3::SatBbFrame::Extend | ( | Ptr< SatBbFrameConf > | conf | ) |
Extent BB frame to the longest type.
conf | Pointer to BB frame configuration |
Definition at line 236 of file satellite-bbframe.cc.
References ns3::SatConstVariables::BITS_PER_BYTE, GetSpaceUsedInBytes(), m_duration, m_frameType, m_freeSpaceInBytes, m_maxSpaceInBytes, m_modCod, ns3::SatEnums::NORMAL_FRAME, and ns3::SatEnums::SHORT_FRAME.
|
inline |
Get duration of the frame transmission.
Definition at line 160 of file satellite-bbframe.h.
References m_duration.
|
inline |
Get header size of the frame.
Definition at line 205 of file satellite-bbframe.h.
References m_headerSizeInBytes.
|
inline |
Get type of the frame.
Definition at line 169 of file satellite-bbframe.h.
References m_frameType.
uint32_t ns3::SatBbFrame::GetMaxSpaceInBytes | ( | ) | const |
Get the maximum size of the BB Frame transmit buffer in bytes.
Definition at line 141 of file satellite-bbframe.cc.
References m_maxSpaceInBytes.
|
inline |
Get type of the frame.
Definition at line 178 of file satellite-bbframe.h.
References m_modCod.
double ns3::SatBbFrame::GetOccupancy | ( | ) | const |
Get the occupancy of the of the BB Frame.
Definition at line 148 of file satellite-bbframe.cc.
References GetSpaceUsedInBytes(), and m_maxSpaceInBytes.
double ns3::SatBbFrame::GetOccupancyIfMerged | ( | Ptr< SatBbFrame > | mergedFrame | ) | const |
Checks occupancy of the frame if given frame would been merged with this frame.
mergedFrame | Another frame wanted to merge with this frame. |
Definition at line 155 of file satellite-bbframe.cc.
References GetSpaceUsedInBytes(), m_freeSpaceInBytes, and m_maxSpaceInBytes.
const SatBbFrame::SatBbFramePayload_t & ns3::SatBbFrame::GetPayload | ( | ) |
Get the data in the BB Frame info as container of the packet pointers.
Definition at line 99 of file satellite-bbframe.cc.
References m_framePayload.
|
inline |
Get the slice ID of the BBFrame.
Definition at line 187 of file satellite-bbframe.h.
References m_sliceId.
uint32_t ns3::SatBbFrame::GetSpaceLeftInBytes | ( | ) | const |
Get space left in BB frame transmit buffer in bytes.
Definition at line 127 of file satellite-bbframe.cc.
References m_freeSpaceInBytes.
Referenced by AddPayload().
uint32_t ns3::SatBbFrame::GetSpaceUsedInBytes | ( | ) | const |
Get space used in BB frame transmit buffer in bytes.
Definition at line 134 of file satellite-bbframe.cc.
References m_freeSpaceInBytes, and m_maxSpaceInBytes.
Referenced by Extend(), GetOccupancy(), GetOccupancyIfMerged(), and Shrink().
double ns3::SatBbFrame::GetSpectralEfficiency | ( | double | carrierBandwidthInHz | ) | const |
Get spectra efficiency of the frame.
carrierBandwidthInHz | Carrier bandwidth in hertz. |
Definition at line 174 of file satellite-bbframe.cc.
References ns3::SatConstVariables::BITS_PER_BYTE, m_duration, and m_maxSpaceInBytes.
bool ns3::SatBbFrame::MergeWithFrame | ( | Ptr< SatBbFrame > | mergedFrame, |
TracedCallback< Ptr< SatBbFrame >, Ptr< SatBbFrame >> | mergeTraceCb | ||
) |
Merge given frame with this frame.
mergedFrame | Another frame to be merged with this frame. |
mergeTraceCb | Logging trace source for BB frame optimization. |
Definition at line 183 of file satellite-bbframe.cc.
References m_framePayload, and m_freeSpaceInBytes.
|
inline |
Set the slice ID of the BBFrame.
sliceId | The slice ID of the BBFrame |
Definition at line 196 of file satellite-bbframe.h.
References m_sliceId.
Time ns3::SatBbFrame::Shrink | ( | Ptr< SatBbFrameConf > | conf | ) |
Shrink BB frame to the shortest type possible according to current load in the frame.
conf | Pointer to BB frame configuration |
Definition at line 206 of file satellite-bbframe.cc.
References ns3::SatConstVariables::BITS_PER_BYTE, GetSpaceUsedInBytes(), m_duration, m_frameType, m_freeSpaceInBytes, m_headerSizeInBytes, m_maxSpaceInBytes, m_modCod, ns3::SatEnums::NORMAL_FRAME, and ns3::SatEnums::SHORT_FRAME.
|
private |
Definition at line 230 of file satellite-bbframe.h.
Referenced by SatBbFrame(), Extend(), GetDuration(), GetSpectralEfficiency(), and Shrink().
|
private |
Definition at line 229 of file satellite-bbframe.h.
Referenced by AddPayload(), GetPayload(), and MergeWithFrame().
|
private |
Definition at line 231 of file satellite-bbframe.h.
Referenced by Extend(), GetFrameType(), and Shrink().
|
private |
Definition at line 226 of file satellite-bbframe.h.
Referenced by SatBbFrame(), AddPayload(), Extend(), GetOccupancyIfMerged(), GetSpaceLeftInBytes(), GetSpaceUsedInBytes(), MergeWithFrame(), and Shrink().
|
private |
Definition at line 228 of file satellite-bbframe.h.
Referenced by SatBbFrame(), GetFrameHeaderSize(), and Shrink().
|
private |
Definition at line 227 of file satellite-bbframe.h.
Referenced by SatBbFrame(), Extend(), GetMaxSpaceInBytes(), GetOccupancy(), GetOccupancyIfMerged(), GetSpaceUsedInBytes(), GetSpectralEfficiency(), and Shrink().
|
private |
Definition at line 224 of file satellite-bbframe.h.
Referenced by Extend(), GetModcod(), and Shrink().
|
private |
Definition at line 225 of file satellite-bbframe.h.
Referenced by GetSliceId(), and SetSliceId().