94#include "ns3/applications-module.h"
95#include "ns3/core-module.h"
96#include "ns3/fd-net-device-module.h"
97#include "ns3/internet-module.h"
98#include "ns3/network-module.h"
118 std::string
client(
"10.1.1.1");
119 std::string
server(
"10.1.1.2");
120 std::string netmask(
"255.255.255.0");
121 std::string
macClient(
"00:00:00:00:00:01");
122 std::string
macServer(
"00:00:00:00:00:02");
127#elif HAVE_NETMAP_USER_H
134 cmd.AddValue(
"deviceName",
135 "Device name (in raw, netmap mode) or Device address (in dpdk mode, eg: "
136 "0000:00:1f.6). Use `lspci` to find device address.",
138 cmd.AddValue(
"client",
"Local IP address (dotted decimal only please)", client);
139 cmd.AddValue(
"server",
"Remote IP address (dotted decimal only please)", server);
140 cmd.AddValue(
"localmask",
"Local mask address (dotted decimal only please)", netmask);
141 cmd.AddValue(
"serverMode",
"1:true, 0:false, default client",
serverMode);
142 cmd.AddValue(
"mac-client",
"Mac Address for Server Client : 00:00:00:00:00:01",
macClient);
143 cmd.AddValue(
"mac-server",
"Mac Address for Server Default : 00:00:00:00:00:02",
macServer);
144 cmd.AddValue(
"data-rate",
"Data rate defaults to 1000Mb/s",
dataRate);
145 cmd.AddValue(
"transportProt",
"Transport protocol to use: Tcp, Udp",
transportProt);
146 cmd.AddValue(
"emuMode",
"Emulation mode in {raw, netmap}",
emuMode);
177 Ipv4Mask localMask(netmask.c_str());
197#ifdef HAVE_NETMAP_USER_H
205#ifdef HAVE_DPDK_USER_H
212 dpdk->SetPmdLibrary(
"librte_pmd_e1000.so");
214 dpdk->SetDpdkDriver(
"uio_pci_generic");
228 device->SetAttribute(
"Address",
localMac);
239 ipv4->AddAddress(interface, address);
240 ipv4->SetMetric(interface, 1);
241 ipv4->SetUp(interface);
251 helper->EnablePcap(
"fd-server", device);
257 onoff.SetAttribute(
"Remote", remoteAddress);
258 onoff.SetAttribute(
"OnTime",
StringValue(
"ns3::ConstantRandomVariable[Constant=1]"));
259 onoff.SetAttribute(
"OffTime",
StringValue(
"ns3::ConstantRandomVariable[Constant=0]"));
267 helper->EnablePcap(
"fd-client", device);
a polymophic address class
AttributeValue implementation for Address.
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.
AttributeValue implementation for DataRate.
build a DpdkNetDevice object attached to a physical network interface
build a set of FdNetDevice objects attached to a physical network interface
void SetDeviceName(std::string deviceName)
Set the device name of this device.
build a set of FdNetDevice objects Normally we eschew multiple inheritance, however,...
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.
void SetIpv4StackInstall(bool enable)
Enable/disable IPv4 stack install.
Ipv4 addresses are stored in host order in this class.
Access to the IPv4 forwarding table, interfaces, and configuration.
a class to store IPv4 address information on an interface
a class to represent an Ipv4 address mask
AttributeValue implementation for Mac48Address.
holds a vector of ns3::NetDevice pointers
build a set of FdNetDevice objects attached to a physical network interface
void SetDeviceName(std::string deviceName)
Set the device name of this device.
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.
Hold an unsigned integer type.
void SetDefault(std::string name, const AttributeValue &value)
#define NS_ABORT_MSG(msg)
Unconditional abnormal program termination with a message.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
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.
static const uint32_t packetSize
Packet size generated at the AP.