internet: Change TcpCubic attribute HyStartDetect from int to enum

This commit is contained in:
Eduardo Almeida
2022-11-19 22:56:44 +00:00
committed by Tommaso Pecorella
parent fec6a2c1d7
commit 0c16c4a434
3 changed files with 27 additions and 20 deletions

View File

@@ -23,7 +23,8 @@ Changes from ns-3.37 to ns-3.38
### Changes to existing API
* (network) **Ipv4Address** and **Ipv6Address** now do not raise an exception if built from an invalid string. Instead the address is marked as not initialized.
* (internet) TCP Westwood model has been removed due to a bug in BW estimation documented in https://gitlab.com/nsnam/ns-3-dev/-/issues/579. The TCP Westwood+ model is now named **TcpWestwoodPlus** and can be instantiated like all the other TCP flavors.
* (internet) TCP Westwood model has been removed due to a bug in BW estimation documented in <https://gitlab.com/nsnam/ns-3-dev/-/issues/579>. The TCP Westwood+ model is now named **TcpWestwoodPlus** and can be instantiated like all the other TCP flavors.
* (internet) `TcpCubic` attribute `HyStartDetect` changed from `int` to `enum HybridSSDetectionMode`.
### Changes to build system

View File

@@ -62,10 +62,15 @@ TcpCubic::GetTypeId()
MakeUintegerChecker<uint32_t>())
.AddAttribute("HyStartDetect",
"Hybrid Slow Start detection mechanisms:"
"1: packet train, 2: delay, 3: both",
IntegerValue(3),
MakeIntegerAccessor(&TcpCubic::m_hystartDetect),
MakeIntegerChecker<int>(1, 3))
"packet train, delay, both",
EnumValue(HybridSSDetectionMode::BOTH),
MakeEnumAccessor(&TcpCubic::m_hystartDetect),
MakeEnumChecker(HybridSSDetectionMode::PACKET_TRAIN,
"PACKET_TRAIN",
HybridSSDetectionMode::DELAY,
"DELAY",
HybridSSDetectionMode::BOTH,
"BOTH"))
.AddAttribute("HyStartMinSamples",
"Number of delay samples for detecting the increase of delay",
UintegerValue(8),

View File

@@ -69,6 +69,16 @@ namespace ns3
class TcpCubic : public TcpCongestionOps
{
public:
/**
* \brief Values to detect the Slow Start mode of HyStart
*/
enum HybridSSDetectionMode
{
PACKET_TRAIN = 1, //!< Detection by trains of packet
DELAY = 2, //!< Detection by delay value
BOTH = 3, //!< Detection by both
};
/**
* \brief Get the type ID.
* \return the object TypeId
@@ -93,24 +103,15 @@ class TcpCubic : public TcpCongestionOps
Ptr<TcpCongestionOps> Fork() override;
private:
/**
* \brief Values to detect the Slow Start mode of HyStart
*/
enum HybridSSDetectionMode
{
PACKET_TRAIN = 0x1, //!< Detection by trains of packet
DELAY = 0x2 //!< Detection by delay value
};
bool m_fastConvergence; //!< Enable or disable fast convergence algorithm
double m_beta; //!< Beta for cubic multiplicative increase
bool m_hystart; //!< Enable or disable HyStart algorithm
int m_hystartDetect; //!< Detect way for HyStart algorithm \see HybridSSDetectionMode
uint32_t m_hystartLowWindow; //!< Lower bound cWnd for hybrid slow start (segments)
Time m_hystartAckDelta; //!< Spacing between ack's indicating train
Time m_hystartDelayMin; //!< Minimum time for hystart algorithm
Time m_hystartDelayMax; //!< Maximum time for hystart algorithm
bool m_hystart; //!< Enable or disable HyStart algorithm
HybridSSDetectionMode m_hystartDetect; //!< Detect way for HyStart algorithm
uint32_t m_hystartLowWindow; //!< Lower bound cWnd for hybrid slow start (segments)
Time m_hystartAckDelta; //!< Spacing between ack's indicating train
Time m_hystartDelayMin; //!< Minimum time for hystart algorithm
Time m_hystartDelayMax; //!< Maximum time for hystart algorithm
uint8_t m_hystartMinSamples; //!< Number of delay samples for detecting the increase of delay
uint32_t m_initialCwnd; //!< Initial cWnd