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

(-)a/src/wifi/model/txop.cc (-2 / +2 lines)
 Lines 352-365   bool Link Here 
352
Txop::NeedRtsRetransmission (Ptr<const Packet> packet, const WifiMacHeader &hdr)
352
Txop::NeedRtsRetransmission (Ptr<const Packet> packet, const WifiMacHeader &hdr)
353
{
353
{
354
  NS_LOG_FUNCTION (this);
354
  NS_LOG_FUNCTION (this);
355
  return m_stationManager->NeedRtsRetransmission (hdr.GetAddr1 (), &hdr, packet);
355
  return m_stationManager->NeedRetransmission (hdr.GetAddr1 (), &hdr, packet);
356
}
356
}
357
357
358
bool
358
bool
359
Txop::NeedDataRetransmission (Ptr<const Packet> packet, const WifiMacHeader &hdr)
359
Txop::NeedDataRetransmission (Ptr<const Packet> packet, const WifiMacHeader &hdr)
360
{
360
{
361
  NS_LOG_FUNCTION (this);
361
  NS_LOG_FUNCTION (this);
362
  return m_stationManager->NeedDataRetransmission (hdr.GetAddr1 (), &hdr, packet);
362
  return m_stationManager->NeedRetransmission (hdr.GetAddr1 (), &hdr, packet);
363
}
363
}
364
364
365
bool
365
bool
(-)a/src/wifi/model/wifi-remote-station-manager.cc (-28 / +21 lines)
 Lines 334-346   WifiRemoteStationManager::GetTypeId (void) Link Here 
334
                   MakeBooleanAccessor (&WifiRemoteStationManager::IsLowLatency),
334
                   MakeBooleanAccessor (&WifiRemoteStationManager::IsLowLatency),
335
                   MakeBooleanChecker ())
335
                   MakeBooleanChecker ())
336
    .AddAttribute ("MaxSsrc",
336
    .AddAttribute ("MaxSsrc",
337
                   "The maximum number of retransmission attempts for an RTS. "
337
                   "The maximum number of retransmission attempts for any packet with size <= RtsCtsThreshold. "
338
                   " This value will not have any effect on some rate control algorithms.",
338
                   "This value will not have any effect on some rate control algorithms.",
339
                   UintegerValue (7),
339
                   UintegerValue (7),
340
                   MakeUintegerAccessor (&WifiRemoteStationManager::SetMaxSsrc),
340
                   MakeUintegerAccessor (&WifiRemoteStationManager::SetMaxSsrc),
341
                   MakeUintegerChecker<uint32_t> ())
341
                   MakeUintegerChecker<uint32_t> ())
342
    .AddAttribute ("MaxSlrc",
342
    .AddAttribute ("MaxSlrc",
343
                   "The maximum number of retransmission attempts for a DATA packet. "
343
                   "The maximum number of retransmission attempts for any packet with size > RtsCtsThreshold. "
344
                   "This value will not have any effect on some rate control algorithms.",
344
                   "This value will not have any effect on some rate control algorithms.",
345
                   UintegerValue (7),
345
                   UintegerValue (7),
346
                   MakeUintegerAccessor (&WifiRemoteStationManager::SetMaxSlrc),
346
                   MakeUintegerAccessor (&WifiRemoteStationManager::SetMaxSlrc),
 Lines 1144-1170   WifiRemoteStationManager::GetUseGreenfieldProtection (void) const Link Here 
1144
}
1144
}
1145
1145
1146
bool
1146
bool
1147
WifiRemoteStationManager::NeedRtsRetransmission (Mac48Address address, const WifiMacHeader *header,
1147
WifiRemoteStationManager::NeedRetransmission (Mac48Address address, const WifiMacHeader *header,
1148
                                                 Ptr<const Packet> packet)
1148
                                                 Ptr<const Packet> packet)
1149
{
1149
{
1150
  NS_LOG_FUNCTION (this << address << packet << *header);
1150
  NS_LOG_FUNCTION (this << address << packet << *header);
1151
  NS_ASSERT (!address.IsGroup ());
1151
  NS_ASSERT (!address.IsGroup ());
1152
  WifiRemoteStation *station = Lookup (address, header);
1152
  WifiRemoteStation *station = Lookup (address, header);
1153
  bool normally = station->m_ssrc < m_maxSsrc;
1153
  bool longMpdu = (packet->GetSize () + header->GetSize () + WIFI_MAC_FCS_LENGTH) > m_rtsCtsThreshold;
1154
  NS_LOG_DEBUG ("WifiRemoteStationManager::NeedDataRetransmission count: " << station->m_ssrc << " result: " << std::boolalpha << normally);
1154
  uint32_t retryCount, maxRetryCount;
1155
  return DoNeedRtsRetransmission (station, packet, normally);
1155
  if (longMpdu)
1156
}
1156
    {
1157
1157
      retryCount = station->m_slrc;
1158
bool
1158
      maxRetryCount = m_maxSlrc;
1159
WifiRemoteStationManager::NeedDataRetransmission (Mac48Address address, const WifiMacHeader *header,
1159
    }
1160
                                                  Ptr<const Packet> packet)
1160
  else
1161
{
1161
    {
1162
  NS_LOG_FUNCTION (this << address << packet << *header);
1162
      retryCount = station->m_ssrc;
1163
  NS_ASSERT (!address.IsGroup ());
1163
      maxRetryCount = m_maxSsrc;
1164
  WifiRemoteStation *station = Lookup (address, header);
1164
    }
1165
  bool normally = station->m_slrc < m_maxSlrc;
1165
  bool normally = retryCount < maxRetryCount;
1166
  NS_LOG_DEBUG ("WifiRemoteStationManager::NeedDataRetransmission count: " << station->m_slrc << " result: " << std::boolalpha << normally);
1166
  NS_LOG_DEBUG ("WifiRemoteStationManager::NeedRetransmission count: " << retryCount << " result: " << std::boolalpha << normally);
1167
  return DoNeedDataRetransmission (station, packet, normally);
1167
  return DoNeedRetransmission (station, packet, normally);
1168
}
1168
}
1169
1169
1170
bool
1170
bool
 Lines 1979-1993   WifiRemoteStationManager::DoNeedRts (WifiRemoteStation *station, Link Here 
1979
}
1979
}
1980
1980
1981
bool
1981
bool
1982
WifiRemoteStationManager::DoNeedRtsRetransmission (WifiRemoteStation *station,
1982
WifiRemoteStationManager::DoNeedRetransmission (WifiRemoteStation *station,
1983
                                                   Ptr<const Packet> packet, bool normally)
1983
                                                Ptr<const Packet> packet, bool normally)
1984
{
1985
  return normally;
1986
}
1987
1988
bool
1989
WifiRemoteStationManager::DoNeedDataRetransmission (WifiRemoteStation *station,
1990
                                                    Ptr<const Packet> packet, bool normally)
1991
{
1984
{
1992
  return normally;
1985
  return normally;
1993
}
1986
}
(-)a/src/wifi/model/wifi-remote-station-manager.h (-31 / +7 lines)
 Lines 688-694   public: Link Here 
688
                     double ackSnr, WifiMode ackMode, double dataSnr);
688
                     double ackSnr, WifiMode ackMode, double dataSnr);
689
  /**
689
  /**
690
   * Should be invoked after calling ReportRtsFailed if
690
   * Should be invoked after calling ReportRtsFailed if
691
   * NeedRtsRetransmission returns false
691
   * NeedRetransmission returns false
692
   *
692
   *
693
   * \param address the address of the receiver
693
   * \param address the address of the receiver
694
   * \param header MAC header of the DATA packet
694
   * \param header MAC header of the DATA packet
 Lines 696-702   public: Link Here 
696
  void ReportFinalRtsFailed (Mac48Address address, const WifiMacHeader *header);
696
  void ReportFinalRtsFailed (Mac48Address address, const WifiMacHeader *header);
697
  /**
697
  /**
698
   * Should be invoked after calling ReportDataFailed if
698
   * Should be invoked after calling ReportDataFailed if
699
   * NeedDataRetransmission returns false
699
   * NeedRetransmission returns false
700
   *
700
   *
701
   * \param address the address of the receiver
701
   * \param address the address of the receiver
702
   * \param header MAC header of the DATA packet
702
   * \param header MAC header of the DATA packet
 Lines 748-763   public: Link Here 
748
   */
748
   */
749
  bool NeedCtsToSelf (WifiTxVector txVector);
749
  bool NeedCtsToSelf (WifiTxVector txVector);
750
750
751
  /**
752
   * \param address remote address
753
   * \param header MAC header
754
   * \param packet the packet to send
755
   *
756
   * \return true if we want to restart a failed RTS/CTS handshake,
757
   *         false otherwise.
758
   */
759
  bool NeedRtsRetransmission (Mac48Address address, const WifiMacHeader *header,
760
                              Ptr<const Packet> packet);
761
  /**
751
  /**
762
   * \param address remote address
752
   * \param address remote address
763
   * \param header MAC header
753
   * \param header MAC header
 Lines 766-773   public: Link Here 
766
   * \return true if we want to resend a packet after a failed transmission attempt,
756
   * \return true if we want to resend a packet after a failed transmission attempt,
767
   *         false otherwise.
757
   *         false otherwise.
768
   */
758
   */
769
  bool NeedDataRetransmission (Mac48Address address, const WifiMacHeader *header,
759
  bool NeedRetransmission (Mac48Address address, const WifiMacHeader *header,
770
                               Ptr<const Packet> packet);
760
                           Ptr<const Packet> packet);
771
  /**
761
  /**
772
   * \param address remote address
762
   * \param address remote address
773
   * \param header MAC header
763
   * \param header MAC header
 Lines 1080-1099   private: Link Here 
1080
   */
1070
   */
1081
  virtual bool DoNeedRts (WifiRemoteStation *station,
1071
  virtual bool DoNeedRts (WifiRemoteStation *station,
1082
                          Ptr<const Packet> packet, bool normally);
1072
                          Ptr<const Packet> packet, bool normally);
1083
  /**
1084
   * \param station the station that we need to communicate
1085
   * \param packet the packet to send
1086
   * \param normally indicates whether the normal 802.11 rts enable mechanism would
1087
   *        request that the rts is retransmitted or not.
1088
   *
1089
   * \return true if we want to restart a failed RTS/CTS handshake,
1090
   *         false otherwise.
1091
   *
1092
   * Note: This method is called after an rts/cts handshake has been attempted
1093
   *       and has failed.
1094
   */
1095
  virtual bool DoNeedRtsRetransmission (WifiRemoteStation *station,
1096
                                        Ptr<const Packet> packet, bool normally);
1097
  /**
1073
  /**
1098
   * \param station the station that we need to communicate
1074
   * \param station the station that we need to communicate
1099
   * \param packet the packet to send
1075
   * \param packet the packet to send
 Lines 1102-1111   private: Link Here 
1102
   * \return true if we want to resend a packet after a failed transmission attempt,
1078
   * \return true if we want to resend a packet after a failed transmission attempt,
1103
   *         false otherwise.
1079
   *         false otherwise.
1104
   *
1080
   *
1105
   * Note: This method is called after a unicast packet transmission has been attempted
1081
   * Note: This method is called after any unicast packet transmission (control, management,
1106
   *       and has failed.
1082
   *       or data) has been attempted and has failed.
1107
   */
1083
   */
1108
  virtual bool DoNeedDataRetransmission (WifiRemoteStation *station,
1084
  virtual bool DoNeedRetransmission (WifiRemoteStation *station,
1109
                                         Ptr<const Packet> packet, bool normally);
1085
                                         Ptr<const Packet> packet, bool normally);
1110
  /**
1086
  /**
1111
   * \param station the station that we need to communicate
1087
   * \param station the station that we need to communicate

Return to bug 2926