SatReturnLinkEncapsulator class is used in the RTN link for RLE encapsulation and fragmentation of higher layer packets. More...
#include "satellite-return-link-encapsulator.h"
Public Member Functions | |
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 | DoDispose () |
Dispose of this class instance. 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... | |
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 msg (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< SatQueue > | GetQueue () |
Get the queue instance. More... | |
virtual uint32_t | GetTxBufferSizeInBytes () const |
Get the buffered packets for this encapsulator. 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... | |
Protected Member Functions | |
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 | |
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... | |
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... | |
SatReturnLinkEncapsulator class is used in the RTN link for RLE encapsulation and fragmentation of higher layer packets.
SatReturnLinkEncapsulator object is flow (UT address - flow id) specific and its entities are located at both UT (encapsulation, fragmentation) and GW (decapsulation, defragmentation). Return link encapsulators/decapsulators are created dynamically when first needed (when a packet is received for this flow).
Definition at line 49 of file satellite-return-link-encapsulator.h.
ns3::SatReturnLinkEncapsulator::SatReturnLinkEncapsulator | ( | ) |
Default constructor, not used.
Default constuctor is not meant to be used!
Definition at line 43 of file satellite-return-link-encapsulator.cc.
ns3::SatReturnLinkEncapsulator::SatReturnLinkEncapsulator | ( | 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 61 of file satellite-return-link-encapsulator.cc.
References ns3::SatPPduHeader::GetMaxHeaderSizeInBytes(), and m_minTxOpportunity.
|
virtual |
Destructor for SatReturnLinkEncapsulator.
Definition at line 88 of file satellite-return-link-encapsulator.cc.
|
virtual |
Dispose of this class instance.
Reimplemented from ns3::SatBaseEncapsulator.
Reimplemented in ns3::SatReturnLinkEncapsulatorArq.
Definition at line 103 of file satellite-return-link-encapsulator.cc.
References ns3::SatBaseEncapsulator::DoDispose().
Referenced by ns3::SatReturnLinkEncapsulatorArq::DoDispose().
|
virtual |
Enqueue a Higher Layer packet to txBuffer.
p | To be buffered packet |
dest | Target MAC address |
TODO: This is the place to encapsulate the higher layer packet with Addressed Link (AL) header, if needed.
Reimplemented from ns3::SatBaseEncapsulator.
Definition at line 111 of file satellite-return-link-encapsulator.cc.
References ns3::SatEncapPduStatusTag::FULL_PDU, ns3::SatBaseEncapsulator::m_decapAddress, ns3::SatBaseEncapsulator::m_encapAddress, ns3::SatBaseEncapsulator::m_txQueue, MAX_HL_PDU_PACKET_SIZE, ns3::SatMacTag::SetDestAddress(), ns3::SatMacTag::SetSourceAddress(), and ns3::SatEncapPduStatusTag::SetStatus().
|
virtual |
Get minimum Tx opportunity in bytes, which takes the assumed header sizes into account.
Reimplemented from ns3::SatBaseEncapsulator.
Definition at line 535 of file satellite-return-link-encapsulator.cc.
References m_minTxOpportunity.
Referenced by ns3::SatReturnLinkEncapsulatorArq::NotifyTxOpportunity(), and NotifyTxOpportunity().
|
protected |
Get new packet performs the RLE fragmentation and encapsulation for a one single packet.
Returns NULL packet if a suitable packet is not created.
Definition at line 216 of file satellite-return-link-encapsulator.cc.
References ns3::SatEncapPduStatusTag::CONTINUATION_PDU, ns3::SatEncapPduStatusTag::END_PDU, ns3::SatEncapPduStatusTag::FULL_PDU, ns3::SatPPduHeader::GetHeaderSizeInBytes(), ns3::SatEncapPduStatusTag::GetStatus(), IncreaseFragmentId(), m_txFragmentId, ns3::SatBaseEncapsulator::m_txQueue, ns3::SatPPduHeader::SetEndIndicator(), ns3::SatPPduHeader::SetFragmentId(), ns3::SatPPduHeader::SetPPduLength(), ns3::SatPPduHeader::SetStartIndicator(), ns3::SatEncapPduStatusTag::SetStatus(), ns3::SatPPduHeader::SetTotalLength(), and ns3::SatEncapPduStatusTag::START_PDU.
Referenced by ns3::SatReturnLinkEncapsulatorArq::NotifyTxOpportunity(), and NotifyTxOpportunity().
|
static |
Get the type ID.
Definition at line 94 of file satellite-return-link-encapsulator.cc.
|
protected |
Method increases the fragment id by one.
If the maximum fragment id is reached, it is reset to zero.
Definition at line 512 of file satellite-return-link-encapsulator.cc.
References m_txFragmentId, and MAX_FRAGMENT_ID.
Referenced by GetNewRlePdu().
|
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 |
Reimplemented from ns3::SatBaseEncapsulator.
Reimplemented in ns3::SatReturnLinkEncapsulatorArq.
Definition at line 149 of file satellite-return-link-encapsulator.cc.
References GetMinTxOpportunityInBytes(), GetNewRlePdu(), ns3::SatBaseEncapsulator::GetTxBufferSizeInBytes(), ns3::SatBaseEncapsulator::m_additionalHeaderSize, ns3::SatBaseEncapsulator::m_decapAddress, ns3::SatBaseEncapsulator::m_destE2EAddress, ns3::SatBaseEncapsulator::m_encapAddress, ns3::SatBaseEncapsulator::m_flowId, ns3::SatBaseEncapsulator::m_sourceE2EAddress, ns3::SatBaseEncapsulator::m_txQueue, MAX_PPDU_PACKET_SIZE, ns3::SatMacTag::SetDestAddress(), ns3::SatAddressE2ETag::SetE2EDestAddress(), ns3::SatAddressE2ETag::SetE2ESourceAddress(), ns3::SatFlowIdTag::SetFlowId(), and ns3::SatMacTag::SetSourceAddress().
|
protectedvirtual |
Process the reception of individual RLE PDUs.
p | Packet to be received |
Definition at line 416 of file satellite-return-link-encapsulator.cc.
References ns3::SatPPduHeader::GetEndIndicator(), ns3::SatPPduHeader::GetFragmentId(), ns3::SatPPduHeader::GetPPduLength(), ns3::SatPPduHeader::GetStartIndicator(), ns3::SatPPduHeader::GetTotalLength(), m_currRxFragmentId, m_currRxPacketFragment, m_currRxPacketFragmentBytes, m_currRxPacketSize, ns3::SatBaseEncapsulator::m_decapAddress, ns3::SatBaseEncapsulator::m_encapAddress, ns3::SatBaseEncapsulator::m_rxCallback, and Reset().
Referenced by ns3::SatReturnLinkEncapsulatorArq::ReassembleAndReceive(), and ReceivePdu().
|
virtual |
Receive a control msg (ARQ ACK)
ack | ACK control message pointer received from lower layer |
The base encapsulator should not be used at receiving control packets at all! This functionality is implemented in the inherited classes.
Reimplemented from ns3::SatBaseEncapsulator.
Reimplemented in ns3::SatReturnLinkEncapsulatorArq.
Definition at line 500 of file satellite-return-link-encapsulator.cc.
|
virtual |
Receive a packet, thus decapsulate and defragment/deconcatenate if needed.
The decapsulated/defragmented HL PDU is forwarded back to LLC and to upper layer.
p | packet pointer received from lower layer |
Reimplemented from ns3::SatBaseEncapsulator.
Reimplemented in ns3::SatReturnLinkEncapsulatorArq.
Definition at line 387 of file satellite-return-link-encapsulator.cc.
References ns3::SatMacTag::GetDestAddress(), ns3::SatBaseEncapsulator::m_decapAddress, and ProcessPdu().
|
protected |
Reset defragmentation variables.
Definition at line 524 of file satellite-return-link-encapsulator.cc.
References m_currRxFragmentId, m_currRxPacketFragment, m_currRxPacketFragmentBytes, and m_currRxPacketSize.
Referenced by ProcessPdu().
|
protected |
Current fragment id in the reassembly process.
Definition at line 164 of file satellite-return-link-encapsulator.h.
Referenced by ProcessPdu(), and Reset().
|
protected |
Current packet in the reassembly process.
Definition at line 169 of file satellite-return-link-encapsulator.h.
Referenced by ProcessPdu(), and Reset().
|
protected |
Currently received bytes of the fragmented packet.
Definition at line 179 of file satellite-return-link-encapsulator.h.
Referenced by ProcessPdu(), and Reset().
|
protected |
The total size of the ALPDU size reassembly process.
Definition at line 174 of file satellite-return-link-encapsulator.h.
Referenced by ProcessPdu(), and Reset().
|
protected |
Minimum Tx opportunity.
Definition at line 184 of file satellite-return-link-encapsulator.h.
Referenced by SatReturnLinkEncapsulator(), and GetMinTxOpportunityInBytes().
|
protected |
Fragment id used in the packet transmissions.
Definition at line 160 of file satellite-return-link-encapsulator.h.
Referenced by GetNewRlePdu(), and IncreaseFragmentId().
|
protected |
The fragment is described with 3 bits, thus the maximum fragment id is 8.
Definition at line 190 of file satellite-return-link-encapsulator.h.
Referenced by IncreaseFragmentId().
|
protected |
The maximum packet size is described with 12 bits, thus, the maximum HL packet size is 4096 bytes.
Definition at line 202 of file satellite-return-link-encapsulator.h.
Referenced by EnquePdu().
|
protected |
The maximum PPDU fragment size is described with 11 bits, thus, the maximum fragment size is 2048 bytes.
Definition at line 196 of file satellite-return-link-encapsulator.h.
Referenced by NotifyTxOpportunity().