Left: | ||
Right: |
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) 2006, 2009 INRIA | 3 * Copyright (c) 2006, 2009 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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
102 m_beaconDca->SetAifsn(1); | 102 m_beaconDca->SetAifsn(1); |
103 m_beaconDca->SetMinCw(0); | 103 m_beaconDca->SetMinCw(0); |
104 m_beaconDca->SetMaxCw(0); | 104 m_beaconDca->SetMaxCw(0); |
105 m_beaconDca->SetLow (m_low); | 105 m_beaconDca->SetLow (m_low); |
106 m_beaconDca->SetManager (m_dcfManager); | 106 m_beaconDca->SetManager (m_dcfManager); |
107 | 107 |
108 SetQueue (AC_VO); | 108 SetQueue (AC_VO); |
109 SetQueue (AC_VI); | 109 SetQueue (AC_VI); |
110 SetQueue (AC_BE); | 110 SetQueue (AC_BE); |
111 SetQueue (AC_BK); | 111 SetQueue (AC_BK); |
112 | |
113 m_enableBeaconGeneration = false; | |
112 } | 114 } |
113 | 115 |
114 QapWifiMac::~QapWifiMac () | 116 QapWifiMac::~QapWifiMac () |
115 { | 117 { |
116 NS_LOG_FUNCTION (this); | 118 NS_LOG_FUNCTION (this); |
117 } | 119 } |
118 | 120 |
119 void | 121 void |
120 QapWifiMac::DoDispose () | 122 QapWifiMac::DoDispose () |
121 { | 123 { |
122 delete m_rxMiddle; | 124 delete m_rxMiddle; |
123 delete m_txMiddle; | 125 delete m_txMiddle; |
124 delete m_dcfManager; | 126 delete m_dcfManager; |
125 m_low->Dispose (); | 127 m_low->Dispose (); |
126 m_rxMiddle = 0; | 128 m_rxMiddle = 0; |
127 m_txMiddle = 0; | 129 m_txMiddle = 0; |
128 m_dcfManager = 0; | 130 m_dcfManager = 0; |
129 m_low = 0; | 131 m_low = 0; |
130 m_phy = 0; | 132 m_phy = 0; |
131 m_beaconDca = 0; | 133 m_beaconDca = 0; |
134 m_enableBeaconGeneration = false; | |
132 m_beaconEvent.Cancel (); | 135 m_beaconEvent.Cancel (); |
133 m_stationManager = 0; | 136 m_stationManager = 0; |
134 for (Queues::iterator i = m_queues.begin (); i != m_queues.end (); ++i) | 137 for (Queues::iterator i = m_queues.begin (); i != m_queues.end (); ++i) |
135 { | 138 { |
136 (*i).second = 0; | 139 (*i).second = 0; |
137 } | 140 } |
138 WifiMac::DoDispose (); | 141 WifiMac::DoDispose (); |
139 } | 142 } |
140 | 143 |
141 void | 144 void |
142 QapWifiMac::SetBeaconGeneration (bool enable) | 145 QapWifiMac::SetBeaconGeneration (bool enable) |
143 { | 146 { |
144 NS_LOG_FUNCTION (this << enable); | 147 NS_LOG_FUNCTION (this << enable); |
145 if (enable) | 148 if (!enable) |
149 { | |
150 m_beaconEvent.Cancel (); | |
151 } | |
152 else if (enable && !m_enableBeaconGeneration) | |
146 { | 153 { |
147 m_beaconEvent = Simulator::ScheduleNow (&QapWifiMac::SendOneBeacon, this); | 154 m_beaconEvent = Simulator::ScheduleNow (&QapWifiMac::SendOneBeacon, this); |
148 } | 155 } |
149 else | 156 m_enableBeaconGeneration = enable; |
150 { | |
151 m_beaconEvent.Cancel (); | |
152 } | |
153 } | 157 } |
154 | 158 |
155 bool | 159 bool |
156 QapWifiMac::GetBeaconGeneration (void) const | 160 QapWifiMac::GetBeaconGeneration (void) const |
157 { | 161 { |
158 return m_beaconEvent.IsRunning (); | 162 return m_enableBeaconGeneration; |
159 } | 163 } |
160 | 164 |
161 Time | 165 Time |
162 QapWifiMac::GetBeaconInterval (void) const | 166 QapWifiMac::GetBeaconInterval (void) const |
163 { | 167 { |
164 return m_beaconInterval; | 168 return m_beaconInterval; |
165 } | 169 } |
166 | 170 |
167 void· | 171 void· |
168 QapWifiMac::SetSlot (Time slotTime) | 172 QapWifiMac::SetSlot (Time slotTime) |
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
396 else | 400 else |
397 { | 401 { |
398 //packet is considerated belonging to BestEffort AC | 402 //packet is considerated belonging to BestEffort AC |
399 hdr.SetQosTid (0); | 403 hdr.SetQosTid (0); |
400 m_queues[AC_BE]->Queue (packet, hdr); | 404 m_queues[AC_BE]->Queue (packet, hdr); |
401 } | 405 } |
402 } | 406 } |
403 | 407 |
404 void | 408 void |
405 QapWifiMac::ForwardDown (Ptr<const Packet> packet, Mac48Address from, Mac48Addre ss to, | 409 QapWifiMac::ForwardDown (Ptr<const Packet> packet, Mac48Address from, Mac48Addre ss to, |
406 WifiMacHeader const *oldHdr) | 410 const WifiMacHeader *oldHdr) |
407 { | 411 { |
408 /* For now Qos AP sends only Qos frame. In the future it should be able to· | 412 /* For now Qos AP sends only Qos frame. In the future it should be able to· |
409 send frames also to Non-Qos Stas. | 413 send frames also to Non-Qos Stas. |
410 */ | 414 */ |
411 NS_LOG_FUNCTION (this << packet << from << to); | 415 NS_LOG_FUNCTION (this << packet << from << to); |
412 NS_ASSERT (oldHdr->IsQosData ()); | 416 NS_ASSERT (oldHdr->IsQosData ()); |
413 WifiMacHeader hdr; | 417 WifiMacHeader hdr; |
414 hdr.SetType (WIFI_MAC_QOSDATA); | 418 hdr.SetType (WIFI_MAC_QOSDATA); |
415 hdr.SetQosAckPolicy (WifiMacHeader::NORMAL_ACK); | 419 hdr.SetQosAckPolicy (WifiMacHeader::NORMAL_ACK); |
416 hdr.SetQosNoEosp (); | 420 hdr.SetQosNoEosp (); |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
539 beacon.SetSupportedRates (GetSupportedRates ()); | 543 beacon.SetSupportedRates (GetSupportedRates ()); |
540 beacon.SetBeaconIntervalUs (m_beaconInterval.GetMicroSeconds ()); | 544 beacon.SetBeaconIntervalUs (m_beaconInterval.GetMicroSeconds ()); |
541 ·· | 545 ·· |
542 packet->AddHeader (beacon); | 546 packet->AddHeader (beacon); |
543 | 547 |
544 m_beaconDca->Queue (packet, hdr); | 548 m_beaconDca->Queue (packet, hdr); |
545 m_beaconEvent = Simulator::Schedule (m_beaconInterval, &QapWifiMac::SendOneBea con, this);·· | 549 m_beaconEvent = Simulator::Schedule (m_beaconInterval, &QapWifiMac::SendOneBea con, this);·· |
546 } | 550 } |
547 | 551 |
548 void | 552 void |
549 QapWifiMac::TxOk (WifiMacHeader const &hdr) | 553 QapWifiMac::TxOk (const WifiMacHeader &hdr) |
550 { | 554 { |
551 NS_LOG_FUNCTION (this); | 555 NS_LOG_FUNCTION (this); |
552 WifiRemoteStation *station = m_stationManager->Lookup (hdr.GetAddr1 ()); | 556 WifiRemoteStation *station = m_stationManager->Lookup (hdr.GetAddr1 ()); |
553 if (hdr.IsAssocResp () &&· | 557 if (hdr.IsAssocResp () &&· |
554 station->IsWaitAssocTxOk ())· | 558 station->IsWaitAssocTxOk ())· |
555 { | 559 { |
556 NS_LOG_DEBUG ("associated with sta="<<hdr.GetAddr1 ()); | 560 NS_LOG_DEBUG ("associated with sta="<<hdr.GetAddr1 ()); |
557 station->RecordGotAssocTxOk (); | 561 station->RecordGotAssocTxOk (); |
558 } | 562 } |
559 } | 563 } |
560 | 564 |
561 void | 565 void |
562 QapWifiMac::TxFailed (WifiMacHeader const &hdr) | 566 QapWifiMac::TxFailed (const WifiMacHeader &hdr) |
563 { | 567 { |
564 NS_LOG_FUNCTION (this); | 568 NS_LOG_FUNCTION (this); |
565 WifiRemoteStation *station = m_stationManager->Lookup (hdr.GetAddr1 ()); | 569 WifiRemoteStation *station = m_stationManager->Lookup (hdr.GetAddr1 ()); |
566 if (hdr.IsAssocResp () &&· | 570 if (hdr.IsAssocResp () &&· |
567 station->IsWaitAssocTxOk ())· | 571 station->IsWaitAssocTxOk ())· |
568 { | 572 { |
569 NS_LOG_DEBUG ("assoc failed with sta="<<hdr.GetAddr1 ()); | 573 NS_LOG_DEBUG ("assoc failed with sta="<<hdr.GetAddr1 ()); |
570 station->RecordGotAssocTxFailed (); | 574 station->RecordGotAssocTxFailed (); |
571 } | 575 } |
572 } | 576 } |
573 | 577 |
574 void | 578 void |
575 QapWifiMac::Receive (Ptr<Packet> packet, WifiMacHeader const *hdr) | 579 QapWifiMac::Receive (Ptr<Packet> packet, const WifiMacHeader *hdr) |
576 { | 580 { |
577 NS_LOG_FUNCTION (this << packet << hdr); | 581 NS_LOG_FUNCTION (this << packet << hdr); |
578 | 582 |
579 Mac48Address from = hdr->GetAddr2 (); | 583 Mac48Address from = hdr->GetAddr2 (); |
580 WifiRemoteStation *fromStation = m_stationManager->Lookup (from); | 584 WifiRemoteStation *fromStation = m_stationManager->Lookup (from); |
581 ·· | 585 ·· |
582 if (hdr->IsData ()) | 586 if (hdr->IsData ()) |
583 { | 587 { |
584 Mac48Address bssid = hdr->GetAddr1 (); | 588 Mac48Address bssid = hdr->GetAddr1 (); |
585 if (!hdr->IsFromDs () &&· | 589 if (!hdr->IsFromDs () &&· |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
689 else if (hdr->IsDisassociation ())· | 693 else if (hdr->IsDisassociation ())· |
690 { | 694 { |
691 fromStation->RecordDisassociated (); | 695 fromStation->RecordDisassociated (); |
692 }· | 696 }· |
693 else if (hdr->IsReassocReq ())· | 697 else if (hdr->IsReassocReq ())· |
694 { | 698 { |
695 /* we don't support reassoc frames for now */ | 699 /* we don't support reassoc frames for now */ |
696 } | 700 } |
697 else if (hdr->IsAction ()) | 701 else if (hdr->IsAction ()) |
698 { | 702 { |
699 MgtActionFrameHeader actHdr; | 703 WifiActionHeader actionHdr; |
700 packet->PeekHeader (actHdr); | 704 packet->RemoveHeader (actionHdr); |
701 if (actHdr.IsAddBaRequest ()) | 705 if (actionHdr.GetCategory () == WifiActionHeader::BLOCK_ACK && |
706 actionHdr.GetAction().blockAck == WifiActionHeader::BLOCK_ACK_ ADDBA_REQUEST) | |
702 { | 707 { |
703 MgtAddBaRequestHeader reqHdr; | 708 MgtAddBaRequestHeader reqHdr; |
704 packet->RemoveHeader (reqHdr); | 709 packet->RemoveHeader (reqHdr); |
705 SendAddBaResponse (&reqHdr, hdr->GetAddr2 ()); | 710 SendAddBaResponse (&reqHdr, hdr->GetAddr2 ()); |
706 } | 711 } |
707 else if (actHdr.IsAddBaResponse ()) | 712 else if (actionHdr.GetCategory () == WifiActionHeader::BLOCK_ACK & & |
713 actionHdr.GetAction().blockAck == WifiActionHeader::BLOCK _ACK_ADDBA_RESPONSE) | |
708 { | 714 { |
709 MgtAddBaResponseHeader respHdr; | 715 MgtAddBaResponseHeader respHdr; |
710 packet->RemoveHeader (respHdr); | 716 packet->RemoveHeader (respHdr); |
711 m_queues[QosUtilsMapTidToAc (respHdr.GetTid ())]->GotAddBaResp onse (&respHdr, hdr->GetAddr2 ()); | 717 m_queues[QosUtilsMapTidToAc (respHdr.GetTid ())]->GotAddBaResp onse (&respHdr, hdr->GetAddr2 ()); |
712 } | 718 } |
713 else if (actHdr.IsDelBa ()) | 719 else if (actionHdr.GetCategory () == WifiActionHeader::BLOCK_ACK & & |
720 actionHdr.GetAction().blockAck == WifiActionHeader::BLOCK _ACK_DELBA) | |
714 { | 721 { |
715 MgtDelBaHeader delBaHdr; | 722 MgtDelBaHeader delBaHdr; |
716 packet->RemoveHeader (delBaHdr); | 723 packet->RemoveHeader (delBaHdr); |
717 if (delBaHdr.IsByOriginator ()) | 724 if (delBaHdr.IsByOriginator ()) |
718 { | 725 { |
719 /* Delba frame was sent by originator, this means that an ingoing established | 726 /* Delba frame was sent by originator, this means that an ingoing established |
720 agreement exists in MacLow */ | 727 agreement exists in MacLow */ |
721 m_low->DestroyBlockAckAgreement (hdr->GetAddr2 (), delBaHd r.GetTid ()); | 728 m_low->DestroyBlockAckAgreement (hdr->GetAddr2 (), delBaHd r.GetTid ()); |
722 } | 729 } |
723 else | 730 else |
(...skipping 13 matching lines...) Expand all Loading... | |
737 else· | 744 else· |
738 { | 745 { |
739 /* unknown mgt frame | 746 /* unknown mgt frame |
740 */ | 747 */ |
741 } | 748 } |
742 } | 749 } |
743 } | 750 } |
744 } | 751 } |
745 | 752 |
746 void | 753 void |
747 QapWifiMac::DeaggregateAmsduAndForward (Ptr<Packet> aggregatedPacket, WifiMacHea der const *hdr) | 754 QapWifiMac::DeaggregateAmsduAndForward (Ptr<Packet> aggregatedPacket, const Wifi MacHeader *hdr) |
748 { | 755 { |
749 DeaggregatedMsdus packets = MsduAggregator::Deaggregate (aggregatedPacket); | 756 DeaggregatedMsdus packets = MsduAggregator::Deaggregate (aggregatedPacket); |
750 for (DeaggregatedMsdusCI i = packets.begin (); i != packets.end (); ++i) | 757 for (DeaggregatedMsdusCI i = packets.begin (); i != packets.end (); ++i) |
751 { | 758 { |
752 if ((*i).second.GetDestinationAddr () == GetAddress ()) | 759 if ((*i).second.GetDestinationAddr () == GetAddress ()) |
753 { | 760 { |
754 ForwardUp ((*i).first, (*i).second.GetSourceAddr (), | 761 ForwardUp ((*i).first, (*i).second.GetSourceAddr (), |
755 (*i).second.GetDestinationAddr ()); | 762 (*i).second.GetDestinationAddr ()); |
756 } | 763 } |
757 else | 764 else |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
791 void | 798 void |
792 QapWifiMac::SetQueue (enum AccessClass ac) | 799 QapWifiMac::SetQueue (enum AccessClass ac) |
793 { | 800 { |
794 Ptr<EdcaTxopN> edca = CreateObject<EdcaTxopN> (); | 801 Ptr<EdcaTxopN> edca = CreateObject<EdcaTxopN> (); |
795 edca->SetLow (m_low); | 802 edca->SetLow (m_low); |
796 edca->SetManager (m_dcfManager); | 803 edca->SetManager (m_dcfManager); |
797 edca->SetTypeOfStation (AP); | 804 edca->SetTypeOfStation (AP); |
798 edca->SetTxMiddle (m_txMiddle); | 805 edca->SetTxMiddle (m_txMiddle); |
799 edca->SetTxOkCallback (MakeCallback (&QapWifiMac::TxOk, this)); | 806 edca->SetTxOkCallback (MakeCallback (&QapWifiMac::TxOk, this)); |
800 edca->SetTxFailedCallback (MakeCallback (&QapWifiMac::TxFailed, this)); | 807 edca->SetTxFailedCallback (MakeCallback (&QapWifiMac::TxFailed, this)); |
808 edca->SetAccessClass (ac); | |
801 edca->CompleteConfig (); | 809 edca->CompleteConfig (); |
802 m_low->SetQueueForAc (ac, edca); | |
803 m_queues.insert (std::make_pair(ac, edca)); | 810 m_queues.insert (std::make_pair(ac, edca)); |
804 } | 811 } |
805 | 812 |
806 void· | 813 void· |
807 QapWifiMac::FinishConfigureStandard (enum WifiPhyStandard standard) | 814 QapWifiMac::FinishConfigureStandard (enum WifiPhyStandard standard) |
808 { | 815 { |
809 switch (standard) | 816 switch (standard) |
810 { | 817 { |
818 case WIFI_PHY_STANDARD_80211p_CCH: | |
819 ConfigureCCHDcf (m_queues[AC_BK], 15, 511, AC_BK); | |
820 ConfigureCCHDcf (m_queues[AC_BE], 15, 511, AC_BE); | |
821 ConfigureCCHDcf (m_queues[AC_VI], 15, 511, AC_VI); | |
822 ConfigureCCHDcf (m_queues[AC_VO], 15, 511, AC_VO); | |
823 break; | |
824 case WIFI_PHY_STANDARD_80211p_SCH: | |
825 ConfigureDcf (m_queues[AC_BK], 15, 511, AC_BK); | |
826 ConfigureDcf (m_queues[AC_BE], 15, 511, AC_BE); | |
827 ConfigureDcf (m_queues[AC_VI], 15, 511, AC_VI); | |
828 ConfigureDcf (m_queues[AC_VO], 15, 511, AC_VO); | |
829 break; | |
811 case WIFI_PHY_STANDARD_holland: | 830 case WIFI_PHY_STANDARD_holland: |
812 // fall through | 831 // fall through |
813 case WIFI_PHY_STANDARD_80211a: | 832 case WIFI_PHY_STANDARD_80211a: |
814 // fall through | 833 // fall through |
815 case WIFI_PHY_STANDARD_80211_10Mhz: | 834 case WIFI_PHY_STANDARD_80211_10Mhz: |
816 // fall through | 835 // fall through |
817 case WIFI_PHY_STANDARD_80211_5Mhz: | 836 case WIFI_PHY_STANDARD_80211_5Mhz: |
818 ConfigureDcf (m_queues[AC_BK], 15, 1023, AC_BK); | 837 ConfigureDcf (m_queues[AC_BK], 15, 1023, AC_BK); |
819 ConfigureDcf (m_queues[AC_BE], 15, 1023, AC_BE); | 838 ConfigureDcf (m_queues[AC_BE], 15, 1023, AC_BE); |
820 ConfigureDcf (m_queues[AC_VI], 15, 1023, AC_VI); | 839 ConfigureDcf (m_queues[AC_VI], 15, 1023, AC_VI); |
821 ConfigureDcf (m_queues[AC_VO], 15, 1023, AC_VO); | 840 ConfigureDcf (m_queues[AC_VO], 15, 1023, AC_VO); |
822 break; | 841 break; |
823 case WIFI_PHY_STANDARD_80211b: | 842 case WIFI_PHY_STANDARD_80211b: |
824 ConfigureDcf (m_queues[AC_BK], 31, 1023, AC_BK); | 843 ConfigureDcf (m_queues[AC_BK], 31, 1023, AC_BK); |
825 ConfigureDcf (m_queues[AC_BE], 31, 1023, AC_BE); | 844 ConfigureDcf (m_queues[AC_BE], 31, 1023, AC_BE); |
826 ConfigureDcf (m_queues[AC_VI], 31, 1023, AC_VI); | 845 ConfigureDcf (m_queues[AC_VI], 31, 1023, AC_VI); |
827 ConfigureDcf (m_queues[AC_VO], 31, 1023, AC_VO); | 846 ConfigureDcf (m_queues[AC_VO], 31, 1023, AC_VO); |
828 break; | 847 break; |
829 default: | 848 default: |
830 NS_ASSERT (false); | 849 NS_ASSERT (false); |
831 break; | 850 break; |
832 } | 851 } |
833 } | 852 } |
834 | 853 |
835 void | 854 void |
855 QapWifiMac::DoStart (void) | |
856 { | |
857 m_beaconEvent.Cancel (); | |
858 if (m_enableBeaconGeneration) | |
859 { | |
860 m_beaconEvent = Simulator::ScheduleNow (&QapWifiMac::SendOneBeacon, this); | |
861 } | |
862 WifiMac::DoStart (); | |
863 } | |
864 | |
865 void | |
836 QapWifiMac::SendAddBaResponse (const MgtAddBaRequestHeader *reqHdr, Mac48Address originator) | 866 QapWifiMac::SendAddBaResponse (const MgtAddBaRequestHeader *reqHdr, Mac48Address originator) |
837 { | 867 { |
838 NS_LOG_FUNCTION (this); | 868 NS_LOG_FUNCTION (this); |
839 WifiMacHeader hdr; | 869 WifiMacHeader hdr; |
840 hdr.SetAction (); | 870 hdr.SetAction (); |
841 hdr.SetAddr1 (originator); | 871 hdr.SetAddr1 (originator); |
842 hdr.SetAddr2 (m_low->GetAddress ()); | 872 hdr.SetAddr2 (m_low->GetAddress ()); |
843 hdr.SetAddr3 (GetBssid ()); | 873 hdr.SetAddr3 (m_low->GetAddress ()); |
844 hdr.SetDsNotFrom (); | 874 hdr.SetDsNotFrom (); |
845 hdr.SetDsNotTo (); | 875 hdr.SetDsNotTo (); |
846 | 876 |
847 MgtAddBaResponseHeader respHdr; | 877 MgtAddBaResponseHeader respHdr; |
848 StatusCode code; | 878 StatusCode code; |
849 code.SetSuccess (); | 879 code.SetSuccess (); |
850 respHdr.SetStatusCode (code); | 880 respHdr.SetStatusCode (code); |
851 //Here a control about queues type? | 881 //Here a control about queues type? |
852 respHdr.SetAmsduSupport (reqHdr->IsAmsduSupported ()); | 882 respHdr.SetAmsduSupport (reqHdr->IsAmsduSupported ()); |
853 ·· | 883 ·· |
854 if (reqHdr->IsImmediateBlockAck ()) | 884 if (reqHdr->IsImmediateBlockAck ()) |
855 { | 885 { |
856 respHdr.SetImmediateBlockAck (); | 886 respHdr.SetImmediateBlockAck (); |
857 } | 887 } |
858 else | 888 else |
859 { | 889 { |
860 respHdr.SetDelayedBlockAck (); | 890 respHdr.SetDelayedBlockAck (); |
861 } | 891 } |
862 respHdr.SetTid (reqHdr->GetTid ()); | 892 respHdr.SetTid (reqHdr->GetTid ()); |
863 /* For now there's not no control about limit of reception. | 893 /* For now there's not no control about limit of reception. |
864 We assume that receiver has no limit on reception. | 894 We assume that receiver has no limit on reception. |
865 However we assume that a receiver sets a bufferSize in order to satisfy | 895 However we assume that a receiver sets a bufferSize in order to satisfy |
866 next equation: | 896 next equation: |
Tom Henderson
2010/01/30 23:21:14
minor nit; multi-line comment misses the "*" chara
| |
867 (bufferSize + 1) % 16 = 0 | 897 (bufferSize + 1) % 16 = 0 |
868 So if a recipient is able to buffer a packet, it should be also able to buf fer | 898 So if a recipient is able to buffer a packet, it should be also able to buf fer |
869 all possible packet's fragments. | 899 all possible packet's fragments. |
870 See section 7.3.1.14 in IEEE802.11e for more details. */ | 900 See section 7.3.1.14 in IEEE802.11e for more details. */ |
871 respHdr.SetBufferSize (1023); | 901 respHdr.SetBufferSize (1023); |
872 respHdr.SetTimeout (reqHdr->GetTimeout ()); | 902 respHdr.SetTimeout (reqHdr->GetTimeout ()); |
873 | 903 |
904 WifiActionHeader actionHdr; | |
905 WifiActionHeader::ActionValue action; | |
906 action.blockAck = WifiActionHeader::BLOCK_ACK_ADDBA_RESPONSE; | |
907 actionHdr.SetAction (WifiActionHeader::BLOCK_ACK, action); | |
908 | |
874 Ptr<Packet> packet = Create<Packet> (); | 909 Ptr<Packet> packet = Create<Packet> (); |
875 packet->AddHeader (respHdr); | 910 packet->AddHeader (respHdr); |
911 packet->AddHeader (actionHdr); | |
876 ·· | 912 ·· |
877 /* ns3::MacLow have to buffer all correctly received packet for this block ack session */ | 913 /* ns3::MacLow have to buffer all correctly received packet for this block ack session */ |
878 m_low->CreateBlockAckAgreement (&respHdr, originator, reqHdr->GetStartingSeque nce ()); | 914 m_low->CreateBlockAckAgreement (&respHdr, originator, reqHdr->GetStartingSeque nce ()); |
879 | 915 |
880 //Better a management queue?· | 916 //Better a management queue?· |
Tom Henderson
2010/01/30 23:21:14
minor nit: mixed C and C++ commenting styles with
| |
881 m_queues[QosUtilsMapTidToAc (reqHdr->GetTid ())]->PushFront (packet, hdr); | 917 m_queues[QosUtilsMapTidToAc (reqHdr->GetTid ())]->PushFront (packet, hdr); |
882 } | 918 } |
883 | 919 |
884 } //namespace ns3 | 920 } //namespace ns3 |
LEFT | RIGHT |