|
|
| 745 |
CancelAllEvents (); |
745 |
CancelAllEvents (); |
| 746 |
m_listener = listener; |
746 |
m_listener = listener; |
| 747 |
m_txParams = params; |
747 |
m_txParams = params; |
|
|
748 |
m_currentTxVector = GetDataTxVector (m_currentPacket, &m_currentHdr); |
| 748 |
|
749 |
|
| 749 |
if (!m_currentHdr.IsQosData () && !m_currentHdr.IsBlockAck () && !m_currentHdr.IsBlockAckReq ()) |
750 |
if (!m_currentHdr.IsQosData () && !m_currentHdr.IsBlockAck () && !m_currentHdr.IsBlockAckReq ()) |
| 750 |
{ |
751 |
{ |
|
|
| 1846 |
} |
1847 |
} |
| 1847 |
else |
1848 |
else |
| 1848 |
{ |
1849 |
{ |
| 1849 |
WifiTxVector dataTxVector = GetDataTxVector (m_currentPacket, &m_currentHdr); |
|
|
| 1850 |
duration += GetSifs (); |
1850 |
duration += GetSifs (); |
| 1851 |
duration += GetCtsDuration (m_currentHdr.GetAddr1 (), rtsTxVector); |
1851 |
duration += GetCtsDuration (m_currentHdr.GetAddr1 (), rtsTxVector); |
| 1852 |
duration += GetSifs (); |
1852 |
duration += GetSifs (); |
| 1853 |
duration += m_phy->CalculateTxDuration (GetSize (m_currentPacket, &m_currentHdr), |
1853 |
duration += m_phy->CalculateTxDuration (GetSize (m_currentPacket, &m_currentHdr), |
| 1854 |
dataTxVector, preamble, m_phy->GetFrequency ()); |
1854 |
m_currentTxVector, preamble, m_phy->GetFrequency ()); |
| 1855 |
duration += GetSifs (); |
1855 |
duration += GetSifs (); |
| 1856 |
if (m_txParams.MustWaitBasicBlockAck ()) |
1856 |
if (m_txParams.MustWaitBasicBlockAck ()) |
| 1857 |
{ |
1857 |
{ |
| 1858 |
WifiTxVector blockAckReqTxVector = GetBlockAckTxVector (m_currentHdr.GetAddr2 (), dataTxVector.GetMode ()); |
1858 |
WifiTxVector blockAckReqTxVector = GetBlockAckTxVector (m_currentHdr.GetAddr2 (), m_currentTxVector.GetMode ()); |
| 1859 |
duration += GetBlockAckDuration (m_currentHdr.GetAddr1 (), blockAckReqTxVector, BASIC_BLOCK_ACK); |
1859 |
duration += GetBlockAckDuration (m_currentHdr.GetAddr1 (), blockAckReqTxVector, BASIC_BLOCK_ACK); |
| 1860 |
} |
1860 |
} |
| 1861 |
else if (m_txParams.MustWaitCompressedBlockAck ()) |
1861 |
else if (m_txParams.MustWaitCompressedBlockAck ()) |
| 1862 |
{ |
1862 |
{ |
| 1863 |
WifiTxVector blockAckReqTxVector = GetBlockAckTxVector (m_currentHdr.GetAddr2 (), dataTxVector.GetMode ()); |
1863 |
WifiTxVector blockAckReqTxVector = GetBlockAckTxVector (m_currentHdr.GetAddr2 (), m_currentTxVector.GetMode ()); |
| 1864 |
duration += GetBlockAckDuration (m_currentHdr.GetAddr1 (), blockAckReqTxVector, COMPRESSED_BLOCK_ACK); |
1864 |
duration += GetBlockAckDuration (m_currentHdr.GetAddr1 (), blockAckReqTxVector, COMPRESSED_BLOCK_ACK); |
| 1865 |
} |
1865 |
} |
| 1866 |
else if (m_txParams.MustWaitAck ()) |
1866 |
else if (m_txParams.MustWaitAck ()) |
| 1867 |
{ |
1867 |
{ |
| 1868 |
duration += GetAckDuration (m_currentHdr.GetAddr1 (), dataTxVector); |
1868 |
duration += GetAckDuration (m_currentHdr.GetAddr1 (), m_currentTxVector); |
| 1869 |
} |
1869 |
} |
| 1870 |
if (m_txParams.HasNextPacket ()) |
1870 |
if (m_txParams.HasNextPacket ()) |
| 1871 |
{ |
1871 |
{ |
| 1872 |
duration += m_phy->CalculateTxDuration (m_txParams.GetNextPacketSize (), |
1872 |
duration += m_phy->CalculateTxDuration (m_txParams.GetNextPacketSize (), |
| 1873 |
dataTxVector, preamble, m_phy->GetFrequency ()); |
1873 |
m_currentTxVector, preamble, m_phy->GetFrequency ()); |
| 1874 |
if (m_txParams.MustWaitAck ()) |
1874 |
if (m_txParams.MustWaitAck ()) |
| 1875 |
{ |
1875 |
{ |
| 1876 |
duration += GetSifs (); |
1876 |
duration += GetSifs (); |
| 1877 |
duration += GetAckDuration (m_currentHdr.GetAddr1 (), dataTxVector); |
1877 |
duration += GetAckDuration (m_currentHdr.GetAddr1 (), m_currentTxVector); |
| 1878 |
} |
1878 |
} |
| 1879 |
} |
1879 |
} |
| 1880 |
} |
1880 |
} |
|
|
| 1986 |
{ |
1986 |
{ |
| 1987 |
NS_LOG_FUNCTION (this); |
1987 |
NS_LOG_FUNCTION (this); |
| 1988 |
/* send this packet directly. No RTS is needed. */ |
1988 |
/* send this packet directly. No RTS is needed. */ |
| 1989 |
WifiTxVector dataTxVector = GetDataTxVector (m_currentPacket, &m_currentHdr); |
|
|
| 1990 |
WifiPreamble preamble; |
1989 |
WifiPreamble preamble; |
| 1991 |
if (dataTxVector.GetMode ().GetModulationClass () == WIFI_MOD_CLASS_VHT) |
1990 |
if (m_currentTxVector.GetMode ().GetModulationClass () == WIFI_MOD_CLASS_VHT) |
| 1992 |
{ |
1991 |
{ |
| 1993 |
preamble = WIFI_PREAMBLE_VHT; |
1992 |
preamble = WIFI_PREAMBLE_VHT; |
| 1994 |
} |
1993 |
} |
|
|
| 1997 |
//In the future has to make sure that receiver has greenfield enabled |
1996 |
//In the future has to make sure that receiver has greenfield enabled |
| 1998 |
preamble = WIFI_PREAMBLE_HT_GF; |
1997 |
preamble = WIFI_PREAMBLE_HT_GF; |
| 1999 |
} |
1998 |
} |
| 2000 |
else if (dataTxVector.GetMode ().GetModulationClass () == WIFI_MOD_CLASS_HT) |
1999 |
else if (m_currentTxVector.GetMode ().GetModulationClass () == WIFI_MOD_CLASS_HT) |
| 2001 |
{ |
2000 |
{ |
| 2002 |
preamble = WIFI_PREAMBLE_HT_MF; |
2001 |
preamble = WIFI_PREAMBLE_HT_MF; |
| 2003 |
} |
2002 |
} |
|
|
| 2010 |
preamble = WIFI_PREAMBLE_LONG; |
2009 |
preamble = WIFI_PREAMBLE_LONG; |
| 2011 |
} |
2010 |
} |
| 2012 |
|
2011 |
|
| 2013 |
StartDataTxTimers (dataTxVector); |
2012 |
StartDataTxTimers (m_currentTxVector); |
| 2014 |
|
2013 |
|
| 2015 |
Time duration = Seconds (0.0); |
2014 |
Time duration = Seconds (0.0); |
| 2016 |
if (m_txParams.HasDurationId ()) |
2015 |
if (m_txParams.HasDurationId ()) |
|
|
| 2022 |
if (m_txParams.MustWaitBasicBlockAck ()) |
2021 |
if (m_txParams.MustWaitBasicBlockAck ()) |
| 2023 |
{ |
2022 |
{ |
| 2024 |
duration += GetSifs (); |
2023 |
duration += GetSifs (); |
| 2025 |
WifiTxVector blockAckReqTxVector = GetBlockAckTxVector (m_currentHdr.GetAddr2 (), dataTxVector.GetMode ()); |
2024 |
WifiTxVector blockAckReqTxVector = GetBlockAckTxVector (m_currentHdr.GetAddr2 (), m_currentTxVector.GetMode ()); |
| 2026 |
duration += GetBlockAckDuration (m_currentHdr.GetAddr1 (), blockAckReqTxVector, BASIC_BLOCK_ACK); |
2025 |
duration += GetBlockAckDuration (m_currentHdr.GetAddr1 (), blockAckReqTxVector, BASIC_BLOCK_ACK); |
| 2027 |
} |
2026 |
} |
| 2028 |
else if (m_txParams.MustWaitCompressedBlockAck ()) |
2027 |
else if (m_txParams.MustWaitCompressedBlockAck ()) |
| 2029 |
{ |
2028 |
{ |
| 2030 |
duration += GetSifs (); |
2029 |
duration += GetSifs (); |
| 2031 |
WifiTxVector blockAckReqTxVector = GetBlockAckTxVector (m_currentHdr.GetAddr2 (), dataTxVector.GetMode ()); |
2030 |
WifiTxVector blockAckReqTxVector = GetBlockAckTxVector (m_currentHdr.GetAddr2 (), m_currentTxVector.GetMode ()); |
| 2032 |
duration += GetBlockAckDuration (m_currentHdr.GetAddr1 (), blockAckReqTxVector, COMPRESSED_BLOCK_ACK); |
2031 |
duration += GetBlockAckDuration (m_currentHdr.GetAddr1 (), blockAckReqTxVector, COMPRESSED_BLOCK_ACK); |
| 2033 |
} |
2032 |
} |
| 2034 |
else if (m_txParams.MustWaitAck ()) |
2033 |
else if (m_txParams.MustWaitAck ()) |
| 2035 |
{ |
2034 |
{ |
| 2036 |
duration += GetSifs (); |
2035 |
duration += GetSifs (); |
| 2037 |
duration += GetAckDuration (m_currentHdr.GetAddr1 (), dataTxVector); |
2036 |
duration += GetAckDuration (m_currentHdr.GetAddr1 (), m_currentTxVector); |
| 2038 |
} |
2037 |
} |
| 2039 |
if (m_txParams.HasNextPacket ()) |
2038 |
if (m_txParams.HasNextPacket ()) |
| 2040 |
{ |
2039 |
{ |
| 2041 |
duration += GetSifs (); |
2040 |
duration += GetSifs (); |
| 2042 |
duration += m_phy->CalculateTxDuration (m_txParams.GetNextPacketSize (), |
2041 |
duration += m_phy->CalculateTxDuration (m_txParams.GetNextPacketSize (), |
| 2043 |
dataTxVector, preamble, m_phy->GetFrequency ()); |
2042 |
m_currentTxVector, preamble, m_phy->GetFrequency ()); |
| 2044 |
if (m_txParams.MustWaitAck ()) |
2043 |
if (m_txParams.MustWaitAck ()) |
| 2045 |
{ |
2044 |
{ |
| 2046 |
duration += GetSifs (); |
2045 |
duration += GetSifs (); |
| 2047 |
duration += GetAckDuration (m_currentHdr.GetAddr1 (), dataTxVector); |
2046 |
duration += GetAckDuration (m_currentHdr.GetAddr1 (), m_currentTxVector); |
| 2048 |
} |
2047 |
} |
| 2049 |
} |
2048 |
} |
| 2050 |
} |
2049 |
} |
|
|
| 2057 |
m_currentPacket->AddTrailer (fcs); |
2056 |
m_currentPacket->AddTrailer (fcs); |
| 2058 |
} |
2057 |
} |
| 2059 |
|
2058 |
|
| 2060 |
ForwardDown (m_currentPacket, &m_currentHdr, dataTxVector, preamble); |
2059 |
ForwardDown (m_currentPacket, &m_currentHdr, m_currentTxVector, preamble); |
| 2061 |
m_currentPacket = 0; |
2060 |
m_currentPacket = 0; |
| 2062 |
} |
2061 |
} |
| 2063 |
|
2062 |
|
|
|
| 2109 |
} |
2108 |
} |
| 2110 |
else |
2109 |
else |
| 2111 |
{ |
2110 |
{ |
| 2112 |
WifiTxVector dataTxVector = GetDataTxVector (m_currentPacket, &m_currentHdr); |
|
|
| 2113 |
duration += GetSifs (); |
2111 |
duration += GetSifs (); |
| 2114 |
duration += m_phy->CalculateTxDuration (GetSize (m_currentPacket,&m_currentHdr), |
2112 |
duration += m_phy->CalculateTxDuration (GetSize (m_currentPacket,&m_currentHdr), |
| 2115 |
dataTxVector, preamble, m_phy->GetFrequency ()); |
2113 |
m_currentTxVector, preamble, m_phy->GetFrequency ()); |
| 2116 |
if (m_txParams.MustWaitBasicBlockAck ()) |
2114 |
if (m_txParams.MustWaitBasicBlockAck ()) |
| 2117 |
{ |
2115 |
{ |
| 2118 |
|
2116 |
|
| 2119 |
duration += GetSifs (); |
2117 |
duration += GetSifs (); |
| 2120 |
WifiTxVector blockAckReqTxVector = GetBlockAckTxVector (m_currentHdr.GetAddr2 (), dataTxVector.GetMode ()); |
2118 |
WifiTxVector blockAckReqTxVector = GetBlockAckTxVector (m_currentHdr.GetAddr2 (), m_currentTxVector.GetMode ()); |
| 2121 |
duration += GetBlockAckDuration (m_currentHdr.GetAddr1 (), blockAckReqTxVector, BASIC_BLOCK_ACK); |
2119 |
duration += GetBlockAckDuration (m_currentHdr.GetAddr1 (), blockAckReqTxVector, BASIC_BLOCK_ACK); |
| 2122 |
} |
2120 |
} |
| 2123 |
else if (m_txParams.MustWaitCompressedBlockAck ()) |
2121 |
else if (m_txParams.MustWaitCompressedBlockAck ()) |
| 2124 |
{ |
2122 |
{ |
| 2125 |
duration += GetSifs (); |
2123 |
duration += GetSifs (); |
| 2126 |
WifiTxVector blockAckReqTxVector = GetBlockAckTxVector (m_currentHdr.GetAddr2 (), dataTxVector.GetMode ()); |
2124 |
WifiTxVector blockAckReqTxVector = GetBlockAckTxVector (m_currentHdr.GetAddr2 (), m_currentTxVector.GetMode ()); |
| 2127 |
duration += GetBlockAckDuration (m_currentHdr.GetAddr1 (), blockAckReqTxVector, COMPRESSED_BLOCK_ACK); |
2125 |
duration += GetBlockAckDuration (m_currentHdr.GetAddr1 (), blockAckReqTxVector, COMPRESSED_BLOCK_ACK); |
| 2128 |
} |
2126 |
} |
| 2129 |
else if (m_txParams.MustWaitAck ()) |
2127 |
else if (m_txParams.MustWaitAck ()) |
| 2130 |
{ |
2128 |
{ |
| 2131 |
duration += GetSifs (); |
2129 |
duration += GetSifs (); |
| 2132 |
duration += GetAckDuration (m_currentHdr.GetAddr1 (), dataTxVector); |
2130 |
duration += GetAckDuration (m_currentHdr.GetAddr1 (), m_currentTxVector); |
| 2133 |
} |
2131 |
} |
| 2134 |
if (m_txParams.HasNextPacket ()) |
2132 |
if (m_txParams.HasNextPacket ()) |
| 2135 |
{ |
2133 |
{ |
| 2136 |
duration += GetSifs (); |
2134 |
duration += GetSifs (); |
| 2137 |
duration += m_phy->CalculateTxDuration (m_txParams.GetNextPacketSize (), |
2135 |
duration += m_phy->CalculateTxDuration (m_txParams.GetNextPacketSize (), |
| 2138 |
dataTxVector, preamble, m_phy->GetFrequency ()); |
2136 |
m_currentTxVector, preamble, m_phy->GetFrequency ()); |
| 2139 |
if (m_txParams.MustWaitCompressedBlockAck ()) |
2137 |
if (m_txParams.MustWaitCompressedBlockAck ()) |
| 2140 |
{ |
2138 |
{ |
| 2141 |
duration += GetSifs (); |
2139 |
duration += GetSifs (); |
| 2142 |
WifiTxVector blockAckReqTxVector = GetBlockAckTxVector (m_currentHdr.GetAddr2 (), dataTxVector.GetMode ()); |
2140 |
WifiTxVector blockAckReqTxVector = GetBlockAckTxVector (m_currentHdr.GetAddr2 (), m_currentTxVector.GetMode ()); |
| 2143 |
duration += GetBlockAckDuration (m_currentHdr.GetAddr1 (), blockAckReqTxVector, COMPRESSED_BLOCK_ACK); |
2141 |
duration += GetBlockAckDuration (m_currentHdr.GetAddr1 (), blockAckReqTxVector, COMPRESSED_BLOCK_ACK); |
| 2144 |
} |
2142 |
} |
| 2145 |
else if (m_txParams.MustWaitAck ()) |
2143 |
else if (m_txParams.MustWaitAck ()) |
| 2146 |
{ |
2144 |
{ |
| 2147 |
duration += GetSifs (); |
2145 |
duration += GetSifs (); |
| 2148 |
duration += GetAckDuration (m_currentHdr.GetAddr1 (), dataTxVector); |
2146 |
duration += GetAckDuration (m_currentHdr.GetAddr1 (), m_currentTxVector); |
| 2149 |
} |
2147 |
} |
| 2150 |
} |
2148 |
} |
| 2151 |
} |
2149 |
} |
|
|
| 2221 |
* RTS/CTS/DATA/ACK hanshake |
2219 |
* RTS/CTS/DATA/ACK hanshake |
| 2222 |
*/ |
2220 |
*/ |
| 2223 |
NS_ASSERT (m_currentPacket != 0); |
2221 |
NS_ASSERT (m_currentPacket != 0); |
| 2224 |
WifiTxVector dataTxVector = GetDataTxVector (m_currentPacket, &m_currentHdr); |
|
|
| 2225 |
|
2222 |
|
| 2226 |
if (m_aggregateQueue->GetSize () != 0) |
2223 |
if (m_aggregateQueue->GetSize () != 0) |
| 2227 |
{ |
2224 |
{ |
|
|
| 2237 |
} |
2234 |
} |
| 2238 |
|
2235 |
|
| 2239 |
WifiPreamble preamble; |
2236 |
WifiPreamble preamble; |
| 2240 |
if (dataTxVector.GetMode ().GetModulationClass () == WIFI_MOD_CLASS_VHT) |
2237 |
if (m_currentTxVector.GetMode ().GetModulationClass () == WIFI_MOD_CLASS_VHT) |
| 2241 |
{ |
2238 |
{ |
| 2242 |
preamble = WIFI_PREAMBLE_VHT; |
2239 |
preamble = WIFI_PREAMBLE_VHT; |
| 2243 |
} |
2240 |
} |
|
|
| 2246 |
//In the future has to make sure that receiver has greenfield enabled |
2243 |
//In the future has to make sure that receiver has greenfield enabled |
| 2247 |
preamble = WIFI_PREAMBLE_HT_GF; |
2244 |
preamble = WIFI_PREAMBLE_HT_GF; |
| 2248 |
} |
2245 |
} |
| 2249 |
else if (dataTxVector.GetMode ().GetModulationClass () == WIFI_MOD_CLASS_HT) |
2246 |
else if (m_currentTxVector.GetMode ().GetModulationClass () == WIFI_MOD_CLASS_HT) |
| 2250 |
{ |
2247 |
{ |
| 2251 |
preamble = WIFI_PREAMBLE_HT_MF; |
2248 |
preamble = WIFI_PREAMBLE_HT_MF; |
| 2252 |
} |
2249 |
} |
|
|
| 2259 |
preamble = WIFI_PREAMBLE_LONG; |
2256 |
preamble = WIFI_PREAMBLE_LONG; |
| 2260 |
} |
2257 |
} |
| 2261 |
|
2258 |
|
| 2262 |
StartDataTxTimers (dataTxVector); |
2259 |
StartDataTxTimers (m_currentTxVector); |
| 2263 |
Time newDuration = Seconds (0); |
2260 |
Time newDuration = Seconds (0); |
| 2264 |
if (m_txParams.MustWaitBasicBlockAck ()) |
2261 |
if (m_txParams.MustWaitBasicBlockAck ()) |
| 2265 |
{ |
2262 |
{ |
| 2266 |
newDuration += GetSifs (); |
2263 |
newDuration += GetSifs (); |
| 2267 |
WifiTxVector blockAckReqTxVector = GetBlockAckTxVector (m_currentHdr.GetAddr2 (), dataTxVector.GetMode ()); |
2264 |
WifiTxVector blockAckReqTxVector = GetBlockAckTxVector (m_currentHdr.GetAddr2 (), m_currentTxVector.GetMode ()); |
| 2268 |
newDuration += GetBlockAckDuration (m_currentHdr.GetAddr1 (), blockAckReqTxVector, BASIC_BLOCK_ACK); |
2265 |
newDuration += GetBlockAckDuration (m_currentHdr.GetAddr1 (), blockAckReqTxVector, BASIC_BLOCK_ACK); |
| 2269 |
} |
2266 |
} |
| 2270 |
else if (m_txParams.MustWaitCompressedBlockAck ()) |
2267 |
else if (m_txParams.MustWaitCompressedBlockAck ()) |
| 2271 |
{ |
2268 |
{ |
| 2272 |
newDuration += GetSifs (); |
2269 |
newDuration += GetSifs (); |
| 2273 |
WifiTxVector blockAckReqTxVector = GetBlockAckTxVector (m_currentHdr.GetAddr2 (), dataTxVector.GetMode ()); |
2270 |
WifiTxVector blockAckReqTxVector = GetBlockAckTxVector (m_currentHdr.GetAddr2 (), m_currentTxVector.GetMode ()); |
| 2274 |
newDuration += GetBlockAckDuration (m_currentHdr.GetAddr1 (), blockAckReqTxVector, COMPRESSED_BLOCK_ACK); |
2271 |
newDuration += GetBlockAckDuration (m_currentHdr.GetAddr1 (), blockAckReqTxVector, COMPRESSED_BLOCK_ACK); |
| 2275 |
} |
2272 |
} |
| 2276 |
else if (m_txParams.MustWaitAck ()) |
2273 |
else if (m_txParams.MustWaitAck ()) |
| 2277 |
{ |
2274 |
{ |
| 2278 |
newDuration += GetSifs (); |
2275 |
newDuration += GetSifs (); |
| 2279 |
newDuration += GetAckDuration (m_currentHdr.GetAddr1 (), dataTxVector); |
2276 |
newDuration += GetAckDuration (m_currentHdr.GetAddr1 (), m_currentTxVector); |
| 2280 |
} |
2277 |
} |
| 2281 |
if (m_txParams.HasNextPacket ()) |
2278 |
if (m_txParams.HasNextPacket ()) |
| 2282 |
{ |
2279 |
{ |
| 2283 |
newDuration += GetSifs (); |
2280 |
newDuration += GetSifs (); |
| 2284 |
newDuration += m_phy->CalculateTxDuration (m_txParams.GetNextPacketSize (), dataTxVector, preamble, m_phy->GetFrequency ()); |
2281 |
newDuration += m_phy->CalculateTxDuration (m_txParams.GetNextPacketSize (), m_currentTxVector, preamble, m_phy->GetFrequency ()); |
| 2285 |
if (m_txParams.MustWaitCompressedBlockAck ()) |
2282 |
if (m_txParams.MustWaitCompressedBlockAck ()) |
| 2286 |
{ |
2283 |
{ |
| 2287 |
newDuration += GetSifs (); |
2284 |
newDuration += GetSifs (); |
| 2288 |
WifiTxVector blockAckReqTxVector = GetBlockAckTxVector (m_currentHdr.GetAddr2 (), dataTxVector.GetMode ()); |
2285 |
WifiTxVector blockAckReqTxVector = GetBlockAckTxVector (m_currentHdr.GetAddr2 (), m_currentTxVector.GetMode ()); |
| 2289 |
newDuration += GetBlockAckDuration (m_currentHdr.GetAddr1 (), blockAckReqTxVector, COMPRESSED_BLOCK_ACK); |
2286 |
newDuration += GetBlockAckDuration (m_currentHdr.GetAddr1 (), blockAckReqTxVector, COMPRESSED_BLOCK_ACK); |
| 2290 |
} |
2287 |
} |
| 2291 |
else if (m_txParams.MustWaitAck ()) |
2288 |
else if (m_txParams.MustWaitAck ()) |
| 2292 |
{ |
2289 |
{ |
| 2293 |
newDuration += GetSifs (); |
2290 |
newDuration += GetSifs (); |
| 2294 |
newDuration += GetAckDuration (m_currentHdr.GetAddr1 (), dataTxVector); |
2291 |
newDuration += GetAckDuration (m_currentHdr.GetAddr1 (), m_currentTxVector); |
| 2295 |
} |
2292 |
} |
| 2296 |
} |
2293 |
} |
| 2297 |
|
2294 |
|
| 2298 |
Time txDuration = m_phy->CalculateTxDuration (GetSize (m_currentPacket, &m_currentHdr), dataTxVector, preamble, m_phy->GetFrequency ()); |
2295 |
Time txDuration = m_phy->CalculateTxDuration (GetSize (m_currentPacket, &m_currentHdr), m_currentTxVector, preamble, m_phy->GetFrequency ()); |
| 2299 |
duration -= txDuration; |
2296 |
duration -= txDuration; |
| 2300 |
duration -= GetSifs (); |
2297 |
duration -= GetSifs (); |
| 2301 |
|
2298 |
|
|
|
| 2310 |
m_currentPacket->AddTrailer (fcs); |
2307 |
m_currentPacket->AddTrailer (fcs); |
| 2311 |
} |
2308 |
} |
| 2312 |
|
2309 |
|
| 2313 |
ForwardDown (m_currentPacket, &m_currentHdr, dataTxVector, preamble); |
2310 |
ForwardDown (m_currentPacket, &m_currentHdr, m_currentTxVector, preamble); |
| 2314 |
m_currentPacket = 0; |
2311 |
m_currentPacket = 0; |
| 2315 |
} |
2312 |
} |
| 2316 |
|
2313 |
|
|
|
| 2889 |
MacLow::StopMpduAggregation (Ptr<const Packet> peekedPacket, WifiMacHeader peekedHdr, Ptr<Packet> aggregatedPacket, uint16_t size) const |
2886 |
MacLow::StopMpduAggregation (Ptr<const Packet> peekedPacket, WifiMacHeader peekedHdr, Ptr<Packet> aggregatedPacket, uint16_t size) const |
| 2890 |
{ |
2887 |
{ |
| 2891 |
WifiPreamble preamble; |
2888 |
WifiPreamble preamble; |
| 2892 |
WifiTxVector dataTxVector = GetDataTxVector (m_currentPacket, &m_currentHdr); |
|
|
| 2893 |
|
2889 |
|
| 2894 |
uint8_t tid = GetTid (peekedPacket, peekedHdr); |
2890 |
uint8_t tid = GetTid (peekedPacket, peekedHdr); |
| 2895 |
AcIndex ac = QosUtilsMapTidToAc (tid); |
2891 |
AcIndex ac = QosUtilsMapTidToAc (tid); |
| 2896 |
std::map<AcIndex, MacLowAggregationCapableTransmissionListener*>::const_iterator listenerIt = m_edcaListeners.find (ac); |
2892 |
std::map<AcIndex, MacLowAggregationCapableTransmissionListener*>::const_iterator listenerIt = m_edcaListeners.find (ac); |
| 2897 |
|
2893 |
|
| 2898 |
if (dataTxVector.GetMode ().GetModulationClass () == WIFI_MOD_CLASS_VHT) |
2894 |
if (m_currentTxVector.GetMode ().GetModulationClass () == WIFI_MOD_CLASS_VHT) |
| 2899 |
{ |
2895 |
{ |
| 2900 |
preamble = WIFI_PREAMBLE_VHT; |
2896 |
preamble = WIFI_PREAMBLE_VHT; |
| 2901 |
} |
2897 |
} |
|
|
| 2903 |
{ |
2899 |
{ |
| 2904 |
preamble = WIFI_PREAMBLE_HT_GF; |
2900 |
preamble = WIFI_PREAMBLE_HT_GF; |
| 2905 |
} |
2901 |
} |
| 2906 |
else if (dataTxVector.GetMode ().GetModulationClass () == WIFI_MOD_CLASS_HT) |
2902 |
else if (m_currentTxVector.GetMode ().GetModulationClass () == WIFI_MOD_CLASS_HT) |
| 2907 |
{ |
2903 |
{ |
| 2908 |
preamble = WIFI_PREAMBLE_HT_MF; |
2904 |
preamble = WIFI_PREAMBLE_HT_MF; |
| 2909 |
} |
2905 |
} |
|
|
| 2923 |
} |
2919 |
} |
| 2924 |
|
2920 |
|
| 2925 |
//An HT STA shall not transmit a PPDU that has a duration that is greater than aPPDUMaxTime (10 milliseconds) |
2921 |
//An HT STA shall not transmit a PPDU that has a duration that is greater than aPPDUMaxTime (10 milliseconds) |
| 2926 |
if (m_phy->CalculateTxDuration (aggregatedPacket->GetSize () + peekedPacket->GetSize () + peekedHdr.GetSize () + WIFI_MAC_FCS_LENGTH, dataTxVector, preamble, m_phy->GetFrequency ()) > MilliSeconds (10)) |
2922 |
if (m_phy->CalculateTxDuration (aggregatedPacket->GetSize () + peekedPacket->GetSize () + peekedHdr.GetSize () + WIFI_MAC_FCS_LENGTH, m_currentTxVector, preamble, m_phy->GetFrequency ()) > MilliSeconds (10)) |
| 2927 |
{ |
2923 |
{ |
| 2928 |
NS_LOG_DEBUG ("no more packets can be aggregated to satisfy PPDU <= aPPDUMaxTime"); |
2924 |
NS_LOG_DEBUG ("no more packets can be aggregated to satisfy PPDU <= aPPDUMaxTime"); |
| 2929 |
return true; |
2925 |
return true; |