A Discrete-Event Network Simulator
API
originator-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) 2009, 2010 MIRKO BANCHI
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: Mirko Banchi <mk.banchi@gmail.com>
19  * Author: Tommaso Pecorella <tommaso.pecorella@unifi.it>
20  */
21 #ifndef ORIGINATOR_BLOCK_ACK_AGREEMENT_H
22 #define ORIGINATOR_BLOCK_ACK_AGREEMENT_H
23 
24 #include "block-ack-agreement.h"
25 
26 namespace ns3 {
27 
34 {
36  friend class BlockAckManager;
37 
38 
39 public:
47  OriginatorBlockAckAgreement (Mac48Address recipient, uint8_t tid);
49  /* receive ADDBAResponse
50  * send ADDBARequest --------------- status code = success ---------------
51  * ----------------->| PENDING |------------------------>| ESTABLISHED |-----
52  * --------------- --------------- |
53  * | / ^ ^ |
54  * receive ADDBAResponse | receive BlockAck / | | | receive BlockAck
55  * status code = failure | retryPkts + queuePkts / | | | retryPkts + queuePkts
56  * v < / | | | >=
57  * --------------- blockAckThreshold / | | | blockAckThreshold
58  * | UNSUCCESSFUL | / | | |
59  * --------------- v | ----------|
60  * -------------- |
61  * | INACTIVE | |
62  * -------------- |
63  * send a MPDU (Normal Ack) | |
64  * retryPkts + queuePkts | |
65  * >= | |
66  * blockAckThreshold |----------------
67  */
98  enum State
100  {
105  };
111  void SetState (State state);
118  bool IsPending (void) const;
125  bool IsEstablished (void) const;
132  bool IsInactive (void) const;
139  bool IsUnsuccessful (void) const;
145  void NotifyMpduTransmission (uint16_t nextSeqNumber);
153  bool IsBlockAckRequestNeeded (void) const;
155  void CompleteExchange (void);
156 
157 
158 private:
160  uint16_t m_sentMpdus;
162 };
163 
164 } //namespace ns3
165 
166 #endif /* ORIGINATOR_BLOCK_ACK_AGREEMENT_H */
Maintains the state and information about transmitted MPDUs with ack policy block ack for an originat...
bool IsInactive(void) const
Check if the current state of this agreement is INACTIVE.
bool IsBlockAckRequestNeeded(void) const
Returns true if all packets for which a block ack was negotiated have been transmitted so a block ack...
void SetState(State state)
Set the current state.
bool IsPending(void) const
Check if the current state of this agreement is PENDING.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
bool IsEstablished(void) const
Check if the current state of this agreement is ESTABLISHED.
an EUI-48 address
Definition: mac48-address.h:43
bool IsUnsuccessful(void) const
Check if the current state of this agreement is UNSUCCESSFUL.
Maintains information for a block ack agreement.
State
Represents the state for this agreement.
void NotifyMpduTransmission(uint16_t nextSeqNumber)
Notifies a packet's transmission with ack policy Block Ack.
Manages all block ack agreements for an originator station.
bool m_needBlockAckReq
flag whether it needs a Block ACK request
void CompleteExchange(void)
Complete exchange function.