Skip to content

SwitchRegistryModule

Alex edited this page Nov 5, 2015 · 23 revisions

SwitchRegistryModule

Information

ModuleTypeID (hex) 0x0001
ModuleTypeID (decimal) 1
Distribution support single instance
Dependencies -

 

Description

The SwitchRegistryModule knows about all switches in the SDN-network. This module provides more detailed information about switches and publishes events informing other modules about the state of the switches. In contrast, the SwitchAdapter only serves as a connector between ZMF and the OpenFlow connection to an actual switch.

 

Services Provided (REQUEST/REPLY)


 

GetAllSwitches

Query all Switches known to the SwitchRegistryModule. Reply can contain 0 or more Switches.

Request-MessageType:

REQUEST.SWITCH_REGISTRY_MODULE.GET_ALL_SWITCHES

Request-Payload:

Request-Container +

message GetAllSwitchesRequest {}
Reply-MessageType:

REPLY.SWITCH_REGISTRY_MODULE.GET_ALL_SWITCHES

Reply-Payload:

Reply-Container +

message GetAllSwitchesReply {
    repeated Switch switches = 1;
}

 

GetSwitchById

Query for a single switch. Request must contain the switchId (datapath id) of the switch. Reply contains the switch with that switchId, or nothing, if the SwitchRegistryModule does not know any switch with that switchId.

Request-MessageType:

REQUEST.SWITCH_REGISTRY_MODULE.GET_SWITCH_BY_ID

Request-Payload:

Request-Container +

message GetSwitchByIdRequest {
    required uint64 switch_dpid = 1;
}
Reply-MessageType:

REPLY.SWITCH_REGISTRY_MODULE.GET_SWITCH_BY_ID

Reply-Payload:

Reply-Container +

message GetSwitchByIdReply { 
   optional Switch switch = 1;
}

 

Publishes Events (FROM)

SwitchEvent

When a switch is added, removed, or changed one of its attributes, an event of this type is published.

From-MessageType

FROM.SWITCH_REGISTRY_MODULE.SWITCH_EVENT.*(ADDED/REMOVED/CHANGED)

From-Payload

From-Container +

message SwitchEvent{
    oneof SwitchEventType {
        Switch switch_added = 1;
        Switch switch_removed = 2;
        SwitchChanged switch_changed = 3;
    }
    message SwitchChanged {
        required Switch switch_before = 1;
        required Switch switch_now = 2;
    }
}

 

MessageTypes

For a detailed list of all supported topics, see the SwitchAdapter.topics file.  

Implementation Details

Overview

start Module:

  • do the Subscriptions (we need: the own types AND Switch-Adapter types, that give information about the Switch)
  • look for for existing Switches (in case this module was started after some Switch-Adapters were already running (maybe with V. 1.2))

After Startup: Module waits for messages from other parties, since there is nothing else to do.

  • new Switch in ZMF: send requests to the Switch, so every information is available.
  • Switch-Reply or Switch Status message(e.g. Port-Status): save data for the Switch, which is origin of the message.
  • Information-Request: Create Reply, with Information for specific or all Switches.

Details

start module:

When the Module is started, it will subscribe to four Types of ZMF-messages, which are all coming from a SwitchAdapter: Feature-Reply, Echo-Request, Multipart-Reply and Port-Status. After the Subscriptions are done, the module will search for existing SwitchAdapter-Instances within the ZMF. If one is found the Switch will be listed in the inner list and will send a send a Feature Request and, if the OpenFlow-Version of the Switch is 1.3 or higher, a Port-Description Multipart-Request to the SwitchAdapter.

Request/Reply: (REQUEST)

There are two possible Requests, that are supported by this module: All-Switches and Spefic-Switch-By-Id. If all switches are requested, we send a list with every Switch, which is marked as 'active'(meaning we already have all necassary data for the Switch), back to the requesting module. If a specific Switch is requested, we look up, whether it is available and 'active'. If both is true, the Switch will be sent back, if not we send a NO-REPLY-message.

available Subscriptions (FROM this module)


MessageType: FROM.SWITCH_REGISTRY_MODULE.SWITCHEVENT.ADDED
Description: A Switch was added, and is 'active'(meaning we already have all necassary data for the Switch)


MessageType: FROM.SWITCH_REGISTRY_MODULE.SWITCHEVENT.REMOVED
Description: A Switch was removed


MessageType: FROM.SWITCH_REGISTRY_MODULE.SWITCHEVENT.CHANGED
Description: The data for a specific Switch was changed (e.g. a port was deleted due to not working)


Subscriptions used (FROM other modules)


MessageType: FROM.SWITCH_ADAPTER.OPENFLOW.FEATURES_REPLY
Comment: Finding out detailed information about the switches (and if OF 1.0 Port-Descriptions).

MessageType: FROM.SWITCH_ADAPTER.OPENFLOW.MULTIPART_REPLY
Comment: Finding out Ports and their Descriptions for the switches

MessageType: FROM.SWITCH_ADAPTER.OPENFLOW.PORT_STATUS
Comment: Updating a Port for one Switch (ports can be added, removed or their data was changed)

MessageType:FROM.SWITCH_ADAPTER.OPENFLOW.ECHO_REQUEST
Comment: Adding a Switch if unknown, if known and no reply received yet: resend requests

Here the activity diagrams for used subscriptions:

ZeroSDN SwitchRegistry main methods  

Clone this wiki locally