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

(-)a/src/devices/wifi/dca-txop.cc (-2 / +2 lines)
 Lines 279-292    Link Here 
279
DcaTxop::NeedRtsRetransmission (void)
279
DcaTxop::NeedRtsRetransmission (void)
280
{
280
{
281
  WifiRemoteStation *station = GetStation (m_currentHdr.GetAddr1 ());
281
  WifiRemoteStation *station = GetStation (m_currentHdr.GetAddr1 ());
282
  return station->NeedRtsRetransmission (m_currentPacket);
282
  return station->NeedRtsRetransmission (&m_currentHdr);
283
}
283
}
284
284
285
bool
285
bool
286
DcaTxop::NeedDataRetransmission (void)
286
DcaTxop::NeedDataRetransmission (void)
287
{
287
{
288
  WifiRemoteStation *station = GetStation (m_currentHdr.GetAddr1 ());
288
  WifiRemoteStation *station = GetStation (m_currentHdr.GetAddr1 ());
289
  return station->NeedDataRetransmission (m_currentPacket);
289
  return station->NeedDataRetransmission (&m_currentHdr);
290
}
290
}
291
bool
291
bool
292
DcaTxop::NeedFragmentation (void)
292
DcaTxop::NeedFragmentation (void)
(-)a/src/devices/wifi/edca-txop-n.cc (-4 / +20 lines)
 Lines 413-419    Link Here 
413
    {
413
    {
414
      MY_DEBUG ("Cts Fail");
414
      MY_DEBUG ("Cts Fail");
415
      WifiRemoteStation *station = GetStation (m_currentHdr.GetAddr1 ());
415
      WifiRemoteStation *station = GetStation (m_currentHdr.GetAddr1 ());
416
      station->ReportFinalRtsFailed ();
416
      if (m_currentHdr.IsQosData ())
417
        {
418
          uint8_t tid = m_currentHdr.GetQosTid ();
419
          station->ReportFinalRtsFailed (QosUtilsMapTidToAc (tid));
420
        }
421
      else
422
        {
423
          station->ReportFinalRtsFailed ();
424
        }
417
      if (!m_txFailedCallback.IsNull ()) 
425
      if (!m_txFailedCallback.IsNull ()) 
418
        {
426
        {
419
          m_txFailedCallback (m_currentHdr);
427
          m_txFailedCallback (m_currentHdr);
 Lines 483-489    Link Here 
483
    {
491
    {
484
      MY_DEBUG ("Ack Fail");
492
      MY_DEBUG ("Ack Fail");
485
      WifiRemoteStation *station = GetStation (m_currentHdr.GetAddr1 ());
493
      WifiRemoteStation *station = GetStation (m_currentHdr.GetAddr1 ());
486
      station->ReportFinalDataFailed ();
494
      if (m_currentHdr.IsQosData ())
495
       {
496
         uint8_t tid = m_currentHdr.GetQosTid ();
497
         station->ReportFinalDataFailed (QosUtilsMapTidToAc (tid));
498
       }
499
      else
500
       {
501
         station->ReportFinalDataFailed ();
502
       }
487
      if (!m_txFailedCallback.IsNull ()) 
503
      if (!m_txFailedCallback.IsNull ()) 
488
        {
504
        {
489
          m_txFailedCallback (m_currentHdr);
505
          m_txFailedCallback (m_currentHdr);
 Lines 543-556    Link Here 
543
EdcaTxopN::NeedRtsRetransmission (void)
559
EdcaTxopN::NeedRtsRetransmission (void)
544
{
560
{
545
  WifiRemoteStation *station = GetStation (m_currentHdr.GetAddr1 ());
561
  WifiRemoteStation *station = GetStation (m_currentHdr.GetAddr1 ());
546
  return station->NeedRtsRetransmission (m_currentPacket);
562
  return station->NeedRtsRetransmission (&m_currentHdr);
547
}
563
}
548
564
549
bool
565
bool
550
EdcaTxopN::NeedDataRetransmission (void)
566
EdcaTxopN::NeedDataRetransmission (void)
551
{
567
{
552
  WifiRemoteStation *station = GetStation (m_currentHdr.GetAddr1 ());
568
  WifiRemoteStation *station = GetStation (m_currentHdr.GetAddr1 ());
553
  return station->NeedDataRetransmission (m_currentPacket);
569
  return station->NeedDataRetransmission (&m_currentHdr);
554
}
570
}
555
571
556
void
572
void
(-)a/src/devices/wifi/mac-low.cc (-7 / +54 lines)
 Lines 591-598    Link Here 
591
      packet->RemovePacketTag (tag);
591
      packet->RemovePacketTag (tag);
592
      WifiRemoteStation *station = GetStation (m_currentHdr.GetAddr1 ());
592
      WifiRemoteStation *station = GetStation (m_currentHdr.GetAddr1 ());
593
      station->ReportRxOk (rxSnr, txMode);
593
      station->ReportRxOk (rxSnr, txMode);
594
      station->ReportRtsOk (rxSnr, txMode, tag.Get ());
594
      if (m_currentHdr.IsQosData ())
595
      
595
        {
596
          uint8_t tid = m_currentHdr.GetQosTid ();
597
          station->ReportRtsOk (rxSnr, txMode, tag.Get (), QosUtilsMapTidToAc (tid));
598
        }
599
      else
600
        {
601
          station->ReportRtsOk (rxSnr, txMode, tag.Get ());
602
        }
596
      m_ctsTimeoutEvent.Cancel ();
603
      m_ctsTimeoutEvent.Cancel ();
597
      NotifyCtsTimeoutResetNow ();
604
      NotifyCtsTimeoutResetNow ();
598
      m_listener->GotCts (rxSnr, txMode);
605
      m_listener->GotCts (rxSnr, txMode);
 Lines 615-621    Link Here 
615
      packet->RemovePacketTag (tag);
622
      packet->RemovePacketTag (tag);
616
      WifiRemoteStation *station = GetStation (m_currentHdr.GetAddr1 ());
623
      WifiRemoteStation *station = GetStation (m_currentHdr.GetAddr1 ());
617
      station->ReportRxOk (rxSnr, txMode);
624
      station->ReportRxOk (rxSnr, txMode);
618
      station->ReportDataOk (rxSnr, txMode, tag.Get ());
625
      if (m_currentHdr.IsQosData ())
626
        {
627
          uint8_t tid = m_currentHdr.GetQosTid ();
628
          station->ReportDataOk (rxSnr, txMode, tag.Get (), QosUtilsMapTidToAc (tid));
629
        }
630
      else
631
        {
632
          station->ReportDataOk (rxSnr, txMode, tag.Get ());
633
        }
619
      bool gotAck = false;
634
      bool gotAck = false;
620
      if (m_txParams.MustWaitNormalAck () &&
635
      if (m_txParams.MustWaitNormalAck () &&
621
          m_normalAckTimeoutEvent.IsRunning ()) 
636
          m_normalAckTimeoutEvent.IsRunning ()) 
 Lines 930-936    Link Here 
930
  // we should restart a new cts timeout now until the expected
945
  // we should restart a new cts timeout now until the expected
931
  // end of rx if there was a rx start before now.
946
  // end of rx if there was a rx start before now.
932
  WifiRemoteStation *station = GetStation (m_currentHdr.GetAddr1 ());
947
  WifiRemoteStation *station = GetStation (m_currentHdr.GetAddr1 ());
933
  station->ReportRtsFailed ();
948
  if (m_currentHdr.IsQosData ())
949
    {
950
      uint8_t tid = m_currentHdr.GetQosTid ();
951
      station->ReportRtsFailed (QosUtilsMapTidToAc (tid));
952
    }
953
  else
954
    {
955
      station->ReportRtsFailed ();
956
    }
934
  m_currentPacket = 0;
957
  m_currentPacket = 0;
935
  MacLowTransmissionListener *listener = m_listener;
958
  MacLowTransmissionListener *listener = m_listener;
936
  m_listener = 0;
959
  m_listener = 0;
 Lines 945-951    Link Here 
945
  // we should restart a new ack timeout now until the expected
968
  // we should restart a new ack timeout now until the expected
946
  // end of rx if there was a rx start before now.
969
  // end of rx if there was a rx start before now.
947
  WifiRemoteStation *station = GetStation (m_currentHdr.GetAddr1 ());
970
  WifiRemoteStation *station = GetStation (m_currentHdr.GetAddr1 ());
948
  station->ReportDataFailed ();
971
  if (m_currentHdr.IsQosData ())
972
    {
973
      uint8_t tid = m_currentHdr.GetQosTid ();
974
      station->ReportDataFailed (QosUtilsMapTidToAc (tid));
975
    }
976
  else
977
    {
978
      station->ReportDataFailed ();
979
    }
949
  MacLowTransmissionListener *listener = m_listener;
980
  MacLowTransmissionListener *listener = m_listener;
950
  m_listener = 0;
981
  m_listener = 0;
951
  listener->MissedAck ();
982
  listener->MissedAck ();
 Lines 955-961    Link Here 
955
{
986
{
956
  NS_LOG_FUNCTION (this);
987
  NS_LOG_FUNCTION (this);
957
  WifiRemoteStation *station = GetStation (m_currentHdr.GetAddr1 ());
988
  WifiRemoteStation *station = GetStation (m_currentHdr.GetAddr1 ());
958
  station->ReportDataFailed ();
989
  if (m_currentHdr.IsQosData ())
990
    {
991
      uint8_t tid = m_currentHdr.GetQosTid ();
992
      station->ReportDataFailed (QosUtilsMapTidToAc (tid));
993
    }
994
  else
995
    {
996
      station->ReportDataFailed ();
997
    }
959
  MacLowTransmissionListener *listener = m_listener;
998
  MacLowTransmissionListener *listener = m_listener;
960
  m_listener = 0;
999
  m_listener = 0;
961
  if (m_phy->IsStateIdle ()) 
1000
  if (m_phy->IsStateIdle ()) 
 Lines 973-979    Link Here 
973
{
1012
{
974
  NS_LOG_FUNCTION (this);
1013
  NS_LOG_FUNCTION (this);
975
  WifiRemoteStation *station = GetStation (m_currentHdr.GetAddr1 ());
1014
  WifiRemoteStation *station = GetStation (m_currentHdr.GetAddr1 ());
976
  station->ReportDataFailed ();
1015
  if (m_currentHdr.IsQosData ())
1016
    {
1017
      uint8_t tid = m_currentHdr.GetQosTid ();
1018
      station->ReportDataFailed (QosUtilsMapTidToAc (tid));
1019
    }
1020
  else
1021
    {
1022
      station->ReportDataFailed ();
1023
    }
977
  MacLowTransmissionListener *listener = m_listener;
1024
  MacLowTransmissionListener *listener = m_listener;
978
  m_listener = 0;
1025
  m_listener = 0;
979
  if (m_phy->IsStateIdle ()) 
1026
  if (m_phy->IsStateIdle ()) 
(-)a/src/devices/wifi/wifi-remote-station-manager.cc (-20 / +151 lines)
 Lines 462-471    Link Here 
462
{
462
{
463
  static TypeId tid = TypeId ("ns3::WifiRemoteStation")
463
  static TypeId tid = TypeId ("ns3::WifiRemoteStation")
464
    .SetParent<Object> ()
464
    .SetParent<Object> ()
465
    .AddTraceSource ("Ssrc", "The value of the ssrc counter: indicates the number of retransmissions of RTS.",
465
    .AddTraceSource ("Ssrc", "The value of the ssrc counter: indicates the number of retransmissions of RTS for non-QoS packets.",
466
                     MakeTraceSourceAccessor (&WifiRemoteStation::m_ssrc))
466
                     MakeTraceSourceAccessor (&WifiRemoteStation::m_ssrc))
467
    .AddTraceSource ("Slrc", "The value of the slrc counter: indicates the number of retransmissions of DATA.",
467
    .AddTraceSource ("Slrc", "The value of the slrc counter: indicates the number of retransmissions of DATA for non-QoS packets.",
468
                     MakeTraceSourceAccessor (&WifiRemoteStation::m_slrc))
468
                     MakeTraceSourceAccessor (&WifiRemoteStation::m_slrc))
469
    .AddTraceSource ("voSsrc", "The value of the ssrc counter for AC_VO access class: indicates the number of retransmissions of RTS for\
470
                     packets belonging to voice access class.",
471
                     MakeTraceSourceAccessor (&WifiRemoteStation::m_voSsrc))
472
    .AddTraceSource ("voSlrc", "The value of the slrc counter AC_VO access class: indicates the number of retransmissions of DATA packets\
473
                     belonging to voice access class.",
474
                     MakeTraceSourceAccessor (&WifiRemoteStation::m_voSlrc))
475
    .AddTraceSource ("viSsrc", "The value of the ssrc counter for AC_VI access class: indicates the number of retransmissions of RTS for\
476
                     packets belonging to voice access class.",
477
                     MakeTraceSourceAccessor (&WifiRemoteStation::m_viSsrc))
478
    .AddTraceSource ("viSlrc", "The value of the slrc counter AC_VI access class: indicates the number of retransmissions of DATA packets\
479
                     belonging to voice access class.",
480
                     MakeTraceSourceAccessor (&WifiRemoteStation::m_viSlrc))
481
    .AddTraceSource ("beSsrc", "The value of the ssrc counter for AC_BE access class: indicates the number of retransmissions of RTS for\
482
                     packets belonging to voice access class.",
483
                     MakeTraceSourceAccessor (&WifiRemoteStation::m_beSsrc))
484
    .AddTraceSource ("beSlrc", "The value of the slrc counter AC_BE access class: indicates the number of retransmissions of DATA packets\
485
                     belonging to voice access class.",
486
                     MakeTraceSourceAccessor (&WifiRemoteStation::m_beSlrc))
487
    .AddTraceSource ("bkSsrc", "The value of the ssrc counter for AC_BK access class: indicates the number of retransmissions of RTS for\
488
                     packets belonging to voice access class.",
489
                     MakeTraceSourceAccessor (&WifiRemoteStation::m_bkSsrc))
490
    .AddTraceSource ("bkSlrc", "The value of the slrc counter AC_BK access class: indicates the number of retransmissions of DATA packets\
491
                     belonging to voice access class.",
492
                     MakeTraceSourceAccessor (&WifiRemoteStation::m_bkSlrc))
469
    ;
493
    ;
470
  return tid;
494
  return tid;
471
}
495
}
 Lines 474-482    Link Here 
474
  : m_state (BRAND_NEW),
498
  : m_state (BRAND_NEW),
475
    m_ssrc (0),
499
    m_ssrc (0),
476
    m_slrc (0),
500
    m_slrc (0),
501
    m_voSsrc (0),
502
    m_voSlrc (0),
503
    m_viSsrc (0),
504
    m_viSlrc (0),
505
    m_beSsrc (0),
506
    m_beSlrc (0),
507
    m_bkSsrc (0),
508
    m_bkSlrc (0),
477
    m_avgSlrcCoefficient(0.9),
509
    m_avgSlrcCoefficient(0.9),
478
    m_avgSlrc (0)
510
    m_avgSlrc (0)
479
{}
511
{
512
  m_qosSsrc.insert (std::make_pair (AC_VO, &m_voSsrc));
513
  m_qosSsrc.insert (std::make_pair (AC_VI, &m_viSsrc));
514
  m_qosSsrc.insert (std::make_pair (AC_BE, &m_beSsrc));
515
  m_qosSsrc.insert (std::make_pair (AC_BK, &m_bkSsrc));
516
517
  m_qosSlrc.insert (std::make_pair (AC_VO, &m_voSlrc));
518
  m_qosSlrc.insert (std::make_pair (AC_VI, &m_viSlrc));
519
  m_qosSlrc.insert (std::make_pair (AC_BE, &m_beSlrc));
520
  m_qosSlrc.insert (std::make_pair (AC_BK, &m_bkSlrc));
521
}
480
WifiRemoteStation::~WifiRemoteStation ()
522
WifiRemoteStation::~WifiRemoteStation ()
481
{}
523
{}
482
524
 Lines 675-689    Link Here 
675
    }
717
    }
676
}
718
}
677
bool
719
bool
678
WifiRemoteStation::NeedRtsRetransmission (Ptr<const Packet> packet)
720
WifiRemoteStation::NeedRtsRetransmission (const WifiMacHeader *hdr)
679
{
721
{
680
  return (m_ssrc < GetManager ()->GetMaxSsrc ());
722
  if (hdr->IsQosData ())
723
    {
724
      AccessClass ac = QosUtilsMapTidToAc (hdr->GetQosTid ());
725
      return ((*m_qosSsrc.find (ac)->second) < GetManager ()->GetMaxSsrc ());
726
    }
727
  else
728
   {
729
      return (m_ssrc < GetManager ()->GetMaxSsrc ());
730
   }
681
}
731
}
682
732
683
bool
733
bool
684
WifiRemoteStation::NeedDataRetransmission (Ptr<const Packet> packet)
734
WifiRemoteStation::NeedDataRetransmission (const WifiMacHeader *hdr)
685
{
735
{
686
  return (m_slrc < GetManager ()->GetMaxSlrc ());
736
  if (hdr->IsQosData ())
737
    {
738
      AccessClass ac = QosUtilsMapTidToAc (hdr->GetQosTid ());
739
      return ((*m_qosSlrc.find (ac)->second) < GetManager ()->GetMaxSlrc ());
740
    }
741
  else
742
    {
743
      return (m_slrc < GetManager ()->GetMaxSlrc ());
744
    }
687
}
745
}
688
746
689
bool
747
bool
 Lines 745-799    Link Here 
745
}
803
}
746
804
747
void 
805
void 
748
WifiRemoteStation::ReportRtsFailed (void)
806
WifiRemoteStation::ReportRtsFailed (enum AccessClass ac)
749
{
807
{
750
  m_ssrc++;
808
  if (ac == AC_UNDEF)
809
    {
810
      NS_LOG_INFO ("Access class not supported");
811
      NS_ASSERT (false);
812
    }
813
  else if (ac == AC_BE_NQOS)
814
    {
815
      m_ssrc++;
816
    }
817
  else
818
    {
819
      (*m_qosSsrc.find (ac)->second)++;
820
    }
751
  GetManager ()->NotifyTxRtsFailed (m_address);
821
  GetManager ()->NotifyTxRtsFailed (m_address);
752
  DoReportRtsFailed ();
822
  DoReportRtsFailed ();
753
}
823
}
754
824
755
void 
825
void 
756
WifiRemoteStation::ReportDataFailed (void)
826
WifiRemoteStation::ReportDataFailed (enum AccessClass ac)
757
{
827
{
758
  m_slrc++;
828
  if (ac == AC_UNDEF)
829
    {
830
      NS_LOG_INFO ("Access class not supported");
831
      NS_ASSERT (false);
832
    }
833
  else if (ac == AC_BE_NQOS)
834
    {
835
      m_slrc++;
836
    }
837
  else
838
    {
839
      (*m_qosSlrc.find (ac)->second)++;
840
    }
759
  GetManager ()->NotifyTxDataFailed (m_address);
841
  GetManager ()->NotifyTxDataFailed (m_address);
760
  DoReportDataFailed ();
842
  DoReportDataFailed ();
761
}
843
}
762
844
763
void 
845
void 
764
WifiRemoteStation::ReportRtsOk (double ctsSnr, WifiMode ctsMode, double rtsSnr)
846
WifiRemoteStation::ReportRtsOk (double ctsSnr, WifiMode ctsMode, double rtsSnr, enum AccessClass ac)
765
{
847
{
766
  m_ssrc = 0;
848
  if (ac == AC_UNDEF)
849
    {
850
      NS_LOG_INFO ("Access class not supported");
851
      NS_ASSERT (false);
852
    }
853
  else if (ac == AC_BE_NQOS)
854
    {
855
      m_ssrc = 0;
856
    }
857
  else
858
    {
859
      *m_qosSsrc.find (ac)->second = 0;
860
    }
767
  DoReportRtsOk (ctsSnr, ctsMode, rtsSnr);
861
  DoReportRtsOk (ctsSnr, ctsMode, rtsSnr);
768
}
862
}
769
863
770
void 
864
void 
771
WifiRemoteStation::ReportDataOk (double ackSnr, WifiMode ackMode, double dataSnr)
865
WifiRemoteStation::ReportDataOk (double ackSnr, WifiMode ackMode, double dataSnr, enum AccessClass ac)
772
{
866
{
773
  m_avgSlrc = m_avgSlrc * m_avgSlrcCoefficient + (double) m_slrc * (1 - m_avgSlrcCoefficient);
867
  m_avgSlrc = m_avgSlrc * m_avgSlrcCoefficient + (double) m_slrc * (1 - m_avgSlrcCoefficient);
774
  m_slrc = 0;
868
  if (ac == AC_UNDEF)
869
    {
870
      NS_LOG_INFO ("Access class not supported");
871
      NS_ASSERT (false);
872
    }
873
  else if (ac == AC_BE_NQOS)
874
    {
875
      m_slrc = 0;
876
    }
877
  else
878
    {
879
      *m_qosSlrc.find (ac)->second = 0;
880
    }
775
  DoReportDataOk (ackSnr, ackMode, dataSnr);
881
  DoReportDataOk (ackSnr, ackMode, dataSnr);
776
}
882
}
777
883
778
void 
884
void 
779
WifiRemoteStation::ReportFinalRtsFailed (void)
885
WifiRemoteStation::ReportFinalRtsFailed (enum AccessClass ac)
780
{
886
{
781
  m_ssrc = 0;
887
  if (ac == AC_UNDEF)
888
    {
889
      NS_LOG_INFO ("Access class not supported");
890
      NS_ASSERT (false);
891
    }
892
  else if (ac == AC_BE_NQOS)
893
    {
894
      m_ssrc = 0;
895
    }
896
  else
897
    {
898
      *m_qosSsrc.find (ac)->second = 0;
899
    }
782
  GetManager ()->NotifyTxFinalRtsFailed (m_address);
900
  GetManager ()->NotifyTxFinalRtsFailed (m_address);
783
  DoReportFinalRtsFailed ();
901
  DoReportFinalRtsFailed ();
784
}
902
}
785
903
786
void 
904
void 
787
WifiRemoteStation::ReportFinalDataFailed (void)
905
WifiRemoteStation::ReportFinalDataFailed (enum AccessClass ac)
788
{
906
{
789
  m_slrc = 0;
907
  if (ac == AC_UNDEF)
908
    {
909
      NS_LOG_INFO ("Access class not supported");
910
      NS_ASSERT (false);
911
    }
912
  else if (ac == AC_BE_NQOS)
913
    {
914
      m_slrc = 0;
915
    }
916
  else
917
    {
918
      *m_qosSlrc.find (ac)->second = 0;
919
    }
790
  GetManager ()->NotifyTxFinalDataFailed (m_address);
920
  GetManager ()->NotifyTxFinalDataFailed (m_address);
791
  DoReportFinalDataFailed ();
921
  DoReportFinalDataFailed ();
792
}
922
}
793
923
794
void 
924
void 
795
WifiRemoteStation::ReportRxOk (double rxSnr, WifiMode txMode)
925
WifiRemoteStation::ReportRxOk (double rxSnr, WifiMode txMode, enum AccessClass ac)
796
{
926
{
927
  //How should we use 'ac' parameter here?
797
  DoReportRxOk (rxSnr, txMode);
928
  DoReportRxOk (rxSnr, txMode);
798
}
929
}
799
} // namespace ns3
930
} // namespace ns3
(-)a/src/devices/wifi/wifi-remote-station-manager.h (-11 / +43 lines)
 Lines 1-6    Link Here 
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,2007 INRIA
3
 * Copyright (c) 2005,2006,2007 INRIA
4
 * Copyright (c) 2009 MIRKO BANCHI
4
 *
5
 *
5
 * 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
6
 * 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 
 Lines 16-32    Link Here 
16
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
17
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
17
 *
18
 *
18
 * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
19
 * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
20
 * Author: Mirko Banchi <mk.banchi@gmail.com>
19
 */
21
 */
20
#ifndef WIFI_REMOTE_STATION_MANAGER_H
22
#ifndef WIFI_REMOTE_STATION_MANAGER_H
21
#define WIFI_REMOTE_STATION_MANAGER_H
23
#define WIFI_REMOTE_STATION_MANAGER_H
22
24
23
#include <vector>
25
#include <vector>
24
#include <utility>
26
#include <utility>
27
#include <map>
25
#include "ns3/mac48-address.h"
28
#include "ns3/mac48-address.h"
26
#include "ns3/packet.h"
29
#include "ns3/packet.h"
27
#include "ns3/object.h"
30
#include "ns3/object.h"
28
#include "ns3/traced-value.h"
31
#include "ns3/traced-value.h"
32
#include "ns3/wifi-mac-header.h"
29
#include "wifi-mode.h"
33
#include "wifi-mode.h"
34
#include "qos-utils.h"
30
35
31
namespace ns3 {
36
namespace ns3 {
32
37
 Lines 224-258    Link Here 
224
   */
229
   */
225
  WifiMode GetRtsMode (Ptr<const Packet> packet);
230
  WifiMode GetRtsMode (Ptr<const Packet> packet);
226
  /**
231
  /**
232
   * \param ac Represents access class of the packet for which a rts was transmitted.
233
   *
227
   * Should be invoked whenever the RtsTimeout associated to a transmission
234
   * Should be invoked whenever the RtsTimeout associated to a transmission
228
   * attempt expires.
235
   * attempt expires.
229
   */
236
   */
230
  void ReportRtsFailed (void);
237
  void ReportRtsFailed (enum AccessClass ac = AC_BE_NQOS);
231
  /**
238
  /**
239
   * \param ac Access class which failed data belongs.
240
   *
232
   * Should be invoked whenever the AckTimeout associated to a transmission
241
   * Should be invoked whenever the AckTimeout associated to a transmission
233
   * attempt expires.
242
   * attempt expires.
234
   */
243
   */
235
  void ReportDataFailed (void);
244
  void ReportDataFailed (enum AccessClass ac = AC_BE_NQOS);
236
  /**
245
  /**
246
   * \param ac Represents access class of the packet for which the rts was transmitted.
247
   *
237
   * Should be invoked whenever we receive the Cts associated to an RTS 
248
   * Should be invoked whenever we receive the Cts associated to an RTS 
238
   * we just sent.
249
   * we just sent.
239
   */
250
   */
240
  void ReportRtsOk (double ctsSnr, WifiMode ctsMode, double rtsSnr);
251
  void ReportRtsOk (double ctsSnr, WifiMode ctsMode, double rtsSnr, enum AccessClass ac = AC_BE_NQOS);
241
  /**
252
  /**
253
   * \param ac Access class which correct received data belongs.
254
   *
242
   * Should be invoked whenever we receive the Ack associated to a data packet
255
   * Should be invoked whenever we receive the Ack associated to a data packet
243
   * we just sent.
256
   * we just sent.
244
   */
257
   */
245
  void ReportDataOk (double ackSnr, WifiMode ackMode, double dataSnr);
258
  void ReportDataOk (double ackSnr, WifiMode ackMode, double dataSnr, enum AccessClass ac = AC_BE_NQOS);
246
  /**
259
  /**
260
   * \param ac Represents access class of the packet for which a rts was transmitted.
261
   *
247
   * Should be invoked after calling ReportRtsFailed if 
262
   * Should be invoked after calling ReportRtsFailed if 
248
   * NeedRtsRetransmission returns false
263
   * NeedRtsRetransmission returns false
249
   */
264
   */
250
  void ReportFinalRtsFailed (void);
265
  void ReportFinalRtsFailed (enum AccessClass ac = AC_BE_NQOS);
251
  /**
266
  /**
267
   * \param ac Access class which failed data belongs.
268
   *
252
   * Should be invoked after calling ReportDataFailed if 
269
   * Should be invoked after calling ReportDataFailed if 
253
   * NeedDataRetransmission returns false
270
   * NeedDataRetransmission returns false
254
   */
271
   */
255
  void ReportFinalDataFailed (void);
272
  void ReportFinalDataFailed (enum AccessClass ac = AC_BE_NQOS);
256
273
257
  /**
274
  /**
258
   * \param rxSnr the snr of the packet received
275
   * \param rxSnr the snr of the packet received
 Lines 260-266    Link Here 
260
   *
277
   *
261
   * Should be invoked whenever a packet is successfully received.
278
   * Should be invoked whenever a packet is successfully received.
262
   */
279
   */
263
  void ReportRxOk (double rxSnr, WifiMode txMode);
280
  void ReportRxOk (double rxSnr, WifiMode txMode, enum AccessClass ac = AC_BE_NQOS);
264
281
265
  /**
282
  /**
266
   * \param packet the packet to send
283
   * \param packet the packet to send
 Lines 269-285    Link Here 
269
   */
286
   */
270
  virtual bool NeedRts (Ptr<const Packet> packet);
287
  virtual bool NeedRts (Ptr<const Packet> packet);
271
  /**
288
  /**
272
   * \param packet the packet to send
289
   * \param hdr the header of the packet to send
273
   * \returns true if we want to restart a failed RTS/CTS 
290
   * \returns true if we want to restart a failed RTS/CTS 
274
   *          handshake, false otherwise.
291
   *          handshake, false otherwise.
275
   */
292
   */
276
  virtual bool NeedRtsRetransmission (Ptr<const Packet> packet);
293
  virtual bool NeedRtsRetransmission (const WifiMacHeader *hdr);
277
  /**
294
  /**
278
   * \param packet the packet to send
295
   * \param hdr the header of the packet to send
279
   * \returns true if we want to resend a packet 
296
   * \returns true if we want to resend a packet 
280
   *          after a failed transmission attempt, false otherwise.
297
   *          after a failed transmission attempt, false otherwise.
281
   */
298
   */
282
  virtual bool NeedDataRetransmission (Ptr<const Packet> packet);
299
  virtual bool NeedDataRetransmission (const WifiMacHeader *hdr);
283
300
284
  /**
301
  /**
285
   * \param packet the packet to send
302
   * \param packet the packet to send
 Lines 361-366    Link Here 
361
  SupportedModes m_modes;
378
  SupportedModes m_modes;
362
  TracedValue<uint32_t> m_ssrc;
379
  TracedValue<uint32_t> m_ssrc;
363
  TracedValue<uint32_t> m_slrc;
380
  TracedValue<uint32_t> m_slrc;
381
  /* voice access class retry counters */
382
  TracedValue<uint32_t> m_voSsrc;
383
  TracedValue<uint32_t> m_voSlrc;
384
  /* video access class retry counters */
385
  TracedValue<uint32_t> m_viSsrc;
386
  TracedValue<uint32_t> m_viSlrc;
387
  /* best-effort access class retry counters */
388
  TracedValue<uint32_t> m_beSsrc;
389
  TracedValue<uint32_t> m_beSlrc;
390
  /* background access class retry counters */
391
  TracedValue<uint32_t> m_bkSsrc;
392
  TracedValue<uint32_t> m_bkSlrc;
393
  /* next two maps are defined for an easy access to qos retry counters */
394
  std::map<AccessClass, TracedValue<uint32_t>* > m_qosSsrc;
395
  std::map<AccessClass, TracedValue<uint32_t>* > m_qosSlrc;
364
  double m_avgSlrcCoefficient;
396
  double m_avgSlrcCoefficient;
365
  double m_avgSlrc;
397
  double m_avgSlrc;
366
  Mac48Address m_address;
398
  Mac48Address m_address;

Return to bug 602