|
|
| 982 |
preamble= WIFI_PREAMBLE_HT_MF; |
982 |
preamble= WIFI_PREAMBLE_HT_MF; |
| 983 |
else |
983 |
else |
| 984 |
preamble=WIFI_PREAMBLE_LONG; |
984 |
preamble=WIFI_PREAMBLE_LONG; |
| 985 |
return m_phy->CalculateTxDuration (GetAckSize (), ackTxVector, preamble); |
985 |
return m_phy->CalculateTxDuration (GetAckSize (), ackTxVector, preamble, m_phy->GetFrequency()); |
| 986 |
} |
986 |
} |
| 987 |
Time |
987 |
Time |
| 988 |
MacLow::GetBlockAckDuration (Mac48Address to, WifiTxVector blockAckReqTxVector, enum BlockAckType type) const |
988 |
MacLow::GetBlockAckDuration (Mac48Address to, WifiTxVector blockAckReqTxVector, enum BlockAckType type) const |
|
|
| 1000 |
preamble= WIFI_PREAMBLE_HT_MF; |
1000 |
preamble= WIFI_PREAMBLE_HT_MF; |
| 1001 |
else |
1001 |
else |
| 1002 |
preamble=WIFI_PREAMBLE_LONG; |
1002 |
preamble=WIFI_PREAMBLE_LONG; |
| 1003 |
return m_phy->CalculateTxDuration (GetBlockAckSize (type), blockAckReqTxVector, preamble); |
1003 |
return m_phy->CalculateTxDuration (GetBlockAckSize (type), blockAckReqTxVector, preamble, m_phy->GetFrequency()); |
| 1004 |
} |
1004 |
} |
| 1005 |
Time |
1005 |
Time |
| 1006 |
MacLow::GetCtsDuration (Mac48Address to, WifiTxVector rtsTxVector) const |
1006 |
MacLow::GetCtsDuration (Mac48Address to, WifiTxVector rtsTxVector) const |
|
|
| 1017 |
preamble= WIFI_PREAMBLE_HT_MF; |
1017 |
preamble= WIFI_PREAMBLE_HT_MF; |
| 1018 |
else |
1018 |
else |
| 1019 |
preamble=WIFI_PREAMBLE_LONG; |
1019 |
preamble=WIFI_PREAMBLE_LONG; |
| 1020 |
return m_phy->CalculateTxDuration (GetCtsSize (), ctsTxVector, preamble); |
1020 |
return m_phy->CalculateTxDuration (GetCtsSize (), ctsTxVector, preamble, m_phy->GetFrequency()); |
| 1021 |
} |
1021 |
} |
| 1022 |
uint32_t |
1022 |
uint32_t |
| 1023 |
MacLow::GetCtsSize (void) const |
1023 |
MacLow::GetCtsSize (void) const |
|
|
| 1105 |
{ |
1105 |
{ |
| 1106 |
preamble = WIFI_PREAMBLE_LONG; |
1106 |
preamble = WIFI_PREAMBLE_LONG; |
| 1107 |
} |
1107 |
} |
| 1108 |
txTime += m_phy->CalculateTxDuration (GetRtsSize (), rtsTxVector, preamble); |
1108 |
txTime += m_phy->CalculateTxDuration (GetRtsSize (), rtsTxVector, preamble, m_phy->GetFrequency()); |
| 1109 |
txTime += GetCtsDuration (hdr->GetAddr1 (), rtsTxVector); |
1109 |
txTime += GetCtsDuration (hdr->GetAddr1 (), rtsTxVector); |
| 1110 |
txTime += Time (GetSifs () * 2); |
1110 |
txTime += Time (GetSifs () * 2); |
| 1111 |
} |
1111 |
} |
|
|
| 1118 |
else |
1118 |
else |
| 1119 |
preamble=WIFI_PREAMBLE_LONG; |
1119 |
preamble=WIFI_PREAMBLE_LONG; |
| 1120 |
uint32_t dataSize = GetSize (packet, hdr); |
1120 |
uint32_t dataSize = GetSize (packet, hdr); |
| 1121 |
txTime += m_phy->CalculateTxDuration (dataSize, dataTxVector, preamble); |
1121 |
txTime += m_phy->CalculateTxDuration (dataSize, dataTxVector, preamble, m_phy->GetFrequency()); |
| 1122 |
if (params.MustWaitAck ()) |
1122 |
if (params.MustWaitAck ()) |
| 1123 |
{ |
1123 |
{ |
| 1124 |
txTime += GetSifs (); |
1124 |
txTime += GetSifs (); |
|
|
| 1145 |
else |
1145 |
else |
| 1146 |
preamble=WIFI_PREAMBLE_LONG; |
1146 |
preamble=WIFI_PREAMBLE_LONG; |
| 1147 |
txTime += GetSifs (); |
1147 |
txTime += GetSifs (); |
| 1148 |
txTime += m_phy->CalculateTxDuration (params.GetNextPacketSize (), dataTxVector, preamble); |
1148 |
txTime += m_phy->CalculateTxDuration (params.GetNextPacketSize (), dataTxVector, preamble, m_phy->GetFrequency()); |
| 1149 |
} |
1149 |
} |
| 1150 |
return txTime; |
1150 |
return txTime; |
| 1151 |
} |
1151 |
} |
|
|
| 1183 |
cts.SetType (WIFI_MAC_CTL_CTS); |
1183 |
cts.SetType (WIFI_MAC_CTL_CTS); |
| 1184 |
WifiTxVector txVector=GetRtsTxVector (packet, &hdr); |
1184 |
WifiTxVector txVector=GetRtsTxVector (packet, &hdr); |
| 1185 |
Time navCounterResetCtsMissedDelay = |
1185 |
Time navCounterResetCtsMissedDelay = |
| 1186 |
m_phy->CalculateTxDuration (cts.GetSerializedSize (), txVector, preamble) + |
1186 |
m_phy->CalculateTxDuration (cts.GetSerializedSize (), txVector, preamble, m_phy->GetFrequency()) + |
| 1187 |
Time (2 * GetSifs ()) + Time (2 * GetSlotTime ()); |
1187 |
Time (2 * GetSifs ()) + Time (2 * GetSlotTime ()); |
| 1188 |
m_navCounterResetCtsMissed = Simulator::Schedule (navCounterResetCtsMissedDelay, |
1188 |
m_navCounterResetCtsMissed = Simulator::Schedule (navCounterResetCtsMissedDelay, |
| 1189 |
&MacLow::NavCounterResetCtsMissed, this, |
1189 |
&MacLow::NavCounterResetCtsMissed, this, |
|
|
| 1385 |
duration += GetCtsDuration (m_currentHdr.GetAddr1 (), rtsTxVector); |
1385 |
duration += GetCtsDuration (m_currentHdr.GetAddr1 (), rtsTxVector); |
| 1386 |
duration += GetSifs (); |
1386 |
duration += GetSifs (); |
| 1387 |
duration += m_phy->CalculateTxDuration (GetSize (m_currentPacket, &m_currentHdr), |
1387 |
duration += m_phy->CalculateTxDuration (GetSize (m_currentPacket, &m_currentHdr), |
| 1388 |
dataTxVector, preamble); |
1388 |
dataTxVector, preamble, m_phy->GetFrequency()); |
| 1389 |
duration += GetSifs (); |
1389 |
duration += GetSifs (); |
| 1390 |
duration += GetAckDuration (m_currentHdr.GetAddr1 (), dataTxVector); |
1390 |
duration += GetAckDuration (m_currentHdr.GetAddr1 (), dataTxVector); |
| 1391 |
} |
1391 |
} |
| 1392 |
rts.SetDuration (duration); |
1392 |
rts.SetDuration (duration); |
| 1393 |
|
1393 |
|
| 1394 |
Time txDuration = m_phy->CalculateTxDuration (GetRtsSize (), rtsTxVector, preamble); |
1394 |
Time txDuration = m_phy->CalculateTxDuration (GetRtsSize (), rtsTxVector, preamble, m_phy->GetFrequency()); |
| 1395 |
Time timerDelay = txDuration + GetCtsTimeout (); |
1395 |
Time timerDelay = txDuration + GetCtsTimeout (); |
| 1396 |
|
1396 |
|
| 1397 |
NS_ASSERT (m_ctsTimeoutEvent.IsExpired ()); |
1397 |
NS_ASSERT (m_ctsTimeoutEvent.IsExpired ()); |
|
|
| 1419 |
else |
1419 |
else |
| 1420 |
preamble=WIFI_PREAMBLE_LONG; |
1420 |
preamble=WIFI_PREAMBLE_LONG; |
| 1421 |
|
1421 |
|
| 1422 |
Time txDuration = m_phy->CalculateTxDuration (GetSize (m_currentPacket, &m_currentHdr), dataTxVector, preamble); |
1422 |
Time txDuration = m_phy->CalculateTxDuration (GetSize (m_currentPacket, &m_currentHdr), dataTxVector, preamble, m_phy->GetFrequency()); |
| 1423 |
if (m_txParams.MustWaitNormalAck ()) |
1423 |
if (m_txParams.MustWaitNormalAck ()) |
| 1424 |
{ |
1424 |
{ |
| 1425 |
Time timerDelay = txDuration + GetAckTimeout (); |
1425 |
Time timerDelay = txDuration + GetAckTimeout (); |
|
|
| 1522 |
{ |
1522 |
{ |
| 1523 |
duration += GetSifs (); |
1523 |
duration += GetSifs (); |
| 1524 |
duration += m_phy->CalculateTxDuration (m_txParams.GetNextPacketSize (), |
1524 |
duration += m_phy->CalculateTxDuration (m_txParams.GetNextPacketSize (), |
| 1525 |
dataTxVector, preamble); |
1525 |
dataTxVector, preamble, m_phy->GetFrequency()); |
| 1526 |
if (m_txParams.MustWaitAck ()) |
1526 |
if (m_txParams.MustWaitAck ()) |
| 1527 |
{ |
1527 |
{ |
| 1528 |
duration += GetSifs (); |
1528 |
duration += GetSifs (); |
|
|
| 1582 |
WifiTxVector dataTxVector = GetDataTxVector (m_currentPacket, &m_currentHdr); |
1582 |
WifiTxVector dataTxVector = GetDataTxVector (m_currentPacket, &m_currentHdr); |
| 1583 |
duration += GetSifs (); |
1583 |
duration += GetSifs (); |
| 1584 |
duration += m_phy->CalculateTxDuration (GetSize (m_currentPacket,&m_currentHdr), |
1584 |
duration += m_phy->CalculateTxDuration (GetSize (m_currentPacket,&m_currentHdr), |
| 1585 |
dataTxVector, preamble); |
1585 |
dataTxVector, preamble, m_phy->GetFrequency()); |
| 1586 |
if (m_txParams.MustWaitBasicBlockAck ()) |
1586 |
if (m_txParams.MustWaitBasicBlockAck ()) |
| 1587 |
{ |
1587 |
{ |
| 1588 |
|
1588 |
|
|
|
| 1603 |
{ |
1603 |
{ |
| 1604 |
duration += GetSifs (); |
1604 |
duration += GetSifs (); |
| 1605 |
duration += m_phy->CalculateTxDuration (m_txParams.GetNextPacketSize (), |
1605 |
duration += m_phy->CalculateTxDuration (m_txParams.GetNextPacketSize (), |
| 1606 |
dataTxVector, preamble); |
1606 |
dataTxVector, preamble, m_phy->GetFrequency()); |
| 1607 |
if (m_txParams.MustWaitCompressedBlockAck ()) |
1607 |
if (m_txParams.MustWaitCompressedBlockAck ()) |
| 1608 |
{ |
1608 |
{ |
| 1609 |
duration += GetSifs (); |
1609 |
duration += GetSifs (); |
|
|
| 1626 |
|
1626 |
|
| 1627 |
ForwardDown (packet, &cts, ctsTxVector,preamble); |
1627 |
ForwardDown (packet, &cts, ctsTxVector,preamble); |
| 1628 |
|
1628 |
|
| 1629 |
Time txDuration = m_phy->CalculateTxDuration (GetCtsSize (), ctsTxVector, preamble); |
1629 |
Time txDuration = m_phy->CalculateTxDuration (GetCtsSize (), ctsTxVector, preamble, m_phy->GetFrequency()); |
| 1630 |
txDuration += GetSifs (); |
1630 |
txDuration += GetSifs (); |
| 1631 |
NS_ASSERT (m_sendDataEvent.IsExpired ()); |
1631 |
NS_ASSERT (m_sendDataEvent.IsExpired ()); |
| 1632 |
|
1632 |
|
|
|
| 1697 |
newDuration += GetSifs (); |
1697 |
newDuration += GetSifs (); |
| 1698 |
newDuration += GetAckDuration (m_currentHdr.GetAddr1 (), dataTxVector); |
1698 |
newDuration += GetAckDuration (m_currentHdr.GetAddr1 (), dataTxVector); |
| 1699 |
Time txDuration = m_phy->CalculateTxDuration (GetSize (m_currentPacket, &m_currentHdr), |
1699 |
Time txDuration = m_phy->CalculateTxDuration (GetSize (m_currentPacket, &m_currentHdr), |
| 1700 |
dataTxVector, preamble); |
1700 |
dataTxVector, preamble, m_phy->GetFrequency()); |
| 1701 |
duration -= txDuration; |
1701 |
duration -= txDuration; |
| 1702 |
duration -= GetSifs (); |
1702 |
duration -= GetSifs (); |
| 1703 |
|
1703 |
|