Loading...
Searching...
No Matches
satellite-orbiter-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_ORBITER_MAC_H
22#define SATELLITE_ORBITER_MAC_H
23
26#include "satellite-mac.h"
28#include "satellite-phy.h"
30
31#include "ns3/address.h"
32#include "ns3/nstime.h"
33#include "ns3/object.h"
34#include "ns3/packet.h"
35#include "ns3/ptr.h"
36
37#include <stdint.h>
38
39namespace ns3
40{
41
47class SatOrbiterMac : public SatMac
48{
49 public:
53 SatOrbiterMac(void);
54
63 SatOrbiterMac(uint32_t satId, uint32_t beamId);
64
68 virtual ~SatOrbiterMac();
69
73 static TypeId GetTypeId(void);
74 virtual void DoInitialize(void);
75
79 virtual void DoDispose(void);
80
85
90 virtual void EnquePacket(Ptr<Packet> packet) = 0;
91
96 void SetFwdScheduler(Ptr<SatFwdLinkScheduler> fwdScheduler);
97
101 void SetLlc(Ptr<SatOrbiterLlc> llc);
102
103 virtual Time GetGuardTime() const;
104 virtual void SetGuardTime(Time guardTime);
105
106 typedef Callback<void, Ptr<SatSignalParameters>> TransmitCallback;
107
109
110 typedef Callback<void, SatPhy::PacketContainer_t, Ptr<SatSignalParameters>>
112
114
118 typedef Callback<Ptr<SatBeamScheduler>, uint32_t, uint32_t> BeamSchedulerCallback;
119
125
129 virtual void StopPeriodicTransmissions();
130
137 virtual bool AddPeer(Mac48Address address) = 0;
138
145 virtual bool RemovePeer(Mac48Address address) = 0;
146
147 protected:
157 void StartTransmission(uint32_t carrierId);
158
166 virtual void SendPacket(SatPhy::PacketContainer_t packets,
167 uint32_t carrierId,
168 Time duration,
170
175 virtual void RxTraces(SatPhy::PacketContainer_t packets);
176
182
188
195 virtual Address GetRxUtAddress(Ptr<Packet> packet) = 0;
196
202 virtual bool HasPeer() = 0;
203
209
213 Ptr<SatFwdLinkScheduler> m_fwdScheduler;
214
220
224 uint32_t m_satId;
225
229 uint32_t m_beamId;
230
234 Ptr<SatOrbiterLlc> m_llc;
235
239 TracedCallback<Ptr<SatBbFrame>> m_bbFrameTxTrace;
240
243
248};
249
250} // namespace ns3
251
252#endif /* SATELLITE_ORBITER_MAC_H */
SatLinkDir_t
Link direction used for packet tracing.
SatMac()
Construct a SatMac.
bool m_disableSchedulingIfNoDeviceConnected
If true, the periodic calls of StartTransmission are not called when no devices are connected to this...
void SetBeamSchedulerCallback(SatOrbiterMac::BeamSchedulerCallback cb)
Set the beam scheduler callback.
virtual bool AddPeer(Mac48Address address)=0
Add a remote peer to this MAC.
uint32_t m_satId
ID of sat for UT.
SatOrbiterMac(void)
Default constructor.
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.
Ptr< SatOrbiterLlc > m_llc
LLC layer linked to this MAC.
Callback< void, SatPhy::PacketContainer_t, Ptr< SatSignalParameters > > ReceiveNetDeviceCallback
virtual Address GetRxUtAddress(Ptr< Packet > packet)=0
Get the UT address associated to this RX packet.
uint32_t m_beamId
ID of beam for UT.
virtual Time GetGuardTime() const
void SetTransmitCallback(SatOrbiterMac::TransmitCallback cb)
Time m_guardTime
Guard time for BB frames.
TransmitCallback m_txCallback
virtual ~SatOrbiterMac()
Destructor for SatOrbiterMac.
virtual void DoInitialize(void)
virtual void EnquePacket(Ptr< Packet > packet)=0
Add new packet to the LLC queue.
void StartTransmission(uint32_t carrierId)
Start sending a Packet Down the Wire.
void SetLlc(Ptr< SatOrbiterLlc > llc)
Set the orbiter LLC associated to this orbiter MAC layer.
virtual bool RemovePeer(Mac48Address address)=0
Remove a remote peer from this MAC.
virtual SatEnums::SatLinkDir_t GetSatLinkTxDir()=0
Get the link TX direction.
bool m_periodicTransmissionEnabled
Indicated if periodic transmission is enabled.
virtual void SetGuardTime(Time guardTime)
virtual void DoDispose(void)
Dispose of this class instance.
virtual SatEnums::SatLinkDir_t GetSatLinkRxDir()=0
Get the link RX direction.
virtual void StopPeriodicTransmissions()
Stop periodic transmission, until a pacquet in enqued.
ReceiveNetDeviceCallback m_rxNetDeviceCallback
void StartPeriodicTransmissions()
Starts periodical transmissions.
static TypeId GetTypeId(void)
inherited from Object
void SetFwdScheduler(Ptr< SatFwdLinkScheduler > fwdScheduler)
Method to set link scheduler (forward or SCPC).
Callback< Ptr< SatBeamScheduler >, uint32_t, uint32_t > BeamSchedulerCallback
Callback to get the SatBeamScheduler from the beam ID for handover.
Callback< void, Ptr< SatSignalParameters > > TransmitCallback
TracedCallback< Ptr< SatBbFrame > > m_bbFrameTxTrace
Trace for transmitted BB frames.
Ptr< SatFwdLinkScheduler > m_fwdScheduler
Scheduler for the forward link.
void SetReceiveNetDeviceCallback(SatOrbiterMac::ReceiveNetDeviceCallback cb)
virtual void RxTraces(SatPhy::PacketContainer_t packets)
Invoke the Rx trace source for each received packet.
virtual bool HasPeer()=0
Indicates if at least one device is connected in this beam.
SatSignalParameters::PacketsInBurst_t PacketContainer_t
Define PacketContainer in SatPhy.
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.
Struct for storing the packet specific Tx information.