A Discrete-Event Network Simulator
API
tcp-dctcp.h
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2017 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  * Author: Shravya K.S. <shravya.ks0@gmail.com>
19  *
20  */
21 
22 #ifndef TCP_DCTCP_H
23 #define TCP_DCTCP_H
24 
25 #include "ns3/tcp-congestion-ops.h"
26 
27 namespace ns3 {
28 
36 class TcpDctcp : public TcpNewReno
37 {
38 public:
43  static TypeId GetTypeId (void);
44 
48  TcpDctcp ();
49 
54  TcpDctcp (const TcpDctcp& sock);
55 
59  virtual ~TcpDctcp (void);
60 
66  virtual std::string GetName () const;
67 
76  virtual void Init (Ptr<TcpSocketState> tcb);
77 
78  virtual Ptr<TcpCongestionOps> Fork ();
79 
85  virtual void ReduceCwnd (Ptr<TcpSocketState> tcb);
86 
94  virtual void PktsAcked (Ptr<TcpSocketState> tcb, uint32_t segmentsAcked,
95  const Time &rtt);
102  virtual void CwndEvent (Ptr<TcpSocketState> tcb,
103  const TcpSocketState::TcpCAEvent_t event);
104 private:
110  void CeState0to1 (Ptr<TcpSocketState> tcb);
111 
117  void CeState1to0 (Ptr<TcpSocketState> tcb);
118 
126  const TcpSocketState::TcpCAEvent_t event);
127 
133  void Reset (Ptr<TcpSocketState> tcb);
134 
140  void SetDctcpAlpha (double alpha);
141 
142  uint32_t m_ackedBytesEcn;
143  uint32_t m_ackedBytesTotal;
146  double m_alpha;
149  bool m_ceState;
151  double m_g;
152  bool m_useEct0;
153 };
154 
155 } // namespace ns3
156 
157 #endif /* TCP_DCTCP_H */
158 
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:102
virtual Ptr< TcpCongestionOps > Fork()
Copy the congestion control algorithm across sockets.
Definition: tcp-dctcp.cc:99
virtual void CwndEvent(Ptr< TcpSocketState > tcb, const TcpSocketState::TcpCAEvent_t event)
Trigger events/calculations on occurrence of congestion window event.
Definition: tcp-dctcp.cc:250
The NewReno implementation.
virtual void Init(Ptr< TcpSocketState > tcb)
Set configuration required by congestion control algorithm, This method will force DctcpEcn mode and ...
Definition: tcp-dctcp.cc:106
void SetDctcpAlpha(double alpha)
Sets the value of m_alpha.
Definition: tcp-dctcp.cc:151
void CeState1to0(Ptr< TcpSocketState > tcb)
Changes state of m_ceState to false.
Definition: tcp-dctcp.cc:194
bool m_useEct0
Use ECT(0) for ECN codepoint.
Definition: tcp-dctcp.h:152
virtual std::string GetName() const
Get the name of the TCP flavour.
Definition: tcp-dctcp.cc:58
static TypeId GetTypeId(void)
Get the type ID.
Definition: tcp-dctcp.cc:33
void UpdateAckReserved(Ptr< TcpSocketState > tcb, const TcpSocketState::TcpCAEvent_t event)
Updates the value of m_delayedAckReserved.
Definition: tcp-dctcp.cc:225
void Reset(Ptr< TcpSocketState > tcb)
Resets the value of m_ackedBytesEcn, m_ackedBytesTotal and m_nextSeq.
Definition: tcp-dctcp.cc:158
virtual void PktsAcked(Ptr< TcpSocketState > tcb, uint32_t segmentsAcked, const Time &rtt)
Get information from the acked packet.
Definition: tcp-dctcp.cc:124
bool m_ceState
DCTCP Congestion Experienced state.
Definition: tcp-dctcp.h:149
double m_alpha
Parameter used to estimate the amount of network congestion.
Definition: tcp-dctcp.h:146
SequenceNumber32 m_nextSeq
TCP sequence number threshold for beginning a new observation window.
Definition: tcp-dctcp.h:147
Every class exported by the ns3 library is enclosed in the ns3 namespace.
An implementation of DCTCP.
Definition: tcp-dctcp.h:36
virtual ~TcpDctcp(void)
Destructor.
Definition: tcp-dctcp.cc:94
double m_g
Estimation gain.
Definition: tcp-dctcp.h:151
void CeState0to1(Ptr< TcpSocketState > tcb)
Changes state of m_ceState to true.
Definition: tcp-dctcp.cc:167
uint32_t m_ackedBytesEcn
Number of acked bytes which are marked.
Definition: tcp-dctcp.h:142
uint32_t m_ackedBytesTotal
Total number of acked bytes.
Definition: tcp-dctcp.h:143
TcpDctcp()
Create an unbound tcp socket.
Definition: tcp-dctcp.cc:63
bool m_priorRcvNxtFlag
Variable used in setting the value of m_priorRcvNxt for first time.
Definition: tcp-dctcp.h:145
SequenceNumber32 m_priorRcvNxt
Sequence number of the first missing byte in data.
Definition: tcp-dctcp.h:144
bool m_delayedAckReserved
Delayed Ack state.
Definition: tcp-dctcp.h:150
virtual void ReduceCwnd(Ptr< TcpSocketState > tcb)
Reduce congestion window based on DCTCP algorithm.
Definition: tcp-dctcp.cc:116
bool m_nextSeqFlag
Variable used in setting the value of m_nextSeq for first time.
Definition: tcp-dctcp.h:148
a unique identifier for an interface.
Definition: type-id.h:58