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 * 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
26namespace ns3
27{
28namespace 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 */
46{
47 public:
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 */
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
an EUI-48 address
Definition: mac48-address.h:46
A base class which provides memory management and object aggregation.
Definition: object.h:89
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:77
a unique identifier for an interface.
Definition: type-id.h:59
Implements the IEEE 802.11 MAC header.
Every class exported by the ns3 library is enclosed in the ns3 namespace.