A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
default-emlsr-manager.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2023 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 DEFAULT_EMLSR_MANAGER_H
10#define DEFAULT_EMLSR_MANAGER_H
11
12#include "emlsr-manager.h"
13
14#include <optional>
15
16namespace ns3
17{
18
19/**
20 * \ingroup wifi
21 *
22 * DefaultEmlsrManager is the default EMLSR manager.
23 */
25{
26 public:
27 /**
28 * \brief Get the type ID.
29 * \return the object TypeId
30 */
31 static TypeId GetTypeId();
32
34 ~DefaultEmlsrManager() override;
35
36 protected:
37 uint8_t GetLinkToSendEmlOmn() override;
38 std::optional<uint8_t> ResendNotification(Ptr<const WifiMpdu> mpdu) override;
39 std::pair<bool, Time> DoGetDelayUntilAccessRequest(uint8_t linkId) override;
40 void SwitchMainPhyIfTxopGainedByAuxPhy(uint8_t linkId, AcIndex aci) override;
41 std::pair<bool, Time> GetDelayUnlessMainPhyTakesOverUlTxop(uint8_t linkId) override;
42
43 /**
44 * This function is intended to be called when an aux PHY is about to transmit an RTS on
45 * the given link to calculate the time remaining to the end of the CTS reception.
46 *
47 * \param linkId the ID of the given link
48 * \return the time remaining to the end of the CTS reception
49 */
50 Time GetTimeToCtsEnd(uint8_t linkId) const;
51
52 /**
53 * This method can only be called when aux PHYs do not switch link. Switch the main PHY back
54 * to the primary link and reconnect the aux PHY that was operating on the link left by the
55 * main PHY.
56 *
57 * \param linkId the ID of the link that the main PHY is leaving
58 */
59 void SwitchMainPhyBackToPrimaryLink(uint8_t linkId);
60
61 /// Store information about a main PHY switch.
63 {
64 Time end; //!< end of channel switching
65 uint8_t from; //!< ID of the link which the main PHY is/has been leaving
66 };
67
68 bool m_switchAuxPhy; /**< whether Aux PHY should switch channel to operate on the link on which
69 the Main PHY was operating before moving to the link of the Aux PHY */
70 bool m_auxPhyToSleep; //!< whether Aux PHY should be put into sleep mode while the Main PHY
71 //!< is operating on the same link as the Aux PHY
72 EventId m_auxPhyToSleepEvent; //!< the event scheduled to put an Aux PHY into sleep mode
73 Ptr<WifiPhy> m_auxPhyToReconnect; //!< Aux PHY the ChannelAccessManager of the link on which
74 //!< the main PHY is operating has to connect a listener to
75 //!< when the main PHY is back operating on its previous link
76 EventId m_auxPhySwitchEvent; //!< event scheduled for an aux PHY to switch link
77 MainPhySwitchInfo m_mainPhySwitchInfo; //!< main PHY switch info
78
79 private:
80 void DoNotifyMgtFrameReceived(Ptr<const WifiMpdu> mpdu, uint8_t linkId) override;
81 void NotifyEmlsrModeChanged() override;
82 void NotifyMainPhySwitch(std::optional<uint8_t> currLinkId,
83 uint8_t nextLinkId,
84 Time duration) override;
85 void DoNotifyIcfReceived(uint8_t linkId) override;
86 void DoNotifyUlTxopStart(uint8_t linkId) override;
87 void DoNotifyTxopEnd(uint8_t linkId) override;
88};
89
90} // namespace ns3
91
92#endif /* DEFAULT_EMLSR_MANAGER_H */
DefaultEmlsrManager is the default EMLSR manager.
void DoNotifyMgtFrameReceived(Ptr< const WifiMpdu > mpdu, uint8_t linkId) override
Notify the subclass of the reception of a management frame addressed to us.
void SwitchMainPhyIfTxopGainedByAuxPhy(uint8_t linkId, AcIndex aci) override
Subclasses have to provide an implementation for this method, that is called by the base class when t...
bool m_auxPhyToSleep
whether Aux PHY should be put into sleep mode while the Main PHY is operating on the same link as the...
void NotifyEmlsrModeChanged() override
Notify subclass that EMLSR mode changed.
EventId m_auxPhySwitchEvent
event scheduled for an aux PHY to switch link
Ptr< WifiPhy > m_auxPhyToReconnect
Aux PHY the ChannelAccessManager of the link on which the main PHY is operating has to connect a list...
void DoNotifyUlTxopStart(uint8_t linkId) override
Notify the subclass of the start of an UL TXOP on the given link.
bool m_switchAuxPhy
whether Aux PHY should switch channel to operate on the link on which the Main PHY was operating befo...
std::pair< bool, Time > DoGetDelayUntilAccessRequest(uint8_t linkId) override
Subclasses have to provide an implementation for this method, that is called by the base class when t...
Time GetTimeToCtsEnd(uint8_t linkId) const
This function is intended to be called when an aux PHY is about to transmit an RTS on the given link ...
static TypeId GetTypeId()
Get the type ID.
void DoNotifyIcfReceived(uint8_t linkId) override
Notify the subclass of the reception of an initial Control frame on the given link.
std::optional< uint8_t > ResendNotification(Ptr< const WifiMpdu > mpdu) override
A previous EML Operating Mode Notification frame was dropped.
void SwitchMainPhyBackToPrimaryLink(uint8_t linkId)
This method can only be called when aux PHYs do not switch link.
EventId m_auxPhyToSleepEvent
the event scheduled to put an Aux PHY into sleep mode
void DoNotifyTxopEnd(uint8_t linkId) override
Notify the subclass of the end of a TXOP on the given link.
void NotifyMainPhySwitch(std::optional< uint8_t > currLinkId, uint8_t nextLinkId, Time duration) override
Notify subclass that the main PHY is switching channel to operate on another link.
MainPhySwitchInfo m_mainPhySwitchInfo
main PHY switch info
std::pair< bool, Time > GetDelayUnlessMainPhyTakesOverUlTxop(uint8_t linkId) override
Subclasses have to provide an implementation for this method, that is called by the base class when t...
uint8_t GetLinkToSendEmlOmn() override
EmlsrManager is an abstract base class defining the API that EHT non-AP MLDs with EMLSR activated can...
An identifier for simulation events.
Definition event-id.h:45
Smart pointer class similar to boost::intrusive_ptr.
Simulation virtual time values and global simulation resolution.
Definition nstime.h:94
a unique identifier for an interface.
Definition type-id.h:48
AcIndex
This enumeration defines the Access Categories as an enumeration with values corresponding to the AC ...
Definition qos-utils.h:62
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Store information about a main PHY switch.
uint8_t from
ID of the link which the main PHY is/has been leaving.