ns3::SatBbFrame Class Reference

SatBbFrame class implements functionality for BB frames. More...

#include "satellite-bbframe.h"

+ Inheritance diagram for ns3::SatBbFrame:
+ Collaboration diagram for ns3::SatBbFrame:

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_tGetPayload ()
 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
 

Detailed Description

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 46 of file satellite-bbframe.h.

Member Typedef Documentation

◆ BbFrameCallback

typedef void(* ns3::SatBbFrame::BbFrameCallback) (Ptr< SatBbFrame > bbFrame)

Callback signature for Ptr<SatBbFrame>.

Parameters
bbFrameThe BB frame.

Definition at line 213 of file satellite-bbframe.h.

◆ BbFrameMergeCallback

typedef void(* ns3::SatBbFrame::BbFrameMergeCallback) (Ptr< SatBbFrame > to, Ptr< SatBbFrame > from)

Callback signature for merging of two instances of SatBbFrame.

Parameters
toThe frame merged to.
toThe frame merged from.

Definition at line 220 of file satellite-bbframe.h.

◆ SatBbFramePayload_t

typedef std::vector<Ptr<Packet> > ns3::SatBbFrame::SatBbFramePayload_t

Define type SatBbFramePayload_t.

Definition at line 52 of file satellite-bbframe.h.

Constructor & Destructor Documentation

◆ SatBbFrame() [1/2]

ns3::SatBbFrame::SatBbFrame ( )

Default constructor.

Constructs BB frame with default ModCod and default frame type.

Definition at line 33 of file satellite-bbframe.cc.

◆ SatBbFrame() [2/2]

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.

Parameters
modCodUsed ModCod
typeType of the frame
confPointer 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.

◆ ~SatBbFrame()

ns3::SatBbFrame::~SatBbFrame ( )
virtual

Destructor fro BB frame.

Definition at line 93 of file satellite-bbframe.cc.

Member Function Documentation

◆ AddPayload()

uint32_t ns3::SatBbFrame::AddPayload ( Ptr< Packet >  packet)

Add payload (packet) to transmit buffer of this BB Frame info.

Parameters
packetPointer to packet wanted to add to transmit buffer
Returns
Space left bytes in transmit buffer after addition

Definition at line 106 of file satellite-bbframe.cc.

References GetSpaceLeftInBytes(), m_framePayload, and m_freeSpaceInBytes.

+ Here is the call graph for this function:

◆ Extend()

Time ns3::SatBbFrame::Extend ( Ptr< SatBbFrameConf conf)

Extent BB frame to the longest type.

Parameters
confPointer to BB frame configuration
Returns
Increase of the frame duration after extending it

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.

+ Here is the call graph for this function:

◆ GetDuration()

Time ns3::SatBbFrame::GetDuration ( ) const
inline

Get duration of the frame transmission.

Returns
duration of the frame transmission

Definition at line 159 of file satellite-bbframe.h.

References m_duration.

◆ GetFrameHeaderSize()

uint32_t ns3::SatBbFrame::GetFrameHeaderSize ( ) const
inline

Get header size of the frame.

Returns
Header size in bytes.

Definition at line 204 of file satellite-bbframe.h.

References m_headerSizeInBytes.

◆ GetFrameType()

SatEnums::SatBbFrameType_t ns3::SatBbFrame::GetFrameType ( ) const
inline

Get type of the frame.

Returns
Type of the frame

Definition at line 168 of file satellite-bbframe.h.

References m_frameType.

◆ GetMaxSpaceInBytes()

uint32_t ns3::SatBbFrame::GetMaxSpaceInBytes ( ) const

Get the maximum size of the BB Frame transmit buffer in bytes.

Returns
the maximum size of the BB Frame transmit buffer in bytes

Definition at line 141 of file satellite-bbframe.cc.

References m_maxSpaceInBytes.

◆ GetModcod()

SatEnums::SatModcod_t ns3::SatBbFrame::GetModcod ( void  ) const
inline

Get type of the frame.

Returns
Type of the frame

Definition at line 177 of file satellite-bbframe.h.

References m_modCod.

◆ GetOccupancy()

double ns3::SatBbFrame::GetOccupancy ( ) const

Get the occupancy of the of the BB Frame.

Returns
the occupancy of the BB Frame 0 - 1.

Definition at line 148 of file satellite-bbframe.cc.

References GetSpaceUsedInBytes(), and m_maxSpaceInBytes.

+ Here is the call graph for this function:

◆ GetOccupancyIfMerged()

double ns3::SatBbFrame::GetOccupancyIfMerged ( Ptr< SatBbFrame mergedFrame) const

Checks occupancy of the frame if given frame would been merged with this frame.

Parameters
mergedFrameAnother frame wanted to merge with this frame.
Returns
O, if frames cannot be merged, occupancy of the merged frame in otherwise.

Definition at line 155 of file satellite-bbframe.cc.

References GetSpaceUsedInBytes(), m_freeSpaceInBytes, and m_maxSpaceInBytes.

+ Here is the call graph for this function:

◆ GetPayload()

const SatBbFrame::SatBbFramePayload_t & ns3::SatBbFrame::GetPayload ( )

Get the data in the BB Frame info as container of the packet pointers.

Returns
Container having data as packet pointers.

Definition at line 99 of file satellite-bbframe.cc.

References m_framePayload.

◆ GetSliceId()

uint8_t ns3::SatBbFrame::GetSliceId ( ) const
inline

Get the slice ID of the BBFrame.

Returns
The slice ID of the BBFrame

Definition at line 186 of file satellite-bbframe.h.

References m_sliceId.

◆ GetSpaceLeftInBytes()

uint32_t ns3::SatBbFrame::GetSpaceLeftInBytes ( ) const

Get space left in BB frame transmit buffer in bytes.

Returns
space left in bytes in transmit buffer

Definition at line 127 of file satellite-bbframe.cc.

References m_freeSpaceInBytes.

Referenced by AddPayload().

+ Here is the caller graph for this function:

◆ GetSpaceUsedInBytes()

uint32_t ns3::SatBbFrame::GetSpaceUsedInBytes ( ) const

Get space used in BB frame transmit buffer in bytes.

Returns
space used in bytes in transmit buffer

Definition at line 134 of file satellite-bbframe.cc.

References m_freeSpaceInBytes, and m_maxSpaceInBytes.

Referenced by Extend(), GetOccupancy(), GetOccupancyIfMerged(), and Shrink().

+ Here is the caller graph for this function:

◆ GetSpectralEfficiency()

double ns3::SatBbFrame::GetSpectralEfficiency ( double  carrierBandwidthInHz) const

Get spectra efficiency of the frame.

Parameters
carrierBandwidthInHzCarrier bandwidth in hertz.
Returns

Definition at line 174 of file satellite-bbframe.cc.

References ns3::SatConstVariables::BITS_PER_BYTE, m_duration, and m_maxSpaceInBytes.

◆ MergeWithFrame()

bool ns3::SatBbFrame::MergeWithFrame ( Ptr< SatBbFrame mergedFrame,
TracedCallback< Ptr< SatBbFrame >, Ptr< SatBbFrame >>  mergeTraceCb 
)

Merge given frame with this frame.

Parameters
mergedFrameAnother frame to be merged with this frame.
mergeTraceCbLogging trace source for BB frame optimization.
Returns
true if merging done, false otherwise.

Definition at line 183 of file satellite-bbframe.cc.

References m_framePayload, and m_freeSpaceInBytes.

◆ SetSliceId()

void ns3::SatBbFrame::SetSliceId ( uint8_t  sliceId)
inline

Set the slice ID of the BBFrame.

Parameters
sliceIdThe slice ID of the BBFrame

Definition at line 195 of file satellite-bbframe.h.

References m_sliceId.

◆ Shrink()

Time ns3::SatBbFrame::Shrink ( Ptr< SatBbFrameConf conf)

Shrink BB frame to the shortest type possible according to current load in the frame.

Parameters
confPointer to BB frame configuration
Returns
Decrease of the frame duration after shrinking it

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.

+ Here is the call graph for this function:

Member Data Documentation

◆ m_duration

Time ns3::SatBbFrame::m_duration
private

Definition at line 229 of file satellite-bbframe.h.

Referenced by SatBbFrame(), Extend(), GetDuration(), GetSpectralEfficiency(), and Shrink().

◆ m_framePayload

SatBbFramePayload_t ns3::SatBbFrame::m_framePayload
private

Definition at line 228 of file satellite-bbframe.h.

Referenced by AddPayload(), GetPayload(), and MergeWithFrame().

◆ m_frameType

SatEnums::SatBbFrameType_t ns3::SatBbFrame::m_frameType
private

Definition at line 230 of file satellite-bbframe.h.

Referenced by Extend(), GetFrameType(), and Shrink().

◆ m_freeSpaceInBytes

uint32_t ns3::SatBbFrame::m_freeSpaceInBytes
private

◆ m_headerSizeInBytes

uint32_t ns3::SatBbFrame::m_headerSizeInBytes
private

Definition at line 227 of file satellite-bbframe.h.

Referenced by SatBbFrame(), GetFrameHeaderSize(), and Shrink().

◆ m_maxSpaceInBytes

uint32_t ns3::SatBbFrame::m_maxSpaceInBytes
private

◆ m_modCod

SatEnums::SatModcod_t ns3::SatBbFrame::m_modCod
private

Definition at line 223 of file satellite-bbframe.h.

Referenced by Extend(), GetModcod(), and Shrink().

◆ m_sliceId

uint8_t ns3::SatBbFrame::m_sliceId
private

Definition at line 224 of file satellite-bbframe.h.

Referenced by GetSliceId(), and SetSliceId().


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