29 #include <ns3/double.h>
32 #include <ns3/pointer.h>
33 #include <ns3/simulator.h>
34 #include <ns3/uinteger.h>
36 NS_LOG_COMPONENT_DEFINE(
"SatGeoFeederMac");
41 NS_OBJECT_ENSURE_REGISTERED(SatGeoFeederMac);
47 TypeId(
"ns3::SatGeoFeederMac")
49 .AddConstructor<SatGeoFeederMac>()
50 .AddAttribute(
"GuardTime",
51 "Guard time in this SCPC scheduler",
52 TimeValue(MicroSeconds(1)),
61 NS_LOG_FUNCTION(
this);
68 NS_LOG_FUNCTION(
this);
69 NS_FATAL_ERROR(
"SatGeoFeederMac default constructor is not allowed to use");
76 :
SatGeoMac(satId, beamId, forwardLinkRegenerationMode, returnLinkRegenerationMode)
78 NS_LOG_FUNCTION(
this);
83 NS_LOG_FUNCTION(
this);
89 NS_LOG_FUNCTION(
this);
96 NS_LOG_FUNCTION(
this);
97 Object::DoInitialize();
103 NS_LOG_FUNCTION(
this);
106 bool success = packet->PeekPacketTag(addressE2ETag);
109 success &= packet->RemovePacketTag(mTag);
118 packet->AddPacketTag(mTag);
124 if (packet->PeekPacketTag(ctrlTag))
135 NS_LOG_FUNCTION(
this);
153 rxParams->m_packetsInBurst.clear();
154 for (SatPhy::PacketContainer_t::iterator i = packets.begin(); i != packets.end(); i++)
158 bool mSuccess = (*i)->PeekPacketTag(macTag);
161 NS_FATAL_ERROR(
"MAC tag was not found from the packet!");
166 NS_LOG_INFO(
"Receiver " <<
m_nodeInfo->GetMacAddress());
169 mSuccess = (*i)->PeekPacketTag(satAddressE2ETag);
172 NS_FATAL_ERROR(
"SatAddressE2E tag was not found from the packet!");
175 if (destE2EAddress ==
m_nodeInfo->GetMacAddress())
179 bool cSuccess = (*i)->PeekPacketTag(ctrlTag);
191 NS_FATAL_ERROR(
"A control message received with not valid msg type!");
197 rxParams->m_packetsInBurst.push_back(*i);
203 for (SatPhy::PacketContainer_t::iterator i = rxParams->m_packetsInBurst.begin();
204 i != rxParams->m_packetsInBurst.end();
209 bool mSuccess = (*i)->PeekPacketTag(macTag);
212 NS_FATAL_ERROR(
"MAC tag was not found from the packet!");
218 NS_LOG_INFO(
"Receiver " <<
m_nodeInfo->GetMacAddress());
220 if (destAddress ==
m_nodeInfo->GetMacAddress() || destAddress.IsBroadcast() ||
221 destAddress.IsGroup())
236 NS_LOG_FUNCTION(
this << packet);
240 packet->PeekPacketTag(macTag);
244 bool cSuccess = packet->PeekPacketTag(ctrlTag);
248 NS_FATAL_ERROR(
"SatControlMsgTag not found in the packet!");
254 uint32_t msgId = ctrlTag.
GetMsgId();
255 Ptr<SatCnoReportMessage> cnoReport =
258 if (cnoReport != NULL)
264 NS_LOG_WARN(
"Control message "
266 <<
" is not found from the RTN link control msg container!"
267 <<
" at: " << Now().GetSeconds() <<
"s");
270 packet->RemovePacketTag(macTag);
271 packet->RemovePacketTag(ctrlTag);
276 NS_FATAL_ERROR(
"Control message unkonwn on feeder MAC");
296 NS_LOG_FUNCTION(
this << packet);
301 if (packet->PeekPacketTag(addressE2ETag))
303 NS_LOG_DEBUG(
this <<
" contains a SatE2E tag");
This class implements a tag that carries the satellite MAC of GW and UT.
Mac48Address GetE2EDestAddress(void) const
Get E2E destination MAC address.
This class implements a tag that is used to identify control messages (packages).
SatControlMsgType_t
Definition for different types of control messages.
@ SAT_CN0_REPORT
SAT_CN0_REPORT.
@ SAT_NON_CTRL_MSG
SAT_NON_CTRL_MSG.
virtual uint32_t GetMsgId() const
Get message type specific identifier.
SatControlMsgType_t GetMsgType(void) const
Get type of the control message.
SatLinkDir_t
Link direction used for packet tracing.
RegenerationMode_t
The regeneration mode used in satellites.
void Receive(SatPhy::PacketContainer_t packets, Ptr< SatSignalParameters > rxParams)
Receive packet from lower layer.
virtual Address GetRxUtAddress(Ptr< Packet > packet)
Get the UT address associated to this RX packet.
virtual void EnquePacket(Ptr< Packet > packet)
Add new packet to the LLC queue.
virtual SatEnums::SatLinkDir_t GetSatLinkRxDir()
Get the link RX direction.
static TypeId GetTypeId(void)
inherited from Object
TypeId GetInstanceTypeId(void) const
void ReceiveSignalingPacket(Ptr< Packet > packet)
virtual SatEnums::SatLinkDir_t GetSatLinkTxDir()
Get the link TX direction.
SatGeoFeederMac(void)
Default constructor.
virtual ~SatGeoFeederMac()
Destructor for SatGeoFeederMac.
virtual void DoDispose(void)
Dispose of this class instance.
virtual void DoInitialize(void)
The SatGeoMac models the global link MAC layer of the satellite node.
Ptr< SatGeoLlc > m_llc
LLC layer linked to this MAC.
virtual void SetGuardTime(Time guardTime)
virtual Time GetGuardTime() const
virtual void RxTraces(SatPhy::PacketContainer_t packets)
Invoke the Rx trace source for each received packet.
Ptr< SatFwdLinkScheduler > m_fwdScheduler
Scheduler for the forward link.
ReceiveNetDeviceCallback m_rxNetDeviceCallback
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.
SatMac::ReceiveCallback m_rxCallback
The upper layer package receive callback.
SatMac::ReadCtrlMsgCallback m_readCtrlCallback
The read control message callback.
SatEnums::RegenerationMode_t m_forwardLinkRegenerationMode
Regeneration mode on forward link.
Ptr< SatNodeInfo > m_nodeInfo
Node info containing node related information, such as node type, node id and MAC address (of the Sat...
SatEnums::RegenerationMode_t m_returnLinkRegenerationMode
Regeneration mode on return link.
This class implements a tag that carries the satellite MAC specific information, such as source and d...
void SetDestAddress(Mac48Address dest)
Set destination MAC address.
Mac48Address GetSourceAddress(void) const
Get source MAC address.
Mac48Address GetDestAddress(void) const
Get destination MAC address.
void SetSourceAddress(Mac48Address source)
Set source MAC address.
SatSignalParameters::PacketsInBurst_t PacketContainer_t
Define PacketContainer in SatPhy.
static std::string GetPacketInfo(const Ptr< const Packet > p)
Get packet information in std::string for printing purposes.
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.