1 module openflow-protocol {
2 namespace "urn:opendaylight:openflow:protocol";
6 import ietf-inet-types {prefix inet;}
7 import ietf-yang-types {prefix yang;}
9 import openflow-types {prefix oft;}
10 import openflow-extensible-match { prefix oxm;}
11 import openflow-instruction { prefix ofinstruction;}
12 import openflow-action {prefix ofaction;}
16 revision "2013-07-31" {
17 description "Initial model";
23 // reference "ofp_port";
25 // reference "ofp_port.port_no";
29 // reference "ofp_port.hw_addr";
30 type yang:mac-address;
33 // reference "ofp_port.name";
37 // reference "ofp_port.config";
41 // reference "ofp_port.state";
44 leaf current-features {
45 description "Current features.";
46 // reference "ofp_port.curr";
47 type oft:port-features;
49 leaf advertised-features {
50 description "Features being advertised by the port.";
51 // reference "ofp_port.advertised";
52 type oft:port-features;
54 leaf supported-features {
55 description "Features supported by the port.";
56 // reference "ofp_port.supported";
57 type oft:port-features;
60 description "Features advertised by peer.";
61 // reference "ofp_port.peer";
62 type oft:port-features;
65 description "Current port bitrate in kbps.";
66 // reference "ofp_port.curr_speed";
71 description "Max port bitrate in kbps";
72 // reference "ofp_port.max_speed";
78 // TODO: ofp_packat_queue
80 // # MESSAGE Structures
81 /* Immutable messages. */
83 //reference "ofpt_header struct in Openflow Switch 1.3 Spec"
86 //reference "OpenFlow Header - OFP_VERSION";
90 //reference "OpenFlow Header - transaction id";
93 grouping ofHelloElementHeader {
94 //reference "ofpt_hello_elem_header struct in Openflow Switch 1.3 Spec"
96 type oft:hello-element-type;
97 //reference "OpenFlow Header element type - OFPHET_*";
101 // reference "OFPT_HELLO message in Openflow Switch 1.3 Spec"
102 /* Symmetric message */
106 uses ofHelloElementHeader;
114 // reference "OFPT_ERROR message in Openflow Switch 1.3 Spec"
115 /* Symmetric message */
128 grouping echo-request {
129 // reference "OFPT_ECHO_REQUEST message in Openflow Switch 1.3 Spec"
130 /* Symmetric message */
137 grouping echo-reply {
138 // reference "OFPT_ECHO_REPLY message in Openflow Switch 1.3 Spec"
139 /* Symmetric message */
146 grouping experimenter {
147 // reference "OFPT_EXPERIMENTER message in Openflow Switch 1.3 Spec"
148 /* Symmetric message */
158 /* Switch configuration messages. */
159 grouping features-request {
160 // reference "OFPT_FEATURES_REQUEST message in Openflow Switch 1.3 Spec"
161 /* Controller/switch message */
164 grouping features-reply {
165 // reference "OFPT_FEATURES_REPLY message in Openflow Switch 1.3 Spec"
166 /* Controller/switch message */
188 grouping get-config-request {
189 // reference "OFPT_GET_CONFIG_REQUEST message in Openflow Switch 1.3 Spec"
190 /* Controller/switch message */
193 grouping get-config-reply {
194 // reference "OFPT_GET_CONFIG_REPLY message in Openflow Switch 1.3 Spec"
195 /* Controller/switch message */
199 type oft:switch-config-flag;
205 grouping set-config {
206 // reference "OFPT_SET_CONFIG message in Openflow Switch 1.3 Spec"
207 /* Controller/switch message */
212 type oft:switch-config-flag;
218 /* Asynchronous messages. */
220 // reference "OFPT_PACKET_IN message in Openflow Switch 1.3 Spec"
226 // ID assigned by datapath.
230 // Full length of frame.
234 // Reason packet is being sent (one of OFPR_*)
238 // ID of the table that was looked up
242 // Cookie of the flow entry that was looked up.
246 //TODO:: add match leaf
251 // struct ofp_match match; /* Packet metadata. Variable size. */
252 // /* The variable size and padded match is always followed by:
253 // * - Exactly 2 all-zero padding bytes, then
254 // * - An Ethernet frame whose length is inferred from header.length.
255 // * The padding bytes preceding the Ethernet frame ensure that the IP
256 // * header (if any) following the Ethernet header is 32-bit aligned.
263 grouping flow-removed {
264 // reference "OFPT_FLOW_REMOVED message in Openflow Switch 1.3 Spec"
275 type oft:flow-removed-reason;
298 //TODO:: add match leaf
303 grouping port-status {
304 // reference "OFPT_PORT_STATUS message in Openflow Switch 1.3 Spec"
311 type oft:port-reason;
313 } /* Async message */
314 /* Controller command messages. */
315 grouping packet-out {
316 // reference "OFPT_PACKET_OUT message in Openflow Switch 1.3 Spec"
317 /* Controller/switch message */
322 uses ofaction:action-header;
333 type oft:port-number;
337 // reference "OFPT_FLOW_MOD message in Openflow Switch 1.3 Spec"
338 /* Controller/switch message */
352 type oft:flow-mod-command;
367 type oft:port-number;
375 //TODO:: add match leaf
378 // reference "OFPT_GROUP_MOD message in Openflow Switch 1.3 Spec"
379 /* Controller/switch message */
384 type oft:group-mod-command;
402 type oft:port-number;
409 uses ofaction:action-header;
413 // reference "OFPT_PORT_MOD message in Openflow Switch 1.3 Spec"
414 /* Controller/switch message */
419 type oft:port-number;
422 type yang:mac-address;
425 type oft:port-config;
428 type oft:port-config;
431 type oft:port-config;
435 // reference "OFPT_TABLE_MOD message in Openflow Switch 1.3 Spec"
436 /* Controller/switch message */
444 type oft:port-config;
448 /* Multipart messages. */
449 grouping multipart-request {
450 // reference "OFPT_MULTIPART_REQUEST message in Openflow Switch 1.3 Spec"
451 /* Controller/switch message */
456 type oft:multipart-type;
459 type oft:multipart-request-flags;
462 case multipart-flow {
502 grouping multipart-reply {
503 // reference "OFPT_MULTIPART_REPLY message in Openflow Switch 1.3 Spec"
504 /* Controller/switch message */
509 type oft:multipart-type;
512 type oft:multipart-request-flags;
515 case multipart-desc {
532 case multipart-flow {
572 /* Barrier messages. */
573 grouping barrier-request {
574 // reference "OFPT_BARRIER_REQUEST message in Openflow Switch 1.3 Spec"
575 /* Controller/switch message */
578 grouping barrier-reply {
579 // reference "OFPT_BARRIER_REPLY message in Openflow Switch 1.3 Spec"
580 /* Controller/switch message */
583 /* Queue Configuration messages. */
584 grouping queue-get-config-request {
585 // reference "OFPT_QUEUE_GET_CONFIG_REQUEST message in Openflow Switch 1.3 Spec"
586 /* Controller/switch message */
591 type oft:port-number;
594 grouping queue-get-config-reply {
595 // reference "OFPT_QUEUE_GET_CONFIG_REPLY message in Openflow Switch 1.3 Spec"
596 /* Controller/switch message */
601 type oft:port-number;
607 grouping packet-queue {
612 type oft:port-number;
615 uses queue-property-header;
618 grouping queue-property-header {
620 type oft:queue-property;
623 /* Controller role change request messages. */
624 grouping role-request {
625 // reference "OFPT_ROLE_REQUEST message in Openflow Switch 1.3 Spec"
626 /* Controller/switch message */
631 type oft:controller-role;
637 grouping role-reply {
638 // reference "OFPT_ROLE_REPLY message in Openflow Switch 1.3 Spec"
639 /* Controller/switch message */
644 type oft:controller-role;
650 /* Asynchronous message configuration. */
651 grouping get-async-request {
652 // reference "OFPT_GET_ASYNC_REQUEST message in Openflow Switch 1.3 Spec"
653 /* Controller/switch message */
657 grouping get-async-reply {
658 // reference "OFPT_GET_ASYNC_REPLY message in Openflow Switch 1.3 Spec"
659 /* Controller/switch message */
663 list packet-in-mask {
665 type oft:packet-in-reason;
668 list port-status-mask {
670 type oft:port-reason;
673 list flow-removed-mask {
675 type oft:flow-removed-reason;
680 // reference "OFPT_SET_ASYNC message in Openflow Switch 1.3 Spec"
681 /* Controller/switch message */
685 leaf-list packet-in-mask {
686 type oft:packet-in-reason;
688 leaf-list port-status-mask {
689 type oft:port-reason;
691 leaf-list flow-removed-mask {
692 type oft:flow-removed-reason;
695 /* Meters and rate limiters configuration messages. */
697 // reference "OFPT_METER_MOD message in Openflow Switch 1.3 Spec"
698 /* Controller/switch message */
703 type oft:meter-mod-command;
706 type oft:meter-flags;
712 uses meter-band-header;
716 grouping meter-band-header {
718 type oft:meter-band-type;
730 /* Immutable messages. */
731 notification hello-message {
733 // reference "OFPT_HELLO message in Openflow Switch 1.3 Spec"
735 /* Symmetric message */
737 notification error-message {
739 // reference "OFPT_ERROR message in Openflow Switch 1.3 Spec"
741 /* Symmetric message */
743 notification echo-request-message {
745 // reference "OFPT_ECHO_REQUEST message in Openflow Switch 1.3 Spec"
747 /* Symmetric message */
749 notification experimenter-message {
751 // reference "OFPT_EXPERIMENTER message in Openflow Switch 1.3 Spec"
752 // TODO:: does switch send this when understood experimenter msg from lib?
753 /* Symmetric message */
755 // # Notification and RPCs
758 // reference "OFPT_ECHO_REQUEST message in Openflow Switch 1.3 Spec"
762 /* Controller/switch message */
769 // reference "OFPT_ECHO_REQUEST message in Openflow Switch 1.3 Spec"
776 // reference "OFPT_HELLO message in Openflow Switch 1.3 Spec"
783 // reference "OFPT_EXPERIMENTER message in Openflow Switch 1.3 Spec"
789 /* Switch configuration messages. */
791 // reference "OFPT_FEATURES_REQUEST message in Openflow Switch 1.3 Spec"
793 uses features-request;
795 /* Controller/switch message */
802 // reference "OFPT_GET_CONFIG_REQUEST message in Openflow Switch 1.3 Spec"
804 uses get-config-request;
807 uses get-config-reply;
809 /* Controller/switch message */
813 // reference "OFPT_SET_CONFIG message in Openflow Switch 1.3 Spec"
817 /* Controller/switch message */
819 /* Asynchronous messages. */
820 notification packet-in-message {
822 // reference "OFPT_PACKET_IN message in Openflow Switch 1.3 Spec"
826 notification flow-removed-message {
828 // reference "OFPT_FLOW_REMOVED message in Openflow Switch 1.3 Spec"
832 notification port-status-message {
834 // reference "OFPT_PORT_STATUS message in Openflow Switch 1.3 Spec"
836 } /* Async message */
838 /* Controller command messages. */
842 // reference "OFPT_PACKET_OUT message in Openflow Switch 1.3 Spec"
844 /* Controller/switch message */
849 // reference "OFPT_FLOW_MOD message in Openflow Switch 1.3 Spec"
851 /* Controller/switch message */
856 // reference "OFPT_GROUP_MOD message in Openflow Switch 1.3 Spec"
858 /* Controller/switch message */
863 // reference "OFPT_PORT_MOD message in Openflow Switch 1.3 Spec"
865 } /* Controller/switch message */
870 // reference "OFPT_TABLE_MOD message in Openflow Switch 1.3 Spec"
872 } /* Controller/switch message */
874 /* Multipart messages. */
875 //FIXME: Arent this wire protocol specific?
877 notification multipart-request-message {
878 uses multipart-request;
879 // reference "OFPT_MULTIPART_REQUEST message in Openflow Switch 1.3 Spec"
881 } /* Controller/switch message */
882 notification multipart-reply-message {
883 uses multipart-reply;
884 // reference "OFPT_MULTIPART_REPLY message in Openflow Switch 1.3 Spec"
886 } /* Controller/switch message */
889 /* Barrier messages. */
892 uses barrier-request;
893 // reference "OFPT_BARRIER_REQUEST message in Openflow Switch 1.3 Spec"
897 // reference "OFPT_BARRIER_REPLY message in Openflow Switch 1.3 Spec"
900 /* Queue Configuration messages. */
901 rpc get-queue-config {
903 uses queue-get-config-request;
904 // reference "OFPT_QUEUE_GET_CONFIG_REQUEST message in Openflow Switch 1.3 Spec"
907 uses queue-get-config-reply;
908 // reference "OFPT_QUEUE_GET_CONFIG_REPLY message in Openflow Switch 1.3 Spec"
912 /* Controller role change request messages. */
916 // reference "OFPT_ROLE_REQUEST message in Openflow Switch 1.3 Spec"
920 // reference "OFPT_ROLE_REPLY message in Openflow Switch 1.3 Spec"
922 } /* Controller/switch message */
924 /* Asynchronous message configuration. */
927 uses get-async-request;
928 // reference "OFPT_GET_ASYNC_REQUEST message in Openflow Switch 1.3 Spec"
931 uses get-async-reply;
932 // reference "OFPT_GET_ASYNC_REPLY message in Openflow Switch 1.3 Spec"
935 /* Controller/switch message */
939 // reference "OFPT_SET_ASYNC message in Openflow Switch 1.3 Spec"
943 /* Meters and rate limiters configuration messages. */
947 // reference "OFPT_METER_MOD message in Openflow Switch 1.3 Spec"
949 } /* Controller/switch message */