A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
Loading...
Searching...
No Matches
airtime-metric.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2009 IITP RAS
3
*
4
* SPDX-License-Identifier: GPL-2.0-only
5
*
6
* Authors: Kirill Andreev <andreev@iitp.ru>
7
*/
8
9
#ifndef AIRTIME_METRIC_H
10
#define AIRTIME_METRIC_H
11
12
#include "ns3/mesh-wifi-interface-mac.h"
13
#include "ns3/wifi-mac-header.h"
14
15
namespace
ns3
16
{
17
namespace
dot11s
18
{
19
/**
20
* \ingroup dot11s
21
*
22
* \brief Airtime link metric calculator
23
*
24
* Airtime link metric is defined in 11B.10 of 802.11s Draft D3.0 as:
25
*
26
* airtime = (O + Bt/r)* (1 + average retry counter), where:
27
* - o -- the PHY dependent channel access which includes frame headers, training sequences,
28
* access protocol frames, etc.
29
* - bt -- the test packet length in bits (8192 by default),
30
* - r -- the current bitrate of the packet,
31
*
32
* Final result is expressed in units of 0.01 Time Unit = 10.24 us (as required by 802.11s draft)
33
*/
34
class
AirtimeLinkMetricCalculator
:
public
Object
35
{
36
public
:
37
AirtimeLinkMetricCalculator
();
38
/**
39
* \brief Get the type ID.
40
* \return the object TypeId
41
*/
42
static
TypeId
GetTypeId
();
43
/**
44
* Airtime link metric is defined in Section 13.9 of IEEE 802.11-2012 as:
45
*
46
* airtime = (O + Bt/r) / (1 - frame error rate), where
47
* o -- the PHY dependent channel access which includes frame headers, training sequences,
48
* access protocol frames, etc.
49
* bt -- the test packet length in bits (8192 by default),
50
* r -- the current bitrate of the packet,
51
*
52
* Final result is expressed encoded as an unsigned integer in units of
53
* 0.01 TU = 10.24 us
54
*
55
* \param peerAddress The peer MAC address
56
* \param mac The MAC layer
57
* \returns the calculated metric in units of 0.01 TU
58
*/
59
uint32_t
CalculateMetric
(
Mac48Address
peerAddress,
Ptr<MeshWifiInterfaceMac>
mac);
60
61
private
:
62
/**
63
* Set number of bytes in test frame (a constant 1024 in the standard)
64
* \param testLength the test length in bits
65
*/
66
void
SetTestLength
(uint16_t testLength);
67
/**
68
* Set header TID from the Dot11MetricTid attribute
69
* \param tid the header TID to use to calculate data rate
70
*/
71
void
SetHeaderTid
(uint8_t tid);
72
73
Ptr<Packet>
m_testFrame
;
///< test frame
74
WifiMacHeader
m_testHeader
;
///< test header
75
};
76
}
// namespace dot11s
77
}
// namespace ns3
78
#endif
ns3::Mac48Address
an EUI-48 address
Definition
mac48-address.h:35
ns3::Object
A base class which provides memory management and object aggregation.
Definition
object.h:78
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition
mpi-test-fixtures.h:37
ns3::TypeId
a unique identifier for an interface.
Definition
type-id.h:48
ns3::WifiMacHeader
Implements the IEEE 802.11 MAC header.
Definition
wifi-mac-header.h:87
ns3::dot11s::AirtimeLinkMetricCalculator
Airtime link metric calculator.
Definition
airtime-metric.h:35
ns3::dot11s::AirtimeLinkMetricCalculator::m_testFrame
Ptr< Packet > m_testFrame
test frame
Definition
airtime-metric.h:73
ns3::dot11s::AirtimeLinkMetricCalculator::CalculateMetric
uint32_t CalculateMetric(Mac48Address peerAddress, Ptr< MeshWifiInterfaceMac > mac)
Airtime link metric is defined in Section 13.9 of IEEE 802.11-2012 as:
Definition
airtime-metric.cc:60
ns3::dot11s::AirtimeLinkMetricCalculator::SetHeaderTid
void SetHeaderTid(uint8_t tid)
Set header TID from the Dot11MetricTid attribute.
Definition
airtime-metric.cc:45
ns3::dot11s::AirtimeLinkMetricCalculator::m_testHeader
WifiMacHeader m_testHeader
test header
Definition
airtime-metric.h:74
ns3::dot11s::AirtimeLinkMetricCalculator::AirtimeLinkMetricCalculator
AirtimeLinkMetricCalculator()
Definition
airtime-metric.cc:40
ns3::dot11s::AirtimeLinkMetricCalculator::SetTestLength
void SetTestLength(uint16_t testLength)
Set number of bytes in test frame (a constant 1024 in the standard)
Definition
airtime-metric.cc:54
ns3::dot11s::AirtimeLinkMetricCalculator::GetTypeId
static TypeId GetTypeId()
Get the type ID.
Definition
airtime-metric.cc:20
uint32_t
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
src
mesh
model
dot11s
airtime-metric.h
Generated on Fri Nov 8 2024 13:59:04 for ns-3 by
1.11.0