NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.5: NDN, CCN, CCNx, content centric networks
API Documentation
ndn-consumer-pcon.hpp
Go to the documentation of this file.
1 /* -*- 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 
27 namespace ns3 {
28 namespace ndn {
29 
32  BIC,
34 };
35 
46 class ConsumerPcon : public ConsumerWindow {
47 public:
48  static TypeId
49  GetTypeId();
50 
51  ConsumerPcon();
52 
53  virtual void
54  OnData(shared_ptr<const Data> data) override;
55 
56  virtual void
57  OnTimeout(uint32_t sequenceNum) override;
58 
59 private:
60  void
61  WindowIncrease();
62 
63  void
64  WindowDecrease();
65 
66  void
67  CubicIncrease();
68 
69  void
70  CubicDecrease();
71 
72  void
73  BicIncrease();
74 
75  void
76  BicDecrease();
77 
78 private:
79  CcAlgorithm m_ccAlgorithm;
80  double m_beta;
81  double m_addRttSuppress;
82  bool m_reactToCongestionMarks;
83  bool m_useCwa;
84 
85  double m_ssthresh;
86  uint32_t m_highData;
87  double m_recPoint;
88 
89  // TCP CUBIC Parameters //
90  static constexpr double CUBIC_C = 0.4;
91  bool m_useCubicFastConv;
92  double m_cubicBeta;
93 
94  double m_cubicWmax;
95  double m_cubicLastWmax;
96  time::steady_clock::TimePoint m_cubicLastDecrease;
97 
98  // TCP BIC Parameters //
100  static constexpr uint32_t BIC_LOW_WINDOW = 14;
101 
103  static constexpr uint32_t BIC_MAX_INCREMENT = 16;
104 
105  // BIC variables:
106  double m_bicMinWin;
107  double m_bicMaxWin;
108  double m_bicTargetWin;
109  double m_bicSsCwnd;
110  double m_bicSsTarget;
111  bool m_isBicSs;
112 };
113 
114 } // namespace ndn
115 } // namespace ns3
116 
117 #endif // NDN_CONSUMER_PCON_H
virtual void OnData(shared_ptr< const Data > data) override
Method that will be called every time new Data arrives.
virtual void OnTimeout(uint32_t sequenceNum) override
Timeout event.
Copyright (c) 2011-2015 Regents of the University of California.
Ndn application for sending out Interest packets (window-based)
Copyright (c) 2011-2015 Regents of the University of California.
NDN consumer application with more advanced congestion control options.
time_point TimePoint
Definition: time.hpp:233