View | Details | Raw Unified | Return to bug 1831
Collapse All | Expand All

(-)a/src/internet/model/nsc-tcp-socket-impl.cc (-4 / +9 lines)
 Lines 57-62    Link Here 
57
    .AddTraceSource ("CongestionWindow",
57
    .AddTraceSource ("CongestionWindow",
58
                     "The TCP connection's congestion window",
58
                     "The TCP connection's congestion window",
59
                     MakeTraceSourceAccessor (&NscTcpSocketImpl::m_cWnd))
59
                     MakeTraceSourceAccessor (&NscTcpSocketImpl::m_cWnd))
60
    .AddTraceSource ("SlowStartThreshold",
61
                     "TCP slow start threshold (bytes)",
62
                     MakeTraceSourceAccessor (&NscTcpSocketImpl::m_ssThresh))
60
  ;
63
  ;
61
  return tid;
64
  return tid;
62
}
65
}
 Lines 106-111    Link Here 
106
    m_cWnd (sock.m_cWnd),
109
    m_cWnd (sock.m_cWnd),
107
    m_ssThresh (sock.m_ssThresh),
110
    m_ssThresh (sock.m_ssThresh),
108
    m_initialCWnd (sock.m_initialCWnd),
111
    m_initialCWnd (sock.m_initialCWnd),
112
    m_initialSsThresh (sock.m_initialSsThresh),
109
    m_lastMeasuredRtt (Seconds (0.0)),
113
    m_lastMeasuredRtt (Seconds (0.0)),
110
    m_cnTimeout (sock.m_cnTimeout),
114
    m_cnTimeout (sock.m_cnTimeout),
111
    m_cnCount (sock.m_cnCount),
115
    m_cnCount (sock.m_cnCount),
 Lines 152-157    Link Here 
152
  m_node = node;
156
  m_node = node;
153
  // Initialize some variables 
157
  // Initialize some variables 
154
  m_cWnd = m_initialCWnd * m_segmentSize;
158
  m_cWnd = m_initialCWnd * m_segmentSize;
159
  m_ssThresh = m_initialSsThresh;
155
  m_rxWindowSize = m_advertisedWindowSize;
160
  m_rxWindowSize = m_advertisedWindowSize;
156
}
161
}
157
162
 Lines 730-744    Link Here 
730
}
735
}
731
736
732
void
737
void
733
NscTcpSocketImpl::SetSSThresh (uint32_t threshold)
738
NscTcpSocketImpl::SetInitialSSThresh (uint32_t threshold)
734
{
739
{
735
  m_ssThresh = threshold;
740
  m_initialSsThresh = threshold;
736
}
741
}
737
742
738
uint32_t
743
uint32_t
739
NscTcpSocketImpl::GetSSThresh (void) const
744
NscTcpSocketImpl::GetInitialSSThresh (void) const
740
{
745
{
741
  return m_ssThresh;
746
  return m_initialSsThresh;
742
}
747
}
743
748
744
void
749
void
(-)a/src/internet/model/nsc-tcp-socket-impl.h (-3 / +4 lines)
 Lines 187-194    Link Here 
187
   * \returns the window size
187
   * \returns the window size
188
   */
188
   */
189
  virtual uint32_t GetAdvWin (void) const;
189
  virtual uint32_t GetAdvWin (void) const;
190
  virtual void SetSSThresh (uint32_t threshold);
190
  virtual void SetInitialSSThresh (uint32_t threshold);
191
  virtual uint32_t GetSSThresh (void) const;
191
  virtual uint32_t GetInitialSSThresh (void) const;
192
  virtual void SetInitialCwnd (uint32_t cwnd);
192
  virtual void SetInitialCwnd (uint32_t cwnd);
193
  virtual uint32_t GetInitialCwnd (void) const;
193
  virtual uint32_t GetInitialCwnd (void) const;
194
  virtual void SetConnTimeout (Time timeout);
194
  virtual void SetConnTimeout (Time timeout);
 Lines 240-248    Link Here 
240
  uint32_t                       m_segmentSize;          //!< SegmentSize
240
  uint32_t                       m_segmentSize;          //!< SegmentSize
241
  uint32_t                       m_rxWindowSize;         //!< Receive window size
241
  uint32_t                       m_rxWindowSize;         //!< Receive window size
242
  uint32_t                       m_advertisedWindowSize; //!< Window to advertise
242
  uint32_t                       m_advertisedWindowSize; //!< Window to advertise
243
  TracedValue<uint32_t>          m_ssThresh;             //!< Slow Start Threshold
243
  TracedValue<uint32_t>          m_cWnd;                 //!< Congestion window
244
  TracedValue<uint32_t>          m_cWnd;                 //!< Congestion window
244
  uint32_t                       m_ssThresh;             //!< Slow Start Threshold
245
  uint32_t                       m_initialCWnd;          //!< Initial cWnd value
245
  uint32_t                       m_initialCWnd;          //!< Initial cWnd value
246
  uint32_t                       m_initialSsThresh;      //!< Initial Slow Start Threshold
246
247
247
  // Round trip time estimation
248
  // Round trip time estimation
248
  Time m_lastMeasuredRtt; //!< Last measured RTT
249
  Time m_lastMeasuredRtt; //!< Last measured RTT
(-)a/src/internet/model/tcp-newreno.cc (-11 / +16 lines)
 Lines 45-57    Link Here 
45
                    MakeUintegerAccessor (&TcpNewReno::m_retxThresh),
45
                    MakeUintegerAccessor (&TcpNewReno::m_retxThresh),
46
                    MakeUintegerChecker<uint32_t> ())
46
                    MakeUintegerChecker<uint32_t> ())
47
    .AddAttribute ("LimitedTransmit", "Enable limited transmit",
47
    .AddAttribute ("LimitedTransmit", "Enable limited transmit",
48
		    BooleanValue (false),
48
                   BooleanValue (false),
49
		    MakeBooleanAccessor (&TcpNewReno::m_limitedTx),
49
                   MakeBooleanAccessor (&TcpNewReno::m_limitedTx),
50
		    MakeBooleanChecker ())
50
                   MakeBooleanChecker ())
51
    .AddTraceSource ("CongestionWindow",
51
    .AddTraceSource ("CongestionWindow",
52
                     "The TCP connection's congestion window",
52
                     "The TCP connection's congestion window",
53
                     MakeTraceSourceAccessor (&TcpNewReno::m_cWnd))
53
                     MakeTraceSourceAccessor (&TcpNewReno::m_cWnd))
54
  ;
54
    .AddTraceSource ("SlowStartThreshold",
55
                     "TCP slow start threshold (bytes)",
56
                     MakeTraceSourceAccessor (&TcpNewReno::m_ssThresh))
57
 ;
55
  return tid;
58
  return tid;
56
}
59
}
57
60
 Lines 68-73    Link Here 
68
    m_cWnd (sock.m_cWnd),
71
    m_cWnd (sock.m_cWnd),
69
    m_ssThresh (sock.m_ssThresh),
72
    m_ssThresh (sock.m_ssThresh),
70
    m_initialCWnd (sock.m_initialCWnd),
73
    m_initialCWnd (sock.m_initialCWnd),
74
    m_initialSsThresh (sock.m_initialSsThresh),
71
    m_retxThresh (sock.m_retxThresh),
75
    m_retxThresh (sock.m_retxThresh),
72
    m_inFastRec (false),
76
    m_inFastRec (false),
73
    m_limitedTx (sock.m_limitedTx)
77
    m_limitedTx (sock.m_limitedTx)
 Lines 124-131    Link Here 
124
  // Check for exit condition of fast recovery
128
  // Check for exit condition of fast recovery
125
  if (m_inFastRec && seq < m_recover)
129
  if (m_inFastRec && seq < m_recover)
126
    { // Partial ACK, partial window deflation (RFC2582 sec.3 bullet #5 paragraph 3)
130
    { // Partial ACK, partial window deflation (RFC2582 sec.3 bullet #5 paragraph 3)
127
      m_cWnd -= seq - m_txBuffer.HeadSequence ();
131
      m_cWnd += m_segmentSize - (seq - m_txBuffer.HeadSequence ());
128
      m_cWnd += m_segmentSize;  // increase cwnd
129
      NS_LOG_INFO ("Partial ACK in fast recovery: cwnd set to " << m_cWnd);
132
      NS_LOG_INFO ("Partial ACK in fast recovery: cwnd set to " << m_cWnd);
130
      m_txBuffer.DiscardUpTo(seq);  //Bug 1850:  retransmit before newack
133
      m_txBuffer.DiscardUpTo(seq);  //Bug 1850:  retransmit before newack
131
      DoRetransmit (); // Assume the next seq is lost. Retransmit lost packet
134
      DoRetransmit (); // Assume the next seq is lost. Retransmit lost packet
 Lines 134-140    Link Here 
134
    }
137
    }
135
  else if (m_inFastRec && seq >= m_recover)
138
  else if (m_inFastRec && seq >= m_recover)
136
    { // Full ACK (RFC2582 sec.3 bullet #5 paragraph 2, option 1)
139
    { // Full ACK (RFC2582 sec.3 bullet #5 paragraph 2, option 1)
137
      m_cWnd = std::min (m_ssThresh, BytesInFlight () + m_segmentSize);
140
      m_cWnd = std::min (m_ssThresh.Get (), BytesInFlight () + m_segmentSize);
138
      m_inFastRec = false;
141
      m_inFastRec = false;
139
      NS_LOG_INFO ("Received full ACK. Leaving fast recovery with cwnd set to " << m_cWnd);
142
      NS_LOG_INFO ("Received full ACK. Leaving fast recovery with cwnd set to " << m_cWnd);
140
    }
143
    }
 Lines 220-234    Link Here 
220
}
223
}
221
224
222
void
225
void
223
TcpNewReno::SetSSThresh (uint32_t threshold)
226
TcpNewReno::SetInitialSSThresh (uint32_t threshold)
224
{
227
{
225
  m_ssThresh = threshold;
228
  NS_ABORT_MSG_UNLESS (m_state == CLOSED, "TcpNewReno::SetSSThresh() cannot change initial ssThresh after connection started.");
229
  m_initialSsThresh = threshold;
226
}
230
}
227
231
228
uint32_t
232
uint32_t
229
TcpNewReno::GetSSThresh (void) const
233
TcpNewReno::GetInitialSSThresh (void) const
230
{
234
{
231
  return m_ssThresh;
235
  return m_initialSsThresh;
232
}
236
}
233
237
234
void
238
void
 Lines 253-258    Link Here 
253
   * m_segmentSize are set by the attribute system in ns3::TcpSocket.
257
   * m_segmentSize are set by the attribute system in ns3::TcpSocket.
254
   */
258
   */
255
  m_cWnd = m_initialCWnd * m_segmentSize;
259
  m_cWnd = m_initialCWnd * m_segmentSize;
260
  m_ssThresh = m_initialSsThresh;
256
}
261
}
257
262
258
} // namespace ns3
263
} // namespace ns3
(-)a/src/internet/model/tcp-newreno.h (-3 / +4 lines)
 Lines 65-72    Link Here 
65
65
66
  // Implementing ns3::TcpSocket -- Attribute get/set
66
  // Implementing ns3::TcpSocket -- Attribute get/set
67
  virtual void     SetSegSize (uint32_t size);
67
  virtual void     SetSegSize (uint32_t size);
68
  virtual void     SetSSThresh (uint32_t threshold);
68
  virtual void     SetInitialSSThresh (uint32_t threshold);
69
  virtual uint32_t GetSSThresh (void) const;
69
  virtual uint32_t GetInitialSSThresh (void) const;
70
  virtual void     SetInitialCwnd (uint32_t cwnd);
70
  virtual void     SetInitialCwnd (uint32_t cwnd);
71
  virtual uint32_t GetInitialCwnd (void) const;
71
  virtual uint32_t GetInitialCwnd (void) const;
72
private:
72
private:
 Lines 77-84    Link Here 
77
77
78
protected:
78
protected:
79
  TracedValue<uint32_t>  m_cWnd;         //!< Congestion window
79
  TracedValue<uint32_t>  m_cWnd;         //!< Congestion window
80
  uint32_t               m_ssThresh;     //!< Slow Start Threshold
80
  TracedValue<uint32_t>  m_ssThresh;     //!< Slow Start Threshold
81
  uint32_t               m_initialCWnd;  //!< Initial cWnd value
81
  uint32_t               m_initialCWnd;  //!< Initial cWnd value
82
  uint32_t               m_initialSsThresh;  //!< Initial Slow Start Threshold value
82
  SequenceNumber32       m_recover;      //!< Previous highest Tx seqnum for fast recovery
83
  SequenceNumber32       m_recover;      //!< Previous highest Tx seqnum for fast recovery
83
  uint32_t               m_retxThresh;   //!< Fast Retransmit threshold
84
  uint32_t               m_retxThresh;   //!< Fast Retransmit threshold
84
  bool                   m_inFastRec;    //!< currently in fast recovery
85
  bool                   m_inFastRec;    //!< currently in fast recovery
(-)a/src/internet/model/tcp-reno.cc (-4 / +10 lines)
 Lines 47-52    Link Here 
47
    .AddTraceSource ("CongestionWindow",
47
    .AddTraceSource ("CongestionWindow",
48
                     "The TCP connection's congestion window",
48
                     "The TCP connection's congestion window",
49
                     MakeTraceSourceAccessor (&TcpReno::m_cWnd))
49
                     MakeTraceSourceAccessor (&TcpReno::m_cWnd))
50
    .AddTraceSource ("SlowStartThreshold",
51
                     "TCP slow start threshold (bytes)",
52
                     MakeTraceSourceAccessor (&TcpReno::m_ssThresh))
50
  ;
53
  ;
51
  return tid;
54
  return tid;
52
}
55
}
 Lines 61-66    Link Here 
61
    m_cWnd (sock.m_cWnd),
64
    m_cWnd (sock.m_cWnd),
62
    m_ssThresh (sock.m_ssThresh),
65
    m_ssThresh (sock.m_ssThresh),
63
    m_initialCWnd (sock.m_initialCWnd),
66
    m_initialCWnd (sock.m_initialCWnd),
67
    m_initialSsThresh (sock.m_initialSsThresh),
64
    m_retxThresh (sock.m_retxThresh),
68
    m_retxThresh (sock.m_retxThresh),
65
    m_inFastRec (false)
69
    m_inFastRec (false)
66
{
70
{
 Lines 194-208    Link Here 
194
}
198
}
195
199
196
void
200
void
197
TcpReno::SetSSThresh (uint32_t threshold)
201
TcpReno::SetInitialSSThresh (uint32_t threshold)
198
{
202
{
199
  m_ssThresh = threshold;
203
  NS_ABORT_MSG_UNLESS (m_state == CLOSED, "TcpReno::SetSSThresh() cannot change initial ssThresh after connection started.");
204
  m_initialSsThresh = threshold;
200
}
205
}
201
206
202
uint32_t
207
uint32_t
203
TcpReno::GetSSThresh (void) const
208
TcpReno::GetInitialSSThresh (void) const
204
{
209
{
205
  return m_ssThresh;
210
  return m_initialSsThresh;
206
}
211
}
207
212
208
void
213
void
 Lines 227-232    Link Here 
227
   * m_segmentSize are set by the attribute system in ns3::TcpSocket.
232
   * m_segmentSize are set by the attribute system in ns3::TcpSocket.
228
   */
233
   */
229
  m_cWnd = m_initialCWnd * m_segmentSize;
234
  m_cWnd = m_initialCWnd * m_segmentSize;
235
  m_ssThresh = m_initialSsThresh;
230
}
236
}
231
237
232
} // namespace ns3
238
} // namespace ns3
(-)a/src/internet/model/tcp-reno.h (-3 / +4 lines)
 Lines 67-74    Link Here 
67
67
68
  // Implementing ns3::TcpSocket -- Attribute get/set
68
  // Implementing ns3::TcpSocket -- Attribute get/set
69
  virtual void     SetSegSize (uint32_t size);
69
  virtual void     SetSegSize (uint32_t size);
70
  virtual void     SetSSThresh (uint32_t threshold);
70
  virtual void     SetInitialSSThresh (uint32_t threshold);
71
  virtual uint32_t GetSSThresh (void) const;
71
  virtual uint32_t GetInitialSSThresh (void) const;
72
  virtual void     SetInitialCwnd (uint32_t cwnd);
72
  virtual void     SetInitialCwnd (uint32_t cwnd);
73
  virtual uint32_t GetInitialCwnd (void) const;
73
  virtual uint32_t GetInitialCwnd (void) const;
74
private:
74
private:
 Lines 79-86    Link Here 
79
79
80
protected:
80
protected:
81
  TracedValue<uint32_t>  m_cWnd;         //!< Congestion window
81
  TracedValue<uint32_t>  m_cWnd;         //!< Congestion window
82
  uint32_t               m_ssThresh;     //!< Slow Start Threshold
82
  TracedValue<uint32_t>  m_ssThresh;     //!< Slow Start Threshold
83
  uint32_t               m_initialCWnd;  //!< Initial cWnd value
83
  uint32_t               m_initialCWnd;  //!< Initial cWnd value
84
  uint32_t               m_initialSsThresh;  //!< Initial Slow Start Threshold value
84
  uint32_t               m_retxThresh;   //!< Fast Retransmit threshold
85
  uint32_t               m_retxThresh;   //!< Fast Retransmit threshold
85
  bool                   m_inFastRec;    //!< currently in fast recovery
86
  bool                   m_inFastRec;    //!< currently in fast recovery
86
};
87
};
(-)a/src/internet/model/tcp-rfc793.cc (-2 / +2 lines)
 Lines 63-75    Link Here 
63
}
63
}
64
64
65
void
65
void
66
TcpRfc793::SetSSThresh (uint32_t threshold)
66
TcpRfc793::SetInitialSSThresh (uint32_t threshold)
67
{
67
{
68
  NS_LOG_WARN ("DoD TCP does not perform slow start");
68
  NS_LOG_WARN ("DoD TCP does not perform slow start");
69
}
69
}
70
70
71
uint32_t
71
uint32_t
72
TcpRfc793::GetSSThresh (void) const
72
TcpRfc793::GetInitialSSThresh (void) const
73
{
73
{
74
  NS_LOG_WARN ("DoD TCP does not perform slow start");
74
  NS_LOG_WARN ("DoD TCP does not perform slow start");
75
  return 0;
75
  return 0;
(-)a/src/internet/model/tcp-rfc793.h (-2 / +2 lines)
 Lines 58-65    Link Here 
58
protected:
58
protected:
59
  virtual Ptr<TcpSocketBase> Fork (); // Call CopyObject<TcpRfc793> to clone me
59
  virtual Ptr<TcpSocketBase> Fork (); // Call CopyObject<TcpRfc793> to clone me
60
  virtual void DupAck (const TcpHeader& t, uint32_t count);
60
  virtual void DupAck (const TcpHeader& t, uint32_t count);
61
  virtual void     SetSSThresh (uint32_t threshold);
61
  virtual void     SetInitialSSThresh (uint32_t threshold);
62
  virtual uint32_t GetSSThresh (void) const;
62
  virtual uint32_t GetInitialSSThresh (void) const;
63
  virtual void     SetInitialCwnd (uint32_t cwnd);
63
  virtual void     SetInitialCwnd (uint32_t cwnd);
64
  virtual uint32_t GetInitialCwnd (void) const;
64
  virtual uint32_t GetInitialCwnd (void) const;
65
};
65
};
(-)a/src/internet/model/tcp-socket-base.h (-2 / +2 lines)
 Lines 132-139    Link Here 
132
  virtual uint32_t GetRcvBufSize (void) const;
132
  virtual uint32_t GetRcvBufSize (void) const;
133
  virtual void     SetSegSize (uint32_t size);
133
  virtual void     SetSegSize (uint32_t size);
134
  virtual uint32_t GetSegSize (void) const;
134
  virtual uint32_t GetSegSize (void) const;
135
  virtual void     SetSSThresh (uint32_t threshold) = 0;
135
  virtual void     SetInitialSSThresh (uint32_t threshold) = 0;
136
  virtual uint32_t GetSSThresh (void) const = 0;
136
  virtual uint32_t GetInitialSSThresh (void) const = 0;
137
  virtual void     SetInitialCwnd (uint32_t cwnd) = 0;
137
  virtual void     SetInitialCwnd (uint32_t cwnd) = 0;
138
  virtual uint32_t GetInitialCwnd (void) const = 0;
138
  virtual uint32_t GetInitialCwnd (void) const = 0;
139
  virtual void     SetConnTimeout (Time timeout);
139
  virtual void     SetConnTimeout (Time timeout);
(-)a/src/internet/model/tcp-socket.cc (-4 / +4 lines)
 Lines 58-68    Link Here 
58
                   MakeUintegerAccessor (&TcpSocket::GetSegSize,
58
                   MakeUintegerAccessor (&TcpSocket::GetSegSize,
59
                                         &TcpSocket::SetSegSize),
59
                                         &TcpSocket::SetSegSize),
60
                   MakeUintegerChecker<uint32_t> ())
60
                   MakeUintegerChecker<uint32_t> ())
61
    .AddAttribute ("SlowStartThreshold",
61
    .AddAttribute ("InitialSlowStartThreshold",
62
                   "TCP slow start threshold (bytes)",
62
                   "TCP initial slow start threshold (bytes)",
63
                   UintegerValue (0xffff),
63
                   UintegerValue (0xffff),
64
                   MakeUintegerAccessor (&TcpSocket::GetSSThresh,
64
                   MakeUintegerAccessor (&TcpSocket::GetInitialSSThresh,
65
                                         &TcpSocket::SetSSThresh),
65
                                         &TcpSocket::SetInitialSSThresh),
66
                   MakeUintegerChecker<uint32_t> ())
66
                   MakeUintegerChecker<uint32_t> ())
67
    .AddAttribute ("InitialCwnd",
67
    .AddAttribute ("InitialCwnd",
68
                   "TCP initial congestion window size (segments)",
68
                   "TCP initial congestion window size (segments)",
(-)a/src/internet/model/tcp-socket.h (-4 / +4 lines)
 Lines 119-134    Link Here 
119
  virtual uint32_t GetSegSize (void) const = 0;
119
  virtual uint32_t GetSegSize (void) const = 0;
120
120
121
  /**
121
  /**
122
   * \brief Set the Slow Start Threshold.
122
   * \brief Set the initial Slow Start Threshold.
123
   * \param threshold the Slow Start Threshold (in bytes)
123
   * \param threshold the Slow Start Threshold (in bytes)
124
   */
124
   */
125
  virtual void SetSSThresh (uint32_t threshold) = 0;
125
  virtual void SetInitialSSThresh (uint32_t threshold) = 0;
126
126
127
  /**
127
  /**
128
   * \brief Get the Slow Start Threshold.
128
   * \brief Get the initial Slow Start Threshold.
129
   * \returns the Slow Start Threshold (in bytes)
129
   * \returns the Slow Start Threshold (in bytes)
130
   */
130
   */
131
  virtual uint32_t GetSSThresh (void) const = 0;
131
  virtual uint32_t GetInitialSSThresh (void) const = 0;
132
132
133
  /**
133
  /**
134
   * \brief Set the initial Congestion Window.
134
   * \brief Set the initial Congestion Window.
(-)a/src/internet/model/tcp-tahoe.cc (-5 / +11 lines)
 Lines 47-52    Link Here 
47
    .AddTraceSource ("CongestionWindow",
47
    .AddTraceSource ("CongestionWindow",
48
                     "The TCP connection's congestion window",
48
                     "The TCP connection's congestion window",
49
                     MakeTraceSourceAccessor (&TcpTahoe::m_cWnd))
49
                     MakeTraceSourceAccessor (&TcpTahoe::m_cWnd))
50
    .AddTraceSource ("SlowStartThreshold",
51
                     "TCP slow start threshold (bytes)",
52
                     MakeTraceSourceAccessor (&TcpTahoe::m_ssThresh))
50
  ;
53
  ;
51
  return tid;
54
  return tid;
52
}
55
}
 Lines 61-66    Link Here 
61
    m_cWnd (sock.m_cWnd),
64
    m_cWnd (sock.m_cWnd),
62
    m_ssThresh (sock.m_ssThresh),
65
    m_ssThresh (sock.m_ssThresh),
63
    m_initialCWnd (sock.m_initialCWnd),
66
    m_initialCWnd (sock.m_initialCWnd),
67
    m_initialSsThresh (sock.m_initialSsThresh),
64
    m_retxThresh (sock.m_retxThresh)
68
    m_retxThresh (sock.m_retxThresh)
65
{
69
{
66
  NS_LOG_FUNCTION (this);
70
  NS_LOG_FUNCTION (this);
 Lines 108-114    Link Here 
108
TcpTahoe::NewAck (SequenceNumber32 const& seq)
112
TcpTahoe::NewAck (SequenceNumber32 const& seq)
109
{
113
{
110
  NS_LOG_FUNCTION (this << seq);
114
  NS_LOG_FUNCTION (this << seq);
111
  NS_LOG_LOGIC ("TcpTahoe receieved ACK for seq " << seq <<
115
  NS_LOG_LOGIC ("TcpTahoe received ACK for seq " << seq <<
112
                " cwnd " << m_cWnd <<
116
                " cwnd " << m_cWnd <<
113
                " ssthresh " << m_ssThresh);
117
                " ssthresh " << m_ssThresh);
114
  if (m_cWnd < m_ssThresh)
118
  if (m_cWnd < m_ssThresh)
 Lines 172-186    Link Here 
172
}
176
}
173
177
174
void
178
void
175
TcpTahoe::SetSSThresh (uint32_t threshold)
179
TcpTahoe::SetInitialSSThresh (uint32_t threshold)
176
{
180
{
177
  m_ssThresh = threshold;
181
  NS_ABORT_MSG_UNLESS (m_state == CLOSED, "TcpTahoe::SetSSThresh() cannot change initial ssThresh after connection started.");
182
  m_initialSsThresh = threshold;
178
}
183
}
179
184
180
uint32_t
185
uint32_t
181
TcpTahoe::GetSSThresh (void) const
186
TcpTahoe::GetInitialSSThresh (void) const
182
{
187
{
183
  return m_ssThresh;
188
  return m_initialSsThresh;
184
}
189
}
185
190
186
void
191
void
 Lines 205-210    Link Here 
205
   * m_segmentSize are set by the attribute system in ns3::TcpSocket.
210
   * m_segmentSize are set by the attribute system in ns3::TcpSocket.
206
   */
211
   */
207
  m_cWnd = m_initialCWnd * m_segmentSize;
212
  m_cWnd = m_initialCWnd * m_segmentSize;
213
  m_ssThresh = m_initialSsThresh;
208
}
214
}
209
215
210
} // namespace ns3
216
} // namespace ns3
(-)a/src/internet/model/tcp-tahoe.h (-3 / +4 lines)
 Lines 71-78    Link Here 
71
71
72
  // Implementing ns3::TcpSocket -- Attribute get/set
72
  // Implementing ns3::TcpSocket -- Attribute get/set
73
  virtual void     SetSegSize (uint32_t size);
73
  virtual void     SetSegSize (uint32_t size);
74
  virtual void     SetSSThresh (uint32_t threshold);
74
  virtual void     SetInitialSSThresh (uint32_t threshold);
75
  virtual uint32_t GetSSThresh (void) const;
75
  virtual uint32_t GetInitialSSThresh (void) const;
76
  virtual void     SetInitialCwnd (uint32_t cwnd);
76
  virtual void     SetInitialCwnd (uint32_t cwnd);
77
  virtual uint32_t GetInitialCwnd (void) const;
77
  virtual uint32_t GetInitialCwnd (void) const;
78
private:
78
private:
 Lines 83-90    Link Here 
83
83
84
protected:
84
protected:
85
  TracedValue<uint32_t>  m_cWnd;         //!< Congestion window
85
  TracedValue<uint32_t>  m_cWnd;         //!< Congestion window
86
  uint32_t               m_ssThresh;     //!< Slow Start Threshold
86
  TracedValue<uint32_t>  m_ssThresh;     //!< Slow Start Threshold
87
  uint32_t               m_initialCWnd;  //!< Initial cWnd value
87
  uint32_t               m_initialCWnd;  //!< Initial cWnd value
88
  uint32_t               m_initialSsThresh;  //!< Initial Slow Start Threshold value
88
  uint32_t               m_retxThresh;   //!< Fast Retransmit threshold
89
  uint32_t               m_retxThresh;   //!< Fast Retransmit threshold
89
};
90
};
90
91
(-)a/src/internet/model/tcp-westwood.cc (-5 / +11 lines)
 Lines 56-61    Link Here 
56
      .AddConstructor<TcpWestwood>()
56
      .AddConstructor<TcpWestwood>()
57
      .AddTraceSource("CongestionWindow", "The TCP connection's congestion window",
57
      .AddTraceSource("CongestionWindow", "The TCP connection's congestion window",
58
                      MakeTraceSourceAccessor(&TcpWestwood::m_cWnd))
58
                      MakeTraceSourceAccessor(&TcpWestwood::m_cWnd))
59
      .AddTraceSource ("SlowStartThreshold",
60
                       "TCP slow start threshold (bytes)",
61
                       MakeTraceSourceAccessor (&TcpWestwood::m_ssThresh))
59
      .AddAttribute("FilterType", "Use this to choose no filter or Tustin's approximation filter",
62
      .AddAttribute("FilterType", "Use this to choose no filter or Tustin's approximation filter",
60
                    EnumValue(TcpWestwood::TUSTIN), MakeEnumAccessor(&TcpWestwood::m_fType),
63
                    EnumValue(TcpWestwood::TUSTIN), MakeEnumAccessor(&TcpWestwood::m_fType),
61
                    MakeEnumChecker(TcpWestwood::NONE, "None", TcpWestwood::TUSTIN, "Tustin"))
64
                    MakeEnumChecker(TcpWestwood::NONE, "None", TcpWestwood::TUSTIN, "Tustin"))
 Lines 88-93    Link Here 
88
  m_cWnd(sock.m_cWnd),
91
  m_cWnd(sock.m_cWnd),
89
  m_ssThresh(sock.m_ssThresh),
92
  m_ssThresh(sock.m_ssThresh),
90
  m_initialCWnd(sock.m_initialCWnd),
93
  m_initialCWnd(sock.m_initialCWnd),
94
  m_initialSsThresh (sock.m_initialSsThresh),
91
  m_inFastRec(false),
95
  m_inFastRec(false),
92
  m_currentBW(sock.m_currentBW),
96
  m_currentBW(sock.m_currentBW),
93
  m_lastSampleBW(sock.m_lastSampleBW),
97
  m_lastSampleBW(sock.m_lastSampleBW),
 Lines 272-278    Link Here 
272
  if (count == 3 && !m_inFastRec)
276
  if (count == 3 && !m_inFastRec)
273
    {// Triple duplicate ACK triggers fast retransmit
277
    {// Triple duplicate ACK triggers fast retransmit
274
     // Adjust cwnd and ssthresh based on the estimated BW
278
     // Adjust cwnd and ssthresh based on the estimated BW
275
      m_ssThresh = m_currentBW * static_cast<double> (m_minRtt.GetSeconds());
279
      m_ssThresh = uint32_t(m_currentBW * static_cast<double> (m_minRtt.GetSeconds()));
276
      if (m_cWnd > m_ssThresh)
280
      if (m_cWnd > m_ssThresh)
277
        {
281
        {
278
          m_cWnd = m_ssThresh;
282
          m_cWnd = m_ssThresh;
 Lines 380-396    Link Here 
380
}
384
}
381
385
382
void
386
void
383
TcpWestwood::SetSSThresh (uint32_t threshold)
387
TcpWestwood::SetInitialSSThresh (uint32_t threshold)
384
{
388
{
385
  NS_LOG_FUNCTION (this);
389
  NS_LOG_FUNCTION (this);
386
  m_ssThresh = threshold;
390
  NS_ABORT_MSG_UNLESS (m_state == CLOSED, "TcpWestwood::SetSSThresh() cannot change initial ssThresh after connection started.");
391
  m_initialSsThresh = threshold;
387
}
392
}
388
393
389
uint32_t
394
uint32_t
390
TcpWestwood::GetSSThresh (void) const
395
TcpWestwood::GetInitialSSThresh (void) const
391
{
396
{
392
  NS_LOG_FUNCTION (this);
397
  NS_LOG_FUNCTION (this);
393
  return m_ssThresh;
398
  return m_initialSsThresh;
394
}
399
}
395
400
396
void
401
void
 Lines 417-422    Link Here 
417
   * m_segmentSize are set by the attribute system in ns3::TcpSocket.
422
   * m_segmentSize are set by the attribute system in ns3::TcpSocket.
418
   */
423
   */
419
  m_cWnd = m_initialCWnd * m_segmentSize;
424
  m_cWnd = m_initialCWnd * m_segmentSize;
425
  m_ssThresh = m_initialSsThresh;
420
}
426
}
421
427
422
} // namespace ns3
428
} // namespace ns3
(-)a/src/internet/model/tcp-westwood.h (-3 / +4 lines)
 Lines 122-129    Link Here 
122
122
123
  // Implementing ns3::TcpSocket -- Attribute get/set
123
  // Implementing ns3::TcpSocket -- Attribute get/set
124
  virtual void     SetSegSize (uint32_t size);
124
  virtual void     SetSegSize (uint32_t size);
125
  virtual void     SetSSThresh (uint32_t threshold);
125
  virtual void     SetInitialSSThresh (uint32_t threshold);
126
  virtual uint32_t GetSSThresh (void) const;
126
  virtual uint32_t GetInitialSSThresh (void) const;
127
  virtual void     SetInitialCwnd (uint32_t cwnd);
127
  virtual void     SetInitialCwnd (uint32_t cwnd);
128
  virtual uint32_t GetInitialCwnd (void) const;
128
  virtual uint32_t GetInitialCwnd (void) const;
129
129
 Lines 164-171    Link Here 
164
164
165
protected:
165
protected:
166
  TracedValue<uint32_t>  m_cWnd;                   //!< Congestion window
166
  TracedValue<uint32_t>  m_cWnd;                   //!< Congestion window
167
  uint32_t               m_ssThresh;               //!< Slow Start Threshold
167
  TracedValue<uint32_t>  m_ssThresh;               //!< Slow Start Threshold
168
  uint32_t               m_initialCWnd;            //!< Initial cWnd value
168
  uint32_t               m_initialCWnd;            //!< Initial cWnd value
169
  uint32_t               m_initialSsThresh;        //!< Initial Slow Start Threshold value
169
  bool                   m_inFastRec;              //!< Currently in fast recovery if TRUE
170
  bool                   m_inFastRec;              //!< Currently in fast recovery if TRUE
170
171
171
  TracedValue<double>    m_currentBW;              //!< Current value of the estimated BW
172
  TracedValue<double>    m_currentBW;              //!< Current value of the estimated BW

Return to bug 1831