Skip to content

SwitchRegistryModule

Alex edited this page Nov 4, 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": 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
.Reply-MessageType [[REPLY.SWITCH_REGISTRY_MODULE.GET_SWITCH_BY_ID
.Reply-Payload [[Reply-Container

 

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

 

MessageTypes

FROM = 0x02
    SWITCH_REGISTRY_MODULE = 0x0001
        SWITCH_EVENT = 0x00
            ADDED = 0x00
            REMOVED = 0x01
            CHANGED = 0x02
	
REQUEST = 0x03
    SWITCH_REGISTRY_MODULE = 0x0001
        GET_ALL_SWITCHES = 0x00
        GET_SWITCH_BY_ID = 0x01

REPLY = 0x04
    SWITCH_REGISTRY_MODULE = 0x0001
        GET_ALL_SWITCHES = 0x00
        GET_SWITCH_BY_ID = 0x01

 

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 Comment
[[FROM.SWITCH_REGISTRY_MODULE.SWITCHEVENT.ADDED SwitchRegistryModule#SwitchEvent]]
[[FROM.SWITCH_REGISTRY_MODULE.SWITCHEVENT.REMOVED SwitchRegistryModule#SwitchEvent]]
[[FROM.SWITCH_REGISTRY_MODULE.SWITCHEVENT.CHANGED SwitchRegistryModule#SwitchEvent]]

Subscriptions used (FROM other modules)

MessageType Comment
[[FROM.SWITCH_ADAPTER.OPENFLOW.FEATURES_REPLY SwitchAdapter#OpenFlow-from-Switch]]
[[FROM.SWITCH_ADAPTER.OPENFLOW.MULTIPART_REPLY SwitchAdapter#OpenFlow-from-Switch]]
[[FROM.SWITCH_ADAPTER.OPENFLOW.PORT_STATUS SwitchAdapter#OpenFlow-from-Switch]]
[[FROM.SWITCH_ADAPTER.OPENFLOW.ECHO_REQUEST SwitchAdapter#OpenFlow-from-Switch]]

Here the activity diagrams for used subscriptions:

ZeroSDN SwitchRegistry main methods  

Clone this wiki locally