author | Pavel Boyko <boyko@iitp.ru> |
Tue, 16 Jun 2009 17:58:16 +0400 | |
changeset 5074 | 355de6af8ea9 |
parent 4345 | 528d4150d2ac |
child 6065 | 0f012e7d9128 |
permissions | -rw-r--r-- |
4342 | 1 |
/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ |
2 |
/* |
|
3 |
* Copyright (c) 2005,2006 INRIA |
|
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: Federico Maguolo <maguolof@dei.unipd.it> |
|
19 |
*/ |
|
20 |
#ifndef CARA_WIFI_MANAGER_H |
|
21 |
#define CARA_WIFI_MANAGER_H |
|
22 |
||
23 |
#include "wifi-remote-station-manager.h" |
|
24 |
||
25 |
namespace ns3 { |
|
26 |
||
27 |
/** |
|
28 |
* \brief implement the CARA rate control algorithm |
|
29 |
* |
|
30 |
* Implement the CARA algorithm from: |
|
31 |
* J. Kim, S. Kim, S. Choi, and D. Qiao. |
|
32 |
* "CARA: Collision-Aware Rate Adaptation for IEEE 802.11 WLANs." |
|
33 |
* |
|
34 |
* Originally implemented by Federico Maguolo for a very early |
|
35 |
* prototype version of ns-3. |
|
36 |
*/ |
|
37 |
class CaraWifiManager : public WifiRemoteStationManager |
|
38 |
{ |
|
39 |
public: |
|
40 |
static TypeId GetTypeId (void); |
|
41 |
CaraWifiManager (); |
|
42 |
virtual ~CaraWifiManager (); |
|
43 |
||
44 |
private: |
|
45 |
friend class CaraWifiRemoteStation; |
|
46 |
virtual class WifiRemoteStation *CreateStation (void); |
|
47 |
uint32_t m_timerTimeout; |
|
48 |
uint32_t m_successThreshold; |
|
49 |
uint32_t m_failureThreshold; |
|
50 |
uint32_t m_probeThreshold; |
|
51 |
}; |
|
52 |
||
53 |
||
54 |
class CaraWifiRemoteStation : public WifiRemoteStation |
|
55 |
{ |
|
56 |
public: |
|
57 |
CaraWifiRemoteStation (Ptr<CaraWifiManager> manager); |
|
58 |
virtual ~CaraWifiRemoteStation (); |
|
59 |
||
60 |
private: |
|
61 |
virtual Ptr<WifiRemoteStationManager> GetManager (void) const; |
|
62 |
virtual void DoReportRtsFailed (void); |
|
63 |
virtual void DoReportDataFailed (void); |
|
64 |
virtual void DoReportRtsOk (double ctsSnr, WifiMode ctsMode, double rtsSnr); |
|
65 |
virtual void DoReportDataOk (double ackSnr, WifiMode ackMode, double dataSnr); |
|
66 |
virtual void DoReportFinalRtsFailed (void); |
|
67 |
virtual void DoReportFinalDataFailed (void); |
|
4344
968b98374cf6
order similarly to base class
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4342
diff
changeset
|
68 |
virtual void DoReportRxOk (double rxSnr, WifiMode txMode); |
4342 | 69 |
virtual WifiMode DoGetDataMode (uint32_t size); |
70 |
virtual WifiMode DoGetRtsMode (void); |
|
71 |
||
4345
528d4150d2ac
handle rts somewhat better
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4344
diff
changeset
|
72 |
virtual bool NeedRts (Ptr<const Packet> packet); |
528d4150d2ac
handle rts somewhat better
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4344
diff
changeset
|
73 |
|
4342 | 74 |
uint32_t m_timer; |
75 |
uint32_t m_success; |
|
76 |
uint32_t m_failed; |
|
77 |
||
78 |
uint32_t m_rate; |
|
79 |
||
80 |
Ptr<CaraWifiManager> m_manager; |
|
81 |
||
82 |
uint32_t GetMaxRate (void); |
|
83 |
uint32_t GetMinRate (void); |
|
84 |
||
85 |
bool NeedNormalFallback (void); |
|
86 |
||
87 |
}; |
|
88 |
||
89 |
} // namespace ns3 |
|
90 |
||
91 |
#endif /* CARA_WIFI_MANAGER_H */ |