A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
uan-phy-gen.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2009 University of Washington
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation;
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 *
17 * Author: Leonard Tracy <lentracy@gmail.com>
18 * Andrea Sacco <andrea.sacco85@gmail.com>
19 */
20
21#ifndef UAN_PHY_GEN_H
22#define UAN_PHY_GEN_H
23
24#include "uan-phy.h"
25
26#include "ns3/device-energy-model.h"
27#include "ns3/event-id.h"
28#include "ns3/nstime.h"
29#include "ns3/random-variable-stream.h"
30#include "ns3/traced-callback.h"
31
32#include <list>
33
34namespace ns3
35{
36
37/**
38 * \ingroup uan
39 *
40 * Default Packet Error Rate calculator for UanPhyGen
41 *
42 * Considers no error if SINR is > user defined threshold
43 * (configured by an attribute).
44 */
46{
47 public:
48 /** Constructor */
50 /** Destructor */
51 ~UanPhyPerGenDefault() override;
52
53 /**
54 * Register this type.
55 * \return The TypeId.
56 */
57 static TypeId GetTypeId();
58
59 double CalcPer(Ptr<Packet> pkt, double sinrDb, UanTxMode mode) override;
60
61 private:
62 double m_thresh; //!< SINR threshold.
63
64}; // class UanPhyPerGenDefault
65
66/**
67 * \ingroup uan
68 *
69 * Packet error rate calculation assuming WHOI Micromodem-like PHY (FH-FSK)
70 *
71 * Calculates PER assuming rate 1/2 convolutional code with
72 * constraint length 9 with soft decision viterbi decoding and
73 * a CRC capable of correcting 1 bit error.
74 */
76{
77 public:
78 /** Constructor */
80 /** Destructor */
81 ~UanPhyPerUmodem() override;
82
83 /**
84 * Register this type.
85 * \return The TypeId.
86 */
87 static TypeId GetTypeId();
88
89 /**
90 * Calculate the packet error probability based on
91 * SINR at the receiver and a tx mode.
92 *
93 * This implementation uses calculations
94 * for binary FSK modulation coded by a rate 1/2 convolutional code
95 * with constraint length = 9 and a viterbi decoder and finally a CRC capable
96 * of correcting one bit error. These equations can be found in
97 * the book, Digital Communications, by Proakis (any version I think).
98 *
99 * \param pkt Packet which is under consideration.
100 * \param sinrDb SINR at receiver.
101 * \param mode TX mode used to transmit packet.
102 * \return Probability of packet error.
103 */
104 double CalcPer(Ptr<Packet> pkt, double sinrDb, UanTxMode mode) override;
105
106 private:
107 /**
108 * Binomial coefficient
109 *
110 * \param n Pool size.
111 * \param k Number of draws.
112 * \return Binomial coefficient n choose k.
113 */
114 double NChooseK(uint32_t n, uint32_t k);
115
116}; // class UanPhyPerUmodem
117
118/**
119 * \ingroup uan
120 *
121 * Packet error rate calculation for common tx modes based on UanPhyPerUmodem
122 *
123 * Calculates PER for common UanTxMode modulations, by deriving
124 * PER from the BER taken from well known literature's formulas.
125 */
127{
128 public:
129 /** Constructor */
131 /** Destructor */
132 ~UanPhyPerCommonModes() override;
133
134 /**
135 * Register this type.
136 * \return The TypeId.
137 */
138 static TypeId GetTypeId();
139
140 /**
141 * Calculate the Packet ERror probability based on
142 * SINR at the receiver and a tx mode.
143 *
144 * This implementation calculates PER for common UanTxMode modulations,
145 * by deriving PER from the BER taken from literature's formulas.
146 *
147 * \param pkt Packet which is under consideration.
148 * \param sinrDb SINR at receiver.
149 * \param mode TX mode used to transmit packet.
150 * \return Probability of packet error.
151 */
152 double CalcPer(Ptr<Packet> pkt, double sinrDb, UanTxMode mode) override;
153
154}; // class UanPhyPerCommonModes
155
156/**
157 * \ingroup uan
158 *
159 * Default SINR calculator for UanPhyGen.
160 *
161 * The default ignores mode data and assumes that all rxpower transmitted is
162 * captured by the receiver, and that all signal power associated with
163 * interfering packets affects SINR identically to additional ambient noise.
164 */
166{
167 public:
168 /** Constructor */
170 /** Destructor */
171 ~UanPhyCalcSinrDefault() override;
172
173 /**
174 * Register this type.
175 * \return The TypeId.
176 */
177 static TypeId GetTypeId();
178
179 /**
180 * Calculate the SINR value for a packet.
181 *
182 * This implementation simply adds all arriving signal power
183 * and assumes it acts identically to additional noise.
184 *
185 * \param pkt Packet to calculate SINR for.
186 * \param arrTime Arrival time of pkt.
187 * \param rxPowerDb The received signal strength of the packet in dB re 1 uPa.
188 * \param ambNoiseDb Ambient channel noise in dB re 1 uPa.
189 * \param mode TX Mode of pkt.
190 * \param pdp Power delay profile of pkt.
191 * \param arrivalList List of interfering arrivals given from Transducer.
192 * \return The SINR in dB re 1 uPa.
193 */
194 double CalcSinrDb(Ptr<Packet> pkt,
195 Time arrTime,
196 double rxPowerDb,
197 double ambNoiseDb,
198 UanTxMode mode,
199 UanPdp pdp,
200 const UanTransducer::ArrivalList& arrivalList) const override;
201
202}; // class UanPhyCalcSinrDefault
203
204/**
205 * \ingroup uan
206 *
207 * WHOI Micromodem like FH-FSK model.
208 *
209 * Model of interference calculation for FH-FSK wherein all nodes
210 * use an identical hopping pattern. In this case, there is an (M-1)*SymbolTime
211 * clearing time between symbols transmitted on the same frequency.
212 * This clearing time combats ISI from channel delay spread and also has
213 * a byproduct of possibly reducing interference from other transmitted packets.
214 *
215 * Thanks to Randall Plate for the latest model revision based on the following
216 * papers:
217 * <ul>
218 * <li>Parrish, "System Design Considerations for Undersea Networks: Link and Multiple Access
219 * Protocols" <li>Siderius, "Effects of Ocean Thermocline Variability on Noncoherent Underwater
220 * Acoustic Communications" <li>Rao, "Channel Coding Techniques for Wireless Communications", ch 2
221 * </ul>
222 */
224{
225 public:
226 /** Constructor */
228 /** Destructor */
229 ~UanPhyCalcSinrFhFsk() override;
230
231 /**
232 * Register this type.
233 * \return The TypeId.
234 */
235 static TypeId GetTypeId();
236
237 double CalcSinrDb(Ptr<Packet> pkt,
238 Time arrTime,
239 double rxPowerDb,
240 double ambNoiseDb,
241 UanTxMode mode,
242 UanPdp pdp,
243 const UanTransducer::ArrivalList& arrivalList) const override;
244
245 private:
246 uint32_t m_hops; //!< Number of hops.
247
248}; // class UanPhyCalcSinrFhFsk
249
250/**
251 * \ingroup uan
252 *
253 * Generic PHY model.
254 *
255 * This is a generic PHY class. SINR and PER information
256 * are controlled via attributes. By adapting the SINR
257 * and PER models to a specific situation, this PHY should
258 * be able to model a wide variety of networks.
259 */
260class UanPhyGen : public UanPhy
261{
262 public:
263 /** Constructor */
264 UanPhyGen();
265 /** Dummy destructor, see DoDispose */
266 ~UanPhyGen() override;
267 /**
268 * Get the default transmission modes.
269 *
270 * \return The default mode list.
271 */
273
274 /**
275 * Register this type.
276 * \return The TypeId.
277 */
278 static TypeId GetTypeId();
279
280 // Inherited methods
282 void EnergyDepletionHandler() override;
283 void EnergyRechargeHandler() override;
284 void SendPacket(Ptr<Packet> pkt, uint32_t modeNum) override;
285 void RegisterListener(UanPhyListener* listener) override;
286 void StartRxPacket(Ptr<Packet> pkt, double rxPowerDb, UanTxMode txMode, UanPdp pdp) override;
287 void SetReceiveOkCallback(RxOkCallback cb) override;
288 void SetReceiveErrorCallback(RxErrCallback cb) override;
289 bool IsStateSleep() override;
290 bool IsStateIdle() override;
291 bool IsStateBusy() override;
292 bool IsStateRx() override;
293 bool IsStateTx() override;
294 bool IsStateCcaBusy() override;
295 void SetTxPowerDb(double txpwr) override;
296 void SetRxThresholdDb(double thresh) override;
297 void SetCcaThresholdDb(double thresh) override;
298 double GetTxPowerDb() override;
299 double GetRxThresholdDb() override;
300 double GetCcaThresholdDb() override;
301 Ptr<UanChannel> GetChannel() const override;
302 Ptr<UanNetDevice> GetDevice() const override;
304 void SetChannel(Ptr<UanChannel> channel) override;
305 void SetDevice(Ptr<UanNetDevice> device) override;
306 void SetMac(Ptr<UanMac> mac) override;
307 void SetTransducer(Ptr<UanTransducer> trans) override;
308 void NotifyTransStartTx(Ptr<Packet> packet, double txPowerDb, UanTxMode txMode) override;
309 void NotifyIntChange() override;
310 uint32_t GetNModes() override;
311 UanTxMode GetMode(uint32_t n) override;
312 Ptr<Packet> GetPacketRx() const override;
313 void Clear() override;
314 void SetSleepMode(bool sleep) override;
315 int64_t AssignStreams(int64_t stream) override;
316
317 private:
318 /** List of Phy Listeners. */
319 typedef std::list<UanPhyListener*> ListenerList;
320
321 UanModesList m_modes; //!< List of modes supported by this PHY.
322
323 State m_state; //!< Phy state.
324 ListenerList m_listeners; //!< List of listeners.
325 RxOkCallback m_recOkCb; //!< Callback for packets received without error.
326 RxErrCallback m_recErrCb; //!< Callback for packets received with errors.
327 Ptr<UanChannel> m_channel; //!< Attached channel.
328 Ptr<UanTransducer> m_transducer; //!< Associated transducer.
329 Ptr<UanNetDevice> m_device; //!< Device hosting this Phy.
330 Ptr<UanMac> m_mac; //!< MAC layer.
331 Ptr<UanPhyPer> m_per; //!< Error model.
332 Ptr<UanPhyCalcSinr> m_sinr; //!< SINR calculator.
333
334 double m_txPwrDb; //!< Transmit power.
335 double m_rxThreshDb; //!< Receive SINR threshold.
336 double m_ccaThreshDb; //!< CCA busy threshold.
337
338 Ptr<Packet> m_pktRx; //!< Received packet.
339 Ptr<Packet> m_pktTx; //!< Sent packet.
340 double m_minRxSinrDb; //!< Minimum receive SINR during packet reception.
341 double m_rxRecvPwrDb; //!< Receiver power.
342 Time m_pktRxArrTime; //!< Packet arrival time.
343 UanPdp m_pktRxPdp; //!< Power delay profile of packet.
344 UanTxMode m_pktRxMode; //!< Packet transmission mode at receiver.
345
346 bool m_cleared; //!< Flag when we've been cleared.
347
348 EventId m_txEndEvent; //!< Tx event
349 EventId m_rxEndEvent; //!< Rx event
350
351 /** Provides uniform random variables. */
353
354 /** Energy model callback. */
356 /** A packet destined for this Phy was received without error. */
358 /** A packet destined for this Phy was received with error. */
360 /** A packet was sent from this Phy. */
362
363 /**
364 * Calculate the SINR value for a packet.
365 *
366 * \param pkt Packet to calculate SINR for.
367 * \param arrTime Arrival time of pkt.
368 * \param rxPowerDb The received signal strength of the packet in dB re 1 uPa.
369 * \param mode TX Mode of pkt.
370 * \param pdp Power delay profile of pkt.
371 * \return The SINR in dB re 1 uPa.
372 */
373 double CalculateSinrDb(Ptr<Packet> pkt,
374 Time arrTime,
375 double rxPowerDb,
376 UanTxMode mode,
377 UanPdp pdp);
378
379 /**
380 * Calculate interference power from overlapping packet arrivals, in dB.
381 *
382 * The "signal" packet power is excluded. Use
383 * GetInterferenceDb ( (Ptr<Packet>) 0) to treat all signals as
384 * interference, for instance in calculating the CCA busy.
385 *
386 * \param pkt The arriving (signal) packet.
387 * \return The total interference power, in dB.
388 */
389 double GetInterferenceDb(Ptr<Packet> pkt);
390 /**
391 * Convert dB to kilopascals.
392 *
393 * \f[{\rm{kPa}} = {10^{\frac{{{\rm{dB}}}}{{10}}}}\f]
394 *
395 * \param db Signal level in dB.
396 * \return Sound pressure in kPa.
397 */
398 double DbToKp(double db);
399 /**
400 * Convert kilopascals to dB.
401 *
402 * \f[{\rm{dB}} = 10{\log _{10}}{\rm{kPa}}\f]
403 *
404 * \param kp Sound pressure in kPa.
405 * \return Signal level in dB.
406 */
407 double KpToDb(double kp);
408 /**
409 * Event to process end of packet reception.
410 *
411 * \param pkt The packet.
412 * \param rxPowerDb Received signal power.
413 * \param txMode Transmission mode.
414 */
415 void RxEndEvent(Ptr<Packet> pkt, double rxPowerDb, UanTxMode txMode);
416 /** Event to process end of packet transmission. */
417 void TxEndEvent();
418 /**
419 * Update energy source with new state.
420 *
421 * \param state The new Phy state.
422 */
423 void UpdatePowerConsumption(const State state);
424
425 /** Call UanListener::NotifyRxStart on all listeners. */
427 /** Call UanListener::NotifyRxEndOk on all listeners. */
429 /** Call UanListener::NotifyRxEndError on all listeners. */
431 /** Call UanListener::NotifyCcaStart on all listeners. */
433 /** Call UanListener::NotifyCcaEnd on all listeners. */
435 /**
436 * Call UanListener::NotifyTxStart on all listeners.
437 *
438 * \param duration Duration of transmission.
439 */
440 void NotifyListenersTxStart(Time duration);
441 /**
442 * Call UanListener::NotifyTxEnd on all listeners.
443 */
445
446 protected:
447 void DoDispose() override;
448
449}; // class UanPhyGen
450
451} // namespace ns3
452
453#endif /* UAN_PHY_GEN_H */
An identifier for simulation events.
Definition: event-id.h:55
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:77
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:105
Forward calls to a chain of Callback.
a unique identifier for an interface.
Definition: type-id.h:59
Container for UanTxModes.
Definition: uan-tx-mode.h:259
The power delay profile returned by propagation models.
Default SINR calculator for UanPhyGen.
Definition: uan-phy-gen.h:166
double CalcSinrDb(Ptr< Packet > pkt, Time arrTime, double rxPowerDb, double ambNoiseDb, UanTxMode mode, UanPdp pdp, const UanTransducer::ArrivalList &arrivalList) const override
Calculate the SINR value for a packet.
Definition: uan-phy-gen.cc:72
UanPhyCalcSinrDefault()
Constructor.
Definition: uan-phy-gen.cc:53
static TypeId GetTypeId()
Register this type.
Definition: uan-phy-gen.cc:62
~UanPhyCalcSinrDefault() override
Destructor.
Definition: uan-phy-gen.cc:57
WHOI Micromodem like FH-FSK model.
Definition: uan-phy-gen.h:224
UanPhyCalcSinrFhFsk()
Constructor.
Definition: uan-phy-gen.cc:102
double CalcSinrDb(Ptr< Packet > pkt, Time arrTime, double rxPowerDb, double ambNoiseDb, UanTxMode mode, UanPdp pdp, const UanTransducer::ArrivalList &arrivalList) const override
Calculate the SINR value for a packet.
Definition: uan-phy-gen.cc:126
static TypeId GetTypeId()
Register this type.
Definition: uan-phy-gen.cc:111
~UanPhyCalcSinrFhFsk() override
Destructor.
Definition: uan-phy-gen.cc:106
uint32_t m_hops
Number of hops.
Definition: uan-phy-gen.h:246
Class used for calculating SINR of packet in UanPhy.
Definition: uan-phy.h:44
Generic PHY model.
Definition: uan-phy-gen.h:261
std::list< UanPhyListener * > ListenerList
List of Phy Listeners.
Definition: uan-phy-gen.h:319
Ptr< UanChannel > GetChannel() const override
Get the attached channel.
Definition: uan-phy-gen.cc:970
bool IsStateSleep() override
Definition: uan-phy-gen.cc:898
void SetTxPowerDb(double txpwr) override
Set the transmit power.
Definition: uan-phy-gen.cc:934
double KpToDb(double kp)
Convert kilopascals to dB.
void NotifyTransStartTx(Ptr< Packet > packet, double txPowerDb, UanTxMode txMode) override
Called when a transmission is beginning on the attached transducer.
int64_t AssignStreams(int64_t stream) override
Assign a fixed random variable stream number to the random variables used by this model.
Ptr< UanPhyPer > m_per
Error model.
Definition: uan-phy-gen.h:331
UanPhyGen()
Constructor.
Definition: uan-phy-gen.cc:493
void SetRxThresholdDb(double thresh) override
Set the minimum SINR threshold to receive a packet without errors.
Definition: uan-phy-gen.cc:940
void EnergyDepletionHandler() override
Handle the energy depletion event.
Definition: uan-phy-gen.cc:652
void NotifyListenersTxStart(Time duration)
Call UanListener::NotifyTxStart on all listeners.
Time m_pktRxArrTime
Packet arrival time.
Definition: uan-phy-gen.h:342
UanTxMode GetMode(uint32_t n) override
Get a specific transmission mode.
void UpdatePowerConsumption(const State state)
Update energy source with new state.
Definition: uan-phy-gen.cc:641
double GetRxThresholdDb() override
Get the minimum received signal strength required to receive a packet without errors.
Definition: uan-phy-gen.cc:958
ListenerList m_listeners
List of listeners.
Definition: uan-phy-gen.h:324
void NotifyListenersCcaStart()
Call UanListener::NotifyCcaStart on all listeners.
void SetSleepMode(bool sleep) override
Set the Phy SLEEP mode.
~UanPhyGen() override
Dummy destructor, see DoDispose.
Definition: uan-phy-gen.cc:512
double m_rxRecvPwrDb
Receiver power.
Definition: uan-phy-gen.h:341
bool IsStateBusy() override
Definition: uan-phy-gen.cc:910
void NotifyListenersRxGood()
Call UanListener::NotifyRxEndOk on all listeners.
uint32_t GetNModes() override
Get the number of transmission modes supported by this Phy.
Ptr< UanPhyCalcSinr > m_sinr
SINR calculator.
Definition: uan-phy-gen.h:332
void NotifyListenersRxBad()
Call UanListener::NotifyRxEndError on all listeners.
double GetCcaThresholdDb() override
Get the CCA threshold signal strength required to detect channel busy.
Definition: uan-phy-gen.cc:964
Ptr< Packet > m_pktRx
Received packet.
Definition: uan-phy-gen.h:338
void SetReceiveErrorCallback(RxErrCallback cb) override
Set the callback to be used when a packet is received with errors.
Definition: uan-phy-gen.cc:892
Ptr< UanTransducer > GetTransducer() override
Get the attached transducer.
Definition: uan-phy-gen.cc:982
DeviceEnergyModel::ChangeStateCallback m_energyCallback
Energy model callback.
Definition: uan-phy-gen.h:355
Ptr< UanTransducer > m_transducer
Associated transducer.
Definition: uan-phy-gen.h:328
double m_rxThreshDb
Receive SINR threshold.
Definition: uan-phy-gen.h:335
EventId m_rxEndEvent
Rx event.
Definition: uan-phy-gen.h:349
void DoDispose() override
Destructor implementation.
Definition: uan-phy-gen.cc:559
double m_ccaThreshDb
CCA busy threshold.
Definition: uan-phy-gen.h:336
void SetTransducer(Ptr< UanTransducer > trans) override
Attach a transducer to this Phy.
RxOkCallback m_recOkCb
Callback for packets received without error.
Definition: uan-phy-gen.h:325
State m_state
Phy state.
Definition: uan-phy-gen.h:323
void NotifyListenersTxEnd()
Call UanListener::NotifyTxEnd on all listeners.
Ptr< UanMac > m_mac
MAC layer.
Definition: uan-phy-gen.h:330
Ptr< UanNetDevice > GetDevice() const override
Get the device hosting this Phy.
Definition: uan-phy-gen.cc:976
double GetInterferenceDb(Ptr< Packet > pkt)
Calculate interference power from overlapping packet arrivals, in dB.
double m_txPwrDb
Transmit power.
Definition: uan-phy-gen.h:334
double CalculateSinrDb(Ptr< Packet > pkt, Time arrTime, double rxPowerDb, UanTxMode mode, UanPdp pdp)
Calculate the SINR value for a packet.
void SetReceiveOkCallback(RxOkCallback cb) override
Set the callback to be used when a packet is received without error.
Definition: uan-phy-gen.cc:886
static UanModesList GetDefaultModes()
Get the default transmission modes.
Definition: uan-phy-gen.cc:567
bool IsStateTx() override
Definition: uan-phy-gen.cc:922
ns3::TracedCallback< Ptr< const Packet >, double, UanTxMode > m_rxOkLogger
A packet destined for this Phy was received without error.
Definition: uan-phy-gen.h:357
Ptr< UniformRandomVariable > m_pg
Provides uniform random variables.
Definition: uan-phy-gen.h:352
EventId m_txEndEvent
Tx event.
Definition: uan-phy-gen.h:348
void SendPacket(Ptr< Packet > pkt, uint32_t modeNum) override
Send a packet using a specific transmission mode.
Definition: uan-phy-gen.cc:684
void RegisterListener(UanPhyListener *listener) override
Register a UanPhyListener to be notified of common UanPhy events.
Definition: uan-phy-gen.cc:748
bool m_cleared
Flag when we've been cleared.
Definition: uan-phy-gen.h:346
bool IsStateRx() override
Definition: uan-phy-gen.cc:916
void SetMac(Ptr< UanMac > mac) override
Set the MAC forwarding messages to this Phy.
double m_minRxSinrDb
Minimum receive SINR during packet reception.
Definition: uan-phy-gen.h:340
static TypeId GetTypeId()
Register this type.
Definition: uan-phy-gen.cc:581
void SetCcaThresholdDb(double thresh) override
Set the threshold for detecting channel busy.
Definition: uan-phy-gen.cc:946
Ptr< UanChannel > m_channel
Attached channel.
Definition: uan-phy-gen.h:327
bool IsStateCcaBusy() override
Definition: uan-phy-gen.cc:928
void SetEnergyModelCallback(DeviceEnergyModel::ChangeStateCallback cb) override
Set the DeviceEnergyModel callback for UanPhy device.
Definition: uan-phy-gen.cc:634
void SetDevice(Ptr< UanNetDevice > device) override
Set the device hosting this Phy.
Definition: uan-phy-gen.cc:994
double DbToKp(double db)
Convert dB to kilopascals.
UanTxMode m_pktRxMode
Packet transmission mode at receiver.
Definition: uan-phy-gen.h:344
void TxEndEvent()
Event to process end of packet transmission.
Definition: uan-phy-gen.cc:724
void Clear() override
Clear all pointer references.
Definition: uan-phy-gen.cc:517
Ptr< Packet > GetPacketRx() const override
Get the packet currently being received.
RxErrCallback m_recErrCb
Callback for packets received with errors.
Definition: uan-phy-gen.h:326
void RxEndEvent(Ptr< Packet > pkt, double rxPowerDb, UanTxMode txMode)
Event to process end of packet reception.
Definition: uan-phy-gen.cc:836
Ptr< UanNetDevice > m_device
Device hosting this Phy.
Definition: uan-phy-gen.h:329
void StartRxPacket(Ptr< Packet > pkt, double rxPowerDb, UanTxMode txMode, UanPdp pdp) override
Packet arriving from channel: i.e.
Definition: uan-phy-gen.cc:754
Ptr< Packet > m_pktTx
Sent packet.
Definition: uan-phy-gen.h:339
void SetChannel(Ptr< UanChannel > channel) override
Attach to a channel.
Definition: uan-phy-gen.cc:988
ns3::TracedCallback< Ptr< const Packet >, double, UanTxMode > m_txLogger
A packet was sent from this Phy.
Definition: uan-phy-gen.h:361
void NotifyIntChange() override
Called when there has been a change in the amount of interference this node is experiencing from othe...
double GetTxPowerDb() override
Get the current transmit power, in dB.
Definition: uan-phy-gen.cc:952
bool IsStateIdle() override
Definition: uan-phy-gen.cc:904
UanPdp m_pktRxPdp
Power delay profile of packet.
Definition: uan-phy-gen.h:343
void NotifyListenersCcaEnd()
Call UanListener::NotifyCcaEnd on all listeners.
void EnergyRechargeHandler() override
Handle the energy recharge event.
Definition: uan-phy-gen.cc:674
void NotifyListenersRxStart()
Call UanListener::NotifyRxStart on all listeners.
ns3::TracedCallback< Ptr< const Packet >, double, UanTxMode > m_rxErrLogger
A packet destined for this Phy was received with error.
Definition: uan-phy-gen.h:359
UanModesList m_modes
List of modes supported by this PHY.
Definition: uan-phy-gen.h:321
Base class for UAN Phy models.
Definition: uan-phy.h:178
State
Enum defining possible Phy states.
Definition: uan-phy.h:182
Interface for PHY event listener.
Definition: uan-phy.h:145
Packet error rate calculation for common tx modes based on UanPhyPerUmodem.
Definition: uan-phy-gen.h:127
~UanPhyPerCommonModes() override
Destructor.
Definition: uan-phy-gen.cc:263
double CalcPer(Ptr< Packet > pkt, double sinrDb, UanTxMode mode) override
Calculate the Packet ERror probability based on SINR at the receiver and a tx mode.
Definition: uan-phy-gen.cc:279
UanPhyPerCommonModes()
Constructor.
Definition: uan-phy-gen.cc:258
static TypeId GetTypeId()
Register this type.
Definition: uan-phy-gen.cc:268
Default Packet Error Rate calculator for UanPhyGen.
Definition: uan-phy-gen.h:46
UanPhyPerGenDefault()
Constructor.
Definition: uan-phy-gen.cc:219
~UanPhyPerGenDefault() override
Destructor.
Definition: uan-phy-gen.cc:223
double CalcPer(Ptr< Packet > pkt, double sinrDb, UanTxMode mode) override
Calculate the packet error probability based on SINR at the receiver and a tx mode.
Definition: uan-phy-gen.cc:245
static TypeId GetTypeId()
Register this type.
Definition: uan-phy-gen.cc:228
double m_thresh
SINR threshold.
Definition: uan-phy-gen.h:62
Calculate packet error probability, based on received SINR and modulation (mode).
Definition: uan-phy.h:110
Packet error rate calculation assuming WHOI Micromodem-like PHY (FH-FSK)
Definition: uan-phy-gen.h:76
double CalcPer(Ptr< Packet > pkt, double sinrDb, UanTxMode mode) override
Calculate the packet error probability based on SINR at the receiver and a tx mode.
Definition: uan-phy-gen.cc:432
static TypeId GetTypeId()
Register this type.
Definition: uan-phy-gen.cc:402
double NChooseK(uint32_t n, uint32_t k)
Binomial coefficient.
Definition: uan-phy-gen.cc:412
UanPhyPerUmodem()
Constructor.
Definition: uan-phy-gen.cc:393
~UanPhyPerUmodem() override
Destructor.
Definition: uan-phy-gen.cc:397
std::list< UanPacketArrival > ArrivalList
List of arriving packets overlapping in time.
Abstraction of packet modulation information.
Definition: uan-tx-mode.h:43
Every class exported by the ns3 library is enclosed in the ns3 namespace.