networkservicemesh / api

Apache License 2.0
12 stars 21 forks source link

Spec: Select the remote mechanism #149

Closed denis-tingaikin closed 1 year ago

denis-tingaikin commented 1 year ago

Intro

Currently, we have two remote mechanisms: VXLAN (Ethernet) and Wireguard (IP).

The selection for those mechanisms is working fine because they have a diff by Payload.

What NSM should do if we will have a few IP mechanisms or a few Ethernet mechanisms?

Problems

  1. How to select a remote mech for a pair nsc/nse?
  2. How to select a remote mech for a couple of pairs nsc/nse?
  3. How to select a remote mech for a composition of nse?
  4. How to select a remote mech for a couple of compositions of nse?

Solutions

  1. Extend match metadata
  2. Your options
glazychev-art commented 1 year ago

Solution - Extend match metadata

  1. Add to registry.NetworkService.Matches.Metadata (link) a new map<string, string> filterMechanisms, where key - mechanism.Cls ("LOCAL" or "REMOTE"), value - array of allowed mechanisms (separated by ','). Allow all mechanisms if value is empty.
  2. Improve discover to store and handle information about which Endpoint corresponds to which Match.
  3. selectEndpointServer adds to context.Metadata a mechanism that can be taken from Match.Metadata.FilterMechanisms.
  4. filterMechanismsClient takes mechanism from context.Metadata and filters MechanismPreferences (alongside cls.LOCAL/REMOTE).

After that, only the desired mechanism should remain in the preferences.

glazychev-art commented 1 year ago

@edwarnicke Any thoughts?

glazychev-art commented 1 year ago

I think we can close this issue because we found another solution here - https://github.com/networkservicemesh/sdk-vpp/issues/638