kytos/of_core
is a NApp to handle all OpenFlow basic
operations. The messages covered are:
- hello messages;
- reply echo request messages;
- request stats messages;
- send a feature request after echo reply;
- update flow list of each switch;
- update features;
- handle all input messages.
Besides the operations related to the messages above and OpenFlow handshake,
this NApp emits basic OpenFlow status events. This NApp also standardizes which priority value should be set when putting OpenFlow event messages in msg_in
and msg_out
.
To install this NApp, first, make sure to have the same venv activated as you have kytos
installed on:
$ git clone https://github.com/kytos-ng/of_core.git
$ cd of_core
$ python3 -m pip install --editable .
To install the kytos environment, please follow our development environment setup.
kytos/core.openflow.raw.in
kytos/of_core.v0x04.messages.in.ofpt_features_reply
kytos/of_core.v0x04.messages.in.ofpt_echo_request
kytos/of_core.v0x04.messages.out.ofpt_echo_reply
kytos/of_core.v0x04.messages.out.ofpt_features_request
kytos/of_core.v0x[0-9a-f]{2}.messages.in.hello_failed
kytos/of_core.v0x04.messages.out.hello_failed
kytos/of_core.handshake.completed
Event reporting that a port was modified in the datapath. It is dispatched after parsing a PortStatus sent by a datapath.
It is worth to say that the PortStatus message just announces that some Port attributes were modified, but it does not state which one. The event dispatched will hold all current Port attributes. If a NApp needs to know which attribute was modified, it will need to compare the current list of attributes with the previous one.
Content:
{
'interface': <interface> # Instance of Interface class
}
Event reporting that a port was deleted from the datapath. It is dispatched after parsing a PortStatus sent by a datapath.
Content:
{
'interface': <interface> # Instance of Interface class
}
Event reporting that an interface was created.
Content:
{
'interface': <interface> # Instance of Interface class
}
Event reporting that interfaces were created.
It's meant to facilitate bulk updates or inserts.
Content:
{
'interfaces': [<interface>] # Instance of Interface class
}
Event reporting that OpenFlow multipart OFPMP_FLOW message has been received.
This event includes the switch with all flows, and also the assembled flows that have been just received.
Content:
{
'switch': <switch>,
'replies_flows': <list of Flow04>
}
Event reporting that OpenFlow multipart OFPMP_TABLE message has been received.
This event includes the switch with tables.
Content:
{
'switch': <switch>,
'replies_tables': <list of TableStats>
}
Event reporting that a mac address is reachable from a specific switch/port. This information is retrieved from PacketIns generated sent by the switches.
Content:
{
'switch': <switch.id>, # switch identification
'port': <port.port_no>, # port number
'reachable_mac': <reachable_mac_address> # string with mac address
}
Send Error message and emit event upon negotiation failure.
Content:
{
'source': <object> # instance of kytos.core.switch.Connection class
}
Send an EchoRequest to a datapath.
Content:
{ 'message': <object>, # instance of a python-openflow EchoRequest message
'destination': <object> # instance of kytos.core.switch.Connection class
}
Send a SetConfig message after the Openflow handshake.
Content:
{ 'message': <object>, # instance of a python-openflow SetConfig message
'destination': <object> # instance of kytos.core.switch.Connection class
}
Send a Port Description Request after the Features Reply.
This message will be a Multipart with the type OFPMP_PORT_DESC
.
Content:
{ 'message': <object>, # instance of a python-openflow MultiPart message
'destination': <object> # instance of kytos.core.switch.Connection class
}
Send back a Hello packet with the same version as the switch.
Content:
{ 'message': <object>, # instance of a python-openflow Hello message
'destination': <object> # instance of kytos.core.switch.Connection class
}
Send an Echo Reply message to data path.
Content:
{ 'message': <object>, # instance of a python-openflow EchoReply message
'destination': <object> # instance of kytos.core.switch.Connection class
}
Send Error message and emit event upon negotiation failure.
Content:
{ 'message': <object>, # instance of a python-openflow ErrorMsg message
'destination': <object> # instance of kytos.core.switch.Connection class
}
Send a feature request to the switch.
Content:
{ 'message': <object>, # instance of a python-openflow FeaturesRequest message
'destination': <object> # instance of kytos.core.switch.Connection class
}
Event with the new port stats and clean resources.
Content:
{
'switch': <switch>,
'port_stats': [<port_stats>] # list of port stats
}
Content:
{
'switch': <switch>
}