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
* This program is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License version 2 as
6
* published by the Free Software Foundation;
7
*
8
* This program is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
* GNU General Public License for more details.
12
*
13
* You should have received a copy of the GNU General Public License
14
* along with this program; if not, write to the Free Software
15
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16
*
17
* Authors: Kirill Andreev <andreev@iitp.ru>
18
*/
19
20
#ifndef AIRTIME_METRIC_H
21
#define AIRTIME_METRIC_H
22
23
#include "ns3/mesh-wifi-interface-mac.h"
24
#include "ns3/wifi-mac-header.h"
25
26
namespace
ns3
27
{
28
namespace
dot11s
29
{
30
/**
31
* \ingroup dot11s
32
*
33
* \brief Airtime link metric calculator
34
*
35
* Airtime link metric is defined in 11B.10 of 802.11s Draft D3.0 as:
36
*
37
* airtime = (O + Bt/r)* (1 + average retry counter), where:
38
* - o -- the PHY dependent channel access which includes frame headers, training sequences,
39
* access protocol frames, etc.
40
* - bt -- the test packet length in bits (8192 by default),
41
* - r -- the current bitrate of the packet,
42
*
43
* Final result is expressed in units of 0.01 Time Unit = 10.24 us (as required by 802.11s draft)
44
*/
45
class
AirtimeLinkMetricCalculator
:
public
Object
46
{
47
public
:
48
AirtimeLinkMetricCalculator
();
49
/**
50
* \brief Get the type ID.
51
* \return the object TypeId
52
*/
53
static
TypeId
GetTypeId
();
54
/**
55
* Airtime link metric is defined in Section 13.9 of IEEE 802.11-2012 as:
56
*
57
* airtime = (O + Bt/r) / (1 - frame error rate), where
58
* o -- the PHY dependent channel access which includes frame headers, training sequences,
59
* access protocol frames, etc.
60
* bt -- the test packet length in bits (8192 by default),
61
* r -- the current bitrate of the packet,
62
*
63
* Final result is expressed encoded as an unsigned integer in units of
64
* 0.01 TU = 10.24 us
65
*
66
* \param peerAddress The peer MAC address
67
* \param mac The MAC layer
68
* \returns the calculated metric in units of 0.01 TU
69
*/
70
uint32_t
CalculateMetric
(
Mac48Address
peerAddress,
Ptr<MeshWifiInterfaceMac>
mac);
71
72
private
:
73
/**
74
* Set number of bytes in test frame (a constant 1024 in the standard)
75
* \param testLength the test length in bits
76
*/
77
void
SetTestLength
(uint16_t testLength);
78
/**
79
* Set header TID from the Dot11MetricTid attribute
80
* \param tid the header TID to use to calculate data rate
81
*/
82
void
SetHeaderTid
(uint8_t tid);
83
84
Ptr<Packet>
m_testFrame
;
///< test frame
85
WifiMacHeader
m_testHeader
;
///< test header
86
};
87
}
// namespace dot11s
88
}
// namespace ns3
89
#endif
ns3::Mac48Address
an EUI-48 address
Definition:
mac48-address.h:46
ns3::Object
A base class which provides memory management and object aggregation.
Definition:
object.h:89
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition:
ptr.h:77
ns3::TypeId
a unique identifier for an interface.
Definition:
type-id.h:59
ns3::WifiMacHeader
Implements the IEEE 802.11 MAC header.
Definition:
wifi-mac-header.h:98
ns3::dot11s::AirtimeLinkMetricCalculator
Airtime link metric calculator.
Definition:
airtime-metric.h:46
ns3::dot11s::AirtimeLinkMetricCalculator::m_testFrame
Ptr< Packet > m_testFrame
test frame
Definition:
airtime-metric.h:84
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:71
ns3::dot11s::AirtimeLinkMetricCalculator::SetHeaderTid
void SetHeaderTid(uint8_t tid)
Set header TID from the Dot11MetricTid attribute.
Definition:
airtime-metric.cc:56
ns3::dot11s::AirtimeLinkMetricCalculator::m_testHeader
WifiMacHeader m_testHeader
test header
Definition:
airtime-metric.h:85
ns3::dot11s::AirtimeLinkMetricCalculator::AirtimeLinkMetricCalculator
AirtimeLinkMetricCalculator()
Definition:
airtime-metric.cc:51
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:65
ns3::dot11s::AirtimeLinkMetricCalculator::GetTypeId
static TypeId GetTypeId()
Get the type ID.
Definition:
airtime-metric.cc:31
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 Tue May 28 2024 23:38:04 for ns-3 by
1.9.6