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");
103 tapBridge.SetAttribute (
"Mode",
StringValue (mode));
104 tapBridge.SetAttribute (
"DeviceName",
StringValue (tapName));
void SetChannelAttribute(std::string n1, const AttributeValue &v1)
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. Makes all nodes in the simulation into routers.
hold variables of type string
Ptr< NetDevice > Get(uint32_t i) const
Get the Ptr<NetDevice> stored in this container at a given index.
#define NS_LOG_COMPONENT_DEFINE(name)
aggregate IP/TCP/UDP functionality to existing Nodes.
NetDeviceContainer Install(Ptr< Node > node) const
void EnablePcapAll(std::string prefix, bool promiscuous=false)
Enable pcap output on each device (which is of the appropriate type) in the set of all nodes created ...
hold objects of type ns3::Time
holds a vector of ns3::NetDevice pointers
static void Bind(std::string name, const AttributeValue &value)
parse command-line argumentsInstances of this class can be used to parse command-line arguments: user...
static void Destroy(void)
keep track of a set of node pointers.
void Install(std::string nodeName) const
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...
Time Seconds(double seconds)
create ns3::Time instances in units of seconds.
Ptr< NetDevice > Install(Ptr< Node > node, Ptr< NetDevice > nd)
hold objects of type ns3::DataRate
void AddValue(const std::string &name, const std::string &help, T &value)
Ptr< Node > Get(uint32_t i) const
Get the Ptr<Node> stored in this container at a given index.
void Parse(int argc, char *argv[]) const
Time MilliSeconds(uint64_t ms)
create ns3::Time instances in units of milliseconds.
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 Create(uint32_t n)
Create n nodes and append pointers to them to the end of this NodeContainer.
void SetBase(Ipv4Address network, Ipv4Mask mask, Ipv4Address base="0.0.0.1")
Set the base network number, network mask and base address.