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"
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::SatReturnLinkEncapsulator | |
SatReturnLinkEncapsulator () | |
Default constructor, not used. More... | |
SatReturnLinkEncapsulator (Mac48Address encapAddress, Mac48Address decapAddress, Mac48Address sourceE2EAddress, Mac48Address destE2EAddress, uint8_t rcIndex, uint32_t additionalHeaderSize=0) | |
Constructor. More... | |
virtual | ~SatReturnLinkEncapsulator () |
Destructor for SatReturnLinkEncapsulator. More... | |
virtual void | EnquePdu (Ptr< Packet > p, Mac48Address dest) |
Enqueue a Higher Layer packet to txBuffer. More... | |
virtual uint32_t | GetMinTxOpportunityInBytes () const |
Get minimum Tx opportunity in bytes, which takes the assumed header sizes into account. 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< SatQueue > | GetQueue () |
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::SatReturnLinkEncapsulator | |
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< SatArqSequenceNumber > | m_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 Member Functions inherited from ns3::SatReturnLinkEncapsulator | |
Ptr< Packet > | GetNewRlePdu (uint32_t txOpportunityBytes, uint32_t maxRlePduSize, uint32_t additionalHeaderSize=0) |
Get new packet performs the RLE fragmentation and encapsulation for a one single packet. More... | |
void | IncreaseFragmentId () |
Method increases the fragment id by one. More... | |
virtual void | ProcessPdu (Ptr< Packet > p) |
Process the reception of individual RLE PDUs. More... | |
void | Reset () |
Reset defragmentation variables. More... | |
Protected Attributes inherited from ns3::SatReturnLinkEncapsulator | |
uint32_t | m_currRxFragmentId |
Current fragment id in the reassembly process. More... | |
Ptr< Packet > | m_currRxPacketFragment |
Current packet in the reassembly process. More... | |
uint32_t | m_currRxPacketFragmentBytes |
Currently received bytes of the fragmented packet. More... | |
uint32_t | m_currRxPacketSize |
The total size of the ALPDU size reassembly process. More... | |
uint32_t | m_minTxOpportunity |
Minimum Tx opportunity. More... | |
uint32_t | m_txFragmentId |
Fragment id used in the packet transmissions. More... | |
const uint32_t | MAX_FRAGMENT_ID |
The fragment is described with 3 bits, thus the maximum fragment id is 8. More... | |
const uint32_t | MAX_HL_PDU_PACKET_SIZE |
The maximum packet size is described with 12 bits, thus, the maximum HL packet size is 4096 bytes. More... | |
const uint32_t | MAX_PPDU_PACKET_SIZE |
The maximum PPDU fragment size is described with 11 bits, thus, the maximum fragment size is 2048 bytes. 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< SatQueue > | m_txQueue |
Used queue in satellite encapsulator. More... | |
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.
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.
ns3::SatReturnLinkEncapsulatorArq::SatReturnLinkEncapsulatorArq | ( | Mac48Address | encapAddress, |
Mac48Address | decapAddress, | ||
Mac48Address | sourceE2EAddress, | ||
Mac48Address | destE2EAddress, | ||
uint8_t | rcIndex, | ||
uint32_t | additionalHeaderSize = 0 |
||
) |
Constructor.
encapAddress | MAC addressd of encapsulator |
decapAddress | MAC addressd of decapsulator |
sourceE2EAddress | E2E source MAC addressd of packets (used to set SatAddressE2ETag) |
destE2EAddress | E2E destination MAC addressd of packets (used to set SatAddressE2ETag) |
rcIndex | RC index |
additionalHeaderSize | Additional 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.
|
virtual |
Destructor for SatReturnLinkEncapsulatorArq.
Definition at line 96 of file satellite-return-link-encapsulator-arq.cc.
|
private |
ARQ Tx timer has expired.
The PDU will be flushed, if the maximum retransmissions has been reached. Otherwise the packet will be resent.
seqNo | Sequence 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().
|
private |
Clean-up a certain sequence number.
sequenceNumber | Sequence 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().
|
private |
Convert the 8-bit sequence number value from ARQ header into 32-bit continuous sequence number stream at the receiver.
seqNo | 8-bit sequence number |
Definition at line 549 of file satellite-return-link-encapsulator-arq.cc.
References m_arqWindowSize, and m_nextExpectedSeqNo.
Referenced by ReceivePdu().
|
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.
TypeId ns3::SatReturnLinkEncapsulatorArq::GetInstanceTypeId | ( | void | ) | const |
Definition at line 147 of file satellite-return-link-encapsulator-arq.cc.
References GetTypeId().
|
virtual |
Get the buffered packets for this encapsulator.
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().
|
static |
Get the type ID.
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().
|
virtual |
Notify a Tx opportunity to this encapsulator.
bytes | Notified tx opportunity bytes from lower layer |
&bytesLeft | Bytes left after this TxOpportunity in txBuffer |
&nextMinTxO | Minimum TxO after this TxO |
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().
|
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().
|
virtual |
Receive a control message (ARQ ACK)
ack | ACK 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.
|
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.
p | packet 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().
|
private |
Rx waiting timer for a PDU has expired.
sn | Sequence 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().
|
private |
Send ACK for a given sequence number.
seqNo | Sequence 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
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().
|
private |
ARQ header size in Bytes.
Definition at line 202 of file satellite-return-link-encapsulator-arq.h.
Referenced by GetTypeId(), and NotifyTxOpportunity().
|
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().
|
private |
Maximum number of retransmissions.
Definition at line 185 of file satellite-return-link-encapsulator-arq.h.
Referenced by ArqReTxTimerExpired(), and GetTypeId().
|
private |
Max RTN link ARQ segment size.
Definition at line 180 of file satellite-return-link-encapsulator-arq.h.
Referenced by GetTypeId(), and NotifyTxOpportunity().
|
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().
|
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().
|
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().
|
private |
Definition at line 173 of file satellite-return-link-encapsulator-arq.h.
Referenced by ArqReTxTimerExpired(), CleanUp(), DoDispose(), and NotifyTxOpportunity().
|
private |
Definition at line 174 of file satellite-return-link-encapsulator-arq.h.
Referenced by ArqReTxTimerExpired(), CleanUp(), GetTxBufferSizeInBytes(), and NotifyTxOpportunity().
|
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().
|
private |
Sequence number handler.
Definition at line 167 of file satellite-return-link-encapsulator-arq.h.
Referenced by SatReturnLinkEncapsulatorArq(), CleanUp(), DoDispose(), and NotifyTxOpportunity().
|
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().
|
private |
Definition at line 175 of file satellite-return-link-encapsulator-arq.h.
Referenced by CleanUp(), and NotifyTxOpportunity().