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[])
77 ClickInternetStackHelper clickinternet;
78 clickinternet.SetClickFile (n,
"src/click/examples/nsclick-lan-single-interface.click");
79 clickinternet.SetRoutingTableElement (n,
"rt");
80 clickinternet.Install (n);
87 ipv4.
SetBase (
"172.16.1.0",
"255.255.255.0");
97 apps.
Start (Seconds (1.0));
98 apps.
Stop (Seconds (10.0));
104 uint32_t MaxPacketSize = 1024;
105 Time interPacketInterval = Seconds (0.05);
106 uint32_t maxPacketCount = 320;
109 client.SetAttribute (
"Interval",
TimeValue (interPacketInterval));
110 client.SetAttribute (
"PacketSize",
UintegerValue (MaxPacketSize));
112 apps.
Start (Seconds (2.0));
113 apps.
Stop (Seconds (10.0));
115 csma.
EnablePcap (
"nsclick-udp-client-server-csma", d,
false);
126 NS_FATAL_ERROR (
"Can't use ns-3-click without NSCLICK compiled in");
holds a vector of ns3::Application pointers.
keep track of time values and allow control of global simulation resolution
void SetChannelAttribute(std::string n1, const AttributeValue &v1)
NS_LOG_COMPONENT_DEFINE("GrantedTimeWindowMpiInterface")
holds a vector of std::pair of Ptr and interface index.
static void Run(void)
Run the simulation until one of:
NetDeviceContainer Install(Ptr< Node > node) const
This method creates an ns3::CsmaChannel with the attributes configured by CsmaHelper::SetChannelAttri...
#define NS_FATAL_ERROR(msg)
fatal error handling
Class for representing data rates.
Create a client application which sends UDP packets carrying a 32bit sequence number and a 64 bit tim...
hold objects of type ns3::Time
Hold an unsigned integer type.
holds a vector of ns3::NetDevice pointers
Create a server application which waits for input UDP packets and uses the information carried into t...
void Start(Time start)
Arrange for all of the Applications in this container to Start() at the Time given as a parameter...
static void Destroy(void)
Every event scheduled by the Simulator::insertAtDestroy method is invoked.
int main(int argc, char *argv[])
void SetAttribute(std::string name, const AttributeValue &value)
Record an attribute to be set in each Application after it is is created.
keep track of a set of node pointers.
build a set of CsmaNetDevice objects
void SetDeviceAttribute(std::string n1, const AttributeValue &v1)
void Stop(Time stop)
Arrange for all of the Applications in this container to Stop() at the Time given as a parameter...
Ipv4InterfaceContainer Assign(const NetDeviceContainer &c)
Assign IP addresses to the net devices specified in the container based on the current network prefix...
ApplicationContainer Install(NodeContainer c)
Create one UDP server application on each of the Nodes in the NodeContainer.
hold objects of type ns3::DataRate
static void Stop(void)
If an event invokes this method, it will be the last event scheduled by the Simulator::run method bef...
Ptr< Node > Get(uint32_t i) const
Get the Ptr stored in this container at a given index.
A helper class to make life easier while doing simple IPv4 address assignment in scripts.
void Create(uint32_t n)
Create n nodes and append pointers to them to the end of this NodeContainer.
void EnablePcap(std::string prefix, Ptr< NetDevice > nd, bool promiscuous=false, bool explicitFilename=false)
Enable pcap output the indicated net device.
void SetBase(Ipv4Address network, Ipv4Mask mask, Ipv4Address base="0.0.0.1")
Set the base network number, network mask and base address.
void LogComponentEnable(char const *name, enum LogLevel level)
Ipv4Address GetAddress(uint32_t i, uint32_t j=0) const