src/internet/model/tcp-reno.cc
changeset 10855 7ef081ddfc7f
parent 10652 dc18deba4502
child 10968 2d29fee2b7b8
--- a/src/internet/model/tcp-reno.cc	Wed Aug 06 11:00:06 2014 +0200
+++ b/src/internet/model/tcp-reno.cc	Wed Aug 13 23:46:16 2014 +0200
@@ -47,6 +47,9 @@
     .AddTraceSource ("CongestionWindow",
                      "The TCP connection's congestion window",
                      MakeTraceSourceAccessor (&TcpReno::m_cWnd))
+    .AddTraceSource ("SlowStartThreshold",
+                     "TCP slow start threshold (bytes)",
+                     MakeTraceSourceAccessor (&TcpReno::m_ssThresh))
   ;
   return tid;
 }
@@ -61,6 +64,7 @@
     m_cWnd (sock.m_cWnd),
     m_ssThresh (sock.m_ssThresh),
     m_initialCWnd (sock.m_initialCWnd),
+    m_initialSsThresh (sock.m_initialSsThresh),
     m_retxThresh (sock.m_retxThresh),
     m_inFastRec (false)
 {
@@ -194,15 +198,16 @@
 }
 
 void
-TcpReno::SetSSThresh (uint32_t threshold)
+TcpReno::SetInitialSSThresh (uint32_t threshold)
 {
-  m_ssThresh = threshold;
+  NS_ABORT_MSG_UNLESS (m_state == CLOSED, "TcpReno::SetSSThresh() cannot change initial ssThresh after connection started.");
+  m_initialSsThresh = threshold;
 }
 
 uint32_t
-TcpReno::GetSSThresh (void) const
+TcpReno::GetInitialSSThresh (void) const
 {
-  return m_ssThresh;
+  return m_initialSsThresh;
 }
 
 void
@@ -227,6 +232,7 @@
    * m_segmentSize are set by the attribute system in ns3::TcpSocket.
    */
   m_cWnd = m_initialCWnd * m_segmentSize;
+  m_ssThresh = m_initialSsThresh;
 }
 
 } // namespace ns3