satellite-geo-mac.h
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2013 Magister Solutions Ltd.
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License version 2 as
7  * published by the Free Software Foundation;
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  *
18  * Author: Bastien Tauran <bastien.tauran@viveris.fr>
19  */
20 
21 #ifndef SATELLITE_GEO_MAC_H
22 #define SATELLITE_GEO_MAC_H
23 
25 #include "satellite-geo-user-llc.h"
26 #include "satellite-mac.h"
27 #include "satellite-phy.h"
29 
30 #include <ns3/address.h>
31 #include <ns3/nstime.h>
32 #include <ns3/object.h>
33 #include <ns3/packet.h>
34 #include <ns3/ptr.h>
35 
36 namespace ns3
37 {
38 
44 class SatGeoMac : public SatMac
45 {
46  public:
50  SatGeoMac(void);
51 
62  SatGeoMac(uint32_t satId,
63  uint32_t beamId,
64  SatEnums::RegenerationMode_t forwardLinkRegenerationMode,
65  SatEnums::RegenerationMode_t returnLinkRegenerationMode);
66 
70  virtual ~SatGeoMac();
71 
75  static TypeId GetTypeId(void);
76  TypeId GetInstanceTypeId(void) const;
77  virtual void DoInitialize(void);
78 
82  virtual void DoDispose(void);
83 
88 
93  virtual void EnquePacket(Ptr<Packet> packet) = 0;
94 
99  void SetFwdScheduler(Ptr<SatFwdLinkScheduler> fwdScheduler);
100 
104  void SetLlc(Ptr<SatGeoLlc> llc);
105 
106  virtual Time GetGuardTime() const;
107  virtual void SetGuardTime(Time guardTime);
108 
109  typedef Callback<void, Ptr<SatSignalParameters>> TransmitCallback;
110 
112 
113  typedef Callback<void, SatPhy::PacketContainer_t, Ptr<SatSignalParameters>>
115 
117 
118  protected:
128  void StartTransmission(uint32_t carrierId);
129 
137  virtual void SendPacket(SatPhy::PacketContainer_t packets,
138  uint32_t carrierId,
139  Time duration,
141 
146  virtual void RxTraces(SatPhy::PacketContainer_t packets);
147 
153 
159 
166  virtual Address GetRxUtAddress(Ptr<Packet> packet) = 0;
167 
171  Ptr<SatFwdLinkScheduler> m_fwdScheduler;
172 
178 
182  uint32_t m_satId;
183 
187  uint32_t m_beamId;
188 
192  Ptr<SatGeoLlc> m_llc;
193 
197  TracedCallback<Ptr<SatBbFrame>> m_bbFrameTxTrace;
198 
201 };
202 
203 } // namespace ns3
204 
205 #endif /* SATELLITE_GEO_MAC_H */
SatLinkDir_t
Link direction used for packet tracing.
RegenerationMode_t
The regeneration mode used in satellites.
The SatGeoMac models the global link MAC layer of the satellite node.
Callback< void, Ptr< SatSignalParameters > > TransmitCallback
Ptr< SatGeoLlc > m_llc
LLC layer linked to this MAC.
virtual void SetGuardTime(Time guardTime)
void StartTransmission(uint32_t carrierId)
Start sending a Packet Down the Wire.
virtual Time GetGuardTime() const
SatGeoMac(void)
Default constructor.
TracedCallback< Ptr< SatBbFrame > > m_bbFrameTxTrace
Trace for transmitted BB frames.
virtual void RxTraces(SatPhy::PacketContainer_t packets)
Invoke the Rx trace source for each received packet.
Time m_guardTime
Guard time for BB frames.
void StartPeriodicTransmissions()
Starts periodical transmissions.
uint32_t m_satId
ID of sat for UT.
TransmitCallback m_txCallback
virtual void DoInitialize(void)
virtual void DoDispose(void)
Dispose of this class instance.
void SetLlc(Ptr< SatGeoLlc > llc)
Set the Geo LLC associated to this Geo MAC layer.
uint32_t m_beamId
ID of beam for UT.
void SetTransmitCallback(SatGeoMac::TransmitCallback cb)
void SetReceiveNetDeviceCallback(SatGeoMac::ReceiveNetDeviceCallback cb)
Callback< void, SatPhy::PacketContainer_t, Ptr< SatSignalParameters > > ReceiveNetDeviceCallback
virtual SatEnums::SatLinkDir_t GetSatLinkRxDir()=0
Get the link RX direction.
void SetFwdScheduler(Ptr< SatFwdLinkScheduler > fwdScheduler)
Method to set link scheduler (forward or SCPC)
Ptr< SatFwdLinkScheduler > m_fwdScheduler
Scheduler for the forward link.
ReceiveNetDeviceCallback m_rxNetDeviceCallback
TypeId GetInstanceTypeId(void) const
static TypeId GetTypeId(void)
inherited from Object
virtual void SendPacket(SatPhy::PacketContainer_t packets, uint32_t carrierId, Time duration, SatSignalParameters::txInfo_s txInfo)
Send packets to lower layer by using a callback.
virtual void EnquePacket(Ptr< Packet > packet)=0
Add new packet to the LLC queue.
virtual Address GetRxUtAddress(Ptr< Packet > packet)=0
Get the UT address associated to this RX packet.
virtual SatEnums::SatLinkDir_t GetSatLinkTxDir()=0
Get the link TX direction.
virtual ~SatGeoMac()
Destructor for SatGeoMac.
Base MAC class for SatNetDevices.
Definition: satellite-mac.h:52
SatSignalParameters::PacketsInBurst_t PacketContainer_t
Define PacketContainer in SatPhy.
Definition: satellite-phy.h:78
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.
Struct for storing the packet specific Tx information.