264#include "ns3/applications-module.h"
265#include "ns3/core-module.h"
266#include "ns3/csma-module.h"
267#include "ns3/internet-module.h"
268#include "ns3/network-module.h"
331 std::cout <<
"Rx pkt from " << from <<
" to " << dst <<
" -> " << header << std::endl;
338 cmd.AddValue(
"useIPv6",
"Use IPv6 instead of IPv4",
m_useIpv6);
339 cmd.AddValue(
"enableLog",
"Enable ArpL3Protocol and Icmpv6L4Protocol logging",
m_enableLog);
340 cmd.AddValue(
"useChannel",
"Generate neighbor cache for specific Channel",
m_useChannel);
341 cmd.AddValue(
"useNetDeviceContainer",
342 "Generate neighbor cache for specific netDeviceContainer",
344 cmd.AddValue(
"useInterfaceContainer",
345 "Generate neighbor cache for specific interfaceContainer",
347 cmd.AddValue(
"noGenerate",
"do not generate neighbor cache automatically",
m_noGenerate);
348 cmd.AddValue(
"sendTraffic",
"send data stream from n0 to n1",
m_sendTraffic);
396 stack.SetIpv6StackInstall(
false);
400 stack.SetIpv4StackInstall(
false);
403 stack.SetIpv4ArpJitter(
false);
404 stack.SetIpv6NsRsJitter(
false);
411 address.SetBase(
"10.1.1.0",
"255.255.255.0");
414 address.SetBase(
"10.1.2.0",
"255.255.255.0");
458 onoff.SetConstantRate(
DataRate(
"10Gbps"));
459 onoff.SetAttribute(
"EnableSeqTsSizeHeader",
BooleanValue(
true));
468 apps.Get(1)->TraceConnectWithoutContext(
474 csmaLeft.EnablePcapAll(
"neighbor-cache-example");
536 "ns3::UdpSocketFactory",
538 onoff.SetConstantRate(
DataRate(
"10Gbps"));
539 onoff.SetAttribute(
"EnableSeqTsSizeHeader",
BooleanValue(
true));
548 apps.Get(1)->TraceConnectWithoutContext(
554 csmaLeft.EnablePcapAll(
"neighbor-cache-example");
neighbor Cache example class.
void CommandSetup(int argc, char **argv)
description the command-line parameters.
bool m_sendTraffic
send data stream from n0 to n1
bool m_noGenerate
do not generate neighbor cache automatically
void ReceivePacket(Ptr< const Packet > pkt, const Address &from, const Address &dst, const SeqTsSizeHeader &header)
Print the information of receive data.
bool m_useNetDeviceContainer
Generate neighbor cache for specific netDeviceContainer.
bool m_useChannel
Generate neighbor cache for specific Channel.
void Run()
Run the example.
bool m_useIpv6
Use IPv6 instead of IPv4.
bool m_enableLog
Enable ArpL3Protocol and Icmpv6L4Protocol logging.
bool m_useInterfaceContainer
Generate neighbor cache for specific interfaceContainer.
a polymophic address class
holds a vector of ns3::Application pointers.
Manage ASCII trace files for device models.
AttributeValue implementation for Boolean.
Parse command-line arguments.
build a set of CsmaNetDevice objects
void SetChannelAttribute(std::string n1, const AttributeValue &v1)
Class for representing data rates.
aggregate IP/TCP/UDP functionality to existing Nodes.
A helper class to make life easier while doing simple IPv4 address assignment in scripts.
static Ipv4Address GetAny()
holds a vector of std::pair of Ptr<Ipv4> and interface index.
static void PrintNeighborCacheAllAt(Time printTime, Ptr< OutputStreamWrapper > stream, Time::Unit unit=Time::S)
prints the neighbor cache of all nodes at a particular time.
Helper class to auto-assign global IPv6 unicast addresses.
Describes an IPv6 address.
static Ipv6Address GetAny()
Get the "any" (::) Ipv6Address.
Keep track of a set of IPv6 interfaces.
Describes an IPv6 prefix.
static void PrintNeighborCacheAllAt(Time printTime, Ptr< OutputStreamWrapper > stream, Time::Unit unit=Time::S)
prints the neighbor cache of all nodes at a particular time.
A helper class to populate neighbor cache.
holds a vector of ns3::NetDevice pointers
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.
A helper to make it easier to instantiate an ns3::OnOffApplication on a set of nodes.
A helper to make it easier to instantiate an ns3::PacketSinkApplication on a set of nodes.
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.
AttributeValue implementation for Time.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
Ptr< T > Create(Ts &&... args)
Create class instances by constructors with varying numbers of arguments and return them by Ptr.
Time MicroSeconds(uint64_t value)
Construct a Time in the indicated unit.
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.
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...
@ LOG_LEVEL_LOGIC
LOG_LOGIC and above.
Ptr< PacketSink > sink
Pointer to the packet sink application.