60 #include "ns3/core-module.h" 61 #include "ns3/network-module.h" 62 #include "ns3/wifi-module.h" 63 #include "ns3/csma-module.h" 64 #include "ns3/internet-module.h" 65 #include "ns3/ipv4-global-routing-helper.h" 66 #include "ns3/tap-bridge-module.h" 73 main (
int argc,
char *argv[])
75 std::string mode =
"ConfigureLocal";
76 std::string tapName =
"thetap";
79 cmd.AddValue (
"mode",
"Mode setting of TapBridge", mode);
80 cmd.AddValue (
"tapName",
"Name of the OS tap device", tapName);
81 cmd.Parse (argc, argv);
99 addresses.
SetBase (
"10.1.1.0",
"255.255.255.0");
107 csma.EnablePcapAll (
"tap-csma",
false);
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 Boolean.
holds a vector of std::pair of Ptr<Ipv4> and interface index.
static void PopulateRoutingTables(void)
Build a routing database and initialize the routing tables of the nodes in the simulation.
Hold variables of type string.
static void Run(void)
Run the simulation.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Time MilliSeconds(uint64_t value)
Construct a Time in the indicated unit.
aggregate IP/TCP/UDP functionality to existing Nodes.
AttributeValue implementation for Time.
holds a vector of ns3::NetDevice pointers
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...
Parse command-line arguments.
static void Destroy(void)
Execute the events scheduled with ScheduleDestroy().
Every class exported by the ns3 library is enclosed in the ns3 namespace.
keep track of a set of node pointers.
build a set of CsmaNetDevice objects
Ipv4InterfaceContainer Assign(const NetDeviceContainer &c)
Assign IP addresses to the net devices specified in the container based on the current network prefix...
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...
AttributeValue implementation for DataRate.
static void Stop(void)
Tell the Simulator the calling event should be the last one executed.
Time Seconds(double value)
Construct a Time in the indicated unit.
A helper class to make life easier while doing simple IPv4 address assignment in scripts.
build TapBridge to allow ns-3 simulations to interact with Linux tap devices and processes on the Lin...
void SetBase(Ipv4Address network, Ipv4Mask mask, Ipv4Address base="0.0.0.1")
Set the base network number, network mask and base address.