Moved cWnd and ssThresh inside TcpSocketBase
authorNatale Patriciello <natale.patriciello@gmail.com>
Mon, 13 Jul 2015 10:02:55 -0700
changeset 11511 2c614cf0b5bd
parent 11510 030e5d6efdd6
child 11512 c0e78011217c
Moved cWnd and ssThresh inside TcpSocketBase These two trace sources are now managed in TcpSocketBase.
src/internet/model/tcp-newreno.cc
src/internet/model/tcp-newreno.h
src/internet/model/tcp-reno.cc
src/internet/model/tcp-reno.h
src/internet/model/tcp-socket-base.cc
src/internet/model/tcp-socket-base.h
src/internet/model/tcp-tahoe.cc
src/internet/model/tcp-tahoe.h
src/internet/model/tcp-westwood.cc
src/internet/model/tcp-westwood.h
--- a/src/internet/model/tcp-newreno.cc	Mon Jul 13 08:26:43 2015 -0700
+++ b/src/internet/model/tcp-newreno.cc	Mon Jul 13 10:02:55 2015 -0700
@@ -49,14 +49,6 @@
                    BooleanValue (false),
                    MakeBooleanAccessor (&TcpNewReno::m_limitedTx),
                    MakeBooleanChecker ())
-    .AddTraceSource ("CongestionWindow",
-                     "The TCP connection's congestion window",
-                     MakeTraceSourceAccessor (&TcpNewReno::m_cWnd),
-                     "ns3::TracedValue::Uint32Callback")
-    .AddTraceSource ("SlowStartThreshold",
-                     "TCP slow start threshold (bytes)",
-                     MakeTraceSourceAccessor (&TcpNewReno::m_ssThresh),
-                     "ns3::TracedValue::Uint32Callback")
  ;
   return tid;
 }
@@ -71,8 +63,6 @@
 
 TcpNewReno::TcpNewReno (const TcpNewReno& sock)
   : TcpSocketBase (sock),
-    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),
--- a/src/internet/model/tcp-newreno.h	Mon Jul 13 08:26:43 2015 -0700
+++ b/src/internet/model/tcp-newreno.h	Mon Jul 13 10:02:55 2015 -0700
@@ -78,8 +78,6 @@
   void InitializeCwnd (void);
 
 protected:
-  TracedValue<uint32_t>  m_cWnd;         //!< Congestion window
-  TracedValue<uint32_t>  m_ssThresh;     //!< Slow Start Threshold
   uint32_t               m_initialCWnd;  //!< Initial cWnd value
   uint32_t               m_initialSsThresh;  //!< Initial Slow Start Threshold value
   SequenceNumber32       m_recover;      //!< Previous highest Tx seqnum for fast recovery
--- a/src/internet/model/tcp-reno.cc	Mon Jul 13 08:26:43 2015 -0700
+++ b/src/internet/model/tcp-reno.cc	Mon Jul 13 10:02:55 2015 -0700
@@ -45,14 +45,6 @@
                     UintegerValue (3),
                     MakeUintegerAccessor (&TcpReno::m_retxThresh),
                     MakeUintegerChecker<uint32_t> ())
-    .AddTraceSource ("CongestionWindow",
-                     "The TCP connection's congestion window",
-                     MakeTraceSourceAccessor (&TcpReno::m_cWnd),
-                     "ns3::TracedValue::Uint32Callback")
-    .AddTraceSource ("SlowStartThreshold",
-                     "TCP slow start threshold (bytes)",
-                     MakeTraceSourceAccessor (&TcpReno::m_ssThresh),
-                     "ns3::TracedValue::Uint32Callback")
   ;
   return tid;
 }
@@ -64,8 +56,6 @@
 
 TcpReno::TcpReno (const TcpReno& sock)
   : TcpSocketBase (sock),
-    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),
--- a/src/internet/model/tcp-reno.h	Mon Jul 13 08:26:43 2015 -0700
+++ b/src/internet/model/tcp-reno.h	Mon Jul 13 10:02:55 2015 -0700
@@ -80,8 +80,6 @@
   void InitializeCwnd (void);
 
 protected:
-  TracedValue<uint32_t>  m_cWnd;         //!< Congestion window
-  TracedValue<uint32_t>  m_ssThresh;     //!< Slow Start Threshold
   uint32_t               m_initialCWnd;  //!< Initial cWnd value
   uint32_t               m_initialSsThresh;  //!< Initial Slow Start Threshold value
   uint32_t               m_retxThresh;   //!< Fast Retransmit threshold
--- a/src/internet/model/tcp-socket-base.cc	Mon Jul 13 08:26:43 2015 -0700
+++ b/src/internet/model/tcp-socket-base.cc	Mon Jul 13 10:02:55 2015 -0700
@@ -150,6 +150,14 @@
                      "Highest ack received from peer",
                      MakeTraceSourceAccessor (&TcpSocketBase::m_highRxAckMark),
                      "ns3::SequenceNumber32TracedValueCallback")
+    .AddTraceSource ("CongestionWindow",
+                     "The TCP connection's congestion window",
+                     MakeTraceSourceAccessor (&TcpSocketBase::m_cWnd),
+                     "ns3::TracedValue::Uint32Callback")
+    .AddTraceSource ("SlowStartThreshold",
+                     "TCP slow start threshold (bytes)",
+                     MakeTraceSourceAccessor (&TcpSocketBase::m_ssThresh),
+                     "ns3::TracedValue::Uint32Callback")
   ;
   return tid;
 }
@@ -221,6 +229,8 @@
     m_rWnd (sock.m_rWnd),
     m_highRxMark (sock.m_highRxMark),
     m_highRxAckMark (sock.m_highRxAckMark),
+    m_cWnd (sock.m_cWnd),
+    m_ssThresh (sock.m_ssThresh),
     m_winScalingEnabled (sock.m_winScalingEnabled),
     m_sndScaleFactor (sock.m_sndScaleFactor),
     m_rcvScaleFactor (sock.m_rcvScaleFactor),
--- a/src/internet/model/tcp-socket-base.h	Mon Jul 13 08:26:43 2015 -0700
+++ b/src/internet/model/tcp-socket-base.h	Mon Jul 13 10:02:55 2015 -0700
@@ -750,6 +750,10 @@
   TracedValue<SequenceNumber32> m_highRxMark;     //!< Highest seqno received
   TracedValue<SequenceNumber32> m_highRxAckMark;  //!< Highest ack received
 
+  // Congestion control
+  TracedValue<uint32_t> m_cWnd;     //!< Congestion window
+  TracedValue<uint32_t> m_ssThresh; //!< Slow start threshold
+
   // Options
   bool    m_winScalingEnabled;    //!< Window Scale option enabled
   uint8_t m_sndScaleFactor;       //!< Sent Window Scale (i.e., the one of the node)
--- a/src/internet/model/tcp-tahoe.cc	Mon Jul 13 08:26:43 2015 -0700
+++ b/src/internet/model/tcp-tahoe.cc	Mon Jul 13 10:02:55 2015 -0700
@@ -45,14 +45,6 @@
                     UintegerValue (3),
                     MakeUintegerAccessor (&TcpTahoe::m_retxThresh),
                     MakeUintegerChecker<uint32_t> ())
-    .AddTraceSource ("CongestionWindow",
-                     "The TCP connection's congestion window",
-                     MakeTraceSourceAccessor (&TcpTahoe::m_cWnd),
-                     "ns3::TracedValue::Uint32Callback")
-    .AddTraceSource ("SlowStartThreshold",
-                     "TCP slow start threshold (bytes)",
-                     MakeTraceSourceAccessor (&TcpTahoe::m_ssThresh),
-                     "ns3::TracedValue::Uint32Callback")
   ;
   return tid;
 }
@@ -64,8 +56,6 @@
 
 TcpTahoe::TcpTahoe (const TcpTahoe& sock)
   : TcpSocketBase (sock),
-    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)
--- a/src/internet/model/tcp-tahoe.h	Mon Jul 13 08:26:43 2015 -0700
+++ b/src/internet/model/tcp-tahoe.h	Mon Jul 13 10:02:55 2015 -0700
@@ -83,8 +83,6 @@
   void InitializeCwnd (void);
 
 protected:
-  TracedValue<uint32_t>  m_cWnd;         //!< Congestion window
-  TracedValue<uint32_t>  m_ssThresh;     //!< Slow Start Threshold
   uint32_t               m_initialCWnd;  //!< Initial cWnd value
   uint32_t               m_initialSsThresh;  //!< Initial Slow Start Threshold value
   uint32_t               m_retxThresh;   //!< Fast Retransmit threshold
--- a/src/internet/model/tcp-westwood.cc	Mon Jul 13 08:26:43 2015 -0700
+++ b/src/internet/model/tcp-westwood.cc	Mon Jul 13 10:02:55 2015 -0700
@@ -55,13 +55,6 @@
       .SetParent<TcpSocketBase>()
       .SetGroupName ("Internet")
       .AddConstructor<TcpWestwood>()
-      .AddTraceSource("CongestionWindow", "The TCP connection's congestion window",
-                      MakeTraceSourceAccessor(&TcpWestwood::m_cWnd),
-                      "ns3::TracedValue::Uint32Callback")
-      .AddTraceSource ("SlowStartThreshold",
-                       "TCP slow start threshold (bytes)",
-                       MakeTraceSourceAccessor (&TcpWestwood::m_ssThresh),
-                       "ns3::TracedValue::Uint32Callback")
       .AddAttribute("FilterType", "Use this to choose no filter or Tustin's approximation filter",
                     EnumValue(TcpWestwood::TUSTIN), MakeEnumAccessor(&TcpWestwood::m_fType),
                     MakeEnumChecker(TcpWestwood::NONE, "None", TcpWestwood::TUSTIN, "Tustin"))
@@ -92,8 +85,6 @@
 
 TcpWestwood::TcpWestwood (const TcpWestwood& sock) :
   TcpSocketBase(sock),
-  m_cWnd(sock.m_cWnd),
-  m_ssThresh(sock.m_ssThresh),
   m_initialCWnd(sock.m_initialCWnd),
   m_initialSsThresh (sock.m_initialSsThresh),
   m_inFastRec(false),
--- a/src/internet/model/tcp-westwood.h	Mon Jul 13 08:26:43 2015 -0700
+++ b/src/internet/model/tcp-westwood.h	Mon Jul 13 10:02:55 2015 -0700
@@ -164,8 +164,6 @@
   void Filtering (void);
 
 protected:
-  TracedValue<uint32_t>  m_cWnd;                   //!< Congestion window
-  TracedValue<uint32_t>  m_ssThresh;               //!< Slow Start Threshold
   uint32_t               m_initialCWnd;            //!< Initial cWnd value
   uint32_t               m_initialSsThresh;        //!< Initial Slow Start Threshold value
   bool                   m_inFastRec;              //!< Currently in fast recovery if TRUE