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

(-)i/src/internet/model/tcp-illinois.cc (-27 / +26 lines)
 Lines 172-178   TcpIllinois::CongestionStateSet (Ptr<TcpSocketState> tcb, Link Here 
172
}
172
}
173
173
174
void
174
void
175
TcpIllinois::IncreaseWindow (Ptr<TcpSocketState> tcb, uint32_t segmentsAcked)
175
TcpIllinois::SlowStart (Ptr<TcpSocketState> tcb, uint32_t segmentsAcked)
176
{
176
{
177
  NS_LOG_FUNCTION (this << segmentsAcked);
177
  NS_LOG_FUNCTION (this << segmentsAcked);
178
178
 Lines 182-216   TcpIllinois::IncreaseWindow (Ptr<TcpSocketState> tcb, uint32_t segmentsAcked) Link Here 
182
      Reset (tcb->m_nextTxSequence);
182
      Reset (tcb->m_nextTxSequence);
183
    }
183
    }
184
184
185
  if (tcb->m_cWnd < tcb->m_ssThresh)
185
  TcpNewReno::SlowStart (tcb, segmentsAcked);
186
}
187
188
void
189
TcpIllinois::CongestionAvoidance (Ptr<TcpSocketState> tcb, uint32_t segmentsAcked)
190
{
191
  NS_LOG_FUNCTION (this << segmentsAcked);
192
193
  uint32_t segCwnd = tcb->GetCwndInSegments ();
194
  uint32_t oldCwnd = segCwnd;
195
196
  if (segmentsAcked > 0)
186
    {
197
    {
187
      segmentsAcked = TcpNewReno::SlowStart (tcb, segmentsAcked);
198
      m_ackCnt += segmentsAcked * m_alpha;
188
      NS_LOG_INFO ("In SlowStart, updated to cwnd " << tcb->m_cWnd <<
199
    }
200
201
  while (m_ackCnt >= segCwnd)
202
    {
203
      m_ackCnt -= segCwnd;
204
      segCwnd += 1;
205
    }
206
207
  if (segCwnd != oldCwnd)
208
    {
209
      tcb->m_cWnd = segCwnd * tcb->m_segmentSize;
210
      NS_LOG_INFO ("In CongAvoid, updated to cwnd " << tcb->m_cWnd <<
189
                   " ssthresh " << tcb->m_ssThresh);
211
                   " ssthresh " << tcb->m_ssThresh);
190
    }
212
    }
191
  else
192
    {
193
      uint32_t segCwnd = tcb->GetCwndInSegments ();
194
      uint32_t oldCwnd = segCwnd;
195
196
      if (segmentsAcked > 0)
197
        {
198
          m_ackCnt += segmentsAcked * m_alpha;
199
        }
200
201
      while (m_ackCnt >= segCwnd)
202
        {
203
          m_ackCnt -= segCwnd;
204
          segCwnd += 1;
205
        }
206
207
      if (segCwnd != oldCwnd)
208
        {
209
          tcb->m_cWnd = segCwnd * tcb->m_segmentSize;
210
          NS_LOG_INFO ("In CongAvoid, updated to cwnd " << tcb->m_cWnd <<
211
                       " ssthresh " << tcb->m_ssThresh);
212
        }
213
    }
214
}
213
}
215
214
216
void
215
void
(-)i/src/internet/model/tcp-illinois.h (-9 / +3 lines)
 Lines 147-161   public: Link Here 
147
    */
147
    */
148
  virtual void CongestionStateSet (Ptr<TcpSocketState> tcb,
148
  virtual void CongestionStateSet (Ptr<TcpSocketState> tcb,
149
                                   const TcpSocketState::TcpCongState_t newState);
149
                                   const TcpSocketState::TcpCongState_t newState);
150
151
  /**
152
   * \brief Adjust cwnd following Illinois congestion avoidance algorithm
153
   *
154
   * \param tcb internal congestion state
155
   * \param segmentsAcked count of segments ACKed
156
   */
157
  virtual void IncreaseWindow (Ptr<TcpSocketState> tcb, uint32_t segmentsAcked);
158
159
  /**
150
  /**
160
   * \brief Measure RTT for each ACK
151
   * \brief Measure RTT for each ACK
161
   * Keep track of min and max RTT
152
   * Keep track of min and max RTT
 Lines 168-173   public: Link Here 
168
                          const Time& rtt);
159
                          const Time& rtt);
169
160
170
protected:
161
protected:
162
  virtual void CongestionAvoidance (Ptr<TcpSocketState> tcb, uint32_t segmentsAcked);
163
  virtual void SlowStart (Ptr<TcpSocketState> tcb, uint32_t segmentsAcked);
164
171
private:
165
private:
172
  /**
166
  /**
173
   * \brief Recalculate alpha and beta every RTT
167
   * \brief Recalculate alpha and beta every RTT
(-)i/src/internet/model/tcp-vegas.cc (-2 / +2 lines)
 Lines 233-239   TcpVegas::IncreaseWindow (Ptr<TcpSocketState> tcb, uint32_t segmentsAcked) Link Here 
233
            {     // Slow start mode
233
            {     // Slow start mode
234
              NS_LOG_LOGIC ("We are in slow start and diff < m_gamma, so we "
234
              NS_LOG_LOGIC ("We are in slow start and diff < m_gamma, so we "
235
                            "follow NewReno slow start");
235
                            "follow NewReno slow start");
236
              segmentsAcked = TcpNewReno::SlowStart (tcb, segmentsAcked);
236
              TcpNewReno::SlowStart (tcb, segmentsAcked);
237
            }
237
            }
238
          else
238
          else
239
            {     // Linear increase/decrease mode
239
            {     // Linear increase/decrease mode
 Lines 274-280   TcpVegas::IncreaseWindow (Ptr<TcpSocketState> tcb, uint32_t segmentsAcked) Link Here 
274
    }
274
    }
275
  else if (tcb->m_cWnd < tcb->m_ssThresh)
275
  else if (tcb->m_cWnd < tcb->m_ssThresh)
276
    {
276
    {
277
      segmentsAcked = TcpNewReno::SlowStart (tcb, segmentsAcked);
277
      TcpNewReno::SlowStart (tcb, segmentsAcked);
278
    }
278
    }
279
}
279
}
280
280
(-)i/src/internet/model/tcp-veno.cc (-1 / +1 lines)
 Lines 192-198   TcpVeno::IncreaseWindow (Ptr<TcpSocketState> tcb, uint32_t segmentsAcked) Link Here 
192
      if (tcb->m_cWnd < tcb->m_ssThresh)
192
      if (tcb->m_cWnd < tcb->m_ssThresh)
193
        { // Slow start mode. Veno employs same slow start algorithm as NewReno's.
193
        { // Slow start mode. Veno employs same slow start algorithm as NewReno's.
194
          NS_LOG_LOGIC ("We are in slow start, behave like NewReno.");
194
          NS_LOG_LOGIC ("We are in slow start, behave like NewReno.");
195
          segmentsAcked = TcpNewReno::SlowStart (tcb, segmentsAcked);
195
          TcpNewReno::SlowStart (tcb, segmentsAcked);
196
        }
196
        }
197
      else
197
      else
198
        { // Congestion avoidance mode
198
        { // Congestion avoidance mode
(-)i/src/internet/model/tcp-yeah.cc (-7 / +2 lines)
 Lines 196-211   TcpYeah::CongestionStateSet (Ptr<TcpSocketState> tcb, Link Here 
196
}
196
}
197
197
198
void
198
void
199
TcpYeah::IncreaseWindow (Ptr<TcpSocketState> tcb, uint32_t segmentsAcked)
199
TcpYeah::CongestionAvoidance (Ptr<TcpSocketState> tcb, uint32_t segmentsAcked)
200
{
200
{
201
  NS_LOG_FUNCTION (this << tcb << segmentsAcked);
201
  NS_LOG_FUNCTION (this << tcb << segmentsAcked);
202
202
203
  if (tcb->m_cWnd < tcb->m_ssThresh)
203
  if (!m_doingRenoNow)
204
    {
205
      NS_LOG_LOGIC ("In slow start, invoke NewReno slow start.");
206
      segmentsAcked = TcpNewReno::SlowStart (tcb, segmentsAcked);
207
    }
208
  else if (!m_doingRenoNow)
209
    { // Fast mode
204
    { // Fast mode
210
      NS_LOG_LOGIC ("In Fast mode, increment cwnd according to STCP rule.");
205
      NS_LOG_LOGIC ("In Fast mode, increment cwnd according to STCP rule.");
211
      m_stcp->IncreaseWindow (tcb, segmentsAcked);
206
      m_stcp->IncreaseWindow (tcb, segmentsAcked);
(-)i/src/internet/model/tcp-yeah.h (-8 / +2 lines)
 Lines 122-135   public: Link Here 
122
                                   const TcpSocketState::TcpCongState_t newState);
122
                                   const TcpSocketState::TcpCongState_t newState);
123
123
124
  /**
124
  /**
125
   * \brief Adjust cwnd following YeAH dual-mode algorithm
126
   *
127
   * \param tcb internal congestion state
128
   * \param segmentsAcked count of segments ACKed
129
   */
130
  virtual void IncreaseWindow (Ptr<TcpSocketState> tcb, uint32_t segmentsAcked);
131
132
  /**
133
   * \brief Get slow start threshold upon the receipt of 3 dupACKs
125
   * \brief Get slow start threshold upon the receipt of 3 dupACKs
134
   *
126
   *
135
   * \param tcb internal congestion state
127
   * \param tcb internal congestion state
 Lines 143-148   public: Link Here 
143
  virtual Ptr<TcpCongestionOps> Fork ();
135
  virtual Ptr<TcpCongestionOps> Fork ();
144
136
145
protected:
137
protected:
138
  virtual void CongestionAvoidance (Ptr<TcpSocketState> tcb, uint32_t segmentsAcked);
139
146
private:
140
private:
147
  /**
141
  /**
148
   * \brief Enable YeAH algorithm to start taking YeAH samples
142
   * \brief Enable YeAH algorithm to start taking YeAH samples

Return to bug 2547