222#include "ns3/applications-module.h"
223#include "ns3/bridge-module.h"
224#include "ns3/core-module.h"
225#include "ns3/csma-module.h"
226#include "ns3/internet-module.h"
227#include "ns3/network-module.h"
228#include "ns3/point-to-point-module.h"
240#define vssearch(loc, vec) std::find((vec).begin(), (vec).end(), (loc)) != (vec).end()
274 cmd.Usage(
"NOTE: valid --pcap arguments are: 't2,t3,b2,b3,trlan,trwan,brlan,brwan'");
276 cmd.AddValue(
"verbose",
"Enable printing informational messages",
verbose);
280 cmd.AddValue(
"udpMultiSW",
"Enable udp over multi-switch links",
enableUdpMultiSW);
281 cmd.AddValue(
"udpSingleSW",
"Enable udp over single-switch links",
enableUdpSingleSW);
283 cmd.AddValue(
"pcap",
"Comma separated list of PCAP Locations to tap",
pcapLocations);
284 cmd.AddValue(
"snapLen",
"PCAP packet capture length",
snapLen);
293 cmd.AddValue(
"p2pDelay",
"P2P Link delay",
p2pLinkDelay);
309 const std::vector<std::string>
pcapTaps{
418 <<
" CSMA link for csmaX for LANs.");
427 <<
" CSMA link for csmaY for LANs.");
435 NS_LOG_INFO(
"L2: Connect nodes on top LAN together with half-duplex CSMA links.");
452 NS_LOG_INFO(
"L2: Connect nodes on bottom LAN together with half-duplex CSMA links.");
472 <<
" Point-to-Point link for the WAN.");
481 NS_LOG_INFO(
"L2: Connect the routers together with the Point-to-Point WAN link.");
561 NS_LOG_INFO(
"L3: Install the ns3 IP stack on udp client and server nodes.");
568 NS_LOG_INFO(
"L3: Install the ns3 IP stack on routers.");
583 ipv4.SetBase(
"192.168.1.0",
"255.255.255.0");
589 NS_LOG_INFO(
"L3: Assign bottom LAN IP Addresses.");
597 ipv4.SetBase(
"192.168.2.0",
"255.255.255.0");
605 ipv4.SetBase(
"76.1.1.0",
"255.255.255.0");
624 NS_LOG_INFO(
"APP: Multi-Switch UDP server (on node b2 of bottom LAN)");
635 NS_LOG_INFO(
"APP: Multi-Switch UDP client (on node t2 of top LAN)");
644 client.SetAttribute(
"Interval",
TimeValue(interPacketInterval));
660 NS_LOG_INFO(
"APP: Single-Switch UDP server (on node t3 of top LAN)");
671 NS_LOG_INFO(
"APP: Single-Switch UDP client (on node b3 bottom LAN)");
680 client.SetAttribute(
"Interval",
TimeValue(interPacketInterval));
694 NS_LOG_INFO(
"Set up to print routing tables at T=0.1s");
705 NS_LOG_INFO(
"Configure PCAP Tracing (if any configured).");
760 p2p.EnablePcap(
"trwan.pcap",
link_tr_br.Get(0),
true,
true);
768 p2p.EnablePcap(
"brwan.pcap",
link_tr_br.Get(1),
true,
true);
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.
void Stop(Time stop) const
Arrange for all of the Applications in this container to Stop() at the Time given as a parameter.
Add capability to bridge multiple LAN segments (IEEE 802.1D bridging)
NetDeviceContainer Install(Ptr< Node > node, NetDeviceContainer c)
This method creates an ns3::BridgeNetDevice with the attributes configured by BridgeHelper::SetDevice...
Parse command-line arguments.
build a set of CsmaNetDevice objects
void SetChannelAttribute(std::string n1, const AttributeValue &v1)
aggregate IP/TCP/UDP functionality to existing Nodes.
A helper class to make life easier while doing simple IPv4 address assignment in scripts.
Ipv4 addresses are stored in host order in this class.
static void PopulateRoutingTables()
Build a routing database and initialize the routing tables of the nodes in the simulation.
static void PrintRoutingTableAllAt(Time printTime, Ptr< OutputStreamWrapper > stream, Time::Unit unit=Time::S)
prints the routing tables of all nodes at a particular time.
static void Add(std::string name, Ptr< Object > object)
Add the association between the string "name" and the Ptr<Object> obj.
holds a vector of ns3::NetDevice pointers
void Add(NetDeviceContainer other)
Append the contents of another NetDeviceContainer to the end of this container.
keep track of a set of node pointers.
static const uint32_t SNAPLEN_DEFAULT
Default value for maximum octets to save per packet.
Build a set of PointToPointNetDevice objects.
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.
Simulation virtual time values and global simulation resolution.
AttributeValue implementation for Time.
Create an application which sends a UDP packet and waits for an echo of this packet.
Create a server application which waits for input UDP packets and sends them back to the original sen...
Hold an unsigned integer type.
#define vssearch(loc, vec)
void SetDefault(std::string name, const AttributeValue &value)
#define NS_LOG_ERROR(msg)
Use NS_LOG to output a message of level LOG_ERROR.
#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.
void LogComponentEnable(const std::string &name, LogLevel level)
Enable the logging output associated with that log component.
@ LOG_LEVEL_INFO
LOG_INFO and above.
static const uint32_t packetSize
Packet size generated at the AP.