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 uses ofaction:action-header;
337 type oft:port-number;
341 // reference "OFPT_FLOW_MOD message in Openflow Switch 1.3 Spec"
342 /* Controller/switch message */
356 type oft:flow-mod-command;
371 type oft:port-number;
379 //TODO:: add match leaf
382 // reference "OFPT_GROUP_MOD message in Openflow Switch 1.3 Spec"
383 /* Controller/switch message */
388 type oft:group-mod-command;
406 type oft:port-number;
413 uses ofaction:action-header;
417 // reference "OFPT_PORT_MOD message in Openflow Switch 1.3 Spec"
418 /* Controller/switch message */
423 type oft:port-number;
426 type yang:mac-address;
429 type oft:port-config;
432 type oft:port-config;
435 type oft:port-config;
439 // reference "OFPT_TABLE_MOD message in Openflow Switch 1.3 Spec"
440 /* Controller/switch message */
448 type oft:port-config;
452 /* Multipart messages. */
453 grouping multipart-request {
454 // reference "OFPT_MULTIPART_REQUEST message in Openflow Switch 1.3 Spec"
455 /* Controller/switch message */
460 type oft:multipart-type;
463 type oft:multipart-request-flags;
469 grouping multipart-reply {
470 // reference "OFPT_MULTIPART_REPLY message in Openflow Switch 1.3 Spec"
471 /* Controller/switch message */
476 type oft:multipart-type;
479 type oft:multipart-request-flags;
485 /* Barrier messages. */
486 grouping barrier-request {
487 // reference "OFPT_BARRIER_REQUEST message in Openflow Switch 1.3 Spec"
488 /* Controller/switch message */
491 grouping barrier-reply {
492 // reference "OFPT_BARRIER_REPLY message in Openflow Switch 1.3 Spec"
493 /* Controller/switch message */
496 /* Queue Configuration messages. */
497 grouping queue-get-config-request {
498 // reference "OFPT_QUEUE_GET_CONFIG_REQUEST message in Openflow Switch 1.3 Spec"
499 /* Controller/switch message */
504 type oft:port-number;
507 grouping queue-get-config-reply {
508 // reference "OFPT_QUEUE_GET_CONFIG_REPLY message in Openflow Switch 1.3 Spec"
509 /* Controller/switch message */
514 type oft:port-number;
520 grouping packet-queue {
525 type oft:port-number;
528 uses queue-property-header;
531 grouping queue-property-header {
533 type oft:queue-property;
536 /* Controller role change request messages. */
537 grouping role-request {
538 // reference "OFPT_ROLE_REQUEST message in Openflow Switch 1.3 Spec"
539 /* Controller/switch message */
544 type oft:controller-role;
550 grouping role-reply {
551 // reference "OFPT_ROLE_REPLY message in Openflow Switch 1.3 Spec"
552 /* Controller/switch message */
557 type oft:controller-role;
563 /* Asynchronous message configuration. */
564 grouping get-async-request {
565 // reference "OFPT_GET_ASYNC_REQUEST message in Openflow Switch 1.3 Spec"
566 /* Controller/switch message */
570 grouping get-async-reply {
571 // reference "OFPT_GET_ASYNC_REPLY message in Openflow Switch 1.3 Spec"
572 /* Controller/switch message */
576 leaf-list packet-in-mask {
577 type oft:packet-in-reason;
579 leaf-list port-status-mask {
580 type oft:port-reason;
582 leaf-list flow-removed-mask {
583 type oft:flow-removed-reason;
587 // reference "OFPT_SET_ASYNC message in Openflow Switch 1.3 Spec"
588 /* Controller/switch message */
592 leaf-list packet-in-mask {
593 type oft:packet-in-reason;
595 leaf-list port-status-mask {
596 type oft:port-reason;
598 leaf-list flow-removed-mask {
599 type oft:flow-removed-reason;
602 /* Meters and rate limiters configuration messages. */
604 // reference "OFPT_METER_MOD message in Openflow Switch 1.3 Spec"
605 /* Controller/switch message */
610 type oft:meter-mod-command;
613 type oft:meter-flags;
619 uses meter-band-header;
623 grouping meter-band-header {
625 type oft:meter-band-type;
637 /* Immutable messages. */
638 notification hello-message {
640 // reference "OFPT_HELLO message in Openflow Switch 1.3 Spec"
642 /* Symmetric message */
644 notification error-message {
646 // reference "OFPT_ERROR message in Openflow Switch 1.3 Spec"
648 /* Symmetric message */
650 notification echo-request-message {
652 // reference "OFPT_ECHO_REQUEST message in Openflow Switch 1.3 Spec"
654 /* Symmetric message */
656 notification experimenter-message {
658 // reference "OFPT_EXPERIMENTER message in Openflow Switch 1.3 Spec"
659 // TODO:: does switch send this when understood experimenter msg from lib?
660 /* Symmetric message */
662 // # Notification and RPCs
665 // reference "OFPT_ECHO_REQUEST message in Openflow Switch 1.3 Spec"
669 /* Controller/switch message */
676 // reference "OFPT_ECHO_REQUEST message in Openflow Switch 1.3 Spec"
683 // reference "OFPT_HELLO message in Openflow Switch 1.3 Spec"
690 // reference "OFPT_EXPERIMENTER message in Openflow Switch 1.3 Spec"
696 /* Switch configuration messages. */
698 // reference "OFPT_FEATURES_REQUEST message in Openflow Switch 1.3 Spec"
700 uses features-request;
702 /* Controller/switch message */
709 // reference "OFPT_GET_CONFIG_REQUEST message in Openflow Switch 1.3 Spec"
711 uses get-config-request;
714 uses get-config-reply;
716 /* Controller/switch message */
720 // reference "OFPT_SET_CONFIG message in Openflow Switch 1.3 Spec"
724 /* Controller/switch message */
726 /* Asynchronous messages. */
727 notification packet-in-message {
729 // reference "OFPT_PACKET_IN message in Openflow Switch 1.3 Spec"
733 notification flow-removed-message {
735 // reference "OFPT_FLOW_REMOVED message in Openflow Switch 1.3 Spec"
739 notification port-status-message {
741 // reference "OFPT_PORT_STATUS message in Openflow Switch 1.3 Spec"
743 } /* Async message */
745 /* Controller command messages. */
749 // reference "OFPT_PACKET_OUT message in Openflow Switch 1.3 Spec"
751 /* Controller/switch message */
756 // reference "OFPT_FLOW_MOD message in Openflow Switch 1.3 Spec"
758 /* Controller/switch message */
763 // reference "OFPT_GROUP_MOD message in Openflow Switch 1.3 Spec"
765 /* Controller/switch message */
770 // reference "OFPT_PORT_MOD message in Openflow Switch 1.3 Spec"
772 } /* Controller/switch message */
777 // reference "OFPT_TABLE_MOD message in Openflow Switch 1.3 Spec"
779 } /* Controller/switch message */
781 /* Multipart messages. */
782 //FIXME: Arent this wire protocol specific?
784 notification multipart-request-message {
785 uses multipart-request;
786 // reference "OFPT_MULTIPART_REQUEST message in Openflow Switch 1.3 Spec"
788 } /* Controller/switch message */
789 notification multipart-reply-message {
790 uses multipart-reply;
791 // reference "OFPT_MULTIPART_REPLY message in Openflow Switch 1.3 Spec"
793 } /* Controller/switch message */
796 /* Barrier messages. */
799 uses barrier-request;
800 // reference "OFPT_BARRIER_REQUEST message in Openflow Switch 1.3 Spec"
804 // reference "OFPT_BARRIER_REPLY message in Openflow Switch 1.3 Spec"
807 /* Queue Configuration messages. */
808 rpc get-queue-config {
810 uses queue-get-config-request;
811 // reference "OFPT_QUEUE_GET_CONFIG_REQUEST message in Openflow Switch 1.3 Spec"
814 uses queue-get-config-reply;
815 // reference "OFPT_QUEUE_GET_CONFIG_REPLY message in Openflow Switch 1.3 Spec"
819 /* Controller role change request messages. */
823 // reference "OFPT_ROLE_REQUEST message in Openflow Switch 1.3 Spec"
827 // reference "OFPT_ROLE_REPLY message in Openflow Switch 1.3 Spec"
829 } /* Controller/switch message */
831 /* Asynchronous message configuration. */
834 uses get-async-request;
835 // reference "OFPT_GET_ASYNC_REQUEST message in Openflow Switch 1.3 Spec"
838 uses get-async-reply;
839 // reference "OFPT_GET_ASYNC_REPLY message in Openflow Switch 1.3 Spec"
842 /* Controller/switch message */
846 // reference "OFPT_SET_ASYNC message in Openflow Switch 1.3 Spec"
850 /* Meters and rate limiters configuration messages. */
854 // reference "OFPT_METER_MOD message in Openflow Switch 1.3 Spec"
856 } /* Controller/switch message */