64#include "ns3/core-module.h"
65#include "ns3/internet-apps-module.h"
66#include "ns3/internet-module.h"
67#include "ns3/network-module.h"
68#include "ns3/nix-vector-routing-module.h"
69#include "ns3/point-to-point-module.h"
93 cmd.AddValue(
"logging",
"Tell application to log if true", logging);
94 cmd.AddValue(
"interval",
"The time to wait between two packets", interPacketInterval);
95 cmd.AddValue(
"size",
"Data bytes to be sent, per-packet", size);
96 cmd.AddValue(
"count",
"Number of packets to be sent", count);
97 cmd.AddValue(
"destination",
98 "Destination IPv4 or IPv6 address, e.g., \"10.1.2.2\"",
100 cmd.AddValue(
"source",
101 "Source address, needed only for multicast or broadcast destinations",
109 if (
v4Dst.IsInitialized())
114 else if (
v6Dst.IsInitialized())
125 if (
v4Src.IsInitialized())
129 else if (
v6Src.IsInitialized())
139 if (
v6Dst.IsInitialized() &&
v6Dst.IsMulticast())
141 std::cout <<
"Specify a source address to use when pinging multicast addresses"
143 std::cout <<
"Program exiting..." << std::endl;
150 if (
v4Dst.IsInitialized() && (
v4Dst.IsBroadcast() ||
v4Dst.IsMulticast()))
152 std::cout <<
"Specify a source address to use when pinging broadcast or multicast "
155 std::cout <<
"Program exiting..." << std::endl;
203 stack.SetRoutingHelper(nixRouting);
204 stack.SetIpv6StackInstall(
false);
222 stack.SetRoutingHelper(nixRouting);
223 stack.SetIpv4StackInstall(
false);
a polymophic address class
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.
AttributeValue implementation for Boolean.
Parse command-line arguments.
static void Bind(std::string name, const AttributeValue &value)
Iterate over the set of GlobalValues until a matching name is found and then set its value with Globa...
aggregate IP/TCP/UDP functionality to existing Nodes.
A helper class to make life easier while doing simple IPv4 address assignment in scripts.
void SetBase(Ipv4Address network, Ipv4Mask mask, Ipv4Address base="0.0.0.1")
Set the base network number, network mask and base address.
Ipv4 addresses are stored in host order in this class.
holds a vector of std::pair of Ptr<Ipv4> and interface index.
Helper class to auto-assign global IPv6 unicast addresses.
void SetBase(Ipv6Address network, Ipv6Prefix prefix, Ipv6Address base=Ipv6Address("::1"))
Set the base network number, network prefix, and base interface ID.
Describes an IPv6 address.
Keep track of a set of IPv6 interfaces.
holds a vector of ns3::NetDevice pointers
Helper class that adds Nix-vector routing to nodes.
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.
void Add(const NodeContainer &nc)
Append the contents of another NodeContainer to the end of this container.
Ptr< Node > Get(uint32_t i) const
Get the Ptr<Node> stored in this container at a given index.
Create a ping application and associate it to a node.
Build a set of PointToPointNetDevice objects.
Smart pointer class similar to boost::intrusive_ptr.
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.
Simulation virtual time values and global simulation resolution.
AttributeValue implementation for Time.
Hold an unsigned integer type.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Ptr< T > Create(Ts &&... args)
Create class instances by constructors with varying numbers of arguments and return them by Ptr.
Time Seconds(double value)
Construct a Time in the indicated unit.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
void LogComponentEnable(const std::string &name, LogLevel level)
Enable the logging output associated with that log component.
LogLevel
Logging severity classes and levels.
@ LOG_LEVEL_ALL
Print everything.
@ LOG_PREFIX_TIME
Prefix all trace prints with simulation time.
@ LOG_PREFIX_NODE
Prefix all trace prints with simulation node.
void LogComponentEnableAll(LogLevel level)
Enable the logging output for all registered log components.