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.";
438 typedef multipart-request-flags {
440 "enum ofp_multipart_request_flags ";
442 bit OFPMPF_REQ_MORE {
443 //description "More requests to follow.";
449 typedef multipart-type {
450 /* ofp_multipart_type */
454 description "Description of this OpenFlow switch.
455 The request body is empty.
456 The reply body is struct ofp_desc.";
460 description "Individual flow statistics.
461 The request body is struct ofp_flow_stats_request.
462 The reply body is an array of struct ofp_flow_stats.";
464 enum OFPMP_AGGREGATE {
466 description "Aggregate flow statistics.
467 The request body is struct ofp_aggregate_stats_request.
468 The reply body is struct ofp_aggregate_stats_reply.";
472 description "Flow table statistics.
473 The request body is empty.
474 The reply body is an array of struct ofp_table_stats.";
476 enum OFPMP_PORT_STATS {
478 description "Port statistics.
479 The request body is struct ofp_port_stats_request.
480 The reply body is an array of struct ofp_port_stats.";
484 description "Queue statistics for a port
485 The request body is struct ofp_queue_stats_request.
486 The reply body is an array of struct ofp_queue_stats";
490 description "Group counter statistics.
491 The request body is struct ofp_group_stats_request.
492 The reply is an array of struct ofp_group_stats.";
494 enum OFPMP_GROUP_DESC {
496 description "Group description.
497 The request body is empty.
498 The reply body is an array of struct ofp_group_desc.";
500 enum OFPMP_GROUP_FEATURES {
502 description "Group features.
503 The request body is empty.
504 The reply body is struct ofp_group_features.";
508 description "Meter statistics.
509 The request body is struct ofp_meter_multipart_requests.
510 The reply body is an array of struct ofp_meter_stats.";
512 enum OFPMP_METER_CONFIG {
514 description "Meter configuration.
515 The request body is struct ofp_meter_multipart_requests.
516 The reply body is an array of struct ofp_meter_config.";
518 enum OFPMP_METER_FEATURES {
520 description "Meter features.
521 The request body is empty.
522 The reply body is struct ofp_meter_features.";
524 enum OFPMP_TABLE_FEATURES {
526 description "Table features.
527 The request body is either empty or contains an array of
528 struct ofp_table_features containing the controller’s
529 desired view of the switch. If the switch is unable to
530 set the specified view an error is returned.
531 The reply body is an array of struct ofp_table_features.";
533 enum OFPMP_PORT_DESC {
535 description "Port description.
536 The request body is empty.
537 The reply body is an array of struct ofp_port.";
539 enum OFPMP_EXPERIMENTER {
540 value 65535; //0xffff
541 description "Experimenter extension.
542 The request and reply bodies begin with
543 struct ofp_experimenter_multipart_header.
544 The request and reply bodies are otherwise experimenter-defined.";
549 typedef queue-properties {
550 /* ofp_queue_properties */
554 description "No property defined for queue (default).";
556 enum OFPQT_MIN_RATE {
558 description "Minimum datarate guaranteed.";
560 enum OFPQT_MAX_RATE {
562 description "Maximum datarate.";
564 enum OFPQT_EXPERIMENTER {
565 value 65535; // 0xffff
566 description "Experimenter defined property.";
571 typedef controller-role {
572 /* ofp_controller_role */
574 enum OFPCR_ROLE_NOCHANGE {
576 description "Don’t change current role.";
578 enum OFPCR_ROLE_EQUAL {
580 description "Default role, full access.";
582 enum OFPCR_ROLE_MASTER {
584 description "Full access, at most one master.";
586 enum OFPCR_ROLE_SLAVE {
588 description "Read-only access.";
593 typedef packet-in-reason {
594 /* ofp_packet_in_reason */
598 description "No matching flow (table-miss flow entry). ";
602 description "Action explicitly output to controller. ";
604 enum OFPR_INVALID_TTL {
606 description "Packet has invalid TTL ";
611 typedef action-type {
612 /* ofp_action_type */
616 /* Output to switch port. */
618 bit OFPAT_COPY_TTL_OUT {
620 /* Copy TTL "outwards" -- from next-to-outermost to outermost */
622 bit OFPAT_COPY_TTL_IN {
624 /* Copy TTL "inwards" -- from outermost to next-to-outermost */
626 bit OFPAT_SET_MPLS_TTL {
630 bit OFPAT_DEC_MPLS_TTL {
632 /* Decrement MPLS TTL */
634 bit OFPAT_PUSH_VLAN {
636 /* Push a new VLAN tag */
640 /* Pop the outer VLAN tag */
642 bit OFPAT_PUSH_MPLS {
644 /* Push a new MPLS tag */
648 /* Pop the outer MPLS tag */
650 bit OFPAT_SET_QUEUE {
652 /* Set queue id when outputting to a port */
658 bit OFPAT_SET_NW_TTL {
662 bit OFPAT_DEC_NW_TTL {
664 /* Decrement IP TTL. */
666 bit OFPAT_SET_FIELD {
668 /* Set a header field using OXM TLV format. */
672 /* Push a new PBB service tag (I-TAG) */
676 /* Pop the outer PBB service tag (I-TAG) */
678 bit OFPAT_EXPERIMENTER {
684 typedef meter-mod-command {
685 /* ofp_meter_mod_command */
688 description "New meter. ";
691 description "Modify specified meter. ";
694 description "Delete specified meter. ";
699 typedef meter-flags {
700 /* ofp_meter_flags */
704 /* Rate value in kb/s (kilo-bit per second). */
708 /* Rate value in packet/sec. */
716 /* Collect statistics. */
721 typedef meter-band-type {
722 /* ofp_meter_band_type */
726 description "Drop packet. ";
728 enum OFPMBT_DSCP_REMARK {
730 description "Remark DSCP in the IP header. ";
732 enum OFPMBT_EXPERIMENTER {
733 value 65535; //0xFFFF
734 description "Experimenter meter band. ";
739 typedef table-config {
740 /* ofp_table_config */
742 bit OFPTC_DEPRECATED_MASK {
743 /* Deprecated bits */
749 typedef table-features-prop-type {
751 enum OFPTFPT_INSTRUCTIONS {
753 description "Instructions property.";
755 enum OFPTFPT_INSTRUCTIONS_MISS {
757 description "Instructions for table-miss.";
759 enum OFPTFPT_NEXT_TABLES {
761 description "Next Table property.";
763 enum OFPTFPT_NEXT_TABLES_MISS {
765 description "Next Table for table-miss.";
767 enum OFPTFPT_WRITE_ACTIONS {
769 description "Write Actions property.";
771 enum OFPTFPT_WRITE_ACTIONS_MISS {
773 description "Write Actions for table-miss.";
775 enum OFPTFPT_APPLY_ACTIONS {
777 description "Apply Actions property.";
779 enum OFPTFPT_APPLY_ACTIONS_MISS {
781 description "Apply Actions for table-miss.";
785 description "Match property.";
787 enum OFPTFPT_WILDCARDS {
789 description "Wildcards property.";
791 enum OFPTFPT_WRITE_SETFIELD {
793 description "Write Set-Field property.";
795 enum OFPTFPT_WRITE_SETFIELD_MISS {
797 description "Write Set-Field for table-miss.";
799 enum OFPTFPT_APPLY_SETFIELD {
801 description "Apply Set-Field property.";
803 enum OFPTFPT_APPLY_SETFIELD_MISS {
805 description "Apply Set-Field for table-miss.";
807 enum OFPTFPT_EXPERIMENTER {
809 description "Experimenter property.";
811 enum OFPTFPT_EXPERIMENTER_MISS {
812 value 65535; //0xffff
813 description "Experimenter for table-miss.";
818 typedef group-types {
822 /* All (multicast/broadcast) group. */
830 /* Indirect group. */
834 /* Fast failover group. */
840 typedef group-capabilities {
841 /* ofp_group_capabilities */
843 bit OFPGFC_SELECT_WEIGHT {
844 /* Support weight for select groups */
847 bit OFPGFC_SELECT_LIVENESS {
848 /* Support liveness for select groups */
851 bit OFPGFC_CHAINING {
852 /* Support chaining groups */
855 bit OFPGFC_CHAINING_CHECKS {
856 /* Check chaining for loops and delete */
862 // OPENFLOW v1.0 STRUCTURES
863 // Structures under this line are needed to support OpenFlow version 1.0
864 // wire protocol 0x01;
866 typedef port-config-v10 {
868 "Flags to indicate behavior of the physical port. These flags are
869 describe the current configuration and used port_mod message
870 to configure the port's behavior.";
873 //description " Port is administratively down.";
877 //description" Disable 802.1D spanning tree on port.";
881 //description " Drop all packets received by port.";
885 //description " Drop received 802.1D STP packets.";
889 //description " Do not include this port when flooding.";
893 //description " Drop packets forwarded to port.";
897 //description "Do not send packet-in msgs for port.";
903 typedef port-state-v10 {
905 "Current state of the physical port. These are not configurable from
909 //description "No physical link present.";
913 //description "Port is blocked";
917 //description "Live for Fast Failover Group.";
921 //description "Live for Fast Failover Group.";
925 //description "Live for Fast Failover Group.";
929 //description "Live for Fast Failover Group.";
933 //description "Live for Fast Failover Group.";
937 //description "Live for Fast Failover Group.";
943 typedef port-features-v10 {
944 ////description "Features of ports available in datapath.";
945 //reference "ofp_port_features";
949 //description "10 Mb half-duplex rate support.";
953 //description "10 Mb full-duplex rate support.";
957 //description "100 Mb half-duplex rate support.";
961 //description "100 Mb full-duplex rate support.";
965 //description "1 Gb half-duplex rate support.";
969 //description "1 Gb full-duplex rate support.";
973 //description "10 Gb full-duplex rate support.";
977 //description "Copper medium.";
981 //description "Fiber medium.";
985 //description "Auto-negotiation.";
989 //description "Pause.";
993 //description "Asymmetric pause.";
998 typedef capabilities-v10 {
1000 bit OFPC_FLOW_STATS {
1002 /* Flow statistics. */
1004 bit OFPC_TABLE_STATS {
1006 /* Table statistics. */
1008 bit OFPC_PORT_STATS {
1010 /* Port statistics. */
1014 /* 802.1d spanning tree. */
1018 /* Reserved, must be zero. */
1022 /* Can reassemble IP fragments. */
1024 bit OFPC_QUEUE_STATS {
1026 /* Queue statistics. */
1028 bit OFPC_ARP_MATCH_IP {
1030 /* Match IP addresses in ARP pkts. */
1035 typedef flow-mod-flags-v10 {
1036 /* ofp_flow_mod_flags */
1038 bit OFPFF_SEND_FLOW_REM {
1040 /* Send flow removed message when flow expires or is deleted. */
1042 bit OFPFF_CHECK_OVERLAP {
1044 /* Check for overlapping entries first. */
1048 /* Reset flow packet and byte counts. */
1053 typedef action-type-v10 {
1054 /* ofp_action_type */
1058 /* Output to switch port. */
1060 bit OFPAT_SET_VLAN_VID {
1062 /* Set the 802.1q VLAN id. */
1064 bit OFPAT_SET_VLAN_PCP {
1066 /* Set the 802.1q priority. */
1068 bit OFPAT_STRIP_VLAN {
1070 /* Strip the 802.1q header. */
1072 bit OFPAT_SET_DL_SRC {
1074 /* Ethernet source address. */
1076 bit OFPAT_SET_DL_DST {
1078 /* Ethernet destination address. */
1080 bit OFPAT_SET_NW_SRC {
1082 /* IP source address. */
1084 bit OFPAT_SET_NW_DST {
1086 /* IP destination address. */
1088 bit OFPAT_SET_NW_TOS {
1090 /* IP ToS (DSCP field, 6 bits). */
1092 bit OFPAT_SET_TP_SRC {
1094 /* TCP/UDP source port. */
1096 bit OFPAT_SET_TP_DST {
1098 /* TCP/UDP destination port. */
1102 /* Output to queue. */
1106 /* Experimenter in later versions */
1111 typedef error-type-v10 {
1115 description "Hello Protocol failed.";
1119 description "Request was not understood.";
1123 description "Error in action description.";
1125 enum FLOW_MOD_FAILED {
1127 description "Problem modifying flow entry.";
1129 enum PORT_MOD_FAILED {
1131 description "Port mod request failed.";
1133 enum QUEUE_OP_FAILED {
1135 description "Queue operation failed.";