Skip to content
forked from kytos/of_core

Kytos Main OpenFlow Network Application (NApp)

License

Notifications You must be signed in to change notification settings

kytos-ng/of_core

 
 

Repository files navigation

Stable Tag License Build status Code coverage Code-quality score

kytos/of_core

NApp that handles core OpenFlow messages

Overview

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.

Installing

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.

Events

Listen

Subscribed

  • 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

Published

kytos/of_core.switch.interface.modified

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
}
kytos/of_core.switch.interface.deleted

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
}
kytos/of_core.switch.interface.created

Event reporting that an interface was created.

Content:

{
 'interface': <interface> # Instance of Interface class
}
kytos/of_core.switch.interfaces.created

Event reporting that interfaces were created.

It's meant to facilitate bulk updates or inserts.

Content:

{
 'interfaces': [<interface>] # Instance of Interface class
}
kytos/of_core.flow_stats.received

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>
}
kytos/of_core.table_stats.received

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>
}
kytos/of_core.reachable.mac

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
}
kytos/of_core.hello_failed

Send Error message and emit event upon negotiation failure.

Content:

{
  'source': <object> # instance of kytos.core.switch.Connection class
}
kytos/of_core.v0x04.messages.out.ofpt_echo_request

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
}
kytos/of_core.v0x04.messages.out.ofpt_set_config

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
}
kytos/of_core.v0x04.messages.out.ofpt_multipart_request

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
}
kytos/of_core.v0x04.messages.out.ofpt_hello

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
}
kytos/of_core.v0x04.messages.out.EchoReply

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
}
kytos/of_core.v0x04.messages.out.ofpt_error

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
}
kytos/of_core.v0x04.messages.out.ofpt_features_request

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
}
kytos/of_core.port_stats

Event with the new port stats and clean resources.

Content:

{
  'switch': <switch>,
  'port_stats': [<port_stats>] # list of port stats
}
kytos/of_core.handshake.completed

Content:

{
  'switch': <switch>
}

About

Kytos Main OpenFlow Network Application (NApp)

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 100.0%