10#include "ns3/applications-module.h"
11#include "ns3/core-module.h"
12#include "ns3/csma-module.h"
13#include "ns3/data-rate.h"
14#include "ns3/dhcp6-header.h"
15#include "ns3/dhcp6-helper.h"
16#include "ns3/header-serialization-test.h"
17#include "ns3/internet-apps-module.h"
18#include "ns3/internet-module.h"
19#include "ns3/internet-stack-helper.h"
20#include "ns3/ipv6-address-helper.h"
22#include "ns3/mobility-module.h"
23#include "ns3/network-module.h"
24#include "ns3/ping-helper.h"
25#include "ns3/point-to-point-module.h"
26#include "ns3/simple-net-device-helper.h"
27#include "ns3/simple-net-device.h"
28#include "ns3/simulator.h"
31#include "ns3/trace-helper.h"
32#include "ns3/wifi-helper.h"
33#include "ns3/yans-wifi-helper.h"
62 void DoRun()
override;
78 uint8_t numericalContext = std::stoi(context,
nullptr, 10);
80 if (numericalContext >= 0 && numericalContext < std::size(
m_leasedAddress))
105 nonRouterDevices.
Add(devices.Get(0));
106 nonRouterDevices.
Add(devices.Get(1));
107 nonRouterDevices.
Add(devices.Get(2));
111 routerDevice.
Add(devices.Get(3));
136 serverNetDevices.
Add(nonRouterDevices.
Get(0));
152 dhcpClients.
Get(0)->TraceConnect(
"NewLease",
155 dhcpClients.
Get(1)->TraceConnect(
"NewLease",
166 int32_t ifIndex_client1 = ipv6_client1->GetInterfaceForDevice(nonRouterDevices.
Get(1));
170 "Incorrect number of addresses.");
174 int32_t ifIndex_client2 = ipv6_client2->GetInterfaceForDevice(nonRouterDevices.
Get(2));
177 "Incorrect number of addresses.");
void DoRun() override
Implementation to actually run this TestCase.
~Dhcp6TestCase() override
Ipv6Address m_leasedAddress[2]
Address given to the nodes.
void LeaseObtained(std::string context, const Ipv6Address &newAddress)
Triggered by an address lease on a client.
holds a vector of ns3::Application pointers.
void Start(Time start) const
Start all of the Applications in this container at the start time given as a parameter.
Ptr< Application > Get(uint32_t i) const
Get the Ptr<Application> stored in this container at a given index.
void Stop(Time stop) const
Arrange for all of the Applications in this container to Stop() at the Time given as a parameter.
ApplicationContainer Install(NodeContainer c)
Install an application on each node of the input container configured with all the attributes set wit...
Class for representing data rates.
AttributeValue implementation for DataRate.
The helper class used to configure and install DHCPv6 applications on nodes.
void SetServerAttribute(std::string name, const AttributeValue &value)
Set DHCPv6 server attributes.
ApplicationContainer InstallDhcp6Client(NodeContainer clientNodes) const
Install DHCPv6 client on a set of nodes.
ApplicationContainer InstallDhcp6Server(NetDeviceContainer netDevices)
Install DHCPv6 server on a node / NetDevice.
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...
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 Assign(const NetDeviceContainer &c)
Allocate an Ipv6InterfaceContainer with auto-assigned addresses.
Describes an IPv6 address.
Access to the IPv6 forwarding table, interfaces, and configuration.
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.
uint32_t GetInterfaceIndex(uint32_t i) const
Get the interface index for the specified node index.
IPv6 layer implementation.
Describes an IPv6 prefix.
holds a vector of ns3::NetDevice pointers
void Add(NetDeviceContainer other)
Append the contents of another NetDeviceContainer to the end of this container.
Ptr< NetDevice > Get(uint32_t i) const
Get the Ptr<NetDevice> stored in this container at a given index.
keep track of a set of node pointers.
void Create(uint32_t n)
Create n nodes and append pointers to them to the end of this NodeContainer.
Ptr< Node > Get(uint32_t i) const
Get the Ptr<Node> stored in this container at a given index.
Ptr< T > GetObject() const
Get a pointer to the requested aggregated Object.
Smart pointer class similar to boost::intrusive_ptr.
Radvd application helper.
void AddAnnouncedPrefix(uint32_t interface, const Ipv6Address &prefix, uint32_t prefixLength, bool slaac=true)
Add a new prefix to be announced through an interface.
Ptr< RadvdInterface > GetRadvdInterface(uint32_t interface)
Get the low-level RadvdInterface specification for an interface.
void SetManagedFlag(bool managedFlag)
Set managed flag.
build a set of SimpleNetDevice objects
void SetChannelAttribute(std::string n1, const AttributeValue &v1)
void SetDeviceAttribute(std::string n1, const AttributeValue &v1)
NetDeviceContainer Install(Ptr< Node > node) const
This method creates an ns3::SimpleChannel with the attributes configured by SimpleNetDeviceHelper::Se...
static void Destroy()
Execute the events scheduled with ScheduleDestroy().
static void Run()
Run the simulation.
static void Stop()
Tell the Simulator the calling event should be the last one executed.
Hold variables of type string.
void AddTestCase(TestCase *testCase, Duration duration=Duration::QUICK)
Add an individual child TestCase to this test suite.
AttributeValue implementation for Time.
static Dhcp6TestSuite dhcp6TestSuite
Static variable for test initialization.
Ptr< T > CreateObject(Args &&... args)
Create an object by type, with varying number of constructor parameters.
#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.
Time Seconds(double value)
Construct a Time in the indicated unit.
Time MilliSeconds(uint64_t value)
Construct a Time in the indicated unit.
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...
Ptr< T1 > DynamicCast(const Ptr< T2 > &p)
Cast a Ptr.