Skip to content

SwitchRegistryModule

Alex edited this page Nov 9, 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)

| Request-MessageType | [[REQUEST.SWITCH_REGISTRY_MODULE.
GET_ALL_SWITCHES|SwitchRegistryModule#MessageTypes]]|
--- | --- | Request-Payload | Request-Container +
message GetAllSwitchesRequest {} | | Reply-MessageType | [[REPLY.SWITCH_REGISTRY_MODULE.
GET_ALL_SWITCHES|SwitchRegistryModule#MessageTypes]]
| | 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|SwitchRegistryModule#MessageTypes]]| --- | --- |Request-Payload|Request-Container +
message GetSwitchByIdRequest {
required uint64 switch_dpid = 1;
}| |Reply-MessageType|[[REPLY.SWITCH_REGISTRY_MODULE.
GET_SWITCH_BY_ID|SwitchRegistryModule#MessageTypes]]
| |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) |SwitchRegistryModule#MessageTypes]]| --- | --- |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 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