A Discrete-Event Network Simulator
API
NixVectorRoutingTest Class Reference

The topology is of the form: More...

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

Public Member Functions

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

Public Attributes

std::vector< uint32_t > m_receivedPacketSizes
 Received packet sizes. More...
 

Private Member Functions

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

Private Attributes

Ptr< Packetm_receivedPacket
 Received packet. More...
 

Additional Inherited Members

- Public Types inherited from ns3::TestCase
enum  TestDuration { QUICK = 1 , EXTENSIVE = 2 , TAKES_FOREVER = 3 }
 How long the test takes to execute. More...
 
- Protected Member Functions inherited from ns3::TestCase
 TestCase (std::string name)
 Constructor. More...
 
void AddTestCase (TestCase *testCase, TestDuration duration=QUICK)
 Add an individual child TestCase to this test suite. More...
 
TestCaseGetParent () const
 Get the parent of this TestCsse. More...
 
bool IsStatusFailure (void) const
 Check if any tests failed. More...
 
bool IsStatusSuccess (void) const
 Check if all tests passed. More...
 
void SetDataDir (std::string directory)
 Set the data directory where reference trace files can be found. More...
 
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. More...
 
bool MustAssertOnFailure (void) const
 Check if this run should assert on failure. More...
 
bool MustContinueOnFailure (void) const
 Check if this run should continue on failure. More...
 
std::string CreateDataDirFilename (std::string filename)
 Construct the full path to a file in the data directory. More...
 
std::string CreateTempDirFilename (std::string filename)
 Construct the full path to a file in a temporary directory. More...
 

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 66 of file nix-test.cc.

Constructor & Destructor Documentation

◆ NixVectorRoutingTest()

NixVectorRoutingTest::NixVectorRoutingTest ( )

Definition at line 113 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 128 of file nix-test.cc.

References ns3::Socket::SendTo().

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 135 of file nix-test.cc.

References ns3::Socket::SendTo().

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 118 of file nix-test.cc.

References ns3::Socket::GetRxAvailable(), ns3::Packet::GetSize(), m_receivedPacket, m_receivedPacketSizes, max, NS_TEST_ASSERT_MSG_EQ, and ns3::Socket::Recv().

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 142 of file nix-test.cc.

References DoSendDatav4(), ns3::Node::GetId(), ns3::Socket::GetNode(), and m_receivedPacket.

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 150 of file nix-test.cc.

References DoSendDatav6(), ns3::Node::GetId(), ns3::Socket::GetNode(), and m_receivedPacket.

+ Here is the call graph for this function:

Member Data Documentation

◆ m_receivedPacket

Ptr<Packet> NixVectorRoutingTest::m_receivedPacket
private

Received packet.

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

Referenced by ReceivePkt(), and SendData().

◆ m_receivedPacketSizes

std::vector<uint32_t> NixVectorRoutingTest::m_receivedPacketSizes

Received packet sizes.

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

Referenced by DoRun(), and ReceivePkt().


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