A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Docs ▼
Wiki
Manual
Models
Develop ▼
API
Bugs
API
recipient-block-ack-agreement.h
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2
/*
3
* Copyright (c) 2020 Universita' degli Studi di Napoli Federico II
4
*
5
* This program is free software; you can redistribute it and/or modify
6
* it under the terms of the GNU General Public License version 2 as
7
* published by the Free Software Foundation;
8
*
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
13
*
14
* You should have received a copy of the GNU General Public License
15
* along with this program; if not, write to the Free Software
16
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17
*
18
* Author: Stefano Avallone <stavallo@unina.it>
19
*/
20
#ifndef RECIPIENT_BLOCK_ACK_AGREEMENT_H
21
#define RECIPIENT_BLOCK_ACK_AGREEMENT_H
22
23
#include "
block-ack-agreement.h
"
24
#include "
block-ack-window.h
"
25
#include <map>
26
27
28
namespace
ns3
{
29
30
class
WifiMacQueueItem;
31
class
MacRxMiddle;
32
class
CtrlBAckResponseHeader;
33
39
class
RecipientBlockAckAgreement
:
public
BlockAckAgreement
40
{
41
public
:
53
RecipientBlockAckAgreement
(
Mac48Address
originator,
bool
amsduSupported, uint8_t tid,
54
uint16_t bufferSize, uint16_t
timeout
, uint16_t startingSeq,
55
bool
htSupported);
56
~RecipientBlockAckAgreement
();
57
63
void
SetMacRxMiddle
(
const
Ptr<MacRxMiddle>
rxMiddle);
64
71
void
NotifyReceivedMpdu
(
Ptr<WifiMacQueueItem>
mpdu);
79
void
NotifyReceivedBar
(uint16_t startingSequenceNumber);
89
void
FillBlockAckBitmap
(
CtrlBAckResponseHeader
*blockAckHeader, std::size_t index = 0)
const
;
94
void
Flush
(
void
);
95
96
private
:
104
void
PassBufferedMpdusUntilFirstLost
(
void
);
105
113
void
PassBufferedMpdusWithSeqNumberLessThan
(uint16_t newWinStartB);
114
116
typedef
std::pair<uint16_t, uint16_t*>
Key
;
117
119
struct
Compare
120
{
128
bool
operator()
(
const
Key
& a,
const
Key
& b)
const
;
129
};
130
131
BlockAckWindow
m_scoreboard
;
132
uint16_t
m_winStartB
;
133
std::size_t
m_winSizeB
;
134
std::map<Key, Ptr<WifiMacQueueItem>,
Compare
>
m_bufferedMpdus
;
135
Ptr<MacRxMiddle>
m_rxMiddle
;
136
};
137
138
}
//namespace ns3
139
140
#endif
/* RECIPIENT_BLOCK_ACK_AGREEMENT_H */
ns3::RecipientBlockAckAgreement::SetMacRxMiddle
void SetMacRxMiddle(const Ptr< MacRxMiddle > rxMiddle)
Set the MAC RX Middle to use.
Definition:
recipient-block-ack-agreement.cc:68
ns3::RecipientBlockAckAgreement::NotifyReceivedMpdu
void NotifyReceivedMpdu(Ptr< WifiMacQueueItem > mpdu)
Update both the scoreboard and the receive reordering buffer upon reception of the given MPDU.
Definition:
recipient-block-ack-agreement.cc:118
ns3::RecipientBlockAckAgreement::Flush
void Flush(void)
This is called when a Block Ack agreement is destroyed to flush the received packets.
Definition:
recipient-block-ack-agreement.cc:177
ns3::RecipientBlockAckAgreement::RecipientBlockAckAgreement
RecipientBlockAckAgreement(Mac48Address originator, bool amsduSupported, uint8_t tid, uint16_t bufferSize, uint16_t timeout, uint16_t startingSeq, bool htSupported)
Constructor.
Definition:
recipient-block-ack-agreement.cc:41
ns3::RecipientBlockAckAgreement::m_scoreboard
BlockAckWindow m_scoreboard
recipient's scoreboard
Definition:
recipient-block-ack-agreement.h:131
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::RecipientBlockAckAgreement::m_winStartB
uint16_t m_winStartB
starting SN for the reordering buffer
Definition:
recipient-block-ack-agreement.h:132
ns3::RecipientBlockAckAgreement::~RecipientBlockAckAgreement
~RecipientBlockAckAgreement()
Definition:
recipient-block-ack-agreement.cc:60
ns3::RecipientBlockAckAgreement::m_bufferedMpdus
std::map< Key, Ptr< WifiMacQueueItem >, Compare > m_bufferedMpdus
buffered MPDUs sorted by Seq Number
Definition:
recipient-block-ack-agreement.h:134
ns3::RecipientBlockAckAgreement::m_winSizeB
std::size_t m_winSizeB
size of the receive reordering buffer
Definition:
recipient-block-ack-agreement.h:133
ns3::Mac48Address
an EUI-48 address
Definition:
mac48-address.h:44
block-ack-agreement.h
ns3::BlockAckAgreement
Maintains information for a block ack agreement.
Definition:
block-ack-agreement.h:34
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition:
ptr.h:74
ns3::RecipientBlockAckAgreement::PassBufferedMpdusUntilFirstLost
void PassBufferedMpdusUntilFirstLost(void)
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:75
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:40
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:96
ns3::BlockAckWindow
Block ack window.
Definition:
block-ack-window.h:57
ns3::RecipientBlockAckAgreement::m_rxMiddle
Ptr< MacRxMiddle > m_rxMiddle
the MAC RX Middle on this station
Definition:
recipient-block-ack-agreement.h:135
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:224
timeout
ns3::Time timeout
Definition:
openflow-switch.cc:52
ns3::RecipientBlockAckAgreement::Compare
Comparison functor used to sort the buffered MPDUs.
Definition:
recipient-block-ack-agreement.h:120
block-ack-window.h
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:116
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:185
ns3::CtrlBAckResponseHeader
Headers for BlockAck response.
Definition:
ctrl-headers.h:202
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:35
src
wifi
model
recipient-block-ack-agreement.h
Generated on Fri Oct 1 2021 17:03:48 for ns-3 by
1.8.20