20 #ifndef OFSWITCH13_HELPER_H
21 #define OFSWITCH13_HELPER_H
23 #include <ns3/application-container.h>
24 #include <ns3/csma-helper.h>
25 #include <ns3/inet-socket-address.h>
26 #include <ns3/internet-stack-helper.h>
27 #include <ns3/ipv4-address-helper.h>
28 #include <ns3/ipv4-interface-container.h>
29 #include <ns3/names.h>
30 #include <ns3/node-container.h>
31 #include <ns3/object-factory.h>
32 #include <ns3/ofswitch13-controller.h>
33 #include <ns3/ofswitch13-device-container.h>
34 #include <ns3/ofswitch13-device.h>
35 #include <ns3/ofswitch13-interface.h>
36 #include <ns3/point-to-point-helper.h>
37 #include <ns3/simple-ref-count.h>
46 class OFSwitch13Controller;
47 class OFSwitch13LearningController;
128 bool promiscuous =
true);
150 bool useNodeNames =
false);
218 bool explicitFilename =
false);
Hold a value for an Attribute.
build a set of CsmaNetDevice objects
Class for representing data rates.
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.
a class to represent an Ipv4 address mask
holds a vector of ns3::NetDevice pointers
keep track of a set of node pointers.
Holds a vector of ns3::OFSwitch13Device pointers.
This is a base class that must be extended to create and configure an OpenFlow 1.3 network domain com...
static void EnableDatapathLogs(std::string prefix="", bool explicitFilename=false)
Enable OpenFlow datapath logs at all OpenFlow switch devices on the simulation.
InternetStackHelper m_internet
Helper for TCP/IP stack.
void EnableOpenFlowPcap(std::string prefix="ofchannel", bool promiscuous=true)
Enable pacp traces at OpenFlow channel between controller and switches.
Ptr< OFSwitch13Device > InstallSwitch(Ptr< Node > swNode)
This method creates an OpenFlow device and aggregates it to the switch node.
static void SetAddressBase(Ipv4Address network, Ipv4Mask mask, Ipv4Address base="0.0.0.1")
Set the IP network base address, used to assign IP addresses to switches and controllers during the C...
DataRate m_channelDataRate
OF channel data rate.
ObjectFactory m_devFactory
OF device factory.
ChannelType
OpenFlow channel type, used to create the connections.
@ DEDICATEDP2P
Uses individual P2P channels.
@ DEDICATEDCSMA
Uses individual CSMA channels.
@ SINGLECSMA
Uses a single shared CSMA channel.
void EnableDatapathStats(std::string prefix="datapath", bool useNodeNames=false)
Enable OpenFlow datapath statistics at OpenFlow switch devices configured by this helper.
void DoDispose() override
Destructor implementation.
virtual void SetChannelType(ChannelType type)
Set the OpenFlow channel type used to create the connections between switches and controllers.
PointToPointHelper m_p2pHelper
Helper for P2P links.
NetDeviceContainer m_controlDevs
OF channel ctrl devices.
CsmaHelper m_csmaHelper
Helper for CSMA links.
Ptr< OFSwitch13Device > InstallSwitch(Ptr< Node > swNode, NetDeviceContainer &swPorts)
This method creates an OpenFlow device and aggregates it to the switch node.
void EnableOpenFlowAscii(std::string prefix="ofchannel")
Enable ASCII traces at OpenFlow channel between controller and switches.
static TypeId GetTypeId()
Register this type.
OFSwitch13DeviceContainer InstallSwitch(NodeContainer &swNodes)
This method creates and aggregates an OpenFlow device to each switch node in the container.
void SetDeviceAttribute(std::string n1, const AttributeValue &v1)
Set an attribute on each OpenFlow device created by this helper.
static Ipv4AddressHelper m_ipv4helper
Helper for IP address.
~OFSwitch13Helper() override
Dummy destructor, see DoDispose.
OFSwitch13DeviceContainer m_openFlowDevs
OF switch devices.
bool m_blocked
Block this helper.
ChannelType m_channelType
OF channel type.
OFSwitch13Helper()
Default constructor.
virtual void CreateOpenFlowChannels()=0
This virtual method must interconnect all switches to all controllers installed by this helper and st...
virtual void SetChannelDataRate(DataRate rate)
Set the OpenFlow channel data rate used to create the connections between switches and controllers.
NodeContainer m_switchNodes
OF switch nodes.
Instantiate subclasses of ns3::Object.
A base class which provides memory management and object aggregation.
Build a set of PointToPointNetDevice objects.
Smart pointer class similar to boost::intrusive_ptr.
a unique identifier for an interface.
Every class exported by the ns3 library is enclosed in the ns3 namespace.