Reverse-specification of neutron-fwaas — branch stable/2026.2
- Repository: https://opendev.org/openstack/neutron-fwaas (local clone
neutron-fwaas/) — specified branch:stable/2026.2@5303a4deed1e— analysed on: 2026-10-28 - Other repositories cited:
neutron-lib:= neutron-libstable/2026.2@1ee72052251a(API definitions, exceptions);neutron:= neutronstable/2026.2@eef1a0f7ee36(API controller, error translation, OVN helpers); clients in 07. - Scope: the whole project. API (FWaaS v2), service plugin, both service drivers (OVN, the OpenKeel priority, and agent/RPC), the L3 and L2 agent extensions, the OVN DB sync plugin, FWaaS logging, errors, interactions, scenarios, plus the rewrite pack (step 8). No change history (step 7), as agreed.
| File | Content |
|---|---|
| 01-rest-api_stable-2026.2.md | 17 operations, attributes, business rules, default firewall group, lifecycles per driver |
| 02-errors_stable-2026.2.md | exception catalogue with situations, HTTP translation, unexpected 500s, asynchronous errors, logs |
| 03-interactions_stable-2026.2.md | OVN NB (Port_Group, ACL grammar), database, RabbitMQ topology and frames, callbacks, binaries |
| 04-scenarios_stable-2026.2.md | 6 sequence diagrams: OVN create, rule change, insert, agent create, L2 default group, OVN repair |
| 05-async-processing_stable-2026.2.md | RPC endpoints, agent extensions, callbacks, OVN DB sync |
| 07-rewrite-pack_stable-2026.2.md | rewrite pack: OVN ACL algorithm, client expectations, DB strategy, conformance, checklist |
[_rewrite/](_rewrite/rewrite-pack-index_stable-2026.2.md) | route table, OpenAPI, policies, config, migrated schema, 943 replayed vectors, 691 HTTP exchanges |
[_inventory/](_inventory/inventory_stable-2026.2.md) | raw inventory |
| _verification_stable-2026.2.md | reference check output |
Overview
neutron-fwaas adds Firewall-as-a-Service v2 to Neutron: firewall rules (protocol, addresses, ports, allow/deny/reject), ordered into policies, applied through firewall groups to router interface ports (L3) or VM ports (L2).
It has no process of its own. Its components are:
- a Neutron service plugin
firewall_v2(neutron_fwaas/services/firewall/fwaas_plugin_v2.py:42), which serves the API through Neutron's extension framework under/v2.0/fwaas/; - a pluggable service driver, chosen by
[service_providers]:- the OVN driver (
neutron_fwaas/services/firewall/service_drivers/ovn/firewall_l3_driver.py:31) maps each group to an OVN NorthboundPort_Groupholding the router interfaces, and each rule to a stateless ACL. It works synchronously in the API request, without agents, and supports router ports only; - the agent driver (
neutron_fwaas/services/firewall/service_drivers/agents/agents.py:162) casts the groups over RabbitMQ to extensions of the L3 agent (iptables + conntrack in router namespaces) and of the OVS agent (OpenFlow tables 64–69 for VM ports), which report the status back;
- the OVN driver (
- a sync plugin for
neutron-ovn-db-sync-util.
All state lives in six tables of the Neutron database. A per-project default firewall group is created lazily, including on GET list calls.
Architecture
flowchart LR
client[Client / OSC / SDK / Skyline] -->|HTTPS REST /v2.0/fwaas| api[neutron-server<br/>FirewallPluginV2]
api -->|SQL| db[(MariaDB<br/>firewall_*_v2)]
api -->|"OVN driver: OVSDB txn<br/>Port_Group + ACL"| nb[(OVN NB DB)]
api -->|"agent driver: AMQP cast fanout<br/>topic firewall_agent"| mq{{RabbitMQ}}
mq --> l3[neutron-l3-agent<br/>fwaas_v2 ext: iptables]
mq --> l2[neutron-openvswitch-agent<br/>fwaas_v2 ext: OVS flows]
l3 -->|"AMQP call q-firewall-plugin<br/>set_firewall_group_status"| api
l2 -->|AMQP call| api
sync[neutron-ovn-db-sync-util<br/>neutron_fwaas_nb_sync] -->|SQL read| db
sync -->|OVSDB repair| nb
api -->|notifications firewall_*.create.end| mqProcesses
| Process | Entry point | Role | Listens to / consumes |
|---|---|---|---|
| neutron-server | neutron.service_plugins: firewall_v2 (pyproject.toml:50) | API, validation, DB, OVN programming (OVN driver) or RPC casts (agent driver) | HTTP; RPC q-firewall-plugin (agent driver only, neutron_fwaas/services/firewall/service_drivers/agents/agents.py:203); callback port AFTER_UPDATE |
| neutron-l3-agent | neutron.agent.l3.extensions: fwaas_v2, fwaas_v2_log (pyproject.toml:69) | iptables chains on router interfaces, conntrack cleanup, NFLOG logging | fanout firewall_agent; router add/update hooks |
| neutron-openvswitch-agent | neutron.agent.l2.extensions: fwaas_v2 (pyproject.toml:62) | OVS flows for VM ports | fanout firewall_agent; port hooks |
| neutron-ovn-db-sync-util | neutron.ovn.db_sync: neutron_fwaas_nb_sync (pyproject.toml:83) | compare and repair Port_Groups and ACLs | operator command |
| neutron-db-manage | neutron.db.alembic_migrations: neutron-fwaas (pyproject.toml:53) | schema migrations | operator command |
| neutron-status | neutron.status.upgrade.checks: neutron_fwaas (pyproject.toml:80) | refuses a FWaaS v1 configuration | operator command |
External dependencies
| System | Protocol | Library | Configuration | Usage |
|---|---|---|---|---|
| MariaDB/MySQL | SQL | oslo.db / SQLAlchemy through Neutron | Neutron [database] connection | six FWaaS tables, standardattributes, quotas |
| OVN Northbound DB | OVSDB JSON-RPC | ovsdbapp, through the ML2/OVN mechanism driver IDL | Neutron [ovn] ovn_nb_connection | Port_Group and ACL (OVN driver) |
| RabbitMQ | AMQP 0-9-1 | oslo.messaging | Neutron transport_url | RPC with agents (agent driver), notifications |
| Linux kernel | netfilter, conntrack, NFLOG, OpenFlow | iptables, conntrack, libnetfilter_*, privsep, OVS | [fwaas], [network_log] | agent driver only |
Key figures
- REST: 17 operations on 3 resources (15 CRUD + 2 member actions), 26 policy rules, 3 quotas.
- Non-HTTP triggers: 5 RPC endpoints on the server, 3 fanout cast handlers on each agent extension (L3 and L2), 2 L3 router hooks, 2 L2 port hooks, 3 callback subscriptions, 1 sync plugin. 0 periodic tasks, 0 OVSDB event handlers.
- Exceptions: 24 FWaaS exceptions from neutron-lib (22 raised) and 13 defined in the repository.
- Tables: 6, plus the Neutron
standardattributes,tagsandportsthey reference. - Conformance data: 943 vectors replayed against the original (67 + 868 OVN ACL, 8 iptables), all passing; 691 HTTP exchanges from 135 passing API tests.
Points of attention
- OVN allow rules are stateless (
allow-stateless,neutron_fwaas/services/firewall/service_drivers/ovn/constants.py:22): return traffic needs explicit rules in the other direction, unlike the iptables driver, which accepts RELATED/ESTABLISHED. - Protocols without an OVN mapping match everything:
gre,ah,esp,vrrp… are accepted by the API, but the OVN driver writes no protocol clause (neutron_fwaas/services/firewall/service_drivers/ovn/acl.py:82). A "deny gre" rule drops all IP traffic of that version at its priority. - **OVN ignores
admin_state_up** and supports router ports only: VM ports are refused with 409, and the automatic attachment of new VM ports to the default group never runs on OVN. - GET list calls write: they create the project's default group, policies and rules if missing (
neutron_fwaas/db/firewall/v2/firewall_db_v2.py:643). So does the agent RPCget_firewall_groups_for_project. - OVN writes are not transactional with the DB: they happen inside the request (pre/post-commit hooks within the plugin transaction). An OVSDB failure rolls the DB back, but not the OVSDB transactions already committed. The only repair is the manual
neutron-ovn-db-sync-util --sync_mode repair, which does not remove stale ACLs or ports, and deletes the default group's Port_Group. - **Agent driver can stay
PENDING_*forever** if no agent answers:services_sync_neededis set butprocess_services_syncis never called. Every update then returns 409FirewallGroupInPendingState. - Misleading statuses:
FirewallPolicyConflict,FirewallRuleSharingConflictandMechanismDriverNotFoundare 404s, and the "default policy" update error says "Firewall Group". - **
standard-attr-fwaas-v2is not advertised** (extension class name mismatch, seen at run time), although the standard attributes are returned. - Priority overflow above 999 rules per policy (
2000 - positionreaches the default drops at 1001); bounded in practice by the rule quota (100). - Concurrency: the policy rule list and the default group's ports are read-modify-write without locks, so concurrent
insert_rulecalls, or concurrent VM bindings (agent driver), can lose an update [inferred]. - **
FirewallRuleConflictreveals another project's id** in its message.
Blind spots / [inferred]
- No live system: OVN behaviour is derived from the code, the OVN driver unit tests (mocked NB IDL) and replayed vectors. The OVSDB transaction sequence and the real ovsdbapp
pg_acl_addrow contents were not observed against an NB DB. Points marked [inferred] in 01–05 (transaction joining, rollback effects, concurrent losses) were reasoned from the code. - Agent path: the OVS L2 driver (1022 lines of OpenFlow programming,
neutron_fwaas/services/firewall/service_drivers/agents/drivers/linux/l2/openvswitch_firewall/firewall.py:216) and the NFLOG logging driver are summarised, not specified flow by flow. Both are irrelevant for an OVN/Kube-OVN target. - Neutron generic behaviour (pagination, sorting, field projection, filter handling, quota engine, notifications) is cited, not re-specified; see
reverse-spec-neutron/. - Clients: neutron-fwaas-dashboard is not cloned in the workspace and was not read. Heat's firewall resources target FWaaS v1.
- Dynamic validation (capturing real NB transactions and RPC frames) was not done; it needs a running environment.
Source: reverse-spec-neutron-fwaas/00-summary_stable-2026.2.md. The _rewrite/ and _inventory/ files are not published on the site.