blob: 96008294e0565fafa858a4577caebd6ebb85832e [file] [log] [blame]
Eric Newberry8821d3e2018-07-04 16:42:01 -04001/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2/*
3 * Copyright (c) 2011-2018 Regents of the University of California.
4 *
5 * This file is part of ndnSIM. See AUTHORS for complete list of ndnSIM authors and
6 * contributors.
7 *
8 * ndnSIM is free software: you can redistribute it and/or modify it under the terms
9 * of the GNU General Public License as published by the Free Software Foundation,
10 * either version 3 of the License, or (at your option) any later version.
11 *
12 * ndnSIM is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
13 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14 * PURPOSE. See the GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along with
17 * ndnSIM, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
18 **/
19
20#ifndef NDN_CONSUMER_PCON_H
21#define NDN_CONSUMER_PCON_H
22
23#include "ns3/ndnSIM/model/ndn-common.hpp"
24
25#include "ndn-consumer-window.hpp"
26
27namespace ns3 {
28namespace ndn {
29
30/**
31 * @ingroup ndn-apps
32 * \brief NDN consumer application (uses a PCON congestion window)
33 *
34 * Please refer to ConsumerWindow for further documentation on how to use this consumer.
35 */
36class ConsumerPcon : public ConsumerWindow {
37public:
38 static TypeId
39 GetTypeId();
40
41 ConsumerPcon();
42
43 virtual void
44 OnData(shared_ptr<const Data> data) override;
45
46 virtual void
47 OnTimeout(uint32_t sequenceNum) override;
48
49private:
50 void
51 WindowIncrease();
52
53 void
54 WindowDecrease();
55
56private:
57 double m_beta;
58 double m_addRttSupress;
59 bool m_shouldReactToCongestionMarks;
60 bool m_shouldUseCwa;
61
62 double m_ssthresh;
63 uint32_t m_highData;
64 double m_recPoint;
65};
66
67} // namespace ndn
68} // namespace ns3
69
70#endif // NDN_CONSUMER_PCON_H