A base encapsulator implementation which does not support encapsulation, fragmentation or packing. More...
#include "satellite-base-encapsulator.h"
Public Types | |
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... | |
Public Member Functions | |
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 void | DoDispose () |
Dispose of this class instance. More... | |
virtual void | EnquePdu (Ptr< Packet > p, Mac48Address dest) |
Enqueue a packet to txBuffer. More... | |
virtual Time | GetHolDelay () const |
Get Head-of-Line packet buffering delay. More... | |
virtual uint32_t | GetMinTxOpportunityInBytes () const |
Get minimum Tx opportunity in bytes, which takes the assumed header sizes into account. More... | |
Ptr< SatQueue > | GetQueue () |
Get the queue instance. More... | |
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 base encapsulator. More... | |
virtual void | ReceiveAck (Ptr< SatArqAckMessage > ack) |
Receive a control message (ARQ ACK) More... | |
virtual void | ReceivePdu (Ptr< Packet > p) |
Receive a packet. 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... | |
Protected Attributes | |
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... | |
A base encapsulator implementation which does not support encapsulation, fragmentation or packing.
Base encapsulator is used for flows which do not need encapsulation or fragmentation, such as lower layer control flows. Base encapsulator basically just stores packets in SatQueue and sends them as they are.
Return Link Encapsulator (RLE) and Generic Stream Encapsulator (GSE), as well as their ARQ supportive versions, are inherited from this base class.
Definition at line 52 of file satellite-base-encapsulator.h.
typedef Callback<void, Ptr<Packet>, Mac48Address, Mac48Address> ns3::SatBaseEncapsulator::ReceiveCallback |
Callback to send packet to lower layer.
Ptr<Packet> | the packet received |
Mac48Address | Source MAC address |
Mac48Address | Destination MAC address |
Definition at line 99 of file satellite-base-encapsulator.h.
typedef Callback<bool, Ptr<SatControlMessage>, const Address&> ns3::SatBaseEncapsulator::SendCtrlCallback |
Control msg sending callback.
msg | the message send |
address | Packet destination address |
Definition at line 107 of file satellite-base-encapsulator.h.
ns3::SatBaseEncapsulator::SatBaseEncapsulator | ( | ) |
Default constructor not used.
Default constructor is not meant to be used!
Definition at line 37 of file satellite-base-encapsulator.cc.
ns3::SatBaseEncapsulator::SatBaseEncapsulator | ( | 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 50 of file satellite-base-encapsulator.cc.
|
virtual |
Destructor for SatBaseEncapsulator.
Definition at line 66 of file satellite-base-encapsulator.cc.
References m_rxCallback, and m_txQueue.
|
virtual |
Dispose of this class instance.
Reimplemented in ns3::SatReturnLinkEncapsulator, ns3::SatReturnLinkEncapsulatorArq, ns3::SatGenericStreamEncapsulator, and ns3::SatGenericStreamEncapsulatorArq.
Definition at line 81 of file satellite-base-encapsulator.cc.
References m_ctrlCallback, m_rxCallback, and m_txQueue.
Referenced by ns3::SatGenericStreamEncapsulator::DoDispose(), and ns3::SatReturnLinkEncapsulator::DoDispose().
|
virtual |
Enqueue a packet to txBuffer.
p | To be buffered packet |
dest | Target MAC address |
Reimplemented in ns3::SatReturnLinkEncapsulator, and ns3::SatGenericStreamEncapsulator.
Definition at line 93 of file satellite-base-encapsulator.cc.
References m_encapAddress, m_flowId, m_txQueue, ns3::SatMacTag::SetDestAddress(), ns3::SatFlowIdTag::SetFlowId(), and ns3::SatMacTag::SetSourceAddress().
|
virtual |
Get Head-of-Line packet buffering delay.
Definition at line 215 of file satellite-base-encapsulator.cc.
References ns3::SatTimeTag::GetSenderTimestamp(), and m_txQueue.
|
virtual |
Get minimum Tx opportunity in bytes, which takes the assumed header sizes into account.
Reimplemented in ns3::SatReturnLinkEncapsulator, and ns3::SatGenericStreamEncapsulator.
Definition at line 267 of file satellite-base-encapsulator.cc.
References m_txQueue.
Ptr< SatQueue > ns3::SatBaseEncapsulator::GetQueue | ( | ) |
Get the queue instance.
Definition at line 259 of file satellite-base-encapsulator.cc.
References m_txQueue.
|
virtual |
Get the buffered packets for this encapsulator.
Reimplemented in ns3::SatReturnLinkEncapsulatorArq, and ns3::SatGenericStreamEncapsulatorArq.
Definition at line 207 of file satellite-base-encapsulator.cc.
References m_txQueue.
Referenced by ns3::SatGenericStreamEncapsulator::NotifyTxOpportunity(), and ns3::SatReturnLinkEncapsulator::NotifyTxOpportunity().
|
static |
Get the type ID.
Definition at line 74 of file satellite-base-encapsulator.cc.
|
virtual |
Notify a Tx opportunity to this base encapsulator.
Note, that this class does not do encapsulator nor do not support fragmentation.
bytes | Notified Tx opportunity bytes from lower layer |
bytesLeft | Bytes left after this TxOpportunity in txBuffer |
&nextMinTxO | Minimum TxO after this TxO |
Reimplemented in ns3::SatReturnLinkEncapsulator, ns3::SatReturnLinkEncapsulatorArq, ns3::SatGenericStreamEncapsulator, and ns3::SatGenericStreamEncapsulatorArq.
Definition at line 126 of file satellite-base-encapsulator.cc.
|
virtual |
Receive a control message (ARQ ACK)
ack | Control message received (e.g. ARQ ACK) |
The base encapsulator should not be used at receiving control packets at all! This functionality is implemented in the inherited classes.
Reimplemented in ns3::SatReturnLinkEncapsulator, ns3::SatReturnLinkEncapsulatorArq, and ns3::SatGenericStreamEncapsulatorArq.
Definition at line 195 of file satellite-base-encapsulator.cc.
|
virtual |
Receive a packet.
Note, that base encapsulator does not support packet reception, since it assumes that packet receptions are terminated already at lower layers.
p | packet pointer received from lower layer |
The base encapsulator should not be used at receiving data packets at all! This functionality is implemented in the inherited classes.
Reimplemented in ns3::SatReturnLinkEncapsulator, ns3::SatReturnLinkEncapsulatorArq, ns3::SatGenericStreamEncapsulator, and ns3::SatGenericStreamEncapsulatorArq.
Definition at line 177 of file satellite-base-encapsulator.cc.
References m_decapAddress, m_encapAddress, m_flowId, and m_rxCallback.
void ns3::SatBaseEncapsulator::SetCtrlMsgCallback | ( | SatBaseEncapsulator::SendCtrlCallback | cb | ) |
cb | callback to send control messages. |
Definition at line 243 of file satellite-base-encapsulator.cc.
References m_ctrlCallback.
void ns3::SatBaseEncapsulator::SetQueue | ( | Ptr< SatQueue > | queue | ) |
Set the used queue from outside.
queue | Transmission queue |
Definition at line 251 of file satellite-base-encapsulator.cc.
References m_txQueue.
void ns3::SatBaseEncapsulator::SetReceiveCallback | ( | ReceiveCallback | cb | ) |
Method to set receive callback.
cb | callback to invoke whenever a packet has been received and must be forwarded to the higher layers. |
Definition at line 235 of file satellite-base-encapsulator.cc.
References m_rxCallback.
|
protected |
Additional value in to take into account when pulling packets to represent E2E tags.
Definition at line 210 of file satellite-base-encapsulator.h.
Referenced by ns3::SatGenericStreamEncapsulator::NotifyTxOpportunity(), and ns3::SatReturnLinkEncapsulator::NotifyTxOpportunity().
|
protected |
Callback to send control messages.
Definition at line 220 of file satellite-base-encapsulator.h.
Referenced by DoDispose(), ns3::SatGenericStreamEncapsulatorArq::SendAck(), ns3::SatReturnLinkEncapsulatorArq::SendAck(), and SetCtrlMsgCallback().
|
protected |
Definition at line 193 of file satellite-base-encapsulator.h.
Referenced by ns3::SatReturnLinkEncapsulator::EnquePdu(), ns3::SatGenericStreamEncapsulatorArq::NotifyTxOpportunity(), ns3::SatGenericStreamEncapsulator::NotifyTxOpportunity(), ns3::SatReturnLinkEncapsulatorArq::NotifyTxOpportunity(), ns3::SatReturnLinkEncapsulator::NotifyTxOpportunity(), ns3::SatGenericStreamEncapsulator::ProcessPdu(), ns3::SatReturnLinkEncapsulator::ProcessPdu(), ReceivePdu(), ns3::SatGenericStreamEncapsulatorArq::ReceivePdu(), ns3::SatGenericStreamEncapsulator::ReceivePdu(), ns3::SatReturnLinkEncapsulatorArq::ReceivePdu(), ns3::SatReturnLinkEncapsulator::ReceivePdu(), ns3::SatGenericStreamEncapsulatorArq::SendAck(), and ns3::SatReturnLinkEncapsulatorArq::SendAck().
|
protected |
Definition at line 195 of file satellite-base-encapsulator.h.
Referenced by ns3::SatGenericStreamEncapsulatorArq::NotifyTxOpportunity(), ns3::SatGenericStreamEncapsulator::NotifyTxOpportunity(), ns3::SatReturnLinkEncapsulatorArq::NotifyTxOpportunity(), and ns3::SatReturnLinkEncapsulator::NotifyTxOpportunity().
|
protected |
Source and destination mac addresses.
Used to tag the Frame PDU so that lower layers are capable of passing the packet to the correct destination.
Definition at line 192 of file satellite-base-encapsulator.h.
Referenced by ns3::SatGenericStreamEncapsulatorArq::ArqReTxTimerExpired(), ns3::SatReturnLinkEncapsulatorArq::ArqReTxTimerExpired(), EnquePdu(), ns3::SatReturnLinkEncapsulator::EnquePdu(), ns3::SatGenericStreamEncapsulatorArq::NotifyTxOpportunity(), ns3::SatGenericStreamEncapsulator::NotifyTxOpportunity(), ns3::SatReturnLinkEncapsulatorArq::NotifyTxOpportunity(), ns3::SatReturnLinkEncapsulator::NotifyTxOpportunity(), ns3::SatGenericStreamEncapsulator::ProcessPdu(), ns3::SatReturnLinkEncapsulator::ProcessPdu(), ns3::SatGenericStreamEncapsulatorArq::ReceiveAck(), ns3::SatReturnLinkEncapsulatorArq::ReceiveAck(), ReceivePdu(), ns3::SatGenericStreamEncapsulatorArq::ReceivePdu(), ns3::SatReturnLinkEncapsulatorArq::ReceivePdu(), ns3::SatGenericStreamEncapsulatorArq::RxWaitingTimerExpired(), ns3::SatReturnLinkEncapsulatorArq::RxWaitingTimerExpired(), ns3::SatGenericStreamEncapsulatorArq::SendAck(), and ns3::SatReturnLinkEncapsulatorArq::SendAck().
|
protected |
Flow identifier.
Definition at line 200 of file satellite-base-encapsulator.h.
Referenced by EnquePdu(), NotifyTxOpportunity(), ns3::SatGenericStreamEncapsulatorArq::NotifyTxOpportunity(), ns3::SatGenericStreamEncapsulator::NotifyTxOpportunity(), ns3::SatReturnLinkEncapsulatorArq::NotifyTxOpportunity(), ns3::SatReturnLinkEncapsulator::NotifyTxOpportunity(), ReceivePdu(), ns3::SatGenericStreamEncapsulatorArq::SendAck(), and ns3::SatReturnLinkEncapsulatorArq::SendAck().
|
protected |
Receive callback.
Definition at line 215 of file satellite-base-encapsulator.h.
Referenced by ~SatBaseEncapsulator(), DoDispose(), ns3::SatGenericStreamEncapsulator::ProcessPdu(), ns3::SatReturnLinkEncapsulator::ProcessPdu(), ReceivePdu(), and SetReceiveCallback().
|
protected |
Definition at line 194 of file satellite-base-encapsulator.h.
Referenced by ns3::SatGenericStreamEncapsulatorArq::NotifyTxOpportunity(), ns3::SatGenericStreamEncapsulator::NotifyTxOpportunity(), ns3::SatReturnLinkEncapsulatorArq::NotifyTxOpportunity(), and ns3::SatReturnLinkEncapsulator::NotifyTxOpportunity().
|
protected |
Used queue in satellite encapsulator.
Definition at line 205 of file satellite-base-encapsulator.h.
Referenced by ~SatBaseEncapsulator(), DoDispose(), EnquePdu(), ns3::SatGenericStreamEncapsulator::EnquePdu(), ns3::SatReturnLinkEncapsulator::EnquePdu(), GetHolDelay(), GetMinTxOpportunityInBytes(), ns3::SatGenericStreamEncapsulator::GetNewGsePdu(), ns3::SatReturnLinkEncapsulator::GetNewRlePdu(), GetQueue(), GetTxBufferSizeInBytes(), ns3::SatGenericStreamEncapsulatorArq::GetTxBufferSizeInBytes(), ns3::SatReturnLinkEncapsulatorArq::GetTxBufferSizeInBytes(), NotifyTxOpportunity(), ns3::SatGenericStreamEncapsulatorArq::NotifyTxOpportunity(), ns3::SatGenericStreamEncapsulator::NotifyTxOpportunity(), ns3::SatReturnLinkEncapsulatorArq::NotifyTxOpportunity(), ns3::SatReturnLinkEncapsulator::NotifyTxOpportunity(), and SetQueue().