22 #include "ns3/config.h"
77 void BytesInFlightTrace(uint32_t oldValue, uint32_t newValue)
override;
90 void ConfigureEnvironment()
override;
104 void RTOExpired(
Time oldVal,
Time newVal);
109 void FinalChecks()
override;
121 m_guessedBytesInFlight(0),
124 m_greatestSeqSent(0),
132 TcpGeneralTest::ConfigureEnvironment();
216 (h.
GetFlags() & TcpHeader::FIN) == 0)
228 NS_LOG_DEBUG(
"Dupack received, Update m_guessedBytesInFlight to "
240 static uint32_t times = 0;
272 <<
"; guessed and measured bytes in flight differs");
280 "Still present bytes in flight at the end of the transmission");
294 std::vector<uint32_t> toDrop;
297 toDrop.push_back(4001);
300 toDrop.push_back(4001);
305 toDrop.push_back(4501);
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()
uint32_t GetSize() const
Returns the the size in bytes of the packet (including the zero-filled initial payload).
Smart pointer class similar to boost::intrusive_ptr.
void SetDropCallback(Callback< void, const Ipv4Header &, const TcpHeader &, Ptr< const Packet >> cb)
Set the drop callback.
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.
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 AddSeqToKill(const SequenceNumber32 &seq)
Add the sequence number to the list of segments to be killed.
void AddTestCase(TestCase *testCase, TestDuration duration=QUICK)
Add an individual child TestCase to this test suite.
@ UNIT
This test suite implements a Unit Test.
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.
SequenceNumber< uint32_t, int32_t > SequenceNumber32
32 bit Sequence number.
Time Now()
create an ns3::Time instance which contains the current simulation time.
#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.