9#include "ns3/boolean.h"
11#include "ns3/icmpv6-l4-protocol.h"
12#include "ns3/inet6-socket-address.h"
13#include "ns3/internet-stack-helper.h"
14#include "ns3/ipv6-address-helper.h"
15#include "ns3/ipv6-l3-protocol.h"
17#include "ns3/node-container.h"
19#include "ns3/ripng-helper.h"
21#include "ns3/simple-channel.h"
22#include "ns3/simple-net-device.h"
23#include "ns3/simulator.h"
24#include "ns3/socket-factory.h"
25#include "ns3/socket.h"
27#include "ns3/udp-l4-protocol.h"
28#include "ns3/udp-socket-factory.h"
58 void DoRun()
override;
80 "Received packet size is not equal to Rx buffer size");
224 iic1.SetDefaultRouteInAllNodes(1);
228 iic2.SetForwarding(1,
true);
232 iic3.SetForwarding(1,
true);
237 iic4.SetDefaultRouteInAllNodes(0);
288 void DoRun()
override;
299 :
TestCase(
"RIPng counting to infinity")
310 "Received packet size is not equal to Rx buffer size");
461 iic1.SetDefaultRouteInAllNodes(1);
465 iic2.SetForwarding(1,
true);
469 iic3.SetForwarding(1,
true);
474 iic4.SetDefaultRouteInAllNodes(0);
508 void DoRun()
override;
524 :
TestCase(
"RIPng Split Horizon strategy")
535 socket->RecvFrom(std::numeric_limits<uint32_t>::max(), 0,
srcAddr);
538 "ReceivedPacketProbe size is not equal to the Rx buffer size");
550 if (
iter->GetPrefix() ==
"2001:1::")
553 if (
iter->GetRouteMetric() == 16)
558 else if (
iter->GetRouteMetric() == 2)
565 "RIPng: unexpected metric value: " <<
iter->GetRouteMetric());
661 iic1.SetForwarding(1,
true);
699 TestCase::Duration::QUICK);
701 TestCase::Duration::QUICK);
703 TestCase::Duration::QUICK);
IPv6 RIPng count to infinity Test.
void SendData(Ptr< Socket > socket, std::string to)
Send data.
void DoSendData(Ptr< Socket > socket, std::string to)
Send data.
Ipv6RipngCountToInfinityTest()
void ReceivePkt(Ptr< Socket > socket)
Receive data.
Ptr< Packet > m_receivedPacket
Received packet.
void DoRun() override
Implementation to actually run this TestCase.
IPv6 RIPng SplitHorizon strategy Test.
Ipv6RipngSplitHorizonStrategyTest(RipNg::SplitHorizonType_e strategy)
Constructor.
RipNg::SplitHorizonType_e m_setStrategy
Strategy set.
void DoRun() override
Implementation to actually run this TestCase.
RipNg::SplitHorizonType_e m_detectedStrategy
Strategy detected.
void ReceivePktProbe(Ptr< Socket > socket)
Receive data.
Ptr< Packet > m_receivedPacket
Received packet.
void DoRun() override
Implementation to actually run this TestCase.
void SendData(Ptr< Socket > socket, std::string to)
Send data.
void DoSendData(Ptr< Socket > socket, std::string to)
Send data.
void ReceivePkt(Ptr< Socket > socket)
Receive data.
a polymophic address class
Hold variables of type enum.
static Inet6SocketAddress ConvertFrom(const Address &addr)
Convert the address to a InetSocketAddress.
Ipv6Address GetIpv6() const
Get the IPv6 address.
aggregate IP/TCP/UDP functionality to existing Nodes.
void Install(std::string nodeName) const
Aggregate implementations of the ns3::Ipv4, ns3::Ipv6, ns3::Udp, and ns3::Tcp classes onto the provid...
void SetRoutingHelper(const Ipv4RoutingHelper &routing)
Helper class to auto-assign global IPv6 unicast addresses.
Ipv6InterfaceContainer AssignWithoutAddress(const NetDeviceContainer &c)
Allocate an Ipv6InterfaceContainer but do not assign any IPv6 addresses.
void SetBase(Ipv6Address network, Ipv6Prefix prefix, Ipv6Address base=Ipv6Address("::1"))
Set the base network number, network prefix, and base interface ID.
Ipv6InterfaceContainer AssignWithoutOnLink(const NetDeviceContainer &c)
Allocate an Ipv6InterfaceContainer with auto-assigned addresses, but do not set the on-link property ...
Describes an IPv6 address.
Keep track of a set of IPv6 interfaces.
void SetForwarding(uint32_t i, bool state)
Set the state of the stack (act as a router or as an host) for the specified index.
Describes an IPv6 prefix.
holds a vector of ns3::NetDevice pointers
keep track of a set of node pointers.
Smart pointer class similar to boost::intrusive_ptr.
Helper class that adds RIPng routing to nodes.
void SetInterfaceMetric(Ptr< Node > node, uint32_t interface, uint8_t metric)
Set a metric for an interface.
void Set(std::string name, const AttributeValue &value)
SplitHorizonType_e
Split Horizon strategy type.
@ SPLIT_HORIZON
Split Horizon.
@ POISON_REVERSE
Poison Reverse Split Horizon.
@ NO_SPLIT_HORIZON
No Split Horizon.
static void Destroy()
Execute the events scheduled with ScheduleDestroy().
static void ScheduleWithContext(uint32_t context, const Time &delay, FUNC f, Ts &&... args)
Schedule an event with the given context.
static void Run()
Run the simulation.
static void Stop()
Tell the Simulator the calling event should be the last one executed.
void AddTestCase(TestCase *testCase, Duration duration=Duration::QUICK)
Add an individual child TestCase to this test suite.
static constexpr auto UNIT
API to create UDP socket instances.
Ptr< T > Create(Ts &&... args)
Create class instances by constructors with varying numbers of arguments and return them by Ptr.
#define NS_TEST_ASSERT_MSG_EQ(actual, limit, msg)
Test that an actual and expected (limit) value are equal and report and abort if not.
#define NS_TEST_EXPECT_MSG_EQ(actual, limit, msg)
Test that an actual and expected (limit) value are equal and report if not.
Time Seconds(double value)
Construct a Time in the indicated unit.
static Ipv6RipngTestSuite g_ipv6ripngTestSuite
Static variable for test initialization.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Callback< R, Args... > MakeCallback(R(T::*memPtr)(Args...), OBJ objPtr)
Build Callbacks for class method members which take varying numbers of arguments and potentially retu...