ZeroSDN Controller  1.0
A modular distributed Software-Defined Network Controller
 All Classes Files Functions Variables Enumerations Enumerator Friends Macros
SwitchAdapterServer Class Reference

A Module which accepts connections from Switches and spawns SwitchAdapter Modules for them. More...

#include <SwitchAdapterServer.hpp>

Inheritance diagram for SwitchAdapterServer:

Public Member Functions

 SwitchAdapterServer (const uint64_t instanceId, const of_version_t openFlowVersion, const Poco::Net::SocketAddress serverAddress, const bool flushStreamToSwitchesEveryMessage, const bool startAsMock)
 
 ~SwitchAdapterServer ()
 
virtual bool enable ()
 
virtual void disable ()
 

Detailed Description

A Module which accepts connections from Switches and spawns SwitchAdapter Modules for them.

The SwitchAdapter wraps each OpenFlow capable switch as a ZMF Module instance. An OpenFlow switch connects to a SwitchAdapter instance as it would normally connect to a controller.

Author
Andre Kutzleb
Date
01.07.2015

Constructor & Destructor Documentation

SwitchAdapterServer::SwitchAdapterServer ( const uint64_t  instanceId,
const of_version_t  openFlowVersion,
const Poco::Net::SocketAddress  serverAddress,
const bool  flushStreamToSwitchesEveryMessage,
const bool  startAsMock 
)

Constructs (but does not start) a SwitchAdapterServer.

Parameters
instanceIdunique id of this SwitchAdapterServer instance.
openFlowVersionthe OpenFlow version this runner and the spawned SwitchAdapters will speak with the switches.
serverAddressthe address on which a ServerSocket will be listening for switches.
flushStreamToSwitchesEveryMessageif set to true, SwitchAdapters will flush the socket after every sent message. flushing may affect throughput negatively but can decrease latency. Flushing also prevents messages from waiting in the queue when no message follow after it.
SwitchAdapterServer::~SwitchAdapterServer ( )

Destructor. Stops all SwitchAdapters and closes the ServerSocket.

Member Function Documentation

void SwitchAdapterServer::disable ( )
virtual

closes the serverSocket, shuts down all child SwitchAdapter modules.

bool SwitchAdapterServer::enable ( )
virtual

starts a ServerSocket listening for incoming switchConnections. For each incoming connection, an OpenFlow handshake is attempted. If the handshake is successful, a SwitchAdapter(Module) is started.

Returns
true if started successfully, false else (could not bind ServerSocket)

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