tcp: Add Tcp prefix to Recovery algorithms
This commit is contained in:
@@ -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.",
|
||||
|
||||
@@ -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<ClassicRecovery> ()
|
||||
.AddConstructor<PrrRecovery> ()
|
||||
static TypeId tid = TypeId ("ns3::TcpPrrRecovery")
|
||||
.SetParent<TcpClassicRecovery> ()
|
||||
.AddConstructor<TcpPrrRecovery> ()
|
||||
.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<TcpSocketState> tcb, uint32_t dupAckCount,
|
||||
TcpPrrRecovery::EnterRecovery (Ptr<TcpSocketState> 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<TcpSocketState> tcb, uint32_t dupAckCount,
|
||||
}
|
||||
|
||||
void
|
||||
PrrRecovery::DoRecovery (Ptr<TcpSocketState> tcb, uint32_t lastAckedBytes,
|
||||
TcpPrrRecovery::DoRecovery (Ptr<TcpSocketState> tcb, uint32_t lastAckedBytes,
|
||||
uint32_t lastSackedBytes)
|
||||
{
|
||||
NS_LOG_FUNCTION (this << tcb << lastAckedBytes << lastSackedBytes);
|
||||
@@ -121,7 +121,7 @@ PrrRecovery::DoRecovery (Ptr<TcpSocketState> tcb, uint32_t lastAckedBytes,
|
||||
}
|
||||
|
||||
void
|
||||
PrrRecovery::ExitRecovery (Ptr<TcpSocketState> tcb)
|
||||
TcpPrrRecovery::ExitRecovery (Ptr<TcpSocketState> tcb)
|
||||
{
|
||||
NS_LOG_FUNCTION (this << tcb);
|
||||
tcb->m_cWnd = tcb->m_ssThresh.Get ();
|
||||
@@ -129,20 +129,20 @@ PrrRecovery::ExitRecovery (Ptr<TcpSocketState> tcb)
|
||||
}
|
||||
|
||||
void
|
||||
PrrRecovery::UpdateBytesSent (uint32_t bytesSent)
|
||||
TcpPrrRecovery::UpdateBytesSent (uint32_t bytesSent)
|
||||
{
|
||||
NS_LOG_FUNCTION (this << bytesSent);
|
||||
m_prrOut += bytesSent;
|
||||
}
|
||||
|
||||
Ptr<TcpRecoveryOps>
|
||||
PrrRecovery::Fork (void)
|
||||
TcpPrrRecovery::Fork (void)
|
||||
{
|
||||
return CopyObject<PrrRecovery> (this);
|
||||
return CopyObject<TcpPrrRecovery> (this);
|
||||
}
|
||||
|
||||
std::string
|
||||
PrrRecovery::GetName () const
|
||||
TcpPrrRecovery::GetName () const
|
||||
{
|
||||
return "PrrRecovery";
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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<TcpRecoveryOps> ()
|
||||
.SetGroupName ("Internet")
|
||||
.AddConstructor<ClassicRecovery> ()
|
||||
.AddConstructor<TcpClassicRecovery> ()
|
||||
;
|
||||
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<TcpSocketState> tcb, uint32_t dupAckCount,
|
||||
TcpClassicRecovery::EnterRecovery (Ptr<TcpSocketState> 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<TcpSocketState> tcb, uint32_t dupAckCount,
|
||||
}
|
||||
|
||||
void
|
||||
ClassicRecovery::DoRecovery (Ptr<TcpSocketState> tcb, uint32_t lastAckedBytes,
|
||||
TcpClassicRecovery::DoRecovery (Ptr<TcpSocketState> tcb, uint32_t lastAckedBytes,
|
||||
uint32_t lastSackedBytes)
|
||||
{
|
||||
NS_LOG_FUNCTION (this << tcb << lastAckedBytes << lastSackedBytes);
|
||||
@@ -110,7 +110,7 @@ ClassicRecovery::DoRecovery (Ptr<TcpSocketState> tcb, uint32_t lastAckedBytes,
|
||||
}
|
||||
|
||||
void
|
||||
ClassicRecovery::ExitRecovery (Ptr<TcpSocketState> tcb)
|
||||
TcpClassicRecovery::ExitRecovery (Ptr<TcpSocketState> tcb)
|
||||
{
|
||||
NS_LOG_FUNCTION (this << tcb);
|
||||
// Follow NewReno procedures to exit FR if SACK is disabled
|
||||
@@ -122,15 +122,15 @@ ClassicRecovery::ExitRecovery (Ptr<TcpSocketState> tcb)
|
||||
}
|
||||
|
||||
std::string
|
||||
ClassicRecovery::GetName () const
|
||||
TcpClassicRecovery::GetName () const
|
||||
{
|
||||
return "ClassicRecovery";
|
||||
return "TcpClassicRecovery";
|
||||
}
|
||||
|
||||
Ptr<TcpRecoveryOps>
|
||||
ClassicRecovery::Fork ()
|
||||
TcpClassicRecovery::Fork ()
|
||||
{
|
||||
return CopyObject<ClassicRecovery> (this);
|
||||
return CopyObject<TcpClassicRecovery> (this);
|
||||
}
|
||||
|
||||
} // namespace ns3
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -85,10 +85,10 @@ ClassicRecoveryTest::DoRun ()
|
||||
m_state->m_segmentSize = m_segmentSize;
|
||||
m_state->m_ssThresh = m_ssThresh;
|
||||
|
||||
Ptr<ClassicRecovery> recovery = CreateObject <ClassicRecovery> ();
|
||||
Ptr<TcpClassicRecovery> recovery = CreateObject <TcpClassicRecovery> ();
|
||||
|
||||
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);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -108,7 +108,7 @@ PrrRecoveryTest::DoRun ()
|
||||
m_state->m_ssThresh = m_ssThresh;
|
||||
m_state->m_bytesInFlight = m_bytesInFlight;
|
||||
|
||||
Ptr<PrrRecovery> recovery = CreateObject <PrrRecovery> ();
|
||||
Ptr<TcpPrrRecovery> recovery = CreateObject <TcpPrrRecovery> ();
|
||||
recovery->SetAttribute ("ReductionBound", StringValue (m_reductionBound));
|
||||
|
||||
recovery->EnterRecovery (m_state, 3, m_unAckDataCount, 0);
|
||||
|
||||
Reference in New Issue
Block a user