A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
Bug772ChainTest Class Reference

AODV deferred route lookup test case (see Bug 772 ) More...

#include "bug-772.h"

+ Inheritance diagram for Bug772ChainTest:
+ Collaboration diagram for Bug772ChainTest:

Public Member Functions

 Bug772ChainTest (const char *const prefix, const char *const proto, Time time, uint32_t size)
 Create test case.
 
 ~Bug772ChainTest () override
 
- Public Member Functions inherited from ns3::TestCase
 TestCase (const TestCase &)=delete
 
virtual ~TestCase ()
 Destructor.
 
std::string GetName () const
 
TestCaseoperator= (const TestCase &)=delete
 

Private Member Functions

void CheckResults ()
 Compare traces with reference ones.
 
void CreateDevices ()
 Create devices, install TCP/IP stack and applications.
 
void CreateNodes ()
 Create test topology.
 
void DoRun () override
 Go.
 
void HandleRead (Ptr< Socket > socket)
 Receive data function.
 
void SendData (Ptr< Socket > socket)
 Send data.
 

Private Attributes

NodeContainerm_nodes
 
const uint16_t m_port
 port number
 
const std::string m_prefix
 PCAP file names prefix.
 
const std::string m_proto
 Socket factory TID.
 
uint32_t m_receivedPackets
 Received packet count.
 
Ptr< Socketm_recvSocket
 Receiving socket.
 
Ptr< Socketm_sendSocket
 Transmitting socket.
 
const uint32_t m_size
 Chain size.
 
const double m_step
 Chain step, meters.
 
const Time m_time
 Total simulation time.
 

Additional Inherited Members

- Public Types inherited from ns3::TestCase
enum class  Duration { QUICK = 1 , EXTENSIVE = 2 , TAKES_FOREVER = 3 }
 How long the test takes to execute. More...
 
- Static Public Attributes inherited from ns3::TestCase
static constexpr auto QUICK = Duration::QUICK
 Deprecated test duration simple enums.
 
static constexpr auto EXTENSIVE = Duration::EXTENSIVE
 
static constexpr auto TAKES_FOREVER = Duration::TAKES_FOREVER
 
- Protected Member Functions inherited from ns3::TestCase
 TestCase (std::string name)
 Constructor.
 
void AddTestCase (TestCase *testCase, Duration duration=Duration::QUICK)
 Add an individual child TestCase to this test suite.
 
TestCaseGetParent () const
 Get the parent of this TestCase.
 
bool IsStatusFailure () const
 Check if any tests failed.
 
bool IsStatusSuccess () const
 Check if all tests passed.
 
void SetDataDir (std::string directory)
 Set the data directory where reference trace files can be found.
 
void ReportTestFailure (std::string cond, std::string actual, std::string limit, std::string message, std::string file, int32_t line)
 Log the failure of this TestCase.
 
bool MustAssertOnFailure () const
 Check if this run should assert on failure.
 
bool MustContinueOnFailure () const
 Check if this run should continue on failure.
 
std::string CreateDataDirFilename (std::string filename)
 Construct the full path to a file in the data directory.
 
std::string CreateTempDirFilename (std::string filename)
 Construct the full path to a file in a temporary directory.
 

Detailed Description

AODV deferred route lookup test case (see Bug 772 )

UDP packet transfers are delayed while a route is found and then while ARP completes. Eight packets should be sent, queued until the path becomes functional, and then delivered.

Definition at line 28 of file bug-772.h.

Constructor & Destructor Documentation

◆ Bug772ChainTest()

Bug772ChainTest::Bug772ChainTest ( const char *const prefix,
const char *const proto,
Time time,
uint32_t size )

Create test case.

Parameters
prefixUnique file names prefix
protons3::UdpSocketFactory or ns3::TcpSocketFactory
sizeNumber of nodes in the chain
timeSimulation time

Definition at line 38 of file bug-772.cc.

◆ ~Bug772ChainTest()

Bug772ChainTest::~Bug772ChainTest ( )
override

Definition at line 54 of file bug-772.cc.

References m_nodes.

Member Function Documentation

◆ CheckResults()

void Bug772ChainTest::CheckResults ( )
private

Compare traces with reference ones.

Definition at line 200 of file bug-772.cc.

References m_receivedPackets, and NS_TEST_EXPECT_MSG_EQ.

Referenced by DoRun().

+ Here is the caller graph for this function:

◆ CreateDevices()

void Bug772ChainTest::CreateDevices ( )
private

◆ CreateNodes()

void Bug772ChainTest::CreateNodes ( )
private

Create test topology.

Definition at line 101 of file bug-772.cc.

References ns3::NodeContainer::Create(), m_nodes, m_size, and m_step.

Referenced by DoRun().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ DoRun()

void Bug772ChainTest::DoRun ( )
overrideprivatevirtual

Go.

Implements ns3::TestCase.

Definition at line 80 of file bug-772.cc.

References CheckResults(), CreateDevices(), CreateNodes(), ns3::Simulator::Destroy(), m_nodes, m_time, ns3::Simulator::Run(), ns3::Seconds(), ns3::Config::SetDefault(), ns3::RngSeedManager::SetRun(), ns3::RngSeedManager::SetSeed(), and ns3::Simulator::Stop().

+ Here is the call graph for this function:

◆ HandleRead()

void Bug772ChainTest::HandleRead ( Ptr< Socket > socket)
private

Receive data function.

Parameters
socketthe socket to receive from

Definition at line 74 of file bug-772.cc.

References m_receivedPackets.

Referenced by CreateDevices().

+ Here is the caller graph for this function:

◆ SendData()

void Bug772ChainTest::SendData ( Ptr< Socket > socket)
private

Send data.

Parameters
socketthe sending socket

Definition at line 60 of file bug-772.cc.

References ns3::Create(), m_time, ns3::Simulator::Now(), ns3::Simulator::ScheduleWithContext(), ns3::Seconds(), and SendData().

Referenced by CreateDevices(), and SendData().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ m_nodes

NodeContainer* Bug772ChainTest::m_nodes
private
Internal: It is important to have pointers here

Definition at line 44 of file bug-772.h.

Referenced by ~Bug772ChainTest(), CreateDevices(), CreateNodes(), and DoRun().

◆ m_port

const uint16_t Bug772ChainTest::m_port
private

port number

Definition at line 57 of file bug-772.h.

Referenced by CreateDevices().

◆ m_prefix

const std::string Bug772ChainTest::m_prefix
private

PCAP file names prefix.

Definition at line 47 of file bug-772.h.

◆ m_proto

const std::string Bug772ChainTest::m_proto
private

Socket factory TID.

Definition at line 49 of file bug-772.h.

Referenced by CreateDevices().

◆ m_receivedPackets

uint32_t Bug772ChainTest::m_receivedPackets
private

Received packet count.

Definition at line 79 of file bug-772.h.

Referenced by CheckResults(), and HandleRead().

◆ m_recvSocket

Ptr<Socket> Bug772ChainTest::m_recvSocket
private

Receiving socket.

Definition at line 74 of file bug-772.h.

Referenced by CreateDevices().

◆ m_sendSocket

Ptr<Socket> Bug772ChainTest::m_sendSocket
private

Transmitting socket.

Definition at line 76 of file bug-772.h.

Referenced by CreateDevices().

◆ m_size

const uint32_t Bug772ChainTest::m_size
private

Chain size.

Definition at line 53 of file bug-772.h.

Referenced by CreateDevices(), and CreateNodes().

◆ m_step

const double Bug772ChainTest::m_step
private

Chain step, meters.

Definition at line 55 of file bug-772.h.

Referenced by CreateNodes().

◆ m_time

const Time Bug772ChainTest::m_time
private

Total simulation time.

Definition at line 51 of file bug-772.h.

Referenced by DoRun(), and SendData().


The documentation for this class was generated from the following files: