A Discrete-Event Network Simulator
API
tcp-lp.h
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2016 NITK Surathkal
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  * Authors: Charitha Sangaraju <charitha29193@gmail.com>
19  * Nandita G <gm.nandita@gmail.com>
20  * Mohit P. Tahiliani <tahiliani@nitk.edu.in>
21  *
22  */
23 
24 #ifndef TCPLP_H
25 #define TCPLP_H
26 
27 #include "ns3/tcp-congestion-ops.h"
28 #include "ns3/traced-value.h"
29 
30 namespace ns3 {
31 
32 class TcpLp : public TcpNewReno
33 {
34 public:
40  static TypeId GetTypeId (void);
41 
46  TcpLp (void);
47 
53  TcpLp (const TcpLp& sock);
54 
55  virtual ~TcpLp (void);
56 
67  virtual void PktsAcked (Ptr<TcpSocketState> tcb, uint32_t segmentsAcked,
68  const Time& rtt);
69 
70  virtual std::string GetName () const;
71 
72  virtual Ptr<TcpCongestionOps> Fork ();
73 
74 protected:
81  virtual void CongestionAvoidance (Ptr<TcpSocketState> tcb, uint32_t segmentsAcked);
82 
83 private:
88  enum State
89  {
90  LP_VALID_OWD = (1 << 1),
91  LP_WITHIN_THR = (1 << 3),
92  LP_WITHIN_INF = (1 << 4),
93  };
94 
95  uint32_t m_flag;
96  uint32_t m_sOwd;
97  uint32_t m_owdMin;
98  uint32_t m_owdMax;
99  uint32_t m_owdMaxRsv;
102 
103 private:
110  uint32_t OwdCalculator (Ptr<TcpSocketState> tcb);
111 
117  void RttSample (Ptr<TcpSocketState> tcb);
118 };
119 
120 } // namespace ns3
121 
122 #endif // TCPLP_H
virtual ~TcpLp(void)
Definition: tcp-lp.cc:70
State
Describes the state of TcpLp.
Definition: tcp-lp.h:88
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:102
Calculated One-Way Delay is valid.
Definition: tcp-lp.h:90
uint32_t m_owdMin
Minimum One-Way Delay.
Definition: tcp-lp.h:97
uint32_t m_sOwd
Smoothed One-Way Delay.
Definition: tcp-lp.h:96
The NewReno implementation.
virtual void PktsAcked(Ptr< TcpSocketState > tcb, uint32_t segmentsAcked, const Time &rtt)
Timing information on received ACK.
Definition: tcp-lp.cc:167
virtual void CongestionAvoidance(Ptr< TcpSocketState > tcb, uint32_t segmentsAcked)
Invokes Congestion Avoidance of TcpNewReno if TcpLp is not within inference.
Definition: tcp-lp.cc:82
TcpLp is within Threshold.
Definition: tcp-lp.h:91
Time m_inference
Current inference period.
Definition: tcp-lp.h:101
TcpLp(void)
Creates an unbound tcp socket.
Definition: tcp-lp.cc:44
uint32_t m_flag
TcpLp state flag.
Definition: tcp-lp.h:95
TcpLp is within Inference.
Definition: tcp-lp.h:92
virtual std::string GetName() const
Get the name of the congestion control algorithm.
Definition: tcp-lp.cc:233
uint32_t m_owdMax
Maximum One-Way Delay.
Definition: tcp-lp.h:98
Every class exported by the ns3 library is enclosed in the ns3 namespace.
virtual Ptr< TcpCongestionOps > Fork()
Copy the congestion control algorithm across socket.
Definition: tcp-lp.cc:76
Introspection did not find any typical Config paths.
Definition: tcp-lp.h:32
void RttSample(Ptr< TcpSocketState > tcb)
Estimates minimum and maximum One-Way Delays and calculates the smoothed One-Way Delay.
Definition: tcp-lp.cc:117
uint32_t m_owdMaxRsv
Reserved Maximum One-Way Delay.
Definition: tcp-lp.h:99
static TypeId GetTypeId(void)
Get the type ID.
Definition: tcp-lp.cc:34
uint32_t OwdCalculator(Ptr< TcpSocketState > tcb)
Calculates One-Way Delay using Sender and Receiver timestamps.
Definition: tcp-lp.cc:93
a unique identifier for an interface.
Definition: type-id.h:58
Time m_lastDrop
Last time when cwnd was reduced.
Definition: tcp-lp.h:100