Skip to content

Sync Profile#

The Sync Profile is an integral component of SDC, enabling the accurate configuration of devices and validation of configuration payloads. SDC achieves this by synchronizing the device's running store and state store into an internal cache. The synchronization process, including the protocol and strategy used, is customizable through the TargetSyncProfile CustomResource, detailed here.

Synchronization protocols#

SDC supports the synchronization of a device's configuration and state using two protocols: gNMI and NETCONF. The TargetSyncProfile encompasses both protocol-specific and general fields.

General sync Attributes#

These attributes are common across synchronization protocols:

  • validate: If set to true, SDC validates the received updates against the device's schema.
  • workers: Determines the number of cache workers, optimizing write performance to the cache.
  • buffer: Specifies the buffer size for queuing sync updates before writing to the cache.
  • sync: A list of synchronization strategies, each defining a protocol and its specific attributes. Multiple strategies can be employed concurrently.

NETCONF Sync strategy#

For NETCONF synchronization, the netconf strategy is used with protocol: netconf. SDC periodically retrieves the current running configuration of the device using the NETCONF get-config RPC. This can be adjusted with the following attributes:

  • paths: A list of paths included as filter in the get-config RPC.
  • interval: The frequency at which get-config is executed.

Example NETCONF Sync Profile:

apiVersion: inv.sdcio.dev/v1alpha1
kind: TargetSyncProfile
metadata:
  name: netconf-getconfig
  namespace: default
spec:
  buffer: 0
  workers: 10
  validate: true
  sync:
  - name: config
    protocol: netconf
    paths:
    - /
    mode: sample
    interval: 10s

gNMI Sync strategy#

For gNMI synchronization, set the protocol to protocol: gnmi:

SDC supports various gNMI subscription modes:

  • get: Periodic get Config, interval needs to be specified.
  • onChange: Corresponds to gNMI stream mode ON_CHANGE.
  • sample: Matches gNMI stream mode SAMPLE, using interval as the sample-interval.
  • once: Equivalent to gNMI mode ONCE, where a SubscribeRequest is sent at each interval.

Other gNMI specific attributes:

  • protocol: the protocol used for syncing: options being netconf or gnmi
  • encoding: The gNMI encoding used for subscriptions. (only relevant for gNMI with options (JSON, JSON_IETF, PROTO))
  • port: The port used to access the target for syncing

Example of an get gNMI SyncProfile:

apiVersion: inv.sdcio.dev/v1alpha1
kind: TargetSyncProfile
metadata:
  name: gnmi-get
  namespace: default
spec:
  buffer: 0
  workers: 10
  validate: true
  sync:
  - name: config
    protocol: gnmi
    paths:
    - /
    mode: get
    encoding: JSON_IETF
    interval: 10s

Example of a gNMI TargetSyncProfile with both once and onChange modes:

apiVersion: inv.sdcio.dev/v1alpha1
kind: TargetSyncProfile
metadata:
  name: gnmi-onchange-and-once
  namespace: default
spec:
  buffer: 0
  workers: 10
  validate: true
  sync:
  - name: config
    protocol: gnmi
    paths:
    - /
    mode: onChange
    encoding: CONFIG
  - name: all_once
    protocol: gnmi
    paths:
    - /
    mode: once
    encoding: JSON_IETF
    interval: 5m