AODV deferred route lookup test case (see Bug 772) More...
#include "bug-772.h"
Public Member Functions | |
Bug772ChainTest (const char *const prefix, const char *const proto, Time time, uint32_t size) | |
Create test case. More... | |
~Bug772ChainTest () | |
Public Member Functions inherited from ns3::TestCase | |
TestCase (const TestCase &)=delete | |
virtual | ~TestCase () |
Destructor. More... | |
std::string | GetName (void) const |
TestCase & | operator= (const TestCase &)=delete |
Private Member Functions | |
void | CheckResults () |
Compare traces with reference ones. More... | |
void | CreateDevices () |
Create devices, install TCP/IP stack and applications. More... | |
void | CreateNodes () |
Create test topology. More... | |
void | DoRun () |
Go. More... | |
void | HandleRead (Ptr< Socket > socket) |
Receive data function. More... | |
void | SendData (Ptr< Socket > socket) |
Send data. More... | |
Private Attributes | |
NodeContainer * | m_nodes |
const uint16_t | m_port |
port number More... | |
const std::string | m_prefix |
PCAP file names prefix. More... | |
const std::string | m_proto |
Socket factory TID. More... | |
uint32_t | m_receivedPackets |
Received packet count. More... | |
Ptr< Socket > | m_recvSocket |
Receiving socket. More... | |
Ptr< Socket > | m_sendSocket |
Transmitting socket. More... | |
const uint32_t | m_size |
Chain size. More... | |
const double | m_step |
Chain step, meters. More... | |
const Time | m_time |
Total simulation time. 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... | |
TestCase * | GetParent () 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... | |
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.
Bug772ChainTest::Bug772ChainTest | ( | const char *const | prefix, |
const char *const | proto, | ||
Time | time, | ||
uint32_t | size | ||
) |
Create test case.
prefix | Unique file names prefix |
proto | ns3::UdpSocketFactory or ns3::TcpSocketFactory |
size | Number of nodes in the chain |
time | Simulation time |
Definition at line 49 of file bug-772.cc.
Bug772ChainTest::~Bug772ChainTest | ( | ) |
Definition at line 62 of file bug-772.cc.
References m_nodes.
|
private |
Compare traces with reference ones.
Definition at line 183 of file bug-772.cc.
References m_receivedPackets, and NS_TEST_EXPECT_MSG_EQ.
Referenced by DoRun().
|
private |
Create devices, install TCP/IP stack and applications.
Definition at line 123 of file bug-772.cc.
References first::address, ns3::AodvHelper::AssignStreams(), ns3::InternetStackHelper::AssignStreams(), ns3::YansWifiChannelHelper::AssignStreams(), ns3::Socket::Bind(), ns3::Socket::Connect(), ns3::YansWifiChannelHelper::Create(), first::devices, ns3::WifiPhyHelper::DisablePreambleDetectionModel(), ns3::NodeContainer::Get(), ns3::Node::GetId(), ns3::Socket::GetNode(), HandleRead(), ns3::InternetStackHelper::Install(), first::interfaces, ns3::Socket::Listen(), m_nodes, m_port, m_proto, m_recvSocket, m_sendSocket, m_size, ns3::MakeCallback(), NS_TEST_ASSERT_MSG_EQ, ns3::Seconds(), SendData(), ns3::WifiPhyHelper::Set(), ns3::Socket::SetAllowBroadcast(), ns3::YansWifiPhyHelper::SetChannel(), ns3::WifiPhyHelper::SetErrorRateModel(), ns3::Socket::SetRecvCallback(), ns3::InternetStackHelper::SetRoutingHelper(), ns3::WifiMacHelper::SetType(), ns3::Socket::ShutdownSend(), third::wifi, and ns3::WIFI_STANDARD_80211a.
Referenced by DoRun().
|
private |
Create test topology.
Definition at line 106 of file bug-772.cc.
References ns3::NodeContainer::Create(), m_nodes, m_size, m_step, and third::mobility.
Referenced by DoRun().
|
privatevirtual |
Go.
Implements ns3::TestCase.
Definition at line 85 of file bug-772.cc.
References CheckResults(), CreateDevices(), CreateNodes(), m_nodes, m_time, ns3::Seconds(), and ns3::Config::SetDefault().
Receive data function.
socket | the socket to receive from |
Definition at line 79 of file bug-772.cc.
References m_receivedPackets.
Referenced by CreateDevices().
Send data.
socket | the sending socket |
Definition at line 68 of file bug-772.cc.
References ns3::Node::GetId(), ns3::Socket::GetNode(), m_time, ns3::Now(), ns3::Seconds(), and ns3::Socket::Send().
Referenced by CreateDevices().
|
private |
Definition at line 56 of file bug-772.h.
Referenced by ~Bug772ChainTest(), CreateDevices(), CreateNodes(), and DoRun().
|
private |
|
private |
|
private |
|
private |
Received packet count.
Definition at line 91 of file bug-772.h.
Referenced by CheckResults(), and HandleRead().
|
private |
Chain size.
Definition at line 65 of file bug-772.h.
Referenced by CreateDevices(), and CreateNodes().
|
private |
|
private |
Total simulation time.
Definition at line 63 of file bug-772.h.
Referenced by DoRun(), and SendData().