View | Details | Raw Unified | Return to bug 2368
Collapse All | Expand All

(-)a/src/wifi/examples/test-frame-capture.cc (+291 lines)
Line 0    Link Here 
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2
/*
3
 * Copyright (c) 2015
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: Sébastien Deronne <sebastien.deronne@gmail.com>
19
 */
20
21
//
22
// This script is used to verify the behavior of InterferenceHelper.
23
//
24
// The scenario consists of two IEEE 802.11 hidden stations and an access point.
25
// The two stations have both a packet to transmit to the access point.
26
//
27
//
28
// (xA,0,0)     (0,0,0)      (xB,0,0)
29
//
30
//    *   ----->   *   <-----   *
31
//    |            |            |
32
//   STA A         AP          STA B
33
//
34
//
35
// The program can be configured at run-time by passing command-line arguments.
36
// It enables to configure the delay between the transmission from station A
37
// and the transmission from station B (--delay option). It is also possible to
38
// select the tx power level (--txPowerA and --txPowerB options), the packet size
39
// (--packetSizeA and --packetSizeB options) and the modulation (--txModeA and
40
// --txModeB options) used for the respective transmissions.
41
//
42
// By default, IEEE 802.11a with long preamble type is considered, but those
43
// parameters can be also picked among other IEEE 802.11 flavors and preamble
44
// types available in the simulator (--standard and --preamble options).
45
// Note that the program checks the consistency between the selected standard
46
// the selected preamble type.
47
//
48
// The output of the program displays InterfenceHelper and YansWifiPhy trace
49
// logs associated to the chosen scenario.
50
//
51
52
#include "ns3/core-module.h"
53
#include "ns3/yans-wifi-channel.h"
54
#include "ns3/propagation-loss-model.h"
55
#include "ns3/propagation-delay-model.h"
56
#include "ns3/nist-error-rate-model.h"
57
#include "ns3/constant-position-mobility-model.h"
58
59
using namespace ns3;
60
61
class FrameCaptureExperiment
62
{
63
public:
64
  struct Input
65
  {
66
    Input ();
67
    Time interval;
68
    double xA;
69
    double xB;
70
    std::string txModeA;
71
    std::string txModeB;
72
    uint32_t txPowerLevelA;
73
    uint32_t txPowerLevelB;
74
    double txPowerA;
75
    double txPowerB;
76
    uint32_t packetSizeA;
77
    uint32_t packetSizeB;
78
    WifiPhyStandard standard;
79
    WifiPreamble preamble;
80
  };
81
  FrameCaptureExperiment ();
82
  void Run (struct FrameCaptureExperiment::Input input);
83
84
private:
85
  void SendA (void) const;
86
  void SendB (void) const;
87
  Ptr<YansWifiPhy> m_txA;
88
  Ptr<YansWifiPhy> m_txB;
89
  struct Input m_input;
90
};
91
92
void
93
FrameCaptureExperiment::SendA (void) const
94
{
95
  Ptr<Packet> p = Create<Packet> (m_input.packetSizeA);
96
  WifiTxVector txVector;
97
  txVector.SetTxPowerLevel (m_input.txPowerLevelA);
98
  txVector.SetMode (WifiMode (m_input.txModeA));
99
  txVector.SetPreambleType (m_input.preamble);
100
  m_txA->SetTxPowerStart(m_input.txPowerA);
101
  m_txA->SetTxPowerEnd(m_input.txPowerA);
102
  m_txA->SendPacket (p, txVector);
103
}
104
105
void
106
FrameCaptureExperiment::SendB (void) const
107
{
108
  Ptr<Packet> p = Create<Packet> (m_input.packetSizeB);
109
  WifiTxVector txVector;
110
  txVector.SetTxPowerLevel (m_input.txPowerLevelB);
111
  txVector.SetMode (WifiMode (m_input.txModeB));
112
  txVector.SetPreambleType (m_input.preamble);
113
  m_txB->SetTxPowerStart(m_input.txPowerB);
114
  m_txB->SetTxPowerEnd(m_input.txPowerB);
115
  m_txB->SendPacket (p, txVector);
116
}
117
118
FrameCaptureExperiment::FrameCaptureExperiment ()
119
{
120
}
121
FrameCaptureExperiment::Input::Input ()
122
  : interval (MicroSeconds (0)),
123
    xA (-5),
124
    xB (5),
125
    txModeA ("OfdmRate12Mbps"),
126
    txModeB ("OfdmRate12Mbps"),
127
    txPowerLevelA (0),
128
    txPowerLevelB (0),
129
    txPowerA (20),
130
    txPowerB (20),
131
    packetSizeA (1500),
132
    packetSizeB (1500),
133
    standard (WIFI_PHY_STANDARD_80211a),
134
    preamble (WIFI_PREAMBLE_LONG)
135
{
136
}
137
138
void
139
FrameCaptureExperiment::Run (struct FrameCaptureExperiment::Input input)
140
{
141
  m_input = input;
142
143
  double range = std::max (std::abs (input.xA), input.xB);
144
  Config::SetDefault ("ns3::RangePropagationLossModel::MaxRange", DoubleValue (range));
145
146
  Ptr<YansWifiChannel> channel = CreateObject<YansWifiChannel> ();
147
  channel->SetPropagationDelayModel (CreateObject<ConstantSpeedPropagationDelayModel> ());
148
  Ptr<RangePropagationLossModel> loss = CreateObject<RangePropagationLossModel> ();
149
  channel->SetPropagationLossModel (loss);
150
151
  Ptr<MobilityModel> posTxA = CreateObject<ConstantPositionMobilityModel> ();
152
  posTxA->SetPosition (Vector (input.xA, 0.0, 0.0));
153
  Ptr<MobilityModel> posTxB = CreateObject<ConstantPositionMobilityModel> ();
154
  posTxB->SetPosition (Vector (input.xB, 0.0, 0.0));
155
  Ptr<MobilityModel> posRx = CreateObject<ConstantPositionMobilityModel> ();
156
  posRx->SetPosition (Vector (0.0, 0.0, 0.0));
157
158
  m_txA = CreateObject<YansWifiPhy> ();
159
  m_txB = CreateObject<YansWifiPhy> ();
160
  Ptr<YansWifiPhy> rx = CreateObject<YansWifiPhy> ();
161
162
  Ptr<ErrorRateModel> error = CreateObject<NistErrorRateModel> ();
163
  m_txA->SetErrorRateModel (error);
164
  m_txB->SetErrorRateModel (error);
165
  rx->SetErrorRateModel (error);
166
  m_txA->SetChannel (channel);
167
  m_txB->SetChannel (channel);
168
  rx->SetChannel (channel);
169
  m_txA->SetMobility (posTxA);
170
  m_txB->SetMobility (posTxB);
171
  rx->SetMobility (posRx);
172
173
  m_txA->ConfigureStandard (input.standard);
174
  m_txB->ConfigureStandard (input.standard);
175
  rx->ConfigureStandard (input.standard);
176
177
  for (int n = 0; n < 1000; ++n)
178
    {
179
      Simulator::Schedule (Seconds (double(n * 0.1)), &FrameCaptureExperiment::SendA, this);
180
      Simulator::Schedule (Seconds (double(n * 0.1)) + input.interval, &FrameCaptureExperiment::SendB, this);
181
    }
182
183
  Simulator::Run ();
184
  Simulator::Destroy ();
185
}
186
187
188
int main (int argc, char *argv[])
189
{
190
  FrameCaptureExperiment::Input input;
191
  std::string str_standard = "WIFI_PHY_STANDARD_80211a";
192
  std::string str_preamble = "WIFI_PREAMBLE_LONG";
193
  double delay = 10; //microseconds
194
195
  CommandLine cmd;
196
  cmd.AddValue ("delay", "Delay in microseconds between frame transmission from sender A and frame transmission from sender B", delay);
197
  cmd.AddValue ("xA", "The position of transmitter A (< 0)", input.xA);
198
  cmd.AddValue ("xB", "The position of transmitter B (> 0)", input.xB);
199
  cmd.AddValue ("packetSizeA", "Packet size in bytes of transmitter A", input.packetSizeA);
200
  cmd.AddValue ("packetSizeB", "Packet size in bytes of transmitter B", input.packetSizeB);
201
  cmd.AddValue ("txPowerA", "TX power level of transmitter A", input.txPowerLevelA);
202
  cmd.AddValue ("txPowerB", "TX power level of transmitter B", input.txPowerLevelB);
203
  cmd.AddValue ("txPowerA", "TX power of transmitter A", input.txPowerA);
204
  cmd.AddValue ("txPowerB", "TX power of transmitter B", input.txPowerB);
205
  cmd.AddValue ("txModeA", "Wifi mode used for payload transmission of sender A", input.txModeA);
206
  cmd.AddValue ("txModeB", "Wifi mode used for payload transmission of sender B", input.txModeB);
207
  cmd.AddValue ("standard", "IEEE 802.11 flavor", str_standard);
208
  cmd.AddValue ("preamble", "Type of preamble", str_preamble);
209
  cmd.Parse (argc, argv);
210
211
//  LogComponentEnable ("YansWifiPhy", LOG_LEVEL_ALL);
212
//  LogComponentEnable ("WifiPhy", LOG_LEVEL_ALL);
213
//  LogComponentEnable ("InterferenceHelper", LOG_LEVEL_ALL);
214
215
  input.interval = MicroSeconds (delay);
216
217
  if (input.xA >= 0 || input.xB <= 0)
218
    {
219
      std::cout << "Value of xA must be smaller than 0 and value of xB must be bigger than 0!" << std::endl;
220
      return 0;
221
    }
222
223
  if (str_standard == "WIFI_PHY_STANDARD_80211a")
224
    {
225
      input.standard = WIFI_PHY_STANDARD_80211a;
226
    }
227
  else if (str_standard == "WIFI_PHY_STANDARD_80211b")
228
    {
229
      input.standard = WIFI_PHY_STANDARD_80211b;
230
    }
231
  else if (str_standard == "WIFI_PHY_STANDARD_80211g")
232
    {
233
      input.standard = WIFI_PHY_STANDARD_80211g;
234
    }
235
  else if (str_standard == "WIFI_PHY_STANDARD_80211n_2_4GHZ")
236
    {
237
      input.standard = WIFI_PHY_STANDARD_80211n_2_4GHZ;
238
    }
239
  else if (str_standard == "WIFI_PHY_STANDARD_80211n_5GHZ")
240
    {
241
      input.standard = WIFI_PHY_STANDARD_80211n_5GHZ;
242
    }
243
  else if (str_standard == "WIFI_PHY_STANDARD_80211ac")
244
    {
245
      input.standard = WIFI_PHY_STANDARD_80211ac;
246
    }
247
248
  if (str_preamble == "WIFI_PREAMBLE_LONG" && (input.standard == WIFI_PHY_STANDARD_80211a || input.standard == WIFI_PHY_STANDARD_80211b || input.standard == WIFI_PHY_STANDARD_80211g))
249
    {
250
      input.preamble = WIFI_PREAMBLE_LONG;
251
    }
252
  else if (str_preamble == "WIFI_PREAMBLE_SHORT" && (input.standard == WIFI_PHY_STANDARD_80211b || input.standard == WIFI_PHY_STANDARD_80211g))
253
    {
254
      input.preamble = WIFI_PREAMBLE_SHORT;
255
    }
256
  else if (str_preamble == "WIFI_PREAMBLE_HT_MF" && (input.standard == WIFI_PHY_STANDARD_80211n_2_4GHZ || input.standard == WIFI_PHY_STANDARD_80211n_5GHZ))
257
    {
258
      input.preamble = WIFI_PREAMBLE_HT_MF;
259
    }
260
  else if (str_preamble == "WIFI_PREAMBLE_HT_GF" && (input.standard == WIFI_PHY_STANDARD_80211n_2_4GHZ || input.standard == WIFI_PHY_STANDARD_80211n_5GHZ))
261
    {
262
      input.preamble = WIFI_PREAMBLE_HT_GF;
263
    }
264
  else if (str_preamble == "WIFI_PREAMBLE_VHT" && input.standard == WIFI_PHY_STANDARD_80211ac)
265
    {
266
      input.preamble = WIFI_PREAMBLE_VHT;
267
    }
268
  else
269
    {
270
      std::cout << "Preamble does not exist or is not compatible with the selected standard!" << std::endl;
271
      return 0;
272
    }
273
274
  FrameCaptureExperiment experiment;
275
  double sinrRange = 15;
276
  double stepSize = 0.2;
277
  int stepBound = (int)(sinrRange / stepSize);
278
  double powerBase = 10;
279
280
  for (int numSteps = 0; numSteps < stepBound; ++numSteps)
281
    {
282
      double power = powerBase + stepSize * numSteps;
283
      input.txPowerA = power;
284
      input.txPowerB = powerBase;
285
      experiment.Run(input);
286
    }
287
288
//  experiment.Run (input);
289
290
  return 0;
291
}
(-)a/src/wifi/examples/wscript (+4 lines)
 Lines 11-16   def build(bld): Link Here 
11
    obj = bld.create_ns3_program('test-interference-helper',
11
    obj = bld.create_ns3_program('test-interference-helper',
12
        ['core', 'mobility', 'network', 'wifi'])
12
        ['core', 'mobility', 'network', 'wifi'])
13
    obj.source = 'test-interference-helper.cc'
13
    obj.source = 'test-interference-helper.cc'
14
    
15
    obj = bld.create_ns3_program('test-frame-capture',
16
        ['core', 'mobility', 'network', 'wifi'])
17
    obj.source = 'test-frame-capture.cc'
14
18
15
    obj = bld.create_ns3_program('ideal-wifi-manager-example',
19
    obj = bld.create_ns3_program('ideal-wifi-manager-example',
16
        ['core', 'network', 'wifi', 'stats', 'mobility', 'propagation'])
20
        ['core', 'network', 'wifi', 'stats', 'mobility', 'propagation'])
(-)a/src/wifi/model/frame-capture-model.cc (+67 lines)
Line 0    Link Here 
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2
#include "frame-capture-model.h"
3
#include <algorithm>
4
#include <cmath>
5
6
namespace ns3 {
7
8
NS_OBJECT_ENSURE_REGISTERED (FrameCaptureModel);
9
10
TypeId
11
FrameCaptureModel::GetTypeId (void)
12
{
13
  static TypeId tid = TypeId ("ns3::FrameCaptureModel")
14
    .SetParent<Object> ()
15
    .SetGroupName ("Wifi")
16
    .AddConstructor<FrameCaptureModel> ()
17
  ;
18
  return tid;
19
}
20
21
FrameCaptureModel::FrameCaptureModel()
22
{
23
}
24
25
double
26
FrameCaptureModel::CalculatePreambleCaptureProbability (double sinr)
27
{
28
  double z = std::sqrt (sinr / 4.0);
29
  double p = 0.5 * erfc(z);
30
  if (p == 0.0)
31
    {
32
      return 1.0;
33
    }
34
  double pe = CalculatePe (p);
35
  pe = std::min(pe, 1.0);
36
  double prob = std::pow (1 - pe, 240);
37
  return prob;
38
}
39
40
double
41
FrameCaptureModel::CalculatePayloadCaptureProbability (double sinr)
42
{
43
  double sinrDb = 10 * std::log10(sinr);
44
  double prob = 0.4989 * erf((sinrDb - 9.356) / 0.8722) + 0.4989;
45
  prob = std::max(prob, 0.0);
46
  prob = std::min(prob, 1.0);
47
  return prob;
48
}
49
50
double
51
FrameCaptureModel::CalculatePe(double p)
52
{
53
  double D = std::sqrt (4.0 * p * (1.0 - p));
54
  double pe = 1.0;
55
  pe = 0.5 * (36.0 * std::pow (D, 10)
56
	      + 211.0 * std::pow (D, 12)
57
	      + 1404.0 * std::pow (D, 14)
58
	      + 11633.0 * std::pow (D, 16)
59
	      + 77433.0 * std::pow (D, 18)
60
	      + 502690.0 * std::pow (D, 20)
61
	      + 3322763.0 * std::pow (D, 22)
62
	      + 21292910.0 * std::pow (D, 24)
63
	      + 134365911.0 * std::pow (D, 26));
64
  return pe;
65
}
66
67
} // //namespace ns3
(-)a/src/wifi/model/frame-capture-model.h (+23 lines)
Line 0    Link Here 
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2
3
#ifndef FRAME_CAPTURE_MODEL_H
4
#define FRAME_CAPTURE_MODEL_H
5
6
#include "ns3/object.h"
7
8
namespace ns3 {
9
10
class FrameCaptureModel : public Object
11
{
12
public:
13
  static TypeId GetTypeId (void);
14
  FrameCaptureModel ();
15
  double CalculatePreambleCaptureProbability (double sinr);
16
  double CalculatePayloadCaptureProbability (double sinr);
17
private:
18
  double CalculatePe (double p);
19
};
20
21
} //namespace ns3
22
23
#endif /* FRAME_CAPTURE_MODEL_H */
(-)a/src/wifi/model/interference-helper.cc (-7 / +25 lines)
 Lines 251-264   double Link Here 
251
InterferenceHelper::CalculateNoiseInterferenceW (Ptr<InterferenceHelper::Event> event, NiChanges *ni) const
251
InterferenceHelper::CalculateNoiseInterferenceW (Ptr<InterferenceHelper::Event> event, NiChanges *ni) const
252
{
252
{
253
  double noiseInterference = m_firstPower;
253
  double noiseInterference = m_firstPower;
254
  NS_ASSERT (m_rxing);
254
  for (NiChanges::const_iterator i = m_niChanges.begin (); i != m_niChanges.end (); ++i)
255
  for (NiChanges::const_iterator i = m_niChanges.begin () + 1; i != m_niChanges.end (); i++)
256
    {
255
    {
257
      if ((event->GetEndTime () == i->GetTime ()) && event->GetRxPowerW () == -i->GetDelta ())
256
      if (i->GetTime () < event->GetStartTime ())
258
        {
257
	{
259
          break;
258
	  noiseInterference += i->GetDelta ();
260
        }
259
	}
261
      ni->push_back (*i);
260
      else if (i->GetTime () > event->GetStartTime () && i->GetTime () < event->GetEndTime ())
261
	{
262
	  ni->push_back(*i);
263
	}
264
      else if (event->GetEndTime () == i->GetTime () && event->GetRxPowerW () == -i->GetDelta ())
265
	{
266
	  break;
267
	}
262
    }
268
    }
263
  ni->insert (ni->begin (), NiChange (event->GetStartTime (), noiseInterference));
269
  ni->insert (ni->begin (), NiChange (event->GetStartTime (), noiseInterference));
264
  ni->push_back (NiChange (event->GetEndTime (), 0));
270
  ni->push_back (NiChange (event->GetEndTime (), 0));
 Lines 865-868   InterferenceHelper::NotifyRxEnd () Link Here 
865
  m_rxing = false;
871
  m_rxing = false;
866
}
872
}
867
873
874
double
875
InterferenceHelper::CalculatePreambleCaptureProbability (double sinr)
876
{
877
  return m_frameCaptureModel->CalculatePreambleCaptureProbability(sinr);
878
}
879
880
double
881
InterferenceHelper::CalculatePayloadCaptureProbability (double sinr)
882
{
883
  return m_frameCaptureModel->CalculatePayloadCaptureProbability(sinr);
884
}
885
868
} //namespace ns3
886
} //namespace ns3
(-)a/src/wifi/model/interference-helper.h (-1 / +15 lines)
 Lines 24-29    Link Here 
24
#include "ns3/nstime.h"
24
#include "ns3/nstime.h"
25
#include "wifi-tx-vector.h"
25
#include "wifi-tx-vector.h"
26
#include "error-rate-model.h"
26
#include "error-rate-model.h"
27
#include "frame-capture-model.h"
27
28
28
namespace ns3 {
29
namespace ns3 {
29
30
 Lines 206-212   private: Link Here 
206
   * Erase all events.
207
   * Erase all events.
207
   */
208
   */
208
  void EraseEvents (void);
209
  void EraseEvents (void);
209
210
  // following methods used to support frame capture capability
211
  /**
212
   * Calculate the successful probability for preamble capture
213
   * \param sinr the sinr value at the current time
214
   */
215
  double CalculatePreambleCaptureProbability (double sinr);
216
  /**
217
   * Calculate the successful probability for payload capture
218
   * \param sinr the sinr value at the current time
219
   */
220
  double CalculatePayloadCaptureProbability (double sinr);
210
221
211
private:
222
private:
212
  /**
223
  /**
 Lines 322-327   private: Link Here 
322
  NiChanges m_niChanges;
333
  NiChanges m_niChanges;
323
  double m_firstPower;
334
  double m_firstPower;
324
  bool m_rxing;
335
  bool m_rxing;
336
  // following variables used for frame capture capability
337
  Ptr<FrameCaptureModel> m_frameCaptureModel;
338
325
  /// Returns an iterator to the first nichange, which is later than moment
339
  /// Returns an iterator to the first nichange, which is later than moment
326
  NiChanges::iterator GetPosition (Time moment);
340
  NiChanges::iterator GetPosition (Time moment);
327
  /**
341
  /**
(-)a/src/wifi/model/wifi-phy-state-helper.cc (+10 lines)
 Lines 541-544   WifiPhyStateHelper::SwitchFromSleep (Time duration) Link Here 
541
    }
541
    }
542
}
542
}
543
543
544
void
545
WifiPhyStateHelper::SwitchFromRxAbort ()
546
{
547
  NS_ASSERT (IsStateRx ());
548
  NS_ASSERT (m_rxing);
549
  NotifyRxEndError ();
550
  m_endRx = Simulator::Now ();
551
  DoSwitchFromRx ();
552
  NS_ASSERT (!IsStateRx ());
553
}
544
} //namespace ns3
554
} //namespace ns3
(-)a/src/wifi/model/wifi-phy-state-helper.h (-1 / +4 lines)
 Lines 181-187   public: Link Here 
181
   * \param duration the duration of CCA busy state
181
   * \param duration the duration of CCA busy state
182
   */
182
   */
183
  void SwitchFromSleep (Time duration);
183
  void SwitchFromSleep (Time duration);
184
184
  /**
185
   * Abort current reception
186
   */
187
  void SwitchFromRxAbort (void);
185
  /** \todo Why is this public? */
188
  /** \todo Why is this public? */
186
  TracedCallback<Time, Time, WifiPhy::State> m_stateLogger;
189
  TracedCallback<Time, Time, WifiPhy::State> m_stateLogger;
187
190
(-)a/src/wifi/model/wifi-phy.cc (-22 / +236 lines)
 Lines 29-34    Link Here 
29
#include "ns3/pointer.h"
29
#include "ns3/pointer.h"
30
#include "wifi-phy-tag.h"
30
#include "wifi-phy-tag.h"
31
#include "ampdu-tag.h"
31
#include "ampdu-tag.h"
32
#include "wifi-phy-tag.h"
32
#include "wifi-utils.h"
33
#include "wifi-utils.h"
33
34
34
namespace ns3 {
35
namespace ns3 {
 Lines 191-203   WifiPhy::GetTypeId (void) Link Here 
191
                   MakeDoubleChecker<double> ())
192
                   MakeDoubleChecker<double> ())
192
    .AddAttribute ("TxGain",
193
    .AddAttribute ("TxGain",
193
                   "Transmission gain (dB).",
194
                   "Transmission gain (dB).",
194
                   DoubleValue (1.0),
195
                   DoubleValue (0.0),
195
                   MakeDoubleAccessor (&WifiPhy::SetTxGain,
196
                   MakeDoubleAccessor (&WifiPhy::SetTxGain,
196
                                       &WifiPhy::GetTxGain),
197
                                       &WifiPhy::GetTxGain),
197
                   MakeDoubleChecker<double> ())
198
                   MakeDoubleChecker<double> ())
198
    .AddAttribute ("RxGain",
199
    .AddAttribute ("RxGain",
199
                   "Reception gain (dB).",
200
                   "Reception gain (dB).",
200
                   DoubleValue (1.0),
201
                   DoubleValue (0.0),
201
                   MakeDoubleAccessor (&WifiPhy::SetRxGain,
202
                   MakeDoubleAccessor (&WifiPhy::SetRxGain,
202
                                       &WifiPhy::GetRxGain),
203
                                       &WifiPhy::GetRxGain),
203
                   MakeDoubleChecker<double> ())
204
                   MakeDoubleChecker<double> ())
 Lines 308-313   WifiPhy::GetTypeId (void) Link Here 
308
                   MakeBooleanAccessor (&WifiPhy::GetShortPlcpPreambleSupported,
309
                   MakeBooleanAccessor (&WifiPhy::GetShortPlcpPreambleSupported,
309
                                        &WifiPhy::SetShortPlcpPreambleSupported),
310
                                        &WifiPhy::SetShortPlcpPreambleSupported),
310
                   MakeBooleanChecker ())
311
                   MakeBooleanChecker ())
312
    .AddAttribute ("PreambleCaptureEnabled",
313
		   "Whether or not to enable capture at the preamble portion of the packet.",
314
		   BooleanValue (true),
315
		   MakeBooleanAccessor (&WifiPhy::GetPreambleCapture,
316
					&WifiPhy::SetPreambleCapture),
317
		   MakeBooleanChecker ())
318
    .AddAttribute ("PayloadCaptureEnabled",
319
		   "Whether or not to enable cautpure at the payload(data) portion of the packet",
320
		   BooleanValue (true),
321
		   MakeBooleanAccessor (&WifiPhy::GetPayloadCapture,
322
					&WifiPhy::SetPayloadCapture),
323
		   MakeBooleanChecker ())
311
    .AddTraceSource ("PhyTxBegin",
324
    .AddTraceSource ("PhyTxBegin",
312
                     "Trace source indicating a packet "
325
                     "Trace source indicating a packet "
313
                     "has begun transmitting over the channel medium",
326
                     "has begun transmitting over the channel medium",
 Lines 372-378   WifiPhy::WifiPhy () Link Here 
372
    m_channelNumber (0),
385
    m_channelNumber (0),
373
    m_initialChannelNumber (0),
386
    m_initialChannelNumber (0),
374
    m_totalAmpduSize (0),
387
    m_totalAmpduSize (0),
375
    m_totalAmpduNumSymbols (0)
388
    m_totalAmpduNumSymbols (0),
389
    m_doPreambleCapture (true),
390
    m_doPayloadCapture (true)
376
{
391
{
377
  NS_LOG_FUNCTION (this);
392
  NS_LOG_FUNCTION (this);
378
  NS_UNUSED (m_numberOfTransmitters);
393
  NS_UNUSED (m_numberOfTransmitters);
 Lines 706-711   WifiPhy::GetChannelSwitchDelay (void) const Link Here 
706
  return m_channelSwitchDelay;
721
  return m_channelSwitchDelay;
707
}
722
}
708
723
724
void
725
WifiPhy::SetPreambleCapture (bool enable)
726
{
727
  NS_LOG_FUNCTION (this << enable);
728
  m_doPreambleCapture = enable;
729
}
730
731
bool
732
WifiPhy::GetPreambleCapture (void) const
733
{
734
  return m_doPreambleCapture;
735
}
736
737
void
738
WifiPhy::SetPayloadCapture (bool enable)
739
{
740
  NS_LOG_FUNCTION (this << enable);
741
  m_doPayloadCapture = enable;
742
}
743
744
bool
745
WifiPhy::GetPayloadCapture (void) const
746
{
747
  return m_doPayloadCapture;
748
}
749
709
double
750
double
710
WifiPhy::CalculateSnr (WifiTxVector txVector, double ber) const
751
WifiPhy::CalculateSnr (WifiTxVector txVector, double ber) const
711
{
752
{
 Lines 2296-2301   WifiPhy::StartReceivePreambleAndHeader (Ptr<Packet> packet, double rxPowerW, Tim Link Here 
2296
                              txVector,
2337
                              txVector,
2297
                              rxDuration,
2338
                              rxDuration,
2298
                              rxPowerW);
2339
                              rxPowerW);
2340
  Time currentRxStage = Seconds (0);
2299
2341
2300
  switch (m_state->GetState ())
2342
  switch (m_state->GetState ())
2301
    {
2343
    {
 Lines 2315-2334   WifiPhy::StartReceivePreambleAndHeader (Ptr<Packet> packet, double rxPowerW, Tim Link Here 
2315
        {
2357
        {
2316
          //that packet will be noise _after_ the completion of the
2358
          //that packet will be noise _after_ the completion of the
2317
          //channel switching.
2359
          //channel switching.
2318
          goto maybeCcaBusy;
2360
	  CalculateCcaBusyDuration ();
2319
        }
2361
        }
2320
      break;
2362
      break;
2321
    case WifiPhy::RX:
2363
    case WifiPhy::RX:
2322
      NS_LOG_DEBUG ("drop packet because already in Rx (power=" <<
2364
      {
2323
                    rxPowerW << "W)");
2365
	NS_ASSERT (m_rxPacketEvent != NULL);
2324
      NotifyRxDrop (packet);
2366
	currentRxStage = Simulator::Now() - m_rxPacketEvent->GetStartTime();
2325
      if (endRx > Simulator::Now () + m_state->GetDelayUntilIdle ())
2367
	bool doReceptionSwitch = false;
2326
        {
2368
	if (currentRxStage <= preambleAndHeaderDuration) // still receiving the preamble and plcp header portion of the old packet
2327
          //that packet will be noise _after_ the reception of the
2369
	  {
2328
          //currently-received packet.
2370
	    doReceptionSwitch = CheckPreambleCapture (packet, event);
2329
          goto maybeCcaBusy;
2371
	  }
2330
        }
2372
	else
2331
      break;
2373
	  {
2374
	    doReceptionSwitch = CheckPayloadCapture (packet, event);
2375
	  }
2376
	if (doReceptionSwitch)
2377
	  {
2378
	    m_endPlcpRxEvent = Simulator::Schedule (preambleAndHeaderDuration, &WifiPhy::StartReceivePacket, this,
2379
	  					  packet, txVector, mpdutype, event);
2380
	  }
2381
	break;
2382
      }
2332
    case WifiPhy::TX:
2383
    case WifiPhy::TX:
2333
      NS_LOG_DEBUG ("drop packet because already in Tx (power=" <<
2384
      NS_LOG_DEBUG ("drop packet because already in Tx (power=" <<
2334
                    rxPowerW << "W)");
2385
                    rxPowerW << "W)");
 Lines 2337-2343   WifiPhy::StartReceivePreambleAndHeader (Ptr<Packet> packet, double rxPowerW, Tim Link Here 
2337
        {
2388
        {
2338
          //that packet will be noise _after_ the transmission of the
2389
          //that packet will be noise _after_ the transmission of the
2339
          //currently-transmitted packet.
2390
          //currently-transmitted packet.
2340
          goto maybeCcaBusy;
2391
	  CalculateCcaBusyDuration ();
2341
        }
2392
        }
2342
      break;
2393
      break;
2343
    case WifiPhy::CCA_BUSY:
2394
    case WifiPhy::CCA_BUSY:
 Lines 2350-2356   WifiPhy::StartReceivePreambleAndHeader (Ptr<Packet> packet, double rxPowerW, Tim Link Here 
2350
              m_mpdusNum = 0;
2401
              m_mpdusNum = 0;
2351
              NS_LOG_DEBUG ("drop packet because no PLCP preamble/header has been received");
2402
              NS_LOG_DEBUG ("drop packet because no PLCP preamble/header has been received");
2352
              NotifyRxDrop (packet);
2403
              NotifyRxDrop (packet);
2353
              goto maybeCcaBusy;
2404
              CalculateCcaBusyDuration ();
2354
            }
2405
            }
2355
          else if (preamble != WIFI_PREAMBLE_NONE && packet->PeekPacketTag (ampduTag) && m_mpdusNum == 0)
2406
          else if (preamble != WIFI_PREAMBLE_NONE && packet->PeekPacketTag (ampduTag) && m_mpdusNum == 0)
2356
            {
2407
            {
 Lines 2388-2393   WifiPhy::StartReceivePreambleAndHeader (Ptr<Packet> packet, double rxPowerW, Tim Link Here 
2388
          NS_ASSERT (m_endPlcpRxEvent.IsExpired ());
2439
          NS_ASSERT (m_endPlcpRxEvent.IsExpired ());
2389
          NotifyRxBegin (packet);
2440
          NotifyRxBegin (packet);
2390
          m_interference.NotifyRxStart ();
2441
          m_interference.NotifyRxStart ();
2442
          m_rxPacket = packet;
2443
          m_rxPacketEvent = event;
2391
2444
2392
          if (preamble != WIFI_PREAMBLE_NONE)
2445
          if (preamble != WIFI_PREAMBLE_NONE)
2393
            {
2446
            {
 Lines 2395-2404   WifiPhy::StartReceivePreambleAndHeader (Ptr<Packet> packet, double rxPowerW, Tim Link Here 
2395
              m_endPlcpRxEvent = Simulator::Schedule (preambleAndHeaderDuration, &WifiPhy::StartReceivePacket, this,
2448
              m_endPlcpRxEvent = Simulator::Schedule (preambleAndHeaderDuration, &WifiPhy::StartReceivePacket, this,
2396
                                                      packet, txVector, mpdutype, event);
2449
                                                      packet, txVector, mpdutype, event);
2397
            }
2450
            }
2398
2399
          NS_ASSERT (m_endRxEvent.IsExpired ());
2400
          m_endRxEvent = Simulator::Schedule (rxDuration, &WifiPhy::EndReceive, this,
2401
                                              packet, preamble, mpdutype, event);
2402
        }
2451
        }
2403
      else
2452
      else
2404
        {
2453
        {
 Lines 2406-2412   WifiPhy::StartReceivePreambleAndHeader (Ptr<Packet> packet, double rxPowerW, Tim Link Here 
2406
                        rxPowerW << "<" << GetEdThresholdW () << ")");
2455
                        rxPowerW << "<" << GetEdThresholdW () << ")");
2407
          NotifyRxDrop (packet);
2456
          NotifyRxDrop (packet);
2408
          m_plcpSuccess = false;
2457
          m_plcpSuccess = false;
2409
          goto maybeCcaBusy;
2458
          CalculateCcaBusyDuration ();
2410
        }
2459
        }
2411
      break;
2460
      break;
2412
    case WifiPhy::SLEEP:
2461
    case WifiPhy::SLEEP:
 Lines 2417-2424   WifiPhy::StartReceivePreambleAndHeader (Ptr<Packet> packet, double rxPowerW, Tim Link Here 
2417
    }
2466
    }
2418
2467
2419
  return;
2468
  return;
2469
}
2420
2470
2421
maybeCcaBusy:
2471
void
2472
WifiPhy::CalculateCcaBusyDuration ()
2473
{
2474
//  maybeCcaBusy:
2422
  //We are here because we have received the first bit of a packet and we are
2475
  //We are here because we have received the first bit of a packet and we are
2423
  //not going to be able to synchronize on it
2476
  //not going to be able to synchronize on it
2424
  //In this model, CCA becomes busy when the aggregation of all signals as
2477
  //In this model, CCA becomes busy when the aggregation of all signals as
 Lines 2431-2436   maybeCcaBusy: Link Here 
2431
    }
2484
    }
2432
}
2485
}
2433
2486
2487
bool
2488
WifiPhy::CheckPreambleCapture (Ptr<Packet> packet, Ptr<InterferenceHelper::Event> event)
2489
{
2490
  NS_LOG_DEBUG (Simulator::Now() << ", preamble capture check: old reception event start at "
2491
		  << m_rxPacketEvent->GetStartTime()
2492
		  << ", end at " << m_rxPacketEvent->GetEndTime()
2493
		  << ", old rxPower "<< m_rxPacketEvent->GetRxPowerW());
2494
  bool result = false;
2495
  Time endRx = event->GetEndTime();
2496
  InterferenceHelper::SnrPer snrPer;
2497
  snrPer = m_interference.CalculatePlcpHeaderSnrPer (m_rxPacketEvent); // check whether the plcp header can still decoded
2498
  NS_LOG_DEBUG ("snr(dB)=" << RatioToDb (snrPer.snr) << ", per=" << snrPer.per);
2499
  if (m_random->GetValue () > snrPer.per)  // the reception of the old packet can be continued
2500
    {
2501
      NS_ASSERT (m_endPlcpRxEvent.IsRunning());
2502
      NS_LOG_INFO (Simulator::Now() << " preamble capture check: dropping newly arrived packet"
2503
		   << ", because already sync to a stronger enough signal");
2504
      NotifyRxDrop (packet);
2505
      if (endRx > Simulator::Now() + m_state->GetDelayUntilIdle())
2506
	{
2507
	  CalculateCcaBusyDuration ();
2508
	}
2509
    }
2510
  else // the reception of the old packet cannot be continued
2511
    {
2512
      NS_LOG_INFO (Simulator::Now() << " preamble capture check: dropping currently received packet");
2513
      AbortCurrentReception ();
2514
      if (m_doPreambleCapture) // if the frame capture capability at preamble is enabled, check whether can
2515
			       // switch to the new packet
2516
	{
2517
	  NS_ASSERT (m_endPlcpRxEvent.IsExpired() && m_endRxEvent.IsExpired());
2518
	  NS_LOG_INFO (Simulator::Now()<< " preamble capture check: switch to new packet");
2519
	  InterferenceHelper::SnrPer snrPerForNewPkt;
2520
	  snrPerForNewPkt = m_interference.CalculatePlcpHeaderSnrPer (event);
2521
	  double prob = m_interference.CalculatePreambleCaptureProbability(snrPerForNewPkt.snr);
2522
	  if (m_random->GetValue () < prob)
2523
	    {
2524
	      SwitchReception (packet, event);
2525
	      result = true;
2526
	    }
2527
	  else
2528
	    {
2529
	      NS_LOG_INFO (Simulator::Now()<<" preamble capture: signal is too low for capture");
2530
	      NotifyRxDrop (packet);
2531
	      if (endRx > Simulator::Now() + m_state->GetDelayUntilIdle())
2532
		{
2533
		  CalculateCcaBusyDuration ();
2534
		}
2535
	    }
2536
	}
2537
      else // if the frame capture is not enabled, drop the packet
2538
	{
2539
	  NS_LOG_INFO (Simulator::Now()<<" preamble capture check: drop packet because already receiving");
2540
	  NotifyRxDrop (packet);
2541
	  if (endRx > Simulator::Now() + m_state->GetDelayUntilIdle())
2542
	    {
2543
	      CalculateCcaBusyDuration ();
2544
	    }
2545
	}
2546
    }
2547
  return result;
2548
}
2549
2550
bool
2551
WifiPhy::CheckPayloadCapture (Ptr<Packet> packet, Ptr<InterferenceHelper::Event> event)
2552
{
2553
  NS_LOG_DEBUG (Simulator::Now() << ", payload capture check: old reception event start at "
2554
		  << m_rxPacketEvent->GetStartTime()
2555
		  << ", end at " << m_rxPacketEvent->GetEndTime()
2556
		  << ", old rxPower "<< m_rxPacketEvent->GetRxPowerW());
2557
  bool result = false;
2558
  Time endRx = event->GetEndTime();
2559
  InterferenceHelper::SnrPer snrPer;
2560
  snrPer = m_interference.CalculatePlcpPayloadSnrPer(m_rxPacketEvent); // check whether the plcp header can still decoded
2561
  NS_LOG_DEBUG ("snr(dB)=" << RatioToDb (snrPer.snr) << ", per=" << snrPer.per);
2562
  if (m_random->GetValue () > snrPer.per)  // the reception of the old packet can be continued
2563
    {
2564
      NS_ASSERT (m_endRxEvent.IsRunning());
2565
      NS_LOG_INFO (Simulator::Now() << " payload capture check: dropping newly arrived packet"
2566
		   << ", because already sync to a stronger enough signal");
2567
      NotifyRxDrop (packet);
2568
      if (endRx > Simulator::Now() + m_state->GetDelayUntilIdle())
2569
	{
2570
	  CalculateCcaBusyDuration ();
2571
	}
2572
    }
2573
  else // the reception of the old packet cannot be continued
2574
    {
2575
      NS_LOG_INFO (Simulator::Now() << " preamble capture check: dropping currently received packet");
2576
      AbortCurrentReception ();
2577
      if (m_doPayloadCapture) // if the frame capture capability at preamble is enabled, check whether can
2578
			       // switch to the new packet
2579
	{
2580
	  NS_ASSERT (m_endPlcpRxEvent.IsExpired() && m_endRxEvent.IsExpired());
2581
	  NS_LOG_INFO (Simulator::Now()<< " payload capture check: switch to new packet");
2582
	  InterferenceHelper::SnrPer snrPerForNewPkt;
2583
	  snrPerForNewPkt = m_interference.CalculatePlcpPayloadSnrPer (event);
2584
	  double prob = m_interference.CalculatePayloadCaptureProbability (snrPerForNewPkt.snr);
2585
	  if (m_random->GetValue () < prob)
2586
	    {
2587
	      SwitchReception (packet, event);
2588
	      result = true;
2589
	    }
2590
	  else
2591
	    {
2592
	      NS_LOG_INFO (Simulator::Now()<<" payload capture: signal is too low for capture");
2593
	      NotifyRxDrop (packet);
2594
	      if (endRx > Simulator::Now() + m_state->GetDelayUntilIdle())
2595
		{
2596
		  CalculateCcaBusyDuration ();
2597
		}
2598
	    }
2599
	}
2600
      else // if the frame capture is not enabled, drop the packet
2601
	{
2602
	  NS_LOG_INFO (Simulator::Now()<<" payload capture check: drop packet because already receiving");
2603
	  NotifyRxDrop (packet);
2604
	  if (endRx > Simulator::Now() + m_state->GetDelayUntilIdle())
2605
	    {
2606
	      CalculateCcaBusyDuration ();
2607
	    }
2608
	}
2609
    }
2610
  return result;
2611
}
2612
2613
void
2614
WifiPhy::AbortCurrentReception ()
2615
{
2616
  if (m_endPlcpRxEvent.IsRunning())
2617
    {
2618
      m_endPlcpRxEvent.Cancel();
2619
    }
2620
  if (m_endRxEvent.IsRunning())
2621
    {
2622
      m_endRxEvent.Cancel();
2623
    }
2624
  m_interference.NotifyRxEnd();
2625
  m_state->SwitchFromRxAbort();
2626
  m_rxPacket = NULL;
2627
  m_rxPacketEvent = NULL;
2628
}
2629
2630
void
2631
WifiPhy::SwitchReception (Ptr<Packet> packet, Ptr<InterferenceHelper::Event> event)
2632
{
2633
  m_rxPacket = packet;
2634
  m_rxPacketEvent = event;
2635
  m_state->SwitchToRx (event->GetDuration());
2636
  NotifyRxBegin (packet);
2637
  m_interference.NotifyRxStart();
2638
}
2639
2434
void
2640
void
2435
WifiPhy::StartReceivePacket (Ptr<Packet> packet,
2641
WifiPhy::StartReceivePacket (Ptr<Packet> packet,
2436
                             WifiTxVector txVector,
2642
                             WifiTxVector txVector,
 Lines 2453-2464   WifiPhy::StartReceivePacket (Ptr<Packet> packet, Link Here 
2453
        {
2659
        {
2454
          NS_LOG_DEBUG ("receiving plcp payload"); //endReceive is already scheduled
2660
          NS_LOG_DEBUG ("receiving plcp payload"); //endReceive is already scheduled
2455
          m_plcpSuccess = true;
2661
          m_plcpSuccess = true;
2662
          WifiPreamble preamble = txVector.GetPreambleType ();
2663
          Time preambleAndHeaderDuration = CalculatePlcpPreambleAndHeaderDuration (txVector);
2664
          m_endRxEvent = Simulator::Schedule (event->GetDuration() - preambleAndHeaderDuration, &WifiPhy::EndReceive, this,
2665
                                              packet, preamble, mpdutype, event);
2456
        }
2666
        }
2457
      else //mode is not allowed
2667
      else //mode is not allowed
2458
        {
2668
        {
2459
          NS_LOG_DEBUG ("drop packet because it was sent using an unsupported mode (" << txMode << ")");
2669
          NS_LOG_DEBUG ("drop packet because it was sent using an unsupported mode (" << txMode << ")");
2460
          NotifyRxDrop (packet);
2670
          NotifyRxDrop (packet);
2461
          m_plcpSuccess = false;
2671
          m_plcpSuccess = false;
2672
          AbortCurrentReception ();
2673
          CalculateCcaBusyDuration ();
2462
        }
2674
        }
2463
    }
2675
    }
2464
  else //plcp reception failed
2676
  else //plcp reception failed
 Lines 2466-2471   WifiPhy::StartReceivePacket (Ptr<Packet> packet, Link Here 
2466
      NS_LOG_DEBUG ("drop packet because plcp preamble/header reception failed");
2678
      NS_LOG_DEBUG ("drop packet because plcp preamble/header reception failed");
2467
      NotifyRxDrop (packet);
2679
      NotifyRxDrop (packet);
2468
      m_plcpSuccess = false;
2680
      m_plcpSuccess = false;
2681
      AbortCurrentReception ();
2682
      CalculateCcaBusyDuration ();
2469
    }
2683
    }
2470
}
2684
}
2471
2685
(-)a/src/wifi/model/wifi-phy.h (-1 / +54 lines)
 Lines 1524-1529   public: Link Here 
1524
   */
1524
   */
1525
  virtual std::vector<uint32_t> GetSupportedChannelWidthSet (void) const;
1525
  virtual std::vector<uint32_t> GetSupportedChannelWidthSet (void) const;
1526
1526
1527
// following method is used to support frame capture capability
1528
1529
  /**
1530
   * \param enable boolean value to indicate whether preamble capture is enabled or not
1531
   */
1532
  void SetPreambleCapture (bool enable);
1533
  /**
1534
   * \return boolean value to indicate whether preamble capture is enable or not
1535
   */
1536
  bool GetPreambleCapture (void) const;
1537
  /**
1538
   * \param enable boolean value to indicate whether payload capture is enabled or not
1539
   */
1540
  void SetPayloadCapture (bool enable);
1541
  /**
1542
   * \return boolean value to indicate whether payload capture is enable or not
1543
   */
1544
  bool GetPayloadCapture (void) const;
1545
1527
1546
1528
protected:
1547
protected:
1529
  // Inherited
1548
  // Inherited
 Lines 1741-1747   private: Link Here 
1741
   * of its size.
1760
   * of its size.
1742
   */
1761
   */
1743
  TracedCallback<Ptr<const Packet>, uint16_t, uint16_t, WifiTxVector, MpduInfo> m_phyMonitorSniffTxTrace;
1762
  TracedCallback<Ptr<const Packet>, uint16_t, uint16_t, WifiTxVector, MpduInfo> m_phyMonitorSniffTxTrace;
1744
    
1763
1764
  // following methods used to support frame capture capability
1765
  /**
1766
   * Due to newly arrived signal, the old reception cannot be continued and has to be abort
1767
   */
1768
  void AbortCurrentReception (void);
1769
  /**
1770
   * Calculate the duration of CCA busy
1771
   */
1772
  void CalculateCcaBusyDuration (void);
1773
  /**
1774
   * Check whether preamble capture can be triggered
1775
   * \param packet the newly arrived packet which needs to be check for capture
1776
   * \param event the receiving event associated with the receiving packet
1777
   * \param txVector
1778
   * \param mpdutype
1779
   */
1780
  bool CheckPreambleCapture (Ptr<Packet> packet, Ptr<InterferenceHelper::Event> event);
1781
  /**
1782
   * Check whether payload capture can be triggered
1783
   * \param packet the newly arrived packet which needs to be check for capture
1784
   * \param event the receiving event associated with the receiving packet
1785
   * \param tag
1786
   */
1787
  bool CheckPayloadCapture (Ptr<Packet> packet, Ptr<InterferenceHelper::Event> event);
1788
  /**
1789
   * The new packet passes the check and the receiver is going to switch to the new packet
1790
   */
1791
  void SwitchReception (Ptr<Packet> packet, Ptr<InterferenceHelper::Event> event);
1745
  /**
1792
  /**
1746
   * This vector holds the set of transmission modes that this
1793
   * This vector holds the set of transmission modes that this
1747
   * WifiPhy(-derived class) can support. In conversation we call this
1794
   * WifiPhy(-derived class) can support. In conversation we call this
 Lines 1824-1829   private: Link Here 
1824
  
1871
  
1825
  Ptr<NetDevice>     m_device;   //!< Pointer to the device
1872
  Ptr<NetDevice>     m_device;   //!< Pointer to the device
1826
  Ptr<MobilityModel> m_mobility; //!< Pointer to the mobility model
1873
  Ptr<MobilityModel> m_mobility; //!< Pointer to the mobility model
1874
1875
  // following variables used to support frame capture capability
1876
  Ptr<Packet> m_rxPacket;                         // The packet that is currently being received by the receiver
1877
  Ptr<InterferenceHelper::Event> m_rxPacketEvent; // The event that indicates the current receiving event
1878
  bool m_doPreambleCapture;                       // The flag indicates whether the capture at the preamble portion of the packet is enabled or not
1879
  bool m_doPayloadCapture;                        // The flag indicates whether the capture at the payload(data) portion of the packet is enabled or not
1827
};
1880
};
1828
1881
1829
/**
1882
/**
(-)a/src/wifi/wscript (+2 lines)
 Lines 81-86   def build(bld): Link Here 
81
        'model/ht-operations.cc',
81
        'model/ht-operations.cc',
82
        'model/dsss-parameter-set.cc',
82
        'model/dsss-parameter-set.cc',
83
        'model/edca-parameter-set.cc',
83
        'model/edca-parameter-set.cc',
84
        'model/frame-capture-model.cc',
84
        'helper/wifi-radio-energy-model-helper.cc',
85
        'helper/wifi-radio-energy-model-helper.cc',
85
        'helper/vht-wifi-mac-helper.cc',
86
        'helper/vht-wifi-mac-helper.cc',
86
        'helper/ht-wifi-mac-helper.cc',
87
        'helper/ht-wifi-mac-helper.cc',
 Lines 186-191   def build(bld): Link Here 
186
        'model/ht-operations.h',
187
        'model/ht-operations.h',
187
        'model/dsss-parameter-set.h',
188
        'model/dsss-parameter-set.h',
188
        'model/edca-parameter-set.h',
189
        'model/edca-parameter-set.h',
190
        'model/frame-capture-model.h',
189
        'helper/wifi-radio-energy-model-helper.h',
191
        'helper/wifi-radio-energy-model-helper.h',
190
        'helper/vht-wifi-mac-helper.h',
192
        'helper/vht-wifi-mac-helper.h',
191
        'helper/ht-wifi-mac-helper.h',
193
        'helper/ht-wifi-mac-helper.h',

Return to bug 2368