Proactive and reactive flows
Proactive and reactive flows describe two approaches to installing forwarding rules in SDN switches: proactive installs rules ahead of traffic, reactive installs them on demand via the controller.
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
Two short sentences: In Software-Defined Networking (SDN) the controller decides how switches forward traffic by installing flow entries. Choosing proactive or reactive flow installation affects latency, controller load, scalability and failure recovery — an engineer uses these trade-offs when designing data-centre networks, SDN controller apps, and failure-handling policies.
Key ideas
Start from first principles and define terms before use.
- Flow entry (flow rule) — a rule in a switch flow table that matches packet fields and prescribes actions (forward, drop, modify). Assumes OpenFlow-like match/action model.
- Proactive flow installation (proactive flows) — the controller programs flow entries into switches before matching packets arrive (i.e., push model). Assumes controller knows or predicts traffic patterns or configures rules per policy/(static) topology.
- Reactive flow installation (reactive flows) — the switch sends an event (typically a packet-in) to the controller when a packet does not match any existing flow; the controller computes a rule and sends a flow-mod to the switch (i.e., pull model). Assumes controller is reachable and able to respond within acceptable latency.
- Packet-in — a control message from switch to controller carrying packet header (or whole packet) and metadata about the missed match.
- Flow-mod — a control message from controller to switch to add, modify or delete flow entries.
- Packet-out — a control message from controller to switch to send a specific packet (often the buffered first packet referenced by buffer_id from the packet-in) out a given port or through the pipeline.
- Controller processing time — time the controller takes to compute policy and prepare flow-mod.
Exact statements (as exam-style definitions):
- Definition. A forwarding decision is proactive if the flow entry that will match an arriving packet is already installed in the switch before the packet arrives.
- Definition. A forwarding decision is reactive if, on first packet arrival for that flow, the switch asks the controller for instructions and installs a new flow entry based on the controller's reply.
Assumptions behind comparison:
- Network control link between switch and controller has finite latency (RTT_sc).
- Controller has finite processing throughput (R_ctrl, e.g., pkt-ins per second it can handle).
- Switch flow tables have limited capacity (N_max entries) and per-entry cost (size and TCAM resources).
Derivations universities commonly ask for (step-by-step):
Derive first-packet latency in reactive mode (absolute) and the added latency over proactive.
- Step 1: Packet arrives at switch and misses all flow entries → switch generates packet-in and sends to controller.
- Step 2: Packet travels to controller (one-way delay ≈ RTT_sc/2). Controller processes the packet (T_ctrl) and sends flow-mod back (one-way delay RTT_sc/2).
- Step 3: Switch installs flow entry (T_install) and processes the buffered packet (T_sw_proc). Some implementations forward the buffered packet immediately after installing the rule.
- Step 4: Total latency for the first packet in reactive mode = RTT_sc + T_ctrl + T_install + T_sw_proc. The added latency over proactive (which also incurs T_sw_proc) is RTT_sc + T_ctrl + T_install.
- For subsequent packets in same flow only T_sw_proc applies (no control-plane round trip).
Derive controller load from reactive flows.
- Step 1: Let λ_new be the arrival rate of new flows (unseen flows per second) across the network that require packet-in messages.
- Step 2: Controller must handle λ_new packet-ins per second. If controller capacity R_ctrl < λ_new, queueing or drops occur; hence stability requires λ_new < R_ctrl.
Derive required flow table memory for proactive installation.
- Step 1: Let N_entries be number of proactive entries installed per switch. Memory = N_entries × size_per_entry.
- Step 2: If network supports M hosts and a policy requires P entries per host, then N_entries ≈ M·P per switch (or appropriate summary entries for prefixes).
Diagrams to draw (describe exactly):
- Diagram 1 (reactive): Draw a box labelled Switch (left) and a box labelled Controller (right). Inside Switch, draw "Flow Table" and "Packet Buffer". Draw an incoming packet arrow into Switch labelled "Packet (new flow)". From Switch draw an arrow labelled "packet-in" to Controller; from Controller draw back arrow labelled "flow-mod (add rule)" to Switch. Label RTT_sc on the round trip. Also annotate times: T_ctrl at Controller, T_install at Switch, T_sw_proc for switch packet processing.
- Diagram 2 (proactive): Draw Controller and Switch; arrow from Controller to Switch labelled "pre-installed flow entries". Draw packet arrow into Switch that matches flow table and forwards immediately; annotate only T_sw_proc.
Formulas
Latency_reactive_first (absolute) = RTT_sc + T_ctrl + T_install + T_sw_proc — where RTT_sc is round-trip time between switch and controller (s), T_ctrl is controller processing time per packet-in (s), T_install is time switch takes to install a flow entry (s), T_sw_proc is switch packet processing time (s). Applies to the first packet of a reactive flow.
Latency_reactive_subsequent = T_sw_proc
Added_latency_vs_proactive (reactive first packet) = RTT_sc + T_ctrl + T_install — the extra latency of the first reactive packet compared to proactive, since both incur T_sw_proc. — subsequent packets match installed flow and experience only switch processing time (s).
Controller_load = λ_new — λ_new (packet-ins/s or flows/s) is the rate of new-flow events the controller must handle in reactive mode. Controller stability requires λ_new < R_ctrl where R_ctrl is controller processing capacity (packet-ins/s).
Flow_table_memory = N_entries × Size_entry — N_entries (dimensionless), Size_entry (bytes), gives memory in bytes (B). Use SI prefixes where needed (kB = 10^3 B) for estimates.
Required_entries_per_switch ≈ M_hosts × P_entries_per_host — when installing per-host rules proactively; dimensionless.
Worked examples
Example 1 — Reactive first-packet latency (numerical).
Given: RTT_sc = 2.0 ms, T_ctrl = 5.0 ms, T_install = 0.1 ms, T_sw_proc = 0.05 ms. Convert to seconds when needed.
Formula: Latency_reactive_first = RTT_sc + T_ctrl + T_install + T_sw_proc.
Step-by-step numeric:
- RTT_sc = 2.0 ms = 0.002 s
- T_ctrl = 5.0 ms = 0.005 s
- T_install = 0.1 ms = 0.0001 s
- T_sw_proc = 0.05 ms = 0.00005 s
- Sum = 0.002 + 0.005 + 0.0001 + 0.00005 = 0.00715 s = 7.15 ms Final answer: First-packet absolute latency (reactive) ≈ 7.15 ms; added over proactive ≈ 7.10 ms.
Example 2 — Controller overload threshold (numerical reasoning). Given: Controller processing capacity R_ctrl = 10,000 packet-ins/s (assumed), and network generates λ_new = 2,500 new flows/s. What fraction of controller capacity used and safety margin? Step-by-step:
- Fraction used = λ_new / R_ctrl = 2,500 / 10,000 = 0.25 → 25% used.
- Safety headroom = R_ctrl − λ_new = 7,500 packet-ins/s. Final answer: Controller uses 25% of capacity; headroom 7,500 packet-ins/s. (If λ_new exceeded R_ctrl, reactive approach would cause queueing/drops.)
Example 3 — Proactive flow table memory calculation.
Given: A leaf switch will have N_entries = 2,000 proactive entries; each entry size Size_entry = 120 bytes (estimate). Compute memory.
Formula: Flow_table_memory = N_entries × Size_entry.
Step-by-step:
- Memory = 2,000 × 120 B = 240,000 B = 240 kB (kB = 10^3 B). Final answer: Flow table memory ≈ 240 kB. (Note: TCAM usage or vendor-specific formats may change actual resource usage.)
Common mistakes
- Forgetting controller capacity limit: counting only average packet rates, not the new-flow (miss) rate λ_new.
- Confusing flow entry size (bytes) with TCAM cost (number of TCAM words) — vendor-specific.
- Using ms without converting to seconds in formulas when SI consistency is required in derivations.
For your exam
Kinds of questions:
- Definitions: define proactive/reactive flows and packet-in/flow-mod.
- Short notes: pros and cons, use-cases in data centres, effects on latency and scalability.
- Derivations: show stepwise formula for first-packet latency and controller stability condition λ_new < R_ctrl.
- Numericals: compute added latency given RTT and processing times; compute flow table memory or controller load.
- Diagrams: draw reactive and proactive sequence diagrams (switch, controller, packet-in, flow-mod).
What a full-marks answer includes:
- Clear definitions with bold terms, assumptions stated (link latency, controller capacity, flow-table limits), correct formula derivations, a labelled diagram as described above, and a short comparison table listing advantages/disadvantages with examples (e.g., proactive for predictable east-west data-centre flows; reactive for flexible policy onboarding). Mention practical mitigations: hybrid approaches, wildcard or aggregated entries, timeouts and idle/hard timeouts.
Quick check
- What message does a switch send to the controller when a packet does not match any flow?
- Which approach (proactive or reactive) reduces the first-packet latency?
- Write the stability condition for the controller in reactive mode using λ_new and R_ctrl. Answers: 1) Packet-in. 2) Proactive (because flow already installed, only switch processing). 3) Stability requires λ_new < R_ctrl.
Finished this topic? Mark it so your progress, study plan and readiness keep up.
Stuck on something here?