11#include "ns3/config.h"
110 m_guessedBytesInFlight(0),
113 m_greatestSeqSent(0),
217 NS_LOG_DEBUG(
"Dupack received, Update m_guessedBytesInFlight to "
261 <<
"; guessed and measured bytes in flight differs");
269 "Still present bytes in flight at the end of the transmission");
283 std::vector<uint32_t> toDrop;
285 TestCase::Duration::QUICK);
286 toDrop.push_back(4001);
288 TestCase::Duration::QUICK);
289 toDrop.push_back(4001);
292 TestCase::Duration::QUICK);
294 toDrop.push_back(4501);
298 TestCase::Duration::QUICK);
Check the value of BytesInFlight against a home-made guess.
void ConfigureEnvironment() override
Configure the test.
std::vector< uint32_t > m_toDrop
List of SequenceNumber to drop.
void BytesInFlightTrace(uint32_t oldValue, uint32_t newValue) override
Track the bytes in flight.
void FinalChecks() override
Do the final checks.
void BeforeRTOExpired(const Ptr< const TcpSocketState > tcb, SocketWho who) override
Do the checks before the RTO expires.
SequenceNumber32 m_lastAckRecv
Last ACK received.
uint32_t m_guessedBytesInFlight
Guessed bytes in flight.
void Tx(const Ptr< const Packet > p, const TcpHeader &h, SocketWho who) override
Transmit a packet.
void PktDropped(const Ipv4Header &ipH, const TcpHeader &tcpH, Ptr< const Packet > p)
Called when a packet is dropped.
TcpBytesInFlightTest(const std::string &desc, std::vector< uint32_t > &toDrop)
Constructor.
void RTOExpired(Time oldVal, Time newVal)
Update when RTO expires.
uint32_t m_dupAckRecv
Number of DupACKs received.
void Rx(const Ptr< const Packet > p, const TcpHeader &h, SocketWho who) override
Receive a packet.
Ptr< ErrorModel > CreateReceiverErrorModel() override
Create a receiver error model.
SequenceNumber32 m_greatestSeqSent
greatest sequence number sent.
TestSuite: Check the value of BytesInFlight against a home-made guess.
TcpBytesInFlightTestSuite()
Smart pointer class similar to boost::intrusive_ptr.
static Time Now()
Return the current simulation virtual time.
General infrastructure for TCP testing.
void SetPropagationDelay(Time propDelay)
Propagation delay of the bottleneck link.
void SetAppPktCount(uint32_t pktCount)
Set app packet count.
SocketWho
Used as parameter of methods, specifies on what node the caller is interested (e.g.
uint32_t GetSegSize(SocketWho who)
Get the segment size of the node specified.
virtual void ConfigureEnvironment()
Change the configuration of the environment.
Ptr< TcpSocketMsgBase > GetSenderSocket()
Get the pointer to a previously created sender socket.
void SetTransmitStart(Time startTime)
Set the initial time at which the application sends the first data packet.
void AddTestCase(TestCase *testCase, Duration duration=Duration::QUICK)
Add an individual child TestCase to this test suite.
static constexpr auto UNIT
Simulation virtual time values and global simulation resolution.
double GetSeconds() const
Get an approximation of the time stored in this instance in the indicated unit.
void SetDefault(std::string name, const AttributeValue &value)
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
Ptr< T > CreateObject(Args &&... args)
Create an object by type, with varying number of constructor parameters.
SequenceNumber< uint32_t, int32_t > SequenceNumber32
32 bit Sequence number.
#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.
Time MilliSeconds(uint64_t value)
Construct a Time in the indicated unit.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Callback< R, Args... > MakeCallback(R(T::*memPtr)(Args...), OBJ objPtr)
Build Callbacks for class method members which take varying numbers of arguments and potentially retu...
static TcpBytesInFlightTestSuite g_tcpBytesInFlightTestSuite
Static variable for test initialization.