A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
wifi-mac-queue-elem.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2022 Universita' degli Studi di Napoli Federico II
3 *
4 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 * Author: Stefano Avallone <stavallo@unina.it>
7 */
8
9#ifndef WIFI_MAC_QUEUE_ELEM_H
10#define WIFI_MAC_QUEUE_ELEM_H
11
12#include "qos-utils.h"
13
14#include "ns3/callback.h"
15#include "ns3/nstime.h"
16#include "ns3/wifi-export.h"
17
18#include <map>
19
20namespace ns3
21{
22
23class WifiMpdu;
24
25/**
26 * @ingroup wifi
27 * Type of elements stored in a WifiMacQueue container.
28 *
29 * Such elements can be accessed by the WifiMacQueue (via iterators) and
30 * by the WifiMpdu itself (via the iterator it stores).
31 *
32 * Data frames transmitted by an 11be MLD must include link addresses as (RA, TA)
33 * which are different than the MLD addresses seen by the upper layer. In order
34 * to keep the original version of the data frame, we create an alias when a data
35 * frame is sent over a link. Aliases are stored in the map of in-flight MPDUs, which
36 * is indexed by the ID of the link over which the alias is in-flight.
37 * For consistency, also data frame transmitted by non-MLDs have an alias, which is
38 * simply a pointer to the original version of the data frame.
39 */
40struct WIFI_EXPORT WifiMacQueueElem
41{
42 Ptr<WifiMpdu> mpdu; ///< MPDU stored by this element
43 Time expiryTime{0}; ///< expiry time of the MPDU (set by WifiMacQueue)
44 AcIndex ac{AC_UNDEF}; ///< the Access Category associated with the queue
45 ///< storing this element (set by WifiMacQueue)
46 bool expired{false}; ///< whether this MPDU has been marked as expired
47 std::map<uint8_t, Ptr<WifiMpdu>> inflights; ///< map of MPDUs in-flight on each link
48 Callback<void, Ptr<WifiMpdu>> deleter; ///< reset the iterator stored by the MPDU
49
50 /**
51 * Constructor.
52 * @param item the MPDU stored by this queue element
53 */
55
57};
58
59} // namespace ns3
60
61#endif /* WIFI_MAC_QUEUE_ELEM_H */
Callback template class.
Definition callback.h:428
Smart pointer class similar to boost::intrusive_ptr.
Definition ptr.h:70
Simulation virtual time values and global simulation resolution.
Definition nstime.h:95
WifiMpdu stores a (const) packet along with a MAC header.
Definition wifi-mpdu.h:52
AcIndex
This enumeration defines the Access Categories as an enumeration with values corresponding to the AC ...
Definition qos-utils.h:64
@ AC_UNDEF
Total number of ACs.
Definition qos-utils.h:78
Every class exported by the ns3 library is enclosed in the ns3 namespace.
bool expired
whether this MPDU has been marked as expired
Ptr< WifiMpdu > mpdu
MPDU stored by this element.
WifiMacQueueElem(Ptr< WifiMpdu > item)
Constructor.
Callback< void, Ptr< WifiMpdu > > deleter
reset the iterator stored by the MPDU
AcIndex ac
the Access Category associated with the queue storing this element (set by WifiMacQueue)
std::map< uint8_t, Ptr< WifiMpdu > > inflights
map of MPDUs in-flight on each link
Time expiryTime
expiry time of the MPDU (set by WifiMacQueue)