Applicable VersionsNetSim StandardNetSim Pro


Applicable Releasesv11v12
v13
In the NetSim SDN module, the SDN controllers and its association with the SDN clients are configured prior to the Simulation. In order to perform dynamic controller allocation and client association, the source codes of the SDN module in NetSim will have to be modified.

In NetSim SDN each node is associated with an open flow variable (pointer) ptrOPENFLOW which has the following structure:

typedef struct stru_openflow
{
bool isSDNConfigured;
bool isSDNController;

NETSIM_IPAddress myIP;

char* sdnControllerDev;
NETSIM_ID sdnControllerId;

union sdn_info
{
ptrSDNCONTROLLERINFO controllerInfo;
ptrSDNCLIENTINFO clientInfo;
}INFO;

UINT msgId;
ptrHANDLEINFO handleInfo;
    }OPENFLOW, *ptrOPENFLOW;

Each controller device is associated with a controller info variable(pointer) ptrSDNCONTROLLERINFO which has additional information about the controller:

typedef struct stru_controllerInfo
{
NETSIM_ID controllerId;
NETSIM_IPAddress controllerIP;
UINT16 port;
ptrSOCKETINTERFACE sock;
    }SDNCONTROLLERINFO, *ptrSDNCONTROLLERINFO;

Each client device is associated with a client info variable(pointer) ptrSDNCLIENTINFO which has additional information about the client:

typedef struct stru_clientInfo
{
NETSIM_ID clientId;
UINT16 clientPort;
NETSIM_IPAddress clientIP;
ptrSOCKETINTERFACE sock;
struct stru_clientInfo* next;
}SDNCLIENTINFO,*ptrSDNCLIENTINFO;

This definition can be found in the file OpenFlow.h that is part of the SDN module source codes.

The parameter isSDNConfigured of a node is set to 1 if Open Flow protocol is enabled in its properties.
The parameter isSDNController of a node is set to 1 if SDN_Controller option is set to true in its properties.
If a node is a controller, the list ptrSDNCLIENTINFO clientInfo will be updated with client node information.

The function bool isSDNController(NETSIM_ID d) that is part of the SDNController.c file returns true or false based on the flag isSDNController that is part of the device's open flow variable.

The function void openFlow_add_new_client(NETSIM_ID ct, NETSIM_ID ci, UINT16 port) which is also part of the SDNController.c file is used to add a new client to a controller's ptrSDNCLIENTINFO list.

The function ptrSDNCLIENTINFO openFlow_find_clientInfo(NETSIM_ID ct, NETSIM_ID ci) is used to check the association between a client and a controller node.

Debugging through the SDN module source codes for a simple SDN simulation will help you in basically understanding how the variables are configured based on user configuration done in NetSim GUI and about how different functions are called when a command is executed in the device console or via sockets.

Subsequently, for your implementation, periodic classification of devices into:
  • SDN controllers
  • SDN clients
  • Mapping Client to a respective controller
needs to be carried out.

Then, the open flow parameters of each device will have to be updated during runtime as per the classification that was done.

The frequency of this process can be controlled based on triggers which can be based on time or specific events. 


Related Articles:

https://support.tetcos.com/support/solutions/articles/14000105991