|
A Discrete-Event Network Simulator
|
API
|
Go to the documentation of this file.
36 #include "ns3/core-module.h"
37 #include "ns3/network-module.h"
38 #include "ns3/internet-module.h"
39 #include "ns3/csma-module.h"
40 #include "ns3/applications-module.h"
41 #include "ns3/ipv4-click-routing.h"
42 #include "ns3/click-internet-stack-helper.h"
49 main (
int argc,
char *argv[])
52 std::string clickConfigFolder =
"src/click/examples";
55 cmd.AddValue (
"clickConfigFolder",
"Base folder for click configuration files", clickConfigFolder);
56 cmd.Parse (argc, argv);
83 ClickInternetStackHelper clickinternet;
84 clickinternet.SetClickFile (
n, clickConfigFolder +
"/nsclick-lan-single-interface.click");
85 clickinternet.SetRoutingTableElement (
n,
"rt");
86 clickinternet.Install (
n);
93 ipv4.
SetBase (
"172.16.1.0",
"255.255.255.0");
100 uint16_t
port = 4000;
110 uint32_t MaxPacketSize = 1024;
112 uint32_t maxPacketCount = 320;
114 client.SetAttribute (
"MaxPackets",
UintegerValue (maxPacketCount));
115 client.SetAttribute (
"Interval",
TimeValue (interPacketInterval));
116 client.SetAttribute (
"PacketSize",
UintegerValue (MaxPacketSize));
121 csma.EnablePcap (
"nsclick-udp-client-server-csma", d,
false);
132 NS_FATAL_ERROR (
"Can't use ns-3-click without NSCLICK compiled in");
holds a vector of ns3::NetDevice pointers
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
AttributeValue implementation for DataRate.
Create a client application which sends UDP packets carrying a 32bit sequence number and a 64 bit tim...
Parse command-line arguments.
@ LOG_LEVEL_INFO
LOG_INFO and above.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
void Stop(Time stop)
Arrange for all of the Applications in this container to Stop() at the Time given as a parameter.
A helper class to make life easier while doing simple IPv4 address assignment in scripts.
void LogComponentEnable(char const *name, enum LogLevel level)
Enable the logging output associated with that log component.
build a set of CsmaNetDevice objects
Create a server application which waits for input UDP packets and uses the information carried into t...
void SetBase(Ipv4Address network, Ipv4Mask mask, Ipv4Address base="0.0.0.1")
Set the base network number, network mask and base address.
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
Class for representing data rates.
static void Stop(void)
Tell the Simulator the calling event should be the last one executed.
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
Time MilliSeconds(uint64_t value)
Construct a Time in the indicated unit.
holds a vector of std::pair of Ptr<Ipv4> and interface index.
Simulation virtual time values and global simulation resolution.
static void Run(void)
Run the simulation.
void Start(Time start)
Arrange for all of the Applications in this container to Start() at the Time given as a parameter.
Time Seconds(double value)
Construct a Time in the indicated unit.
Ipv4InterfaceContainer Assign(const NetDeviceContainer &c)
Assign IP addresses to the net devices specified in the container based on the current network prefix...
static void Destroy(void)
Execute the events scheduled with ScheduleDestroy().
holds a vector of ns3::Application pointers.
AttributeValue implementation for Time.
keep track of a set of node pointers.
Ipv4Address GetAddress(uint32_t i, uint32_t j=0) const
Hold an unsigned integer type.