A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
wifi-static-setup-helper.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2025
3 *
4 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 * Author: Sharan Naribole <sharan.naribole@gmail.com>
7 */
8
9#ifndef WIFI_STATIC_SETUP_HELPER_H
10#define WIFI_STATIC_SETUP_HELPER_H
11
12#include "ns3/mac48-address.h"
13#include "ns3/wifi-utils.h"
14
15#include <optional>
16#include <set>
17
18namespace ns3
19{
20
21class ApWifiMac;
25class WifiNetDevice;
26class StaWifiMac;
27class WifiMacHeader;
28
29/**
30 * Helper to statically setup wifi devices without actually exchanging management frames over the
31 * air:
32 *
33 * - association/ML setup (note that scanning is disabled for this purpose)
34 * - block ack agreement(s)
35 * - enabling EMLSR mode on EMLSR client links
36 */
38{
39 public:
40 /// Bypass static capabilities exchange for input devices
41 /// @param bssDev BSS advertising device (AP)
42 /// @param clientDevs client devices
44 const NetDeviceContainer& clientDevs);
45
46 /// Bypass static capabilities exchange for input devices
47 /// @param bssDev BSS advertising device (AP)
48 /// @param clientDev client device
49 static void SetStaticAssociation(Ptr<WifiNetDevice> bssDev, Ptr<WifiNetDevice> clientDev);
50
51 /// Perform static Association Request/Response exchange for input devices post initialization
52 /// at runtime begin
53 /// @param bssDev BSS advertising device (AP)
54 /// @param clientDev client device
56
57 /// Perform static Association Request/Response exchange for input devices post initialization
58 /// at runtime begin
59 /// @param apMac AP MAC
60 /// @param clientMac client MAC
61 static void SetStaticAssocPostInit(Ptr<ApWifiMac> apMac, Ptr<StaWifiMac> clientMac);
62
63 /// Construct non-AP MLD link ID to AP MLD link ID mapping based on PHY channel settings.
64 /// It is required that for each STA affiliated with the non-AP MLD there exists an AP
65 /// affiliated with the AP MLD that operates on a channel having the same primary20 as the
66 /// channel on which the STA operates.
67 /// @param apDev AP NetDevice
68 /// @param clientDev STA NetDevice
69 /// @return link ID mapping
70 static std::map<linkId_t, linkId_t> GetLinkIdMap(Ptr<WifiNetDevice> apDev,
71 Ptr<WifiNetDevice> clientDev);
72
73 /// Construct non-AP MLD link ID to AP MLD link ID mapping based on PHY channel settings
74 /// It is required that for each STA affiliated with the non-AP MLD there exists an AP
75 /// affiliated with the AP MLD that operates on a channel having the same primary20 as the
76 /// channel on which the STA operates.
77 /// @param apMac AP MAC
78 /// @param staMac STA MAC
79 /// @return link ID mapping
80 static std::map<linkId_t, linkId_t> GetLinkIdMap(Ptr<ApWifiMac> apMac, Ptr<StaWifiMac> staMac);
81
82 /// Get Association Request for input STA link address
83 /// @param staMac STA MAC
84 /// @param staLinkId ID of link used for Assoc request
85 /// @param isMldAssoc true if MLD association, false otherwise
86 /// @return association request
88 linkId_t staLinkId,
89 bool isMldAssoc);
90
91 /// Get Association Response for input STA link address from
92 /// AP MAC including Multi-link Element if MLD Association
93 /// @param staLinkAddr STA link MAC address
94 /// @param apMac AP MAC
95 /// @param apLinkId ID of link used for Assoc response
96 /// @param isMldAssoc true if MLD association, false otherwise
97 /// @return association response
99 Ptr<ApWifiMac> apMac,
100 linkId_t apLinkId,
101 bool isMldAssoc);
102
103 /// Get Association Response MAC Header for input STA link address from
104 /// AP MAC including Multi-link Element if MLD Association
105 /// @param staLinkAddr STA link MAC address
106 /// @param apMac AP MAC
107 /// @param apLinkId Link ID of link used for Assoc response
108 /// @return MAC header
110 Ptr<ApWifiMac> apMac,
111 linkId_t apLinkId);
112
113 /// Align the knowledge that the AP has about the PM mode of the STAs affiliated with the
114 /// client device to their actual PM modes.
115 /// @param apMac the AP MAC
116 /// @param clientMac the client MAC
117 static void AlignApViewOfStaPmMode(Ptr<ApWifiMac> apMac, Ptr<StaWifiMac> clientMac);
118
119 /// Bypass ADDBA Request-Response exchange sequence between AP and STAs for given TIDs.
120 /// Static setup will be performed in both uplink and downlink.
121 /// @param apDev AP device
122 /// @param clientDevs STA devices
123 /// @param tids the set of TIDs corresponding to Block ACK agreements
124 /// @param gcrGroupAddr MAC address of the GCR group (GCR Group Address)
125 static void SetStaticBlockAck(Ptr<WifiNetDevice> apDev,
126 const NetDeviceContainer& clientDevs,
127 const std::set<tid_t>& tids,
128 std::optional<Mac48Address> gcrGroupAddr = std::nullopt);
129
130 /// Bypass ADDBA Request-Response exchange sequence between input devices for given TID.
131 /// @param originatorDev originator device of Block ACK agreement
132 /// @param recipientDev recipient device of Block ACK agreement
133 /// @param tid TID corresponding to Block ACK agreement
134 /// @param gcrGroupAddr MAC address of the GCR group (GCR Group Address)
135 static void SetStaticBlockAck(Ptr<WifiNetDevice> originatorDev,
136 Ptr<WifiNetDevice> recipientDev,
137 tid_t tid,
138 std::optional<Mac48Address> gcrGroupAddr = std::nullopt);
139
140 /// Perform ADDBA Request-Response exchange sequence between input devices for given TID
141 /// post initialization at runtime begin
142 /// @param originatorDev originator device of Block ACK agreement
143 /// @param recipientDev recipient device of Block ACK agreement
144 /// @param tid TID corresponding to Block ACK agreement
145 /// @param gcrGroupAddr MAC address of the GCR group (GCR Group Address)
146 static void SetStaticBlockAckPostInit(Ptr<WifiNetDevice> originatorDev,
147 Ptr<WifiNetDevice> recipientDev,
148 tid_t tid,
149 std::optional<Mac48Address> gcrGroupAddr = std::nullopt);
150
151 /// Get Block ACK originator address based on devices MAC config
152 /// @param originatorMac originator MAC
153 /// @param recipientMac recipient MAC
154 /// @return the Block Ack originator address
155 static Mac48Address GetBaOriginatorAddr(Ptr<WifiMac> originatorMac, Ptr<WifiMac> recipientMac);
156
157 /// Get Block ACK recipient address based on devices MAC config
158 /// @param originatorMac originator MAC
159 /// @param recipientMac recipient MAC
160 /// @return the Block Ack recipient address
161 static Mac48Address GetBaRecipientAddr(Ptr<WifiMac> originatorMac, Ptr<WifiMac> recipientMac);
162
163 /// Bypass EML Operating Mode Notification exchange sequence between AP MLD
164 /// and input non-AP devices
165 /// @param apDev AP MLD
166 /// @param clientDevs Non-AP devices
167 static void SetStaticEmlsr(Ptr<WifiNetDevice> apDev, const NetDeviceContainer& clientDevs);
168
169 /// Bypass EML Operating Mode Notification exchange sequence between AP MLD and non-AP MLD
170 /// to enable EMLSR mode on the links specified via the EmlsrManager::EmlsrLinkSet attribute
171 /// @param apDev AP MLD
172 /// @param clientDev Non-AP MLD
173 static void SetStaticEmlsr(Ptr<WifiNetDevice> apDev, Ptr<WifiNetDevice> clientDev);
174
175 /// Perform EML Operating Mode Notification exchange sequence between AP MLD and non-AP MLD
176 /// to enable EMLSR mode on the links specified via the EmlsrManager::EmlsrLinkSet attribute
177 /// post initialization at runtime begin
178 /// @param apDev AP MLD
179 /// @param clientDev Non-AP MLD
181};
182
183} // namespace ns3
184
185#endif // WIFI_STATIC_SETUP_HELPER_H
Wi-Fi AP state machine.
Definition ap-wifi-mac.h:62
an EUI-48 address
Implement the header for management frames of type association request.
Implement the header for management frames of type association and reassociation response.
holds a vector of ns3::NetDevice pointers
Smart pointer class similar to boost::intrusive_ptr.
Definition ptr.h:70
The Wifi MAC high model for a non-AP STA in a BSS.
Implements the IEEE 802.11 MAC header.
Hold together all Wifi-related objects.
Helper to statically setup wifi devices without actually exchanging management frames over the air:
static Mac48Address GetBaRecipientAddr(Ptr< WifiMac > originatorMac, Ptr< WifiMac > recipientMac)
Get Block ACK recipient address based on devices MAC config.
static Mac48Address GetBaOriginatorAddr(Ptr< WifiMac > originatorMac, Ptr< WifiMac > recipientMac)
Get Block ACK originator address based on devices MAC config.
static void SetStaticBlockAckPostInit(Ptr< WifiNetDevice > originatorDev, Ptr< WifiNetDevice > recipientDev, tid_t tid, std::optional< Mac48Address > gcrGroupAddr=std::nullopt)
Perform ADDBA Request-Response exchange sequence between input devices for given TID post initializat...
static void AlignApViewOfStaPmMode(Ptr< ApWifiMac > apMac, Ptr< StaWifiMac > clientMac)
Align the knowledge that the AP has about the PM mode of the STAs affiliated with the client device t...
static void SetStaticAssociation(Ptr< WifiNetDevice > bssDev, const NetDeviceContainer &clientDevs)
Bypass static capabilities exchange for input devices.
static std::map< linkId_t, linkId_t > GetLinkIdMap(Ptr< WifiNetDevice > apDev, Ptr< WifiNetDevice > clientDev)
Construct non-AP MLD link ID to AP MLD link ID mapping based on PHY channel settings.
static MgtAssocRequestHeader GetAssocReq(Ptr< StaWifiMac > staMac, linkId_t staLinkId, bool isMldAssoc)
Get Association Request for input STA link address.
static void SetStaticAssocPostInit(Ptr< WifiNetDevice > bssDev, Ptr< WifiNetDevice > clientDev)
Perform static Association Request/Response exchange for input devices post initialization at runtime...
static MgtAssocResponseHeader GetAssocResp(Mac48Address staLinkAddr, Ptr< ApWifiMac > apMac, linkId_t apLinkId, bool isMldAssoc)
Get Association Response for input STA link address from AP MAC including Multi-link Element if MLD A...
static void SetStaticEmlsrPostInit(Ptr< WifiNetDevice > apDev, Ptr< WifiNetDevice > clientDev)
Perform EML Operating Mode Notification exchange sequence between AP MLD and non-AP MLD to enable EML...
static void SetStaticBlockAck(Ptr< WifiNetDevice > apDev, const NetDeviceContainer &clientDevs, const std::set< tid_t > &tids, std::optional< Mac48Address > gcrGroupAddr=std::nullopt)
Bypass ADDBA Request-Response exchange sequence between AP and STAs for given TIDs.
static WifiMacHeader GetAssocRespMacHdr(Mac48Address staLinkAddr, Ptr< ApWifiMac > apMac, linkId_t apLinkId)
Get Association Response MAC Header for input STA link address from AP MAC including Multi-link Eleme...
static void SetStaticEmlsr(Ptr< WifiNetDevice > apDev, const NetDeviceContainer &clientDevs)
Bypass EML Operating Mode Notification exchange sequence between AP MLD and input non-AP devices.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
uint8_t tid_t
IEEE 802.11-2020 9.2.4.5.2 TID subfield.
Definition wifi-utils.h:71
uint8_t linkId_t
IEEE 802.11be D7.0 Figure 9-207e—Link ID Info field format.
Definition wifi-utils.h:74