{"id":21667,"library":"os-ken","title":"os-ken","description":"A component-based software defined networking framework for OpenStack, currently at version 4.1.1. It is actively maintained with a focus on SDN controller development.","status":"active","version":"4.1.1","language":"python","source_language":"en","source_url":"https://github.com/openstack/os-ken","tags":["SDN","OpenFlow","OpenStack","networking","controller"],"install":[{"cmd":"pip install os-ken","lang":"bash","label":"Install from PyPI"}],"dependencies":[],"imports":[{"note":"os-ken is a fork of Ryu; all imports use os_ken prefix.","wrong":"from ryu.base.app_manager import OFPHandler","symbol":"OFPHandler","correct":"from os_ken.base.app_manager import OFPHandler"},{"note":"Common mistake due to Ryu legacy.","wrong":"from ryu.cmd.manager import Controller","symbol":"Controller","correct":"from os_ken.cmd.manager import Controller"},{"note":"Module path changed from ryu to os_ken.","wrong":"from ryu.ofproto.ofproto_v1_3 import OFPFlowMod","symbol":"add_flow","correct":"from os_ken.ofproto.ofproto_v1_3 import OFPFlowMod"},{"note":"Base app class renamed; use OSKenApp instead.","wrong":"from ryu.base.app_manager import RyuApp","symbol":"NetworkApp","correct":"from os_ken.base.app_manager import OSKenApp"}],"quickstart":{"code":"from os_ken.base.app_manager import OSKenApp\nfrom os_ken.controller.handler import set_ev_cls\nfrom os_ken.ofproto.ofproto_v1_3 import OFPFlowMod\n\nclass SimpleSwitch(OSKenApp):\n    @set_ev_cls(OFPFlowMod)\n    def switch_features_handler(self, ev):\n        msg = ev.msg\n        print(f\"Switch {msg.datapath.id} connected\")\n\nif __name__ == '__main__':\n    from os_ken.cmd.manager import Controller\n    c = Controller()\n    c.start()","lang":"python","description":"Simple SDN controller app that prints switch ID on connection."},"warnings":[{"fix":"Use Python 3.10 or later, or pin to os-ken 3.x if older Python needed.","message":"Python 3.10+ required; os-ken 4.x drops Python 3.8/3.9 support.","severity":"breaking","affected_versions":">=4.0.0"},{"fix":"Replace 'ryu' with 'os_ken' in imports and RyuApp with OSKenApp.","message":"Renamed base app class from RyuApp to OSKenApp; all Ryu imports broken.","severity":"breaking","affected_versions":"all"},{"fix":"Always import from os_ken not ryu; check os_ken documentation for exact paths.","message":"os-ken uses same OF-Config and OpenFlow libraries as Ryu but with different module paths.","severity":"gotcha","affected_versions":"all"},{"fix":"Check if the extension is available under os_ken; fallback to lower version if needed.","message":"Some Ryu extension modules (e.g., ryu.topology) may not be fully ported; use os_ken.topology.","severity":"deprecated","affected_versions":"<4.0.0"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Replace import ryu with import os_ken.","cause":"Code written for Ryu imported under 'ryu' instead of 'os_ken'.","error":"ModuleNotFoundError: No module named 'ryu'"},{"fix":"Use 'from os_ken.base.app_manager import OSKenApp'.","cause":"Base class renamed from RyuApp to OSKenApp.","error":"ImportError: cannot import name 'RyuApp' from 'os_ken.base.app_manager'"},{"fix":"Upgrade Python to 3.10 or later, or install os-ken 3.x with pip install os-ken==3.6.0.","cause":"os-ken 4.x requires Python 3.10+.","error":"RuntimeError: Python version <3.10 not supported"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}