|Stable| |Tag| |License| |Build| |Coverage| |Quality|
.. raw:: html
kytos/flow_manager
This NApp supports a subset of the OpenFlow specification fields in the bodies of the requests when creating and removing flows:
Flow attributes:
priority: Priority of the flow entry when matching packets;
idle_timeout: Time before the flow expires when no packet is matched;
hard_timeout: Time before the flow expires, not related to matching;
cookie: Flow cookie;
match:
in_port: Port where the packet came from;
dl_src: Ethernet frame source MAC address;
dl_dst: Ethernet frame destination MAC address;
dl_type: EtherType of the upper layer protocol;
dl_vlan: 802.1q VLAN ID;
dl_vlan_pcp: 802.1q VLAN PCP;
nw_src: IPv4 source address of the packet;
nw_dst: IPv4 destination address of the packet;
nw_proto: Upper layer protocol number;
actions:
push_vlan: Add a new VLAN tag to the packet. The type is tag_type ('s' for service, 'c' for client);
set_vlan: Change the VLAN ID of the packet to vlan_id;
pop_vlan: Remove the outermost VLAN tag of the packet.
output: Send the packet through port port.
.. note::
For the Output Action port you may use any port number or the string
"controller". The string will be interpreted and converted to the correct
controller port number for the datapath protocol version.
.. note::
For OpenFlow 1.3, the only Instruction supported is InstructionApplyAction.
Other fields are not supported and will generate error messages from the NApp.
This NApp provides a consistency mechanism for all managed flows. All expected flows are stored in MongoDB and checked when kytos/of_core.flow_stats.received
event is received comparing the installed flows with the stored flows. If flows are missing they will eventually be installed. Similarly, if unexpected flows are installed (alien), they will eventually be removed, unless they are intentionally configured to be ignored. By default, the consistency mechanism is enabled on settings.py
ENABLE_CONSISTENCY_CHECK = True
, running every STATS_INTERVAL
(60 seconds). This interval can be adapted as needed on kytos/of_core settings.py file <https://github.com/kytos-ng/of_core/blob/master/settings.py>
_. Depending on your topology size you might want to set a higher interval.
To install this NApp, first, make sure to have the same venv activated as you have kytos
installed on:
.. code:: shell
$ git clone https://github.com/kytos-ng/flow_manager.git $ cd flow_manager $ python3 -m pip install --editable .
To install the kytos environment, please follow our
development environment setup <https://github.com/kytos-ng/documentation/blob/master/tutorials/napps/development_environment_setup.rst>
_.
kytos/of_core <https://github.com/kytos-ng/of_core>
_MongoDB <https://github.com/kytos-ng/kytos#how-to-use-with-mongodb>
_kytos/of_core.handshake.completed
kytos.flow_manager.flows.(install|delete)
kytos.flow_manager.flows.single.(install|delete)
kytos/of_core.flow_stats.received
kytos/of_core.v0x04.messages.in.ofpt_flow_removed
kytos/of_core.v0x04.messages.in.ofpt_barrier_reply
kytos/core.openflow.connection.error
.*.of_core.*.ofpt_error
kytos/flow_manager.messages.out.ofpt_barrier_request
*buffer*: ``app``
Event reporting that a Barrier Request was sent to a switch.
Content:
.. code-block:: python3
{
'datapath': <Switch object>
'flow': <Object representing the barrier request>
}
kytos/flow_manager.messages.out.ofpt_flow_mod
buffer: app
Event reporting that a FlowMod was sent to a switch.
Content:
.. code-block:: python3
{
'datapath':
kytos/flow_manager.flow.pending
*buffer*: ``app``
Event reporting that a FlowMod was sent to a Datapath.
Content:
.. code-block:: python3
{
'datapath': <Switch object>,
'flow': <Object representing the flow>
}
kytos/flow_manager.flow.added
buffer: app
Event reporting that an installed Flow was confirmed via Barrier Reply.
Content:
.. code-block:: python3
{
'datapath':
kytos/flow_manager.flow.removed
*buffer*: ``app``
Event reporting that a removed Flow was confirmed via ``OFPT_FLOW_REMOVED``
Content:
.. code-block:: python3
{
'datapath': <Switch object>,
'flow': <Object representing the removed flow>
}
kytos/flow_manager.flow.error
buffer: app
Event reporting that either an OFPT_ERROR error happened or an asynchronous core OpenFlow socket error happened. Clients that send FlowMods via flow_manager
should handle these accordingly. If error_exception
isn't set, then it's a OFPT_ERROR, otherwise, it's a socket exception.
Content:
.. code-block:: python3
{
'datapath':
.. TAGs
.. |Stable| image:: https://img.shields.io/badge/stability-stable-green.svg :target: https://github.com/kytos-ng/flow_manager .. |License| image:: https://img.shields.io/github/license/kytos-ng/kytos.svg :target: https://github.com/kytos-ng/flow_manager/blob/master/LICENSE .. |Build| image:: https://scrutinizer-ci.com/g/kytos-ng/flow_manager/badges/build.png?b=master :alt: Build status :target: https://scrutinizer-ci.com/g/kytos-ng/flow_manager/?branch=master .. |Coverage| image:: https://scrutinizer-ci.com/g/kytos-ng/flow_manager/badges/coverage.png?b=master :alt: Code coverage :target: https://scrutinizer-ci.com/g/kytos-ng/flow_manager/?branch=master .. |Quality| image:: https://scrutinizer-ci.com/g/kytos-ng/flow_manager/badges/quality-score.png?b=master :alt: Code-quality score :target: https://scrutinizer-ci.com/g/kytos-ng/flow_manager/?branch=master .. |Tag| image:: https://img.shields.io/github/tag/kytos-ng/flow_manager.svg :target: https://github.com/kytos-ng/flow_manager/tags