This patch series introduces infrastructure and user-facing improvements
for multi-table routing in OVS. The main motivation is to enable more
advanced routing scenarios, such as policy-based routing with source
address selectors. For example, this can be used to support
OVN-Kubernetes multi-VTEP topology where nodes may have multiple SR-IOV
network adapters and to facilitate selection of which VTEP to use to
send/receive the packets to/from the wire.

The core of this series adds support for multiple routing tables within
OVS. This is a prerequisite for importing non-default routing tables
from the kernel and enables advanced routing lookups that consider
parameters beyond just the destination address (e.g., source address).

Additional routing tables are now created by reading the Routing Policy
Database (RPDB) from the kernel. Only tables referenced by RPDB rules
with a table lookup action are imported, and rule priorities and table
IDs are preserved. The current implementation supports RPDB rules with a
source address selector (`[not] from IP`).

User interface improvements:

- The `ovs-appctl ovs/route/show` command now accepts an optional
  `table=ID` or `table=all` parameter, allowing users to display routes
  from specific or all tables.

- The `ovs-appctl ovs/route/add` and `ovs/route/del` commands accept a
  `table=ID` parameter for adding or deleting user routes in non-default
  tables.

- A new `ovs-appctl ovs/route/rule/show` command is introduced to
  display the internal routing rules database, sorted by priority.

- New `ovs-appctl ovs/route/rule/{add,del}` commands are introduced to
  add and delete user-configured routing rules in OVS.

- The `ovs-appctl ovs/route/lookup` command now supports an optional
  `src=IP` parameter for lookups that match on source IP address.

Example usage:

- Show all routes, including those from non-default tables:

  ovs-appctl ovs/route/show table=all

- Add a route to a specific table:

  ovs-appctl ovs/route/add 10.7.7.0/24 br-phy0 table=10

- Add user routing rules:

  ovs-appctl ovs/route/rule/add from=all table=10

- Show routing rules:

  ovs-appctl ovs/route/rule/show

- Lookup a route with a source IP:

  ovs-appctl ovs/route/lookup 10.0.0.5 src=10.0.0.2

v1 -> v2: Changes based on Ilya's feedback:

    * Split default classifier into three: local, main and default.
    * Rules based routing is the only way now.
    * The three default rules are always present, on non-Linux systems
      too.
    * Rules list is implemented with pvector instead of rculist.
    * Added more unit tests for rules, including tunnel-push-pop test.
    * Rules related appctl commands are grouped under ovs/route/rule/*
      prefix.
    * Implemented new appctl commands for adding and deleting
      user-configured rules.
    * Updated manpage and tunneling documentation with the new commands
      and parameters.

Dima Chumak (8):
  route-table: Export is_standard_table_id().
  ovs-router: Add infrastructure for multi-table routing.
  route-table: Introduce multi-table route lookup.
  ovs-router: Add 'table=ID' parameter in ovs/route/show.
  ovs-router: Introduce ovs/router/rule/show command.
  ovs-router: Add 'table=ID' parameter in ovs/route/{add,del}.
  ovs-router: Add 'src=IP' parameter in ovs/route/lookup.
  ovs-router: Introduce ovs/router/rule/{add,del} commands.

 Documentation/howto/userspace-tunneling.rst |  17 +-
 NEWS                                        |   9 +
 lib/netdev-dummy.c                          |   6 +-
 lib/ovs-router.c                            | 816 ++++++++++++++++++--
 lib/ovs-router.h                            |  23 +-
 lib/packets.c                               |  20 +
 lib/packets.h                               |   2 +
 lib/route-table-bsd.c                       |   9 +
 lib/route-table-stub.c                      |   9 +
 lib/route-table.c                           | 231 +++++-
 lib/route-table.h                           |  19 +-
 ofproto/ofproto-tnl-unixctl.man             |  44 +-
 tests/ovs-router.at                         |  86 +++
 tests/system-route.at                       | 134 ++++
 tests/test-lib-route-table.c                |   5 +-
 tests/tunnel-push-pop.at                    | 119 +++
 16 files changed, 1442 insertions(+), 107 deletions(-)

-- 
2.50.1

_______________________________________________
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to