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

The topology is of the form: More...

+ Inheritance diagram for NixVectorRoutingTest:
+ Collaboration diagram for NixVectorRoutingTest:

Public Member Functions

 NixVectorRoutingTest ()
 
void DoRun () override
 Implementation to actually run this TestCase.
 
void ReceivePkt (Ptr< Socket > socket)
 Receive data.
 
- Public Member Functions inherited from ns3::TestCase
 TestCase (const TestCase &)=delete
 
virtual ~TestCase ()
 Destructor.
 
std::string GetName () const
 
TestCaseoperator= (const TestCase &)=delete
 

Public Attributes

std::vector< uint32_tm_receivedPacketSizes
 Received packet sizes.
 

Private Member Functions

void DoSendDatav4 (Ptr< Socket > socket, Ipv4Address to)
 Send data immediately after being called.
 
void DoSendDatav6 (Ptr< Socket > socket, Ipv6Address to)
 Send data immediately after being called.
 
void SendData (Time delay, Ptr< Socket > socket, Ipv4Address to)
 Schedules the DoSendData () function to send the data.
 
void SendData (Time delay, Ptr< Socket > socket, Ipv6Address to)
 Schedules the DoSendData () function to send the data.
 

Private Attributes

Ptr< Packetm_receivedPacket
 Received packet.
 

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

The topology is of the form:

           __________
          /          \
 nSrc -- nA -- nB -- nC -- nDst

Following are the tests in this test case:

  • Test the routing from nSrc to nDst.
  • Test if the path taken is the shortest path. (Set down the interface of nA on nA-nC channel.)
  • Test if the NixCache and Ipv4RouteCache are empty.
  • Test the routing from nSrc to nDst again.
  • Test if the new shortest path is taken. (Set down the interface of nC on nB-nC channel.)
  • Test that routing is not possible from nSrc to nDst.

IPv4 Nix-Vector Routing Test

Definition at line 54 of file nix-test.cc.

Constructor & Destructor Documentation

◆ NixVectorRoutingTest()

NixVectorRoutingTest::NixVectorRoutingTest ( )

Definition at line 101 of file nix-test.cc.

Member Function Documentation

◆ DoRun()

◆ DoSendDatav4()

void NixVectorRoutingTest::DoSendDatav4 ( Ptr< Socket > socket,
Ipv4Address to )
private

Send data immediately after being called.

Parameters
socketThe sending socket.
toIPv4 Destination address.

Definition at line 118 of file nix-test.cc.

References ns3::Create().

Referenced by SendData().

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

◆ DoSendDatav6()

void NixVectorRoutingTest::DoSendDatav6 ( Ptr< Socket > socket,
Ipv6Address to )
private

Send data immediately after being called.

Parameters
socketThe sending socket.
toIPv6 Destination address.

Definition at line 125 of file nix-test.cc.

References ns3::Create().

Referenced by SendData().

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

◆ ReceivePkt()

void NixVectorRoutingTest::ReceivePkt ( Ptr< Socket > socket)

Receive data.

Parameters
socketThe receiving socket.

Definition at line 107 of file nix-test.cc.

References ns3::Packet::GetSize(), m_receivedPacket, m_receivedPacketSizes, and NS_TEST_ASSERT_MSG_EQ.

Referenced by DoRun().

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

◆ SendData() [1/2]

void NixVectorRoutingTest::SendData ( Time delay,
Ptr< Socket > socket,
Ipv4Address to )
private

Schedules the DoSendData () function to send the data.

Parameters
delayThe scheduled time to send data.
socketThe sending socket.
toIPv4 Destination address.

Definition at line 132 of file nix-test.cc.

References ns3::Create(), DoSendDatav4(), m_receivedPacket, and ns3::Simulator::ScheduleWithContext().

Referenced by DoRun().

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

◆ SendData() [2/2]

void NixVectorRoutingTest::SendData ( Time delay,
Ptr< Socket > socket,
Ipv6Address to )
private

Schedules the DoSendData () function to send the data.

Parameters
delayThe scheduled time to send data.
socketThe sending socket.
toIPv6 Destination address.

Definition at line 144 of file nix-test.cc.

References ns3::Create(), DoSendDatav6(), m_receivedPacket, and ns3::Simulator::ScheduleWithContext().

+ Here is the call graph for this function:

Member Data Documentation

◆ m_receivedPacket

Ptr<Packet> NixVectorRoutingTest::m_receivedPacket
private

Received packet.

Definition at line 56 of file nix-test.cc.

Referenced by ReceivePkt(), SendData(), and SendData().

◆ m_receivedPacketSizes

std::vector<uint32_t> NixVectorRoutingTest::m_receivedPacketSizes

Received packet sizes.

Definition at line 98 of file nix-test.cc.

Referenced by DoRun(), and ReceivePkt().


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