A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
Loading...
Searching...
No Matches
recipient-block-ack-agreement.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2020 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
#ifndef RECIPIENT_BLOCK_ACK_AGREEMENT_H
9
#define RECIPIENT_BLOCK_ACK_AGREEMENT_H
10
11
#include "
block-ack-agreement.h
"
12
#include "
block-ack-window.h
"
13
14
#include <map>
15
16
namespace
ns3
17
{
18
19
class
WifiMpdu;
20
class
MacRxMiddle;
21
class
CtrlBAckResponseHeader;
22
23
/**
24
* @ingroup wifi
25
* Maintains the scoreboard and the receive reordering buffer used by a recipient
26
* of a Block Ack agreement.
27
*/
28
class
RecipientBlockAckAgreement
:
public
BlockAckAgreement
29
{
30
public
:
31
/**
32
* Constructor
33
*
34
* @param originator MAC address
35
* @param amsduSupported whether A-MSDU support is enabled
36
* @param tid Traffic ID
37
* @param bufferSize the buffer size (in number of MPDUs)
38
* @param timeout the timeout value
39
* @param startingSeq the starting sequence number
40
* @param htSupported whether HT support is enabled
41
*/
42
RecipientBlockAckAgreement
(
Mac48Address
originator
,
43
bool
amsduSupported
,
44
uint8_t tid,
45
uint16_t bufferSize,
46
uint16_t
timeout
,
47
uint16_t
startingSeq
,
48
bool
htSupported
);
49
~RecipientBlockAckAgreement
()
override
;
50
51
/**
52
* Set the MAC RX Middle to use.
53
*
54
* @param rxMiddle the MAC RX Middle to use
55
*/
56
void
SetMacRxMiddle
(
const
Ptr<MacRxMiddle>
rxMiddle
);
57
58
/**
59
* Update both the scoreboard and the receive reordering buffer upon reception
60
* of the given MPDU.
61
*
62
* @param mpdu the received MPDU
63
*/
64
void
NotifyReceivedMpdu
(
Ptr<const WifiMpdu>
mpdu);
65
/**
66
* Update both the scoreboard and the receive reordering buffer upon reception
67
* of a Block Ack Request.
68
*
69
* @param startingSequenceNumber the starting sequence number included in the
70
* received Block Ack Request
71
*/
72
void
NotifyReceivedBar
(uint16_t
startingSequenceNumber
);
73
/**
74
* Set the Starting Sequence Number subfield of the Block Ack Starting Sequence
75
* Control subfield of the Block Ack frame and fill the block ack bitmap.
76
* For Multi-STA Block Acks, <i>index</i> identifies the Per AID TID Info
77
* subfield whose bitmap has to be filled.
78
*
79
* @param blockAckHeader the block ack header
80
* @param index the index of the Per AID TID Info subfield (Multi-STA Block Ack only)
81
*/
82
void
FillBlockAckBitmap
(
CtrlBAckResponseHeader
&
blockAckHeader
, std::size_t index = 0)
const
;
83
/**
84
* This is called when a Block Ack agreement is destroyed to flush the
85
* received packets.
86
*/
87
void
Flush
();
88
89
private
:
90
/**
91
* Pass MSDUs or A-MSDUs up to the next MAC process if they are stored in
92
* the buffer in order of increasing value of the Sequence Number subfield
93
* starting with the MSDU or A-MSDU that has SN=WinStartB.
94
* Set WinStartB to the value of the Sequence Number subfield of the last
95
* MSDU or A-MSDU that was passed up to the next MAC process plus one.
96
*/
97
void
PassBufferedMpdusUntilFirstLost
();
98
99
/**
100
* Pass any complete MSDUs or A-MSDUs stored in the buffer with Sequence Number
101
* subfield values that are lower than the new value of WinStartB up to the next
102
* MAC process in order of increasing Sequence Number subfield value.
103
*
104
* @param newWinStartB the new value of WinStartB
105
*/
106
void
PassBufferedMpdusWithSeqNumberLessThan
(uint16_t
newWinStartB
);
107
108
/// The key of a buffered MPDU is the pair (MPDU sequence number, pointer to WinStartB)
109
typedef
std::pair<uint16_t, uint16_t*>
Key
;
110
111
/// Comparison functor used to sort the buffered MPDUs
112
struct
Compare
113
{
114
/**
115
* Functional operator for sorting the buffered MPDUs.
116
*
117
* @param a the key of first buffered MPDU (\see Key)
118
* @param b the key of second buffered MPDU (\see Key)
119
* @return true if first key is smaller than second
120
*/
121
bool
operator()
(
const
Key
&
a
,
const
Key
& b)
const
;
122
};
123
124
BlockAckWindow
m_scoreboard
;
///< recipient's scoreboard
125
uint16_t
m_winStartB
;
///< starting SN for the reordering buffer
126
std::size_t
m_winSizeB
;
///< size of the receive reordering buffer
127
std::map<Key, Ptr<const WifiMpdu>,
Compare
>
128
m_bufferedMpdus
;
///< buffered MPDUs sorted by Seq Number
129
Ptr<MacRxMiddle>
m_rxMiddle
;
///< the MAC RX Middle on this station
130
};
131
132
}
// namespace ns3
133
134
#endif
/* RECIPIENT_BLOCK_ACK_AGREEMENT_H */
block-ack-agreement.h
block-ack-window.h
ns3::BlockAckAgreement
Maintains information for a block ack agreement.
Definition
block-ack-agreement.h:26
ns3::BlockAckWindow
Block ack window.
Definition
block-ack-window.h:47
ns3::CtrlBAckResponseHeader
Headers for BlockAck response.
Definition
ctrl-headers.h:195
ns3::Mac48Address
an EUI-48 address
Definition
mac48-address.h:35
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition
ptr.h:66
ns3::RecipientBlockAckAgreement
Maintains the scoreboard and the receive reordering buffer used by a recipient of a Block Ack agreeme...
Definition
recipient-block-ack-agreement.h:29
ns3::RecipientBlockAckAgreement::m_rxMiddle
Ptr< MacRxMiddle > m_rxMiddle
the MAC RX Middle on this station
Definition
recipient-block-ack-agreement.h:129
ns3::RecipientBlockAckAgreement::PassBufferedMpdusWithSeqNumberLessThan
void PassBufferedMpdusWithSeqNumberLessThan(uint16_t newWinStartB)
Pass any complete MSDUs or A-MSDUs stored in the buffer with Sequence Number subfield values that are...
Definition
recipient-block-ack-agreement.cc:92
ns3::RecipientBlockAckAgreement::m_scoreboard
BlockAckWindow m_scoreboard
recipient's scoreboard
Definition
recipient-block-ack-agreement.h:124
ns3::RecipientBlockAckAgreement::~RecipientBlockAckAgreement
~RecipientBlockAckAgreement() override
Definition
recipient-block-ack-agreement.cc:56
ns3::RecipientBlockAckAgreement::NotifyReceivedBar
void NotifyReceivedBar(uint16_t startingSequenceNumber)
Update both the scoreboard and the receive reordering buffer upon reception of a Block Ack Request.
Definition
recipient-block-ack-agreement.cc:184
ns3::RecipientBlockAckAgreement::Flush
void Flush()
This is called when a Block Ack agreement is destroyed to flush the received packets.
Definition
recipient-block-ack-agreement.cc:176
ns3::RecipientBlockAckAgreement::PassBufferedMpdusUntilFirstLost
void PassBufferedMpdusUntilFirstLost()
Pass MSDUs or A-MSDUs up to the next MAC process if they are stored in the buffer in order of increas...
Definition
recipient-block-ack-agreement.cc:71
ns3::RecipientBlockAckAgreement::Key
std::pair< uint16_t, uint16_t * > Key
The key of a buffered MPDU is the pair (MPDU sequence number, pointer to WinStartB)
Definition
recipient-block-ack-agreement.h:109
ns3::RecipientBlockAckAgreement::NotifyReceivedMpdu
void NotifyReceivedMpdu(Ptr< const WifiMpdu > mpdu)
Update both the scoreboard and the receive reordering buffer upon reception of the given MPDU.
Definition
recipient-block-ack-agreement.cc:114
ns3::RecipientBlockAckAgreement::m_bufferedMpdus
std::map< Key, Ptr< const WifiMpdu >, Compare > m_bufferedMpdus
buffered MPDUs sorted by Seq Number
Definition
recipient-block-ack-agreement.h:128
ns3::RecipientBlockAckAgreement::FillBlockAckBitmap
void FillBlockAckBitmap(CtrlBAckResponseHeader &blockAckHeader, std::size_t index=0) const
Set the Starting Sequence Number subfield of the Block Ack Starting Sequence Control subfield of the ...
Definition
recipient-block-ack-agreement.cc:223
ns3::RecipientBlockAckAgreement::m_winStartB
uint16_t m_winStartB
starting SN for the reordering buffer
Definition
recipient-block-ack-agreement.h:125
ns3::RecipientBlockAckAgreement::m_winSizeB
std::size_t m_winSizeB
size of the receive reordering buffer
Definition
recipient-block-ack-agreement.h:126
ns3::RecipientBlockAckAgreement::SetMacRxMiddle
void SetMacRxMiddle(const Ptr< MacRxMiddle > rxMiddle)
Set the MAC RX Middle to use.
Definition
recipient-block-ack-agreement.cc:64
ns3::Create
Ptr< T > Create(Ts &&... args)
Create class instances by constructors with varying numbers of arguments and return them by Ptr.
Definition
ptr.h:436
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
timeout
ns3::Time timeout
Definition
openflow-switch.cc:44
ns3::RecipientBlockAckAgreement::Compare
Comparison functor used to sort the buffered MPDUs.
Definition
recipient-block-ack-agreement.h:113
ns3::RecipientBlockAckAgreement::Compare::operator()
bool operator()(const Key &a, const Key &b) const
Functional operator for sorting the buffered MPDUs.
Definition
recipient-block-ack-agreement.cc:27
src
wifi
model
recipient-block-ack-agreement.h
Generated on Mon Dec 15 2025 15:22:08 for ns-3 by
1.9.8