|
|
| 150 |
MacLowDcfListener (); |
150 |
MacLowDcfListener (); |
| 151 |
virtual ~MacLowDcfListener (); |
151 |
virtual ~MacLowDcfListener (); |
| 152 |
/** |
152 |
/** |
|
|
153 |
* Norify that NAV has started for the given duration. |
| 154 |
* |
| 153 |
* \param duration duration of NAV timer |
155 |
* \param duration duration of NAV timer |
| 154 |
*/ |
156 |
*/ |
| 155 |
virtual void NavStart (Time duration) = 0; |
157 |
virtual void NavStart (Time duration) = 0; |
| 156 |
/** |
158 |
/** |
|
|
159 |
* Notify that NAV has resetted. |
| 160 |
* |
| 157 |
* \param duration duration of NAV timer |
161 |
* \param duration duration of NAV timer |
| 158 |
*/ |
162 |
*/ |
| 159 |
virtual void NavReset (Time duration) = 0; |
163 |
virtual void NavReset (Time duration) = 0; |
|
|
164 |
/** |
| 165 |
* Notify that ACK timeout has started for a given duration. |
| 166 |
* |
| 167 |
* \param duration duration of ACK timeout |
| 168 |
*/ |
| 160 |
virtual void AckTimeoutStart (Time duration) = 0; |
169 |
virtual void AckTimeoutStart (Time duration) = 0; |
|
|
170 |
/** |
| 171 |
* Notify that ACK timeout has resetted. |
| 172 |
*/ |
| 161 |
virtual void AckTimeoutReset () = 0; |
173 |
virtual void AckTimeoutReset () = 0; |
|
|
174 |
/** |
| 175 |
* Notify that CTS timeout has started for a given duration. |
| 176 |
* |
| 177 |
* \param duration duration of CTS timeout |
| 178 |
*/ |
| 162 |
virtual void CtsTimeoutStart (Time duration) = 0; |
179 |
virtual void CtsTimeoutStart (Time duration) = 0; |
|
|
180 |
/** |
| 181 |
* Notify that CTS timeout has resetted. |
| 182 |
*/ |
| 163 |
virtual void CtsTimeoutReset () = 0; |
183 |
virtual void CtsTimeoutReset () = 0; |
| 164 |
}; |
184 |
}; |
| 165 |
|
185 |
|
|
|
| 180 |
* agreement. Timer is reset when a frame with ack policy block ack |
200 |
* agreement. Timer is reset when a frame with ack policy block ack |
| 181 |
* or a block ack request are received. When this timer reaches zero |
201 |
* or a block ack request are received. When this timer reaches zero |
| 182 |
* this method is called and a delba frame is scheduled for transmission. |
202 |
* this method is called and a delba frame is scheduled for transmission. |
|
|
203 |
* |
| 204 |
* \param originator MAC address of the data originator |
| 205 |
* \param tid |
| 183 |
*/ |
206 |
*/ |
| 184 |
virtual void BlockAckInactivityTimeout (Mac48Address originator, uint8_t tid) = 0; |
207 |
virtual void BlockAckInactivityTimeout (Mac48Address originator, uint8_t tid) = 0; |
| 185 |
}; |
208 |
}; |
|
|
| 385 |
MacLow (); |
408 |
MacLow (); |
| 386 |
virtual ~MacLow (); |
409 |
virtual ~MacLow (); |
| 387 |
|
410 |
|
|
|
411 |
/** |
| 412 |
* Set up WifiPhy associated with this MacLow. |
| 413 |
* |
| 414 |
* \param phy WifiPhy associated with this MacLow |
| 415 |
*/ |
| 388 |
void SetPhy (Ptr<WifiPhy> phy); |
416 |
void SetPhy (Ptr<WifiPhy> phy); |
|
|
417 |
/** |
| 418 |
* Set up WifiRemoteStationManager associated with this MacLow. |
| 419 |
* |
| 420 |
* \param manager WifiRemoteStationManager associated with this MacLow |
| 421 |
*/ |
| 389 |
void SetWifiRemoteStationManager (Ptr<WifiRemoteStationManager> manager); |
422 |
void SetWifiRemoteStationManager (Ptr<WifiRemoteStationManager> manager); |
| 390 |
|
423 |
|
|
|
424 |
/** |
| 425 |
* Set MAC address of this MacLow. |
| 426 |
* |
| 427 |
* \param ad Mac48Address of this MacLow |
| 428 |
*/ |
| 391 |
void SetAddress (Mac48Address ad); |
429 |
void SetAddress (Mac48Address ad); |
|
|
430 |
/** |
| 431 |
* Set ACK timeout of this MacLow. |
| 432 |
* |
| 433 |
* \param ackTimeout ACK timeout of this MacLow |
| 434 |
*/ |
| 392 |
void SetAckTimeout (Time ackTimeout); |
435 |
void SetAckTimeout (Time ackTimeout); |
|
|
436 |
/** |
| 437 |
* Set Basic Block ACK timeout of this MacLow. |
| 438 |
* |
| 439 |
* \param blockAckTimeout Basic Block ACK timeout of this MacLow |
| 440 |
*/ |
| 393 |
void SetBasicBlockAckTimeout (Time blockAckTimeout); |
441 |
void SetBasicBlockAckTimeout (Time blockAckTimeout); |
|
|
442 |
/** |
| 443 |
* Set Compressed Block ACK timeout of this MacLow. |
| 444 |
* |
| 445 |
* \param blockAckTimeout Compressed Block ACK timeout of this MacLow |
| 446 |
*/ |
| 394 |
void SetCompressedBlockAckTimeout (Time blockAckTimeout); |
447 |
void SetCompressedBlockAckTimeout (Time blockAckTimeout); |
|
|
448 |
/** |
| 449 |
* Enable or disable CTS-to-self capability. |
| 450 |
* |
| 451 |
* \param enable Enable or disable CTS-to-self capability |
| 452 |
*/ |
| 395 |
void SetCtsToSelfSupported (bool enable); |
453 |
void SetCtsToSelfSupported (bool enable); |
|
|
454 |
/** |
| 455 |
* Set CTS timeout of this MacLow. |
| 456 |
* |
| 457 |
* \param ctsTimeout CTS timeout of this MacLow |
| 458 |
*/ |
| 396 |
void SetCtsTimeout (Time ctsTimeout); |
459 |
void SetCtsTimeout (Time ctsTimeout); |
|
|
460 |
/** |
| 461 |
* Set Short Interframe Space (SIFS) of this MacLow. |
| 462 |
* |
| 463 |
* \param sifs SIFS of this MacLow |
| 464 |
*/ |
| 397 |
void SetSifs (Time sifs); |
465 |
void SetSifs (Time sifs); |
|
|
466 |
/** |
| 467 |
* Set Reduced Interframe Space (RIFS) of this MacLow. |
| 468 |
* |
| 469 |
* \param rifs RIFS of this MacLow |
| 470 |
*/ |
| 398 |
void SetRifs (Time rifs); |
471 |
void SetRifs (Time rifs); |
|
|
472 |
/** |
| 473 |
* Set slot duration of this MacLow. |
| 474 |
* |
| 475 |
* \param slotTime slot duration of this MacLow |
| 476 |
*/ |
| 399 |
void SetSlotTime (Time slotTime); |
477 |
void SetSlotTime (Time slotTime); |
|
|
478 |
/** |
| 479 |
* Set PCF Interframe Space (PIFS) of this MacLow. |
| 480 |
* |
| 481 |
* \param pifs PIFS of this MacLow |
| 482 |
*/ |
| 400 |
void SetPifs (Time pifs); |
483 |
void SetPifs (Time pifs); |
|
|
484 |
/** |
| 485 |
* Set the Basic Service Set Identification. |
| 486 |
* |
| 487 |
* \param ad the BSSID |
| 488 |
*/ |
| 401 |
void SetBssid (Mac48Address ad); |
489 |
void SetBssid (Mac48Address ad); |
|
|
490 |
/** |
| 491 |
* Enable promiscuous mode. |
| 492 |
*/ |
| 402 |
void SetPromisc (void); |
493 |
void SetPromisc (void); |
|
|
494 |
/** |
| 495 |
* Return whether CTS-to-self capability is supported. |
| 496 |
* |
| 497 |
* \return true if CTS-to-self is supported, false otherwise |
| 498 |
*/ |
| 403 |
bool GetCtsToSelfSupported () const; |
499 |
bool GetCtsToSelfSupported () const; |
|
|
500 |
/** |
| 501 |
* Return the MAC address of this MacLow. |
| 502 |
* |
| 503 |
* \return Mac48Address of this MacLow |
| 504 |
*/ |
| 404 |
Mac48Address GetAddress (void) const; |
505 |
Mac48Address GetAddress (void) const; |
|
|
506 |
/** |
| 507 |
* Return ACK timeout of this MacLow. |
| 508 |
* |
| 509 |
* \return ACK timeout |
| 510 |
*/ |
| 405 |
Time GetAckTimeout (void) const; |
511 |
Time GetAckTimeout (void) const; |
|
|
512 |
/** |
| 513 |
* Return Basic Block ACK timeout of this MacLow. |
| 514 |
* |
| 515 |
* \return Basic Block ACK timeout |
| 516 |
*/ |
| 406 |
Time GetBasicBlockAckTimeout () const; |
517 |
Time GetBasicBlockAckTimeout () const; |
|
|
518 |
/** |
| 519 |
* Return Compressed Block ACK timeout of this MacLow. |
| 520 |
* |
| 521 |
* \return Compressed Block ACK timeout |
| 522 |
*/ |
| 407 |
Time GetCompressedBlockAckTimeout () const; |
523 |
Time GetCompressedBlockAckTimeout () const; |
|
|
524 |
/** |
| 525 |
* Return CTS timeout of this MacLow. |
| 526 |
* |
| 527 |
* \return CTS timeout |
| 528 |
*/ |
| 408 |
Time GetCtsTimeout (void) const; |
529 |
Time GetCtsTimeout (void) const; |
|
|
530 |
/** |
| 531 |
* Return Short Interframe Space (SIFS) of this MacLow. |
| 532 |
* |
| 533 |
* \return SIFS |
| 534 |
*/ |
| 409 |
Time GetSifs (void) const; |
535 |
Time GetSifs (void) const; |
|
|
536 |
/** |
| 537 |
* Return slot duration of this MacLow. |
| 538 |
* |
| 539 |
* \return slot duration |
| 540 |
*/ |
| 410 |
Time GetSlotTime (void) const; |
541 |
Time GetSlotTime (void) const; |
|
|
542 |
/** |
| 543 |
* Return PCF Interframe Space (PIFS) of this MacLow. |
| 544 |
* |
| 545 |
* \return PIFS |
| 546 |
*/ |
| 411 |
Time GetPifs (void) const; |
547 |
Time GetPifs (void) const; |
|
|
548 |
/** |
| 549 |
* Return Reduced Interframe Space (RIFS) of this MacLow. |
| 550 |
* |
| 551 |
* \return RIFS |
| 552 |
*/ |
| 412 |
Time GetRifs (void) const; |
553 |
Time GetRifs (void) const; |
|
|
554 |
/** |
| 555 |
* Return the Basic Service Set Identification. |
| 556 |
* |
| 557 |
* \return BSSID |
| 558 |
*/ |
| 413 |
Mac48Address GetBssid (void) const; |
559 |
Mac48Address GetBssid (void) const; |
| 414 |
|
560 |
|
| 415 |
/** |
561 |
/** |
|
|
| 429 |
* \param packet to send (does not include the 802.11 MAC header and checksum) |
575 |
* \param packet to send (does not include the 802.11 MAC header and checksum) |
| 430 |
* \param hdr header associated to the packet to send. |
576 |
* \param hdr header associated to the packet to send. |
| 431 |
* \param parameters transmission parameters of packet. |
577 |
* \param parameters transmission parameters of packet. |
|
|
578 |
* \return the transmission time that includes the time for the next packet transmission |
| 432 |
* |
579 |
* |
| 433 |
* This transmission time includes the time required for |
580 |
* This transmission time includes the time required for |
| 434 |
* the next packet transmission if one was selected. |
581 |
* the next packet transmission if one was selected. |
|
|
| 513 |
*/ |
660 |
*/ |
| 514 |
void RegisterBlockAckListenerForAc (enum AcIndex ac, MacLowBlockAckEventListener *listener); |
661 |
void RegisterBlockAckListenerForAc (enum AcIndex ac, MacLowBlockAckEventListener *listener); |
| 515 |
private: |
662 |
private: |
|
|
663 |
/** |
| 664 |
* Cancel all scheduled events. Called before beginning a transmission |
| 665 |
* or switching channel. |
| 666 |
*/ |
| 516 |
void CancelAllEvents (void); |
667 |
void CancelAllEvents (void); |
|
|
668 |
/** |
| 669 |
* Return the total ACK size (including FCS trailer). |
| 670 |
* |
| 671 |
* \return the total ACK size |
| 672 |
*/ |
| 517 |
uint32_t GetAckSize (void) const; |
673 |
uint32_t GetAckSize (void) const; |
|
|
674 |
/** |
| 675 |
* Return the total Block ACK size (including FCS trailer). |
| 676 |
* |
| 677 |
* \param type the Block ACK type |
| 678 |
* \return the total Block ACK size |
| 679 |
*/ |
| 518 |
uint32_t GetBlockAckSize (enum BlockAckType type) const; |
680 |
uint32_t GetBlockAckSize (enum BlockAckType type) const; |
|
|
681 |
/** |
| 682 |
* Return the total RTS size (including FCS trailer). |
| 683 |
* |
| 684 |
* \return the total RTS size |
| 685 |
*/ |
| 519 |
uint32_t GetRtsSize (void) const; |
686 |
uint32_t GetRtsSize (void) const; |
|
|
687 |
/** |
| 688 |
* Return the total CTS size (including FCS trailer). |
| 689 |
* |
| 690 |
* \return the total CTS size |
| 691 |
*/ |
| 520 |
uint32_t GetCtsSize (void) const; |
692 |
uint32_t GetCtsSize (void) const; |
|
|
693 |
/** |
| 694 |
* Return the total size of the packet after WifiMacHeader and FCS trailer |
| 695 |
* have been added. |
| 696 |
* |
| 697 |
* \param packet the packet to be encapsulated with WifiMacHeader and FCS trailer |
| 698 |
* \param hdr the WifiMacHeader |
| 699 |
* \return the total packet size |
| 700 |
*/ |
| 521 |
uint32_t GetSize (Ptr<const Packet> packet, const WifiMacHeader *hdr) const; |
701 |
uint32_t GetSize (Ptr<const Packet> packet, const WifiMacHeader *hdr) const; |
|
|
702 |
/** |
| 703 |
* Forward the packet down to WifiPhy for transmission. |
| 704 |
* |
| 705 |
* \param packet |
| 706 |
* \param hdr |
| 707 |
* \param txVector |
| 708 |
* \param preamble |
| 709 |
*/ |
| 522 |
void ForwardDown (Ptr<const Packet> packet, const WifiMacHeader *hdr, |
710 |
void ForwardDown (Ptr<const Packet> packet, const WifiMacHeader *hdr, |
| 523 |
WifiTxVector txVector, WifiPreamble preamble); |
711 |
WifiTxVector txVector, WifiPreamble preamble); |
|
|
712 |
/** |
| 713 |
* Return a TXVECTOR for the RTS frame given the destination. |
| 714 |
* The function consults WifiRemoteStationManager, which controls the rate |
| 715 |
* to different destinations. |
| 716 |
* |
| 717 |
* \param packet the packet being asked for RTS TXVECTOR |
| 718 |
* \param hdr the WifiMacHeader |
| 719 |
* \return TXVECTOR for the RTS of the given packet |
| 720 |
*/ |
| 524 |
WifiTxVector GetRtsTxVector (Ptr<const Packet> packet, const WifiMacHeader *hdr) const; |
721 |
WifiTxVector GetRtsTxVector (Ptr<const Packet> packet, const WifiMacHeader *hdr) const; |
|
|
722 |
/** |
| 723 |
* Return a TXVECTOR for the DATA frame given the destination. |
| 724 |
* The function consults WifiRemoteStationManager, which controls the rate |
| 725 |
* to different destinations. |
| 726 |
* |
| 727 |
* \param packet the packet being asked for TXVECTOR |
| 728 |
* \param hdr the WifiMacHeader |
| 729 |
* \return TXVECTOR for the given packet |
| 730 |
*/ |
| 525 |
WifiTxVector GetDataTxVector (Ptr<const Packet> packet, const WifiMacHeader *hdr) const; |
731 |
WifiTxVector GetDataTxVector (Ptr<const Packet> packet, const WifiMacHeader *hdr) const; |
|
|
732 |
/** |
| 733 |
* Return a TXVECTOR for the CTS frame given the destination and the mode of the RTS |
| 734 |
* used by the sender. |
| 735 |
* The function consults WifiRemoteStationManager, which controls the rate |
| 736 |
* to different destinations. |
| 737 |
* |
| 738 |
* \param to the MAC address of the CTS receiver |
| 739 |
* \param rtsTxMode the mode of the RTS used by the sender |
| 740 |
* \return TXVECTOR for the CTS |
| 741 |
*/ |
| 526 |
WifiTxVector GetCtsTxVector (Mac48Address to, WifiMode rtsTxMode) const; |
742 |
WifiTxVector GetCtsTxVector (Mac48Address to, WifiMode rtsTxMode) const; |
|
|
743 |
/** |
| 744 |
* Return a TXVECTOR for the ACK frame given the destination and the mode of the DATA |
| 745 |
* used by the sender. |
| 746 |
* The function consults WifiRemoteStationManager, which controls the rate |
| 747 |
* to different destinations. |
| 748 |
* |
| 749 |
* \param to the MAC address of the ACK receiver |
| 750 |
* \param dataTxMode the mode of the DATA used by the sender |
| 751 |
* \return TXVECTOR for the ACK |
| 752 |
*/ |
| 527 |
WifiTxVector GetAckTxVector (Mac48Address to, WifiMode dataTxMode) const; |
753 |
WifiTxVector GetAckTxVector (Mac48Address to, WifiMode dataTxMode) const; |
|
|
754 |
/** |
| 755 |
* Return a TXVECTOR for the Block ACK frame given the destination and the mode of the DATA |
| 756 |
* used by the sender. |
| 757 |
* The function consults WifiRemoteStationManager, which controls the rate |
| 758 |
* to different destinations. |
| 759 |
* |
| 760 |
* \param to the MAC address of the Block ACK receiver |
| 761 |
* \param dataTxMode the mode of the DATA used by the sender |
| 762 |
* \return TXVECTOR for the Block ACK |
| 763 |
*/ |
| 528 |
WifiTxVector GetBlockAckTxVector (Mac48Address to, WifiMode dataTxMode) const; |
764 |
WifiTxVector GetBlockAckTxVector (Mac48Address to, WifiMode dataTxMode) const; |
| 529 |
|
765 |
|
|
|
766 |
/** |
| 767 |
* Return a TXVECTOR for the CTS-to-self frame. |
| 768 |
* The function consults WifiRemoteStationManager, which controls the rate |
| 769 |
* to different destinations. |
| 770 |
* |
| 771 |
* \param packet the packet that requires CTS-to-self |
| 772 |
* \param hdr the Wifi header of the packet |
| 773 |
* \return TXVECTOR for the CTS-to-self operation |
| 774 |
*/ |
| 530 |
WifiTxVector GetCtsToSelfTxVector (Ptr<const Packet> packet, const WifiMacHeader *hdr) const; |
775 |
WifiTxVector GetCtsToSelfTxVector (Ptr<const Packet> packet, const WifiMacHeader *hdr) const; |
| 531 |
|
776 |
|
|
|
777 |
/** |
| 778 |
* Return a TXVECTOR for the CTS frame given the destination and the mode of the RTS |
| 779 |
* used by the sender. |
| 780 |
* The function consults WifiRemoteStationManager, which controls the rate |
| 781 |
* to different destinations. |
| 782 |
* |
| 783 |
* \param to the MAC address of the CTS receiver |
| 784 |
* \param rtsTxMode the mode of the RTS used by the sender |
| 785 |
* \return TXVECTOR for the CTS |
| 786 |
*/ |
| 532 |
WifiTxVector GetCtsTxVectorForRts (Mac48Address to, WifiMode rtsTxMode) const; |
787 |
WifiTxVector GetCtsTxVectorForRts (Mac48Address to, WifiMode rtsTxMode) const; |
|
|
788 |
/** |
| 789 |
* Return a TXVECTOR for the Block ACK frame given the destination and the mode of the DATA |
| 790 |
* used by the sender. |
| 791 |
* The function consults WifiRemoteStationManager, which controls the rate |
| 792 |
* to different destinations. |
| 793 |
* |
| 794 |
* \param to the MAC address of the Block ACK receiver |
| 795 |
* \param dataTxMode the mode of the DATA used by the sender |
| 796 |
* \return TXVECTOR for the Block ACK |
| 797 |
*/ |
| 533 |
WifiTxVector GetAckTxVectorForData (Mac48Address to, WifiMode dataTxMode) const; |
798 |
WifiTxVector GetAckTxVectorForData (Mac48Address to, WifiMode dataTxMode) const; |
| 534 |
|
799 |
|
|
|
800 |
/** |
| 801 |
* Return the time required to transmit the CTS (including preamble and FCS). |
| 802 |
* |
| 803 |
* \param ctsTxVector |
| 804 |
* \return the time required to transmit the CTS (including preamble and FCS) |
| 805 |
*/ |
| 535 |
Time GetCtsDuration (WifiTxVector ctsTxVector) const; |
806 |
Time GetCtsDuration (WifiTxVector ctsTxVector) const; |
|
|
807 |
/** |
| 808 |
* Return the time required to transmit the CTS to the specified address |
| 809 |
* given the TXVECTOR of the RTS (including preamble and FCS). |
| 810 |
* |
| 811 |
* \param to |
| 812 |
* \param rtsTxVector |
| 813 |
* \return the time required to transmit the CTS (including preamble and FCS) |
| 814 |
*/ |
| 536 |
Time GetCtsDuration (Mac48Address to, WifiTxVector rtsTxVector) const; |
815 |
Time GetCtsDuration (Mac48Address to, WifiTxVector rtsTxVector) const; |
|
|
816 |
/** |
| 817 |
* Return the time required to transmit the ACK (including preamble and FCS). |
| 818 |
* |
| 819 |
* \param ackTxVector |
| 820 |
* \return the time required to transmit the ACK (including preamble and FCS) |
| 821 |
*/ |
| 537 |
Time GetAckDuration (WifiTxVector ackTxVector) const; |
822 |
Time GetAckDuration (WifiTxVector ackTxVector) const; |
|
|
823 |
/** |
| 824 |
* Return the time required to transmit the ACK to the specified address |
| 825 |
* given the TXVECTOR of the DATA (including preamble and FCS). |
| 826 |
* |
| 827 |
* \param to |
| 828 |
* \param dataTxVector |
| 829 |
* \return the time required to transmit the ACK (including preamble and FCS) |
| 830 |
*/ |
| 538 |
Time GetAckDuration (Mac48Address to, WifiTxVector dataTxVector) const; |
831 |
Time GetAckDuration (Mac48Address to, WifiTxVector dataTxVector) const; |
| 539 |
Time GetBlockAckDuration (Mac48Address to, WifiTxVector blockAckReqTxVector, enum BlockAckType type) const; |
832 |
Time GetBlockAckDuration (Mac48Address to, WifiTxVector blockAckReqTxVector, enum BlockAckType type) const; |
| 540 |
|
833 |
|
|
|
834 |
/** |
| 835 |
* Check if CTS-to-self mechanism should be used for the current packet. |
| 836 |
* |
| 837 |
* \return true if CTS-to-self mechanism should be used for the current packet, |
| 838 |
* false otherwise |
| 839 |
*/ |
| 541 |
bool NeedCtsToSelf (void); |
840 |
bool NeedCtsToSelf (void); |
| 542 |
|
841 |
|
| 543 |
Time CalculateOverallTxTime (Ptr<const Packet> packet, |
842 |
Time CalculateOverallTxTime (Ptr<const Packet> packet, |
| 544 |
const WifiMacHeader* hdr, |
843 |
const WifiMacHeader* hdr, |
| 545 |
const MacLowTransmissionParameters ¶ms) const; |
844 |
const MacLowTransmissionParameters ¶ms) const; |
| 546 |
void NotifyNav (Ptr<const Packet> packet,const WifiMacHeader &hdr, WifiMode txMode, WifiPreamble preamble); |
845 |
void NotifyNav (Ptr<const Packet> packet,const WifiMacHeader &hdr, WifiMode txMode, WifiPreamble preamble); |
|
|
846 |
/** |
| 847 |
* Reset NAV with the given duration. |
| 848 |
* |
| 849 |
* \param duration |
| 850 |
*/ |
| 547 |
void DoNavResetNow (Time duration); |
851 |
void DoNavResetNow (Time duration); |
|
|
852 |
/** |
| 853 |
* Start NAV with the given duration. |
| 854 |
* |
| 855 |
* \param duration |
| 856 |
* \return true if NAV is resetted |
| 857 |
*/ |
| 548 |
bool DoNavStartNow (Time duration); |
858 |
bool DoNavStartNow (Time duration); |
|
|
859 |
/** |
| 860 |
* Check if NAV is zero. |
| 861 |
* |
| 862 |
* \return true if NAV is zero, |
| 863 |
* false otherwise |
| 864 |
*/ |
| 549 |
bool IsNavZero (void) const; |
865 |
bool IsNavZero (void) const; |
|
|
866 |
/** |
| 867 |
* Notify DcfManager (via DcfListener) that |
| 868 |
* ACK timer should be started for the given |
| 869 |
* duration. |
| 870 |
* |
| 871 |
* \param duration |
| 872 |
*/ |
| 550 |
void NotifyAckTimeoutStartNow (Time duration); |
873 |
void NotifyAckTimeoutStartNow (Time duration); |
|
|
874 |
/** |
| 875 |
* Notify DcfManager (via DcfListener) that |
| 876 |
* ACK timer should be resetted. |
| 877 |
*/ |
| 551 |
void NotifyAckTimeoutResetNow (); |
878 |
void NotifyAckTimeoutResetNow (); |
|
|
879 |
/** |
| 880 |
* Notify DcfManager (via DcfListener) that |
| 881 |
* CTS timer should be started for the given |
| 882 |
* duration. |
| 883 |
* |
| 884 |
* \param duration |
| 885 |
*/ |
| 552 |
void NotifyCtsTimeoutStartNow (Time duration); |
886 |
void NotifyCtsTimeoutStartNow (Time duration); |
|
|
887 |
/** |
| 888 |
* Notify DcfManager (via DcfListener) that |
| 889 |
* CTS timer should be resetted. |
| 890 |
*/ |
| 553 |
void NotifyCtsTimeoutResetNow (); |
891 |
void NotifyCtsTimeoutResetNow (); |
| 554 |
|
892 |
|
|
|
893 |
/** |
| 894 |
* Reset NAV after CTS was missed when the NAV was |
| 895 |
* setted with RTS. |
| 896 |
* |
| 897 |
* \param rtsEndRxTime |
| 898 |
*/ |
| 555 |
void NavCounterResetCtsMissed (Time rtsEndRxTime); |
899 |
void NavCounterResetCtsMissed (Time rtsEndRxTime); |
|
|
900 |
|
| 901 |
/* Event handlers */ |
| 902 |
/** |
| 903 |
* Event handler when normal ACK timeout occurs. |
| 904 |
*/ |
| 556 |
void NormalAckTimeout (void); |
905 |
void NormalAckTimeout (void); |
|
|
906 |
/** |
| 907 |
* Event handler when fast ACK timeout occurs (idle). |
| 908 |
*/ |
| 557 |
void FastAckTimeout (void); |
909 |
void FastAckTimeout (void); |
|
|
910 |
/** |
| 911 |
* Event handler when super fast ACK timeout occurs. |
| 912 |
*/ |
| 558 |
void SuperFastAckTimeout (void); |
913 |
void SuperFastAckTimeout (void); |
|
|
914 |
/** |
| 915 |
* Event handler when fast ACK timeout occurs (busy). |
| 916 |
*/ |
| 559 |
void FastAckFailedTimeout (void); |
917 |
void FastAckFailedTimeout (void); |
|
|
918 |
/** |
| 919 |
* Event handler when block ACK timeout occurs. |
| 920 |
*/ |
| 560 |
void BlockAckTimeout (void); |
921 |
void BlockAckTimeout (void); |
|
|
922 |
/** |
| 923 |
* Event handler when CTS timeout occurs. |
| 924 |
*/ |
| 561 |
void CtsTimeout (void); |
925 |
void CtsTimeout (void); |
|
|
926 |
/** |
| 927 |
* Send CTS for a CTS-to-self mechanism. |
| 928 |
*/ |
| 562 |
void SendCtsToSelf (void); |
929 |
void SendCtsToSelf (void); |
|
|
930 |
/** |
| 931 |
* Send CTS after receiving RTS. |
| 932 |
* |
| 933 |
* \param source |
| 934 |
* \param duration |
| 935 |
* \param txMode |
| 936 |
* \param rtsSnr |
| 937 |
*/ |
| 563 |
void SendCtsAfterRts (Mac48Address source, Time duration, WifiMode txMode, double rtsSnr); |
938 |
void SendCtsAfterRts (Mac48Address source, Time duration, WifiMode txMode, double rtsSnr); |
| 564 |
void SendAckAfterData (Mac48Address source, Time duration, WifiMode txMode, double rtsSnr); |
939 |
/** |
|
|
940 |
* Send ACK after receiving DATA. |
| 941 |
* |
| 942 |
* \param source |
| 943 |
* \param duration |
| 944 |
* \param dataTxMode |
| 945 |
* \param dataSnr |
| 946 |
*/ |
| 947 |
void SendAckAfterData (Mac48Address source, Time duration, WifiMode dataTxMode, double dataSnr); |
| 948 |
/** |
| 949 |
* Send DATA after receiving CTS. |
| 950 |
* |
| 951 |
* \param source |
| 952 |
* \param duration |
| 953 |
* \param txMode |
| 954 |
*/ |
| 565 |
void SendDataAfterCts (Mac48Address source, Time duration, WifiMode txMode); |
955 |
void SendDataAfterCts (Mac48Address source, Time duration, WifiMode txMode); |
|
|
956 |
/** |
| 957 |
* Event handler that is usually scheduled to fired at the appropriate time |
| 958 |
* after completing transmissions. |
| 959 |
*/ |
| 566 |
void WaitSifsAfterEndTx (void); |
960 |
void WaitSifsAfterEndTx (void); |
|
|
961 |
/** |
| 962 |
* A transmission that does not require an ACK has completed. |
| 963 |
*/ |
| 567 |
void EndTxNoAck (void); |
964 |
void EndTxNoAck (void); |
| 568 |
|
965 |
|
|
|
966 |
/** |
| 967 |
* Send RTS to begin RTS-CTS-DATA-ACK transaction. |
| 968 |
*/ |
| 569 |
void SendRtsForPacket (void); |
969 |
void SendRtsForPacket (void); |
|
|
970 |
/** |
| 971 |
* Send DATA packet, which can be DATA-ACK or |
| 972 |
* RTS-CTS-DATA-ACK transaction. |
| 973 |
*/ |
| 570 |
void SendDataPacket (void); |
974 |
void SendDataPacket (void); |
|
|
975 |
/** |
| 976 |
* Start a DATA timer by scheduling appropriate |
| 977 |
* ACK timeout. |
| 978 |
* |
| 979 |
* \param dataTxVector |
| 980 |
*/ |
| 571 |
void StartDataTxTimers (WifiTxVector dataTxVector); |
981 |
void StartDataTxTimers (WifiTxVector dataTxVector); |
| 572 |
virtual void DoDispose (void); |
982 |
virtual void DoDispose (void); |
| 573 |
/** |
983 |
/** |
|
|
| 599 |
* circularly modulo 2^12. |
1009 |
* circularly modulo 2^12. |
| 600 |
*/ |
1010 |
*/ |
| 601 |
bool StoreMpduIfNeeded (Ptr<Packet> packet, WifiMacHeader hdr); |
1011 |
bool StoreMpduIfNeeded (Ptr<Packet> packet, WifiMacHeader hdr); |
| 602 |
/* |
1012 |
/** |
| 603 |
* Invoked after that a block ack request has been received. Looks for corresponding |
1013 |
* Invoked after that a block ack request has been received. Looks for corresponding |
| 604 |
* block ack agreement and creates block ack bitmap on a received packets basis. |
1014 |
* block ack agreement and creates block ack bitmap on a received packets basis. |
|
|
1015 |
* |
| 1016 |
* \param reqHdr |
| 1017 |
* \param originator |
| 1018 |
* \param duration |
| 1019 |
* \param blockAckReqTxMode |
| 605 |
*/ |
1020 |
*/ |
| 606 |
void SendBlockAckAfterBlockAckRequest (const CtrlBAckRequestHeader reqHdr, Mac48Address originator, |
1021 |
void SendBlockAckAfterBlockAckRequest (const CtrlBAckRequestHeader reqHdr, Mac48Address originator, |
| 607 |
Time duration, WifiMode blockAckReqTxMode); |
1022 |
Time duration, WifiMode blockAckReqTxMode); |
| 608 |
/* |
1023 |
/** |
| 609 |
* This method creates block ack frame with header equals to <i>blockAck</i> and start its transmission. |
1024 |
* This method creates block ack frame with header equals to <i>blockAck</i> and start its transmission. |
|
|
1025 |
* |
| 1026 |
* \param blockAck |
| 1027 |
* \param originator |
| 1028 |
* \param immediate |
| 1029 |
* \param duration |
| 1030 |
* \param blockAckReqTxMode |
| 610 |
*/ |
1031 |
*/ |
| 611 |
void SendBlockAckResponse (const CtrlBAckResponseHeader* blockAck, Mac48Address originator, bool immediate, |
1032 |
void SendBlockAckResponse (const CtrlBAckResponseHeader* blockAck, Mac48Address originator, bool immediate, |
| 612 |
Time duration, WifiMode blockAckReqTxMode); |
1033 |
Time duration, WifiMode blockAckReqTxMode); |
| 613 |
/* |
1034 |
/** |
| 614 |
* Every time that a block ack request or a packet with ack policy equals to <i>block ack</i> |
1035 |
* Every time that a block ack request or a packet with ack policy equals to <i>block ack</i> |
| 615 |
* are received, if a relative block ack agreement exists and the value of inactivity timeout |
1036 |
* are received, if a relative block ack agreement exists and the value of inactivity timeout |
| 616 |
* is not 0, the timer is reset. |
1037 |
* is not 0, the timer is reset. |
| 617 |
* see section 11.5.3 in IEEE802.11e for more details. |
1038 |
* see section 11.5.3 in IEEE802.11e for more details. |
|
|
1039 |
* |
| 1040 |
* \param agreement |
| 618 |
*/ |
1041 |
*/ |
| 619 |
void ResetBlockAckInactivityTimerIfNeeded (BlockAckAgreement &agreement); |
1042 |
void ResetBlockAckInactivityTimerIfNeeded (BlockAckAgreement &agreement); |
| 620 |
|
1043 |
|
|
|
1044 |
/** |
| 1045 |
* Set up WifiPhy listener for this MacLow. |
| 1046 |
* |
| 1047 |
* \param phy the WifiPhy this MacLow is connected to |
| 1048 |
*/ |
| 621 |
void SetupPhyMacLowListener (Ptr<WifiPhy> phy); |
1049 |
void SetupPhyMacLowListener (Ptr<WifiPhy> phy); |
| 622 |
|
1050 |
|
| 623 |
Ptr<WifiPhy> m_phy; |
1051 |
Ptr<WifiPhy> m_phy; |
| 624 |
Ptr<WifiRemoteStationManager> m_stationManager; |
1052 |
Ptr<WifiRemoteStationManager> m_stationManager; |
| 625 |
MacLowRxCallback m_rxCallback; |
1053 |
MacLowRxCallback m_rxCallback; |
|
|
1054 |
/** |
| 1055 |
* typedef for an iterator for a list of MacLowDcfListener. |
| 1056 |
*/ |
| 626 |
typedef std::vector<MacLowDcfListener *>::const_iterator DcfListenersCI; |
1057 |
typedef std::vector<MacLowDcfListener *>::const_iterator DcfListenersCI; |
|
|
1058 |
/** |
| 1059 |
* typedef for a list of MacLowDcfListener. |
| 1060 |
*/ |
| 627 |
typedef std::vector<MacLowDcfListener *> DcfListeners; |
1061 |
typedef std::vector<MacLowDcfListener *> DcfListeners; |
| 628 |
DcfListeners m_dcfListeners; |
1062 |
DcfListeners m_dcfListeners; |
| 629 |
|
1063 |
|