45 const std::uint8_t RTS_BIT_LENGTH_DEFAULT {160};
46 const std::uint8_t RTS_BIT_LENGTH_80211A {160};
47 const std::uint8_t RTS_BIT_LENGTH_80211B {160};
48 const std::uint8_t RTS_BIT_LENGTH_80211BG {160};
50 const std::uint8_t CTS_BIT_LENGTH_DEFAULT {112};
51 const std::uint8_t CTS_BIT_LENGTH_80211A {112};
52 const std::uint8_t CTS_BIT_LENGTH_80211B {112};
53 const std::uint8_t CTS_BIT_LENGTH_80211BG {112};
55 const std::uint8_t ACK_BIT_LENGTH_DEFAULT {112};
56 const std::uint8_t ACK_BIT_LENGTH_80211A {112};
57 const std::uint8_t ACK_BIT_LENGTH_80211B {112};
58 const std::uint8_t ACK_BIT_LENGTH_80211BG {112};
76 const std::uint16_t IEEE_80211MAC_DATAHEADER_BITLEN {272};
77 const std::uint16_t IEEE_80211MAC_CTRLHEADER_BITLEN {160};
79 const float SLOT_TIME_DISTANCE_DIVISOR_SEC_F {299792458.0f};
142 std::uint16_t EMANE::Models::IEEE80211ABG::ModeTimingParameters::getRtsBitLength(
MODULATION_TYPE mode)
const 171 EMANE::Models::IEEE80211ABG::ModeTimingParameters::getCtsBitLength(
MODULATION_TYPE mode)
const 200 EMANE::Models::IEEE80211ABG::ModeTimingParameters::getAckBitLength(
MODULATION_TYPE mode)
const 260 EMANE::Models::IEEE80211ABG::ModeTimingParameters::getSifsMicroseconds(
MODULATION_TYPE mode)
const 289 EMANE::Models::IEEE80211ABG::ModeTimingParameters::getPreambleMicroseconds(
MODULATION_TYPE mode)
const 318 EMANE::Models::IEEE80211ABG::ModeTimingParameters::getPropagationMicroseconds(std::uint32_t dist)
const 340 getSifsMicroseconds(mode).count()};
363 return std::chrono::duration_cast<
Microseconds>(doubleSeconds);
385 if(txOpMicroseconds.count() != 0)
388 return(rxTime + txOpMicroseconds) < Clock::now();
414 return getCtsMessageDurationMicroseconds();
418 return getUnicastMessageDurationMicroseconds(numBytes);
422 return getUnicastMessageDurationMicroseconds(numBytes) +
423 getRtsMessageDurationMicroseconds() +
424 getCtsMessageDurationMicroseconds();
428 return getBroadcastMessageDurationMicroseconds(numBytes);
431 return Microseconds::zero();
437 EMANE::Models::IEEE80211ABG::ModeTimingParameters::getBroadcastMessageDurationMicroseconds(
size_t numBytes)
const 441 DoubleSeconds doubleSeconds{(getPreambleMicroseconds(mode).count() +
442 ((IEEE_80211MAC_DATAHEADER_BITLEN + (numBytes * 8)) /
445 return std::chrono::duration_cast<
Microseconds>(doubleSeconds);
451 EMANE::Models::IEEE80211ABG::ModeTimingParameters::getUnicastMessageDurationMicroseconds(
size_t numBytes)
const 455 DoubleSeconds doubleSeconds{(getSifsMicroseconds(mode).count() + (2 * getPreambleMicroseconds(mode).count()) +
456 ((IEEE_80211MAC_DATAHEADER_BITLEN + getAckBitLength(mode) + (numBytes * 8)) /
459 return std::chrono::duration_cast<
Microseconds>(doubleSeconds);
465 EMANE::Models::IEEE80211ABG::ModeTimingParameters::getCtsMessageDurationMicroseconds()
const 469 DoubleSeconds doubleSeconds{(getPreambleMicroseconds(mode).count() +
472 return std::chrono::duration_cast<
Microseconds>(doubleSeconds);
478 EMANE::Models::IEEE80211ABG::ModeTimingParameters::getRtsMessageDurationMicroseconds()
const 482 DoubleSeconds doubleSeconds{(getPreambleMicroseconds(mode).count() +
485 return std::chrono::duration_cast<
Microseconds>(doubleSeconds);
504 const int min{macConfig_.
getCWMin(u8Category)};
505 const int max{macConfig_.
getCWMax(u8Category)};
507 int cw{min *
static_cast<int>(powf(2.0f, tries))};
const std::uint8_t MSG_TYPE_UNICAST_CTS_CTRL
class used to define the mac layer configuration items
std::uint32_t getBroadcastDataRateKbps() const
get the broadcast datarate
~ModeTimingParameters()
destructor
int getContentionWindow(std::uint8_t, std::uint8_t) const
get the contention window
bool packetTimedOut(const Microseconds &txOpMicroseconds, const TimePoint &) const
check if a packet has timed out
Microseconds getAifsMicroseconds(std::uint8_t) const
get the aifs for a given queue index
ModeTimingParameters(const MACConfig &macConfig)
constructor
std::uint16_t getCWMin(std::uint8_t) const
get the min contention window size for a given queue index
Microseconds getOverheadMicroseconds(std::uint8_t u8Category) const
get the overhead time
const std::uint8_t MSG_TYPE_BROADCAST_DATA
std::uint32_t getUnicastDataRateKbps() const
get the unicast datarate
std::chrono::microseconds Microseconds
std::chrono::duration< double > DoubleSeconds
const float USEC_PER_SEC_F
const std::uint8_t MSG_TYPE_UNICAST_DATA
MODULATION_TYPE getModulationType() const
get the modulation type
Microseconds getSlotSizeMicroseconds() const
get the slot duration for a given mode and distance
Clock::time_point TimePoint
std::uint16_t getCWMax(std::uint8_t) const
get the max contention window size for a given queue index
Microseconds getDeferIntervalMicroseconds(std::uint8_t) const
get the defer time
Microseconds getMessageDurationMicroseconds(std::uint8_t, size_t) const
get the message duration
std::uint32_t getMaxP2pDistance() const
get the max ptp distance
const std::uint8_t MSG_TYPE_UNICAST_RTS_CTS_DATA