PYTHON-OPENFLOWLIBRARY(1)

πŸ“¦
version 2021.1 Β· 2 versions
, in debian trixie, ubuntu resolute, ubuntu stonking

πŸ’– python-openflowlibrary πŸ’–

okay bestie, so this is the man page for python-openflowlibrary in section 1 of the manual β€” it's literally the python-openflow library Documentation, and we're about to go through it together. no skimming, we're doing the whole thing πŸ’…


✨ NAME ✨

python-openflowlibrary β€” python-openflow library Documentation


πŸ¦‹ DESCRIPTION πŸ¦‹

[image: Experimental] [image] Openflow Tag Release License Build status Code coverage Code-quality score

python-openflow is a low level library to parse and create OpenFlow messages. if you want to read an OpenFlow packet from an open socket, or send a message to an OpenFlow switch β€” bestie, this is your best friend. no cap. the main features are:

  • high performance
  • short learning curve
  • free software license

this library is part of the Kytos project, but fr fr, feel free to use this simple and intuitive library in other projects too 🫢

ATTENTION: 🚨 python-openflow does not perform I/O operations. To communicate with a switch, you must write your own controller using this library, or use our Kytos SDN Platform.

a quick start follows so you can vibe check whether this project fits your needs. for a more detailed documentation, please check the python-openflow API Reference Manual πŸ“–


🌈 QUICK START 🌈

πŸŽ€ Installing πŸŽ€

we use python3.6. so in order to use this software, please install python3.6 into your environment beforehand, okay? don't skip that step, it's giving necessary ✨

we are doing a huge effort to make Kytos and its components available on all common distros. so, we recommend you download it from your distro repository πŸ‘‘

but if you are trying to test, develop, or just want a more recent version of our software β€” no problem! download now, the latest release (it still a beta software), from our repository:

first you need to clone the python-openflow repository:

$ git clone https://github.com/kytos/python-openflow.git

after cloning, the installation process is done by standard setuptools install procedure:

$ cd python-openflow
$ sudo python3.6 setup.py install

alternatively, if you are a developer and want to install in develop mode:

$ cd python-openflow
$ pip3.6 install -r requirements/dev.txt

πŸ’… Basic Usage Example πŸ’…

see how easy it is to create a feature request message with this library?? you can use ipython3 to get the advantages of autocompletion:

>>> from pyof.v0x01.controller2switch.features_request import FeaturesRequest
>>> request = FeaturesRequest()
>>> print(request.header.message_type)
Type.OFPT_FEATURES_REQUEST

if you need to send this message via socket, call the pack() method to get its binary representation to be sent through the network:

>>> binary_msg = request.pack()
>>> print(binary_msg)
b"\x01\x05\x00\x08\x14\xad'\x8d"
>>> # Use a controller (e.g. Kytos SDN controller) to send "binary_msg"

to parse a message, use unpack_message():

>>> from pyof.v0x01.common.utils import unpack_message
>>> binary_msg = b"\x01\x05\x00\x08\x14\xad'\x8d"
>>> msg = unpack_message(binary_msg)
>>> print(msg.header.message_type)
Type.OFPT_FEATURES_REQUEST

please, note that this library do not send or receive messages via socket. you have to create your own server to receive messages from switches. this library only helps you handle OpenFlow messages in a more pythonic way 🐍✨


πŸ‘‘ AUTHORS πŸ‘‘

for a complete list of authors, please open AUTHORS.rst file.


🫢 CONTRIBUTING 🫢

if you want to contribute to this project, please read Kytos Documentation website.


πŸ“œ LICENSE πŸ“œ

this software is under MIT-License. for more information please read LICENSE file.

here you will find examples on how to use python-openflow for both unpack raw binary openflow messages and create new openflow messages and pack them as binary data to be sent throughtout your network.


πŸ“ PACKING EXAMPLES πŸ“

⭐ TODO ⭐

write a full list of examples, with simples messages and also more complex ones


🧚 UNPACKING EXAMPLES 🧚

⭐ TODO ⭐

write unpacking examples, showing how the library behaves on simple and complex messages.

  • Beraldo Leal <beraldo AT ncc DOT unesp DOT br>
  • Artur Baruchi <abaruchi AT ncc DOT unesp DOT br>
  • Carlos Eduardo Moreira dos Santos <cadu AT ncc DOT unesp DOT br>
  • Diego Rabatone Oliveira <diraol AT ncc DOT unesp DOT br>
  • MacΓ‘rtur de Sousa Carvalho <macartur.sc AT gmail DOT com>
  • Raphael CΓ³be <rmcobe AT ncc DOT unesp DOT br>
  • AndrΓ© Tadeu <andretadeu AT ncc DOT unesp DOT br>

πŸ’œ The MIT License (MIT) πŸ’œ

Copyright (c) 2016 Kytos Team

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


🌸 AUTHOR 🌸

Kytos Project

2017, Kytos Project


and that's the whole thing, bestie, you ate it πŸ’…βœ¨ this page is from version 2019.2, dated Jan 03, 2020 β€” mwah, iconic, periodt πŸŽ€πŸ¦‹πŸ’–

πŸ“¦ where this page comes from