OLD | NEW |
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ | 1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
2 /* | 2 /* |
3 * Copyright (c) 2005,2006 INRIA | 3 * Copyright (c) 2005,2006 INRIA |
4 * | 4 * |
5 * This program is free software; you can redistribute it and/or modify | 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 | 6 * it under the terms of the GNU General Public License version 2 as |
7 * published by the Free Software Foundation; | 7 * published by the Free Software Foundation; |
8 * | 8 * |
9 * This program is distributed in the hope that it will be useful, | 9 * This program is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 * GNU General Public License for more details. | 12 * GNU General Public License for more details. |
13 * | 13 * |
14 * You should have received a copy of the GNU General Public License | 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 | 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 | 16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
17 * | 17 * |
18 * Authors: Mathieu Lacage <mathieu.lacage@sophia.inria.fr> | 18 * Authors: Mathieu Lacage <mathieu.lacage@sophia.inria.fr> |
19 * Sébastien Deronne <sebastien.deronne@gmail.com> | 19 * Sébastien Deronne <sebastien.deronne@gmail.com> |
20 */ | 20 */ |
21 | 21 |
22 #ifndef WIFI_PHY_H | 22 #ifndef WIFI_PHY_H |
23 #define WIFI_PHY_H | 23 #define WIFI_PHY_H |
24 | 24 |
25 #include <map> | |
26 #include "ns3/event-id.h" | 25 #include "ns3/event-id.h" |
27 #include "ns3/mobility-model.h" | 26 #include "wifi-mpdu-type.h" |
28 #include "ns3/random-variable-stream.h" | |
29 #include "ns3/channel.h" | |
30 #include "wifi-phy-standard.h" | 27 #include "wifi-phy-standard.h" |
31 #include "interference-helper.h" | 28 #include "interference-helper.h" |
32 #include "ns3/node.h" | |
33 #include "ns3/string.h" | |
34 #include "wifi-phy-state-helper.h" | 29 #include "wifi-phy-state-helper.h" |
35 | 30 |
36 namespace ns3 { | 31 namespace ns3 { |
37 | 32 |
38 #define HE_PHY 125 | 33 #define HE_PHY 125 |
39 #define VHT_PHY 126 | 34 #define VHT_PHY 126 |
40 #define HT_PHY 127 | 35 #define HT_PHY 127 |
41 | 36 |
42 /** | 37 class Channel; |
43 * WifiPhyStateHelper class | 38 class NetDevice; |
44 */ | 39 class MobilityModel; |
45 class WifiPhyStateHelper; | 40 class WifiPhyStateHelper; |
46 | |
47 /** | |
48 * FrameCaptureModel class | |
49 */ | |
50 class FrameCaptureModel; | 41 class FrameCaptureModel; |
51 | |
52 /** | |
53 * WifiRadioEnergyModel class | |
54 */ | |
55 class WifiRadioEnergyModel; | 42 class WifiRadioEnergyModel; |
56 | 43 class UniformRandomVariable; |
57 /** | |
58 * This enumeration defines the type of an MPDU. | |
59 */ | |
60 /// MpduType enumeration | |
61 enum MpduType | |
62 { | |
63 /** The MPDU is not part of an A-MPDU */ | |
64 NORMAL_MPDU = 0, | |
65 /** The MPDU is part of an A-MPDU, but is not the last aggregate */ | |
66 MPDU_IN_AGGREGATE, | |
67 /** The MPDU is the last aggregate in an A-MPDU */ | |
68 LAST_MPDU_IN_AGGREGATE | |
69 }; | |
70 | 44 |
71 /// SignalNoiseDbm structure | 45 /// SignalNoiseDbm structure |
72 struct SignalNoiseDbm | 46 struct SignalNoiseDbm |
73 { | 47 { |
74 double signal; ///< in dBm | 48 double signal; ///< in dBm |
75 double noise; ///< in dBm | 49 double noise; ///< in dBm |
76 }; | 50 }; |
77 | 51 |
78 /// MpduInfo structure | 52 /// MpduInfo structure |
79 struct MpduInfo | 53 struct MpduInfo |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 * Starting receiving the payload of a packet (i.e. the first bit of the packe
t has arrived). | 119 * Starting receiving the payload of a packet (i.e. the first bit of the packe
t has arrived). |
146 * | 120 * |
147 * \param packet the arriving packet | 121 * \param packet the arriving packet |
148 * \param txVector the TXVECTOR of the arriving packet | 122 * \param txVector the TXVECTOR of the arriving packet |
149 * \param mpdutype the type of the MPDU as defined in WifiPhy::MpduType. | 123 * \param mpdutype the type of the MPDU as defined in WifiPhy::MpduType. |
150 * \param event the corresponding event of the first time the packet arrives | 124 * \param event the corresponding event of the first time the packet arrives |
151 */ | 125 */ |
152 void StartReceivePacket (Ptr<Packet> packet, | 126 void StartReceivePacket (Ptr<Packet> packet, |
153 WifiTxVector txVector, | 127 WifiTxVector txVector, |
154 MpduType mpdutype, | 128 MpduType mpdutype, |
155 Ptr<InterferenceHelper::Event> event); | 129 Ptr<Event> event); |
156 | 130 |
157 /** | 131 /** |
158 * The last bit of the packet has arrived. | 132 * The last bit of the packet has arrived. |
159 * | 133 * |
160 * \param packet the packet that the last bit has arrived | 134 * \param packet the packet that the last bit has arrived |
161 * \param preamble the preamble of the arriving packet | 135 * \param preamble the preamble of the arriving packet |
162 * \param mpdutype the type of the MPDU as defined in WifiPhy::MpduType. | 136 * \param mpdutype the type of the MPDU as defined in WifiPhy::MpduType. |
163 * \param event the corresponding event of the first time the packet arrives | 137 * \param event the corresponding event of the first time the packet arrives |
164 */ | 138 */ |
165 void EndReceive (Ptr<Packet> packet, WifiPreamble preamble, MpduType mpdutype,
Ptr<InterferenceHelper::Event> event); | 139 void EndReceive (Ptr<Packet> packet, WifiPreamble preamble, MpduType mpdutype,
Ptr<Event> event); |
166 | 140 |
167 /** | 141 /** |
168 * \param packet the packet to send | 142 * \param packet the packet to send |
169 * \param txVector the TXVECTOR that has tx parameters such as mode, the trans
mission mode to use to send | 143 * \param txVector the TXVECTOR that has tx parameters such as mode, the trans
mission mode to use to send |
170 * this packet, and txPowerLevel, a power level to use to send this pac
ket. The real transmission | 144 * this packet, and txPowerLevel, a power level to use to send this pac
ket. The real transmission |
171 * power is calculated as txPowerMin + txPowerLevel * (txPowerMax - txP
owerMin) / nTxLevels | 145 * power is calculated as txPowerMin + txPowerLevel * (txPowerMax - txP
owerMin) / nTxLevels |
172 * \param mpdutype the type of the MPDU as defined in WifiPhy::MpduType. | 146 * \param mpdutype the type of the MPDU as defined in WifiPhy::MpduType. |
173 */ | 147 */ |
174 void SendPacket (Ptr<const Packet> packet, WifiTxVector txVector, MpduType mpd
utype = NORMAL_MPDU); | 148 void SendPacket (Ptr<const Packet> packet, WifiTxVector txVector, MpduType mpd
utype = NORMAL_MPDU); |
175 | 149 |
(...skipping 1505 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1681 * \param mpdutype the type of the MPDU as defined in WifiPhy::MpduType. | 1655 * \param mpdutype the type of the MPDU as defined in WifiPhy::MpduType. |
1682 * \param rxPowerW the receive power in W | 1656 * \param rxPowerW the receive power in W |
1683 * \param rxDuration the duration needed for the reception of the packet | 1657 * \param rxDuration the duration needed for the reception of the packet |
1684 * \param event the corresponding event of the first time the packet arrives | 1658 * \param event the corresponding event of the first time the packet arrives |
1685 */ | 1659 */ |
1686 void StartRx (Ptr<Packet> packet, | 1660 void StartRx (Ptr<Packet> packet, |
1687 WifiTxVector txVector, | 1661 WifiTxVector txVector, |
1688 MpduType mpdutype, | 1662 MpduType mpdutype, |
1689 double rxPowerW, | 1663 double rxPowerW, |
1690 Time rxDuration, | 1664 Time rxDuration, |
1691 Ptr<InterferenceHelper::Event> event); | 1665 Ptr<Event> event); |
1692 | 1666 |
1693 /** | 1667 /** |
1694 * The trace source fired when a packet begins the transmission process on | 1668 * The trace source fired when a packet begins the transmission process on |
1695 * the medium. | 1669 * the medium. |
1696 * | 1670 * |
1697 * \see class CallBackTraceSource | 1671 * \see class CallBackTraceSource |
1698 */ | 1672 */ |
1699 TracedCallback<Ptr<const Packet> > m_phyTxBeginTrace; | 1673 TracedCallback<Ptr<const Packet> > m_phyTxBeginTrace; |
1700 | 1674 |
1701 /** | 1675 /** |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1840 uint8_t m_channelNumber; //!< Operating channel number | 1814 uint8_t m_channelNumber; //!< Operating channel number |
1841 uint8_t m_initialChannelNumber; //!< Initial channel number | 1815 uint8_t m_initialChannelNumber; //!< Initial channel number |
1842 | 1816 |
1843 Time m_channelSwitchDelay; //!< Time required to switch between channel | 1817 Time m_channelSwitchDelay; //!< Time required to switch between channel |
1844 uint32_t m_totalAmpduSize; //!< Total size of the previously transmitted M
PDUs in an A-MPDU, used for the computation of the number of symbols needed for
the last MPDU in the A-MPDU | 1818 uint32_t m_totalAmpduSize; //!< Total size of the previously transmitted M
PDUs in an A-MPDU, used for the computation of the number of symbols needed for
the last MPDU in the A-MPDU |
1845 double m_totalAmpduNumSymbols; //!< Number of symbols previously transmitted f
or the MPDUs in an A-MPDU, used for the computation of the number of symbols nee
ded for the last MPDU in the A-MPDU | 1819 double m_totalAmpduNumSymbols; //!< Number of symbols previously transmitted f
or the MPDUs in an A-MPDU, used for the computation of the number of symbols nee
ded for the last MPDU in the A-MPDU |
1846 | 1820 |
1847 Ptr<NetDevice> m_device; //!< Pointer to the device | 1821 Ptr<NetDevice> m_device; //!< Pointer to the device |
1848 Ptr<MobilityModel> m_mobility; //!< Pointer to the mobility model | 1822 Ptr<MobilityModel> m_mobility; //!< Pointer to the mobility model |
1849 | 1823 |
1850 Ptr<InterferenceHelper::Event> m_currentEvent; //!< Hold the current event | 1824 Ptr<Event> m_currentEvent; //!< Hold the current event |
1851 Ptr<FrameCaptureModel> m_frameCaptureModel; //!< Frame capture model | 1825 Ptr<FrameCaptureModel> m_frameCaptureModel; //!< Frame capture model |
1852 Ptr<WifiRadioEnergyModel> m_wifiRadioEnergyModel; //!< Wifi radio energy model | 1826 Ptr<WifiRadioEnergyModel> m_wifiRadioEnergyModel; //!< Wifi radio energy model |
1853 | 1827 |
1854 Callback<void> m_capabilitiesChangedCallback; //!< Callback when PHY capabilit
ies changed | 1828 Callback<void> m_capabilitiesChangedCallback; //!< Callback when PHY capabilit
ies changed |
1855 }; | 1829 }; |
1856 | 1830 |
1857 /** | 1831 /** |
1858 * \param os output stream | 1832 * \param os output stream |
1859 * \param state wifi state to stringify | 1833 * \param state wifi state to stringify |
1860 * \return output stream | 1834 * \return output stream |
1861 */ | 1835 */ |
1862 std::ostream& operator<< (std::ostream& os, WifiPhyState state); | 1836 std::ostream& operator<< (std::ostream& os, WifiPhyState state); |
1863 | 1837 |
1864 } //namespace ns3 | 1838 } //namespace ns3 |
1865 | 1839 |
1866 #endif /* WIFI_PHY_H */ | 1840 #endif /* WIFI_PHY_H */ |
OLD | NEW |