A Discrete-Event Network Simulator
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
15namespace ns3
16{
17namespace 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 */
35{
36 public:
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 */
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
an EUI-48 address
A base class which provides memory management and object aggregation.
Definition object.h:78
Smart pointer class similar to boost::intrusive_ptr.
a unique identifier for an interface.
Definition type-id.h:48
Implements the IEEE 802.11 MAC header.
Every class exported by the ns3 library is enclosed in the ns3 namespace.