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 "OpenFlow Header element length";
105 // reference "OFPT_HELLO message in Openflow Switch 1.3 Spec"
106 /* Symmetric message */
110 uses ofHelloElementHeader;
118 // reference "OFPT_ERROR message in Openflow Switch 1.3 Spec"
119 /* Symmetric message */
132 grouping echo-request {
133 // reference "OFPT_ECHO_REQUEST message in Openflow Switch 1.3 Spec"
134 /* Symmetric message */
141 grouping echo-reply {
142 // reference "OFPT_ECHO_REPLY message in Openflow Switch 1.3 Spec"
143 /* Symmetric message */
150 grouping experimenter {
151 // reference "OFPT_EXPERIMENTER message in Openflow Switch 1.3 Spec"
152 /* Symmetric message */
162 /* Switch configuration messages. */
163 grouping features-request {
164 // reference "OFPT_FEATURES_REQUEST message in Openflow Switch 1.3 Spec"
165 /* Controller/switch message */
168 grouping features-reply {
169 // reference "OFPT_FEATURES_REPLY message in Openflow Switch 1.3 Spec"
170 /* Controller/switch message */
192 grouping get-config-request {
193 // reference "OFPT_GET_CONFIG_REQUEST message in Openflow Switch 1.3 Spec"
194 /* Controller/switch message */
197 grouping get-config-reply {
198 // reference "OFPT_GET_CONFIG_REPLY message in Openflow Switch 1.3 Spec"
199 /* Controller/switch message */
203 type oft:switch-config-flag;
209 grouping set-config {
210 // reference "OFPT_SET_CONFIG message in Openflow Switch 1.3 Spec"
211 /* Controller/switch message */
216 type oft:switch-config-flag;
222 /* Asynchronous messages. */
224 // reference "OFPT_PACKET_IN message in Openflow Switch 1.3 Spec"
230 // ID assigned by datapath.
234 // Full length of frame.
238 // Reason packet is being sent (one of OFPR_*)
242 // ID of the table that was looked up
246 // Cookie of the flow entry that was looked up.
250 //TODO:: add match leaf
255 // struct ofp_match match; /* Packet metadata. Variable size. */
256 // /* The variable size and padded match is always followed by:
257 // * - Exactly 2 all-zero padding bytes, then
258 // * - An Ethernet frame whose length is inferred from header.length.
259 // * The padding bytes preceding the Ethernet frame ensure that the IP
260 // * header (if any) following the Ethernet header is 32-bit aligned.
267 grouping flow-removed {
268 // reference "OFPT_FLOW_REMOVED message in Openflow Switch 1.3 Spec"
279 type oft:flow-removed-reason;
302 //TODO:: add match leaf
307 grouping port-status {
308 // reference "OFPT_PORT_STATUS message in Openflow Switch 1.3 Spec"
315 type oft:port-reason;
317 } /* Async message */
318 /* Controller command messages. */
319 grouping packet-out {
320 // reference "OFPT_PACKET_OUT message in Openflow Switch 1.3 Spec"
321 /* Controller/switch message */
326 //TODO:: replace with>> uses ofaction:action-header;
338 type oft:port-number;
341 grouping action-header {
342 //TODO:: remove this grouping
344 type ofaction:action-type;
349 // reference "OFPT_FLOW_MOD message in Openflow Switch 1.3 Spec"
350 /* Controller/switch message */
364 type oft:flow-mod-command;
379 type oft:port-number;
387 //TODO:: add match leaf
390 // reference "OFPT_GROUP_MOD message in Openflow Switch 1.3 Spec"
391 /* Controller/switch message */
396 type oft:group-mod-command;
414 type oft:port-number;
421 //TODO:: replace with>> uses ofaction:action-header;
426 // reference "OFPT_PORT_MOD message in Openflow Switch 1.3 Spec"
427 /* Controller/switch message */
432 type oft:port-number;
435 type yang:mac-address;
438 type oft:port-config;
441 type oft:port-config;
444 type oft:port-config;
448 // reference "OFPT_TABLE_MOD message in Openflow Switch 1.3 Spec"
449 /* Controller/switch message */
457 type oft:port-config;
461 /* Multipart messages. */
462 grouping multipart-request {
463 // reference "OFPT_MULTIPART_REQUEST message in Openflow Switch 1.3 Spec"
464 /* Controller/switch message */
469 type oft:multipart-type;
472 type oft:multipart-request-flags;
478 grouping multipart-reply {
479 // reference "OFPT_MULTIPART_REPLY message in Openflow Switch 1.3 Spec"
480 /* Controller/switch message */
485 type oft:multipart-type;
488 type oft:multipart-request-flags;
494 /* Barrier messages. */
495 grouping barrier-request {
496 // reference "OFPT_BARRIER_REQUEST message in Openflow Switch 1.3 Spec"
497 /* Controller/switch message */
500 grouping barrier-reply {
501 // reference "OFPT_BARRIER_REPLY message in Openflow Switch 1.3 Spec"
502 /* Controller/switch message */
505 /* Queue Configuration messages. */
506 grouping queue-get-config-request {
507 // reference "OFPT_QUEUE_GET_CONFIG_REQUEST message in Openflow Switch 1.3 Spec"
508 /* Controller/switch message */
513 type oft:port-number;
516 grouping queue-get-config-reply {
517 // reference "OFPT_QUEUE_GET_CONFIG_REPLY message in Openflow Switch 1.3 Spec"
518 /* Controller/switch message */
523 type oft:port-number;
529 grouping packet-queue {
534 type oft:port-number;
537 uses queue-property-header;
540 grouping queue-property-header {
542 type oft:queue-property;
545 /* Controller role change request messages. */
546 grouping role-request {
547 // reference "OFPT_ROLE_REQUEST message in Openflow Switch 1.3 Spec"
548 /* Controller/switch message */
553 type oft:controller-role;
559 grouping role-reply {
560 // reference "OFPT_ROLE_REPLY message in Openflow Switch 1.3 Spec"
561 /* Controller/switch message */
566 type oft:controller-role;
572 /* Asynchronous message configuration. */
573 grouping get-async-request {
574 // reference "OFPT_GET_ASYNC_REQUEST message in Openflow Switch 1.3 Spec"
575 /* Controller/switch message */
579 grouping get-async-reply {
580 // reference "OFPT_GET_ASYNC_REPLY message in Openflow Switch 1.3 Spec"
581 /* Controller/switch message */
585 list packet-in-mask {
586 type oft:packet-in-reason;
588 list port-status-mask {
589 type oft:port-reason;
591 list flow-removed-mask {
592 type oft:flow-removed-reason;
596 // reference "OFPT_SET_ASYNC message in Openflow Switch 1.3 Spec"
597 /* Controller/switch message */
601 list packet-in-mask {
602 type oft:packet-in-reason;
604 list port-status-mask {
605 type oft:port-reason;
607 list flow-removed-mask {
608 type oft:flow-removed-reason;
611 /* Meters and rate limiters configuration messages. */
613 // reference "OFPT_METER_MOD message in Openflow Switch 1.3 Spec"
614 /* Controller/switch message */
619 type oft:meter-mod-command;
622 type oft:meter-flags;
632 grouping meter-band-header {
634 type oft:meter-band-type;
646 /* Immutable messages. */
647 notification hello-message {
649 // reference "OFPT_HELLO message in Openflow Switch 1.3 Spec"
651 /* Symmetric message */
653 notification error-message {
655 // reference "OFPT_ERROR message in Openflow Switch 1.3 Spec"
657 /* Symmetric message */
659 notification echo-request-message {
661 // reference "OFPT_ECHO_REQUEST message in Openflow Switch 1.3 Spec"
663 /* Symmetric message */
665 notification experimenter-message {
667 // reference "OFPT_EXPERIMENTER message in Openflow Switch 1.3 Spec"
668 // TODO:: does switch send this when understood experimenter msg from lib?
669 /* Symmetric message */
671 // # Notification and RPCs
674 // reference "OFPT_ECHO_REQUEST message in Openflow Switch 1.3 Spec"
678 /* Controller/switch message */
685 // reference "OFPT_ECHO_REQUEST message in Openflow Switch 1.3 Spec"
692 // reference "OFPT_HELLO message in Openflow Switch 1.3 Spec"
699 // reference "OFPT_EXPERIMENTER message in Openflow Switch 1.3 Spec"
705 /* Switch configuration messages. */
707 // reference "OFPT_FEATURES_REQUEST message in Openflow Switch 1.3 Spec"
709 uses features-request;
711 /* Controller/switch message */
718 // reference "OFPT_GET_CONFIG_REQUEST message in Openflow Switch 1.3 Spec"
720 uses get-config-request;
723 uses get-config-reply;
725 /* Controller/switch message */
729 // reference "OFPT_SET_CONFIG message in Openflow Switch 1.3 Spec"
733 /* Controller/switch message */
735 /* Asynchronous messages. */
736 notification packet-in-message {
738 // reference "OFPT_PACKET_IN message in Openflow Switch 1.3 Spec"
742 notification flow-removed-message {
744 // reference "OFPT_FLOW_REMOVED message in Openflow Switch 1.3 Spec"
748 notification port-status-message {
750 // reference "OFPT_PORT_STATUS message in Openflow Switch 1.3 Spec"
752 } /* Async message */
754 /* Controller command messages. */
758 // reference "OFPT_PACKET_OUT message in Openflow Switch 1.3 Spec"
760 /* Controller/switch message */
765 // reference "OFPT_FLOW_MOD message in Openflow Switch 1.3 Spec"
767 /* Controller/switch message */
772 // reference "OFPT_GROUP_MOD message in Openflow Switch 1.3 Spec"
774 /* Controller/switch message */
779 // reference "OFPT_PORT_MOD message in Openflow Switch 1.3 Spec"
781 } /* Controller/switch message */
786 // reference "OFPT_TABLE_MOD message in Openflow Switch 1.3 Spec"
788 } /* Controller/switch message */
790 /* Multipart messages. */
791 //FIXME: Arent this wire protocol specific?
793 notification multipart-request-message {
794 uses multipart-request;
795 // reference "OFPT_MULTIPART_REQUEST message in Openflow Switch 1.3 Spec"
797 } /* Controller/switch message */
798 notification multipart-reply-message {
799 uses multipart-reply;
800 // reference "OFPT_MULTIPART_REPLY message in Openflow Switch 1.3 Spec"
802 } /* Controller/switch message */
805 /* Barrier messages. */
808 uses barrier-request;
809 // reference "OFPT_BARRIER_REQUEST message in Openflow Switch 1.3 Spec"
813 // reference "OFPT_BARRIER_REPLY message in Openflow Switch 1.3 Spec"
816 /* Queue Configuration messages. */
817 rpc get-queue-config {
819 uses queue-get-config-request;
820 // reference "OFPT_QUEUE_GET_CONFIG_REQUEST message in Openflow Switch 1.3 Spec"
823 uses queue-get-config-reply;
824 // reference "OFPT_QUEUE_GET_CONFIG_REPLY message in Openflow Switch 1.3 Spec"
828 /* Controller role change request messages. */
832 // reference "OFPT_ROLE_REQUEST message in Openflow Switch 1.3 Spec"
836 // reference "OFPT_ROLE_REPLY message in Openflow Switch 1.3 Spec"
838 } /* Controller/switch message */
840 /* Asynchronous message configuration. */
841 notification get-async-request-message {
842 uses get-async-request;
843 // reference "OFPT_GET_ASYNC_REQUEST message in Openflow Switch 1.3 Spec"
845 } /* Controller/switch message */
846 notification get-async-reply-message {
847 uses get-async-reply;
848 // reference "OFPT_GET_ASYNC_REPLY message in Openflow Switch 1.3 Spec"
850 } /* Controller/switch message */
851 notification set-async-message {
853 // reference "OFPT_SET_ASYNC message in Openflow Switch 1.3 Spec"
855 } /* Controller/switch message */
856 /* Meters and rate limiters configuration messages. */
860 // reference "OFPT_METER_MOD message in Openflow Switch 1.3 Spec"
862 } /* Controller/switch message */