A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
dca-txop.cc
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2005 INRIA
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: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
19  */
20 
21 #include "ns3/assert.h"
22 #include "ns3/packet.h"
23 #include "ns3/log.h"
24 #include "ns3/simulator.h"
25 #include "ns3/node.h"
26 #include "ns3/uinteger.h"
27 #include "ns3/pointer.h"
28 
29 #include "dca-txop.h"
30 #include "dcf-manager.h"
31 #include "mac-low.h"
32 #include "wifi-mac-queue.h"
33 #include "mac-tx-middle.h"
34 #include "wifi-mac-trailer.h"
35 #include "wifi-mac.h"
36 #include "random-stream.h"
37 
38 NS_LOG_COMPONENT_DEFINE ("DcaTxop");
39 
40 #undef NS_LOG_APPEND_CONTEXT
41 #define NS_LOG_APPEND_CONTEXT if (m_low != 0) { std::clog << "[mac=" << m_low->GetAddress () << "] "; }
42 
43 namespace ns3 {
44 
45 class DcaTxop::Dcf : public DcfState
46 {
47 public:
48  Dcf (DcaTxop * txop)
49  : m_txop (txop)
50  {
51  }
52 private:
53  virtual void DoNotifyAccessGranted (void)
54  {
56  }
57  virtual void DoNotifyInternalCollision (void)
58  {
60  }
61  virtual void DoNotifyCollision (void)
62  {
64  }
65  virtual void DoNotifyChannelSwitching (void)
66  {
68  }
70 };
71 
76 {
77 public:
85  m_txop (txop) {
86  }
87 
88  virtual ~TransmissionListener () {}
89 
90  virtual void GotCts (double snr, WifiMode txMode)
91  {
92  m_txop->GotCts (snr, txMode);
93  }
94  virtual void MissedCts (void)
95  {
96  m_txop->MissedCts ();
97  }
98  virtual void GotAck (double snr, WifiMode txMode)
99  {
100  m_txop->GotAck (snr, txMode);
101  }
102  virtual void MissedAck (void)
103  {
104  m_txop->MissedAck ();
105  }
106  virtual void StartNext (void)
107  {
108  m_txop->StartNext ();
109  }
110  virtual void Cancel (void)
111  {
112  m_txop->Cancel ();
113  }
114  virtual void EndTxNoAck (void)
115  {
116  m_txop->EndTxNoAck ();
117  }
118 
119 private:
121 };
122 
124  ;
125 
126 TypeId
128 {
129  static TypeId tid = TypeId ("ns3::DcaTxop")
132  .AddAttribute ("Queue", "The WifiMacQueue object",
133  PointerValue (),
134  MakePointerAccessor (&DcaTxop::GetQueue),
135  MakePointerChecker<WifiMacQueue> ())
136  ;
137  return tid;
138 }
139 
141  : m_manager (0),
142  m_currentPacket (0)
143 {
144  NS_LOG_FUNCTION (this);
146  m_dcf = new DcaTxop::Dcf (this);
147  m_queue = CreateObject<WifiMacQueue> ();
148  m_rng = new RealRandomStream ();
149  m_txMiddle = new MacTxMiddle ();
150 }
151 
153 {
154  NS_LOG_FUNCTION (this);
155 }
156 
157 void
159 {
160  NS_LOG_FUNCTION (this);
161  m_queue = 0;
162  m_low = 0;
163  m_stationManager = 0;
164  delete m_transmissionListener;
165  delete m_dcf;
166  delete m_rng;
167  delete m_txMiddle;
169  m_dcf = 0;
170  m_rng = 0;
171  m_txMiddle = 0;
172 }
173 
174 void
176 {
177  NS_LOG_FUNCTION (this << manager);
178  m_manager = manager;
179  m_manager->Add (m_dcf);
180 }
181 
182 void
184 {
185  NS_LOG_FUNCTION (this << low);
186  m_low = low;
187 }
188 void
190 {
191  NS_LOG_FUNCTION (this << remoteManager);
192  m_stationManager = remoteManager;
193 }
194 void
196 {
197  NS_LOG_FUNCTION (this << &callback);
198  m_txOkCallback = callback;
199 }
200 void
202 {
203  NS_LOG_FUNCTION (this << &callback);
204  m_txFailedCallback = callback;
205 }
206 
209 {
210  NS_LOG_FUNCTION (this);
211  return m_queue;
212 }
213 
214 void
215 DcaTxop::SetMinCw (uint32_t minCw)
216 {
217  NS_LOG_FUNCTION (this << minCw);
218  m_dcf->SetCwMin (minCw);
219 }
220 void
221 DcaTxop::SetMaxCw (uint32_t maxCw)
222 {
223  NS_LOG_FUNCTION (this << maxCw);
224  m_dcf->SetCwMax (maxCw);
225 }
226 void
227 DcaTxop::SetAifsn (uint32_t aifsn)
228 {
229  NS_LOG_FUNCTION (this << aifsn);
230  m_dcf->SetAifsn (aifsn);
231 }
232 uint32_t
233 DcaTxop::GetMinCw (void) const
234 {
235  NS_LOG_FUNCTION (this);
236  return m_dcf->GetCwMin ();
237 }
238 uint32_t
239 DcaTxop::GetMaxCw (void) const
240 {
241  NS_LOG_FUNCTION (this);
242  return m_dcf->GetCwMax ();
243 }
244 uint32_t
245 DcaTxop::GetAifsn (void) const
246 {
247  NS_LOG_FUNCTION (this);
248  return m_dcf->GetAifsn ();
249 }
250 
251 void
253 {
254  NS_LOG_FUNCTION (this << packet << &hdr);
255  WifiMacTrailer fcs;
256  uint32_t fullPacketSize = hdr.GetSerializedSize () + packet->GetSize () + fcs.GetSerializedSize ();
257  m_stationManager->PrepareForQueue (hdr.GetAddr1 (), &hdr,
258  packet, fullPacketSize);
259  m_queue->Enqueue (packet, hdr);
261 }
262 
263 int64_t
264 DcaTxop::AssignStreams (int64_t stream)
265 {
266  NS_LOG_FUNCTION (this << stream);
267  m_rng->AssignStreams (stream);
268  return 1;
269 }
270 
271 void
273 {
274  NS_LOG_FUNCTION (this);
275  if ((m_currentPacket != 0
276  || !m_queue->IsEmpty ())
277  && !m_dcf->IsAccessRequested ())
278  {
280  }
281 }
282 
283 void
285 {
286  NS_LOG_FUNCTION (this);
287  if (m_currentPacket == 0
288  && !m_queue->IsEmpty ()
289  && !m_dcf->IsAccessRequested ())
290  {
292  }
293 }
294 
295 
298 {
299  NS_LOG_FUNCTION (this);
300  return m_low;
301 }
302 
303 bool
305 {
306  NS_LOG_FUNCTION (this << packet << header);
307  return m_stationManager->NeedRts (header->GetAddr1 (), header,
308  packet);
309 }
310 
311 void
313 {
314  NS_LOG_FUNCTION (this);
315  m_dcf->ResetCw ();
318 }
319 bool
321 {
322  NS_LOG_FUNCTION (this);
323  return m_stationManager->NeedRtsRetransmission (m_currentHdr.GetAddr1 (), &m_currentHdr,
325 }
326 
327 bool
329 {
330  NS_LOG_FUNCTION (this);
331  return m_stationManager->NeedDataRetransmission (m_currentHdr.GetAddr1 (), &m_currentHdr,
333 }
334 bool
336 {
337  NS_LOG_FUNCTION (this);
338  return m_stationManager->NeedFragmentation (m_currentHdr.GetAddr1 (), &m_currentHdr,
340 }
341 
342 void
344 {
345  NS_LOG_FUNCTION (this);
347 }
348 
349 uint32_t
351 {
352  NS_LOG_FUNCTION (this);
353  return m_stationManager->GetFragmentSize (m_currentHdr.GetAddr1 (), &m_currentHdr,
355 }
356 bool
358 {
359  NS_LOG_FUNCTION (this);
360  return m_stationManager->IsLastFragment (m_currentHdr.GetAddr1 (), &m_currentHdr,
362 }
363 
364 uint32_t
366 {
367  NS_LOG_FUNCTION (this);
368  return m_stationManager->GetFragmentSize (m_currentHdr.GetAddr1 (), &m_currentHdr,
370 }
371 
372 uint32_t
374 {
375  NS_LOG_FUNCTION (this);
376  return m_stationManager->GetFragmentOffset (m_currentHdr.GetAddr1 (), &m_currentHdr,
378 }
379 
382 {
383  NS_LOG_FUNCTION (this << hdr);
384  *hdr = m_currentHdr;
386  uint32_t startOffset = GetFragmentOffset ();
387  Ptr<Packet> fragment;
388  if (IsLastFragment ())
389  {
390  hdr->SetNoMoreFragments ();
391  }
392  else
393  {
394  hdr->SetMoreFragments ();
395  }
396  fragment = m_currentPacket->CreateFragment (startOffset,
397  GetFragmentSize ());
398  return fragment;
399 }
400 
401 bool
403 {
404  NS_LOG_FUNCTION (this);
405  return !m_queue->IsEmpty () || m_currentPacket != 0;
406 }
407 void
409 {
410  NS_LOG_FUNCTION (this);
411  if (m_currentPacket == 0)
412  {
413  if (m_queue->IsEmpty ())
414  {
415  NS_LOG_DEBUG ("queue empty");
416  return;
417  }
418  m_currentPacket = m_queue->Dequeue (&m_currentHdr);
419  NS_ASSERT (m_currentPacket != 0);
420  uint16_t sequence = m_txMiddle->GetNextSequenceNumberfor (&m_currentHdr);
421  m_currentHdr.SetSequenceNumber (sequence);
425  m_fragmentNumber = 0;
426  NS_LOG_DEBUG ("dequeued size=" << m_currentPacket->GetSize () <<
427  ", to=" << m_currentHdr.GetAddr1 () <<
428  ", seq=" << m_currentHdr.GetSequenceControl ());
429  }
431  params.DisableOverrideDurationId ();
432  if (m_currentHdr.GetAddr1 ().IsGroup ())
433  {
434  params.DisableRts ();
435  params.DisableAck ();
436  params.DisableNextData ();
437  Low ()->StartTransmission (m_currentPacket,
438  &m_currentHdr,
439  params,
441  NS_LOG_DEBUG ("tx broadcast");
442  }
443  else
444  {
445  params.EnableAck ();
446 
447  if (NeedFragmentation ())
448  {
449  WifiMacHeader hdr;
450  Ptr<Packet> fragment = GetFragmentPacket (&hdr);
451  if (NeedRts (fragment, &hdr))
452  {
453  params.EnableRts ();
454  }
455  else
456  {
457  params.DisableRts ();
458  }
459  if (IsLastFragment ())
460  {
461  NS_LOG_DEBUG ("fragmenting last fragment size=" << fragment->GetSize ());
462  params.DisableNextData ();
463  }
464  else
465  {
466  NS_LOG_DEBUG ("fragmenting size=" << fragment->GetSize ());
468  }
469  Low ()->StartTransmission (fragment, &hdr, params,
471  }
472  else
473  {
475  {
476  params.EnableRts ();
477  NS_LOG_DEBUG ("tx unicast rts");
478  }
479  else
480  {
481  params.DisableRts ();
482  NS_LOG_DEBUG ("tx unicast");
483  }
484  params.DisableNextData ();
485  Low ()->StartTransmission (m_currentPacket, &m_currentHdr,
486  params, m_transmissionListener);
487  }
488  }
489 }
490 
491 void
493 {
494  NS_LOG_FUNCTION (this);
495  NotifyCollision ();
496 }
497 void
499 {
500  NS_LOG_FUNCTION (this);
501  NS_LOG_DEBUG ("collision");
504 }
505 
506 void
508 {
509  NS_LOG_FUNCTION (this);
510  m_queue->Flush ();
511  m_currentPacket = 0;
512 }
513 
514 void
515 DcaTxop::GotCts (double snr, WifiMode txMode)
516 {
517  NS_LOG_FUNCTION (this << snr << txMode);
518  NS_LOG_DEBUG ("got cts");
519 }
520 void
522 {
523  NS_LOG_FUNCTION (this);
524  NS_LOG_DEBUG ("missed cts");
525  if (!NeedRtsRetransmission ())
526  {
527  NS_LOG_DEBUG ("Cts Fail");
528  m_stationManager->ReportFinalRtsFailed (m_currentHdr.GetAddr1 (), &m_currentHdr);
529  if (!m_txFailedCallback.IsNull ())
530  {
532  }
533  // to reset the dcf.
534  m_currentPacket = 0;
535  m_dcf->ResetCw ();
536  }
537  else
538  {
539  m_dcf->UpdateFailedCw ();
540  }
543 }
544 void
545 DcaTxop::GotAck (double snr, WifiMode txMode)
546 {
547  NS_LOG_FUNCTION (this << snr << txMode);
548  if (!NeedFragmentation ()
549  || IsLastFragment ())
550  {
551  NS_LOG_DEBUG ("got ack. tx done.");
552  if (!m_txOkCallback.IsNull ())
553  {
555  }
556 
557  /* we are not fragmenting or we are done fragmenting
558  * so we can get rid of that packet now.
559  */
560  m_currentPacket = 0;
561  m_dcf->ResetCw ();
564  }
565  else
566  {
567  NS_LOG_DEBUG ("got ack. tx not done, size=" << m_currentPacket->GetSize ());
568  }
569 }
570 void
572 {
573  NS_LOG_FUNCTION (this);
574  NS_LOG_DEBUG ("missed ack");
575  if (!NeedDataRetransmission ())
576  {
577  NS_LOG_DEBUG ("Ack Fail");
578  m_stationManager->ReportFinalDataFailed (m_currentHdr.GetAddr1 (), &m_currentHdr);
579  if (!m_txFailedCallback.IsNull ())
580  {
582  }
583  // to reset the dcf.
584  m_currentPacket = 0;
585  m_dcf->ResetCw ();
586  }
587  else
588  {
589  NS_LOG_DEBUG ("Retransmit");
591  m_dcf->UpdateFailedCw ();
592  }
595 }
596 void
598 {
599  NS_LOG_FUNCTION (this);
600  NS_LOG_DEBUG ("start next packet fragment");
601  /* this callback is used only for fragments. */
602  NextFragment ();
603  WifiMacHeader hdr;
604  Ptr<Packet> fragment = GetFragmentPacket (&hdr);
606  params.EnableAck ();
607  params.DisableRts ();
608  params.DisableOverrideDurationId ();
609  if (IsLastFragment ())
610  {
611  params.DisableNextData ();
612  }
613  else
614  {
616  }
617  Low ()->StartTransmission (fragment, &hdr, params, m_transmissionListener);
618 }
619 
620 void
622 {
623  NS_LOG_FUNCTION (this);
624  NS_LOG_DEBUG ("transmission cancelled");
650 }
651 
652 void
654 {
655  NS_LOG_FUNCTION (this);
656  NS_LOG_DEBUG ("a transmission that did not require an ACK just finished");
657  m_currentPacket = 0;
658  m_dcf->ResetCw ();
661 }
662 
663 } // namespace ns3
void SetRetry(void)
Set the Retry bit in the Frame Control field.
void NotifyInternalCollision(void)
Notify the DCF that internal collision has occurred.
Definition: dca-txop.cc:492
void SetMoreFragments(void)
Set the More Fragment bit in the Frame Control field.
virtual uint32_t GetMaxCw(void) const
Return the maximum congestion window size.
Definition: dca-txop.cc:239
smart pointer class similar to boost::intrusive_ptr
Definition: ptr.h:59
uint32_t GetFragmentOffset(void)
Calculate the offset for the current fragment.
Definition: dca-txop.cc:373
#define NS_LOG_FUNCTION(parameters)
Definition: log.h:345
uint8_t m_fragmentNumber
Definition: dca-txop.h:320
TypeId AddConstructor(void)
Definition: type-id.h:418
virtual void DoNotifyInternalCollision(void)
Called by DcfManager to notify a DcfState subclass that an 'internal' collision occured, that is, that the backoff timer of a higher priority DcfState expired at the same time and that access was granted to this higher priority DcfState.
Definition: dca-txop.cc:57
void SetTxFailedCallback(TxFailed callback)
Definition: dca-txop.cc:201
uint32_t GetCwMin(void) const
Return the minimum congestion window size.
Definition: dcf-manager.cc:79
virtual void MissedAck(void)
ns3::MacLow did not receive an expected ACK within AckTimeout.
Definition: dca-txop.cc:102
virtual void SetMaxCw(uint32_t maxCw)
Set the maximum congestion window size.
Definition: dca-txop.cc:221
void StartNext(void)
Start transmission for the next fragment.
Definition: dca-txop.cc:597
void RequestAccess(DcfState *state)
Definition: dcf-manager.cc:423
TransmissionListener(DcaTxop *txop)
Create a TransmissionListener for the given DcaTxop.
Definition: dca-txop.cc:83
Ptr< MacLow > m_low
Definition: dca-txop.h:312
void SetNoMoreFragments(void)
Un-set the More Fragment bit in the Frame Control Field.
bool IsNull(void) const
Check for null implementation.
Definition: callback.h:1014
#define NS_ASSERT(condition)
Definition: assert.h:64
virtual int64_t AssignStreams(int64_t stream)=0
Assign a fixed random variable stream number to the random variables used by this model...
NS_OBJECT_ENSURE_REGISTERED(NullMessageSimulatorImpl)
uint32_t GetSize(void) const
Definition: packet.h:650
Ptr< MacLow > Low(void)
Return the MacLow associated with this DcaTxop.
Definition: dca-txop.cc:297
TxOk m_txOkCallback
Definition: dca-txop.h:308
virtual uint32_t GetAifsn(void) const
Return the number of slots that make up an AIFS.
Definition: dca-txop.cc:245
void SetAifsn(uint32_t aifsn)
Definition: dcf-manager.cc:57
friend class Dcf
Definition: dca-txop.h:152
void ResetCw(void)
Update the value of the CW variable to take into account a transmission success or a transmission abo...
Definition: dcf-manager.cc:90
int64_t AssignStreams(int64_t stream)
Assign a fixed random variable stream number to the random variables used by this model...
Definition: dca-txop.cc:264
listen to events coming from ns3::MacLow.
Definition: mac-low.h:56
represent a single transmission modeA WifiMode is implemented by a single integer which is used to lo...
Definition: wifi-mode.h:91
void Add(DcfState *dcf)
Definition: dcf-manager.cc:343
virtual void GotCts(double snr, WifiMode txMode)
Definition: dca-txop.cc:90
static TypeId GetTypeId(void)
Definition: dca-txop.cc:127
control how a packet is transmitted.
Definition: mac-low.h:218
void SetTxOkCallback(TxOk callback)
Definition: dca-txop.cc:195
Handles sequence numbering of IEEE 802.11 data frames.
Definition: mac-tx-middle.h:39
Ptr< Packet > GetFragmentPacket(WifiMacHeader *hdr)
Get the next fragment from the packet with appropriate Wifi header for the fragment.
Definition: dca-txop.cc:381
virtual void GotAck(double snr, WifiMode txMode)
Definition: dca-txop.cc:98
Ptr< Packet > CreateFragment(uint32_t start, uint32_t length) const
Create a new packet which contains a fragment of the original packet.
Definition: packet.cc:228
void Queue(Ptr< const Packet > packet, const WifiMacHeader &hdr)
Definition: dca-txop.cc:252
void SetLow(Ptr< MacLow > low)
Set MacLow associated with this DcaTxop.
Definition: dca-txop.cc:183
bool NeedFragmentation(void)
Check if the current packet should be fragmented.
Definition: dca-txop.cc:335
virtual uint32_t GetSerializedSize(void) const
Ptr< WifiMacQueue > m_queue
Definition: dca-txop.h:310
void Cancel(void)
Cancel the transmission.
Definition: dca-txop.cc:621
NS_LOG_COMPONENT_DEFINE("DcaTxop")
void GotCts(double snr, WifiMode txMode)
Event handler when a CTS is received.
Definition: dca-txop.cc:515
uint16_t GetSequenceControl(void) const
Return the raw Sequence Control field.
void NotifyChannelSwitching(void)
When a channel switching occurs, enqueued packets are removed.
Definition: dca-txop.cc:507
void MissedCts(void)
Event handler when a CTS timeout has occurred.
Definition: dca-txop.cc:521
Manage a set of ns3::DcfStateHandle a set of independent ns3::DcfState, each of which represents a si...
Definition: dcf-manager.h:229
bool IsLastFragment(void)
Check if the curren fragment is the last fragment.
Definition: dca-txop.cc:357
keep track of the state needed for a single DCF function.
Definition: dcf-manager.h:46
bool IsAccessRequested(void) const
Definition: dcf-manager.cc:133
Ptr< WifiRemoteStationManager > m_stationManager
Definition: dca-txop.h:313
virtual void DoNotifyChannelSwitching(void)
Called by DcfManager to notify a DcfState subclass that a channel switching occured.
Definition: dca-txop.cc:65
uint32_t GetCwMax(void) const
Return the maximum congestion window size.
Definition: dcf-manager.cc:84
bool NeedRts(Ptr< const Packet > packet, const WifiMacHeader *header)
Check if the current packet should be sent with a RTS protection.
Definition: dca-txop.cc:304
void SetCwMin(uint32_t minCw)
Set the minimum congestion window size.
Definition: dcf-manager.cc:62
DcaTxop * m_txop
Definition: dca-txop.cc:69
virtual void SetAifsn(uint32_t aifsn)
Definition: dca-txop.cc:227
void SetWifiRemoteStationManager(Ptr< WifiRemoteStationManager > remoteManager)
Set WifiRemoteStationsManager this DcaTxop is associated to.
Definition: dca-txop.cc:189
void StartBackoffNow(uint32_t nSlots)
Definition: dcf-manager.cc:109
void SetNoRetry(void)
Un-set the Retry bit in the Frame Control field.
uint16_t GetNextSequenceNumberfor(const WifiMacHeader *hdr)
Return the next sequence number for the given header.
hold objects of type Ptr
Definition: pointer.h:33
void DoInitialize()
This method is called only once by Object::Initialize.
Definition: dca-txop.cc:312
bool NeedsAccess(void) const
Check if the DCF requires access.
Definition: dca-txop.cc:402
WifiMacHeader m_currentHdr
Definition: dca-txop.h:319
bool IsGroup(void) const
void EnableAck(void)
Wait ACKTimeout for an ACK.
Definition: mac-low.cc:128
virtual void EndTxNoAck(void)
Invoked upon the end of the transmission of a frame that does not require an ACK (e.g., broadcast and multicast frames).
Definition: dca-txop.cc:114
Ptr< WifiMacQueue > GetQueue() const
Return the packet queue associated with this DcaTxop.
Definition: dca-txop.cc:208
virtual void Cancel(void)
Invoked if this transmission was canceled one way or another.
Definition: dca-txop.cc:110
bool NeedRtsRetransmission(void)
Check if RTS should be re-transmitted if CTS was missed.
Definition: dca-txop.cc:320
void DisableRts(void)
Do not send rts and wait for cts before sending data.
Definition: mac-low.cc:143
friend class TransmissionListener
Definition: dca-txop.h:154
Ptr< const Packet > m_currentPacket
Definition: dca-txop.h:318
virtual void MissedCts(void)
ns3::MacLow did not receive an expected CTS within CtsTimeout.
Definition: dca-txop.cc:94
Listener for MacLow events.
Definition: dca-txop.cc:75
MacTxMiddle * m_txMiddle
Definition: dca-txop.h:311
DcfManager * m_manager
Definition: dca-txop.h:307
void SetCwMax(uint32_t maxCw)
Set the maximum congestion window size.
Definition: dcf-manager.cc:68
virtual void SetMinCw(uint32_t minCw)
Set the minimum congestion window size.
Definition: dca-txop.cc:215
void GotAck(double snr, WifiMode txMode)
Event handler when an ACK is received.
Definition: dca-txop.cc:545
virtual void DoNotifyCollision(void)
Called by DcfManager to notify a DcfState subclass that a normal collision occured, that is, that the medium was busy when access was requested.
Definition: dca-txop.cc:61
static TypeId GetTypeId(void)
Definition: dcf.cc:32
void SetSequenceNumber(uint16_t seq)
Set the sequence number of the header.
void EnableRts(void)
Send a RTS, and wait CTSTimeout for a CTS.
Definition: mac-low.cc:138
uint32_t GetCw(void) const
Definition: dcf-manager.cc:118
uint32_t GetAifsn(void) const
Return the number of slots that make up an AIFS.
Definition: dcf-manager.cc:74
void SetManager(DcfManager *manager)
Set DcfManager this DcaTxop is associated to.
Definition: dca-txop.cc:175
#define NS_LOG_DEBUG(msg)
Definition: log.h:289
uint32_t GetNextFragmentSize(void)
Calculate the size of the next fragment.
Definition: dca-txop.cc:365
virtual void StartNext(void)
Invoked when ns3::MacLow wants to start a new transmission as configured by MacLowTransmissionParamet...
Definition: dca-txop.cc:106
virtual void DoDispose(void)
This method is called by Object::Dispose or by the object's destructor, whichever comes first...
Definition: dca-txop.cc:158
void EnableNextData(uint32_t size)
Definition: mac-low.cc:83
void NotifyCollision(void)
Notify the DCF that collision has occurred.
Definition: dca-txop.cc:498
void DisableOverrideDurationId(void)
Do not force the duration/id field of the packet: its value is automatically calculated by the MacLow...
Definition: mac-low.cc:98
void StartAccessIfNeeded(void)
Request access from DCF manager if needed.
Definition: dca-txop.cc:284
void NextFragment(void)
Continue to the next fragment.
Definition: dca-txop.cc:343
void DisableNextData(void)
Do not attempt to send data burst after current transmission.
Definition: mac-low.cc:88
TransmissionListener * m_transmissionListener
Definition: dca-txop.h:314
virtual void DoNotifyAccessGranted(void)
Called by DcfManager to notify a DcfState subclass that access to the medium is granted and can start...
Definition: dca-txop.cc:53
void RestartAccessIfNeeded(void)
Restart access request if needed.
Definition: dca-txop.cc:272
virtual uint32_t GetNext(uint32_t min, uint32_t max)=0
Get integer between min and max (including min and max).
Mac48Address GetAddr1(void) const
Return the address in the Address 1 field.
void UpdateFailedCw(void)
Update the value of the CW variable to take into account a transmission failure.
Definition: dcf-manager.cc:95
void MissedAck(void)
Event handler when an ACK is received.
Definition: dca-txop.cc:571
handle packet fragmentation and retransmissions.
Definition: dca-txop.h:67
Dcf(DcaTxop *txop)
Definition: dca-txop.cc:48
void SetFragmentNumber(uint8_t frag)
Set the fragment number of the header.
void DisableAck(void)
Do not wait for Ack after data transmission.
Definition: mac-low.cc:133
bool NeedDataRetransmission(void)
Check if DATA should be re-transmitted if ACK was missed.
Definition: dca-txop.cc:328
virtual uint32_t GetMinCw(void) const
Return the minimum congestion window size.
Definition: dca-txop.cc:233
Dcf * m_dcf
Definition: dca-txop.h:306
uint32_t GetFragmentSize(void)
Calculate the size of the current fragment.
Definition: dca-txop.cc:350
a unique identifier for an interface.
Definition: type-id.h:49
TypeId SetParent(TypeId tid)
Definition: type-id.cc:611
void NotifyAccessGranted(void)
Notify the DCF that access has been granted.
Definition: dca-txop.cc:408
virtual void DoInitialize(void)
This method is called only once by Object::Initialize.
Definition: object.cc:343
Implements the IEEE 802.11 MAC header.
Implements the IEEE 802.11 MAC trailer.
void EndTxNoAck(void)
Event handler when a transmission that does not require an ACK has completed.
Definition: dca-txop.cc:653
virtual uint32_t GetSerializedSize(void) const
RandomStream * m_rng
Definition: dca-txop.h:315
TxFailed m_txFailedCallback
Definition: dca-txop.h:309