SatGenericStreamEncapsulator class is used in the FWD link for GSE encapsulation and fragmentation of higher layer packets. More...
#include "satellite-generic-stream-encapsulator.h"
Public Member Functions | |
SatGenericStreamEncapsulator () | |
Default constructor, not used. More... | |
SatGenericStreamEncapsulator (Mac48Address encapAddress, Mac48Address decapAddress, Mac48Address sourceE2EAddress, Mac48Address destE2EAddress, uint8_t flowId, uint32_t additionalHeaderSize=0) | |
Constructor. More... | |
virtual | ~SatGenericStreamEncapsulator () |
Destructor for SatGenericStreamEncapsulator. 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 | 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... | |
virtual void | ReceiveAck (Ptr< SatArqAckMessage > ack) |
Receive a control message (ARQ ACK) 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 > | GetNewGsePdu (uint32_t txOpportunityBytes, uint32_t maxGsePduSize, uint32_t additionalHeaderSize=0) |
Get new packet performs the GSE 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 GSE 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_maxGsePduSize |
Maximum GSE PDU size. More... | |
uint32_t | m_minGseTxOpportunity |
If the GSE opportunity is smaller than this, a NULL packet is returned. More... | |
uint32_t | m_txFragmentId |
Fragment id used in the packet transmissions. 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... | |
Static Protected Attributes | |
static const uint32_t | MAX_FRAGMENT_ID = 256 |
The fragment is described with 8 bits, thus the maximum fragment id is 256. More... | |
static const uint32_t | MAX_HL_PACKET_SIZE = 65536 |
The maximum packet size is described with 16 bits, thus, the maximum HL packet size is 65536 bytes. 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... | |
SatGenericStreamEncapsulator class is used in the FWD link for GSE encapsulation and fragmentation of higher layer packets.
SatGenericStreamEncapsulator object is flow (UT address - flow id) specific and its entities are located at both GW (encapsulation, fragmentation) and UT (decapsulation, defragmentation). Generic stream encapsulators/decapsulators are created dynamically when first needed (when a packet is received for this flow).
Definition at line 48 of file satellite-generic-stream-encapsulator.h.
ns3::SatGenericStreamEncapsulator::SatGenericStreamEncapsulator | ( | ) |
Default constructor, not used.
Definition at line 42 of file satellite-generic-stream-encapsulator.cc.
ns3::SatGenericStreamEncapsulator::SatGenericStreamEncapsulator | ( | Mac48Address | encapAddress, |
Mac48Address | decapAddress, | ||
Mac48Address | sourceE2EAddress, | ||
Mac48Address | destE2EAddress, | ||
uint8_t | flowId, | ||
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) |
flowId | Flow identifier |
additionalHeaderSize | Additional value in to take into account when pulling packets to represent E2E tags |
Definition at line 55 of file satellite-generic-stream-encapsulator.cc.
References ns3::SatGseHeader::GetMaxGseHeaderSizeInBytes(), and m_minGseTxOpportunity.
|
virtual |
Destructor for SatGenericStreamEncapsulator.
Definition at line 80 of file satellite-generic-stream-encapsulator.cc.
|
virtual |
Dispose of this class instance.
Reimplemented from ns3::SatBaseEncapsulator.
Reimplemented in ns3::SatGenericStreamEncapsulatorArq.
Definition at line 101 of file satellite-generic-stream-encapsulator.cc.
References ns3::SatBaseEncapsulator::DoDispose().
Referenced by ns3::SatGenericStreamEncapsulatorArq::DoDispose().
|
virtual |
Enqueue a Higher Layer packet to txBuffer.
p | To be buffered packet |
dest | Target MAC address |
Reimplemented from ns3::SatBaseEncapsulator.
Definition at line 109 of file satellite-generic-stream-encapsulator.cc.
References ns3::SatEncapPduStatusTag::FULL_PDU, ns3::SatBaseEncapsulator::m_txQueue, MAX_HL_PACKET_SIZE, 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 497 of file satellite-generic-stream-encapsulator.cc.
References m_minGseTxOpportunity.
Referenced by ns3::SatGenericStreamEncapsulatorArq::NotifyTxOpportunity(), and NotifyTxOpportunity().
|
protected |
Get new packet performs the GSE fragmentation and encapsulation for a one single packet.
Returns NULL packet if a suitable packet is not created.
Definition at line 195 of file satellite-generic-stream-encapsulator.cc.
References ns3::SatEncapPduStatusTag::CONTINUATION_PDU, ns3::SatEncapPduStatusTag::END_PDU, ns3::SatEncapPduStatusTag::FULL_PDU, ns3::SatGseHeader::GetGseHeaderSizeInBytes(), ns3::SatEncapPduStatusTag::GetStatus(), IncreaseFragmentId(), m_txFragmentId, ns3::SatBaseEncapsulator::m_txQueue, ns3::SatGseHeader::SetEndIndicator(), ns3::SatGseHeader::SetFragmentId(), ns3::SatGseHeader::SetGsePduLength(), ns3::SatGseHeader::SetStartIndicator(), ns3::SatEncapPduStatusTag::SetStatus(), ns3::SatGseHeader::SetTotalLength(), and ns3::SatEncapPduStatusTag::START_PDU.
Referenced by ns3::SatGenericStreamEncapsulatorArq::NotifyTxOpportunity(), and NotifyTxOpportunity().
|
static |
Get the type ID.
Definition at line 86 of file satellite-generic-stream-encapsulator.cc.
References m_maxGsePduSize.
|
protected |
Method increases the fragment id by one.
If the maximum fragment id is reached, it is reset to zero.
Definition at line 362 of file satellite-generic-stream-encapsulator.cc.
References m_txFragmentId, and MAX_FRAGMENT_ID.
Referenced by GetNewGsePdu().
|
virtual |
Notify a Tx opportunity to this encapsulator.
bytes | Notified tx opportunity bytes from lower layer |
bytesLeft | Bytes left after this TxOpportunity in SatQueue |
&nextMinTxO | Minimum TxO after this TxO |
Reimplemented from ns3::SatBaseEncapsulator.
Reimplemented in ns3::SatGenericStreamEncapsulatorArq.
Definition at line 136 of file satellite-generic-stream-encapsulator.cc.
References GetMinTxOpportunityInBytes(), GetNewGsePdu(), ns3::SatBaseEncapsulator::GetTxBufferSizeInBytes(), ns3::SatBaseEncapsulator::m_additionalHeaderSize, ns3::SatBaseEncapsulator::m_decapAddress, ns3::SatBaseEncapsulator::m_destE2EAddress, ns3::SatBaseEncapsulator::m_encapAddress, ns3::SatBaseEncapsulator::m_flowId, m_maxGsePduSize, ns3::SatBaseEncapsulator::m_sourceE2EAddress, ns3::SatBaseEncapsulator::m_txQueue, ns3::SatMacTag::SetDestAddress(), ns3::SatAddressE2ETag::SetE2EDestAddress(), ns3::SatAddressE2ETag::SetE2ESourceAddress(), ns3::SatFlowIdTag::SetFlowId(), and ns3::SatMacTag::SetSourceAddress().
|
protectedvirtual |
Process the reception of individual GSE PDUs.
p | Packet to be received |
Definition at line 403 of file satellite-generic-stream-encapsulator.cc.
References ns3::SatGseHeader::GetEndIndicator(), ns3::SatGseHeader::GetFragmentId(), ns3::SatGseHeader::GetGsePduLength(), ns3::SatGseHeader::GetStartIndicator(), ns3::SatGseHeader::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::SatGenericStreamEncapsulatorArq::ReassembleAndReceive(), and ReceivePdu().
|
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::SatGenericStreamEncapsulatorArq.
Definition at line 374 of file satellite-generic-stream-encapsulator.cc.
References ns3::SatMacTag::GetDestAddress(), ns3::SatBaseEncapsulator::m_decapAddress, and ProcessPdu().
|
protected |
Reset defragmentation variables.
Definition at line 486 of file satellite-generic-stream-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 162 of file satellite-generic-stream-encapsulator.h.
Referenced by ProcessPdu(), and Reset().
|
protected |
Current packet in the reassembly process.
Definition at line 167 of file satellite-generic-stream-encapsulator.h.
Referenced by ProcessPdu(), and Reset().
|
protected |
Currently received bytes of the fragmented packet.
Definition at line 177 of file satellite-generic-stream-encapsulator.h.
Referenced by ProcessPdu(), and Reset().
|
protected |
The total size of the ALPDU size reassembly process.
Definition at line 172 of file satellite-generic-stream-encapsulator.h.
Referenced by ProcessPdu(), and Reset().
|
protected |
Maximum GSE PDU size.
Definition at line 153 of file satellite-generic-stream-encapsulator.h.
Referenced by GetTypeId(), and NotifyTxOpportunity().
|
protected |
If the GSE opportunity is smaller than this, a NULL packet is returned.
Definition at line 183 of file satellite-generic-stream-encapsulator.h.
Referenced by SatGenericStreamEncapsulator(), and GetMinTxOpportunityInBytes().
|
protected |
Fragment id used in the packet transmissions.
Definition at line 158 of file satellite-generic-stream-encapsulator.h.
Referenced by GetNewGsePdu(), and IncreaseFragmentId().
|
staticprotected |
The fragment is described with 8 bits, thus the maximum fragment id is 256.
Definition at line 189 of file satellite-generic-stream-encapsulator.h.
Referenced by IncreaseFragmentId().
|
staticprotected |
The maximum packet size is described with 16 bits, thus, the maximum HL packet size is 65536 bytes.
Definition at line 195 of file satellite-generic-stream-encapsulator.h.
Referenced by EnquePdu().