This is a base class that must be extended to create and configure an OpenFlow 1.3 network domain composed of one or more OpenFlow switches connected to single or multiple OpenFlow controllers. More...
#include "ofswitch13-helper.h"
Public Types | |
enum | ChannelType { SINGLECSMA = 0 , DEDICATEDCSMA = 1 , DEDICATEDP2P = 2 } |
OpenFlow channel type, used to create the connections. More... | |
Public Member Functions | |
OFSwitch13Helper () | |
Default constructor. More... | |
~OFSwitch13Helper () override | |
Dummy destructor, see DoDispose. More... | |
virtual void | CreateOpenFlowChannels ()=0 |
This virtual method must interconnect all switches to all controllers installed by this helper and starts the individual OpenFlow channel connections. More... | |
void | EnableDatapathStats (std::string prefix="datapath", bool useNodeNames=false) |
Enable OpenFlow datapath statistics at OpenFlow switch devices configured by this helper. More... | |
void | EnableOpenFlowAscii (std::string prefix="ofchannel") |
Enable ASCII traces at OpenFlow channel between controller and switches. More... | |
void | EnableOpenFlowPcap (std::string prefix="ofchannel", bool promiscuous=true) |
Enable pacp traces at OpenFlow channel between controller and switches. More... | |
OFSwitch13DeviceContainer | InstallSwitch (NodeContainer &swNodes) |
This method creates and aggregates an OpenFlow device to each switch node in the container. More... | |
Ptr< OFSwitch13Device > | InstallSwitch (Ptr< Node > swNode) |
This method creates an OpenFlow device and aggregates it to the switch node. More... | |
Ptr< OFSwitch13Device > | InstallSwitch (Ptr< Node > swNode, NetDeviceContainer &swPorts) |
This method creates an OpenFlow device and aggregates it to the switch node. More... | |
virtual void | SetChannelDataRate (DataRate rate) |
Set the OpenFlow channel data rate used to create the connections between switches and controllers. More... | |
virtual void | SetChannelType (ChannelType type) |
Set the OpenFlow channel type used to create the connections between switches and controllers. More... | |
void | SetDeviceAttribute (std::string n1, const AttributeValue &v1) |
Set an attribute on each OpenFlow device created by this helper. More... | |
![]() | |
Object () | |
Constructor. More... | |
~Object () override | |
Destructor. More... | |
void | AggregateObject (Ptr< Object > other) |
Aggregate two Objects together. More... | |
void | Dispose () |
Dispose of this Object. More... | |
AggregateIterator | GetAggregateIterator () const |
Get an iterator to the Objects aggregated to this one. More... | |
TypeId | GetInstanceTypeId () const override |
Get the most derived TypeId for this Object. More... | |
template<typename T > | |
Ptr< T > | GetObject () const |
Get a pointer to the requested aggregated Object. More... | |
template<> | |
Ptr< Object > | GetObject () const |
Specialization of () for objects of type ns3::Object. More... | |
template<typename T > | |
Ptr< T > | GetObject (TypeId tid) const |
Get a pointer to the requested aggregated Object by TypeId. More... | |
template<> | |
Ptr< Object > | GetObject (TypeId tid) const |
Specialization of (TypeId tid) for objects of type ns3::Object. More... | |
void | Initialize () |
Invoke DoInitialize on all Objects aggregated to this one. More... | |
bool | IsInitialized () const |
Check if the object has been initialized. More... | |
![]() | |
SimpleRefCount () | |
Default constructor. More... | |
SimpleRefCount (const SimpleRefCount &o[[maybe_unused]]) | |
Copy constructor. More... | |
uint32_t | GetReferenceCount () const |
Get the reference count of the object. More... | |
SimpleRefCount & | operator= (const SimpleRefCount &o[[maybe_unused]]) |
Assignment operator. More... | |
void | Ref () const |
Increment the reference count. More... | |
void | Unref () const |
Decrement the reference count. More... | |
![]() | |
virtual | ~ObjectBase () |
Virtual destructor. More... | |
void | GetAttribute (std::string name, AttributeValue &value) const |
Get the value of an attribute, raising fatal errors if unsuccessful. More... | |
bool | GetAttributeFailSafe (std::string name, AttributeValue &value) const |
Get the value of an attribute without raising errors. More... | |
void | SetAttribute (std::string name, const AttributeValue &value) |
Set a single attribute, raising fatal errors if unsuccessful. More... | |
bool | SetAttributeFailSafe (std::string name, const AttributeValue &value) |
Set a single attribute without raising errors. More... | |
bool | TraceConnect (std::string name, std::string context, const CallbackBase &cb) |
Connect a TraceSource to a Callback with a context. More... | |
bool | TraceConnectWithoutContext (std::string name, const CallbackBase &cb) |
Connect a TraceSource to a Callback without a context. More... | |
bool | TraceDisconnect (std::string name, std::string context, const CallbackBase &cb) |
Disconnect from a TraceSource a Callback previously connected with a context. More... | |
bool | TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb) |
Disconnect from a TraceSource a Callback previously connected without a context. More... | |
Static Public Member Functions | |
static void | EnableDatapathLogs (std::string prefix="", bool explicitFilename=false) |
Enable OpenFlow datapath logs at all OpenFlow switch devices on the simulation. More... | |
static TypeId | GetTypeId () |
Register this type. More... | |
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 CreateOpenFlowChannels () procedure. More... | |
![]() | |
static TypeId | GetTypeId () |
Register this type. More... | |
![]() | |
static TypeId | GetTypeId () |
Get the type ID. More... | |
Protected Member Functions | |
void | DoDispose () override |
Destructor implementation. More... | |
![]() | |
Object (const Object &o) | |
Copy an Object. More... | |
virtual void | DoInitialize () |
Initialize() implementation. More... | |
virtual void | NotifyNewAggregate () |
Notify all Objects aggregated to this one of a new Object being aggregated. More... | |
![]() | |
void | ConstructSelf (const AttributeConstructionList &attributes) |
Complete construction of ObjectBase; invoked by derived classes. More... | |
virtual void | NotifyConstructionCompleted () |
Notifier called once the ObjectBase is fully constructed. More... | |
Protected Attributes | |
bool | m_blocked |
Block this helper. More... | |
DataRate | m_channelDataRate |
OF channel data rate. More... | |
ChannelType | m_channelType |
OF channel type. More... | |
NetDeviceContainer | m_controlDevs |
OF channel ctrl devices. More... | |
CsmaHelper | m_csmaHelper |
Helper for CSMA links. More... | |
ObjectFactory | m_devFactory |
OF device factory. More... | |
InternetStackHelper | m_internet |
Helper for TCP/IP stack. More... | |
OFSwitch13DeviceContainer | m_openFlowDevs |
OF switch devices. More... | |
PointToPointHelper | m_p2pHelper |
Helper for P2P links. More... | |
NodeContainer | m_switchNodes |
OF switch nodes. More... | |
Static Protected Attributes | |
static Ipv4AddressHelper | m_ipv4helper |
Helper for IP address. More... | |
Additional Inherited Members | |
![]() | |
static TypeId | GetObjectIid () |
Ensure the TypeId for ObjectBase gets fully configured to anchor the inheritance tree properly. More... | |
This is a base class that must be extended to create and configure an OpenFlow 1.3 network domain composed of one or more OpenFlow switches connected to single or multiple OpenFlow controllers.
Introspection did not find any typical Config paths.
By default, the connections between switches and controllers are created using a single shared out-of-band CSMA channel, with IP addresses assigned using a /24 network mask. Users can modify this configuration by changing the ChannelType attribute at instantiation time. Dedicated out-of-band connections over CSMA or Point-to-Point channels are also available, using a /30 network mask for IP allocation.
Please note that this base helper class was designed to configure a single OpenFlow network domain. All switches will be connected to all controllers on the same domain. If you want to configure separated OpenFlow domains on your network topology (with their individual switches and controllers) so you may need to use a different instance of the derived helper class for each domain. In this case, don't forget to use the SetAddressBase () method to change the IP network address of the other helper instances, in order to avoid IP conflicts.
DataRate
SingleCsma|DedicatedCsma|DedicatedP2p
No TraceSources are defined for this type.
Size of this type is 480 bytes (on a 64-bit architecture).
Definition at line 72 of file ofswitch13-helper.h.
OpenFlow channel type, used to create the connections.
between controllers and switches.
Enumerator | |
---|---|
SINGLECSMA | Uses a single shared CSMA channel. |
DEDICATEDCSMA | Uses individual CSMA channels. |
DEDICATEDP2P | Uses individual P2P channels. |
Definition at line 79 of file ofswitch13-helper.h.
ns3::OFSwitch13Helper::OFSwitch13Helper | ( | ) |
Default constructor.
|
override |
Dummy destructor, see DoDispose.
|
pure virtual |
This virtual method must interconnect all switches to all controllers installed by this helper and starts the individual OpenFlow channel connections.
Implemented in ns3::OFSwitch13InternalHelper, and ns3::OFSwitch13ExternalHelper.
|
overrideprotectedvirtual |
Destructor implementation.
Reimplemented from ns3::Object.
Reimplemented in ns3::OFSwitch13InternalHelper.
|
static |
Enable OpenFlow datapath logs at all OpenFlow switch devices on the simulation.
This method will enable vlog system at debug level on the BOFUSS library, dumping messages to output file.
prefix | Filename prefix to use for log file. |
explicitFilename | Treat the prefix as an explicit filename if true. |
void ns3::OFSwitch13Helper::EnableDatapathStats | ( | std::string | prefix = "datapath" , |
bool | useNodeNames = false |
||
) |
Enable OpenFlow datapath statistics at OpenFlow switch devices configured by this helper.
This method will create an OFSwitch13StatsCalculator for each switch device, dumping statistcs to output files.
prefix | Filename prefix to use for stats files. |
useNodeNames | Use node names instead of datapath id. |
void ns3::OFSwitch13Helper::EnableOpenFlowAscii | ( | std::string | prefix = "ofchannel" | ) |
Enable ASCII traces at OpenFlow channel between controller and switches.
prefix | Filename prefix to use for ascii files. |
void ns3::OFSwitch13Helper::EnableOpenFlowPcap | ( | std::string | prefix = "ofchannel" , |
bool | promiscuous = true |
||
) |
Enable pacp traces at OpenFlow channel between controller and switches.
prefix | Filename prefix to use for pcap files. |
promiscuous | If true, enable promisc trace. |
|
static |
Register this type.
OFSwitch13DeviceContainer ns3::OFSwitch13Helper::InstallSwitch | ( | NodeContainer & | swNodes | ) |
This method creates and aggregates an OpenFlow device to each switch node in the container.
Switches configured by this method will have no switch ports. Don't forget to add ports do them later, or they will do nothing.
swNodes | The switch nodes where to install the OpenFlow devices. |
Ptr<OFSwitch13Device> ns3::OFSwitch13Helper::InstallSwitch | ( | Ptr< Node > | swNode | ) |
This method creates an OpenFlow device and aggregates it to the switch node.
The switch configured by this method will have no switch ports. Don't forget to add ports do it later, or it will do nothing.
swNode | The switch node where to install the OpenFlow device. |
Ptr<OFSwitch13Device> ns3::OFSwitch13Helper::InstallSwitch | ( | Ptr< Node > | swNode, |
NetDeviceContainer & | swPorts | ||
) |
This method creates an OpenFlow device and aggregates it to the switch node.
It also attaches the given devices as physical ports on the switch. If no devices are given, the switch will be configured without ports. In this case, don't forget to add ports to it later, or it will do nothing.
swNode | The switch node where to install the OpenFlow device. |
ports | Container of devices to be added as physical switch ports. |
|
static |
Set the IP network base address, used to assign IP addresses to switches and controllers during the CreateOpenFlowChannels () procedure.
network | The Ipv4Address containing the initial network number to use during allocation. |
mask | The Ipv4Mask containing one bits in each bit position of the network number. |
base | An optional Ipv4Address containing the initial address used for IP address allocation. |
|
virtual |
Set the OpenFlow channel data rate used to create the connections between switches and controllers.
rate | The channel data rate to use. |
Reimplemented in ns3::OFSwitch13ExternalHelper.
|
virtual |
Set the OpenFlow channel type used to create the connections between switches and controllers.
type | The ChannelType to use. |
Reimplemented in ns3::OFSwitch13ExternalHelper.
void ns3::OFSwitch13Helper::SetDeviceAttribute | ( | std::string | n1, |
const AttributeValue & | v1 | ||
) |
Set an attribute on each OpenFlow device created by this helper.
n1 | the name of the attribute to set. |
v1 | the value of the attribute to set. |
|
protected |
Block this helper.
Definition at line 227 of file ofswitch13-helper.h.
|
protected |
OF channel data rate.
Definition at line 225 of file ofswitch13-helper.h.
|
protected |
OF channel type.
Definition at line 224 of file ofswitch13-helper.h.
|
protected |
OF channel ctrl devices.
Definition at line 229 of file ofswitch13-helper.h.
|
protected |
Helper for CSMA links.
Definition at line 234 of file ofswitch13-helper.h.
|
protected |
OF device factory.
Definition at line 226 of file ofswitch13-helper.h.
|
protected |
Helper for TCP/IP stack.
Definition at line 233 of file ofswitch13-helper.h.
|
staticprotected |
Helper for IP address.
Definition at line 237 of file ofswitch13-helper.h.
|
protected |
OF switch devices.
Definition at line 230 of file ofswitch13-helper.h.
|
protected |
Helper for P2P links.
Definition at line 235 of file ofswitch13-helper.h.
|
protected |
OF switch nodes.
Definition at line 231 of file ofswitch13-helper.h.