This serial patches try to support Router Solicitation (RS) message responder,
which will reply Router Advertisement (RA) message, for OVN.

There will be logical flows in table ls_in_rs_rsp to work as RS responder, with:
 - match: ip6.dst == ff02::2 && nd_rs
   (nd_rs: icmp6.type == 133 && icmp6.code == 0 && ttl == 255)
 - action: nd_ra{put_nd_ra(64,0,10800,0,0);
                 eth.src = 12:34:56:78:9a:bc;
                 ip6.src = fe80::f334:56ff:fe78:9abc;
                 outport = inport; flags.loopback = 1; output;};
   (nd_ra is a new action which stands for RS responder;
    put_nd_ra is a new specific inner action for nd_ra to set cur_hop_limit,
      "Managed address configuration" and "Other configuration" flags, router
      lifetime, reachable time and retrans timer in RA packet;
    put_nd_ra_opt_sll is a new specific inner action for nd_ra to append Source
      Link-layer Address Option for RA message with given ethernet address,
      such as 12:34:56:78:9a:bc;
    put_nd_ra_opt_mtu is a new specific inner action for nd_ra to append MTU
      Option for RA message with given integer value, such as 1450;
    put_nd_ra_opt_prefix is a new specific inner action for nd_ra to append
      Prefix Information Option for RA message with inner parameters. The inner
      parameters will set prefix length, on-link flag and autonomous
      address-configuration flag, valid lifetime, preferred lifetime, prefix
      in Prefix Information Option.
After a RA packet is composed, the left nested actions will make RA packet
transmitted back to the inport, where Router Solicitation (RS) packet comes.

To configure RA packet fields, such as "Managed address configuration" flag,
router_litefime, user can set Logical_Router_Port.ipv6_ra_config to do that,
  ovn-nbctl add Logical_Router_Port lrp0 ipv6_ra_config managed_address="0" \

To configure Prefix Infromation Option fields, such as valid_lifetime, user
can insert records into new table Logical_Router_RA_Prefix_Config, and let
Logical_Router_Port.ipv6_ra_prefix_configs to refer them, e.g.
  ovn-nbctl -- --id=@d1 create Logical_Router_RA_Prefix_Config \
  prefix=\"fdad:1234:5678::/64\" options="\"valid_lifetime\"="21600" \
  \"preferred_lifetime\"="21600" \"autonomous_address\"="0"" \
  -- add Logical_Router_Port lrp0 ipv6_ra_prefix_configs @d1

Most fields in a RA packet, such as "Managed address configuration" and "Other
configuration" flags, router_lifetime, valid lifetime will have default values.
But for mtu value in MTU Option, there is no valid default value. User should
configure this value for each lrouter port.

v1 -> v2:
rebase on upstream
separete ovs_nd_opt rename into a single patch
separete lflow changing for RS packet forward in ovn-northd into a single patch
update is_nd to include RS and RA type, add is_nd_neighbor to inherit previous
  is_nd behavior.

v2 -> v3:
rebase on upstream
address comments from Justin, including:
  revert changing on is_nd and is_nd_neighbor brought in version 2
  update annotations in lib/packets.h for ovs_ra_msg, ovs_nd_prefix_opt,
    ovs_nd_lla_opt, ovs_nd_mtu_opt.
  combine methods compse_nd_ra, packet_put_ra_sll_opt, packet_put_ra_mtu_opt in
    version 2 into method compse_nd_ra_with_sll_mtu_opts.
  update pinctrl_handle_nd to fit new changes on compse_nd_ra_with_sll_mtu_opts.

Zongkai LI (7):
  packets: add compose_nd_ra
  lib: rename ovs_nd_opt to ovs_nd_lla_opt
  ovn: extend expr symbols for ND
  ovn-controller: add 'nd_ra' action
  ovn-controller: add 'put_nd_ra' and 'put_nd_opt_*' actions support
  ovn-northd: add Router Advertisement packet forward flow
  ovn-northd: add IPv6 RS responder support

 include/ovn/actions.h     |  86 +++++++++++++-
 lib/flow.c                |  30 ++---
 lib/odp-execute.c         |  22 ++--
 lib/packets.c             | 146 ++++++++++++++++++-----
 lib/packets.h             |  76 ++++++++++--
 ovn/controller/pinctrl.c  | 235 +++++++++++++++++++++++++++++++++----
 ovn/lib/actions.c         | 290 +++++++++++++++++++++++++++++++++++++++++++++-
 ovn/lib/logical-fields.c  |  18 ++-
 ovn/northd/ovn-northd.c   | 166 +++++++++++++++++++++++++-
 ovn/ovn-nb.ovsschema      |  21 +++-
 ovn/ovn-nb.xml            | 103 ++++++++++++++++
 ovn/ovn-sb.xml            |  84 +++++++++++++-
 ovn/utilities/ovn-nbctl.c |   5 +
 ovn/utilities/ovn-trace.c |  23 ++--
 tests/              | 157 ++++++++++++++++++++++++-
 15 files changed, 1354 insertions(+), 108 deletions(-)


dev mailing list

Reply via email to