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
19 value -8; // 0xfffffff8
22 value -7; // 0xfffffff9
25 value -6; // 0xfffffffa
28 value -5; // 0xfffffffb
31 value -4; // 0xfffffffc
34 value -3; // 0xfffffffd
37 value -2; // 0xfffffffe
40 value -1; // 0xffffffff
45 typedef port-features {
46 ////description "Features of ports available in datapath.";
47 //reference "ofp_port_features";
51 //description "10 Mb half-duplex rate support.";
55 //description "10 Mb full-duplex rate support.";
59 //description "100 Mb half-duplex rate support.";
63 //description "100 Mb full-duplex rate support.";
67 //description "1 Gb half-duplex rate support.";
71 //description "1 Gb full-duplex rate support.";
75 //description "10 Gb full-duplex rate support.";
79 //description "40 Gb full-duplex rate support.";
83 //description "100 Gb full-duplex rate support.";
87 //description "1 Tb full-duplex rate support.";
91 //description "Other rate, not in the list.";
95 //description "Copper medium.";
99 //description "Fiber medium.";
103 //description "Auto-negotiation.";
107 //description "Pause.";
111 //description "Asymmetric pause.";
116 typedef port-config {
118 "Flags to indicate behavior of the physical port. These flags are
119 describe the current configuration and used port_mod message
120 to configure the port's behavior.";
123 //description " Port is administratively down.";
127 //description " Drop all packets received by port.";
131 //description " Drop packets forwarded to port.";
135 //description "Do not send packet-in msgs for port.";
143 "Current state of the physical port. These are not configurable from
147 //description "No physical link present.";
151 //description "Port is blocked";
155 //description "Live for Fast Failover Group.";
161 identity match-type-base {
163 "The match type indicates the match structure (set of fields that compose the
164 match) in use. The match type is placed in the type field at the beginning
165 of all match structures.Extensions that define match types may be
166 published on the ONF wiki. Support for extensions is optional.";
169 identity standard-match-type {
170 base oft:match-type-base;
173 identity instruction {
204 description "Hello Protocol failed.";
208 description "Request was not understood.";
212 description "Error in action description.";
214 enum BAD_INSTRUCTION {
216 description "Error in instruction list.";
220 description "Error in match.";
222 enum FLOW_MOD_FAILED {
224 description "Problem modifying flow entry.";
226 enum GROUP_MOD_FAILED {
228 description "Problem modifying group entry.";
230 enum PORT_MOD_FAILED {
232 description "Port mod request failed.";
234 enum TABLE_MOD_FAILED {
236 description "Table mod request failed.";
238 enum QUEUE_OP_FAILED {
240 description "Queue operation failed.";
242 enum SWITCH_CONFIG_FAILED {
244 description "Switch config request failed.";
246 enum ROLE_REQUEST_FAILED {
248 description "Controller Role request failed.";
250 enum METER_MOD_FAILED {
252 description "Error in meter.";
254 enum TABLE_FEATURES_FAILED {
256 description "Setting table features failed.";
259 value 65535; //0xffff
260 description "Experimenter error messages.";
265 typedef hello-failed-code {
269 description "Hello Protocol failed.";
273 description "Request was not understood.";
278 typedef bad-request-code {
289 enum BAD_EXPERIMENTER {
304 enum BUFFER_UNKNOWN {
319 enum MULTIPART_BUFFER_OVERFLOW {
325 typedef bad-action-code {
333 enum BAD_EXPERIMENTER {
357 enum MATCH_INCONSISTENT {
360 enum UNSUPPORTED_ORDER {
372 enum BAD_SET_ARGUMENT {
378 typedef bad-instruction-code {
389 enum UNSUP_METADATA {
392 enum UNSUP_METADATA_MASK {
395 enum BAD_EXPERIMENTER {
410 typedef bad-match-code {
421 enum BAD_DL_ADDR_MASK {
424 enum BAD_NW_ADDR_MASK {
451 typedef flow-mod-failed-code {
480 typedef group-mod-failed-code {
488 enum WEIGHT_UNSUPPORTED {
494 enum OUT_OF_BUCKETS {
497 enum CHAINING_UNSUPPORTED {
500 enum WATCH_UNSUPPORTED {
530 typedef port-mod-failed-code {
550 typedef table-mod-failed-code {
564 typedef queue-op-failed-code {
578 typedef switch-config-failed-code {
592 typedef role-request-failed-code {
606 typedef meter-mod-failed-code {
635 enum BAD_BAND_VALUE {
647 typedef table-features-failed-code {
670 typedef hello-element-type {
674 description "Bitmap of version supported.";
679 typedef capabilities {
681 bit OFPC_FLOW_STATS {
683 /* Flow statistics. */
685 bit OFPC_TABLE_STATS {
687 /* Table statistics. */
689 bit OFPC_PORT_STATS {
691 /* Port statistics. */
693 bit OFPC_GROUP_STATS {
695 /* Group statistics. */
699 /* Can reassemble IP fragments. */
701 bit OFPC_QUEUE_STATS {
703 /* Queue statistics. */
705 bit OFPC_PORT_BLOCKED {
707 /* Switch will block looping ports. */
712 typedef switch-config-flag {
713 /* Handling of IP fragments. */
717 description "No special handling for fragments.";
719 enum OFPC_FRAG_DROP {
721 description "Drop fragments.";
723 enum OFPC_FRAG_REASM {
725 description "Reassemble (only if OFPC_IP_REASM set).";
727 enum OFPC_FRAG_MASK {
733 typedef flow-removed-reason {
736 enum OFPRR_IDLE_TIMEOUT {
738 description "Flow idle time exceeded idle_timeout.";
740 enum OFPRR_HARD_TIMEOUT {
742 description "Time exceeded hard_timeout.";
746 description "Evicted by a DELETE flow mod.";
748 enum OFPRR_GROUP_DELETE {
750 description "Group was removed.";
755 typedef port-reason {
760 description "The port was added.";
764 description "he port was removed.";
768 description "Some attribute of the port has changed.";
773 typedef flow-mod-command {
774 /* ofp_flow_mod_command */
778 description "New flow.";
782 description "Modify all matching flows.";
784 enum OFPFC_MODIFY_STRICT {
786 description "Modify entry strictly matching wildcards and priority.";
790 description "Delete all matching flows.";
792 enum OFPFC_DELETE_STRICT {
794 description "Delete entry strictly matching wildcards and priority.";
799 typedef flow-mod-flags {
800 /* ofp_flow_mod_flags */
802 bit OFPFF_SEND_FLOW_REM {
804 /* Send flow removed message when flow expires or is deleted. */
806 bit OFPFF_CHECK_OVERLAP {
808 /* Check for overlapping entries first. */
810 bit OFPFF_RESET_COUNTS {
812 /* Reset flow packet and byte counts. */
814 bit OFPFF_NO_PKT_COUNTS {
816 /* Don't keep track of packet count. */
818 bit OFPFF_NO_BYT_COUNTS {
820 /* Don't keep track of byte count. */
825 typedef group-mod-command {
826 /* ofp_group_mod_command */
830 description "New group.";
834 description "Modify all matching groups.";
838 description "Delete all matching groups.";
849 description "All (multicast/broadcast) group.";
853 description "Select group.";
855 enum OFPGT_INDIRECT {
857 description "Indirect group.";
861 description "Fast failover group.";
867 /* ofp_group - Group numbering. Groups can use any number up to OFPG_MAX.*/
870 value -256; //0xffffff00
871 description "Last usable group number";
876 value -4; //0xfffffffc
877 description "Represents all groups for group delete commands";
880 value -1; //0xffffffff
881 description "Wildcard group used only for flow stats requests.
882 Selects all flows regardless of group (including flows with no group)";
889 typedef multipart-request-flags {
891 "enum ofp_multipart_request_flags ";
893 bit OFPMPF_REQ_MORE {
894 //description "More requests to follow.";
900 typedef multipart-type {
901 /* ofp_multipart_type */
905 description "Description of this OpenFlow switch.
906 The request body is empty.
907 The reply body is struct ofp_desc.";
911 description "Individual flow statistics.
912 The request body is struct ofp_flow_stats_request.
913 The reply body is an array of struct ofp_flow_stats.";
915 enum OFPMP_AGGREGATE {
917 description "Aggregate flow statistics.
918 The request body is struct ofp_aggregate_stats_request.
919 The reply body is struct ofp_aggregate_stats_reply.";
923 description "Flow table statistics.
924 The request body is empty.
925 The reply body is an array of struct ofp_table_stats.";
927 enum OFPMP_PORT_STATS {
929 description "Port statistics.
930 The request body is struct ofp_port_stats_request.
931 The reply body is an array of struct ofp_port_stats.";
935 description "Queue statistics for a port
936 The request body is struct ofp_queue_stats_request.
937 The reply body is an array of struct ofp_queue_stats";
941 description "Group counter statistics.
942 The request body is struct ofp_group_stats_request.
943 The reply is an array of struct ofp_group_stats.";
945 enum OFPMP_GROUP_DESC {
947 description "Group description.
948 The request body is empty.
949 The reply body is an array of struct ofp_group_desc.";
951 enum OFPMP_GROUP_FEATURES {
953 description "Group features.
954 The request body is empty.
955 The reply body is struct ofp_group_features.";
959 description "Meter statistics.
960 The request body is struct ofp_meter_multipart_requests.
961 The reply body is an array of struct ofp_meter_stats.";
963 enum OFPMP_METER_CONFIG {
965 description "Meter configuration.
966 The request body is struct ofp_meter_multipart_requests.
967 The reply body is an array of struct ofp_meter_config.";
969 enum OFPMP_METER_FEATURES {
971 description "Meter features.
972 The request body is empty.
973 The reply body is struct ofp_meter_features.";
975 enum OFPMP_TABLE_FEATURES {
977 description "Table features.
978 The request body is either empty or contains an array of
979 struct ofp_table_features containing the controller’s
980 desired view of the switch. If the switch is unable to
981 set the specified view an error is returned.
982 The reply body is an array of struct ofp_table_features.";
984 enum OFPMP_PORT_DESC {
986 description "Port description.
987 The request body is empty.
988 The reply body is an array of struct ofp_port.";
990 enum OFPMP_EXPERIMENTER {
991 value 65535; //0xffff
992 description "Experimenter extension.
993 The request and reply bodies begin with
994 struct ofp_experimenter_multipart_header.
995 The request and reply bodies are otherwise experimenter-defined.";
1000 typedef queue-properties {
1001 /* ofp_queue_properties */
1005 description "No property defined for queue (default).";
1007 enum OFPQT_MIN_RATE {
1009 description "Minimum datarate guaranteed.";
1011 enum OFPQT_MAX_RATE {
1013 description "Maximum datarate.";
1015 enum OFPQT_EXPERIMENTER {
1016 value 65535; // 0xffff
1017 description "Experimenter defined property.";
1022 typedef controller-role {
1023 /* ofp_controller_role */
1025 enum OFPCR_ROLE_NOCHANGE {
1027 description "Don’t change current role.";
1029 enum OFPCR_ROLE_EQUAL {
1031 description "Default role, full access.";
1033 enum OFPCR_ROLE_MASTER {
1035 description "Full access, at most one master.";
1037 enum OFPCR_ROLE_SLAVE {
1039 description "Read-only access.";
1044 typedef packet-in-reason {
1045 /* ofp_packet_in_reason */
1047 enum OFPR_NO_MATCH {
1049 description "No matching flow (table-miss flow entry). ";
1053 description "Action explicitly output to controller. ";
1055 enum OFPR_INVALID_TTL {
1057 description "Packet has invalid TTL ";
1062 typedef action-type {
1063 /* ofp_action_type */
1067 /* Output to switch port. */
1069 bit OFPAT_COPY_TTL_OUT {
1071 /* Copy TTL "outwards" -- from next-to-outermost to outermost */
1073 bit OFPAT_COPY_TTL_IN {
1075 /* Copy TTL "inwards" -- from outermost to next-to-outermost */
1077 bit OFPAT_SET_MPLS_TTL {
1081 bit OFPAT_DEC_MPLS_TTL {
1083 /* Decrement MPLS TTL */
1085 bit OFPAT_PUSH_VLAN {
1087 /* Push a new VLAN tag */
1089 bit OFPAT_POP_VLAN {
1091 /* Pop the outer VLAN tag */
1093 bit OFPAT_PUSH_MPLS {
1095 /* Push a new MPLS tag */
1097 bit OFPAT_POP_MPLS {
1099 /* Pop the outer MPLS tag */
1101 bit OFPAT_SET_QUEUE {
1103 /* Set queue id when outputting to a port */
1109 bit OFPAT_SET_NW_TTL {
1113 bit OFPAT_DEC_NW_TTL {
1115 /* Decrement IP TTL. */
1117 bit OFPAT_SET_FIELD {
1119 /* Set a header field using OXM TLV format. */
1121 bit OFPAT_PUSH_PBB {
1123 /* Push a new PBB service tag (I-TAG) */
1127 /* Pop the outer PBB service tag (I-TAG) */
1129 bit OFPAT_EXPERIMENTER {
1135 typedef meter-mod-command {
1136 /* ofp_meter_mod_command */
1139 description "New meter. ";
1142 description "Modify specified meter. ";
1145 description "Delete specified meter. ";
1150 typedef meter-flags {
1151 /* ofp_meter_flags */
1155 /* Rate value in kb/s (kilo-bit per second). */
1159 /* Rate value in packet/sec. */
1163 /* Do burst size. */
1167 /* Collect statistics. */
1172 typedef meter-band-type {
1173 /* ofp_meter_band_type */
1177 description "Drop packet. ";
1179 enum OFPMBT_DSCP_REMARK {
1181 description "Remark DSCP in the IP header. ";
1183 enum OFPMBT_EXPERIMENTER {
1184 value 65535; //0xFFFF
1185 description "Experimenter meter band. ";
1190 typedef meter-band-type-bitmap {
1191 /* ofp_meter_band_type */
1195 description "Drop packet. ";
1197 bit OFPMBT_DSCP_REMARK {
1199 description "Remark DSCP in the IP header. ";
1205 /* ofp_meter - Meter numbering. Flow meters can use any number up to OFPM_MAX*/
1208 value -65536; //0xffff0000
1209 description "Last usable meter number";
1212 /* Virtual meters. */
1213 enum OFPM_SLOWPATH {
1214 value -3; //0xfffffffd
1215 description "Meter for slow datapath";
1217 enum OFPM_CONTROLLER {
1218 value -2; //0xfffffffe
1219 description "Meter for controller connection";
1222 value -1; //0xffffffff
1223 description "Represents all meters for stat requests commands";
1229 typedef table-config {
1230 /* ofp_table_config */
1232 bit OFPTC_DEPRECATED_MASK {
1233 /* Deprecated bits */
1239 typedef table-features-prop-type {
1241 enum OFPTFPT_INSTRUCTIONS {
1243 description "Instructions property.";
1245 enum OFPTFPT_INSTRUCTIONS_MISS {
1247 description "Instructions for table-miss.";
1249 enum OFPTFPT_NEXT_TABLES {
1251 description "Next Table property.";
1253 enum OFPTFPT_NEXT_TABLES_MISS {
1255 description "Next Table for table-miss.";
1257 enum OFPTFPT_WRITE_ACTIONS {
1259 description "Write Actions property.";
1261 enum OFPTFPT_WRITE_ACTIONS_MISS {
1263 description "Write Actions for table-miss.";
1265 enum OFPTFPT_APPLY_ACTIONS {
1267 description "Apply Actions property.";
1269 enum OFPTFPT_APPLY_ACTIONS_MISS {
1271 description "Apply Actions for table-miss.";
1273 enum OFPTFPT_MATCH {
1275 description "Match property.";
1277 enum OFPTFPT_WILDCARDS {
1279 description "Wildcards property.";
1281 enum OFPTFPT_WRITE_SETFIELD {
1283 description "Write Set-Field property.";
1285 enum OFPTFPT_WRITE_SETFIELD_MISS {
1287 description "Write Set-Field for table-miss.";
1289 enum OFPTFPT_APPLY_SETFIELD {
1291 description "Apply Set-Field property.";
1293 enum OFPTFPT_APPLY_SETFIELD_MISS {
1295 description "Apply Set-Field for table-miss.";
1297 enum OFPTFPT_EXPERIMENTER {
1299 description "Experimenter property.";
1301 enum OFPTFPT_EXPERIMENTER_MISS {
1302 value 65535; //0xffff
1303 description "Experimenter for table-miss.";
1308 typedef group-types {
1309 /* ofp_group_type */
1312 /* All (multicast/broadcast) group. */
1319 bit OFPGT_INDIRECT {
1320 /* Indirect group. */
1324 /* Fast failover group. */
1330 typedef group-capabilities {
1331 /* ofp_group_capabilities */
1333 bit OFPGFC_SELECT_WEIGHT {
1334 /* Support weight for select groups */
1337 bit OFPGFC_SELECT_LIVENESS {
1338 /* Support liveness for select groups */
1341 bit OFPGFC_CHAINING {
1342 /* Support chaining groups */
1345 bit OFPGFC_CHAINING_CHECKS {
1346 /* Check chaining for loops and delete */
1352 // OPENFLOW v1.0 STRUCTURES
1353 // Structures under this line are needed to support OpenFlow version 1.0
1354 // wire protocol 0x01;
1356 typedef error-type-v10 {
1360 description "Hello Protocol failed.";
1364 description "Request was not understood.";
1368 description "Error in action description.";
1370 enum FLOW_MOD_FAILED {
1372 description "Problem modifying flow entry.";
1374 enum PORT_MOD_FAILED {
1376 description "Port mod request failed.";
1378 enum QUEUE_OP_FAILED {
1380 description "Queue operation failed.";
1385 typedef hello-failed-code-v10 {
1389 description "Hello Protocol failed.";
1393 description "Request was not understood.";
1398 typedef bad-request-code-v10 {
1424 enum BUFFER_UNKNOWN {
1430 typedef bad-action-code-v10 {
1441 enum BAD_VENDOR_TYPE {
1462 typedef flow-mod-failed-code-v10 {
1464 enum ALL_TABLES_FULL {
1473 enum BAD_EMERG_TIMEOUT {
1485 typedef port-mod-failed-code-v10 {
1496 typedef queue-op-failed-code-v10 {
1510 typedef port-number-values-v10 {
1513 value 65280; // 0xff00
1516 value 65528; // 0xfff8
1519 value 65529; // 0xfff9
1522 value 65530; // 0xfffa
1525 value 65531; // 0xfffb
1528 value 65532; // 0xfffc
1531 value 65533; // 0xfffd
1534 value 65534; // 0xfffe
1537 value 65535; // 0xffff
1542 typedef port-config-v10 {
1544 "Flags to indicate behavior of the physical port. These flags are
1545 describe the current configuration and used port_mod message
1546 to configure the port's behavior.";
1549 //description " Port is administratively down.";
1553 //description" Disable 802.1D spanning tree on port.";
1557 //description " Drop all packets received by port.";
1561 //description " Drop received 802.1D STP packets.";
1565 //description " Do not include this port when flooding.";
1569 //description " Drop packets forwarded to port.";
1573 //description "Do not send packet-in msgs for port.";
1579 typedef port-state-v10 {
1581 "Current state of the physical port. These are not configurable from
1585 //description "No physical link present.";
1589 //description "Port is blocked";
1593 //description "Live for Fast Failover Group.";
1597 //description "Not learning or relaying frames.";
1600 //description "Learning but not relaying frames.";
1603 //description "Learning and relaying frames.";
1606 //description "Not part of spanning tree.";
1609 //description "Bit mask for OFPPS_STP_* values.";
1614 typedef port-features-v10 {
1615 ////description "Features of ports available in datapath.";
1616 //reference "ofp_port_features";
1620 //description "10 Mb half-duplex rate support.";
1624 //description "10 Mb full-duplex rate support.";
1628 //description "100 Mb half-duplex rate support.";
1632 //description "100 Mb full-duplex rate support.";
1636 //description "1 Gb half-duplex rate support.";
1640 //description "1 Gb full-duplex rate support.";
1644 //description "10 Gb full-duplex rate support.";
1648 //description "Copper medium.";
1652 //description "Fiber medium.";
1656 //description "Auto-negotiation.";
1660 //description "Pause.";
1664 //description "Asymmetric pause.";
1669 typedef capabilities-v10 {
1671 bit OFPC_FLOW_STATS {
1673 /* Flow statistics. */
1675 bit OFPC_TABLE_STATS {
1677 /* Table statistics. */
1679 bit OFPC_PORT_STATS {
1681 /* Port statistics. */
1685 /* 802.1d spanning tree. */
1689 /* Reserved, must be zero. */
1693 /* Can reassemble IP fragments. */
1695 bit OFPC_QUEUE_STATS {
1697 /* Queue statistics. */
1699 bit OFPC_ARP_MATCH_IP {
1701 /* Match IP addresses in ARP pkts. */
1706 typedef flow-mod-flags-v10 {
1707 /* ofp_flow_mod_flags */
1709 bit OFPFF_SEND_FLOW_REM {
1711 /* Send flow removed message when flow expires or is deleted. */
1713 bit OFPFF_CHECK_OVERLAP {
1715 /* Check for overlapping entries first. */
1719 /* Reset flow packet and byte counts. */
1724 typedef action-type-v10 {
1725 /* ofp_action_type */
1729 /* Output to switch port. */
1731 bit OFPAT_SET_VLAN_VID {
1733 /* Set the 802.1q VLAN id. */
1735 bit OFPAT_SET_VLAN_PCP {
1737 /* Set the 802.1q priority. */
1739 bit OFPAT_STRIP_VLAN {
1741 /* Strip the 802.1q header. */
1743 bit OFPAT_SET_DL_SRC {
1745 /* Ethernet source address. */
1747 bit OFPAT_SET_DL_DST {
1749 /* Ethernet destination address. */
1751 bit OFPAT_SET_NW_SRC {
1753 /* IP source address. */
1755 bit OFPAT_SET_NW_DST {
1757 /* IP destination address. */
1759 bit OFPAT_SET_NW_TOS {
1761 /* IP ToS (DSCP field, 6 bits). */
1763 bit OFPAT_SET_TP_SRC {
1765 /* TCP/UDP source port. */
1767 bit OFPAT_SET_TP_DST {
1769 /* TCP/UDP destination port. */
1773 /* Output to queue. */
1777 /* Experimenter in later versions */
1782 typedef flow-wildcards-v10 {
1783 /* ofp_flow_wildcards */
1787 /* Switch input port. */
1791 /* Switch input port. */
1795 /* Switch input port. */
1799 /* Switch input port. */
1803 /* Switch input port. */
1807 /* Switch input port. */
1811 /* Switch input port. */
1815 /* Switch input port. */
1819 /* Switch input port. */
1823 /* Switch input port. */
1827 /* Switch input port. */