1 module openflow-types {
2 namespace "urn:opendaylight:openflow:common:types";
5 revision "2013-07-31" {
6 //description "OpenFlow 1.3 - common types model";
11 range "0..4294967040"; // 0xffffff00 See for actual value
15 typedef port-features {
16 ////description "Features of ports available in datapath.";
17 //reference "ofp_port_features";
21 //description "10 Mb half-duplex rate support.";
25 //description "10 Mb full-duplex rate support.";
29 //description "100 Mb half-duplex rate support.";
33 //description "100 Mb full-duplex rate support.";
37 //description "1 Gb half-duplex rate support.";
41 //description "1 Gb full-duplex rate support.";
45 //description "10 Gb full-duplex rate support.";
49 //description "40 Gb full-duplex rate support.";
53 //description "100 Gb full-duplex rate support.";
57 //description "1 Tb full-duplex rate support.";
61 //description "Other rate, not in the list.";
65 //description "Copper medium.";
69 //description "Fiber medium.";
73 //description "Auto-negotiation.";
77 //description "Pause.";
81 //description "Asymmetric pause.";
88 "Flags to indicate behavior of the physical port. These flags are
89 describe the current configuration and used port_mod message
90 to configure the port's behavior.";
93 //description " Port is administratively down.";
97 //description " Drop all packets received by port.";
101 //description " Drop packets forwarded to port.";
105 //description "Do not send packet-in msgs for port.";
113 "Current state of the physical port. These are not configurable from
117 //description "No physical link present.";
121 //description "Port is blocked";
125 //description "Live for Fast Failover Group.";
131 identity match-type-base {
133 "The match type indicates the match structure (set of fields that compose the
134 match) in use. The match type is placed in the type field at the beginning
135 of all match structures.Extensions that define match types may be
136 published on the ONF wiki. Support for extensions is optional.";
139 identity standard-match-type {
141 base oft:match-type-base;
144 typedef oxm-match-type {
146 base oft:match-type-base;
150 identity instruction {
181 description "Hello Protocol failed.";
185 description "Request was not understood.";
189 description "Error in action description.";
191 enum BAD_INSTRUCTION {
193 description "Error in instruction list.";
197 description "Error in match.";
199 enum FLOW_MOD_FAILED {
201 description "Problem modifying flow entry.";
203 enum GROUP_MOD_FAILED {
205 description "Problem modifying group entry.";
207 enum PORT_MOD_FAILED {
209 description "Port mod request failed.";
211 enum TABLE_MOD_FAILED {
213 description "Table mod request failed.";
215 enum QUEUE_OP_FAILED {
217 description "Queue operation failed.";
219 enum SWITCH_CONFIG_FAILED {
221 description "Switch config request failed.";
223 enum ROLE_REQUEST_FAILED {
225 description "Controller Role request failed.";
227 enum METER_MOD_FAILED {
229 description "Error in meter.";
231 enum TABLE_FEATURES_FAILED {
233 description "Setting table features failed.";
236 value 65535; //0xffff
237 description "Experimenter error messages.";
242 typedef hello-element-type {
246 description "Bitmap of version supported.";
251 typedef capabilities {
253 bit OFPC_FLOW_STATS {
255 /* Flow statistics. */
257 bit OFPC_TABLE_STATS {
259 /* Table statistics. */
261 bit OFPC_PORT_STATS {
263 /* Port statistics. */
265 bit OFPC_GROUP_STATS {
267 /* Group statistics. */
271 /* Can reassemble IP fragments. */
273 bit OFPC_QUEUE_STATS {
275 /* Queue statistics. */
277 bit OFPC_PORT_BLOCKED {
279 /* Switch will block looping ports. */
284 typedef switch-config-flag {
285 /* Handling of IP fragments. */
289 description "No special handling for fragments.";
291 enum OFPC_FRAG_DROP {
293 description "Drop fragments.";
295 enum OFPC_FRAG_REASM {
297 description "Reassemble (only if OFPC_IP_REASM set).";
299 enum OFPC_FRAG_MASK {
305 typedef flow-removed-reason {
308 enum OFPRR_IDLE_TIMEOUT {
310 description "Flow idle time exceeded idle_timeout.";
312 enum OFPRR_HARD_TIMEOUT {
314 description "Time exceeded hard_timeout.";
318 description "Evicted by a DELETE flow mod.";
320 enum OFPRR_GROUP_DELETE {
322 description "Group was removed.";
327 typedef port-reason {
332 description "The port was added.";
336 description "he port was removed.";
340 description "Some attribute of the port has changed.";
345 typedef flow-mod-command {
346 /* ofp_flow_mod_command */
350 description "New flow.";
354 description "Modify all matching flows.";
356 enum OFPFC_MODIFY_STRICT {
358 description "Modify entry strictly matching wildcards and priority.";
362 description "Delete all matching flows.";
364 enum OFPFC_DELETE_STRICT {
366 description "Delete entry strictly matching wildcards and priority.";
371 typedef flow-mod-flags {
372 /* ofp_flow_mod_flags */
374 bit OFPFF_SEND_FLOW_REM {
376 /* Send flow removed message when flow expires or is deleted. */
378 bit OFPFF_CHECK_OVERLAP {
380 /* Check for overlapping entries first. */
382 bit OFPFF_RESET_COUNTS {
384 /* Reset flow packet and byte counts. */
386 bit OFPFF_NO_PKT_COUNTS {
388 /* Don't keep track of packet count. */
390 bit OFPFF_NO_BYT_COUNTS {
392 /* Don't keep track of byte count. */
397 typedef group-mod-command {
398 /* ofp_group_mod_command */
402 description "New group.";
406 description "Modify all matching groups.";
410 description "Delete all matching groups.";
421 description "All (multicast/broadcast) group.";
425 description "Select group.";
427 enum OFPGT_INDIRECT {
429 description "Indirect group.";
433 description "Fast failover group.";
439 /* ofp_group - Group numbering. Groups can use any number up to OFPG_MAX.*/
442 value -256; //0xffffff00
443 description "Last usable group number";
448 value -4; //0xfffffffc
449 description "Represents all groups for group delete commands";
452 value -1; //0xffffffff
453 description "Wildcard group used only for flow stats requests.
454 Selects all flows regardless of group (including flows with no group)";
461 typedef multipart-request-flags {
463 "enum ofp_multipart_request_flags ";
465 bit OFPMPF_REQ_MORE {
466 //description "More requests to follow.";
472 typedef multipart-type {
473 /* ofp_multipart_type */
477 description "Description of this OpenFlow switch.
478 The request body is empty.
479 The reply body is struct ofp_desc.";
483 description "Individual flow statistics.
484 The request body is struct ofp_flow_stats_request.
485 The reply body is an array of struct ofp_flow_stats.";
487 enum OFPMP_AGGREGATE {
489 description "Aggregate flow statistics.
490 The request body is struct ofp_aggregate_stats_request.
491 The reply body is struct ofp_aggregate_stats_reply.";
495 description "Flow table statistics.
496 The request body is empty.
497 The reply body is an array of struct ofp_table_stats.";
499 enum OFPMP_PORT_STATS {
501 description "Port statistics.
502 The request body is struct ofp_port_stats_request.
503 The reply body is an array of struct ofp_port_stats.";
507 description "Queue statistics for a port
508 The request body is struct ofp_queue_stats_request.
509 The reply body is an array of struct ofp_queue_stats";
513 description "Group counter statistics.
514 The request body is struct ofp_group_stats_request.
515 The reply is an array of struct ofp_group_stats.";
517 enum OFPMP_GROUP_DESC {
519 description "Group description.
520 The request body is empty.
521 The reply body is an array of struct ofp_group_desc.";
523 enum OFPMP_GROUP_FEATURES {
525 description "Group features.
526 The request body is empty.
527 The reply body is struct ofp_group_features.";
531 description "Meter statistics.
532 The request body is struct ofp_meter_multipart_requests.
533 The reply body is an array of struct ofp_meter_stats.";
535 enum OFPMP_METER_CONFIG {
537 description "Meter configuration.
538 The request body is struct ofp_meter_multipart_requests.
539 The reply body is an array of struct ofp_meter_config.";
541 enum OFPMP_METER_FEATURES {
543 description "Meter features.
544 The request body is empty.
545 The reply body is struct ofp_meter_features.";
547 enum OFPMP_TABLE_FEATURES {
549 description "Table features.
550 The request body is either empty or contains an array of
551 struct ofp_table_features containing the controller’s
552 desired view of the switch. If the switch is unable to
553 set the specified view an error is returned.
554 The reply body is an array of struct ofp_table_features.";
556 enum OFPMP_PORT_DESC {
558 description "Port description.
559 The request body is empty.
560 The reply body is an array of struct ofp_port.";
562 enum OFPMP_EXPERIMENTER {
563 value 65535; //0xffff
564 description "Experimenter extension.
565 The request and reply bodies begin with
566 struct ofp_experimenter_multipart_header.
567 The request and reply bodies are otherwise experimenter-defined.";
572 typedef queue-properties {
573 /* ofp_queue_properties */
577 description "No property defined for queue (default).";
579 enum OFPQT_MIN_RATE {
581 description "Minimum datarate guaranteed.";
583 enum OFPQT_MAX_RATE {
585 description "Maximum datarate.";
587 enum OFPQT_EXPERIMENTER {
588 value 65535; // 0xffff
589 description "Experimenter defined property.";
594 typedef controller-role {
595 /* ofp_controller_role */
597 enum OFPCR_ROLE_NOCHANGE {
599 description "Don’t change current role.";
601 enum OFPCR_ROLE_EQUAL {
603 description "Default role, full access.";
605 enum OFPCR_ROLE_MASTER {
607 description "Full access, at most one master.";
609 enum OFPCR_ROLE_SLAVE {
611 description "Read-only access.";
616 typedef packet-in-reason {
617 /* ofp_packet_in_reason */
621 description "No matching flow (table-miss flow entry). ";
625 description "Action explicitly output to controller. ";
627 enum OFPR_INVALID_TTL {
629 description "Packet has invalid TTL ";
634 typedef action-type {
635 /* ofp_action_type */
639 /* Output to switch port. */
641 bit OFPAT_COPY_TTL_OUT {
643 /* Copy TTL "outwards" -- from next-to-outermost to outermost */
645 bit OFPAT_COPY_TTL_IN {
647 /* Copy TTL "inwards" -- from outermost to next-to-outermost */
649 bit OFPAT_SET_MPLS_TTL {
653 bit OFPAT_DEC_MPLS_TTL {
655 /* Decrement MPLS TTL */
657 bit OFPAT_PUSH_VLAN {
659 /* Push a new VLAN tag */
663 /* Pop the outer VLAN tag */
665 bit OFPAT_PUSH_MPLS {
667 /* Push a new MPLS tag */
671 /* Pop the outer MPLS tag */
673 bit OFPAT_SET_QUEUE {
675 /* Set queue id when outputting to a port */
681 bit OFPAT_SET_NW_TTL {
685 bit OFPAT_DEC_NW_TTL {
687 /* Decrement IP TTL. */
689 bit OFPAT_SET_FIELD {
691 /* Set a header field using OXM TLV format. */
695 /* Push a new PBB service tag (I-TAG) */
699 /* Pop the outer PBB service tag (I-TAG) */
701 bit OFPAT_EXPERIMENTER {
707 typedef meter-mod-command {
708 /* ofp_meter_mod_command */
711 description "New meter. ";
714 description "Modify specified meter. ";
717 description "Delete specified meter. ";
722 typedef meter-flags {
723 /* ofp_meter_flags */
727 /* Rate value in kb/s (kilo-bit per second). */
731 /* Rate value in packet/sec. */
739 /* Collect statistics. */
744 typedef meter-band-type {
745 /* ofp_meter_band_type */
749 description "Drop packet. ";
751 enum OFPMBT_DSCP_REMARK {
753 description "Remark DSCP in the IP header. ";
755 enum OFPMBT_EXPERIMENTER {
756 value 65535; //0xFFFF
757 description "Experimenter meter band. ";
763 /* ofp_meter - Meter numbering. Flow meters can use any number up to OFPM_MAX*/
766 value -65536; //0xffff0000
767 description "Last usable meter number";
770 /* Virtual meters. */
772 value -3; //0xfffffffd
773 description "Meter for slow datapath";
775 enum OFPM_CONTROLLER {
776 value -2; //0xfffffffe
777 description "Meter for controller connection";
780 value -1; //0xffffffff
781 description "Represents all meters for stat requests commands";
787 typedef table-config {
788 /* ofp_table_config */
790 bit OFPTC_DEPRECATED_MASK {
791 /* Deprecated bits */
797 typedef table-features-prop-type {
799 enum OFPTFPT_INSTRUCTIONS {
801 description "Instructions property.";
803 enum OFPTFPT_INSTRUCTIONS_MISS {
805 description "Instructions for table-miss.";
807 enum OFPTFPT_NEXT_TABLES {
809 description "Next Table property.";
811 enum OFPTFPT_NEXT_TABLES_MISS {
813 description "Next Table for table-miss.";
815 enum OFPTFPT_WRITE_ACTIONS {
817 description "Write Actions property.";
819 enum OFPTFPT_WRITE_ACTIONS_MISS {
821 description "Write Actions for table-miss.";
823 enum OFPTFPT_APPLY_ACTIONS {
825 description "Apply Actions property.";
827 enum OFPTFPT_APPLY_ACTIONS_MISS {
829 description "Apply Actions for table-miss.";
833 description "Match property.";
835 enum OFPTFPT_WILDCARDS {
837 description "Wildcards property.";
839 enum OFPTFPT_WRITE_SETFIELD {
841 description "Write Set-Field property.";
843 enum OFPTFPT_WRITE_SETFIELD_MISS {
845 description "Write Set-Field for table-miss.";
847 enum OFPTFPT_APPLY_SETFIELD {
849 description "Apply Set-Field property.";
851 enum OFPTFPT_APPLY_SETFIELD_MISS {
853 description "Apply Set-Field for table-miss.";
855 enum OFPTFPT_EXPERIMENTER {
857 description "Experimenter property.";
859 enum OFPTFPT_EXPERIMENTER_MISS {
860 value 65535; //0xffff
861 description "Experimenter for table-miss.";
866 typedef group-types {
870 /* All (multicast/broadcast) group. */
878 /* Indirect group. */
882 /* Fast failover group. */
888 typedef group-capabilities {
889 /* ofp_group_capabilities */
891 bit OFPGFC_SELECT_WEIGHT {
892 /* Support weight for select groups */
895 bit OFPGFC_SELECT_LIVENESS {
896 /* Support liveness for select groups */
899 bit OFPGFC_CHAINING {
900 /* Support chaining groups */
903 bit OFPGFC_CHAINING_CHECKS {
904 /* Check chaining for loops and delete */
910 // OPENFLOW v1.0 STRUCTURES
911 // Structures under this line are needed to support OpenFlow version 1.0
912 // wire protocol 0x01;
914 typedef port-config-v10 {
916 "Flags to indicate behavior of the physical port. These flags are
917 describe the current configuration and used port_mod message
918 to configure the port's behavior.";
921 //description " Port is administratively down.";
925 //description" Disable 802.1D spanning tree on port.";
929 //description " Drop all packets received by port.";
933 //description " Drop received 802.1D STP packets.";
937 //description " Do not include this port when flooding.";
941 //description " Drop packets forwarded to port.";
945 //description "Do not send packet-in msgs for port.";
951 typedef port-state-v10 {
953 "Current state of the physical port. These are not configurable from
957 //description "No physical link present.";
961 //description "Port is blocked";
965 //description "Live for Fast Failover Group.";
969 //description "Live for Fast Failover Group.";
973 //description "Live for Fast Failover Group.";
977 //description "Live for Fast Failover Group.";
981 //description "Live for Fast Failover Group.";
985 //description "Live for Fast Failover Group.";
991 typedef port-features-v10 {
992 ////description "Features of ports available in datapath.";
993 //reference "ofp_port_features";
997 //description "10 Mb half-duplex rate support.";
1001 //description "10 Mb full-duplex rate support.";
1005 //description "100 Mb half-duplex rate support.";
1009 //description "100 Mb full-duplex rate support.";
1013 //description "1 Gb half-duplex rate support.";
1017 //description "1 Gb full-duplex rate support.";
1021 //description "10 Gb full-duplex rate support.";
1025 //description "Copper medium.";
1029 //description "Fiber medium.";
1033 //description "Auto-negotiation.";
1037 //description "Pause.";
1041 //description "Asymmetric pause.";
1046 typedef capabilities-v10 {
1048 bit OFPC_FLOW_STATS {
1050 /* Flow statistics. */
1052 bit OFPC_TABLE_STATS {
1054 /* Table statistics. */
1056 bit OFPC_PORT_STATS {
1058 /* Port statistics. */
1062 /* 802.1d spanning tree. */
1066 /* Reserved, must be zero. */
1070 /* Can reassemble IP fragments. */
1072 bit OFPC_QUEUE_STATS {
1074 /* Queue statistics. */
1076 bit OFPC_ARP_MATCH_IP {
1078 /* Match IP addresses in ARP pkts. */
1083 typedef flow-mod-flags-v10 {
1084 /* ofp_flow_mod_flags */
1086 bit OFPFF_SEND_FLOW_REM {
1088 /* Send flow removed message when flow expires or is deleted. */
1090 bit OFPFF_CHECK_OVERLAP {
1092 /* Check for overlapping entries first. */
1096 /* Reset flow packet and byte counts. */
1101 typedef action-type-v10 {
1102 /* ofp_action_type */
1106 /* Output to switch port. */
1108 bit OFPAT_SET_VLAN_VID {
1110 /* Set the 802.1q VLAN id. */
1112 bit OFPAT_SET_VLAN_PCP {
1114 /* Set the 802.1q priority. */
1116 bit OFPAT_STRIP_VLAN {
1118 /* Strip the 802.1q header. */
1120 bit OFPAT_SET_DL_SRC {
1122 /* Ethernet source address. */
1124 bit OFPAT_SET_DL_DST {
1126 /* Ethernet destination address. */
1128 bit OFPAT_SET_NW_SRC {
1130 /* IP source address. */
1132 bit OFPAT_SET_NW_DST {
1134 /* IP destination address. */
1136 bit OFPAT_SET_NW_TOS {
1138 /* IP ToS (DSCP field, 6 bits). */
1140 bit OFPAT_SET_TP_SRC {
1142 /* TCP/UDP source port. */
1144 bit OFPAT_SET_TP_DST {
1146 /* TCP/UDP destination port. */
1150 /* Output to queue. */
1154 /* Experimenter in later versions */
1159 typedef error-type-v10 {
1163 description "Hello Protocol failed.";
1167 description "Request was not understood.";
1171 description "Error in action description.";
1173 enum FLOW_MOD_FAILED {
1175 description "Problem modifying flow entry.";
1177 enum PORT_MOD_FAILED {
1179 description "Port mod request failed.";
1181 enum QUEUE_OP_FAILED {
1183 description "Queue operation failed.";