2 * Copyright (c) 2013 Pantheon Technologies s.r.o. and others. All rights reserved.
\r
4 * This program and the accompanying materials are made available under the
\r
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
\r
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
\r
9 module openflow-protocol {
\r
10 namespace "urn:opendaylight:openflow:protocol";
\r
13 import ietf-yang-types {prefix yang;}
\r
15 import openflow-types {prefix oft;}
\r
16 import openflow-extensible-match { prefix oxm;}
\r
17 import openflow-instruction { prefix ofinstruction;}
\r
18 import openflow-action {prefix ofaction;}
\r
20 revision "2013-07-31" {
\r
21 description "OpenFlow 1.3 - protocol objects model";
\r
24 // Generic Structures
\r
25 grouping port-grouping {
\r
26 reference "ofp_port";
\r
31 type yang:mac-address;
\r
37 description "Bitmap of OFPPC_* flags.";
\r
38 type oft:port-config;
\r
41 description "Bitmap of OFPPS_* flags.";
\r
42 type oft:port-state;
\r
44 leaf current-features {
\r
45 description "Current features.";
\r
46 type oft:port-features;
\r
48 leaf advertised-features {
\r
49 description "Features being advertised by the port.";
\r
50 type oft:port-features;
\r
52 leaf supported-features {
\r
53 description "Features supported by the port.";
\r
54 type oft:port-features;
\r
56 leaf peer-features {
\r
57 description "Features advertised by peer.";
\r
58 type oft:port-features;
\r
61 description "Current port bitrate in kbps.";
\r
66 description "Max port bitrate in kbps";
\r
73 type oft:port-config-v10;
\r
76 type oft:port-state-v10;
\r
78 leaf current-features-v10 {
\r
79 description "Current features.";
\r
80 type oft:port-features-v10;
\r
82 leaf advertised-features-v10 {
\r
83 description "Features being advertised by the port.";
\r
84 type oft:port-features-v10;
\r
86 leaf supported-features-v10 {
\r
87 description "Features supported by the port.";
\r
88 type oft:port-features-v10;
\r
90 leaf peer-features-v10 {
\r
91 description "Features advertised by peer.";
\r
92 type oft:port-features-v10;
\r
96 grouping buckets-grouping {
\r
98 uses bucket-grouping;
\r
102 grouping bucket-grouping {
\r
103 description "Bucket for use in groups.";
\r
105 description "Relative weight of bucket. Only
\r
106 defined for select groups.";
\r
110 description "Port whose state affects whether this
\r
111 bucket is live. Only required for fast
\r
113 type oft:port-number;
\r
116 description "Group whose state affects whether this
\r
117 bucket is live. Only required for fast
\r
122 uses ofaction:actions-grouping;
\r
125 container table-features-properties-container {
\r
126 uses table-features-properties-grouping;
\r
129 grouping table-features-properties-grouping {
\r
130 list table-feature-properties {
\r
133 type oft:table-features-prop-type;
\r
138 // # MESSAGE Structures
\r
139 /* Immutable messages. */
\r
140 grouping ofHeader {
\r
141 reference "ofp_header struct in Openflow Switch 1.3 Spec";
\r
144 description "OpenFlow version";
\r
148 description "Transaction ID";
\r
151 grouping ofHelloElementHeader {
\r
152 reference "ofpt_hello_elem_header struct in Openflow Switch 1.3 Spec";
\r
154 type oft:hello-element-type;
\r
155 //reference "OpenFlow Header element type - OFPHET_*";
\r
159 reference "OFPT_HELLO message in Openflow Switch 1.3 Spec";
\r
160 /* Symmetric message */
\r
164 uses ofHelloElementHeader;
\r
166 leaf-list version-bitmap {
\r
172 reference "OFPT_ERROR message in Openflow Switch 1.3 Spec";
\r
173 /* Symmetric message */
\r
192 grouping echo-request {
\r
193 reference "OFPT_ECHO_REQUEST message in Openflow Switch 1.3 Spec";
\r
194 /* Symmetric message */
\r
201 grouping echo-reply {
\r
202 reference "OFPT_ECHO_REPLY message in Openflow Switch 1.3 Spec";
\r
203 /* Symmetric message */
\r
210 grouping experimenter {
\r
211 reference "OFPT_EXPERIMENTER message in Openflow Switch 1.3 Spec";
\r
212 /* Symmetric message */
\r
215 leaf experimenter {
\r
225 /* Switch configuration messages. */
\r
226 grouping features-request {
\r
227 reference "OFPT_FEATURES_REQUEST message in Openflow Switch 1.3 Spec";
\r
228 /* Controller/switch message */
\r
231 grouping features-reply {
\r
232 reference "OFPT_FEATURES_REPLY message in Openflow Switch 1.3 Spec";
\r
233 /* Controller/switch message */
\r
248 leaf capabilities {
\r
249 type oft:capabilities;
\r
254 // OF1.0 structures
\r
255 leaf capabilities-v10 {
\r
256 type oft:capabilities-v10;
\r
259 type oft:action-type-v10;
\r
262 uses port-grouping;
\r
265 grouping get-config-request {
\r
266 reference "OFPT_GET_CONFIG_REQUEST message in Openflow Switch 1.3 Spec";
\r
267 /* Controller/switch message */
\r
270 grouping get-config-reply {
\r
271 reference "OFPT_GET_CONFIG_REPLY message in Openflow Switch 1.3 Spec";
\r
272 /* Controller/switch message */
\r
276 type oft:switch-config-flag;
\r
278 leaf miss-send-len {
\r
282 grouping set-config {
\r
283 reference "OFPT_SET_CONFIG message in Openflow Switch 1.3 Spec";
\r
284 /* Controller/switch message */
\r
289 type oft:switch-config-flag;
\r
291 leaf miss-send-len {
\r
295 /* Asynchronous messages. */
\r
296 grouping packet-in {
\r
297 reference "OFPT_PACKET_IN message in Openflow Switch 1.3 Spec";
\r
298 /* Async message */
\r
303 // ID assigned by datapath.
\r
307 // Full length of frame.
\r
311 // Reason packet is being sent (one of OFPR_*)
\r
312 type oft:packet-in-reason;
\r
315 // ID of the table that was looked up
\r
319 // Cookie of the flow entry that was looked up.
\r
322 uses oxm:match-grouping;
\r
328 // OF1.0 structures
\r
333 grouping flow-removed {
\r
334 reference "OFPT_FLOW_REMOVED message in Openflow Switch 1.3 Spec";
\r
335 /* Async message */
\r
345 type oft:flow-removed-reason;
\r
350 leaf duration-sec {
\r
353 leaf duration-nsec {
\r
356 leaf idle-timeout {
\r
359 leaf hard-timeout {
\r
362 leaf packet-count {
\r
368 uses oxm:match-grouping;
\r
370 // OF1.0 structures
\r
371 uses oxm:match-v10-grouping;
\r
373 grouping port-status {
\r
374 reference "OFPT_PORT_STATUS message in Openflow Switch 1.3 Spec";
\r
378 uses port-grouping;
\r
381 type oft:port-reason;
\r
384 /* Controller command messages. */
\r
385 grouping packet-out {
\r
386 reference "OFPT_PACKET_OUT message in Openflow Switch 1.3 Spec";
\r
387 /* Controller/switch message */
\r
391 uses ofaction:actions-grouping;
\r
400 type oft:port-number;
\r
403 grouping flow-mod {
\r
404 reference "OFPT_FLOW_MOD message in Openflow Switch 1.3 Spec";
\r
405 /* Controller/switch message */
\r
419 type oft:flow-mod-command;
\r
421 leaf idle-timeout {
\r
424 leaf hard-timeout {
\r
434 type oft:port-number;
\r
440 type oft:flow-mod-flags;
\r
442 uses oxm:match-grouping;
\r
444 uses ofinstruction:instructions-grouping;
\r
446 // OF1.0 structures
\r
448 type oft:flow-mod-flags-v10;
\r
450 uses oxm:match-v10-grouping;
\r
451 uses ofaction:actions-grouping;
\r
453 grouping group-mod {
\r
454 reference "OFPT_GROUP_MOD message in Openflow Switch 1.3 Spec";
\r
455 /* Controller/switch message */
\r
460 type oft:group-mod-command;
\r
463 type oft:group-type;
\r
469 uses buckets-grouping;
\r
472 grouping port-mod {
\r
473 reference "OFPT_PORT_MOD message in Openflow Switch 1.3 Spec";
\r
474 /* Controller/switch message */
\r
479 type oft:port-number;
\r
482 type yang:mac-address;
\r
485 type oft:port-config;
\r
488 type oft:port-config;
\r
491 type oft:port-features;
\r
493 // OF1.0 structures
\r
495 type oft:port-config-v10;
\r
498 type oft:port-config-v10;
\r
500 leaf advertise-v10 {
\r
501 type oft:port-features-v10;
\r
504 grouping table-mod {
\r
505 reference "OFPT_TABLE_MOD message in Openflow Switch 1.3 Spec";
\r
506 /* Controller/switch message */
\r
514 type oft:table-config;
\r
518 /* Multipart messages. */
\r
519 grouping multipart-request {
\r
520 reference "OFPT_MULTIPART_REQUEST message in Openflow Switch 1.3 Spec";
\r
521 /* Controller/switch message */
\r
526 type oft:multipart-type;
\r
529 type oft:multipart-request-flags;
\r
531 choice multipart-request-body {
\r
532 case multipart-request-desc-case {
\r
533 container multipart-request-desc {
\r
539 case multipart-request-flow-case {
\r
540 container multipart-request-flow {
\r
556 uses oxm:match-grouping;
\r
558 // OF1.0 structures
\r
559 uses oxm:match-v10-grouping;
\r
562 case multipart-request-aggregate-case {
\r
563 container multipart-request-aggregate {
\r
579 uses oxm:match-grouping;
\r
581 // OF1.0 structures
\r
582 uses oxm:match-v10-grouping;
\r
585 case multipart-request-table-case {
\r
586 container multipart-request-table {
\r
592 case multipart-request-port-stats-case {
\r
593 container multipart-request-port-stats {
\r
599 case multipart-request-queue-case {
\r
600 container multipart-request-queue {
\r
609 case multipart-request-group-case {
\r
610 container multipart-request-group {
\r
616 case multipart-request-group-desc-case {
\r
617 container multipart-request-group-desc {
\r
623 case multipart-request-group-features-case {
\r
624 container multipart-request-group-features {
\r
630 case multipart-request-meter-case {
\r
631 container multipart-request-meter {
\r
637 case multipart-request-meter-config-case {
\r
638 container multipart-request-meter-config {
\r
644 case multipart-request-meter-features-case {
\r
645 container multipart-request-meter-features {
\r
651 case multipart-request-table-features-case {
\r
652 container multipart-request-table-features {
\r
653 list table-features {
\r
660 leaf metadata-match {
\r
663 leaf metadata-write {
\r
667 type oft:table-config;
\r
672 uses table-features-properties-grouping;
\r
676 case multipart-request-port-desc-case {
\r
677 container multipart-request-port-desc {
\r
683 case multipart-request-experimenter-case {
\r
684 container multipart-request-experimenter {
\r
685 leaf experimenter {
\r
698 grouping multipart-reply {
\r
699 reference "OFPT_MULTIPART_REPLY message in Openflow Switch 1.3 Spec";
\r
700 /* Controller/switch message */
\r
705 type oft:multipart-type;
\r
708 type oft:multipart-request-flags;
\r
710 choice multipart-reply-body {
\r
711 case multipart-reply-desc-case {
\r
712 container multipart-reply-desc {
\r
730 case multipart-reply-flow-case {
\r
731 container multipart-reply-flow {
\r
736 leaf duration-sec {
\r
739 leaf duration-nsec {
\r
745 leaf idle-timeout {
\r
748 leaf hard-timeout {
\r
752 type oft:flow-mod-flags;
\r
757 leaf packet-count {
\r
763 uses oxm:match-grouping;
\r
765 uses ofinstruction:instructions-grouping;
\r
767 // OF1.0 structures
\r
768 uses oxm:match-v10-grouping;
\r
769 uses ofaction:actions-grouping;
\r
773 case multipart-reply-aggregate-case {
\r
774 container multipart-reply-aggregate {
\r
775 leaf packet-count {
\r
786 case multipart-reply-table-case {
\r
787 container multipart-reply-table {
\r
792 leaf active-count {
\r
795 leaf lookup-count {
\r
798 leaf matched-count {
\r
802 // OF1.0 structures
\r
807 type oft:flow-wildcards-v10;
\r
821 case multipart-reply-port-stats-case {
\r
822 container multipart-reply-port-stats {
\r
851 leaf rx-frame-err {
\r
863 leaf duration-sec {
\r
866 leaf duration-nsec {
\r
872 case multipart-reply-queue-case {
\r
873 container multipart-reply-queue {
\r
890 leaf duration-sec {
\r
893 leaf duration-nsec {
\r
899 case multipart-reply-group-case {
\r
900 container multipart-reply-group {
\r
908 leaf packet-count {
\r
914 leaf duration-sec {
\r
917 leaf duration-nsec {
\r
920 list bucket-stats {
\r
921 leaf packet-count {
\r
931 case multipart-reply-group-desc-case {
\r
932 container multipart-reply-group-desc {
\r
935 type oft:group-type;
\r
940 uses buckets-grouping;
\r
944 case multipart-reply-group-features-case {
\r
945 container multipart-reply-group-features {
\r
947 type oft:group-types;
\r
949 leaf capabilities {
\r
950 type oft:group-capabilities;
\r
952 leaf-list max_groups {
\r
955 leaf-list actions-bitmap {
\r
956 type oft:action-type;
\r
960 case multipart-reply-meter-case {
\r
961 container multipart-reply-meter {
\r
969 leaf packet-in-count {
\r
972 leaf byte-in-count {
\r
975 leaf duration-sec {
\r
978 leaf duration-nsec {
\r
981 list meter-band-stats {
\r
982 leaf packet-band-count {
\r
985 leaf byte-band-count {
\r
992 case multipart-reply-meter-config-case {
\r
993 container multipart-reply-meter-config {
\r
994 list meter-config {
\r
996 type oft:meter-flags;
\r
1002 uses meter-band-header;
\r
1007 case multipart-reply-meter-features-case {
\r
1008 container multipart-reply-meter-features {
\r
1013 type oft:meter-band-type-bitmap;
\r
1015 leaf capabilities {
\r
1016 type oft:meter-flags;
\r
1026 case multipart-reply-table-features-case {
\r
1027 container multipart-reply-table-features {
\r
1028 list table-features {
\r
1035 leaf metadata-match {
\r
1038 leaf metadata-write {
\r
1042 type oft:table-config;
\r
1044 leaf max-entries {
\r
1047 uses table-features-properties-grouping;
\r
1051 case multipart-reply-port-desc-case {
\r
1052 container multipart-reply-port-desc {
\r
1054 uses port-grouping;
\r
1058 case multipart-reply-experimenter-case {
\r
1059 container multipart-reply-experimenter {
\r
1060 leaf experimenter {
\r
1073 /* Barrier messages. */
\r
1074 grouping barrier-request {
\r
1075 reference "OFPT_BARRIER_REQUEST message in Openflow Switch 1.3 Spec";
\r
1076 /* Controller/switch message */
\r
1079 grouping barrier-reply {
\r
1080 reference "OFPT_BARRIER_REPLY message in Openflow Switch 1.3 Spec";
\r
1081 /* Controller/switch message */
\r
1084 /* Queue Configuration messages. */
\r
1085 grouping queue-get-config-request {
\r
1086 reference "OFPT_QUEUE_GET_CONFIG_REQUEST message in Openflow Switch 1.3 Spec";
\r
1087 /* Controller/switch message */
\r
1092 type oft:port-number;
\r
1095 grouping queue-get-config-reply {
\r
1096 reference "OFPT_QUEUE_GET_CONFIG_REPLY message in Openflow Switch 1.3 Spec";
\r
1097 /* Controller/switch message */
\r
1102 type oft:port-number;
\r
1105 uses packet-queue;
\r
1108 grouping packet-queue {
\r
1110 type oft:queue-id;
\r
1113 type oft:port-number;
\r
1115 uses queue-property-header;
\r
1117 container queue-prop-container {
\r
1118 uses queue-property-header;
\r
1120 grouping queue-property-header {
\r
1121 list queue-property {
\r
1124 type oft:queue-properties;
\r
1128 /* Controller role change request messages. */
\r
1129 grouping role-request {
\r
1130 reference "OFPT_ROLE_REQUEST message in Openflow Switch 1.3 Spec";
\r
1131 /* Controller/switch message */
\r
1136 type oft:controller-role;
\r
1138 leaf generation-id {
\r
1142 grouping role-reply {
\r
1143 reference "OFPT_ROLE_REPLY message in Openflow Switch 1.3 Spec";
\r
1144 /* Controller/switch message */
\r
1149 type oft:controller-role;
\r
1151 leaf generation-id {
\r
1155 /* Asynchronous message configuration. */
\r
1156 grouping get-async-request {
\r
1157 reference "OFPT_GET_ASYNC_REQUEST message in Openflow Switch 1.3 Spec";
\r
1158 /* Controller/switch message */
\r
1162 grouping get-async-reply {
\r
1163 reference "OFPT_GET_ASYNC_REPLY message in Openflow Switch 1.3 Spec";
\r
1164 /* Controller/switch message */
\r
1167 uses async-body-grouping;
\r
1169 grouping set-async {
\r
1170 reference "OFPT_SET_ASYNC message in Openflow Switch 1.3 Spec";
\r
1171 /* Controller/switch message */
\r
1174 uses async-body-grouping;
\r
1177 grouping async-body-grouping {
\r
1178 list packet-in-mask {
\r
1180 type oft:packet-in-reason;
\r
1183 list port-status-mask {
\r
1185 type oft:port-reason;
\r
1188 list flow-removed-mask {
\r
1190 type oft:flow-removed-reason;
\r
1194 /* Meters and rate limiters configuration messages. */
\r
1195 grouping meter-mod {
\r
1196 reference "OFPT_METER_MOD message in Openflow Switch 1.3 Spec";
\r
1197 /* Controller/switch message */
\r
1202 type oft:meter-mod-command;
\r
1205 type oft:meter-flags;
\r
1208 type oft:meter-id;
\r
1211 uses meter-band-header;
\r
1215 grouping meter-band-header {
\r
1216 choice meter-band {
\r
1217 case meter-band-drop-case {
\r
1218 container meter-band-drop {
\r
1219 uses meter-band-commons;
\r
1222 case meter-band-dscp-remark-case {
\r
1223 container meter-band-dscp-remark {
\r
1224 uses meter-band-commons;
\r
1230 case meter-band-experimenter-case {
\r
1231 container meter-band-experimenter {
\r
1232 uses meter-band-commons;
\r
1233 leaf experimenter {
\r
1241 grouping meter-band-commons {
\r
1243 type oft:meter-band-type;
\r
1253 /* Immutable messages. */
\r
1254 notification hello-message {
\r
1256 reference "OFPT_HELLO message in Openflow Switch 1.3 Spec";
\r
1258 /* Symmetric message */
\r
1260 notification error-message {
\r
1262 reference "OFPT_ERROR message in Openflow Switch 1.3 Spec";
\r
1264 /* Symmetric message */
\r
1266 notification echo-request-message {
\r
1267 uses echo-request;
\r
1268 reference "OFPT_ECHO_REQUEST message in Openflow Switch 1.3 Spec";
\r
1270 /* Symmetric message */
\r
1272 notification experimenter-message {
\r
1273 uses experimenter;
\r
1274 reference "OFPT_EXPERIMENTER message in Openflow Switch 1.3 Spec";
\r
1275 // TODO:: does switch send this when understood experimenter msg from lib?
\r
1276 /* Symmetric message */
\r
1278 // # Notification and RPCs
\r
1279 /* Symmetric RPC. */
\r
1282 uses echo-request;
\r
1284 /* Controller/switch message */
\r
1302 rpc experimenter {
\r
1304 uses experimenter;
\r
1308 /* Switch configuration messages. */
\r
1309 rpc get-features {
\r
1311 uses features-request;
\r
1313 /* Controller/switch message */
\r
1315 uses features-reply;
\r
1321 uses get-config-request;
\r
1324 uses get-config-reply;
\r
1326 /* Controller/switch message */
\r
1333 /* Controller/switch message */
\r
1335 /* Asynchronous messages. */
\r
1336 notification packet-in-message {
\r
1339 /* Async message */
\r
1341 notification flow-removed-message {
\r
1342 uses flow-removed;
\r
1344 /* Async message */
\r
1346 notification port-status-message {
\r
1349 } /* Async message */
\r
1351 /* Controller command messages. */
\r
1356 /* Controller/switch message */
\r
1362 /* Controller/switch message */
\r
1368 /* Controller/switch message */
\r
1374 } /* Controller/switch message */
\r
1380 } /* Controller/switch message */
\r
1382 /* Multipart messages. */
\r
1384 rpc multipart-request {
\r
1386 uses multipart-request;
\r
1390 /* Controller/switch message */
\r
1391 notification multipart-reply-message {
\r
1392 uses multipart-reply;
\r
1393 // notification because of multiple following responses
\r
1394 } /* Controller/switch message */
\r
1397 /* Barrier messages. */
\r
1400 uses barrier-request;
\r
1403 uses barrier-reply;
\r
1406 /* Queue Configuration messages. */
\r
1407 rpc get-queue-config {
\r
1409 uses queue-get-config-request;
\r
1412 uses queue-get-config-reply;
\r
1416 /* Controller role change request messages. */
\r
1417 rpc role-request {
\r
1419 uses role-request;
\r
1424 } /* Controller/switch message */
\r
1426 /* Asynchronous message configuration. */
\r
1429 uses get-async-request;
\r
1432 uses get-async-reply;
\r
1435 /* Controller/switch message */
\r
1442 /* Meters and rate limiters configuration messages. */
\r
1447 } /* Controller/switch message */
\r