OpenDaylight and Floodlight controllers
Concise study notes comparing and explaining the OpenDaylight and Floodlight SDN controllers, their architectures, APIs, configuration and example REST commands for exam preparation.
Drafted with Aria, reviewed by the AiCanCode.org team · Updated . How we write and check our notes. Spotted an error? Use Give Feedback at the bottom of the page.
Why it matters
Software-defined networking (SDN) moves control of packet forwarding out of switches and into software. Engineers use controllers such as OpenDaylight and Floodlight to program network behaviour, implement policies, and automate data-centre and campus networks.
Key ideas
Northbound API — API offered by the controller to applications (e.g., REST, Java APIs). Define: "Interface from controller to management/orchestration apps." Draw: box labelled Controller with arrow up to App labeled 'Northbound: REST/Java/Policy API'.
Southbound API — API used by controller to manage network devices (examples: OpenFlow, NETCONF). Define: "Interface used by controller to install forwarding rules, read counters, and manage devices." List common southbound protocols and their roles.
OpenFlow — protocol to program flow tables in switches. Exact statement: "OpenFlow defines messages for flow table modification, packet-in/packet-out, and statistics. A flow entry matches packet fields and defines actions." Assumption: switch implements OpenFlow pipeline matching fields.
OpenDaylight (ODL) — an open-source, modular, vendor-neutral SDN controller platform managed by the Linux Foundation (originally by OpenDaylight project). Exact: "ODL is a model-driven, modular controller using a middleware called MD-SAL and supports many southbound and northbound plugins." Key parts: MD-SAL, YANG models, RESTCONF, NETCONF plugin, OpenFlow plugin, Karaf (container).
Floodlight — an open-source Java-based OpenFlow controller (lightweight, monolithic compared to ODL). Define: "Floodlight is a simple, modular Java controller primarily focused on OpenFlow-based forwarding and rapid prototyping of apps." Key parts: module system, REST API for flow programming, smaller codebase and simpler deployment than ODL.
MD-SAL (Model-Driven Service Abstraction Layer) — ODL core that stores network state and provides RPC/data stores. Exact definition: "MD-SAL is a middleware that enforces YANG models and provides a consistent data tree for operational and configuration state." Assumption: applications interact through MD-SAL rather than directly invoking device plugins.
YANG — a data modelling language for configuration and state data. Define: "YANG models structure and type-check data exchanged (used with NETCONF/RESTCONF)."
NETCONF / RESTCONF — management protocols: NETCONF uses XML over SSH; RESTCONF is a REST-like protocol using HTTP and YANG models. State when each applies: NETCONF for transactional config, RESTCONF when HTTP/JSON is preferred.
Karaf and OSGi — ODL runs on Apache Karaf (an OSGi runtime). Define: "OSGi is a modular system for Java; Karaf runs bundles (modules) and provides hot-deploy, features and shell commands."
Controller deployment models (exact statements used in answers): a) Single instance assumes small testbed; b) Clustered controller provides fault tolerance and scale; c) Distributed control plane where controller state is replicated using MD-SAL or other replication. Assumption: network latencies and CAP trade-offs matter — controllers prioritise availability or consistency depending on design.
Performance trade-offs: controllers add processing (latency) when flows are installed reactively. Definition exam-style: "Proactive flow installation reduces per-packet latency but increases control-plane configuration effort; reactive flow installation reduces initial configuration but incurs packet-in latency."
Typical flows of control: packet-in → controller computes action → controller issues flow-mod → switch installs flow → data plane forwards. Draw: sequence diagram with time axis: switch sends packet-in to controller; controller responds with flow-mod and packet-out.
Formulas (syntax to remember)
curl -X GET http://<controller>:8080/wm/core/controller/switches/json — Floodlight list switches REST call (replace port/URI if customized).
curl -X POST -H "Content-Type: application/json" -d '{"switch":"00:00:00:00:00:01", "name":"fwd", "priority":"32768", "in_port":"1", "actions":"output=2"}' http://<floodlight>:8080/wm/staticflowpusher/json — Floodlight static flow pusher example.
curl -X PUT -H "Content-Type: application/yang.data+json" -d @flow.json http://<odl>:8181/restconf/config/opendaylight-inventory:nodes/node/openflow:1/table/0/flow/1 — OpenDaylight RESTCONF flow install (MD-SAL / inventory path pattern).
bundle:list — Karaf command to list bundles (ODL runtime).
feature:install <feature-name> — Karaf feature install command for ODL bundles.
bundle:restart <bundle-id> — Karaf command to restart a bundle (ODL runtime).
Notes: controller ports and URIs vary by version; verify correct REST paths for the exact ODL or Floodlight version used.
Worked examples
Example 1 — Floodlight: install a simple L2 forwarding flow using Static Flow Pusher Problem: Host behind switch port 1 should be forwarded to port 2 on switch DPID 00:00:00:00:00:01. Steps:
- Compose JSON for Static Flow Pusher: { "switch": "00:00:00:00:00:01", "name": "fwd1", "priority": "32768", "in_port": "1", "actions": "output=2" }
- Command (replace controller IP):
curl -X POST -H "Content-Type: application/json" -d @flow.json http://192.168.1.10:8080/wm/staticflowpusher/json - Verify:
curl http://192.168.1.10:8080/wm/staticflowpusher/list/00:00:00:00:00:01/jsonorcurl http://192.168.1.10:8080/wm/core/switch/00:00:00:00:00:01/flow/jsonand check that the flow is present. Result: switch installs a flow that matches packets on in_port 1 and outputs to port 2. This is proactive configuration (no packet-in required).
Example 2 — OpenDaylight: push an OpenFlow flow via RESTCONF (MD-SAL inventory path) Problem: Add a flow on node openflow:1 table 0, id 10, to forward packets from in-port 3 to port 4. Steps:
- Create JSON following ODL flow RESTCONF model (minimal example) and save as flow.json. Example keys: id, table_id, priority, match (in-port), instructions (apply-actions -> output-action).
- Command (use basic auth admin/admin by default unless changed):
curl -u admin:admin -X PUT -H "Content-Type: application/yang.data+json" -d @flow.json http://127.0.0.1:8181/restconf/config/opendaylight-inventory:nodes/node/openflow:1/table/0/flow/10 - Verify: GET the same URL and check flow present; observe packet path in switch. Notes: JSON structure is strict to YANG model. If RESTCONF path doesn't exist on your ODL distro/version, the URL changes — verify.
Example 3 — Exam model answer: Compare OpenDaylight and Floodlight (short-note style)
- Architecture: ODL is modular, model-driven (MD-SAL, YANG), runs on Karaf/OSGi; Floodlight is simpler Java-based modular controller without MD-SAL.
- Extensibility: ODL has large ecosystem, many southbound plugins (NETCONF, BGP, PCEP) and northbound models; Floodlight focuses on OpenFlow apps and is easier to extend for quick labs.
- Deployment: ODL supports clustering and enterprise features; Floodlight is lightweight and better for teaching, quick prototyping.
- Use-case: choose Floodlight for labs and simple OpenFlow networks; choose ODL for multi-protocol data-centre orchestration.
Common mistakes
- Forgetting authentication (ODL often requires admin/admin by default) or forgetting to enable modules/bundles in Karaf.
- Assuming Floodlight supports YANG/NETCONF out-of-the-box — it primarily supports OpenFlow and its own REST APIs.
- Not specifying table id or flow priority in flow-mods; default behaviour may drop packets.
- Mixing OpenFlow versions: flow match fields differ between OF1.0, OF1.3 etc. Always state the OpenFlow version.
For your exam
Types of questions you will see:
- Definitions: "Define SDN controller, northbound/southbound APIs, MD-SAL, YANG." Include concise definitions and examples.
- Short notes: "Describe OpenDaylight architecture" or "Explain Floodlight features." Include diagrams: controller box, modules, southbound plugins, northbound REST.
- Derivations/Reasoning: "Why use a model-driven controller?" — show benefits: consistency, validation, protocol independence.
- Practical tasks: "Write a REST command to add a flow to Floodlight/ODL" — give exact curl example with method, URL and JSON.
- Diagram questions: draw sequence diagram for reactive flow installation and label packet-in, flow-mod, packet-out.
- Comparison/Design: "Which controller for a data centre and why?" — discuss scale, clustering, available plugins. Full-marks answers include: clear definitions, correct diagram labels, exact REST syntax or pseudo-code, mention of versions and assumptions (e.g., OpenFlow version, controller port), and trade-offs.
Quick check
- What is MD-SAL in OpenDaylight?
- Which protocol does Floodlight mainly implement for southbound control?
- Is RESTCONF based on HTTP or SSH? Answers: MD-SAL is the Model-Driven Service Abstraction Layer in ODL; Floodlight mainly implements OpenFlow; RESTCONF is based on HTTP.
Finished this topic? Mark it so your progress, study plan and readiness keep up.
Stuck on something here?