IPv6 Raw Socket Fragmentation Test Configuration : Two sockets. More...
Public Member Functions | |
Ipv6RawFragmentationTest () | |
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 > socket) |
Receive a packet. | |
void | SendPacket (Ptr< Socket > socket, Ipv6Address dst, uint32_t size) |
Send a packet. | |
Private Attributes | |
uint32_t | m_droppedFragments {0} |
Number of dropped packets. | |
uint32_t | m_rxCount {0} |
Total count of packets received. | |
uint32_t | m_rxPayloadSize {0} |
Size of the last packet received. | |
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. | |
IPv6 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 ipv6-raw-test.cc.
Ipv6RawFragmentationTest::Ipv6RawFragmentationTest | ( | ) |
Definition at line 102 of file ipv6-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 138 of file ipv6-raw-test.cc.
References ns3::CreateObject(), ns3::Simulator::Destroy(), ns3::DynamicCast(), ns3::NetDeviceContainer::Get(), ns3::Ipv6Address::GetAny(), ns3::SimpleNetDeviceHelper::Install(), ns3::Ipv6Header::IPV6_ICMPV6, m_droppedFragments, m_rxCount, m_rxPayloadSize, ns3::MakeCallback(), NS_TEST_EXPECT_MSG_EQ, PhyRxDropCallback(), ns3::Simulator::Run(), RxCallback(), ns3::Simulator::Schedule(), ns3::Seconds(), SendPacket(), ns3::SimpleNetDeviceHelper::SetNetDevicePointToPointMode(), and ns3::Simulator::Stop().
Packet dropped callback at Phy Rx.
p | Dropped packet. |
Definition at line 132 of file ipv6-raw-test.cc.
References m_droppedFragments.
Referenced by DoRun().
Receive a packet.
socket | Socket that received a packet |
Definition at line 108 of file ipv6-raw-test.cc.
References m_rxCount, m_rxPayloadSize, and NS_LOG_DEBUG.
Referenced by DoRun().
|
private |
Send a packet.
socket | The sending socket |
dst | Destination IPv6 address. |
size | Size (bytes) of the payload to send. |
Definition at line 124 of file ipv6-raw-test.cc.
References ns3::Create(), and NS_LOG_DEBUG.
Referenced by DoRun().
|
private |
Number of dropped packets.
Definition at line 99 of file ipv6-raw-test.cc.
Referenced by DoRun(), and PhyRxDropCallback().
|
private |
Total count of packets received.
Definition at line 97 of file ipv6-raw-test.cc.
Referenced by DoRun(), and RxCallback().
|
private |
Size of the last packet received.
Definition at line 98 of file ipv6-raw-test.cc.
Referenced by DoRun(), and RxCallback().