26 #include "ns3/tcp-congestion-ops.h"
27 #include "ns3/tcp-socket-base.h"
28 #include "ns3/tcp-bbr.h"
48 virtual void DoRun (
void);
80 "BBR has not updated pacing value");
98 virtual void DoRun (
void);
108 double highGain,
const std::string &name)
111 m_highGain (highGain)
127 double actualPacingGain, actualCwndGain, desiredPacingGain =
m_highGain, desiredCwndGain =
m_highGain;
132 cong->EnterStartup ();
135 actualPacingGain = cong->GetPacingGain ();
136 actualCwndGain = cong->GetCwndGain ();
146 cong->EnterProbeBW ();
153 desiredPacingGain = 1.25;
158 cong->EnterProbeRTT ();
159 desiredPacingGain = 1;
167 actualPacingGain = cong->GetPacingGain ();
168 actualCwndGain = cong->GetCwndGain ();
170 NS_TEST_ASSERT_MSG_EQ (actualPacingGain, desiredPacingGain,
"BBR has not updated into desired pacing gain");
171 NS_TEST_ASSERT_MSG_EQ (actualCwndGain, desiredCwndGain,
"BBR has not updated into desired cwnd gain");
This class can be used to hold variables of floating point type such as 'double' or 'float'.
static void Destroy(void)
Execute the events scheduled with ScheduleDestroy().
static EventId Schedule(Time const &delay, FUNC f, Ts &&... args)
Schedule an event to expire after delay.
static void Run(void)
Run the simulation.
Tests whether BBR sets correct value of pacing and cwnd gain based on different state.
TcpBbrCheckGainValuesTest(TcpBbr::BbrMode_t state, double highGain, const std::string &name)
constructor
TcpBbr::BbrMode_t m_mode
BBR mode under test.
double m_highGain
Value of BBR high gain.
virtual void DoRun(void)
Implementation to actually run this TestCase.
void ExecuteTest(void)
Execute the test.
BbrMode_t
BBR has the following 4 modes for deciding how fast to send:
@ BBR_PROBE_RTT
Cut inflight to min to probe min_rtt.
@ BBR_DRAIN
Drain any queue created during startup.
@ BBR_STARTUP
Ramp up sending rate rapidly to fill pipe.
@ BBR_PROBE_BW
Discover, share bw: pace around estimated bw.
Testing whether BBR enables pacing.
void ExecuteTest(void)
Execute the test.
TcpBbrPacingEnableTest(bool pacing, const std::string &name)
constructor
bool m_pacing
Initial pacing configuration.
virtual void DoRun(void)
Implementation to actually run this TestCase.
TcpBbrTestSuite()
constructor
bool m_pacing
Pacing status.
@ CA_OPEN
Normal state, no dubious events.
void AddTestCase(TestCase *testCase, TestDuration duration=QUICK)
Add an individual child TestCase to this test suite.
@ UNIT
This test suite implements a Unit Test.
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_TEST_ASSERT_MSG_EQ(actual, limit, msg)
Test that an actual and expected (limit) value are equal and report and abort if not.
Time Seconds(double value)
Construct a Time in the indicated unit.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
static TcpBbrTestSuite g_tcpBbrTest
static variable for test initialization