-
Notifications
You must be signed in to change notification settings - Fork 7
SwitchAdapter
| ModuleTypeID (hex) | 0x0000 |
|---|---|
| ModuleTypeID (decimal) | 0 |
| Distribution support | multiple, independent instances |
| Dependencies | - |
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.
- From the perspective of the OpenFlow switch the SwitchAdapter is its controller.
- From the perspective of any other module inside the ZMF the SwitchAdapter represents an actual OpenFlow switch.
The SwitchAdapter basically only acts as a relay. For any more advanced functionality involving Switches, consult SwitchRegistryModule.
Note: as the instanceId of a SwitchAdapter is equal to the SwitchId, the creation of a serverSocket and the OpenFlow handshake is conducted BEFORE the SwitchAdapter module is started. therefore, the SwitchAdapter runnable actually acts as a Launcher, which will start a SwitchAdapter for each incoming connection. For this to work, the runner has to be started with two additional parameters - OpenFlow version ("1.0" or "1.3) and OpenFlow port (e.g. 6633).
The configuration file for this module must define the following variables:
| Config | Type | Description |
|---|---|---|
| ZSDN_SWITCH_ADAPTER_PACKET_IN_MULTICAST_GROUPS | Integer | SwitchAdapters will evenly distribute their packetIns to each multicast group(see [SwitchAdapter#MulticastGroups]. This allows for load balancing (each PacketIn consumer module can subscribe to one or more multicast-groups). There can be [1,256] multicast groups. |
| ZSDN_SWITCH_ADAPTER_FLUSH_STREAM_AFTER_EVERY_MESSAGE | A | if true, the socket to the switches is flushed after every message. may decrease performance but may decrease latency and avoid stuck messages (not enough to auto-flush, remains in buffer indefinitely) |
| ZSDN_SWITCH_ADAPTER_EXPERIMENTAL_FAST_TOPIC_GENERATION | A | if true, the, Switch will use a faster, but untested topic generation method. Should be set false by default. |
This enables batch processing of openFlow actions. All openFlow messages contained in the request will be sequentially executed as if they were received by the publish/subscribe api. This allows guaranteed and uninfluenced in-order delivery of the contained messages.
| .Request-MessageType | SwitchAdapter#MessageTypes |
--- | ---
| .Request-Payload | ZSDN_Core-Modules#Container + message HandleOpenflowMessagesRequest {} |
| .Reply-MessageType | SwitchAdapter#MessageTypes |
| .Reply-Payload | ZSDN_Core-Modules#Container + message HandleOpenflowMessagesReply { repeated bytes open_flow_message = 1; } |
Any OpenFlow message the SwitchAdapter receives from the actual switch (with the Exception of HELLO, ECHO_REQUEST, ECHO_REPLY, ROLE_REPLY and ROLE_STATUS) is published using this MessageType.
IMPORTANT: The OpenFlow frame is published as-is, do not use protobuffers to parse Messages sent to this MessageType.
| _.From-MessageTyp | SwitchAdapter#MessageTypes| --- | --- | _.From-Payload | raw OpenFlow frame |
The SwitchAdapter will forward any messages received for this MessageType (with the Exception of HELLO, ECHO_REPLY, ROLE_REQUEST) to the underlying switch. Every SwitchAdapter instance is subscribed to this MessageType using its own switchID (DPID) as value for SWITCH_INSTANCE.
IMPORTANT: The payload has to be a raw OpenFlow frame - do not use protobuf to serialize Messages sent to this MessageType.
|.To-MessageType|SwitchAdapter#MessageTypes| --- | --- |.To-Payload| raw OpenFlow frame|
In order to be able to distribute packetIns in a round-robin fashion to multiple recipients, the SwitchAdapter adds a multicast-byte to all packetIn messages. The config ZSDN_SWITCH_ADAPTER_PACKET_IN_MULTICAST_GROUPS influences how many multicast groups there are. Due to the nature of hierarchical topics, the introduction of this byte forces Modules that want subtopics of packetIn to subscribe once for each multicast-group - if they want to receive all messages. Otherwise (as intended for load balancing) modules subscribe only to one specific multicast group.
The SwitchAdapter will evenly publish all packetIns to the multicast groups.
The Identifiers for OpenFlow, Ethertype and Protocol, are the same as the IDs in the corresponing headers. Through using that, we can just read the Headers and append the ID for the ZMF messages. Custom types are available for further OpenFlow, Ethertype or Protocol extensions.
TO = 0x01
SWITCH_ADAPTER = 0x0000
SWITCH_INSTANCE = 0x????????????????
OPENFLOW = 0x00 #only types sent from controller
HELLO = 0x00 #for the sake of completeness, will not be sent to switch
ERROR = 0x01
ECHO_REQUEST = 0x02 #for the sake of completeness, will not be sent to switch
ECHO_REPLY = 0x03 #for the sake of completeness, will not be sent to switch
OF_1_0_VENDOR_OF_1_3_EXPERIMENTER = 0x04
FEATURES_REQUEST = 0x05
FEATURES_REPLY = 0x06
GET_CONFIG_REQUEST = 0x07
GET_CONFIG_REPLY = 0x08
SET_CONFIG = 0x09
PACKET_IN = 0x0A
FLOW_REMOVED = 0x0B
PORT_STATUS = 0x0C
PACKET_OUT = 0x0D
FLOW_MOD = 0x0E
OF_1_0_PORT_MOD_OF_1_3_GROUP_MOD = 0x0F
OF_1_0_STATS_REQUEST_OF_1_3_PORT_MOD = 0x10
OF_1_0_STATS_REPLY_OF_1_3_TABLE_MOD = 0x11
OF_1_0_BARRIER_REQUEST_OF_1_3_MULTIPART_REQUEST = 0x12
OF_1_0_BARRIER_REPLY_OF_1_3_MULTIPART_REPLY = 0x13
OF_1_0_QUEUE_GET_CONFIG_REQUEST_OF_1_3_BARRIER_REQUEST = 0x14
OF_1_0_QUEUE_GET_CONFIG_REPLY_OF_1_3_BARRIER_REPLY = 0x15
OF_1_3_QUEUE_GET_CONFIG_REQUEST = 0x16
OF_1_3_QUEUE_GET_CONFIG_REPLY = 0x17
ROLE_RQUEST = 0x18
ROLE_REPLY = 0x19
GET_ASYNC_REQUEST = 0x1A
GET_ASYNC_REPLY = 0x1B
SET_ASYNC = 0x1C
METER_MOD = 0x1D
CUSTOM_OPENFLOWTYPE = 0x??
FROM = 0x02
SWITCH_ADAPTER = 0x0000
OPENFLOW = 0x00 #only types sent from switch
HELLO = 0x00 #for the sake of completeness, will not be sent to switch
ERROR = 0x01
ECHO_REQUEST = 0x02 #for the sake of completeness, will not be sent to switch
ECHO_REPLY = 0x03 #for the sake of completeness, will not be sent to switch
OF_1_0_VENDOR_OF_1_3_EXPERIMENTER = 0x04
FEATURES_REQUEST = 0x05
FEATURES_REPLY = 0x06
GET_CONFIG_REQUEST = 0x07
GET_CONFIG_REPLY = 0x08
SET_CONFIG = 0x09
PACKET_IN = 0x0A
MULTICAST_GROUP = 0x?? default=0x00
IPv4 = 0x0800
HOPOPT = 0x00
ICMP = 0x01
IGMP = 0x02
GGP = 0x03
IP_in_IP = 0x04
ST = 0x05
TCP = 0x06
CBT = 0x07
EGP = 0x08
IGP = 0x09
BBN_RCC_MON = 0x0A
NVP_II = 0x0B
PUP = 0x0C
ARGUS = 0x0D
EMCON = 0x0E
XNET = 0x0F
CHAOS = 0x10
UDP = 0x11
SWITCH_INSTANCE = 0x????????????????
MUX = 0x12
DCN_MEAS = 0x13
HMP = 0x14
PRM = 0x15
XNS_IDP = 0x16
TRUNK_1 = 0x17
TRUNK_2 = 0x18
LEAF_1 = 0x19
LEAF_2 = 0x1A
RDP = 0x1B
IRTP = 0x1C
ISO_TP4 = 0x1D
NETBLT = 0x1E
MFE_NSP = 0x1F
MERIT_INP = 0x20
DCCP = 0x21
_3PC = 0x22
IDPR = 0x23
XTP = 0x24
DDP = 0x25
IDPR_CMTP = 0x26
TPPP = 0x27
IL = 0x28
IPv6_Encap = 0x29
SDRP = 0x2A
IPv6_Route = 0x2B
IPv6_Frag = 0x2C
IDRP = 0x2D
RSVP = 0x2E
GRE = 0x2F
MHRP = 0x30
BNA = 0x31
ESP = 0x32
AH = 0x33
I_NLSP = 0x34
SWIPE = 0x35
NARP = 0x36
MOBILE = 0x37
TLSP = 0x38
SKIP = 0x39
IPv6_ICMP = 0x3A
IPv6_NoNxt = 0x3B
IPv6_Opts = 0x3C
Any_Host_Internal_Protocol = 0x3D # no keyword
CFTP = 0x3E
Any_Local_Network = 0x3F # no keyword
SAT_EXPAK = 0x40
KRYPTOLAN = 0x41
RVD = 0x42
IPPC = 0x43
Any_Distributed_File_System = 0x44 # no keyword
SAT_MON = 0x45
VISA = 0x46
IPCU = 0x47
CPNX = 0x48
CPHB = 0x49
WSN = 0x4A
PVP = 0x4B
BR_SAT_MON = 0x4C
SUN_ND = 0x4D
WB_MON = 0x4E
WB_EXPAK = 0x4F
ISO_IP = 0x50
VMTP = 0x51
SECURE_VMTP = 0x52
VINES = 0x53
TTP = 0x54
IPTM = 0x54
NSFNET_IGP = 0x55
DGP = 0x56
TCF = 0x57
EIGRP = 0x58
OSPF = 0x59
Sprite_RPC = 0x5A
LARP = 0x5B
MTP = 0x5C
AX_25 = 0x5D
IPIP = 0x5E
MICP = 0x5F
SCC_SP = 0x60
ETHERIP = 0x61
ENCAP = 0x62
Any_Private_Encryption_Scheme = 0x63 # no keyword
GMTP = 0x64
IFMP = 0x65
PNNI = 0x66
PIM = 0x67
ARIS = 0x68
SCPS = 0x69
QNX = 0x6A
A_N = 0x6B
IPComp = 0x6C
SNP = 0x6D
Compaq_Peer = 0x6E
IPX_in_IP = 0x6F
VRRP = 0x70
PGM = 0x71
Any_0_Hop_Protocol = 0x72 # no keyword
L2TP = 0x73
DDX = 0x74
IATP = 0x75
STP = 0x76
SRP = 0x77
UTI = 0x78
SMP = 0x79
SM = 0x7A
PTP = 0x7B
IS_IS_Over_IPv4 = 0x7C
FIRE = 0x7D
CRTP = 0x7E
CRUDP = 0x7F
SSCOPMCE = 0x80
IPLT = 0x81
SPS = 0x82
PIPE = 0x83
SCTP = 0x84
FC = 0x85
RSVP_E2E_IGNORE = 0x86
Mobility_Header = 0x87
UDPLite = 0x88
MPLS_in_IP = 0x89
manet = 0x8A
HIP = 0x8B
Shim6 = 0x8C
WESP = 0x8D
ROHC = 0x8E
Use_For_Experimentation_And_Testing_0xFD = 0xFD # no keyword
Use_For_Experimentation_And_Testing_0xFE = 0xFE # no keyword
Reserved = 0xFF # no keyword
CUSTOM = 0x??
ARP = 0x0806
Wake_on_LAN = 0x0842
Audio_Video_Transport_Protocol_as_defined_in_IEEE_Std_1722_2011 = 0x22F0
IETF_TRILL_Protocol = 0x22F3
DECnet_Phase_IV = 0x6003
Reverse_Address_Resolution_Protocol = 0x8035
AppleTalk_Ethertalk = 0x809B
AppleTalk_Address_Resolution_Protocol_AARP = 0x80F3
VLAN_tagged_frame_IEEE_802_1Q_Shortest_Path_Bridging_IEEE_802_1aq = 0x8100
IPX_1 = 0x8137
IPX_2 = 0x8138
QNX_Qnet = 0x8204
IPv6 = 0x86DD
HOPOPT = 0x00
ICMP = 0x01
IGMP = 0x02
GGP = 0x03
IP_in_IP = 0x04
ST = 0x05
TCP = 0x06
CBT = 0x07
EGP = 0x08
IGP = 0x09
BBN_RCC_MON = 0x0A
NVP_II = 0x0B
PUP = 0x0C
ARGUS = 0x0D
EMCON = 0x0E
XNET = 0x0F
CHAOS = 0x10
UDP = 0x11
MUX = 0x12
DCN_MEAS = 0x13
HMP = 0x14
PRM = 0x15
XNS_IDP = 0x16
TRUNK_1 = 0x17
TRUNK_2 = 0x18
LEAF_1 = 0x19
LEAF_2 = 0x1A
RDP = 0x1B
IRTP = 0x1C
ISO_TP4 = 0x1D
NETBLT = 0x1E
MFE_NSP = 0x1F
MERIT_INP = 0x20
DCCP = 0x21
_3PC = 0x22
IDPR = 0x23
XTP = 0x24
DDP = 0x25
IDPR_CMTP = 0x26
TPPP = 0x27
IL = 0x28
IPv6_Encap = 0x29
SDRP = 0x2A
IPv6_Route = 0x2B
IPv6_Frag = 0x2C
IDRP = 0x2D
RSVP = 0x2E
GRE = 0x2F
MHRP = 0x30
BNA = 0x31
ESP = 0x32
AH = 0x33
I_NLSP = 0x34
SWIPE = 0x35
NARP = 0x36
MOBILE = 0x37
TLSP = 0x38
SKIP = 0x39
IPv6_ICMP = 0x3A
IPv6_NoNxt = 0x3B
IPv6_Opts = 0x3C
Any_Host_Internal_Protocol = 0x3D # no keyword
CFTP = 0x3E
Any_Local_Network = 0x3F # no keyword
SAT_EXPAK = 0x40
KRYPTOLAN = 0x41
RVD = 0x42
IPPC = 0x43
Any_Distributed_File_System = 0x44 # no keyword
SAT_MON = 0x45
VISA = 0x46
IPCU = 0x47
CPNX = 0x48
CPHB = 0x49
WSN = 0x4A
PVP = 0x4B
BR_SAT_MON = 0x4C
SUN_ND = 0x4D
WB_MON = 0x4E
WB_EXPAK = 0x4F
ISO_IP = 0x50
VMTP = 0x51
SECURE_VMTP = 0x52
VINES = 0x53
TTP = 0x54
IPTM = 0x54
NSFNET_IGP = 0x55
DGP = 0x56
TCF = 0x57
EIGRP = 0x58
OSPF = 0x59
Sprite_RPC = 0x5A
LARP = 0x5B
MTP = 0x5C
AX_25 = 0x5D
IPIP = 0x5E
MICP = 0x5F
SCC_SP = 0x60
ETHERIP = 0x61
ENCAP = 0x62
Any_Private_Encryption_Scheme = 0x63 # no keyword
GMTP = 0x64
IFMP = 0x65
PNNI = 0x66
PIM = 0x67
ARIS = 0x68
SCPS = 0x69
QNX = 0x6A
A_N = 0x6B
IPComp = 0x6C
SNP = 0x6D
Compaq_Peer = 0x6E
IPX_in_IP = 0x6F
VRRP = 0x70
PGM = 0x71
Any_0_Hop_Protocol = 0x72 # no keyword
L2TP = 0x73
DDX = 0x74
IATP = 0x75
STP = 0x76
SRP = 0x77
UTI = 0x78
SMP = 0x79
SM = 0x7A
PTP = 0x7B
IS_IS_Over_IPv4 = 0x7C
FIRE = 0x7D
CRTP = 0x7E
CRUDP = 0x7F
SSCOPMCE = 0x80
IPLT = 0x81
SPS = 0x82
PIPE = 0x83
SCTP = 0x84
FC = 0x85
RSVP_E2E_IGNORE = 0x86
Mobility_Header = 0x87
UDPLite = 0x88
MPLS_in_IP = 0x89
manet = 0x8A
HIP = 0x8B
Shim6 = 0x8C
WESP = 0x8D
ROHC = 0x8E
Use_For_Experimentation_And_Testing_0xFD = 0xFD # no keyword
Use_For_Experimentation_And_Testing_0xFE = 0xFE # no keyword
Reserved = 0xFF # no keyword
CUSTOM = 0x??
Ethernet_flow_control = 0x8808
Slow_Protocols_IEEE_802_3 = 0x8809
CobraNet = 0x8819
MPLS_unicast = 0x8847
MPLS_multicast = 0x8848
PPPoE_Discovery_Stage = 0x8863
PPPoE_Session_Stage = 0x8864
Jumbo_Frames = 0x8870
HomePlug_1_0_MME = 0x887B
EAP_over_LAN_IEEE_802_1X = 0x888E
PROFINET_Protocol = 0x8892
HyperSCSI_SCSI_over_Ethernet = 0x889A
ATA_over_Ethernet = 0x88A2
EtherCAT_Protocol = 0x88A4
Provider_Bridging_IEEE_802_1ad_Shortest_Path_Bridging_IEEE_802_laq = 0x88A8
Ethernet_Powerlink = 0x88AB
LLDP = 0x88CC
SERCOS_III = 0x88CD
HomePlug_AV_MME = 0x88E1
Media_Redundancy_Protocol_IEC62439_2 = 0x88E3
MAC_security_IEEE_802_1AE = 0x88E5
PTP_over_Ethernet_IEEE_1588 = 0x88F7
IEEE_802_1ag_Connectivity_Fault_Management_CFM_Protocol_ITU_T_Recommendation_Y_1731_OAM = 0x8902
FCoE = 0x8906
FCoE_Initialization_Protocol = 0x8914
RoCE = 0x8915
HSR = 0x892F
Ethernet_Configuration_Testing_Protocol = 0x9000
LLT = 0xCAFE
CUSTOM_PROTOCOL = 0x????
FLOW_REMOVED = 0x0B
PORT_STATUS = 0x0C
PACKET_OUT = 0x0D
FLOW_MOD = 0x0E
OF_1_0_PORT_MOD_OF_1_3_GROUP_MOD = 0x0F
OF_1_0_STATS_REQUEST_OF_1_3_PORT_MOD = 0x10
OF_1_0_STATS_REPLY_OF_1_3_TABLE_MOD = 0x11
OF_1_0_BARRIER_REQUEST_OF_1_3_MULTIPART_REQUEST = 0x12
OF_1_0_BARRIER_REPLY_OF_1_3_MULTIPART_REPLY = 0x13
OF_1_0_QUEUE_GET_CONFIG_REQUEST_OF_1_3_BARRIER_REQUEST = 0x14
OF_1_0_QUEUE_GET_CONFIG_REPLY_OF_1_3_BARRIER_REPLY = 0x15
OF_1_3_QUEUE_GET_CONFIG_REQUEST = 0x16
OF_1_3_QUEUE_GET_CONFIG_REPLY = 0x17
ROLE_RQUEST = 0x18
ROLE_REPLY = 0x19
GET_ASYNC_REQUEST = 0x1A
GET_ASYNC_REPLY = 0x1B
SET_ASYNC = 0x1C
METER_MOD = 0x1D
CUSTOM_OPENFLOWTYPE = 0x??
REQUEST = 0x03
SWITCH_ADAPTER = 0x0000
OPENFLOW = 0x00
HANDLE_OPENFLOW_MESSAGE = 0x00
REPLY = 0x04
SWITCH_ADAPTER = 0x0000
OPENFLOW = 0x00
HANDLE_OPENFLOW_MESSAGE = 0x00
In order to be able to run multiple SwitchAdapters on the same machine (using the same OpenFlow port), the executable of the SwitchAdapter has a single TCP ServerSocket and will start one actual SwitchAdapter for each incomming connection from an OpenFlow switch - if the OpenFlow Handshake succeeded. If the basic hello handshake succeeded, a feature request is sent to the switch. After a sucessful handshake and receiving of the feature reply message, a SwitchAdapter instance will be started, using a the switches ID as instanceId of the SwitchAdapter module - which allows other modules to publish to this SwitchAdapter instance.
- A SwitchAdapter will respond to ECHO_REQUESTs of the Switch, and thus avoid a connection timeout.
- A SwitchAdapters will termintate itself, when the connection to the switch ends(EOF).