A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
yans-wifi-phy.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2005,2006 INRIA
3 *
4 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 * Authors: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
7 * Ghada Badawy <gbadawy@gmail.com>
8 * Sébastien Deronne <sebastien.deronne@gmail.com>
9 */
10
11#ifndef YANS_WIFI_PHY_H
12#define YANS_WIFI_PHY_H
13
14#include "wifi-phy.h"
15
16namespace ns3
17{
18
19class YansWifiChannel;
20
21/**
22 * \brief 802.11 PHY layer model
23 * \ingroup wifi
24 *
25 * This PHY implements a model of 802.11a. The model
26 * implemented here is based on the model described
27 * in "Yet Another Network Simulator" published in WNS2 2006;
28 * an author-prepared version of this paper is at:
29 * https://hal.inria.fr/file/index/docid/78318/filename/yans-rr.pdf
30 *
31 * This PHY model depends on a channel loss and delay
32 * model as provided by the ns3::PropagationLossModel
33 * and ns3::PropagationDelayModel classes, both of which are
34 * members of the ns3::YansWifiChannel class.
35 */
36class YansWifiPhy : public WifiPhy
37{
38 public:
39 /**
40 * \brief Get the type ID.
41 * \return the object TypeId
42 */
43 static TypeId GetTypeId();
44
46 ~YansWifiPhy() override;
47
48 void SetInterferenceHelper(const Ptr<InterferenceHelper> helper) override;
49 void StartTx(Ptr<const WifiPpdu> ppdu) override;
50 Ptr<Channel> GetChannel() const override;
51 MHz_u GetGuardBandwidth(MHz_u currentChannelWidth) const override;
52 std::tuple<dBr_u, dBr_u, dBr_u> GetTxMaskRejectionParams() const override;
53 WifiSpectrumBandInfo GetBand(MHz_u bandWidth, uint8_t bandIndex = 0) override;
56 const WifiSpectrumBandIndices& indices) const override;
57
58 /**
59 * Set the YansWifiChannel this YansWifiPhy is to be connected to.
60 *
61 * \param channel the YansWifiChannel this YansWifiPhy is to be connected to
62 */
63 void SetChannel(const Ptr<YansWifiChannel> channel);
64
65 /**
66 * Logs the arrival of a PPDU, including its power and duration.
67 * This will also trace PPDUs below WifiPhy::RxSensitivity
68 *
69 * \param [in] ppdu The PPDU being traced upon its arrival.
70 * \param [in] rxPowerDbm The received power of the PPDU in dBm.
71 * \param [in] duration The duration of the PPDU signal.
72 */
73 void TraceSignalArrival(Ptr<const WifiPpdu> ppdu, double rxPowerDbm, Time duration);
74
75 /**
76 * Callback invoked when the PHY model starts to process a signal
77 *
78 * \param ppdu The PPDU being processed
79 * \param rxPowerDbm received signal power (dBm)
80 * \param duration Signal duration
81 */
83 double rxPowerDbm,
84 Time duration);
85
86 protected:
87 void DoDispose() override;
88
89 private:
90 void FinalizeChannelSwitch() override;
91
92 Ptr<YansWifiChannel> m_channel; //!< YansWifiChannel that this YansWifiPhy is connected to
93
95 m_signalArrivalCb; //!< Signal Arrival callback
96};
97
98} // namespace ns3
99
100#endif /* YANS_WIFI_PHY_H */
Smart pointer class similar to boost::intrusive_ptr.
Simulation virtual time values and global simulation resolution.
Definition nstime.h:94
Forward calls to a chain of Callback.
a unique identifier for an interface.
Definition type-id.h:48
802.11 PHY layer model
Definition wifi-phy.h:55
802.11 PHY layer model
WifiSpectrumBandFrequencies ConvertIndicesToFrequencies(const WifiSpectrumBandIndices &indices) const override
This is a helper function to convert start and stop indices to start and stop frequencies.
void(* SignalArrivalCallback)(Ptr< const WifiPpdu > ppdu, double rxPowerDbm, Time duration)
Callback invoked when the PHY model starts to process a signal.
Ptr< YansWifiChannel > m_channel
YansWifiChannel that this YansWifiPhy is connected to.
FrequencyRange GetCurrentFrequencyRange() const override
Get the frequency range of the current RF interface.
void StartTx(Ptr< const WifiPpdu > ppdu) override
std::tuple< dBr_u, dBr_u, dBr_u > GetTxMaskRejectionParams() const override
MHz_u GetGuardBandwidth(MHz_u currentChannelWidth) const override
WifiSpectrumBandInfo GetBand(MHz_u bandWidth, uint8_t bandIndex=0) override
Get the info of a given band.
TracedCallback< Ptr< const WifiPpdu >, double, Time > m_signalArrivalCb
Signal Arrival callback.
void SetChannel(const Ptr< YansWifiChannel > channel)
Set the YansWifiChannel this YansWifiPhy is to be connected to.
~YansWifiPhy() override
void FinalizeChannelSwitch() override
Method that can be overridden by subclasses to perform operations after the channel is actually switc...
void SetInterferenceHelper(const Ptr< InterferenceHelper > helper) override
Sets the interference helper.
Ptr< Channel > GetChannel() const override
Return the Channel this WifiPhy is connected to.
void DoDispose() override
Destructor implementation.
static TypeId GetTypeId()
Get the type ID.
void TraceSignalArrival(Ptr< const WifiPpdu > ppdu, double rxPowerDbm, Time duration)
Logs the arrival of a PPDU, including its power and duration.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
std::pair< Hz_u, Hz_u > WifiSpectrumBandFrequencies
typedef for a pair of start and stop frequencies to represent a band
std::pair< uint32_t, uint32_t > WifiSpectrumBandIndices
typedef for a pair of start and stop sub-band indices
Struct defining a frequency range between minFrequency and maxFrequency.
WifiSpectrumBandInfo structure containing info about a spectrum band.