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 /// Bypass ADDBA Request-Response exchange sequence between AP and STAs for given TIDs.
114 /// Static setup will be performed in both uplink and downlink.
115 /// @param apDev AP device
116 /// @param clientDevs STA devices
117 /// @param tids the set of TIDs corresponding to Block ACK agreements
118 /// @param gcrGroupAddr MAC address of the GCR group (GCR Group Address)
119 static void SetStaticBlockAck(Ptr<WifiNetDevice> apDev,
120 const NetDeviceContainer& clientDevs,
121 const std::set<tid_t>& tids,
122 std::optional<Mac48Address> gcrGroupAddr = std::nullopt);
123
124 /// Bypass ADDBA Request-Response exchange sequence between input devices for given TID.
125 /// @param originatorDev originator device of Block ACK agreement
126 /// @param recipientDev recipient device of Block ACK agreement
127 /// @param tid TID corresponding to Block ACK agreement
128 /// @param gcrGroupAddr MAC address of the GCR group (GCR Group Address)
129 static void SetStaticBlockAck(Ptr<WifiNetDevice> originatorDev,
130 Ptr<WifiNetDevice> recipientDev,
131 tid_t tid,
132 std::optional<Mac48Address> gcrGroupAddr = std::nullopt);
133
134 /// Perform ADDBA Request-Response exchange sequence between input devices for given TID
135 /// post initialization at runtime begin
136 /// @param originatorDev originator device of Block ACK agreement
137 /// @param recipientDev recipient device of Block ACK agreement
138 /// @param tid TID corresponding to Block ACK agreement
139 /// @param gcrGroupAddr MAC address of the GCR group (GCR Group Address)
140 static void SetStaticBlockAckPostInit(Ptr<WifiNetDevice> originatorDev,
141 Ptr<WifiNetDevice> recipientDev,
142 tid_t tid,
143 std::optional<Mac48Address> gcrGroupAddr = std::nullopt);
144
145 /// Get Block ACK originator address based on devices MAC config
146 /// @param originatorMac originator MAC
147 /// @param recipientMac recipient MAC
148 /// @return the Block Ack originator address
149 static Mac48Address GetBaOriginatorAddr(Ptr<WifiMac> originatorMac, Ptr<WifiMac> recipientMac);
150
151 /// Get Block ACK recipient address based on devices MAC config
152 /// @param originatorMac originator MAC
153 /// @param recipientMac recipient MAC
154 /// @return the Block Ack recipient address
155 static Mac48Address GetBaRecipientAddr(Ptr<WifiMac> originatorMac, Ptr<WifiMac> recipientMac);
156
157 /// Bypass EML Operating Mode Notification exchange sequence between AP MLD
158 /// and input non-AP devices
159 /// @param apDev AP MLD
160 /// @param clientDevs Non-AP devices
161 static void SetStaticEmlsr(Ptr<WifiNetDevice> apDev, const NetDeviceContainer& clientDevs);
162
163 /// Bypass EML Operating Mode Notification exchange sequence between AP MLD and non-AP MLD
164 /// to enable EMLSR mode on the links specified via the EmlsrManager::EmlsrLinkSet attribute
165 /// @param apDev AP MLD
166 /// @param clientDev Non-AP MLD
167 static void SetStaticEmlsr(Ptr<WifiNetDevice> apDev, Ptr<WifiNetDevice> clientDev);
168
169 /// Perform 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 /// post initialization at runtime begin
172 /// @param apDev AP MLD
173 /// @param clientDev Non-AP MLD
175};
176
177} // namespace ns3
178
179#endif // WIFI_STATIC_SETUP_HELPER_H
Wi-Fi AP state machine.
Definition ap-wifi-mac.h:60
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:67
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 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