9#include "ns3/boolean.h"
11#include "ns3/icmpv4-l4-protocol.h"
12#include "ns3/inet-socket-address.h"
13#include "ns3/internet-stack-helper.h"
14#include "ns3/ipv4-address-helper.h"
15#include "ns3/ipv4-l3-protocol.h"
16#include "ns3/ipv4-static-routing.h"
18#include "ns3/node-container.h"
20#include "ns3/rip-helper.h"
22#include "ns3/simple-channel.h"
23#include "ns3/simple-net-device.h"
24#include "ns3/simulator.h"
25#include "ns3/socket-factory.h"
26#include "ns3/socket.h"
28#include "ns3/udp-l4-protocol.h"
29#include "ns3/udp-socket-factory.h"
59 void DoRun()
override;
81 "Received Packet size is not equal to the Rx buffer size");
288 void DoRun()
override;
299 :
TestCase(
"RIP counting to infinity")
310 "Received Packet size is not equal to the Rx buffer size");
509 void DoRun()
override;
525 :
TestCase(
"RIP Split Horizon strategy")
536 socket->RecvFrom(std::numeric_limits<uint32_t>::max(), 0,
srcAddr);
539 "Received Packet size is not equal to the Rx buffer size");
552 if (
iter->GetPrefix() ==
"10.0.1.0")
555 if (
iter->GetRouteMetric() == 16)
560 else if (
iter->GetRouteMetric() == 2)
567 "RIP: unexpected metric value: " <<
iter->GetRouteMetric());
700 TestCase::Duration::QUICK);
702 TestCase::Duration::QUICK);
704 TestCase::Duration::QUICK);
IPv4 RIP count to infinity Test.
void DoRun() override
Implementation to actually run this TestCase.
void ReceivePkt(Ptr< Socket > socket)
Receive data.
void DoSendData(Ptr< Socket > socket, std::string to)
Send data.
Ipv4RipCountToInfinityTest()
void SendData(Ptr< Socket > socket, std::string to)
Send data.
Ptr< Packet > m_receivedPacket
Received packet.
IPv4 RIP SplitHorizon strategy Test.
void ReceivePktProbe(Ptr< Socket > socket)
Receive data.
Rip::SplitHorizonType_e m_detectedStrategy
Strategy detected.
Ipv4RipSplitHorizonStrategyTest(Rip::SplitHorizonType_e strategy)
Constructor.
Rip::SplitHorizonType_e m_setStrategy
Strategy set.
void DoRun() override
Implementation to actually run this TestCase.
void SendData(Ptr< Socket > socket, std::string to)
Send data.
void ReceivePkt(Ptr< Socket > socket)
Receive data.
Ptr< Packet > m_receivedPacket
Received packet.
void DoRun() override
Implementation to actually run this TestCase.
void DoSendData(Ptr< Socket > socket, std::string to)
Send data.
a polymophic address class
Hold variables of type enum.
Ipv4Address GetIpv4() const
static InetSocketAddress ConvertFrom(const Address &address)
Returns an InetSocketAddress which corresponds to the input 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)
A helper class to make life easier while doing simple IPv4 address assignment in scripts.
Ipv4 addresses are stored in host order in this class.
Access to the IPv4 forwarding table, interfaces, and configuration.
virtual Ptr< Ipv4RoutingProtocol > GetRoutingProtocol() const =0
Get the routing protocol to be used by this Ipv4 stack.
holds a vector of std::pair of Ptr<Ipv4> and interface index.
a class to represent an Ipv4 address mask
virtual Ptr< Ipv4RoutingProtocol > Create(Ptr< Node > node) const =0
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 RIP routing to nodes.
void Set(std::string name, const AttributeValue &value)
void SetInterfaceMetric(Ptr< Node > node, uint32_t interface, uint8_t metric)
Set a metric for an interface.
SplitHorizonType_e
Split Horizon strategy type.
@ SPLIT_HORIZON
Split Horizon.
@ NO_SPLIT_HORIZON
No Split Horizon.
@ POISON_REVERSE
Poison Reverse 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 Ipv4RipTestSuite g_ipv4ripTestSuite
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...