From a42feab86ce480cf505f9cb43f1aed0420631ee0 Mon Sep 17 00:00:00 2001 From: Tony Tkacik Date: Mon, 9 Sep 2013 16:18:28 -0700 Subject: [PATCH] Updated models, modeling existing SAL and its functionality model-flow-base - match-types.yang - Match types categorized by protocol / layer - flow-types.yang - Base flow types / actions model-flow-service - flow-service.yang - Model of Flow Programming service model-flow-statistics - flow-statistics.yang - Flow Statistics service model-inventory - model-inventory.yang - Device inventory Change-Id: I14e9fe3c7a85e49131e102cf4c840bb1bdb0afbc Signed-off-by: Tony Tkacik --- .../sal/model/model-flow-base/pom.xml | 2 +- .../src/main/yang/flow-types.yang | 113 ++++++++++++++++++ ...ylight-flow-base.yang => match-types.yang} | 113 +++++++----------- .../src/main/yang/flow-service.yang | 81 +++++++++++++ .../main/yang/opendaylight-flow-config.yang | 21 ---- .../main/yang/opendaylight-flow-service.yang | 56 --------- .../src/main/yang/packet-processing.yang | 46 +++++++ .../src/main/yang/flow-statistics.yang | 70 +++++++++++ ...-statistics.yang => statistics-types.yang} | 42 ++----- .../src/main/yang/inventory.yang | 69 +++++++++++ .../src/main/yang/opendaylight-inventory.yang | 37 ------ 11 files changed, 433 insertions(+), 217 deletions(-) create mode 100644 opendaylight/sal/yang-prototype/sal/model/model-flow-base/src/main/yang/flow-types.yang rename opendaylight/sal/yang-prototype/sal/model/model-flow-base/src/main/yang/{opendaylight-flow-base.yang => match-types.yang} (75%) create mode 100644 opendaylight/sal/yang-prototype/sal/model/model-flow-service/src/main/yang/flow-service.yang delete mode 100644 opendaylight/sal/yang-prototype/sal/model/model-flow-service/src/main/yang/opendaylight-flow-config.yang delete mode 100644 opendaylight/sal/yang-prototype/sal/model/model-flow-service/src/main/yang/opendaylight-flow-service.yang create mode 100644 opendaylight/sal/yang-prototype/sal/model/model-flow-service/src/main/yang/packet-processing.yang create mode 100644 opendaylight/sal/yang-prototype/sal/model/model-flow-statistics/src/main/yang/flow-statistics.yang rename opendaylight/sal/yang-prototype/sal/model/model-flow-statistics/src/main/yang/{opendaylight-flow-statistics.yang => statistics-types.yang} (54%) create mode 100644 opendaylight/sal/yang-prototype/sal/model/model-inventory/src/main/yang/inventory.yang delete mode 100644 opendaylight/sal/yang-prototype/sal/model/model-inventory/src/main/yang/opendaylight-inventory.yang diff --git a/opendaylight/sal/yang-prototype/sal/model/model-flow-base/pom.xml b/opendaylight/sal/yang-prototype/sal/model/model-flow-base/pom.xml index 6eaaebada5..6c050735bb 100644 --- a/opendaylight/sal/yang-prototype/sal/model/model-flow-base/pom.xml +++ b/opendaylight/sal/yang-prototype/sal/model/model-flow-base/pom.xml @@ -14,7 +14,7 @@ 4.0.0 model-flow-base - + ${project.groupId} diff --git a/opendaylight/sal/yang-prototype/sal/model/model-flow-base/src/main/yang/flow-types.yang b/opendaylight/sal/yang-prototype/sal/model/model-flow-base/src/main/yang/flow-types.yang new file mode 100644 index 0000000000..ed92bf499a --- /dev/null +++ b/opendaylight/sal/yang-prototype/sal/model/model-flow-base/src/main/yang/flow-types.yang @@ -0,0 +1,113 @@ +module opendaylight-flow-types { + namespace "urn:opendaylight:flow:types"; + prefix flow; + + import ietf-inet-types {prefix inet;} + import opendaylight-match-types {prefix match;} + import ietf-yang-types {prefix yang;} + + + revision "2013-08-19" { + description "Initial revision of flow service"; + } + + grouping action { + choice action { + case output-action { + leaf-list output-node-connector { + type inet:uri; + } + } + + case controller-action { + leaf max-length { + type uint16 { + range "0..65294"; + } + } + } + + case set-queue-action { + leaf queue { + type string; // TODO: define queues + } + } + + case pop-mpls-action { + leaf ethernet-type { + type uint16; // TODO: define ethertype type + } + } + + case set-mpls-ttl-action { + leaf mpls-ttl { + type uint8; + } + } + + case set-nw-ttl-action { + leaf nw-ttl { + type uint8; + } + } + + case push-pbb-action { + + } + + case push-mpls-action { + + } + + case push-vlan-action { + + } + } + } + + grouping flow { + container match { + uses match:match; + } + list action { + key "order"; + leaf order { + type int32; + } + uses action; + } + } + + grouping flow-statistics { + leaf packet-count { + type yang:counter64; + } + + leaf byte-count { + type yang:counter64; + } + + container duration { + leaf second { + type yang:counter64; + } + leaf nanosecond { + type yang:counter64; + } + } + } + + grouping flow-table-statistics { + leaf active { + type yang:counter64; + } + + leaf lookup { + type yang:counter64; + } + + leaf matched { + type yang:counter64; + } + } +} \ No newline at end of file diff --git a/opendaylight/sal/yang-prototype/sal/model/model-flow-base/src/main/yang/opendaylight-flow-base.yang b/opendaylight/sal/yang-prototype/sal/model/model-flow-base/src/main/yang/match-types.yang similarity index 75% rename from opendaylight/sal/yang-prototype/sal/model/model-flow-base/src/main/yang/opendaylight-flow-base.yang rename to opendaylight/sal/yang-prototype/sal/model/model-flow-base/src/main/yang/match-types.yang index 443d82f2e4..54b46d5587 100644 --- a/opendaylight/sal/yang-prototype/sal/model/model-flow-base/src/main/yang/opendaylight-flow-base.yang +++ b/opendaylight/sal/yang-prototype/sal/model/model-flow-base/src/main/yang/match-types.yang @@ -1,37 +1,36 @@ -module opendaylight-flow-base { - namespace "urn:opendaylight:flow:base"; - prefix "flowbase"; +module opendaylight-match-types { + namespace "urn:opendaylight:model:match:types"; + prefix "match"; - import yang-ext {prefix ext;} import ietf-inet-types {prefix inet;} import ietf-yang-types {prefix yang;} - import opendaylight-inventory {prefix inv;} import opendaylight-l2-types {prefix l2t;} revision "2013-08-19" { description "Initial revision of flow service"; } + grouping "mac-address-filter" { + leaf address { + mandatory true; + type yang:mac-address; + } + leaf mask { + type binary; + } + } + /** Match Groupings **/ grouping "ethernet-match-fields" { container ethernet-source { - //description "Ethernet source address."; - //presence "Match field is active and set"; - leaf address { - mandatory true; - type yang:mac-address; - } - leaf mask { - type binary; - } + description "Ethernet source address."; + presence "Match field is active and set"; + uses mac-address-filter; } container ethernet-destination { description "Ethernet destination address."; presence "Match field is active and set"; - leaf address { - mandatory true; - type yang:mac-address; - } + uses mac-address-filter; } container ethernet-type { description "Ethernet frame type."; @@ -64,8 +63,6 @@ module opendaylight-flow-base { description "VLAN priority."; type l2t:vlan-pcp; } - - } grouping "ip-match-fields" { @@ -106,7 +103,6 @@ module opendaylight-flow-base { } } - grouping "udp-match-fields" { leaf udp-source-port { description "UDP source port."; @@ -151,7 +147,7 @@ module opendaylight-flow-base { } } - grouping "arp-match-fields" { + grouping "arp-match-fields" { leaf arp-source-transport-address { description "ARP source IPv4 address."; type inet:ipv4-prefix; @@ -164,31 +160,19 @@ module opendaylight-flow-base { container arp-source-hardware-address { description "ARP source hardware address."; presence "Match field is active and set"; - leaf address { - mandatory true; - type yang:mac-address; - } - leaf mask { - type binary; - } + uses mac-address-filter; } container arp-target-hardware-address { description "ARP target hardware address."; presence "Match field is active and set"; - leaf address { - mandatory true; - type yang:mac-address; - } - leaf mask { - type binary; - } + uses mac-address-filter; } } grouping action { choice action { case output-action { - leaf output-node-connector { + leaf-list output-node-connector { type string; } } @@ -241,48 +225,43 @@ module opendaylight-flow-base { } } - grouping flow { - leaf node { - type inv:node-id; + + grouping match { + container "ethernet-match" { + uses "ethernet-match-fields"; } - container match { - container "ethernet-match" { - uses "ethernet-match-fields"; - } - container "vlan-match" { - uses "vlan-match-fields"; - } - container "ip-match" { - uses "ip-match-fields"; - } - container "ipv4-match" { + container "vlan-match" { + uses "vlan-match-fields"; + } + container "ip-match" { + uses "ip-match-fields"; + } + + choice layer-3-match { + case "ipv4-match" { uses "ipv4-match-fields"; } - container "ipv6-match" { + case "ipv6-match" { uses "ipv6-match-fields"; } - container "udp-match" { + case "arp-match" { + uses "arp-match-fields"; + } + } + + choice layer-4-match { + case "udp-match" { uses "udp-match-fields"; } - container "tcp-match" { + case "tcp-match" { uses "tcp-match-fields"; } - container "sctp-match" { + case "sctp-match" { uses "sctp-match-fields"; } - container "icmpv4-match" { - uses "icmpv4-match-fields"; - } - container "arp-match" { - uses "arp-match-fields"; - } } - list action { - key "order"; - leaf order { - type int32; - } - uses action; + container "icmpv4-match" { + uses "icmpv4-match-fields"; } } } \ No newline at end of file diff --git a/opendaylight/sal/yang-prototype/sal/model/model-flow-service/src/main/yang/flow-service.yang b/opendaylight/sal/yang-prototype/sal/model/model-flow-service/src/main/yang/flow-service.yang new file mode 100644 index 0000000000..113cb1287d --- /dev/null +++ b/opendaylight/sal/yang-prototype/sal/model/model-flow-service/src/main/yang/flow-service.yang @@ -0,0 +1,81 @@ +module sal-flow { + namespace "urn:opendaylight:flow:service"; + prefix flow; + + import yang-ext {prefix ext;} + import opendaylight-inventory {prefix inv;} + import ietf-inet-types {prefix inet;} + import opendaylight-flow-types {prefix types;} + + + revision "2013-08-19" { + description "Initial revision of flow service"; + } + + + typedef flow-table-ref { + type instance-identifier; + } + + grouping node-flow { + leaf node { + type inv:node-ref; + } + leaf flow-table { + type flow-table-ref; + } + uses types:flow; + } + + /** Base configuration structure **/ + grouping flow-update { + container original-flow { + uses types:flow; + } + container updated-flow { + uses types:flow; + } + } + + rpc add-flow { + input { + uses node-flow; + } + } + + rpc remove-flow { + input { + uses node-flow; + } + } + + rpc update-flow { + input { + uses node-flow; + } + } + + notification flow-added { + uses node-flow; + } + + notification flow-updated { + uses node-flow; + } + + notification flow-removed { + uses node-flow; + } + + augment "/inv:nodes/inv:node" { + ext:augment-identifier "flow-capable-node"; + container flow-tables { + list table { + key "id"; + leaf "id" { + type inet:uri; + } + } + } + } +} \ No newline at end of file diff --git a/opendaylight/sal/yang-prototype/sal/model/model-flow-service/src/main/yang/opendaylight-flow-config.yang b/opendaylight/sal/yang-prototype/sal/model/model-flow-service/src/main/yang/opendaylight-flow-config.yang deleted file mode 100644 index a4ecf7311e..0000000000 --- a/opendaylight/sal/yang-prototype/sal/model/model-flow-service/src/main/yang/opendaylight-flow-config.yang +++ /dev/null @@ -1,21 +0,0 @@ -module opendaylight-flow-config { - namespace "urn:opendaylight:flow:config"; - prefix flow; - - import yang-ext {prefix ext;} - import opendaylight-inventory {prefix inv;} - import opendaylight-flow-base {prefix flowbase;} - - revision "2013-08-19" { - description "Initial revision of flow service"; - } - - /** Base configuration structure - container flows { - list flow { - uses flowbase:flow; - } - } - - **/ -} \ No newline at end of file diff --git a/opendaylight/sal/yang-prototype/sal/model/model-flow-service/src/main/yang/opendaylight-flow-service.yang b/opendaylight/sal/yang-prototype/sal/model/model-flow-service/src/main/yang/opendaylight-flow-service.yang deleted file mode 100644 index 0f01de5dbc..0000000000 --- a/opendaylight/sal/yang-prototype/sal/model/model-flow-service/src/main/yang/opendaylight-flow-service.yang +++ /dev/null @@ -1,56 +0,0 @@ -module opendaylight-flow-service { - namespace "urn:opendaylight:flow:service"; - prefix flow; - - import yang-ext {prefix ext;} - import opendaylight-inventory {prefix inv;} - import opendaylight-flow-base {prefix flowbase;} - - revision "2013-08-19" { - description "Initial revision of flow service"; - } - - /** Base configuration structure **/ - - - grouping flow-update { - container original-flow { - uses flowbase:flow; - } - container updated-flow { - uses flowbase:flow; - } - } - - rpc add-flow { - input { - uses flowbase:flow; - } - } - - rpc remove-flow { - input { - uses flowbase:flow; - } - } - - rpc update-flow { - input { - uses flow-update; - } - } - - notification flow-added { - uses flowbase:flow; - } - - notification flow-updated { - input { - uses flow-update; - } - } - - notification flow-removed { - uses flowbase:flow; - } -} \ No newline at end of file diff --git a/opendaylight/sal/yang-prototype/sal/model/model-flow-service/src/main/yang/packet-processing.yang b/opendaylight/sal/yang-prototype/sal/model/model-flow-service/src/main/yang/packet-processing.yang new file mode 100644 index 0000000000..260de5fd0c --- /dev/null +++ b/opendaylight/sal/yang-prototype/sal/model/model-flow-service/src/main/yang/packet-processing.yang @@ -0,0 +1,46 @@ +module packet-processing { + namespace "urn:opendaylight:packet:service"; + prefix flow; + + import opendaylight-inventory {prefix inv;} + import ietf-inet-types {prefix inet;} + import ietf-yang-types {prefix yang;} + import opendaylight-l2-types {prefix types;} + + revision "2013-07-09" { + description ""; + } + + grouping raw-packet { + leaf ingress { + type inv:node-connector-ref; + } + leaf payload { + type binary; + } + } + + grouping ethernet-packet { + leaf source { + type yang:mac-address; + } + + leaf destination { + type yang:mac-address; + } + } + + + notification packet-received { + uses raw-packet; + } + + rpc transmit-packet { + input { + leaf egress { + type inv:node-connector-ref; + } + uses raw-packet; + } + } +} \ No newline at end of file diff --git a/opendaylight/sal/yang-prototype/sal/model/model-flow-statistics/src/main/yang/flow-statistics.yang b/opendaylight/sal/yang-prototype/sal/model/model-flow-statistics/src/main/yang/flow-statistics.yang new file mode 100644 index 0000000000..7e00a36c0d --- /dev/null +++ b/opendaylight/sal/yang-prototype/sal/model/model-flow-statistics/src/main/yang/flow-statistics.yang @@ -0,0 +1,70 @@ +module opendaylight-flow-statistics { + namespace "urn:opendaylight:flow:statistics"; + prefix flowstat; + + import yang-ext {prefix ext;} + import opendaylight-inventory {prefix inv;} + import opendaylight-flow-types {prefix flow-types;} + import sal-flow {prefix flow;} + import opendaylight-statistics-types {prefix stat-types;} + + revision "2013-08-19" { + description "Initial revision of flow service"; + } + + rpc get-node-connector-statistics { + input { + leaf node { + ext:context-reference "node-context"; + type inv:node-ref; + } + leaf node-connector { + type inv:node-connector-ref; + } + } + output { + uses stat-types:node-connector-statistics; + } + } + + notification node-connector-statistics-updated { + uses stat-types:node-connector-statistics; + } + + rpc get-flow-statistics { + input { + leaf node { + ext:context-reference "node-context"; + type inv:node-ref; + } + uses flow-types:flow; + } + output { + uses flow-types:flow-statistics; + } + } + + notification flow-statistics-updated { + uses flow-types:flow-statistics; + } + + rpc get-flow-table-statistics { + input { + leaf node { + ext:context-reference "node-context"; + type inv:node-ref; + } + } + output { + uses flow-types:flow-table-statistics; + } + } + + notification flow-table-statistics-updated { + leaf flow-table { + type flow:flow-table-ref; + } + uses flow-types:flow-table-statistics; + } + +} \ No newline at end of file diff --git a/opendaylight/sal/yang-prototype/sal/model/model-flow-statistics/src/main/yang/opendaylight-flow-statistics.yang b/opendaylight/sal/yang-prototype/sal/model/model-flow-statistics/src/main/yang/statistics-types.yang similarity index 54% rename from opendaylight/sal/yang-prototype/sal/model/model-flow-statistics/src/main/yang/opendaylight-flow-statistics.yang rename to opendaylight/sal/yang-prototype/sal/model/model-flow-statistics/src/main/yang/statistics-types.yang index 3c1bb70e68..47c4c9369e 100644 --- a/opendaylight/sal/yang-prototype/sal/model/model-flow-statistics/src/main/yang/opendaylight-flow-statistics.yang +++ b/opendaylight/sal/yang-prototype/sal/model/model-flow-statistics/src/main/yang/statistics-types.yang @@ -1,44 +1,18 @@ -module opendaylight-flow-statistics { - namespace "urn:opendaylight:flow:statistics"; - prefix flowstat; +module opendaylight-statistics-types { + namespace "urn:opendaylight:model:statistics:types"; + prefix stat-types; - import yang-ext {prefix ext;} - import ietf-inet-types {prefix inet;} - import ietf-yang-types {prefix yang;} - import opendaylight-flow-base {prefix flow;} import opendaylight-inventory {prefix inv;} + revision "2013-08-19" { description "Initial revision of flow service"; } - /* - augment "/flow:flows/flow:flow" { - ext:augment-identifier "flow-statistics"; + - leaf packet-count { - type uint64; - } - - leaf byte-count { - type uint64; - } - - container duration { - leaf second { - type uint64; - } - leaf nanosecond { - type uint64; - } - } - } - */ - - augment "/inv:nodes/inv:node/inv:node-connector" { - ext:augment-identifier "node-connector-statistics"; - - container packets { + grouping node-connector-statistics { + container packets { leaf received { type uint64; } @@ -78,7 +52,5 @@ module opendaylight-flow-statistics { leaf collision-count { type uint64; } - } - } \ No newline at end of file diff --git a/opendaylight/sal/yang-prototype/sal/model/model-inventory/src/main/yang/inventory.yang b/opendaylight/sal/yang-prototype/sal/model/model-inventory/src/main/yang/inventory.yang new file mode 100644 index 0000000000..a114c624f3 --- /dev/null +++ b/opendaylight/sal/yang-prototype/sal/model/model-inventory/src/main/yang/inventory.yang @@ -0,0 +1,69 @@ +module opendaylight-inventory { + namespace "urn:opendaylight:inventory"; + prefix inv; + + import yang-ext {prefix ext;} + import ietf-inet-types {prefix inet;} + import ietf-yang-types {prefix yang;} + + + revision "2013-08-19" { + description "Initial revision of Inventory model"; + } + + typedef node-id { + type inet:uri; + } + + typedef node-connector-id { + type inet:uri; + } + + typedef node-ref { + type instance-identifier; + } + + typedef node-connector-ref { + type instance-identifier; + } + + identity node-context { + description "Identity used to mark node context"; + } + + identity node-connector-context { + + } + + grouping node { + leaf id { + type node-id; + } + } + + grouping node-connector { + leaf id { + type node-connector-id; + } + } + + + + + /** Base structure **/ + container nodes { + list node { + key "id"; + ext:context-instance "node-context"; + + uses node; + + list "node-connector" { + key "id"; + ext:context-instance "node-connector-context"; + + use node-connector; + } + } + } +} \ No newline at end of file diff --git a/opendaylight/sal/yang-prototype/sal/model/model-inventory/src/main/yang/opendaylight-inventory.yang b/opendaylight/sal/yang-prototype/sal/model/model-inventory/src/main/yang/opendaylight-inventory.yang deleted file mode 100644 index fa9de4afa0..0000000000 --- a/opendaylight/sal/yang-prototype/sal/model/model-inventory/src/main/yang/opendaylight-inventory.yang +++ /dev/null @@ -1,37 +0,0 @@ -module opendaylight-inventory { - namespace "urn:opendaylight:inventory"; - prefix flow; - - import yang-ext {prefix ext;} - import ietf-inet-types {prefix inet;} - import ietf-yang-types {prefix yang;} - - - revision "2013-08-19" { - description "Initial revision of Inventory model"; - } - - typedef node-id { - type inet:uri; - } - - typedef node-connector-id { - type inet:uri; - } - - /** Base structure **/ - container nodes { - list node { - key id; - leaf id { - type node-id; - } - list node-connector { - key "id"; - leaf id { - type node-connector-id; - } - } - } - } -} \ No newline at end of file -- 2.36.6