1 module openflow-types {
2 namespace "urn:opendaylight:openflow:common:types";
5 revision "2013-07-31" {
6 //description "OpenFlow 1.3 - common types model";
13 typedef port-number-values {
16 value -256; // 0xffffff00
17 description "Hello Protocol failed.";
20 value -8; // 0xfffffff8
21 description "Request was not understood.";
24 value -7; // 0xfffffff9
25 description "Error in action description.";
28 value -6; // 0xfffffffa
29 description "Error in instruction list.";
32 value -5; // 0xfffffffb
33 description "Error in match.";
36 value -4; // 0xfffffffc
37 description "Problem modifying flow entry.";
40 value -3; // 0xfffffffd
41 description "Problem modifying group entry.";
44 value -2; // 0xfffffffe
45 description "Port mod request failed.";
48 value -1; // 0xffffffff
49 description "Table mod request failed.";
54 typedef port-features {
55 ////description "Features of ports available in datapath.";
56 //reference "ofp_port_features";
60 //description "10 Mb half-duplex rate support.";
64 //description "10 Mb full-duplex rate support.";
68 //description "100 Mb half-duplex rate support.";
72 //description "100 Mb full-duplex rate support.";
76 //description "1 Gb half-duplex rate support.";
80 //description "1 Gb full-duplex rate support.";
84 //description "10 Gb full-duplex rate support.";
88 //description "40 Gb full-duplex rate support.";
92 //description "100 Gb full-duplex rate support.";
96 //description "1 Tb full-duplex rate support.";
100 //description "Other rate, not in the list.";
104 //description "Copper medium.";
108 //description "Fiber medium.";
112 //description "Auto-negotiation.";
116 //description "Pause.";
120 //description "Asymmetric pause.";
125 typedef port-config {
127 "Flags to indicate behavior of the physical port. These flags are
128 describe the current configuration and used port_mod message
129 to configure the port's behavior.";
132 //description " Port is administratively down.";
136 //description " Drop all packets received by port.";
140 //description " Drop packets forwarded to port.";
144 //description "Do not send packet-in msgs for port.";
152 "Current state of the physical port. These are not configurable from
156 //description "No physical link present.";
160 //description "Port is blocked";
164 //description "Live for Fast Failover Group.";
170 identity match-type-base {
172 "The match type indicates the match structure (set of fields that compose the
173 match) in use. The match type is placed in the type field at the beginning
174 of all match structures.Extensions that define match types may be
175 published on the ONF wiki. Support for extensions is optional.";
178 identity standard-match-type {
180 base oft:match-type-base;
183 typedef oxm-match-type {
185 base oft:match-type-base;
189 identity instruction {
220 description "Hello Protocol failed.";
224 description "Request was not understood.";
228 description "Error in action description.";
230 enum BAD_INSTRUCTION {
232 description "Error in instruction list.";
236 description "Error in match.";
238 enum FLOW_MOD_FAILED {
240 description "Problem modifying flow entry.";
242 enum GROUP_MOD_FAILED {
244 description "Problem modifying group entry.";
246 enum PORT_MOD_FAILED {
248 description "Port mod request failed.";
250 enum TABLE_MOD_FAILED {
252 description "Table mod request failed.";
254 enum QUEUE_OP_FAILED {
256 description "Queue operation failed.";
258 enum SWITCH_CONFIG_FAILED {
260 description "Switch config request failed.";
262 enum ROLE_REQUEST_FAILED {
264 description "Controller Role request failed.";
266 enum METER_MOD_FAILED {
268 description "Error in meter.";
270 enum TABLE_FEATURES_FAILED {
272 description "Setting table features failed.";
275 value 65535; //0xffff
276 description "Experimenter error messages.";
281 typedef hello-element-type {
285 description "Bitmap of version supported.";
290 typedef capabilities {
292 bit OFPC_FLOW_STATS {
294 /* Flow statistics. */
296 bit OFPC_TABLE_STATS {
298 /* Table statistics. */
300 bit OFPC_PORT_STATS {
302 /* Port statistics. */
304 bit OFPC_GROUP_STATS {
306 /* Group statistics. */
310 /* Can reassemble IP fragments. */
312 bit OFPC_QUEUE_STATS {
314 /* Queue statistics. */
316 bit OFPC_PORT_BLOCKED {
318 /* Switch will block looping ports. */
323 typedef switch-config-flag {
324 /* Handling of IP fragments. */
328 description "No special handling for fragments.";
330 enum OFPC_FRAG_DROP {
332 description "Drop fragments.";
334 enum OFPC_FRAG_REASM {
336 description "Reassemble (only if OFPC_IP_REASM set).";
338 enum OFPC_FRAG_MASK {
344 typedef flow-removed-reason {
347 enum OFPRR_IDLE_TIMEOUT {
349 description "Flow idle time exceeded idle_timeout.";
351 enum OFPRR_HARD_TIMEOUT {
353 description "Time exceeded hard_timeout.";
357 description "Evicted by a DELETE flow mod.";
359 enum OFPRR_GROUP_DELETE {
361 description "Group was removed.";
366 typedef port-reason {
371 description "The port was added.";
375 description "he port was removed.";
379 description "Some attribute of the port has changed.";
384 typedef flow-mod-command {
385 /* ofp_flow_mod_command */
389 description "New flow.";
393 description "Modify all matching flows.";
395 enum OFPFC_MODIFY_STRICT {
397 description "Modify entry strictly matching wildcards and priority.";
401 description "Delete all matching flows.";
403 enum OFPFC_DELETE_STRICT {
405 description "Delete entry strictly matching wildcards and priority.";
410 typedef flow-mod-flags {
411 /* ofp_flow_mod_flags */
413 bit OFPFF_SEND_FLOW_REM {
415 /* Send flow removed message when flow expires or is deleted. */
417 bit OFPFF_CHECK_OVERLAP {
419 /* Check for overlapping entries first. */
421 bit OFPFF_RESET_COUNTS {
423 /* Reset flow packet and byte counts. */
425 bit OFPFF_NO_PKT_COUNTS {
427 /* Don't keep track of packet count. */
429 bit OFPFF_NO_BYT_COUNTS {
431 /* Don't keep track of byte count. */
436 typedef group-mod-command {
437 /* ofp_group_mod_command */
441 description "New group.";
445 description "Modify all matching groups.";
449 description "Delete all matching groups.";
460 description "All (multicast/broadcast) group.";
464 description "Select group.";
466 enum OFPGT_INDIRECT {
468 description "Indirect group.";
472 description "Fast failover group.";
478 /* ofp_group - Group numbering. Groups can use any number up to OFPG_MAX.*/
481 value -256; //0xffffff00
482 description "Last usable group number";
487 value -4; //0xfffffffc
488 description "Represents all groups for group delete commands";
491 value -1; //0xffffffff
492 description "Wildcard group used only for flow stats requests.
493 Selects all flows regardless of group (including flows with no group)";
500 typedef multipart-request-flags {
502 "enum ofp_multipart_request_flags ";
504 bit OFPMPF_REQ_MORE {
505 //description "More requests to follow.";
511 typedef multipart-type {
512 /* ofp_multipart_type */
516 description "Description of this OpenFlow switch.
517 The request body is empty.
518 The reply body is struct ofp_desc.";
522 description "Individual flow statistics.
523 The request body is struct ofp_flow_stats_request.
524 The reply body is an array of struct ofp_flow_stats.";
526 enum OFPMP_AGGREGATE {
528 description "Aggregate flow statistics.
529 The request body is struct ofp_aggregate_stats_request.
530 The reply body is struct ofp_aggregate_stats_reply.";
534 description "Flow table statistics.
535 The request body is empty.
536 The reply body is an array of struct ofp_table_stats.";
538 enum OFPMP_PORT_STATS {
540 description "Port statistics.
541 The request body is struct ofp_port_stats_request.
542 The reply body is an array of struct ofp_port_stats.";
546 description "Queue statistics for a port
547 The request body is struct ofp_queue_stats_request.
548 The reply body is an array of struct ofp_queue_stats";
552 description "Group counter statistics.
553 The request body is struct ofp_group_stats_request.
554 The reply is an array of struct ofp_group_stats.";
556 enum OFPMP_GROUP_DESC {
558 description "Group description.
559 The request body is empty.
560 The reply body is an array of struct ofp_group_desc.";
562 enum OFPMP_GROUP_FEATURES {
564 description "Group features.
565 The request body is empty.
566 The reply body is struct ofp_group_features.";
570 description "Meter statistics.
571 The request body is struct ofp_meter_multipart_requests.
572 The reply body is an array of struct ofp_meter_stats.";
574 enum OFPMP_METER_CONFIG {
576 description "Meter configuration.
577 The request body is struct ofp_meter_multipart_requests.
578 The reply body is an array of struct ofp_meter_config.";
580 enum OFPMP_METER_FEATURES {
582 description "Meter features.
583 The request body is empty.
584 The reply body is struct ofp_meter_features.";
586 enum OFPMP_TABLE_FEATURES {
588 description "Table features.
589 The request body is either empty or contains an array of
590 struct ofp_table_features containing the controller’s
591 desired view of the switch. If the switch is unable to
592 set the specified view an error is returned.
593 The reply body is an array of struct ofp_table_features.";
595 enum OFPMP_PORT_DESC {
597 description "Port description.
598 The request body is empty.
599 The reply body is an array of struct ofp_port.";
601 enum OFPMP_EXPERIMENTER {
602 value 65535; //0xffff
603 description "Experimenter extension.
604 The request and reply bodies begin with
605 struct ofp_experimenter_multipart_header.
606 The request and reply bodies are otherwise experimenter-defined.";
611 typedef queue-properties {
612 /* ofp_queue_properties */
616 description "No property defined for queue (default).";
618 enum OFPQT_MIN_RATE {
620 description "Minimum datarate guaranteed.";
622 enum OFPQT_MAX_RATE {
624 description "Maximum datarate.";
626 enum OFPQT_EXPERIMENTER {
627 value 65535; // 0xffff
628 description "Experimenter defined property.";
633 typedef controller-role {
634 /* ofp_controller_role */
636 enum OFPCR_ROLE_NOCHANGE {
638 description "Don’t change current role.";
640 enum OFPCR_ROLE_EQUAL {
642 description "Default role, full access.";
644 enum OFPCR_ROLE_MASTER {
646 description "Full access, at most one master.";
648 enum OFPCR_ROLE_SLAVE {
650 description "Read-only access.";
655 typedef packet-in-reason {
656 /* ofp_packet_in_reason */
660 description "No matching flow (table-miss flow entry). ";
664 description "Action explicitly output to controller. ";
666 enum OFPR_INVALID_TTL {
668 description "Packet has invalid TTL ";
673 typedef action-type {
674 /* ofp_action_type */
678 /* Output to switch port. */
680 bit OFPAT_COPY_TTL_OUT {
682 /* Copy TTL "outwards" -- from next-to-outermost to outermost */
684 bit OFPAT_COPY_TTL_IN {
686 /* Copy TTL "inwards" -- from outermost to next-to-outermost */
688 bit OFPAT_SET_MPLS_TTL {
692 bit OFPAT_DEC_MPLS_TTL {
694 /* Decrement MPLS TTL */
696 bit OFPAT_PUSH_VLAN {
698 /* Push a new VLAN tag */
702 /* Pop the outer VLAN tag */
704 bit OFPAT_PUSH_MPLS {
706 /* Push a new MPLS tag */
710 /* Pop the outer MPLS tag */
712 bit OFPAT_SET_QUEUE {
714 /* Set queue id when outputting to a port */
720 bit OFPAT_SET_NW_TTL {
724 bit OFPAT_DEC_NW_TTL {
726 /* Decrement IP TTL. */
728 bit OFPAT_SET_FIELD {
730 /* Set a header field using OXM TLV format. */
734 /* Push a new PBB service tag (I-TAG) */
738 /* Pop the outer PBB service tag (I-TAG) */
740 bit OFPAT_EXPERIMENTER {
746 typedef meter-mod-command {
747 /* ofp_meter_mod_command */
750 description "New meter. ";
753 description "Modify specified meter. ";
756 description "Delete specified meter. ";
761 typedef meter-flags {
762 /* ofp_meter_flags */
766 /* Rate value in kb/s (kilo-bit per second). */
770 /* Rate value in packet/sec. */
778 /* Collect statistics. */
783 typedef meter-band-type {
784 /* ofp_meter_band_type */
788 description "Drop packet. ";
790 enum OFPMBT_DSCP_REMARK {
792 description "Remark DSCP in the IP header. ";
794 enum OFPMBT_EXPERIMENTER {
795 value 65535; //0xFFFF
796 description "Experimenter meter band. ";
801 typedef meter-band-type-bitmap {
802 /* ofp_meter_band_type */
806 description "Drop packet. ";
808 bit OFPMBT_DSCP_REMARK {
810 description "Remark DSCP in the IP header. ";
816 /* ofp_meter - Meter numbering. Flow meters can use any number up to OFPM_MAX*/
819 value -65536; //0xffff0000
820 description "Last usable meter number";
823 /* Virtual meters. */
825 value -3; //0xfffffffd
826 description "Meter for slow datapath";
828 enum OFPM_CONTROLLER {
829 value -2; //0xfffffffe
830 description "Meter for controller connection";
833 value -1; //0xffffffff
834 description "Represents all meters for stat requests commands";
840 typedef table-config {
841 /* ofp_table_config */
843 bit OFPTC_DEPRECATED_MASK {
844 /* Deprecated bits */
850 typedef table-features-prop-type {
852 enum OFPTFPT_INSTRUCTIONS {
854 description "Instructions property.";
856 enum OFPTFPT_INSTRUCTIONS_MISS {
858 description "Instructions for table-miss.";
860 enum OFPTFPT_NEXT_TABLES {
862 description "Next Table property.";
864 enum OFPTFPT_NEXT_TABLES_MISS {
866 description "Next Table for table-miss.";
868 enum OFPTFPT_WRITE_ACTIONS {
870 description "Write Actions property.";
872 enum OFPTFPT_WRITE_ACTIONS_MISS {
874 description "Write Actions for table-miss.";
876 enum OFPTFPT_APPLY_ACTIONS {
878 description "Apply Actions property.";
880 enum OFPTFPT_APPLY_ACTIONS_MISS {
882 description "Apply Actions for table-miss.";
886 description "Match property.";
888 enum OFPTFPT_WILDCARDS {
890 description "Wildcards property.";
892 enum OFPTFPT_WRITE_SETFIELD {
894 description "Write Set-Field property.";
896 enum OFPTFPT_WRITE_SETFIELD_MISS {
898 description "Write Set-Field for table-miss.";
900 enum OFPTFPT_APPLY_SETFIELD {
902 description "Apply Set-Field property.";
904 enum OFPTFPT_APPLY_SETFIELD_MISS {
906 description "Apply Set-Field for table-miss.";
908 enum OFPTFPT_EXPERIMENTER {
910 description "Experimenter property.";
912 enum OFPTFPT_EXPERIMENTER_MISS {
913 value 65535; //0xffff
914 description "Experimenter for table-miss.";
919 typedef group-types {
923 /* All (multicast/broadcast) group. */
931 /* Indirect group. */
935 /* Fast failover group. */
941 typedef group-capabilities {
942 /* ofp_group_capabilities */
944 bit OFPGFC_SELECT_WEIGHT {
945 /* Support weight for select groups */
948 bit OFPGFC_SELECT_LIVENESS {
949 /* Support liveness for select groups */
952 bit OFPGFC_CHAINING {
953 /* Support chaining groups */
956 bit OFPGFC_CHAINING_CHECKS {
957 /* Check chaining for loops and delete */
963 // OPENFLOW v1.0 STRUCTURES
964 // Structures under this line are needed to support OpenFlow version 1.0
965 // wire protocol 0x01;
967 typedef port-number-values-v10 {
970 value 65280; // 0xff00
971 description "Hello Protocol failed.";
974 value 65528; // 0xfff8
975 description "Request was not understood.";
978 value 65529; // 0xfff9
979 description "Error in action description.";
982 value 65530; // 0xfffa
983 description "Error in instruction list.";
986 value 65531; // 0xfffb
987 description "Error in match.";
990 value 65532; // 0xfffc
991 description "Problem modifying flow entry.";
994 value 65533; // 0xfffd
995 description "Problem modifying group entry.";
998 value 65534; // 0xfffe
999 description "Port mod request failed.";
1002 value 65535; // 0xffff
1003 description "Table mod request failed.";
1008 typedef port-config-v10 {
1010 "Flags to indicate behavior of the physical port. These flags are
1011 describe the current configuration and used port_mod message
1012 to configure the port's behavior.";
1015 //description " Port is administratively down.";
1019 //description" Disable 802.1D spanning tree on port.";
1023 //description " Drop all packets received by port.";
1027 //description " Drop received 802.1D STP packets.";
1031 //description " Do not include this port when flooding.";
1035 //description " Drop packets forwarded to port.";
1039 //description "Do not send packet-in msgs for port.";
1045 typedef port-state-v10 {
1047 "Current state of the physical port. These are not configurable from
1051 //description "No physical link present.";
1055 //description "Port is blocked";
1059 //description "Live for Fast Failover Group.";
1063 //description "Live for Fast Failover Group.";
1067 //description "Live for Fast Failover Group.";
1071 //description "Live for Fast Failover Group.";
1075 //description "Live for Fast Failover Group.";
1079 //description "Live for Fast Failover Group.";
1085 typedef port-features-v10 {
1086 ////description "Features of ports available in datapath.";
1087 //reference "ofp_port_features";
1091 //description "10 Mb half-duplex rate support.";
1095 //description "10 Mb full-duplex rate support.";
1099 //description "100 Mb half-duplex rate support.";
1103 //description "100 Mb full-duplex rate support.";
1107 //description "1 Gb half-duplex rate support.";
1111 //description "1 Gb full-duplex rate support.";
1115 //description "10 Gb full-duplex rate support.";
1119 //description "Copper medium.";
1123 //description "Fiber medium.";
1127 //description "Auto-negotiation.";
1131 //description "Pause.";
1135 //description "Asymmetric pause.";
1140 typedef capabilities-v10 {
1142 bit OFPC_FLOW_STATS {
1144 /* Flow statistics. */
1146 bit OFPC_TABLE_STATS {
1148 /* Table statistics. */
1150 bit OFPC_PORT_STATS {
1152 /* Port statistics. */
1156 /* 802.1d spanning tree. */
1160 /* Reserved, must be zero. */
1164 /* Can reassemble IP fragments. */
1166 bit OFPC_QUEUE_STATS {
1168 /* Queue statistics. */
1170 bit OFPC_ARP_MATCH_IP {
1172 /* Match IP addresses in ARP pkts. */
1177 typedef flow-mod-flags-v10 {
1178 /* ofp_flow_mod_flags */
1180 bit OFPFF_SEND_FLOW_REM {
1182 /* Send flow removed message when flow expires or is deleted. */
1184 bit OFPFF_CHECK_OVERLAP {
1186 /* Check for overlapping entries first. */
1190 /* Reset flow packet and byte counts. */
1195 typedef action-type-v10 {
1196 /* ofp_action_type */
1200 /* Output to switch port. */
1202 bit OFPAT_SET_VLAN_VID {
1204 /* Set the 802.1q VLAN id. */
1206 bit OFPAT_SET_VLAN_PCP {
1208 /* Set the 802.1q priority. */
1210 bit OFPAT_STRIP_VLAN {
1212 /* Strip the 802.1q header. */
1214 bit OFPAT_SET_DL_SRC {
1216 /* Ethernet source address. */
1218 bit OFPAT_SET_DL_DST {
1220 /* Ethernet destination address. */
1222 bit OFPAT_SET_NW_SRC {
1224 /* IP source address. */
1226 bit OFPAT_SET_NW_DST {
1228 /* IP destination address. */
1230 bit OFPAT_SET_NW_TOS {
1232 /* IP ToS (DSCP field, 6 bits). */
1234 bit OFPAT_SET_TP_SRC {
1236 /* TCP/UDP source port. */
1238 bit OFPAT_SET_TP_DST {
1240 /* TCP/UDP destination port. */
1244 /* Output to queue. */
1248 /* Experimenter in later versions */
1253 typedef error-type-v10 {
1257 description "Hello Protocol failed.";
1261 description "Request was not understood.";
1265 description "Error in action description.";
1267 enum FLOW_MOD_FAILED {
1269 description "Problem modifying flow entry.";
1271 enum PORT_MOD_FAILED {
1273 description "Port mod request failed.";
1275 enum QUEUE_OP_FAILED {
1277 description "Queue operation failed.";