Commit f8c5b1a8 authored by chada's avatar chada Committed by djcha
Browse files

2021-07-30 revised version of 3 YANG modules of QKD-018 with new name and its namespace

parent 27ad17ea
Loading
Loading
Loading
Loading
+572 −0
Original line number Diff line number Diff line
/* Copyright 2021 ETSI
Licensed under the BSD-3 Clause (https://forge.etsi.org/legal-matters) */

module etsi-qkd-sdn-connectivity {

  yang-version "1.1";

  namespace "urn:etsi:qkd:yang:etsi-qkd-sdn-conn"; //TBD. Replaced when assigned.

  prefix "qkdnw-conn";

  import ietf-yang-types { prefix "yang"; }
  import etsi-qkd-node-types { prefix "etsi-qkdn-types"; }
  import etsi-qkd-sdn-topology { prefix "qkdnw-tplg"; }

  organization "ETSI ISG QKD";

  contact
    "https://www.etsi.org/committee/qkd
    djcha@sk.com";

  description
    "This module contains the groupings and containers composing the software-defined QKD network
    connectivity service information models specified in ETSI GS QKD 018 V0.0.7";

  revision 2021-07-30 {
    description "This revision changes the naming of YANG module and its namespace.";
  }

  revision 2021-06-17 {
    description "This revision adds server app id and client app id.
      This revision extends the notifications based on ETSI GS QKD 015";
  }

  revision 2021-06-04 {
    description "Initial revision";
  }

  identity ACTION-RESULT {
    description "Base identity from which a specific action result is derived.";
  }
  identity SUCCESS {
    base ACTION-RESULT;
    description "Action was successful.";
  }
  identity FAIL {
    base ACTION-RESULT;
    description "Action failed.";
  }
  typedef action-result {
    type identityref {
      base ACTION-RESULT;
    }
  }

  grouping qkdn_id_ref {
    leaf qkdn_id_ref {
      type leafref {
        path "/qkdnw-tplg:qkd_network/qkdnw-tplg:sdqkd_nodes/qkdnw-tplg:qkdn/qkdnw-tplg:qkdn_id";
      }
      description "A reference to the SD-QKD node.";
    }
  }

  grouping virt_link_id_ref {
    leaf virt_link_id_ref {
      type leafref {
        path "/qkdnw-tplg:qkd_network/qkdnw-tplg:qkd_links/qkdnw-tplg:qkd_virt_links/qkdnw-tplg:virt_link/qkdnw-tplg:virt_link_id";
      }
      description "A reference to the QKD virtual link in QKD network topology.";
    }
  }

  grouping virt_link_local_qkdn_ref {
    leaf local_qkdn_id_ref {
      type leafref {
        path "/qkdnw-tplg:qkd_network/qkdnw-tplg:qkd_links/qkdnw-tplg:qkd_virt_links/qkdnw-tplg:virt_link[qkdnw-tplg:virt_link_id=current()/../virt_link_id_ref]/qkdnw-tplg:virt_link_local_qkdn/qkdnw-tplg:qkdn_id_ref";
      }
      description "A reference to the local SD-QKD node of the QKD virtual link in QKD network topology.";
    }

    leaf local_qkdi_id_ref {
      type leafref {
        path "/qkdnw-tplg:qkd_network/qkdnw-tplg:qkd_links/qkdnw-tplg:qkd_virt_links/qkdnw-tplg:virt_link[qkdnw-tplg:virt_link_id=current()/../virt_link_id_ref]/qkdnw-tplg:virt_link_local_qkdn/qkdnw-tplg:qkdi_id_ref";

      }
      description "A reference to the interface of the local SD-QKD node of the QKD virtual link in QKD network topology.";
    }
  }

  grouping virt_link_remote_qkdn_ref {
    leaf remote_qkdn_id_ref {
      type leafref {
        path "/qkdnw-tplg:qkd_network/qkdnw-tplg:qkd_links/qkdnw-tplg:qkd_virt_links/qkdnw-tplg:virt_link[qkdnw-tplg:virt_link_id=current()/../virt_link_id_ref]/qkdnw-tplg:virt_link_remote_qkdn/qkdnw-tplg:qkdn_id_ref";
      }
      description "A reference to the remote SD-QKD node of the QKD virtual link in QKD network topology.";
    }

    leaf remote_qkdi_id_ref {
      type leafref {
        path "/qkdnw-tplg:qkd_network/qkdnw-tplg:qkd_links/qkdnw-tplg:qkd_virt_links/qkdnw-tplg:virt_link[qkdnw-tplg:virt_link_id=current()/../virt_link_id_ref]/qkdnw-tplg:virt_link_remote_qkdn/qkdnw-tplg:qkdi_id_ref";
      }
      description "A reference to the interface of the remote SD-QKD node of the QKD virtual link in QKD network topology.";
    }

  }

  grouping qkdn_qkdi_id_ref {
    leaf qkdn_id_ref {
      type leafref {
        path "/qkdnw-tplg:qkd_network/qkdnw-tplg:sdqkd_nodes/qkdnw-tplg:qkdn/qkdnw-tplg:qkdn_id";
      }
      description "Unique ID of the SD-QKD node.";
    }

    leaf qkdi_id_ref {
      type leafref {
        path "/qkdnw-tplg:qkd_network/qkdnw-tplg:sdqkd_nodes/qkdnw-tplg:qkdn[qkdnw-tplg:qkdn_id=current()/../qkdn_id_ref]"+
          "/qkdnw-tplg:qkd_interfaces/qkdnw-tplg:qkdi/qkdnw-tplg:qkdi_id";
      }
      description "Interface ID of the interface of the SD-QKD node.";
    }
  }

  grouping virt_link_key_rate_perf {
    leaf expected_consumption {
        type uint32;
        units "bps";
        description "The bandwidth (in bits per second) of the external application that is consuming keys from QKD virtual link.";
    }
    
    leaf skr {
        type uint32;
        units "bps";
        description "Secret key generation rate (in bits per second) of QKD virtual link.";
    }

    leaf eskr {
        type uint32;
        units "bps";
        description "Effective secret key generation rate (in bits per second) of QKD virtual link after the external application’s consumption.";
    }
  }

  grouping phys_links_per_path {
    leaf-list phys_links {
      type leafref {
        path "/qkdnw-tplg:qkd_network/qkdnw-tplg:qkd_links/qkdnw-tplg:qkd_phys_links/qkdnw-tplg:phys_link/qkdnw-tplg:phys_link_id";
      }
      min-elements 1;
      ordered-by system;
      description "A sequence of QKD physical links which constitute the specific key relay path.";
    }
  }

  grouping app_id_ref {
    leaf app_id_ref {
      type leafref {
        path "/qkdnw-conn:connectivity_service/qkdnw-conn:qkd_service/qkdnw-conn:qkd_app/qkdnw-conn:app_id";
      }
      description "A reference to a pair of applications extracting keys from a QKD key association link.";
    }
  }

  grouping app_mapped_virt_link_id_ref {
    leaf app_mapped_virt_link_id_ref {
      type leafref {
        path "/qkdnw-conn:connectivity_service/qkdnw-conn:qkd_service/qkdnw-conn:qkd_app[qkdnw-conn:app_id=current()/../app_id_ref]"+
          "/qkdnw-conn:app_mapped_virt_link/qkdnw-conn:virt_link_and_qkdn_ids/qkdnw-conn:virt_link_id_ref";
      }
    }
  }

  grouping app_list {
    list qkd_app {
      key "app_id";
      description "List of external applications requesting QKD-derived keys.";

      leaf app_id {
        type yang:uuid;
        description "This value uniquely identifies a pair of applications extracting keys from a QKD key association link.";
      }
    }
  }

  grouping app_details {
    leaf app_type {
      type identityref {
        base etsi-qkdn-types:QKD-APP-TYPES;
      }
      description "Application working as client (external applications requesting keys). The identity is CLIENT.";
    }

    leaf app_priority {
      type uint32;
      default 0;
      description "Priority of the association/application. High value indicate high priority.
        This will be assigned by a network administrator.";
    }

    leaf server_app_id {
      type string;
      description "ID of the server application connecting to the local key management entity.";
    }

    leaf client_app_id {
      type string;
      description "ID of the client application connecting to the local key management entity of the peer SD-QKD node.";
    }
  }

  grouping app_status {
    leaf app_status {
      config false;
      type identityref {
        base etsi-qkdn-types:APP-STATUS-TYPES;
      }
      description "Status of the application";
    }
  }

  grouping app_service_time {
    leaf service_creation_time {
      config false;
      type yang:date-and-time;
      description "Date and time of the app(service) creation.";
    }

    leaf service_expiration_time {
      type yang:date-and-time;
      description "Date and time of the app(service) expiration.";
    }
  }

  grouping app_qos {
    container app_qos {

      leaf max_bandwidth {
        type uint32;
        description "Maximum bandwidth (bps) allowed for this specific application. Exceeding this value will
          raise an error from the local key store to the application and to SDN orchestrator via SDN controller.
          This value might be internally configured by a network administrator.";
      }

      leaf min_bandwidth {
        type uint32;
        description "This value is an optional QoS parameter indicating the minimum key rate
          that the application is expected to request (in bits per second).";
      }

      leaf jitter {
        type uint32;
        description "This value allows a maximum time jitter (in milliseconds) of keys provided by the key delivery API
          to be specified, for applications requiring fast rekeying.";
      }

      leaf ttl {
        type uint32;
        description "Time To Live (in seconds) specifies the maximum time a key can have been stored before delivery to
          an application.";
      }
    }
  }

  grouping app_statistics {
    container app_statistics {
      description "Statistical information relating to a specific statistic period of time.";

      list statistics {
        key "end_time";
        config false;

        leaf end_time {
          type yang:date-and-time;
          config false;
          description "End time for the statistics collection period.";
        }

        leaf start_time {
          type yang:date-and-time;
          config false;
          description "Start time for the statistics collection period.";
        }

        leaf consumed_bits {
          type uint32;
          config false;
          description "Consumed secret key amount (bits) for a statistics collection period of time.";
        }
      }
    }
  }

  grouping path_constraints {
    container path_constraints {
      description "Container for constraints when requesting candidate paths calculation.";

      list include_nodes {
        key "qkdn_id_ref qkdi_id_ref";
        description "List of SD-QKD nodes and their interfaces which should be included in candidate paths list
          when SDQNC calculates candidate paths list.";

        uses qkdn_qkdi_id_ref {
          refine qkdn_id_ref {
            description "Unique ID of the SD-QKD node which should be included in candidate paths list.";
          }
          refine qkdi_id_ref {
            description "Interface ID of the SD-QKD node which should be included in candidate paths list.";
          }
        }
      }

      list exclude_nodes {
        key "qkdn_id_ref qkdi_id_ref";
        description "List of SD-QKD nodes and their interfaces which should be excluded in candidate paths list
          when SDQNC calculates candidate paths list.";

        uses qkdn_qkdi_id_ref {
          refine qkdn_id_ref {
            description "Unique ID of the SD-QKD node which should be excluded in candidate paths list.";
          }
          refine qkdi_id_ref {
            description "Interface ID of the SD-QKD node which should be excluded in candidate paths list.";
          }
        }
      }
    }
  }

  grouping candidate_paths {
    container candidate_paths {
      description "Container for key relay paths per QKD virtual link.";

      leaf num_of_candidate_paths {
        type uint32;
        description "The number of candidate paths which SDQNC calculates and provides.";
      }

      list candidate_path {
        key "path_id";
        description "List of end-to-end key relay paths.
          Each path consists of QKD physical links from the local SD-QKD node to the remote SD-QKD node";

        leaf path_id {
          type uint32;
          description "Priority of the specific path among candidate paths. This value is defined by SDQNC.";
        }

        uses phys_links_per_path;
      }
    }
  }

  grouping deploy_path {
    container deploy_path {
      description "Container for a path deployed among condidate paths.";

      leaf path_id {
        type uint32;
        description "Identifier of a path deployed for QKD virtual link. This value is chosen by SDNO from the path ids
          of candidate paths list after SDNO has received candidate paths list from SDQNC";
      }

      uses phys_links_per_path;
    }
  }


  container connectivity_service {
    description "Container for external applications requesting QKD-derived keys and paths supporting QKD virtual link.";

    container qkd_service {
      description "Container for external applications requesting QKD-derived keys.";

      list qkd_app {
        key "app_id";
        description "List of external applications requesting QKD-derived keys.";

        leaf app_id {
          type yang:uuid;
          description "This value uniquely identifies a pair of applications extracting keys from a QKD key association link.";
        }

        uses app_details;
        uses app_status;
        uses app_qos;
        uses app_service_time;
        uses app_statistics;

        container app_mapped_virt_link {
          description "Container for paths per QKD virtual link for a pair of applications.";

          container virt_link_and_qkdn_ids {
            uses virt_link_id_ref;
            uses virt_link_local_qkdn_ref;
            uses virt_link_remote_qkdn_ref;
          }

          uses path_constraints;
          uses candidate_paths;
          uses deploy_path;
        }
      }
    }
  }

  rpc app-registration {
    description "Request app registration to SDQNC.";
    input {
      uses app_id_ref;
      uses app_details;
    }
    output {
      leaf response {
        type action-result;
      }
    }
  }

  rpc create-virtual-link-id-for-app {
    description "When an app requests service, SDNO or SDQNC assigns virtual link id for the app.";
    input {
      uses app_id_ref;
      container local_qkdn {
        uses qkdn_id_ref;
      }
      container remote_qkdn {
        uses qkdn_id_ref;
      }
    }
    output {
      uses virt_link_id_ref;
    }
  }

  rpc create-candidate-paths-per-virtual-link-for-app {
    description "Create candidate paths per the QKD virtual link for app.";
    input {
      uses app_id_ref;
      uses app_qos;
      uses app_mapped_virt_link_id_ref;
      uses path_constraints;
    }
    output {
      uses candidate_paths;
    }
  }

  rpc update-candidate-paths-per-virtual-link-for-app {
    description "SDNO can request this rpc repeatedly until it finally selects a path among candidate paths.";
    input {
      uses app_id_ref;
      uses app_qos;
      uses app_mapped_virt_link_id_ref;
      uses path_constraints;
    }
    output {
      uses candidate_paths;
    }
  }

  rpc deploy-a-candidate-path-per-virtual-link-for-app {
    description "Deploy a SDNO-selected path per QKD virtual link for app.";
    input {
      uses app_id_ref;
      uses app_mapped_virt_link_id_ref;
      leaf path_id {
        type uint32;
      }
    }
    output {
      leaf response {
        type action-result;
      }
      uses deploy_path;
    }
  }

  rpc delete-deployed-path-per-virtual-link-for-app {
    description "Delete the deployed path per QKD virtual link for app in order to reserve key resources.";
    input {
      uses app_id_ref;
      uses app_mapped_virt_link_id_ref;
      leaf path_id {
        type uint32;
      }
    }
    output {
      leaf response {
        type action-result;
      }
      uses app_service_time;
    }
  }

  notification sdqkdn_application_new {
    container qkd_application {
      uses app_id_ref;
      uses app_details;
      uses app_qos;
    }
  }

  notification sdqkdn_application_deployed {
    container qkd_application {
      uses app_id_ref;
      uses app_details;
      uses app_qos;
      uses app_mapped_virt_link_id_ref;
    }
  }

  notification sdqkdn_application_qos_update {
    container qkd_application {
      uses app_id_ref;
      uses app_details;
      uses app_qos;
    }
  }

  notification sdqkdn_application_disconnected {
    container qkd_application {
      uses app_id_ref;
    }
  }

  notification alarm {
    container application {
      uses app_id_ref;
      leaf status {
        type identityref {
          base "etsi-qkdn-types:APP-STATUS-TYPES";
        }
        description "Status of the app.";
      }
      leaf message {
        type string;
        description "Message of an alarm.";
      }
      leaf severity {
        type identityref {
          base "etsi-qkdn-types:SEVERITY-TYPES";
        }
        description "Severity of an alarm.";
      }
    }
  }

  notification event {
    container application {
      uses app_id_ref;
      leaf status {
        type identityref {
          base "etsi-qkdn-types:APP-STATUS-TYPES";
        }
        description "Status of the app.";
      }

      leaf message {
        type string;
        description "Message of an alarm.";
      }

      leaf severity {
        type identityref {
          base "etsi-qkdn-types:SEVERITY-TYPES";
        }
        description "Severity of an alarm.";
      }
    }
  }
}
+645 −0

File added.

Preview size limit exceeded, changes collapsed.

+246 −0
Original line number Diff line number Diff line
/* Copyright 2021 ETSI
Licensed under the BSD-3 Clause (https://forge.etsi.org/legal-matters) */

module etsi-qkd-sdn-topology {

  yang-version "1.1";

  namespace "urn:etsi:qkd:yang:etsi-qkd-sdn-tplg"; //TBD. Replaced when assigned.

  prefix "qkdnw-tplg";
  
  import ietf-yang-types { prefix "yang"; }
  import etsi-qkd-node-types { prefix "etsi-qkdn-types"; }

  organization "ETSI ISG QKD";

  contact
    "https://www.etsi.org/committee/qkd
    djcha@sk.com";

  description
    "This module contains the groupings and containers composing the software-defined QKD network 
    topology information models specified in ETSI GS QKD 018 V0.0.7";
  
  revision 2021-07-30 {
    description "This revision changes the naming of YANG module and its namespace.";
  }

  revision 2021-06-17 {
    description "This revision is in sync with inventory and connectivity YANG modules.";
  }

  revision 2021-06-04 {
    description "Initial revision";    
  }

  grouping qkdn_id_ref {
    leaf qkdn_id_ref {
      type leafref {
        path "/qkdnw-tplg:qkd_network/qkdnw-tplg:sdqkd_nodes/qkdnw-tplg:qkdn/qkdnw-tplg:qkdn_id";
      }
      description "Used to reference a SD-QKD node.";
    }
  }

  grouping qkdi_id_ref {
    leaf qkdi_id_ref {
      type leafref {
        path "/qkdnw-tplg:qkd_network/qkdnw-tplg:sdqkd_nodes/qkdnw-tplg:qkdn[qkdnw-tplg:qkdn_id=current()/../qkdn_id_ref]"+
          "/qkdnw-tplg:qkd_interfaces/qkdnw-tplg:qkdi/qkdnw-tplg:qkdi_id";
      }
      description "Used to reference an interface of the SD-QKD node. Interfaces are identified to the SD-QKD node that contains them.";
    }
  }

  grouping qkdn_qkdi_id_ref {    
    uses qkdn_id_ref;
    uses qkdi_id_ref;
  }

  grouping phys_link_id_ref {
    leaf phys_link_id_ref {
      type leafref {
        path "/qkdnw-tplg:qkd_network/qkdnw-tplg:qkd_links/qkdnw-tplg:qkd_phys_links/qkdnw-tplg:phys_link/qkdnw-tplg:phys_link_id";
      }
    }
    description "Used to reference a QKD physical link.";
  }

  grouping virt_link_id_ref {
    leaf virt_link_id_ref {
      type leafref {
        path "/qkdnw-tplg:qkd_network/qkdnw-tplg:qkd_links/qkdnw-tplg:qkd_virt_links/qkdnw-tplg:virt_link/qkdnw-tplg:virt_link_id";
      }
    }
    description "Used to reference a QKD virtual link.";    
  }

  grouping qkd_interfaces {
    container qkd_interfaces {
      description "A set of the physical QKD modules of the SD-QKD node";

      list qkdi {
        key "qkdi_id";
        description "List of the physical QKD modules of the SD-QKD node.";

        leaf qkdi_id {
          type uint32;
          description "Interface ID. A locally unique number, which is globally unique when combined with the SD-QKD node ID.";
        }
      }
    }
  }

  grouping qkdn_list {
    list qkdn {
      key "qkdn_id";
      description "List of SD-QKD nodes in QKD network";

      leaf qkdn_id {
        type yang:uuid;
        mandatory true;
        description "Uniquely identifies a SD-QKD node within the containing QKD network.";
      }
       
      uses qkd_interfaces;
    }
  }

  grouping phys_link_local_qkdn {
    container phys_link_local_qkdn {
      description "Container for the local (source) SD-QKD node of the QKD physical link.";

      uses qkdn_qkdi_id_ref {
        refine qkdn_id_ref {
          description "Uniquely identifies the local (source) SD-QKD node. Must be in the same topology.";
        }
        refine qkdi_id_ref {
          description "Interface ID of the local (source) SD-QKD node which is connected to the QKD physical link.
            This interface is located within the local SD-QKD node and terminates the QKD physical link";
        }
      }            
    }
  }

  grouping phys_link_remote_qkdn {
    container phys_link_remote_qkdn {
      description "Container for the remote (destination) SD-QKD node of the QKD physical link.";

      uses qkdn_qkdi_id_ref {
        refine qkdn_id_ref {
          description "Uniquely identifies the remote (destination) SD-QKD node. Must be in the same topology.";
        }
        refine qkdi_id_ref {
          description "Interface ID of the remote (destination) SD-QKD node which is connected to the QKD physical link.
            This interface is located within the remote SD-QKD node and terminates the QKD physical link";
        }
      } 
    }
  }

  grouping phys_link_list {
    list phys_link {
      key "phys_link_id";
      description "List of QKD physical links to directly connect SD-QKD nodes in QKD network";

      leaf phys_link_id {
        type yang:uuid;
        mandatory true;
        description "Uniquely identifies a QKD physical link within the containing QKD network.";
      }
       
      leaf link_type {
        type identityref {
          base etsi-qkdn-types:QKD-LINK-TYPES;
        }
        description "QKD physical link type is included. The identity is PHYS.";
      }

      uses phys_link_local_qkdn;
      uses phys_link_remote_qkdn;
    }
  }

  grouping virt_link_local_qkdn {
    container virt_link_local_qkdn {
      description "Container for the local (source) SD-QKD node of the QKD virtual link.";

      uses qkdn_qkdi_id_ref {
        refine qkdn_id_ref {
          description "Uniquely identifies the local (source) SD-QKD node.";
        }
        refine qkdi_id_ref {
          description "Interface ID of the local (source) SD-QKD node which is connected to the QKD virtual link.
            This interface is located within the local SD-QKD node and terminates the QKD virtual link";
        }
      }
    }
  }

  grouping virt_link_remote_qkdn { 
    container virt_link_remote_qkdn {
      description "Container holds the remote (destination) SD-QKD node of the QKD link.";

      uses qkdn_qkdi_id_ref {
        refine qkdn_id_ref {
          description "Uniquely identifies the remote (destination) SD-QKD node.";
        }
        refine qkdi_id_ref {
          description "Interface ID of the remote (destination) SD-QKD node which is connected to the QKD virtual link.
            This interface is located within the remote SD-QKD node and terminates the QKD virtual link";
        }
      }            
    }
  }

  grouping virt_link_list {
    list virt_link {
      key "virt_link_id";
      description "List of QKD virtual links (end-to-end key association links).";

      leaf virt_link_id {
        type yang:uuid;
        mandatory true;
        description "Uniquely identifies a QKD virtual link within the containing QKD network.";
      }
       
      leaf link_type {
        type identityref {
          base etsi-qkdn-types:QKD-LINK-TYPES;
        }
        description "QKD virtual link type is included. The identity is VIRT.";
      }

      uses virt_link_local_qkdn;
      uses virt_link_remote_qkdn;
    }
  }


  container qkd_network {
    description "Container for a list of software-defined QKD (SD-QKD) nodes and QKD links in QKD network.";
    
    container sdqkd_nodes {
      description "A set of SD-QKD nodes in QKD network.";

      uses qkdn_list;
     }

    container qkd_links {
      description "Container for both QKD physical links and virtual links.";

      container qkd_phys_links {
        description "A set of QKD physical links to directly connect SD-QKD nodes in QKD network";

        uses phys_link_list;
      }

      container qkd_virt_links {
        description "A set of QKD virtual links (end-to-end key association links).";

        uses virt_link_list;
      }
    }
  }
}
 No newline at end of file