A Discrete-Event Network Simulator
API
ns3::OFSwitch13ExternalHelper Class Reference

This helper extends the base class and can be instantiated to create and configure an OpenFlow 1.3 network domain composed of one or more OpenFlow switches connected to a single external real OpenFlow controller. More...

#include "ofswitch13-external-helper.h"

+ Inheritance diagram for ns3::OFSwitch13ExternalHelper:
+ Collaboration diagram for ns3::OFSwitch13ExternalHelper:

Public Member Functions

 OFSwitch13ExternalHelper ()
 Default constructor. More...
 
 ~OFSwitch13ExternalHelper () override
 Dummy destructor, see DoDispose. More...
 
void CreateOpenFlowChannels () override
 This virtual method must interconnect all switches to all controllers installed by this helper and starts the individual OpenFlow channel connections. More...
 
Ptr< NetDeviceInstallExternalController (Ptr< Node > cNode)
 This method prepares the controller node so it can be used to connect internal simulated switches to an external OpenFlow controller running on the local machine over a TapBridge device. More...
 
void SetChannelDataRate (DataRate rate) override
 Set the OpenFlow channel data rate used to create the connections between switches and controllers. More...
 
void SetChannelType (ChannelType type) override
 Set the OpenFlow channel type used to create the connections between switches and controllers. More...
 
- Public Member Functions inherited from ns3::OFSwitch13Helper
 OFSwitch13Helper ()
 Default constructor. More...
 
 ~OFSwitch13Helper () override
 Dummy destructor, see DoDispose. 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< OFSwitch13DeviceInstallSwitch (Ptr< Node > swNode)
 This method creates an OpenFlow device and aggregates it to the switch node. More...
 
Ptr< OFSwitch13DeviceInstallSwitch (Ptr< Node > swNode, NetDeviceContainer &swPorts)
 This method creates an OpenFlow device and aggregates it to the switch node. More...
 
void SetDeviceAttribute (std::string n1, const AttributeValue &v1)
 Set an attribute on each OpenFlow device created by this helper. More...
 
- Public Member Functions inherited from ns3::Object
 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< ObjectGetObject () 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< ObjectGetObject (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...
 
- Public Member Functions inherited from ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter >
 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...
 
SimpleRefCountoperator= (const SimpleRefCount &o[[maybe_unused]])
 Assignment operator. More...
 
void Ref () const
 Increment the reference count. More...
 
void Unref () const
 Decrement the reference count. More...
 
- Public Member Functions inherited from ns3::ObjectBase
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 TypeId GetTypeId ()
 Register this type. More...
 
- Static Public Member Functions inherited from ns3::OFSwitch13Helper
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 Public Member Functions inherited from ns3::Object
static TypeId GetTypeId ()
 Register this type. More...
 
- Static Public Member Functions inherited from ns3::ObjectBase
static TypeId GetTypeId ()
 Get the type ID. More...
 

Protected Member Functions

void DoDispose () override
 Destructor implementation. More...
 
- Protected Member Functions inherited from ns3::OFSwitch13Helper
void DoDispose () override
 Destructor implementation. More...
 
- Protected Member Functions inherited from ns3::Object
 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...
 
- Protected Member Functions inherited from ns3::ObjectBase
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...
 

Private Attributes

Ipv4Address m_controlAddr
 OF IP controller addr. More...
 
Ptr< Nodem_controlNode
 OF controller node. More...
 
uint16_t m_controlPort
 OF controller TCP port. More...
 
Ptr< CsmaChannelm_csmaChannel
 Common CSMA channel. More...
 

Additional Inherited Members

- Public Types inherited from ns3::OFSwitch13Helper
enum  ChannelType { SINGLECSMA = 0 , DEDICATEDCSMA = 1 , DEDICATEDP2P = 2 }
 OpenFlow channel type, used to create the connections. More...
 
- Protected Attributes inherited from ns3::OFSwitch13Helper
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 inherited from ns3::OFSwitch13Helper
static Ipv4AddressHelper m_ipv4helper
 Helper for IP address. More...
 

Detailed Description

This helper extends the base class and can be instantiated to create and configure an OpenFlow 1.3 network domain composed of one or more OpenFlow switches connected to a single external real OpenFlow controller.

Introspection did not find any typical Config paths.

It brings methods for configuring the controller node for TapBridge usage and creating the OpenFlow channels.


Attributes

  • Port: The port number where controller will be available.
    • Set with class: ns3::UintegerValue
    • Underlying type: uint16_t 0:65535
    • Initial value: 6653
    • Flags: constructwriteread

Attributes defined in parent class ns3::OFSwitch13Helper

  • ChannelDataRate: The data rate to be used for the OpenFlow channel.
  • ChannelType: The configuration used to create the OpenFlow channel
    • Set with class: ns3::EnumValue
    • Underlying type: SingleCsma|DedicatedCsma|DedicatedP2p
    • Initial value: SingleCsma
    • Flags: construct

No TraceSources are defined for this type.
Size of this type is 512 bytes (on a 64-bit architecture).

Definition at line 42 of file ofswitch13-external-helper.h.

Constructor & Destructor Documentation

◆ OFSwitch13ExternalHelper()

ns3::OFSwitch13ExternalHelper::OFSwitch13ExternalHelper ( )

Default constructor.

◆ ~OFSwitch13ExternalHelper()

ns3::OFSwitch13ExternalHelper::~OFSwitch13ExternalHelper ( )
override

Dummy destructor, see DoDispose.

Member Function Documentation

◆ CreateOpenFlowChannels()

void ns3::OFSwitch13ExternalHelper::CreateOpenFlowChannels ( )
overridevirtual

This virtual method must interconnect all switches to all controllers installed by this helper and starts the individual OpenFlow channel connections.

Attention
After calling this method, it will not be allowed to install more switches or controller using this helper.

Implements ns3::OFSwitch13Helper.

◆ DoDispose()

void ns3::OFSwitch13ExternalHelper::DoDispose ( )
overrideprotectedvirtual

Destructor implementation.

Reimplemented from ns3::Object.

◆ GetTypeId()

static TypeId ns3::OFSwitch13ExternalHelper::GetTypeId ( )
static

Register this type.

Returns
The object TypeId.

◆ InstallExternalController()

Ptr<NetDevice> ns3::OFSwitch13ExternalHelper::InstallExternalController ( Ptr< Node cNode)

This method prepares the controller node so it can be used to connect internal simulated switches to an external OpenFlow controller running on the local machine over a TapBridge device.

It installs the TCP/IP stack into controller node, attach it to the common CSMA channel and configure IP address for it.

Parameters
cNodeThe node to configure as the controller.
Returns
The network device to bind to the TapBridge.

◆ SetChannelDataRate()

void ns3::OFSwitch13ExternalHelper::SetChannelDataRate ( DataRate  rate)
overridevirtual

Set the OpenFlow channel data rate used to create the connections between switches and controllers.

Parameters
rateThe channel data rate to use.

Reimplemented from ns3::OFSwitch13Helper.

◆ SetChannelType()

void ns3::OFSwitch13ExternalHelper::SetChannelType ( ChannelType  type)
overridevirtual

Set the OpenFlow channel type used to create the connections between switches and controllers.

Parameters
typeThe ChannelType to use.

Reimplemented from ns3::OFSwitch13Helper.

Member Data Documentation

◆ m_controlAddr

Ipv4Address ns3::OFSwitch13ExternalHelper::m_controlAddr
private

OF IP controller addr.

Definition at line 79 of file ofswitch13-external-helper.h.

◆ m_controlNode

Ptr<Node> ns3::OFSwitch13ExternalHelper::m_controlNode
private

OF controller node.

Definition at line 77 of file ofswitch13-external-helper.h.

◆ m_controlPort

uint16_t ns3::OFSwitch13ExternalHelper::m_controlPort
private

OF controller TCP port.

Definition at line 78 of file ofswitch13-external-helper.h.

◆ m_csmaChannel

Ptr<CsmaChannel> ns3::OFSwitch13ExternalHelper::m_csmaChannel
private

Common CSMA channel.

Definition at line 76 of file ofswitch13-external-helper.h.


The documentation for this class was generated from the following file: