|
29 |
#include "ns3/wifi-phy.h" |
29 |
#include "ns3/wifi-phy.h" |
30 |
#include "ns3/trace-source-accessor.h" |
30 |
#include "ns3/trace-source-accessor.h" |
31 |
#include "wifi-mac-header.h" |
31 |
#include "wifi-mac-header.h" |
|
|
32 |
#include "wifi-mac-trailer.h" |
32 |
|
33 |
|
33 |
NS_LOG_COMPONENT_DEFINE ("WifiRemoteStationManager"); |
34 |
NS_LOG_COMPONENT_DEFINE ("WifiRemoteStationManager"); |
34 |
|
35 |
|
|
151 |
UintegerValue (7), |
152 |
UintegerValue (7), |
152 |
MakeUintegerAccessor (&WifiRemoteStationManager::m_maxSlrc), |
153 |
MakeUintegerAccessor (&WifiRemoteStationManager::m_maxSlrc), |
153 |
MakeUintegerChecker<uint32_t> ()) |
154 |
MakeUintegerChecker<uint32_t> ()) |
154 |
.AddAttribute ("RtsCtsThreshold", "If a data packet is bigger than this value, we use an RTS/CTS handshake" |
155 |
.AddAttribute ("RtsCtsThreshold", "If the size of the data packet + LLC header + MAC header + FCS trailer is bigger than " |
155 |
" before sending the data. This value will not have any effect on some rate control algorithms.", |
156 |
"this value, we use an RTS/CTS handshake before sending the data, as per IEEE Std. 802.11-2007, Section 9.2.6. " |
|
|
157 |
"This value will not have any effect on some rate control algorithms.", |
156 |
UintegerValue (1500), |
158 |
UintegerValue (1500), |
157 |
MakeUintegerAccessor (&WifiRemoteStationManager::m_rtsCtsThreshold), |
159 |
MakeUintegerAccessor (&WifiRemoteStationManager::m_rtsCtsThreshold), |
158 |
MakeUintegerChecker<uint32_t> ()) |
160 |
MakeUintegerChecker<uint32_t> ()) |
159 |
.AddAttribute ("FragmentationThreshold", "If a data packet is bigger than this value, we fragment it such that" |
161 |
.AddAttribute ("FragmentationThreshold", "If the size of the data packet + LLC header + MAC header + FCS trailer is bigger" |
160 |
" the size of the fragments are equal or smaller than this value. This value will not have any effect" |
162 |
"than this value, we fragment it such that the size of the fragments are equal or smaller " |
161 |
" on some rate control algorithms.", |
163 |
"than this value, as per IEEE Std. 802.11-2007, Section 9.4. " |
|
|
164 |
"This value will not have any effect on some rate control algorithms.", |
162 |
UintegerValue (1500), |
165 |
UintegerValue (1500), |
163 |
MakeUintegerAccessor (&WifiRemoteStationManager::m_fragmentationThreshold), |
166 |
MakeUintegerAccessor (&WifiRemoteStationManager::m_fragmentationThreshold), |
164 |
MakeUintegerChecker<uint32_t> ()) |
167 |
MakeUintegerChecker<uint32_t> ()) |
|
458 |
{ |
461 |
{ |
459 |
return false; |
462 |
return false; |
460 |
} |
463 |
} |
461 |
bool normally = packet->GetSize () > GetRtsCtsThreshold (); |
464 |
bool normally = (packet->GetSize () + header->GetSize () + WIFI_MAC_FCS_LENGTH) > GetRtsCtsThreshold (); |
462 |
return DoNeedRts (Lookup (address, header), packet, normally); |
465 |
return DoNeedRts (Lookup (address, header), packet, normally); |
463 |
} |
466 |
} |
464 |
bool |
467 |
bool |
|
488 |
return false; |
491 |
return false; |
489 |
} |
492 |
} |
490 |
WifiRemoteStation *station = Lookup (address, header); |
493 |
WifiRemoteStation *station = Lookup (address, header); |
491 |
bool normally = packet->GetSize () > GetFragmentationThreshold (); |
494 |
bool normally = (packet->GetSize () + header->GetSize () + WIFI_MAC_FCS_LENGTH) > GetFragmentationThreshold (); |
492 |
return DoNeedFragmentation (station, packet, normally); |
495 |
return DoNeedFragmentation (station, packet, normally); |
493 |
} |
496 |
} |
494 |
uint32_t |
497 |
uint32_t |