A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
advanced-emlsr-manager.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2024 Universita' 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 ADVANCED_EMLSR_MANAGER_H
10#define ADVANCED_EMLSR_MANAGER_H
11
13
14namespace ns3
15{
16
17/**
18 * \ingroup wifi
19 *
20 * AdvancedEmlsrManager is an advanced EMLSR manager.
21 */
23{
24 public:
25 /**
26 * \brief Get the type ID.
27 * \return the object TypeId
28 */
29 static TypeId GetTypeId();
30
32 ~AdvancedEmlsrManager() override;
33
34 protected:
35 void DoDispose() override;
36 void DoSetWifiMac(Ptr<StaWifiMac> mac) override;
37 std::pair<bool, Time> DoGetDelayUntilAccessRequest(uint8_t linkId) override;
38 std::pair<bool, Time> GetDelayUnlessMainPhyTakesOverUlTxop(uint8_t linkId) override;
39 void SwitchMainPhyIfTxopGainedByAuxPhy(uint8_t linkId, AcIndex aci) override;
40
41 /**
42 * Possibly take actions when notified of the MAC header of the MPDU being received by the
43 * given PHY.
44 *
45 * \param phy the given PHY
46 * \param macHdr the MAC header of the MPDU being received
47 * \param txVector the TXVECTOR used to transmit the PSDU
48 * \param psduDuration the remaining duration of the PSDU
49 */
51 const WifiMacHeader& macHdr,
52 const WifiTxVector& txVector,
53 Time psduDuration);
54
55 /**
56 * Use information from NAV and CCA performed by the given PHY on the given link in the last
57 * PIFS interval to determine whether the given EDCAF can start a TXOP. This function is
58 * intended to be used when the main PHY switches channel to start an UL TXOP on a link where
59 * channel access was obtained by a non-TX capable aux PHY.
60 *
61 * \param phy the PHY that performed CCA in the last PIFS interval
62 * \param linkId the ID of the given link
63 * \param edca the given EDCAF
64 */
65 void CheckNavAndCcaLastPifs(Ptr<WifiPhy> phy, uint8_t linkId, Ptr<QosTxop> edca);
66
67 /**
68 * Determine whether the main PHY shall be requested to switch to the link of an aux PHY that
69 * has gained channel access through the given AC but it is not TX capable.
70 *
71 * \param linkId the ID of the link on which the aux PHY is operating
72 * \param aci the index of the given AC
73 * \return whether the main PHY shall be requested to switch to the link of the aux PHY
74 */
75 bool RequestMainPhyToSwitch(uint8_t linkId, AcIndex aci);
76
77 private:
78 void DoNotifyTxopEnd(uint8_t linkId) override;
79 void DoNotifyIcfReceived(uint8_t linkId) override;
80 void DoNotifyUlTxopStart(uint8_t linkId) override;
81
82 bool m_useNotifiedMacHdr; //!< whether to use the information about the MAC header of
83 //!< the MPDU being received (if notified by the PHY)
84 bool m_allowUlTxopInRx; //!< whether a (main or aux) PHY is allowed to start an UL
85 //!< TXOP if another PHY is receiving a PPDU
86 bool m_interruptSwitching; //!< whether a main PHY switching can be interrupted to start
87 //!< switching to another link
88 bool m_useAuxPhyCca; //!< whether the CCA performed in the last PIFS interval by a
89 //!< non-TX capable aux PHY should be used when the main PHY
90 //!< ends switching to the aux PHY's link to determine whether
91 //!< TX can start or not
92 Time m_switchMainPhyBackDelay; //!< duration of the timer started in case of non-TX capable aux
93 //!< PHY when medium is sensed busy during the PIFS interval
94 //!< preceding/following the main PHY switch end
95 EventId m_ccaLastPifs; //!< event scheduled in case of non-TX capable aux PHY to
96 //!< determine whether TX can be started based on whether
97 //!< the medium has been idle during the last PIFS interval
98 EventId m_switchMainPhyBackEvent; //!< event scheduled in case of non-TX capable aux PHY when
99 //!< medium is sensed busy during the PIFS interval
100 //!< preceding/following the main PHY switch end
101};
102
103} // namespace ns3
104
105#endif /* ADVANCED_EMLSR_MANAGER_H */
AdvancedEmlsrManager is an advanced EMLSR manager.
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...
bool RequestMainPhyToSwitch(uint8_t linkId, AcIndex aci)
Determine whether the main PHY shall be requested to switch to the link of an aux PHY that has gained...
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...
bool m_useAuxPhyCca
whether the CCA performed in the last PIFS interval by a non-TX capable aux PHY should be used when t...
void DoNotifyIcfReceived(uint8_t linkId) override
Notify the subclass of the reception of an initial Control frame on the given link.
bool m_allowUlTxopInRx
whether a (main or aux) PHY is allowed to start an UL TXOP if another PHY is receiving a PPDU
void CheckNavAndCcaLastPifs(Ptr< WifiPhy > phy, uint8_t linkId, Ptr< QosTxop > edca)
Use information from NAV and CCA performed by the given PHY on the given link in the last PIFS interv...
void DoNotifyTxopEnd(uint8_t linkId) override
Notify the subclass of the end of a TXOP on the given link.
static TypeId GetTypeId()
Get the type ID.
bool m_useNotifiedMacHdr
whether to use the information about the MAC header of the MPDU being received (if notified by the PH...
void DoNotifyUlTxopStart(uint8_t linkId) override
Notify the subclass of the start of an UL TXOP on the given link.
Time m_switchMainPhyBackDelay
duration of the timer started in case of non-TX capable aux PHY when medium is sensed busy during the...
void DoDispose() override
Destructor implementation.
EventId m_switchMainPhyBackEvent
event scheduled in case of non-TX capable aux PHY when medium is sensed busy during the PIFS interval...
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...
void DoSetWifiMac(Ptr< StaWifiMac > mac) override
Allow subclasses to take actions when the MAC is set.
void ReceivedMacHdr(Ptr< WifiPhy > phy, const WifiMacHeader &macHdr, const WifiTxVector &txVector, Time psduDuration)
Possibly take actions when notified of the MAC header of the MPDU being received by the given PHY.
EventId m_ccaLastPifs
event scheduled in case of non-TX capable aux PHY to determine whether TX can be started based on whe...
bool m_interruptSwitching
whether a main PHY switching can be interrupted to start switching to another link
DefaultEmlsrManager is the default EMLSR manager.
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
Implements the IEEE 802.11 MAC header.
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
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.