|
A Discrete-Event Network Simulator
|
API
|
Go to the documentation of this file.
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);
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
SocketWho
Used as parameter of methods, specifies on what node the caller is interested (e.g.
void AddTestCase(TestCase *testCase, TestDuration duration=QUICK)
Add an individual child TestCase to this test suite.
virtual void BytesInFlightTrace(uint32_t oldValue, uint32_t newValue)
Track the bytes in flight.
AttributeValue implementation for Boolean.
uint32_t GetSize(void) const
Returns the the size in bytes of the packet (including the zero-filled initial payload).
SequenceNumber32 m_lastAckRecv
Last ACK received.
TestSuite: Check the value of BytesInFlight against a home-made guess.
SequenceNumber32 m_greatestSeqSent
greatest sequence number sent.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
void SetTransmitStart(Time startTime)
Set the initial time at which the application sends the first data packet.
void SetAppPktCount(uint32_t pktCount)
Set app packet count.
virtual void Rx(const Ptr< const Packet > p, const TcpHeader &h, SocketWho who)
Receive a packet.
TcpBytesInFlightTest(const std::string &desc, std::vector< uint32_t > &toDrop)
Constructor.
void ConfigureEnvironment()
Configure the test.
Ptr< TcpSocketMsgBase > GetSenderSocket()
Get the pointer to a previously created sender socket.
uint32_t GetSegSize(SocketWho who)
Get the segment size of the node specified.
SequenceNumber< uint32_t, int32_t > SequenceNumber32
32 bit Sequence number.
TcpBytesInFlightTestSuite()
void RTOExpired(Time oldVal, Time newVal)
Update when RTO expires.
void SetDropCallback(Callback< void, const Ipv4Header &, const TcpHeader &, Ptr< const Packet > > cb)
Set the drop callback.
Smart pointer class similar to boost::intrusive_ptr.
Time Now(void)
create an ns3::Time instance which contains the current simulation time.
void BeforeRTOExpired(const Ptr< const TcpSocketState > tcb, SocketWho who)
Do the checks before the RTO expires.
Time MilliSeconds(uint64_t value)
Construct a Time in the indicated unit.
Simulation virtual time values and global simulation resolution.
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...
General infrastructure for TCP testing.
void PktDropped(const Ipv4Header &ipH, const TcpHeader &tcpH, Ptr< const Packet > p)
Called when a packet is dropped.
Check the value of BytesInFlight against a home-made guess.
std::vector< uint32_t > m_toDrop
List of SequenceNumber to drop.
#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.
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
@ UNIT
This test suite implements a Unit Test.
Time Seconds(double value)
Construct a Time in the indicated unit.
static TcpBytesInFlightTestSuite g_tcpBytesInFlightTestSuite
Static variable for test initialization.
uint32_t m_guessedBytesInFlight
Guessed bytes in flight.
void SetDefault(std::string name, const AttributeValue &value)
virtual void Tx(const Ptr< const Packet > p, const TcpHeader &h, SocketWho who)
Transmit a packet.
void AddSeqToKill(const SequenceNumber32 &seq)
Add the sequence number to the list of segments to be killed.
Generic "sequence number" class.
void FinalChecks()
Do the final checks.
virtual Ptr< ErrorModel > CreateReceiverErrorModel()
Create a receiver error model.
double GetSeconds(void) const
Get an approximation of the time stored in this instance in the indicated unit.
void SetPropagationDelay(Time propDelay)
Propagation delay of the bottleneck link.
uint32_t m_dupAckRecv
Number of DupACKs received.