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 leaf-list packet-in-mask {
664 type oft:packet-in-reason;
666 leaf-list port-status-mask {
667 type oft:port-reason;
669 leaf-list flow-removed-mask {
670 type oft:flow-removed-reason;
674 // reference "OFPT_SET_ASYNC message in Openflow Switch 1.3 Spec"
675 /* Controller/switch message */
679 leaf-list packet-in-mask {
680 type oft:packet-in-reason;
682 leaf-list port-status-mask {
683 type oft:port-reason;
685 leaf-list flow-removed-mask {
686 type oft:flow-removed-reason;
689 /* Meters and rate limiters configuration messages. */
691 // reference "OFPT_METER_MOD message in Openflow Switch 1.3 Spec"
692 /* Controller/switch message */
697 type oft:meter-mod-command;
700 type oft:meter-flags;
706 uses meter-band-header;
710 grouping meter-band-header {
712 type oft:meter-band-type;
724 /* Immutable messages. */
725 notification hello-message {
727 // reference "OFPT_HELLO message in Openflow Switch 1.3 Spec"
729 /* Symmetric message */
731 notification error-message {
733 // reference "OFPT_ERROR message in Openflow Switch 1.3 Spec"
735 /* Symmetric message */
737 notification echo-request-message {
739 // reference "OFPT_ECHO_REQUEST message in Openflow Switch 1.3 Spec"
741 /* Symmetric message */
743 notification experimenter-message {
745 // reference "OFPT_EXPERIMENTER message in Openflow Switch 1.3 Spec"
746 // TODO:: does switch send this when understood experimenter msg from lib?
747 /* Symmetric message */
749 // # Notification and RPCs
752 // reference "OFPT_ECHO_REQUEST message in Openflow Switch 1.3 Spec"
756 /* Controller/switch message */
763 // reference "OFPT_ECHO_REQUEST message in Openflow Switch 1.3 Spec"
770 // reference "OFPT_HELLO message in Openflow Switch 1.3 Spec"
777 // reference "OFPT_EXPERIMENTER message in Openflow Switch 1.3 Spec"
783 /* Switch configuration messages. */
785 // reference "OFPT_FEATURES_REQUEST message in Openflow Switch 1.3 Spec"
787 uses features-request;
789 /* Controller/switch message */
796 // reference "OFPT_GET_CONFIG_REQUEST message in Openflow Switch 1.3 Spec"
798 uses get-config-request;
801 uses get-config-reply;
803 /* Controller/switch message */
807 // reference "OFPT_SET_CONFIG message in Openflow Switch 1.3 Spec"
811 /* Controller/switch message */
813 /* Asynchronous messages. */
814 notification packet-in-message {
816 // reference "OFPT_PACKET_IN message in Openflow Switch 1.3 Spec"
820 notification flow-removed-message {
822 // reference "OFPT_FLOW_REMOVED message in Openflow Switch 1.3 Spec"
826 notification port-status-message {
828 // reference "OFPT_PORT_STATUS message in Openflow Switch 1.3 Spec"
830 } /* Async message */
832 /* Controller command messages. */
836 // reference "OFPT_PACKET_OUT message in Openflow Switch 1.3 Spec"
838 /* Controller/switch message */
843 // reference "OFPT_FLOW_MOD message in Openflow Switch 1.3 Spec"
845 /* Controller/switch message */
850 // reference "OFPT_GROUP_MOD message in Openflow Switch 1.3 Spec"
852 /* Controller/switch message */
857 // reference "OFPT_PORT_MOD message in Openflow Switch 1.3 Spec"
859 } /* Controller/switch message */
864 // reference "OFPT_TABLE_MOD message in Openflow Switch 1.3 Spec"
866 } /* Controller/switch message */
868 /* Multipart messages. */
869 //FIXME: Arent this wire protocol specific?
871 notification multipart-request-message {
872 uses multipart-request;
873 // reference "OFPT_MULTIPART_REQUEST message in Openflow Switch 1.3 Spec"
875 } /* Controller/switch message */
876 notification multipart-reply-message {
877 uses multipart-reply;
878 // reference "OFPT_MULTIPART_REPLY message in Openflow Switch 1.3 Spec"
880 } /* Controller/switch message */
883 /* Barrier messages. */
886 uses barrier-request;
887 // reference "OFPT_BARRIER_REQUEST message in Openflow Switch 1.3 Spec"
891 // reference "OFPT_BARRIER_REPLY message in Openflow Switch 1.3 Spec"
894 /* Queue Configuration messages. */
895 rpc get-queue-config {
897 uses queue-get-config-request;
898 // reference "OFPT_QUEUE_GET_CONFIG_REQUEST message in Openflow Switch 1.3 Spec"
901 uses queue-get-config-reply;
902 // reference "OFPT_QUEUE_GET_CONFIG_REPLY message in Openflow Switch 1.3 Spec"
906 /* Controller role change request messages. */
910 // reference "OFPT_ROLE_REQUEST message in Openflow Switch 1.3 Spec"
914 // reference "OFPT_ROLE_REPLY message in Openflow Switch 1.3 Spec"
916 } /* Controller/switch message */
918 /* Asynchronous message configuration. */
921 uses get-async-request;
922 // reference "OFPT_GET_ASYNC_REQUEST message in Openflow Switch 1.3 Spec"
925 uses get-async-reply;
926 // reference "OFPT_GET_ASYNC_REPLY message in Openflow Switch 1.3 Spec"
929 /* Controller/switch message */
933 // reference "OFPT_SET_ASYNC message in Openflow Switch 1.3 Spec"
937 /* Meters and rate limiters configuration messages. */
941 // reference "OFPT_METER_MOD message in Openflow Switch 1.3 Spec"
943 } /* Controller/switch message */