23 #include "ns3/config.h"
78 virtual void BytesInFlightTrace (uint32_t oldValue, uint32_t newValue);
91 void ConfigureEnvironment ();
105 void RTOExpired (
Time oldVal,
Time newVal);
121 std::vector<uint32_t> &toDrop)
123 m_guessedBytesInFlight (0),
126 m_greatestSeqSent (0),
134 TcpGeneralTest::ConfigureEnvironment ();
146 for (std::vector<uint32_t>::iterator it =
m_toDrop.begin (); it !=
m_toDrop.end (); ++it)
208 if ((h.
GetFlags () & TcpHeader::FIN) != 0
220 && (h.
GetFlags () & TcpHeader::FIN) == 0)
232 NS_LOG_DEBUG (
"Dupack received, Update m_guessedBytesInFlight to " <<
245 static uint32_t times = 0;
276 "At time " <<
Simulator::Now ().GetSeconds () <<
"; guessed and measured bytes in flight differs");
283 "Still present bytes in flight at the end of the transmission");
298 std::vector<uint32_t> toDrop;
301 toDrop.push_back (4001);
304 toDrop.push_back (4001);
308 toDrop.push_back (4501);
Check the value of BytesInFlight against a home-made guess.
std::vector< uint32_t > m_toDrop
List of SequenceNumber to drop.
void ConfigureEnvironment()
Configure the test.
virtual Ptr< ErrorModel > CreateReceiverErrorModel()
Create a receiver error model.
virtual void Tx(const Ptr< const Packet > p, const TcpHeader &h, SocketWho who)
Transmit a packet.
SequenceNumber32 m_lastAckRecv
Last ACK received.
void FinalChecks()
Do the final checks.
uint32_t m_guessedBytesInFlight
Guessed bytes in flight.
void BeforeRTOExpired(const Ptr< const TcpSocketState > tcb, SocketWho who)
Do the checks before the RTO expires.
void PktDropped(const Ipv4Header &ipH, const TcpHeader &tcpH, Ptr< const Packet > p)
Called when a packet is dropped.
virtual void BytesInFlightTrace(uint32_t oldValue, uint32_t newValue)
Track the bytes in flight.
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.
virtual void Rx(const Ptr< const Packet > p, const TcpHeader &h, SocketWho who)
Receive a packet.
SequenceNumber32 m_greatestSeqSent
greatest sequence number sent.
TestSuite: Check the value of BytesInFlight against a home-made guess.
TcpBytesInFlightTestSuite()
AttributeValue implementation for Boolean.
uint32_t GetSize(void) 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(void) 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(void)
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, Ts... > MakeCallback(R(T::*memPtr)(Ts...), 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.