diff --git a/CHANGES.md b/CHANGES.md index f140090ee..553f152dc 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -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 . 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 diff --git a/src/internet/model/tcp-cubic.cc b/src/internet/model/tcp-cubic.cc index 3555effd3..ac01aebbc 100644 --- a/src/internet/model/tcp-cubic.cc +++ b/src/internet/model/tcp-cubic.cc @@ -62,10 +62,15 @@ TcpCubic::GetTypeId() MakeUintegerChecker()) .AddAttribute("HyStartDetect", "Hybrid Slow Start detection mechanisms:" - "1: packet train, 2: delay, 3: both", - IntegerValue(3), - MakeIntegerAccessor(&TcpCubic::m_hystartDetect), - MakeIntegerChecker(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), diff --git a/src/internet/model/tcp-cubic.h b/src/internet/model/tcp-cubic.h index d75974125..8802df62e 100644 --- a/src/internet/model/tcp-cubic.h +++ b/src/internet/model/tcp-cubic.h @@ -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 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