LEFT | RIGHT |
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 * Copyright (c) 2009 MIRKO BANCHI | 4 * Copyright (c) 2009 MIRKO BANCHI |
5 * | 5 * |
6 * This program is free software; you can redistribute it and/or modify | 6 * This program is free software; you can redistribute it and/or modify |
7 * it under the terms of the GNU General Public License version 2 as· | 7 * it under the terms of the GNU General Public License version 2 as· |
8 * published by the Free Software Foundation; | 8 * published by the Free Software Foundation; |
9 * | 9 * |
10 * This program is distributed in the hope that it will be useful, | 10 * This program is distributed in the hope that it will be useful, |
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
352 }; | 352 }; |
353 | 353 |
354 std::ostream &operator << (std::ostream &os, const MacLowTransmissionParameters
¶ms); | 354 std::ostream &operator << (std::ostream &os, const MacLowTransmissionParameters
¶ms); |
355 | 355 |
356 | 356 |
357 /** | 357 /** |
358 * \brief handle RTS/CTS/DATA/ACK transactions. | 358 * \brief handle RTS/CTS/DATA/ACK transactions. |
359 */ | 359 */ |
360 class MacLow : public Object { | 360 class MacLow : public Object { |
361 public: | 361 public: |
362 typedef Callback<void, Ptr<Packet> , WifiMacHeader const*> MacLowRxCallback; | 362 typedef Callback<void, Ptr<Packet>, const WifiMacHeader*> MacLowRxCallback; |
363 | 363 |
364 MacLow (); | 364 MacLow (); |
365 virtual ~MacLow (); | 365 virtual ~MacLow (); |
366 | 366 |
367 void SetPhy (Ptr<WifiPhy> phy); | 367 void SetPhy (Ptr<WifiPhy> phy); |
368 void SetWifiRemoteStationManager (Ptr<WifiRemoteStationManager> manager); | 368 void SetWifiRemoteStationManager (Ptr<WifiRemoteStationManager> manager); |
369 | 369 |
370 void SetAddress (Mac48Address ad); | 370 void SetAddress (Mac48Address ad); |
371 void SetAckTimeout (Time ackTimeout); | 371 void SetAckTimeout (Time ackTimeout); |
372 void SetBasicBlockAckTimeout (Time blockAckTimeout); | 372 void SetBasicBlockAckTimeout (Time blockAckTimeout); |
(...skipping 28 matching lines...) Expand all Loading... |
401 | 401 |
402 /** | 402 /** |
403 * \param packet to send (does not include the 802.11 MAC header and checksum) | 403 * \param packet to send (does not include the 802.11 MAC header and checksum) |
404 * \param hdr header associated to the packet to send. | 404 * \param hdr header associated to the packet to send. |
405 * \param parameters transmission parameters of packet. | 405 * \param parameters transmission parameters of packet. |
406 * | 406 * |
407 * This transmission time includes the time required for | 407 * This transmission time includes the time required for |
408 * the next packet transmission if one was selected. | 408 * the next packet transmission if one was selected. |
409 */ | 409 */ |
410 Time CalculateTransmissionTime (Ptr<const Packet> packet, | 410 Time CalculateTransmissionTime (Ptr<const Packet> packet, |
411 WifiMacHeader const*hdr,· | 411 const WifiMacHeader* hdr,· |
412 MacLowTransmissionParameters const¶meters)
const; | 412 const MacLowTransmissionParameters& parameters
) const; |
413 | 413 |
414 /** | 414 /** |
415 * \param packet packet to send | 415 * \param packet packet to send |
416 * \param hdr 802.11 header for packet to send | 416 * \param hdr 802.11 header for packet to send |
417 * \param parameters the transmission parameters to use for this packet. | 417 * \param parameters the transmission parameters to use for this packet. |
418 * \param listener listen to transmission events. | 418 * \param listener listen to transmission events. |
419 * | 419 * |
420 * Start the transmission of the input packet and notify the listener | 420 * Start the transmission of the input packet and notify the listener |
421 * of transmission events. | 421 * of transmission events. |
422 */ | 422 */ |
423 void StartTransmission (Ptr<const Packet> packet,· | 423 void StartTransmission (Ptr<const Packet> packet,· |
424 WifiMacHeader const*hdr,· | 424 const WifiMacHeader* hdr,· |
425 MacLowTransmissionParameters parameters, | 425 MacLowTransmissionParameters parameters, |
426 MacLowTransmissionListener *listener); | 426 MacLowTransmissionListener *listener); |
427 | 427 |
428 /** | 428 /** |
429 * \param packet packet received | 429 * \param packet packet received |
430 * \param rxSnr snr of packet received | 430 * \param rxSnr snr of packet received |
431 * \param txMode transmission mode of packet received | 431 * \param txMode transmission mode of packet received |
432 * \param preamble type of preamble used for the packet received | 432 * \param preamble type of preamble used for the packet received |
433 * | 433 * |
434 * This method is typically invoked by the lower PHY layer to notify | 434 * This method is typically invoked by the lower PHY layer to notify |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
482 void RegisterBlockAckListenerForAc (enum AccessClass ac, MacLowBlockAckEventLi
stener *listener); | 482 void RegisterBlockAckListenerForAc (enum AccessClass ac, MacLowBlockAckEventLi
stener *listener); |
483 private: | 483 private: |
484 void CancelAllEvents (void); | 484 void CancelAllEvents (void); |
485 uint32_t GetAckSize (void) const; | 485 uint32_t GetAckSize (void) const; |
486 uint32_t GetBlockAckSize (enum BlockAckType type) const; | 486 uint32_t GetBlockAckSize (enum BlockAckType type) const; |
487 uint32_t GetRtsSize (void) const; | 487 uint32_t GetRtsSize (void) const; |
488 uint32_t GetCtsSize (void) const; | 488 uint32_t GetCtsSize (void) const; |
489 uint32_t GetSize (Ptr<const Packet> packet, const WifiMacHeader *hdr) const; | 489 uint32_t GetSize (Ptr<const Packet> packet, const WifiMacHeader *hdr) const; |
490 Time NowUs (void) const; | 490 Time NowUs (void) const; |
491 WifiRemoteStation *GetStation (Mac48Address to) const; | 491 WifiRemoteStation *GetStation (Mac48Address to) const; |
492 void ForwardDown (Ptr<const Packet> packet, WifiMacHeader const *hdr,· | 492 void ForwardDown (Ptr<const Packet> packet, const WifiMacHeader *hdr,· |
493 WifiMode txMode); | 493 WifiMode txMode); |
494 Time CalculateOverallTxTime (Ptr<const Packet> packet, | 494 Time CalculateOverallTxTime (Ptr<const Packet> packet, |
495 WifiMacHeader const*hdr,· | 495 const WifiMacHeader* hdr,· |
496 MacLowTransmissionParameters const ¶ms) const
; | 496 const MacLowTransmissionParameters ¶ms) const
; |
497 WifiMode GetRtsTxMode (Ptr<const Packet> packet, const WifiMacHeader *hdr) con
st; | 497 WifiMode GetRtsTxMode (Ptr<const Packet> packet, const WifiMacHeader *hdr) con
st; |
498 WifiMode GetDataTxMode (Ptr<const Packet> packet, const WifiMacHeader *hdr) co
nst; | 498 WifiMode GetDataTxMode (Ptr<const Packet> packet, const WifiMacHeader *hdr) co
nst; |
499 WifiMode GetCtsTxModeForRts (Mac48Address to, WifiMode rtsTxMode) const; | 499 WifiMode GetCtsTxModeForRts (Mac48Address to, WifiMode rtsTxMode) const; |
500 WifiMode GetAckTxModeForData (Mac48Address to, WifiMode dataTxMode) const; | 500 WifiMode GetAckTxModeForData (Mac48Address to, WifiMode dataTxMode) const; |
501 | 501 |
502 Time GetCtsDuration (Mac48Address to, WifiMode rtsTxMode) const; | 502 Time GetCtsDuration (Mac48Address to, WifiMode rtsTxMode) const; |
503 Time GetAckDuration (Mac48Address to, WifiMode dataTxMode) const; | 503 Time GetAckDuration (Mac48Address to, WifiMode dataTxMode) const; |
504 Time GetBlockAckDuration (Mac48Address to, WifiMode blockAckReqTxMode, enum Bl
ockAckType type) const; | 504 Time GetBlockAckDuration (Mac48Address to, WifiMode blockAckReqTxMode, enum Bl
ockAckType type) const; |
505 void NotifyNav (const WifiMacHeader &hdr, WifiMode txMode, WifiPreamble preamb
le); | 505 void NotifyNav (const WifiMacHeader &hdr, WifiMode txMode, WifiPreamble preamb
le); |
506 void DoNavResetNow (Time duration); | 506 void DoNavResetNow (Time duration); |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
556 * If there is, store the packet without pass it up to WifiMac. The packet is
buffered | 556 * If there is, store the packet without pass it up to WifiMac. The packet is
buffered |
557 * in order of increasing sequence control field. All comparison are performed | 557 * in order of increasing sequence control field. All comparison are performed |
558 * circularly modulo 2^12. | 558 * circularly modulo 2^12. |
559 */ | 559 */ |
560 bool StoreMpduIfNeeded (Ptr<Packet> packet, WifiMacHeader hdr); | 560 bool StoreMpduIfNeeded (Ptr<Packet> packet, WifiMacHeader hdr); |
561 /* | 561 /* |
562 * Invoked after that a block ack request has been received. Looks for corresp
onding | 562 * Invoked after that a block ack request has been received. Looks for corresp
onding |
563 * block ack agreement and creates block ack bitmap on a received packets basi
s. | 563 * block ack agreement and creates block ack bitmap on a received packets basi
s. |
564 */ | 564 */ |
565 void SendBlockAckAfterBlockAckRequest (const CtrlBAckRequestHeader reqHdr, Mac
48Address originator, | 565 void SendBlockAckAfterBlockAckRequest (const CtrlBAckRequestHeader reqHdr, Mac
48Address originator, |
566 Time duration, WifiMode txMode); | 566 Time duration, WifiMode blockAckReqTxMo
de); |
567 /* | 567 /* |
568 * This method creates block ack frame with header equals to <i>blockAck</i> a
nd start its transmission. | 568 * This method creates block ack frame with header equals to <i>blockAck</i> a
nd start its transmission. |
569 */ | 569 */ |
570 void SendBlockAckResponse (const CtrlBAckResponseHeader* blockAck, Mac48Addres
s originator, bool immediate, | 570 void SendBlockAckResponse (const CtrlBAckResponseHeader* blockAck, Mac48Addres
s originator, bool immediate, |
571 Time duration, WifiMode txMode); | 571 Time duration, WifiMode blockAckReqTxMode); |
572 /* | 572 /* |
573 * Every time that a block ack request or a packet with ack policy equals to <
i>block ack</i> | 573 * Every time that a block ack request or a packet with ack policy equals to <
i>block ack</i> |
574 * are received, if a relative block ack agreement exists and the value of ina
ctivity timeout | 574 * are received, if a relative block ack agreement exists and the value of ina
ctivity timeout |
575 * is not 0, the timer is reset. | 575 * is not 0, the timer is reset. |
576 * see section 11.5.3 in IEEE802.11e for more details. | 576 * see section 11.5.3 in IEEE802.11e for more details. |
577 */ | 577 */ |
578 void ResetBlockAckInactivityTimerIfNeeded (BlockAckAgreement &agreement); | 578 void ResetBlockAckInactivityTimerIfNeeded (BlockAckAgreement &agreement); |
579 | 579 |
580 void SetupPhyMacLowListener (Ptr<WifiPhy> phy);· | 580 void SetupPhyMacLowListener (Ptr<WifiPhy> phy);· |
581 | 581 |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
632 | 632 |
633 Agreements m_bAckAgreements; | 633 Agreements m_bAckAgreements; |
634 ·· | 634 ·· |
635 typedef std::map<AccessClass, MacLowBlockAckEventListener*> QueueListeners; | 635 typedef std::map<AccessClass, MacLowBlockAckEventListener*> QueueListeners; |
636 QueueListeners m_edcaListeners; | 636 QueueListeners m_edcaListeners; |
637 }; | 637 }; |
638 | 638 |
639 } // namespace ns3 | 639 } // namespace ns3 |
640 | 640 |
641 #endif /* MAC_LOW_H */ | 641 #endif /* MAC_LOW_H */ |
LEFT | RIGHT |