56#include "ns3/core-module.h"
57#include "ns3/csma-module.h"
58#include "ns3/internet-module.h"
59#include "ns3/ipv4-global-routing-helper.h"
60#include "ns3/network-module.h"
61#include "ns3/tap-bridge-module.h"
62#include "ns3/wifi-module.h"
72main(
int argc,
char* argv[])
74 std::string mode =
"ConfigureLocal";
75 std::string tapName =
"thetap";
78 cmd.AddValue(
"mode",
"Mode setting of TapBridge", mode);
79 cmd.AddValue(
"tapName",
"Name of the OS tap device", tapName);
80 cmd.Parse(argc, argv);
82 GlobalValue::Bind(
"SimulatorImplementationType",
StringValue(
"ns3::RealtimeSimulatorImpl"));
83 GlobalValue::Bind(
"ChecksumEnabled",
BooleanValue(
true));
98 addresses.
SetBase(
"10.1.1.0",
"255.255.255.0");
106 csma.EnablePcapAll(
"tap-csma",
false);
107 Ipv4GlobalRoutingHelper::PopulateRoutingTables();
111 Simulator::Destroy();
AttributeValue implementation for Boolean.
Parse command-line arguments.
build a set of CsmaNetDevice objects
AttributeValue implementation for DataRate.
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.
Ipv4InterfaceContainer Assign(const NetDeviceContainer &c)
Assign IP addresses to the net devices specified in the container based on the current network prefix...
holds a vector of std::pair of Ptr<Ipv4> and interface index.
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.
Ptr< Node > Get(uint32_t i) const
Get the Ptr<Node> stored in this container at a given index.
Hold variables of type string.
build TapBridge to allow ns-3 simulations to interact with Linux tap devices and processes on the Lin...
Ptr< NetDevice > Install(Ptr< Node > node, Ptr< NetDevice > nd)
This method installs a TapBridge on the specified Node and forms the bridge with the NetDevice specif...
void SetAttribute(std::string n1, const AttributeValue &v1)
Set an attribute in the underlying TapBridge net device when these devices are automatically created.
AttributeValue implementation for Time.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Time Seconds(double value)
Construct a Time in the indicated unit.
Time MilliSeconds(uint64_t value)
Construct a Time in the indicated unit.
Every class exported by the ns3 library is enclosed in the ns3 namespace.