ns3::SatReturnLinkEncapsulatorArq Class Reference

SatReturnLinkEncapsulatorArq class is inherited from the SatReturnLinkEncapsulator class, which is used in RTN link for encapsulation and fragmentation of higher layer packets. More...

#include "satellite-return-link-encapsulator-arq.h"

+ Inheritance diagram for ns3::SatReturnLinkEncapsulatorArq:
+ Collaboration diagram for ns3::SatReturnLinkEncapsulatorArq:

Public Member Functions

 SatReturnLinkEncapsulatorArq ()
 Default constructor, not used. More...
 
 SatReturnLinkEncapsulatorArq (Mac48Address encapAddress, Mac48Address decapAddress, Mac48Address sourceE2EAddress, Mac48Address destE2EAddress, uint8_t rcIndex, uint32_t additionalHeaderSize=0)
 Constructor. More...
 
virtual ~SatReturnLinkEncapsulatorArq ()
 Destructor for SatReturnLinkEncapsulatorArq. More...
 
virtual void DoDispose ()
 Dispose of this class instance. More...
 
TypeId GetInstanceTypeId (void) const
 
virtual uint32_t GetTxBufferSizeInBytes () const
 Get the buffered packets for this encapsulator. More...
 
virtual Ptr< Packet > NotifyTxOpportunity (uint32_t bytes, uint32_t &bytesLeft, uint32_t &nextMinTxO)
 Notify a Tx opportunity to this encapsulator. More...
 
virtual void ReceiveAck (Ptr< SatArqAckMessage > ack)
 Receive a control message (ARQ ACK) More...
 
virtual void ReceivePdu (Ptr< Packet > p)
 Receive a packet, thus decapsulate and defragment/deconcatenate if needed. More...
 
- Public Member Functions inherited from ns3::SatBaseEncapsulator
 SatBaseEncapsulator ()
 Default constructor not used. More...
 
 SatBaseEncapsulator (Mac48Address encapAddress, Mac48Address decapAddress, Mac48Address sourceE2EAddress, Mac48Address destE2EAddress, uint8_t flowId, uint32_t additionalHeaderSize=0)
 Constructor. More...
 
virtual ~SatBaseEncapsulator ()
 Destructor for SatBaseEncapsulator. More...
 
virtual Time GetHolDelay () const
 Get Head-of-Line packet buffering delay. More...
 
Ptr< SatQueueGetQueue ()
 Get the queue instance. More...
 
void SetCtrlMsgCallback (SatBaseEncapsulator::SendCtrlCallback cb)
 
void SetQueue (Ptr< SatQueue > queue)
 Set the used queue from outside. More...
 
void SetReceiveCallback (ReceiveCallback cb)
 Method to set receive callback. More...
 

Static Public Member Functions

static TypeId GetTypeId (void)
 Get the type ID. More...
 
- Static Public Member Functions inherited from ns3::SatBaseEncapsulator
static TypeId GetTypeId (void)
 Get the type ID. More...
 

Private Member Functions

void ArqReTxTimerExpired (uint8_t seqNo)
 ARQ Tx timer has expired. More...
 
void CleanUp (uint8_t sequenceNumber)
 Clean-up a certain sequence number. More...
 
uint32_t ConvertSeqNo (uint8_t seqNo) const
 Convert the 8-bit sequence number value from ARQ header into 32-bit continuous sequence number stream at the receiver. More...
 
void ReassembleAndReceive ()
 Reassemble and receive the received PDUs if possible. More...
 
void RxWaitingTimerExpired (uint32_t sn)
 Rx waiting timer for a PDU has expired. More...
 
void SendAck (uint8_t seqNo) const
 Send ACK for a given sequence number. More...
 

Private Attributes

uint32_t m_arqHeaderSize
 ARQ header size in Bytes. More...
 
uint32_t m_arqWindowSize
 ARQ window size, i.e. More...
 
uint32_t m_maxNoOfRetransmissions
 Maximum number of retransmissions. More...
 
uint32_t m_maxRtnArqSegmentSize
 Max RTN link ARQ segment size. More...
 
uint32_t m_nextExpectedSeqNo
 Next expected sequence number at the packet reception. More...
 
std::map< uint32_t, Ptr< SatArqBufferContext > > m_reorderingBuffer
 key = sequence number value = RLE packet More...
 
Time m_retransmissionTimer
 Retransmission timer, i.e. More...
 
std::map< uint8_t, Ptr< SatArqBufferContext > > m_retxBuffer
 
uint32_t m_retxBufferSize
 
Time m_rxWaitingTimer
 Waiting time for waiting a certain SN to be received. More...
 
Ptr< SatArqSequenceNumberm_seqNo
 Sequence number handler. More...
 
std::map< uint8_t, Ptr< SatArqBufferContext > > m_txedBuffer
 Transmitted and retransmission context buffer. More...
 
uint32_t m_txedBufferSize
 

Additional Inherited Members

- Public Types inherited from ns3::SatBaseEncapsulator
typedef Callback< void, Ptr< Packet >, Mac48Address, Mac48Address > ReceiveCallback
 Callback to send packet to lower layer. More...
 
typedef Callback< bool, Ptr< SatControlMessage >, const Address & > SendCtrlCallback
 Control msg sending callback. More...
 
- Protected Attributes inherited from ns3::SatBaseEncapsulator
uint32_t m_additionalHeaderSize
 Additional value in to take into account when pulling packets to represent E2E tags. More...
 
SendCtrlCallback m_ctrlCallback
 Callback to send control messages. More...
 
Mac48Address m_decapAddress
 
Mac48Address m_destE2EAddress
 
Mac48Address m_encapAddress
 Source and destination mac addresses. More...
 
uint8_t m_flowId
 Flow identifier. More...
 
ReceiveCallback m_rxCallback
 Receive callback. More...
 
Mac48Address m_sourceE2EAddress
 
Ptr< SatQueuem_txQueue
 Used queue in satellite encapsulator. More...
 

Detailed Description

SatReturnLinkEncapsulatorArq class is inherited from the SatReturnLinkEncapsulator class, which is used in RTN link for encapsulation and fragmentation of higher layer packets.

This class implements the ARQ retransmission logic in both transmission and reception side for RLE.

Implemented algorithm is based on Selective Repeat ARQ. Retransmission logic is based on a set of timers and added increasing sequence numbers for each sent packet. When a packet is received, and ACK is sent to the receiver with a proper sequence number.

Definition at line 52 of file satellite-return-link-encapsulator-arq.h.

Constructor & Destructor Documentation

◆ SatReturnLinkEncapsulatorArq() [1/2]

ns3::SatReturnLinkEncapsulatorArq::SatReturnLinkEncapsulatorArq ( )

Default constructor, not used.

Default constructor is not meant to be used!

Definition at line 44 of file satellite-return-link-encapsulator-arq.cc.

◆ SatReturnLinkEncapsulatorArq() [2/2]

ns3::SatReturnLinkEncapsulatorArq::SatReturnLinkEncapsulatorArq ( Mac48Address  encapAddress,
Mac48Address  decapAddress,
Mac48Address  sourceE2EAddress,
Mac48Address  destE2EAddress,
uint8_t  rcIndex,
uint32_t  additionalHeaderSize = 0 
)

Constructor.

Parameters
encapAddressMAC addressd of encapsulator
decapAddressMAC addressd of decapsulator
sourceE2EAddressE2E source MAC addressd of packets (used to set SatAddressE2ETag)
destE2EAddressE2E destination MAC addressd of packets (used to set SatAddressE2ETag)
rcIndexRC index
additionalHeaderSizeAdditional value in to take into account when pulling packets to represent E2E tags

Definition at line 65 of file satellite-return-link-encapsulator-arq.cc.

References m_arqWindowSize, and m_seqNo.

◆ ~SatReturnLinkEncapsulatorArq()

ns3::SatReturnLinkEncapsulatorArq::~SatReturnLinkEncapsulatorArq ( )
virtual

Destructor for SatReturnLinkEncapsulatorArq.

Definition at line 96 of file satellite-return-link-encapsulator-arq.cc.

Member Function Documentation

◆ ArqReTxTimerExpired()

void ns3::SatReturnLinkEncapsulatorArq::ArqReTxTimerExpired ( uint8_t  seqNo)
private

ARQ Tx timer has expired.

The PDU will be flushed, if the maximum retransmissions has been reached. Otherwise the packet will be resent.

Parameters
seqNoSequence number

Definition at line 342 of file satellite-return-link-encapsulator-arq.cc.

References CleanUp(), ns3::SatBaseEncapsulator::m_encapAddress, m_maxNoOfRetransmissions, m_retxBuffer, m_retxBufferSize, and m_txedBuffer.

Referenced by NotifyTxOpportunity().

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

◆ CleanUp()

void ns3::SatReturnLinkEncapsulatorArq::CleanUp ( uint8_t  sequenceNumber)
private

Clean-up a certain sequence number.

Parameters
sequenceNumberSequence number

Definition at line 387 of file satellite-return-link-encapsulator-arq.cc.

References m_retxBuffer, m_retxBufferSize, m_seqNo, m_txedBuffer, and m_txedBufferSize.

Referenced by ArqReTxTimerExpired(), and ReceiveAck().

+ Here is the caller graph for this function:

◆ ConvertSeqNo()

uint32_t ns3::SatReturnLinkEncapsulatorArq::ConvertSeqNo ( uint8_t  seqNo) const
private

Convert the 8-bit sequence number value from ARQ header into 32-bit continuous sequence number stream at the receiver.

Parameters
seqNo8-bit sequence number
Returns
32-bit sequence number

Definition at line 549 of file satellite-return-link-encapsulator-arq.cc.

References m_arqWindowSize, and m_nextExpectedSeqNo.

Referenced by ReceivePdu().

+ Here is the caller graph for this function:

◆ DoDispose()

void ns3::SatReturnLinkEncapsulatorArq::DoDispose ( void  )
virtual

Dispose of this class instance.

Reimplemented from ns3::SatReturnLinkEncapsulator.

Definition at line 153 of file satellite-return-link-encapsulator-arq.cc.

References ns3::SatReturnLinkEncapsulator::DoDispose(), m_reorderingBuffer, m_retxBuffer, m_seqNo, and m_txedBuffer.

+ Here is the call graph for this function:

◆ GetInstanceTypeId()

TypeId ns3::SatReturnLinkEncapsulatorArq::GetInstanceTypeId ( void  ) const

Definition at line 147 of file satellite-return-link-encapsulator-arq.cc.

References GetTypeId().

+ Here is the call graph for this function:

◆ GetTxBufferSizeInBytes()

uint32_t ns3::SatReturnLinkEncapsulatorArq::GetTxBufferSizeInBytes ( ) const
virtual

Get the buffered packets for this encapsulator.

Returns
uint32_t buffered bytes

Reimplemented from ns3::SatBaseEncapsulator.

Definition at line 655 of file satellite-return-link-encapsulator-arq.cc.

References m_retxBufferSize, and ns3::SatBaseEncapsulator::m_txQueue.

Referenced by NotifyTxOpportunity().

+ Here is the caller graph for this function:

◆ GetTypeId()

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

Get the type ID.

Returns
the object TypeId

Definition at line 102 of file satellite-return-link-encapsulator-arq.cc.

References m_arqHeaderSize, m_arqWindowSize, m_maxNoOfRetransmissions, m_maxRtnArqSegmentSize, m_retransmissionTimer, and m_rxWaitingTimer.

Referenced by GetInstanceTypeId().

+ Here is the caller graph for this function:

◆ NotifyTxOpportunity()

Ptr< Packet > ns3::SatReturnLinkEncapsulatorArq::NotifyTxOpportunity ( uint32_t  bytes,
uint32_t &  bytesLeft,
uint32_t &  nextMinTxO 
)
virtual

Notify a Tx opportunity to this encapsulator.

Parameters
bytesNotified tx opportunity bytes from lower layer
&bytesLeftBytes left after this TxOpportunity in txBuffer
&nextMinTxOMinimum TxO after this TxO
Returns
A RLE PDU pointer

Give priority to the retransmissions. Whenever, the retransmission timer is expired, packet is moved to the retransmission buffer from the transmitted buffer.

Reimplemented from ns3::SatReturnLinkEncapsulator.

Definition at line 192 of file satellite-return-link-encapsulator-arq.cc.

References ArqReTxTimerExpired(), ns3::SatReturnLinkEncapsulator::GetMinTxOpportunityInBytes(), ns3::SatReturnLinkEncapsulator::GetNewRlePdu(), GetTxBufferSizeInBytes(), m_arqHeaderSize, ns3::SatBaseEncapsulator::m_decapAddress, ns3::SatBaseEncapsulator::m_destE2EAddress, ns3::SatBaseEncapsulator::m_encapAddress, ns3::SatBaseEncapsulator::m_flowId, m_maxRtnArqSegmentSize, m_retransmissionTimer, m_retxBuffer, m_retxBufferSize, m_seqNo, ns3::SatBaseEncapsulator::m_sourceE2EAddress, m_txedBuffer, m_txedBufferSize, ns3::SatBaseEncapsulator::m_txQueue, ns3::SatMacTag::SetDestAddress(), ns3::SatAddressE2ETag::SetE2EDestAddress(), ns3::SatAddressE2ETag::SetE2ESourceAddress(), ns3::SatFlowIdTag::SetFlowId(), ns3::SatArqHeader::SetSeqNo(), and ns3::SatMacTag::SetSourceAddress().

+ Here is the call graph for this function:

◆ ReassembleAndReceive()

void ns3::SatReturnLinkEncapsulatorArq::ReassembleAndReceive ( )
private

Reassemble and receive the received PDUs if possible.

As long as the PDU is the next expected one, process the PDU and erase it.

Definition at line 587 of file satellite-return-link-encapsulator-arq.cc.

References m_nextExpectedSeqNo, m_reorderingBuffer, and ns3::SatReturnLinkEncapsulator::ProcessPdu().

Referenced by ReceivePdu(), and RxWaitingTimerExpired().

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

◆ ReceiveAck()

void ns3::SatReturnLinkEncapsulatorArq::ReceiveAck ( Ptr< SatArqAckMessage ack)
virtual

Receive a control message (ARQ ACK)

Parameters
ackACK control message pointer received from lower layer

Take the packet away from the transmitted or retransmission buffer and release the sequence number for further use.

Reimplemented from ns3::SatReturnLinkEncapsulator.

Definition at line 418 of file satellite-return-link-encapsulator-arq.cc.

References CleanUp(), and ns3::SatBaseEncapsulator::m_encapAddress.

+ Here is the call graph for this function:

◆ ReceivePdu()

void ns3::SatReturnLinkEncapsulatorArq::ReceivePdu ( Ptr< Packet >  p)
virtual

Receive a packet, thus decapsulate and defragment/deconcatenate if needed.

The decapsuled/defragmented HL PDU is forwarded back to LLC and to upper layer.

Parameters
ppacket pointer received from lower layer

Reimplemented from ns3::SatReturnLinkEncapsulator.

Definition at line 435 of file satellite-return-link-encapsulator-arq.cc.

References ConvertSeqNo(), ns3::SatMacTag::GetDestAddress(), ns3::SatArqHeader::GetSeqNo(), ns3::SatBaseEncapsulator::m_decapAddress, ns3::SatBaseEncapsulator::m_encapAddress, m_nextExpectedSeqNo, m_reorderingBuffer, m_rxWaitingTimer, ReassembleAndReceive(), RxWaitingTimerExpired(), and SendAck().

+ Here is the call graph for this function:

◆ RxWaitingTimerExpired()

void ns3::SatReturnLinkEncapsulatorArq::RxWaitingTimerExpired ( uint32_t  sn)
private

Rx waiting timer for a PDU has expired.

Parameters
snSequence number

Definition at line 632 of file satellite-return-link-encapsulator-arq.cc.

References ns3::SatBaseEncapsulator::m_encapAddress, m_reorderingBuffer, and ReassembleAndReceive().

Referenced by ReceivePdu().

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

◆ SendAck()

void ns3::SatReturnLinkEncapsulatorArq::SendAck ( uint8_t  seqNo) const
private

Send ACK for a given sequence number.

Parameters
seqNoSequence number

RLE sends the ACK control message via a callback to SatNetDevice of the GW to the GSE control buffer. The transmission assumptions for the control messages are currently

  • Default (most robust) MODCOD
  • Strict priority

Definition at line 663 of file satellite-return-link-encapsulator-arq.cc.

References ns3::SatBaseEncapsulator::m_ctrlCallback, ns3::SatBaseEncapsulator::m_decapAddress, ns3::SatBaseEncapsulator::m_encapAddress, and ns3::SatBaseEncapsulator::m_flowId.

Referenced by ReceivePdu().

+ Here is the caller graph for this function:

Member Data Documentation

◆ m_arqHeaderSize

uint32_t ns3::SatReturnLinkEncapsulatorArq::m_arqHeaderSize
private

ARQ header size in Bytes.

Definition at line 202 of file satellite-return-link-encapsulator-arq.h.

Referenced by GetTypeId(), and NotifyTxOpportunity().

◆ m_arqWindowSize

uint32_t ns3::SatReturnLinkEncapsulatorArq::m_arqWindowSize
private

ARQ window size, i.e.

how many sequential sequence numbers may be in use simultaneously.

Definition at line 197 of file satellite-return-link-encapsulator-arq.h.

Referenced by SatReturnLinkEncapsulatorArq(), ConvertSeqNo(), and GetTypeId().

◆ m_maxNoOfRetransmissions

uint32_t ns3::SatReturnLinkEncapsulatorArq::m_maxNoOfRetransmissions
private

Maximum number of retransmissions.

Definition at line 185 of file satellite-return-link-encapsulator-arq.h.

Referenced by ArqReTxTimerExpired(), and GetTypeId().

◆ m_maxRtnArqSegmentSize

uint32_t ns3::SatReturnLinkEncapsulatorArq::m_maxRtnArqSegmentSize
private

Max RTN link ARQ segment size.

Definition at line 180 of file satellite-return-link-encapsulator-arq.h.

Referenced by GetTypeId(), and NotifyTxOpportunity().

◆ m_nextExpectedSeqNo

uint32_t ns3::SatReturnLinkEncapsulatorArq::m_nextExpectedSeqNo
private

Next expected sequence number at the packet reception.

Definition at line 207 of file satellite-return-link-encapsulator-arq.h.

Referenced by ConvertSeqNo(), ReassembleAndReceive(), and ReceivePdu().

◆ m_reorderingBuffer

std::map<uint32_t, Ptr<SatArqBufferContext> > ns3::SatReturnLinkEncapsulatorArq::m_reorderingBuffer
private

key = sequence number value = RLE packet

Definition at line 218 of file satellite-return-link-encapsulator-arq.h.

Referenced by DoDispose(), ReassembleAndReceive(), ReceivePdu(), and RxWaitingTimerExpired().

◆ m_retransmissionTimer

Time ns3::SatReturnLinkEncapsulatorArq::m_retransmissionTimer
private

Retransmission timer, i.e.

when to retransmit a packet if a ACK has not been received.

Definition at line 191 of file satellite-return-link-encapsulator-arq.h.

Referenced by GetTypeId(), and NotifyTxOpportunity().

◆ m_retxBuffer

std::map<uint8_t, Ptr<SatArqBufferContext> > ns3::SatReturnLinkEncapsulatorArq::m_retxBuffer
private

◆ m_retxBufferSize

uint32_t ns3::SatReturnLinkEncapsulatorArq::m_retxBufferSize
private

◆ m_rxWaitingTimer

Time ns3::SatReturnLinkEncapsulatorArq::m_rxWaitingTimer
private

Waiting time for waiting a certain SN to be received.

Definition at line 212 of file satellite-return-link-encapsulator-arq.h.

Referenced by GetTypeId(), and ReceivePdu().

◆ m_seqNo

Ptr<SatArqSequenceNumber> ns3::SatReturnLinkEncapsulatorArq::m_seqNo
private

Sequence number handler.

Definition at line 167 of file satellite-return-link-encapsulator-arq.h.

Referenced by SatReturnLinkEncapsulatorArq(), CleanUp(), DoDispose(), and NotifyTxOpportunity().

◆ m_txedBuffer

std::map<uint8_t, Ptr<SatArqBufferContext> > ns3::SatReturnLinkEncapsulatorArq::m_txedBuffer
private

Transmitted and retransmission context buffer.

Definition at line 172 of file satellite-return-link-encapsulator-arq.h.

Referenced by ArqReTxTimerExpired(), CleanUp(), DoDispose(), and NotifyTxOpportunity().

◆ m_txedBufferSize

uint32_t ns3::SatReturnLinkEncapsulatorArq::m_txedBufferSize
private

Definition at line 175 of file satellite-return-link-encapsulator-arq.h.

Referenced by CleanUp(), and NotifyTxOpportunity().


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