A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
gcr-manager.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2023 DERONNE SOFTWARE ENGINEERING
3 *
4 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 * Author: Sébastien Deronne <sebastien.deronne@gmail.com>
7 */
8
9#ifndef GCR_MANAGER_H
10#define GCR_MANAGER_H
11
12#include "qos-utils.h"
13
14#include "ns3/mac48-address.h"
15#include "ns3/object.h"
16
17#include <set>
18#include <unordered_set>
19
20namespace ns3
21{
22
23class ApWifiMac;
24class WifiMpdu;
25
26/**
27 * @brief The possible values for group address retransmission policy
28 */
35
36/// Groupcast protection mode enumeration
42
43/**
44 * @ingroup wifi
45 *
46 * GcrManager is a base class defining the API to handle 802.11aa GCR.
47 */
48class GcrManager : public Object
49{
50 public:
51 /**
52 * @brief Get the type ID.
53 * @return the object TypeId
54 */
55 static TypeId GetTypeId();
56
57 GcrManager();
58 ~GcrManager() override;
59
60 /**
61 * Set the wifi MAC. Note that it must be the MAC of a QoS AP.
62 *
63 * @param mac the wifi MAC
64 */
65 void SetWifiMac(Ptr<ApWifiMac> mac);
66
67 /**
68 * Get the configured retransmission policy.
69 *
70 * @return the configured retransmission policy
71 */
73
74 /**
75 * Get the retransmission policy to use to transmit a given group addressed packet.
76 *
77 * @param header the header of the groupcast frame
78 * @return the retransmission policy to use
79 */
81
82 /**
83 * Set the GCR concealment address.
84 *
85 * @param address the GCR concealment address
86 */
87 void SetGcrConcealmentAddress(const Mac48Address& address);
88
89 /**
90 * Get the GCR concealment address.
91 *
92 * @return the GCR concealment address
93 */
95
96 /**
97 * Indicate whether a group addressed packet should be transmitted to the GCR concealment
98 * address.
99 *
100 * @param header the header of the groupcast packet
101 * @return whether GCR concealment should be used
102 */
103 bool UseConcealment(const WifiMacHeader& header) const;
104
105 /**
106 * This function indicates whether a groupcast MPDU should be kept for next retransmission.
107 *
108 * @param mpdu the groupcast MPDU
109 * @return whether a groupcast MPDU should be kept for next retransmission
110 */
112
113 /**
114 * This function notifies a STA is associated.
115 *
116 * @param staAddress the MAC address of the STA
117 * @param isGcrCapable whether GCR is supported by the STA
118 */
119 void NotifyStaAssociated(const Mac48Address& staAddress, bool isGcrCapable);
120
121 /**
122 * This function deletes a STA as a member of any group addresses.
123 *
124 * @param staAddress the MAC address of the STA
125 */
126 void NotifyStaDeassociated(const Mac48Address& staAddress);
127
128 /**
129 * This function adds a STA as a member of zero or more group addresses.
130 *
131 * @param staAddress the MAC address of the STA
132 * @param groupAddressList zero or more MAC addresses to indicate the set of group addressed MAC
133 * addresses for which the STA receives frames
134 */
135 void NotifyGroupMembershipChanged(const Mac48Address& staAddress,
136 const std::set<Mac48Address>& groupAddressList);
137
138 /// MAC addresses of member STAs of a GCR group
139 using GcrMembers = std::unordered_set<Mac48Address, WifiAddressHash>;
140
141 /**
142 * Get the list of MAC addresses of member STAs for a given group address.
143 * @param groupAddress the group address
144 * @return list of MAC addresses of member STAs for the group address
145 */
146 const GcrMembers& GetMemberStasForGroupAddress(const Mac48Address& groupAddress) const;
147
148 /**
149 * Get the MAC address of the individually addressed recipient to use for a groupcast frame
150 * or for a protection frame sent prior to groupcast frames for a given group address.
151 * @param groupAddress the group address
152 * @return the MAC address of the individually addressed recipient to use.
153 */
155 const Mac48Address& groupAddress) const = 0;
156
157 protected:
158 void DoDispose() override;
159
160 /// List of associated STAs that are not GCR capable
162
163 Ptr<ApWifiMac> m_apMac; //!< the MAC of the AP
165 uint8_t m_gcrUnsolicitedRetryLimit; //!< GCR Unsolicited Retry Limit
166 uint8_t m_unsolicitedRetryCounter; //!< the unsolicited retry counter
167 Ptr<WifiMpdu> m_mpdu; //!< current MPDU being retransmitted
168 NonGcrStas m_nonGcrStas; //!< the list of non-GCR capable STAs
169 GcrMembers m_staMembers; //!< the list of STA members (assume currently each member is part of
170 //!< all group)
171 GroupcastProtectionMode m_gcrProtectionMode; //!< Protection mode for groupcast frames
172 Mac48Address m_gcrConcealmentAddress; //!< GCR concealment address
173};
174
175} // namespace ns3
176
177#endif /* GCR_MANAGER_H */
GcrManager is a base class defining the API to handle 802.11aa GCR.
Definition gcr-manager.h:49
Mac48Address m_gcrConcealmentAddress
GCR concealment address.
const GcrMembers & GetMemberStasForGroupAddress(const Mac48Address &groupAddress) const
Get the list of MAC addresses of member STAs for a given group address.
NonGcrStas m_nonGcrStas
the list of non-GCR capable STAs
void SetGcrConcealmentAddress(const Mac48Address &address)
Set the GCR concealment address.
void NotifyStaAssociated(const Mac48Address &staAddress, bool isGcrCapable)
This function notifies a STA is associated.
GcrMembers m_staMembers
the list of STA members (assume currently each member is part of all group)
void DoDispose() override
Destructor implementation.
Ptr< ApWifiMac > m_apMac
the MAC of the AP
static TypeId GetTypeId()
Get the type ID.
Ptr< WifiMpdu > m_mpdu
current MPDU being retransmitted
uint8_t m_unsolicitedRetryCounter
the unsolicited retry counter
void NotifyGroupMembershipChanged(const Mac48Address &staAddress, const std::set< Mac48Address > &groupAddressList)
This function adds a STA as a member of zero or more group addresses.
GroupAddressRetransmissionPolicy m_retransmissionPolicy
retransmission policy
virtual Mac48Address GetIndividuallyAddressedRecipient(const Mac48Address &groupAddress) const =0
Get the MAC address of the individually addressed recipient to use for a groupcast frame or for a pro...
void NotifyStaDeassociated(const Mac48Address &staAddress)
This function deletes a STA as a member of any group addresses.
std::unordered_set< Mac48Address, WifiAddressHash > GcrMembers
MAC addresses of member STAs of a GCR group.
const Mac48Address & GetGcrConcealmentAddress() const
Get the GCR concealment address.
uint8_t m_gcrUnsolicitedRetryLimit
GCR Unsolicited Retry Limit.
GcrMembers NonGcrStas
List of associated STAs that are not GCR capable.
GroupAddressRetransmissionPolicy GetRetransmissionPolicyFor(const WifiMacHeader &header) const
Get the retransmission policy to use to transmit a given group addressed packet.
GroupcastProtectionMode m_gcrProtectionMode
Protection mode for groupcast frames.
~GcrManager() override
bool UseConcealment(const WifiMacHeader &header) const
Indicate whether a group addressed packet should be transmitted to the GCR concealment address.
bool KeepGroupcastQueued(Ptr< WifiMpdu > mpdu)
This function indicates whether a groupcast MPDU should be kept for next retransmission.
GroupAddressRetransmissionPolicy GetRetransmissionPolicy() const
Get the configured retransmission policy.
void SetWifiMac(Ptr< ApWifiMac > mac)
Set the wifi MAC.
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:49
Implements the IEEE 802.11 MAC header.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
GroupcastProtectionMode
Groupcast protection mode enumeration.
Definition gcr-manager.h:38
@ CTS_TO_SELF
Definition gcr-manager.h:40
@ RTS_CTS
Definition gcr-manager.h:39
GroupAddressRetransmissionPolicy
The possible values for group address retransmission policy.
Definition gcr-manager.h:30