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

IPv6 Raw Socket Fragmentation Test Configuration : Two sockets. More...

+ Inheritance diagram for Ipv6RawFragmentationTest:
+ Collaboration diagram for Ipv6RawFragmentationTest:

Public Member Functions

 Ipv6RawFragmentationTest ()
 
void DoRun () override
 Implementation to actually run this TestCase.
 
- Public Member Functions inherited from ns3::TestCase
 TestCase (const TestCase &)=delete
 
virtual ~TestCase ()
 Destructor.
 
std::string GetName () const
 
TestCaseoperator= (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

- 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

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.

Constructor & Destructor Documentation

◆ Ipv6RawFragmentationTest()

Ipv6RawFragmentationTest::Ipv6RawFragmentationTest ( )

Definition at line 102 of file ipv6-raw-test.cc.

Member Function Documentation

◆ DoRun()

void Ipv6RawFragmentationTest::DoRun ( )
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().

+ Here is the call graph for this function:

◆ PhyRxDropCallback()

void Ipv6RawFragmentationTest::PhyRxDropCallback ( Ptr< const Packet > p)
private

Packet dropped callback at Phy Rx.

Parameters
pDropped packet.

Definition at line 132 of file ipv6-raw-test.cc.

References m_droppedFragments.

Referenced by DoRun().

+ Here is the caller graph for this function:

◆ RxCallback()

void Ipv6RawFragmentationTest::RxCallback ( Ptr< Socket > socket)
private

Receive a packet.

Parameters
socketSocket 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().

+ Here is the caller graph for this function:

◆ SendPacket()

void Ipv6RawFragmentationTest::SendPacket ( Ptr< Socket > socket,
Ipv6Address dst,
uint32_t size )
private

Send a packet.

Parameters
socketThe sending socket
dstDestination IPv6 address.
sizeSize (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().

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

Member Data Documentation

◆ m_droppedFragments

uint32_t Ipv6RawFragmentationTest::m_droppedFragments {0}
private

Number of dropped packets.

Definition at line 99 of file ipv6-raw-test.cc.

Referenced by DoRun(), and PhyRxDropCallback().

◆ m_rxCount

uint32_t Ipv6RawFragmentationTest::m_rxCount {0}
private

Total count of packets received.

Definition at line 97 of file ipv6-raw-test.cc.

Referenced by DoRun(), and RxCallback().

◆ m_rxPayloadSize

uint32_t Ipv6RawFragmentationTest::m_rxPayloadSize {0}
private

Size of the last packet received.

Definition at line 98 of file ipv6-raw-test.cc.

Referenced by DoRun(), and RxCallback().


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