21 #ifndef SATELLITE_LLC_H_
22 #define SATELLITE_LLC_H_
26 #include <ns3/mac48-address.h>
27 #include <ns3/object.h>
29 #include <ns3/simple-ref-count.h>
30 #include <ns3/traced-callback.h>
43 class SatControlMessage;
44 class SatSchedulingObject;
52 class EncapKey :
public SimpleRefCount<EncapKey>
62 const Mac48Address decapAddress,
64 const Mac48Address sourceE2EAddress = Mac48Address(),
65 const Mac48Address destE2EAddress = Mac48Address())
85 bool operator()(Ptr<EncapKey> key1, Ptr<EncapKey> key2)
const
87 if (key1->m_encapAddress == key2->m_encapAddress)
89 if (key1->m_decapAddress == key2->m_decapAddress)
91 return key1->m_flowId < key2->m_flowId;
95 return key1->m_decapAddress < key2->m_decapAddress;
100 return key1->m_encapAddress < key2->m_encapAddress;
186 virtual bool Enque(Ptr<Packet> packet, Address dest, uint8_t flowId);
205 uint32_t& nextMinTxO) = 0;
213 virtual void Receive(Ptr<Packet> packet, Mac48Address source, Mac48Address dest);
242 Ptr<SatBaseEncapsulator> enc);
255 Ptr<SatBaseEncapsulator> dec);
261 virtual void SetNodeInfo(Ptr<SatNodeInfo> nodeInfo);
373 virtual void ReceiveAck(Ptr<SatArqAckMessage> ack, Mac48Address source, Mac48Address dest);
EncapKeyCompare is used as a custom compare method within EncapContainer map.
bool operator()(Ptr< EncapKey > key1, Ptr< EncapKey > key2) const
EncapKey class is used as a key in the encapsulator/decapsulator container.
Mac48Address m_encapAddress
Mac48Address m_decapAddress
EncapKey(const Mac48Address encapAddress, const Mac48Address decapAddress, const uint8_t flowId, const Mac48Address sourceE2EAddress=Mac48Address(), const Mac48Address destE2EAddress=Mac48Address())
Mac48Address m_sourceE2EAddress
Mac48Address m_destE2EAddress
Callback< bool, Ptr< SatControlMessage >, const Address & > SendCtrlCallback
Control msg sending callback.
SatLinkDir_t
Link direction used for packet tracing.
SatNodeType_t
Node type used for packet tracing.
SatPacketEvent_t
Packet event used for packet tracing.
SatLogLevel_t
Log level used for packet tracing.
RegenerationMode_t
The regeneration mode used in satellites.
SatLlc base class holds the UT specific SatBaseEncapsulator instances, which are responsible of fragm...
virtual SatEnums::SatLinkDir_t GetSatLinkTxDir()
Get the link TX direction.
virtual bool BuffersEmpty() const
Are buffers empty?
static TypeId GetTypeId(void)
Derived from Object.
virtual SatEnums::SatLinkDir_t GetSatLinkRxDir()
Get the link RX direction.
Ptr< SatNodeInfo > m_nodeInfo
Node info containing node related information, such as node type, node id and MAC address (of the Sat...
virtual void SetGwAddress(Mac48Address address)
Set the GW address.
SatLlc::ReadCtrlMsgCallback m_readCtrlCallback
The read control message callback.
Callback< Ptr< SatControlMessage >, uint32_t > ReadCtrlMsgCallback
Callback to read control messages from container storing control messages.
virtual uint32_t GetNBytesInQueue() const
Get the total number of (new) bytes in all encapsulators.
virtual void SetNodeInfo(Ptr< SatNodeInfo > nodeInfo)
Set the node info.
void SetReadCtrlCallback(SatLlc::ReadCtrlMsgCallback cb)
Method to set read control message callback.
uint32_t m_additionalHeaderSize
Additional header size to add to encapsulation/decapsulation.
void SetReceiveCallback(SatLlc::ReceiveCallback cb)
Set Receive callback to forward packet to upper layer.
bool m_fwdLinkArqEnabled
Is FWD link ARQ enabled.
SatBaseEncapsulator::SendCtrlCallback m_sendCtrlCallback
Callback to send control messages.
SatEnums::RegenerationMode_t m_returnLinkRegenerationMode
Regeneration mode on return link.
EncapContainer_t m_decaps
Map of decapsulator base pointers.
virtual void GetSchedulingContexts(std::vector< Ptr< SatSchedulingObject >> &output) const =0
Create and fill the scheduling objects based on LLC layer information.
virtual void CreateEncap(Ptr< EncapKey > key)=0
Virtual method to create a new encapsulator 'on-a-need-basis' dynamically.
virtual uint32_t GetNPacketsInQueue(Mac48Address utAddress) const =0
Get the number of (new) packets at LLC queues for a certain UT.
TracedCallback< Time, SatEnums::SatPacketEvent_t, SatEnums::SatNodeType_t, uint32_t, Mac48Address, SatEnums::SatLogLevel_t, SatEnums::SatLinkDir_t, std::string > m_packetTrace
Trace callback used for packet tracing:
virtual void CreateDecap(Ptr< EncapKey > key)=0
Virtual method to create a new decapsulator 'on-a-need-basis' dynamically.
Mac48Address m_gwAddress
GW address.
virtual void DoDispose()
Dispose of this class instance.
void AddEncap(Mac48Address source, Mac48Address dest, uint8_t flowId, Ptr< SatBaseEncapsulator > enc)
Add an encapsulator entry for the LLC.
virtual void ReceiveAck(Ptr< SatArqAckMessage > ack, Mac48Address source, Mac48Address dest)
Receive a control msg (ARQ ACK) from lower layer.
void SetCtrlMsgCallback(SatBaseEncapsulator::SendCtrlCallback cb)
EncapContainer_t m_encaps
Map of encapsulator base pointers.
virtual ~SatLlc()
Destroy a SatLlc.
void SetAdditionalHeaderSize(uint32_t additionalHeaderSize)
Set the additional header size.
std::map< Ptr< EncapKey >, Ptr< SatBaseEncapsulator >, EncapKeyCompare > EncapContainer_t
Key = Ptr<EncapKey> (source, dest, flowId) Value = Ptr<SatBaseEncapsulator> Compare class = EncapKeyC...
SatEnums::RegenerationMode_t m_forwardLinkRegenerationMode
Regeneration mode on forward link.
virtual bool ControlBuffersEmpty() const
Are buffers empty?
SatLlc()
Construct a SatLlc.
virtual void SetSatelliteAddress(Mac48Address address)
Set the SAT address.
virtual uint32_t GetNPacketsInQueue() const
Get the total number of (new) packets in all encapsulators.
virtual void ReceiveHigherLayerPdu(Ptr< Packet > packet, Mac48Address source, Mac48Address dest)
Receive HL PDU from encapsulator/decapsulator entity.
Callback< void, Ptr< const Packet > > ReceiveCallback
Receive callback used for sending packet to netdevice layer.
virtual Ptr< Packet > NotifyTxOpportunity(uint32_t bytes, Mac48Address utAddr, uint8_t flowId, uint32_t &bytesLeft, uint32_t &nextMinTxO)=0
Called from lower layer (MAC) to inform a Tx opportunity of certain amount of bytes.
virtual bool Enque(Ptr< Packet > packet, Address dest, uint8_t flowId)
Called from higher layer (SatNetDevice) to enque packet to LLC.
Mac48Address m_satelliteAddress
SAT address, used in case of network regeneration.
void AddDecap(Mac48Address source, Mac48Address dest, uint8_t flowId, Ptr< SatBaseEncapsulator > dec)
Add an decapsulator entry for the LLC.
bool m_rtnLinkArqEnabled
Is RTN link ARQ enabled.
virtual void Receive(Ptr< Packet > packet, Mac48Address source, Mac48Address dest)
Receive user data packet from lower layer.
virtual uint32_t GetNBytesInQueue(Mac48Address utAddress) const =0
Get the number of (new) bytes at LLC queue for a certain UT.
ReceiveCallback m_rxCallback
The upper layer package receive callback.
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.