30 class OFSwitch13Controller;
49 TypeId(
"ns3::OFSwitch13ExternalHelper")
51 .SetGroupName(
"OFSwitch13")
55 "The port number where controller will be available.",
58 MakeUintegerChecker<uint16_t>());
70 "type for OFSwitch13ExternalHelper (use SingleCsma).");
98 NS_LOG_INFO(
"Attach all switches and controllers to the same "
102 NetDeviceContainer switchDevices;
112 NS_LOG_INFO(
"Connect switch " << (*ofDev)->GetDatapathId()
113 <<
" to controller " << addr.GetIpv4()
114 <<
" port " << addr.GetPort());
135 NS_LOG_INFO(
"Installing OpenFlow controller on node " << cNode->GetId());
137 "OpenFlow controller/channels already configured.");
140 if (!cNode->GetObject<Ipv4>())
NetDeviceContainer Install(Ptr< Node > node) const
This method creates an ns3::CsmaChannel with the attributes configured by CsmaHelper::SetChannelAttri...
AttributeValue implementation for DataRate.
void Install(std::string nodeName) const
Aggregate implementations of the ns3::Ipv4, ns3::Ipv6, ns3::Udp, and ns3::Tcp classes onto the provid...
Ipv4Address NewNetwork()
Increment the network number and reset the IP address counter to the base value provided in the SetBa...
Ipv4InterfaceContainer Assign(const NetDeviceContainer &c)
Assign IP addresses to the net devices specified in the container based on the current network prefix...
uint32_t GetN() const
Get the number of Ptr<NetDevice> stored in this container.
Ptr< NetDevice > Get(uint32_t i) const
Get the Ptr<NetDevice> stored in this container at a given index.
std::vector< Ptr< OFSwitch13Device > >::const_iterator Iterator
OFSwitch13Device container iterator.
Iterator Begin() const
Get an iterator which refers to the first OpenFlow device in the container.
Iterator End() const
Get an iterator which indicates past-the-last OpenFlow device in the container.
void StartControllerConnection(Address ctrlAddr)
Starts the TCP connection between this switch and the target controller indicated by the address para...
void CreateOpenFlowChannels() override
This virtual method must interconnect all switches to all controllers installed by this helper and st...
Ptr< NetDevice > InstallExternalController(Ptr< Node > cNode)
This method prepares the controller node so it can be used to connect internal simulated switches to ...
uint16_t m_controlPort
OF controller TCP port.
~OFSwitch13ExternalHelper() override
Dummy destructor, see DoDispose.
Ptr< CsmaChannel > m_csmaChannel
Common CSMA channel.
static TypeId GetTypeId()
Register this type.
void SetChannelType(ChannelType type) override
Set the OpenFlow channel type used to create the connections between switches and controllers.
Ipv4Address m_controlAddr
OF IP controller addr.
Ptr< Node > m_controlNode
OF controller node.
void SetChannelDataRate(DataRate rate) override
Set the OpenFlow channel data rate used to create the connections between switches and controllers.
void DoDispose() override
Destructor implementation.
OFSwitch13ExternalHelper()
Default constructor.
InternetStackHelper m_internet
Helper for TCP/IP stack.
@ DEDICATEDP2P
Uses individual P2P channels.
@ DEDICATEDCSMA
Uses individual CSMA channels.
@ SINGLECSMA
Uses a single shared CSMA channel.
void DoDispose() override
Destructor implementation.
virtual void SetChannelType(ChannelType type)
Set the OpenFlow channel type used to create the connections between switches and controllers.
NetDeviceContainer m_controlDevs
OF channel ctrl devices.
CsmaHelper m_csmaHelper
Helper for CSMA links.
static Ipv4AddressHelper m_ipv4helper
Helper for IP address.
OFSwitch13DeviceContainer m_openFlowDevs
OF switch devices.
bool m_blocked
Block this helper.
ChannelType m_channelType
OF channel type.
OFSwitch13Helper()
Default constructor.
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.
static EventId ScheduleNow(FUNC f, Ts &&... args)
Schedule an event to expire Now.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Ptr< const AttributeAccessor > MakeUintegerAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
#define NS_ABORT_MSG(msg)
Unconditional abnormal program termination with a message.
#define NS_ABORT_MSG_IF(cond, msg)
Abnormal program termination if a condition is true, with a message.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
void(* DataRate)(DataRate oldValue, DataRate newValue)
TracedValue callback signature for DataRate.
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Every class exported by the ns3 library is enclosed in the ns3 namespace.