diff --git a/src/internet/model/tcp-l4-protocol.cc b/src/internet/model/tcp-l4-protocol.cc index ef05a98dc..75b5741d0 100644 --- a/src/internet/model/tcp-l4-protocol.cc +++ b/src/internet/model/tcp-l4-protocol.cc @@ -83,7 +83,7 @@ TcpL4Protocol::GetTypeId (void) MakeTypeIdChecker ()) .AddAttribute ("RecoveryType", "Recovery type of TCP objects.", - TypeIdValue (ClassicRecovery::GetTypeId ()), + TypeIdValue (TcpClassicRecovery::GetTypeId ()), MakeTypeIdAccessor (&TcpL4Protocol::m_recoveryTypeId), MakeTypeIdChecker ()) .AddAttribute ("SocketList", "The list of sockets associated to this protocol.", diff --git a/src/internet/model/tcp-prr-recovery.cc b/src/internet/model/tcp-prr-recovery.cc index 7c29bc729..3620ef497 100644 --- a/src/internet/model/tcp-prr-recovery.cc +++ b/src/internet/model/tcp-prr-recovery.cc @@ -28,33 +28,33 @@ namespace ns3 { -NS_LOG_COMPONENT_DEFINE ("PrrRecovery"); -NS_OBJECT_ENSURE_REGISTERED (PrrRecovery); +NS_LOG_COMPONENT_DEFINE ("TcpPrrRecovery"); +NS_OBJECT_ENSURE_REGISTERED (TcpPrrRecovery); TypeId -PrrRecovery::GetTypeId (void) +TcpPrrRecovery::GetTypeId (void) { - static TypeId tid = TypeId ("ns3::PrrRecovery") - .SetParent () - .AddConstructor () + static TypeId tid = TypeId ("ns3::TcpPrrRecovery") + .SetParent () + .AddConstructor () .SetGroupName ("Internet") .AddAttribute ("ReductionBound", "Type of Reduction Bound", EnumValue (SSRB), - MakeEnumAccessor (&PrrRecovery::m_reductionBoundMode), + MakeEnumAccessor (&TcpPrrRecovery::m_reductionBoundMode), MakeEnumChecker (CRB, "CRB", SSRB, "SSRB")) ; return tid; } -PrrRecovery::PrrRecovery (void) - : ClassicRecovery () +TcpPrrRecovery::TcpPrrRecovery (void) + : TcpClassicRecovery () { NS_LOG_FUNCTION (this); } -PrrRecovery::PrrRecovery (const PrrRecovery& recovery) - : ClassicRecovery (recovery), +TcpPrrRecovery::TcpPrrRecovery (const TcpPrrRecovery& recovery) + : TcpClassicRecovery (recovery), m_prrDelivered (recovery.m_prrDelivered), m_prrOut (recovery.m_prrOut), m_recoveryFlightSize (recovery.m_recoveryFlightSize), @@ -64,13 +64,13 @@ PrrRecovery::PrrRecovery (const PrrRecovery& recovery) NS_LOG_FUNCTION (this); } -PrrRecovery::~PrrRecovery (void) +TcpPrrRecovery::~TcpPrrRecovery (void) { NS_LOG_FUNCTION (this); } void -PrrRecovery::EnterRecovery (Ptr tcb, uint32_t dupAckCount, +TcpPrrRecovery::EnterRecovery (Ptr tcb, uint32_t dupAckCount, uint32_t unAckDataCount, uint32_t lastSackedBytes) { NS_LOG_FUNCTION (this << tcb << dupAckCount << unAckDataCount << lastSackedBytes); @@ -85,7 +85,7 @@ PrrRecovery::EnterRecovery (Ptr tcb, uint32_t dupAckCount, } void -PrrRecovery::DoRecovery (Ptr tcb, uint32_t lastAckedBytes, +TcpPrrRecovery::DoRecovery (Ptr tcb, uint32_t lastAckedBytes, uint32_t lastSackedBytes) { NS_LOG_FUNCTION (this << tcb << lastAckedBytes << lastSackedBytes); @@ -121,7 +121,7 @@ PrrRecovery::DoRecovery (Ptr tcb, uint32_t lastAckedBytes, } void -PrrRecovery::ExitRecovery (Ptr tcb) +TcpPrrRecovery::ExitRecovery (Ptr tcb) { NS_LOG_FUNCTION (this << tcb); tcb->m_cWnd = tcb->m_ssThresh.Get (); @@ -129,20 +129,20 @@ PrrRecovery::ExitRecovery (Ptr tcb) } void -PrrRecovery::UpdateBytesSent (uint32_t bytesSent) +TcpPrrRecovery::UpdateBytesSent (uint32_t bytesSent) { NS_LOG_FUNCTION (this << bytesSent); m_prrOut += bytesSent; } Ptr -PrrRecovery::Fork (void) +TcpPrrRecovery::Fork (void) { - return CopyObject (this); + return CopyObject (this); } std::string -PrrRecovery::GetName () const +TcpPrrRecovery::GetName () const { return "PrrRecovery"; } diff --git a/src/internet/model/tcp-prr-recovery.h b/src/internet/model/tcp-prr-recovery.h index 449dbd182..eb9d5c97f 100644 --- a/src/internet/model/tcp-prr-recovery.h +++ b/src/internet/model/tcp-prr-recovery.h @@ -38,7 +38,7 @@ namespace ns3 { * algorithm. PRR also improves accuracy of the amount of data sent * during loss recovery. */ -class PrrRecovery : public ClassicRecovery +class TcpPrrRecovery : public TcpClassicRecovery { public: /** @@ -50,15 +50,15 @@ public: /** * Create an unbound tcp socket. */ - PrrRecovery (void); + TcpPrrRecovery (void); /** * \brief Copy constructor * \param sock the object to copy */ - PrrRecovery (const PrrRecovery& sock); + TcpPrrRecovery (const TcpPrrRecovery& sock); - virtual ~PrrRecovery (void) override; + virtual ~TcpPrrRecovery (void) override; /** * \brief Reduction Bound variant (CRB or SSRB) diff --git a/src/internet/model/tcp-recovery-ops.cc b/src/internet/model/tcp-recovery-ops.cc index de72a2f22..b70fdbc9a 100644 --- a/src/internet/model/tcp-recovery-ops.cc +++ b/src/internet/model/tcp-recovery-ops.cc @@ -59,37 +59,37 @@ TcpRecoveryOps::~TcpRecoveryOps () // Classic recovery -NS_OBJECT_ENSURE_REGISTERED (ClassicRecovery); +NS_OBJECT_ENSURE_REGISTERED (TcpClassicRecovery); TypeId -ClassicRecovery::GetTypeId (void) +TcpClassicRecovery::GetTypeId (void) { - static TypeId tid = TypeId ("ns3::ClassicRecovery") + static TypeId tid = TypeId ("ns3::TcpClassicRecovery") .SetParent () .SetGroupName ("Internet") - .AddConstructor () + .AddConstructor () ; return tid; } -ClassicRecovery::ClassicRecovery (void) : TcpRecoveryOps () +TcpClassicRecovery::TcpClassicRecovery (void) : TcpRecoveryOps () { NS_LOG_FUNCTION (this); } -ClassicRecovery::ClassicRecovery (const ClassicRecovery& sock) +TcpClassicRecovery::TcpClassicRecovery (const TcpClassicRecovery& sock) : TcpRecoveryOps (sock) { NS_LOG_FUNCTION (this); } -ClassicRecovery::~ClassicRecovery (void) +TcpClassicRecovery::~TcpClassicRecovery (void) { NS_LOG_FUNCTION (this); } void -ClassicRecovery::EnterRecovery (Ptr tcb, uint32_t dupAckCount, +TcpClassicRecovery::EnterRecovery (Ptr tcb, uint32_t dupAckCount, uint32_t unAckDataCount, uint32_t lastSackedBytes) { NS_LOG_FUNCTION (this << tcb << dupAckCount << unAckDataCount << lastSackedBytes); @@ -100,7 +100,7 @@ ClassicRecovery::EnterRecovery (Ptr tcb, uint32_t dupAckCount, } void -ClassicRecovery::DoRecovery (Ptr tcb, uint32_t lastAckedBytes, +TcpClassicRecovery::DoRecovery (Ptr tcb, uint32_t lastAckedBytes, uint32_t lastSackedBytes) { NS_LOG_FUNCTION (this << tcb << lastAckedBytes << lastSackedBytes); @@ -110,7 +110,7 @@ ClassicRecovery::DoRecovery (Ptr tcb, uint32_t lastAckedBytes, } void -ClassicRecovery::ExitRecovery (Ptr tcb) +TcpClassicRecovery::ExitRecovery (Ptr tcb) { NS_LOG_FUNCTION (this << tcb); // Follow NewReno procedures to exit FR if SACK is disabled @@ -122,15 +122,15 @@ ClassicRecovery::ExitRecovery (Ptr tcb) } std::string -ClassicRecovery::GetName () const +TcpClassicRecovery::GetName () const { - return "ClassicRecovery"; + return "TcpClassicRecovery"; } Ptr -ClassicRecovery::Fork () +TcpClassicRecovery::Fork () { - return CopyObject (this); + return CopyObject (this); } } // namespace ns3 diff --git a/src/internet/model/tcp-recovery-ops.h b/src/internet/model/tcp-recovery-ops.h index 596f1a36a..64af71578 100644 --- a/src/internet/model/tcp-recovery-ops.h +++ b/src/internet/model/tcp-recovery-ops.h @@ -153,7 +153,7 @@ public: * * \see DoRecovery */ -class ClassicRecovery : public TcpRecoveryOps +class TcpClassicRecovery : public TcpRecoveryOps { public: /** @@ -165,18 +165,18 @@ public: /** * \brief Constructor */ - ClassicRecovery (); + TcpClassicRecovery (); /** * \brief Copy constructor. * \param recovery object to copy. */ - ClassicRecovery (const ClassicRecovery& recovery); + TcpClassicRecovery (const TcpClassicRecovery& recovery); /** * \brief Constructor */ - virtual ~ClassicRecovery () override; + virtual ~TcpClassicRecovery () override; virtual std::string GetName () const override; diff --git a/src/internet/test/tcp-classic-recovery-test.cc b/src/internet/test/tcp-classic-recovery-test.cc index 2d6a23025..c45f1fb52 100644 --- a/src/internet/test/tcp-classic-recovery-test.cc +++ b/src/internet/test/tcp-classic-recovery-test.cc @@ -85,10 +85,10 @@ ClassicRecoveryTest::DoRun () m_state->m_segmentSize = m_segmentSize; m_state->m_ssThresh = m_ssThresh; - Ptr recovery = CreateObject (); + Ptr recovery = CreateObject (); - NS_TEST_ASSERT_MSG_EQ (recovery->GetName (), "ClassicRecovery", - "The name of recovery used should be ClassicRecovery"); + NS_TEST_ASSERT_MSG_EQ (recovery->GetName (), "TcpClassicRecovery", + "The name of recovery used should be TcpClassicRecovery"); recovery->EnterRecovery (m_state, m_dupAckCount, 1000, 0); NS_TEST_ASSERT_MSG_EQ (m_state->m_cWnd, m_state->m_ssThresh, @@ -122,7 +122,8 @@ class ClassicRecoveryTestSuite : public TestSuite public: ClassicRecoveryTestSuite () : TestSuite ("tcp-classic-recovery-test", UNIT) { - AddTestCase (new ClassicRecoveryTest (3000, 500, 2500, 3, "Classic recovery test on cWnd and cWndInfl with 500 bytes segmentSize"), + AddTestCase (new ClassicRecoveryTest (3000, 500, 2500, 3, + "Classic recovery test on cWnd and cWndInfl with 500 bytes segmentSize"), TestCase::QUICK); } }; diff --git a/src/internet/test/tcp-general-test.cc b/src/internet/test/tcp-general-test.cc index b678ed1f1..bbaa6ea06 100644 --- a/src/internet/test/tcp-general-test.cc +++ b/src/internet/test/tcp-general-test.cc @@ -37,7 +37,7 @@ NS_LOG_COMPONENT_DEFINE ("TcpGeneralTest"); TcpGeneralTest::TcpGeneralTest (const std::string &desc) : TestCase (desc), m_congControlTypeId (TcpNewReno::GetTypeId ()), - m_recoveryTypeId (ClassicRecovery::GetTypeId ()), + m_recoveryTypeId (TcpClassicRecovery::GetTypeId ()), m_remoteAddr (Ipv4Address::GetAny (), 4477) { NS_LOG_FUNCTION (this << desc); diff --git a/src/internet/test/tcp-prr-recovery-test.cc b/src/internet/test/tcp-prr-recovery-test.cc index e645b9104..e23c3ef24 100644 --- a/src/internet/test/tcp-prr-recovery-test.cc +++ b/src/internet/test/tcp-prr-recovery-test.cc @@ -108,7 +108,7 @@ PrrRecoveryTest::DoRun () m_state->m_ssThresh = m_ssThresh; m_state->m_bytesInFlight = m_bytesInFlight; - Ptr recovery = CreateObject (); + Ptr recovery = CreateObject (); recovery->SetAttribute ("ReductionBound", StringValue (m_reductionBound)); recovery->EnterRecovery (m_state, 3, m_unAckDataCount, 0);