IPv4 Raw Socket Fragmentation Test Configuration : Two sockets. More...
Public Member Functions | |
Ipv4RawFragmentationTest () | |
void | DoRun () override |
Implementation to actually run this TestCase. | |
![]() | |
TestCase (const TestCase &)=delete | |
virtual | ~TestCase () |
Destructor. | |
std::string | GetName () const |
TestCase & | operator= (const TestCase &)=delete |
Private Member Functions | |
void | PhyRxDropCallback (Ptr< const Packet > p) |
Packet dropped callback at Phy Rx. | |
void | RxCallback (Ptr< Socket > s) |
Receive callback. | |
void | SendPacket (Ptr< Socket > s, uint32_t sz) |
Send data to the receiver. | |
Private Attributes | |
uint32_t | m_droppedFragments {0} |
Number of dropped fragments. | |
uint32_t | m_rxCount {0} |
Received packet count. | |
uint32_t | m_rxPayloadSize {0} |
Received packet size. | |
Additional Inherited Members | |
![]() | |
enum class | Duration { QUICK = 1 , EXTENSIVE = 2 , TAKES_FOREVER = 3 } |
How long the test takes to execute. More... | |
![]() | |
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 |
![]() | |
TestCase (std::string name) | |
Constructor. | |
void | AddTestCase (TestCase *testCase, Duration duration=Duration::QUICK) |
Add an individual child TestCase to this test suite. | |
TestCase * | GetParent () 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. | |
IPv4 Raw Socket Fragmentation Test Configuration : Two sockets.
1 sender, 1 receiver Sender socket sends packets in two epochs. In the first epoch, it sends payload of sizes {500, 1000, 5000, 10000, 20000, 40000, 60000}. In the second epoch, it sends payload of sizes {5000, 10000, 20000, 40000, 60000}. These are payloads of size greater than the MTU of the link. In the first epoch, there is no loss model. In the second epoch, the second fragment of the packet sent is dropped.
Expected behaviour: In the first epoch: Receiver should receive only 1 packet and the size of the payload received should be equal to the size of the payload sent. No packets should have been dropped. In the second epoch: Receiver should not receive any packet. Only 1 packet should have been dropped at the physical layer.
Definition at line 70 of file ipv4-raw-test.cc.
Ipv4RawFragmentationTest::Ipv4RawFragmentationTest | ( | ) |
Definition at line 101 of file ipv4-raw-test.cc.
|
overridevirtual |
Implementation to actually run this TestCase.
Subclasses should override this method to conduct their tests.
Implements ns3::TestCase.
Definition at line 136 of file ipv4-raw-test.cc.
References ns3::CreateObject(), ns3::Simulator::Destroy(), ns3::NetDeviceContainer::Get(), ns3::Ipv4Address::GetAny(), ns3::SimpleNetDeviceHelper::Install(), m_droppedFragments, m_rxCount, m_rxPayloadSize, ns3::MakeCallback(), nodes, NS_TEST_EXPECT_MSG_EQ, PhyRxDropCallback(), ns3::Simulator::Run(), RxCallback(), ns3::Simulator::Schedule(), ns3::Seconds(), SendPacket(), and ns3::SimpleNetDeviceHelper::SetNetDevicePointToPointMode().
Packet dropped callback at Phy Rx.
p | Dropped packet. |
Definition at line 121 of file ipv4-raw-test.cc.
References m_droppedFragments.
Referenced by DoRun().
Receive callback.
s | The receiving socket. |
Definition at line 107 of file ipv4-raw-test.cc.
References m_rxCount, m_rxPayloadSize, and NS_LOG_DEBUG.
Referenced by DoRun().
Send data to the receiver.
s | The sending socket. |
sz | Size of the packet. |
Definition at line 127 of file ipv4-raw-test.cc.
References ns3::Create(), and NS_LOG_DEBUG.
Referenced by DoRun().
|
private |
Number of dropped fragments.
Definition at line 98 of file ipv4-raw-test.cc.
Referenced by DoRun(), and PhyRxDropCallback().
|
private |
Received packet count.
Definition at line 96 of file ipv4-raw-test.cc.
Referenced by DoRun(), and RxCallback().
|
private |
Received packet size.
Definition at line 97 of file ipv4-raw-test.cc.
Referenced by DoRun(), and RxCallback().