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 {
171 base oft:match-type-base;
174 typedef oxm-match-type {
176 base oft:match-type-base;
180 identity instruction {
211 description "Hello Protocol failed.";
215 description "Request was not understood.";
219 description "Error in action description.";
221 enum BAD_INSTRUCTION {
223 description "Error in instruction list.";
227 description "Error in match.";
229 enum FLOW_MOD_FAILED {
231 description "Problem modifying flow entry.";
233 enum GROUP_MOD_FAILED {
235 description "Problem modifying group entry.";
237 enum PORT_MOD_FAILED {
239 description "Port mod request failed.";
241 enum TABLE_MOD_FAILED {
243 description "Table mod request failed.";
245 enum QUEUE_OP_FAILED {
247 description "Queue operation failed.";
249 enum SWITCH_CONFIG_FAILED {
251 description "Switch config request failed.";
253 enum ROLE_REQUEST_FAILED {
255 description "Controller Role request failed.";
257 enum METER_MOD_FAILED {
259 description "Error in meter.";
261 enum TABLE_FEATURES_FAILED {
263 description "Setting table features failed.";
266 value 65535; //0xffff
267 description "Experimenter error messages.";
272 typedef hello-failed-code {
276 description "Hello Protocol failed.";
280 description "Request was not understood.";
285 typedef bad-request-code {
296 enum BAD_EXPERIMENTER {
311 enum BUFFER_UNKNOWN {
326 enum MULTIPART_BUFFER_OVERFLOW {
332 typedef bad-action-code {
340 enum BAD_EXPERIMENTER {
364 enum MATCH_INCONSISTENT {
367 enum UNSUPPORTED_ORDER {
379 enum BAD_SET_ARGUMENT {
385 typedef bad-instruction-code {
396 enum UNSUP_METADATA {
399 enum UNSUP_METADATA_MASK {
402 enum BAD_EXPERIMENTER {
417 typedef bad-match-code {
428 enum BAD_DL_ADDR_MASK {
431 enum BAD_NW_ADDR_MASK {
458 typedef flow-mod-failed-code {
487 typedef group-mod-failed-code {
495 enum WEIGHT_UNSUPPORTED {
501 enum OUT_OF_BUCKETS {
504 enum CHAINING_UNSUPPORTED {
507 enum WATCH_UNSUPPORTED {
537 typedef port-mod-failed-code {
557 typedef table-mod-failed-code {
571 typedef queue-op-failed-code {
585 typedef switch-config-failed-code {
599 typedef role-request-failed-code {
613 typedef meter-mod-failed-code {
642 enum BAD_BAND_VALUE {
654 typedef table-features-failed-code {
677 typedef hello-element-type {
681 description "Bitmap of version supported.";
686 typedef capabilities {
688 bit OFPC_FLOW_STATS {
690 /* Flow statistics. */
692 bit OFPC_TABLE_STATS {
694 /* Table statistics. */
696 bit OFPC_PORT_STATS {
698 /* Port statistics. */
700 bit OFPC_GROUP_STATS {
702 /* Group statistics. */
706 /* Can reassemble IP fragments. */
708 bit OFPC_QUEUE_STATS {
710 /* Queue statistics. */
712 bit OFPC_PORT_BLOCKED {
714 /* Switch will block looping ports. */
719 typedef switch-config-flag {
720 /* Handling of IP fragments. */
724 description "No special handling for fragments.";
726 enum OFPC_FRAG_DROP {
728 description "Drop fragments.";
730 enum OFPC_FRAG_REASM {
732 description "Reassemble (only if OFPC_IP_REASM set).";
734 enum OFPC_FRAG_MASK {
740 typedef flow-removed-reason {
743 enum OFPRR_IDLE_TIMEOUT {
745 description "Flow idle time exceeded idle_timeout.";
747 enum OFPRR_HARD_TIMEOUT {
749 description "Time exceeded hard_timeout.";
753 description "Evicted by a DELETE flow mod.";
755 enum OFPRR_GROUP_DELETE {
757 description "Group was removed.";
762 typedef port-reason {
767 description "The port was added.";
771 description "he port was removed.";
775 description "Some attribute of the port has changed.";
780 typedef flow-mod-command {
781 /* ofp_flow_mod_command */
785 description "New flow.";
789 description "Modify all matching flows.";
791 enum OFPFC_MODIFY_STRICT {
793 description "Modify entry strictly matching wildcards and priority.";
797 description "Delete all matching flows.";
799 enum OFPFC_DELETE_STRICT {
801 description "Delete entry strictly matching wildcards and priority.";
806 typedef flow-mod-flags {
807 /* ofp_flow_mod_flags */
809 bit OFPFF_SEND_FLOW_REM {
811 /* Send flow removed message when flow expires or is deleted. */
813 bit OFPFF_CHECK_OVERLAP {
815 /* Check for overlapping entries first. */
817 bit OFPFF_RESET_COUNTS {
819 /* Reset flow packet and byte counts. */
821 bit OFPFF_NO_PKT_COUNTS {
823 /* Don't keep track of packet count. */
825 bit OFPFF_NO_BYT_COUNTS {
827 /* Don't keep track of byte count. */
832 typedef group-mod-command {
833 /* ofp_group_mod_command */
837 description "New group.";
841 description "Modify all matching groups.";
845 description "Delete all matching groups.";
856 description "All (multicast/broadcast) group.";
860 description "Select group.";
862 enum OFPGT_INDIRECT {
864 description "Indirect group.";
868 description "Fast failover group.";
874 /* ofp_group - Group numbering. Groups can use any number up to OFPG_MAX.*/
877 value -256; //0xffffff00
878 description "Last usable group number";
883 value -4; //0xfffffffc
884 description "Represents all groups for group delete commands";
887 value -1; //0xffffffff
888 description "Wildcard group used only for flow stats requests.
889 Selects all flows regardless of group (including flows with no group)";
896 typedef multipart-request-flags {
898 "enum ofp_multipart_request_flags ";
900 bit OFPMPF_REQ_MORE {
901 //description "More requests to follow.";
907 typedef multipart-type {
908 /* ofp_multipart_type */
912 description "Description of this OpenFlow switch.
913 The request body is empty.
914 The reply body is struct ofp_desc.";
918 description "Individual flow statistics.
919 The request body is struct ofp_flow_stats_request.
920 The reply body is an array of struct ofp_flow_stats.";
922 enum OFPMP_AGGREGATE {
924 description "Aggregate flow statistics.
925 The request body is struct ofp_aggregate_stats_request.
926 The reply body is struct ofp_aggregate_stats_reply.";
930 description "Flow table statistics.
931 The request body is empty.
932 The reply body is an array of struct ofp_table_stats.";
934 enum OFPMP_PORT_STATS {
936 description "Port statistics.
937 The request body is struct ofp_port_stats_request.
938 The reply body is an array of struct ofp_port_stats.";
942 description "Queue statistics for a port
943 The request body is struct ofp_queue_stats_request.
944 The reply body is an array of struct ofp_queue_stats";
948 description "Group counter statistics.
949 The request body is struct ofp_group_stats_request.
950 The reply is an array of struct ofp_group_stats.";
952 enum OFPMP_GROUP_DESC {
954 description "Group description.
955 The request body is empty.
956 The reply body is an array of struct ofp_group_desc.";
958 enum OFPMP_GROUP_FEATURES {
960 description "Group features.
961 The request body is empty.
962 The reply body is struct ofp_group_features.";
966 description "Meter statistics.
967 The request body is struct ofp_meter_multipart_requests.
968 The reply body is an array of struct ofp_meter_stats.";
970 enum OFPMP_METER_CONFIG {
972 description "Meter configuration.
973 The request body is struct ofp_meter_multipart_requests.
974 The reply body is an array of struct ofp_meter_config.";
976 enum OFPMP_METER_FEATURES {
978 description "Meter features.
979 The request body is empty.
980 The reply body is struct ofp_meter_features.";
982 enum OFPMP_TABLE_FEATURES {
984 description "Table features.
985 The request body is either empty or contains an array of
986 struct ofp_table_features containing the controller’s
987 desired view of the switch. If the switch is unable to
988 set the specified view an error is returned.
989 The reply body is an array of struct ofp_table_features.";
991 enum OFPMP_PORT_DESC {
993 description "Port description.
994 The request body is empty.
995 The reply body is an array of struct ofp_port.";
997 enum OFPMP_EXPERIMENTER {
998 value 65535; //0xffff
999 description "Experimenter extension.
1000 The request and reply bodies begin with
1001 struct ofp_experimenter_multipart_header.
1002 The request and reply bodies are otherwise experimenter-defined.";
1007 typedef queue-properties {
1008 /* ofp_queue_properties */
1012 description "No property defined for queue (default).";
1014 enum OFPQT_MIN_RATE {
1016 description "Minimum datarate guaranteed.";
1018 enum OFPQT_MAX_RATE {
1020 description "Maximum datarate.";
1022 enum OFPQT_EXPERIMENTER {
1023 value 65535; // 0xffff
1024 description "Experimenter defined property.";
1029 typedef controller-role {
1030 /* ofp_controller_role */
1032 enum OFPCR_ROLE_NOCHANGE {
1034 description "Don’t change current role.";
1036 enum OFPCR_ROLE_EQUAL {
1038 description "Default role, full access.";
1040 enum OFPCR_ROLE_MASTER {
1042 description "Full access, at most one master.";
1044 enum OFPCR_ROLE_SLAVE {
1046 description "Read-only access.";
1051 typedef packet-in-reason {
1052 /* ofp_packet_in_reason */
1054 enum OFPR_NO_MATCH {
1056 description "No matching flow (table-miss flow entry). ";
1060 description "Action explicitly output to controller. ";
1062 enum OFPR_INVALID_TTL {
1064 description "Packet has invalid TTL ";
1069 typedef action-type {
1070 /* ofp_action_type */
1074 /* Output to switch port. */
1076 bit OFPAT_COPY_TTL_OUT {
1078 /* Copy TTL "outwards" -- from next-to-outermost to outermost */
1080 bit OFPAT_COPY_TTL_IN {
1082 /* Copy TTL "inwards" -- from outermost to next-to-outermost */
1084 bit OFPAT_SET_MPLS_TTL {
1088 bit OFPAT_DEC_MPLS_TTL {
1090 /* Decrement MPLS TTL */
1092 bit OFPAT_PUSH_VLAN {
1094 /* Push a new VLAN tag */
1096 bit OFPAT_POP_VLAN {
1098 /* Pop the outer VLAN tag */
1100 bit OFPAT_PUSH_MPLS {
1102 /* Push a new MPLS tag */
1104 bit OFPAT_POP_MPLS {
1106 /* Pop the outer MPLS tag */
1108 bit OFPAT_SET_QUEUE {
1110 /* Set queue id when outputting to a port */
1116 bit OFPAT_SET_NW_TTL {
1120 bit OFPAT_DEC_NW_TTL {
1122 /* Decrement IP TTL. */
1124 bit OFPAT_SET_FIELD {
1126 /* Set a header field using OXM TLV format. */
1128 bit OFPAT_PUSH_PBB {
1130 /* Push a new PBB service tag (I-TAG) */
1134 /* Pop the outer PBB service tag (I-TAG) */
1136 bit OFPAT_EXPERIMENTER {
1142 typedef meter-mod-command {
1143 /* ofp_meter_mod_command */
1146 description "New meter. ";
1149 description "Modify specified meter. ";
1152 description "Delete specified meter. ";
1157 typedef meter-flags {
1158 /* ofp_meter_flags */
1162 /* Rate value in kb/s (kilo-bit per second). */
1166 /* Rate value in packet/sec. */
1170 /* Do burst size. */
1174 /* Collect statistics. */
1179 typedef meter-band-type {
1180 /* ofp_meter_band_type */
1184 description "Drop packet. ";
1186 enum OFPMBT_DSCP_REMARK {
1188 description "Remark DSCP in the IP header. ";
1190 enum OFPMBT_EXPERIMENTER {
1191 value 65535; //0xFFFF
1192 description "Experimenter meter band. ";
1197 typedef meter-band-type-bitmap {
1198 /* ofp_meter_band_type */
1202 description "Drop packet. ";
1204 bit OFPMBT_DSCP_REMARK {
1206 description "Remark DSCP in the IP header. ";
1212 /* ofp_meter - Meter numbering. Flow meters can use any number up to OFPM_MAX*/
1215 value -65536; //0xffff0000
1216 description "Last usable meter number";
1219 /* Virtual meters. */
1220 enum OFPM_SLOWPATH {
1221 value -3; //0xfffffffd
1222 description "Meter for slow datapath";
1224 enum OFPM_CONTROLLER {
1225 value -2; //0xfffffffe
1226 description "Meter for controller connection";
1229 value -1; //0xffffffff
1230 description "Represents all meters for stat requests commands";
1236 typedef table-config {
1237 /* ofp_table_config */
1239 bit OFPTC_DEPRECATED_MASK {
1240 /* Deprecated bits */
1246 typedef table-features-prop-type {
1248 enum OFPTFPT_INSTRUCTIONS {
1250 description "Instructions property.";
1252 enum OFPTFPT_INSTRUCTIONS_MISS {
1254 description "Instructions for table-miss.";
1256 enum OFPTFPT_NEXT_TABLES {
1258 description "Next Table property.";
1260 enum OFPTFPT_NEXT_TABLES_MISS {
1262 description "Next Table for table-miss.";
1264 enum OFPTFPT_WRITE_ACTIONS {
1266 description "Write Actions property.";
1268 enum OFPTFPT_WRITE_ACTIONS_MISS {
1270 description "Write Actions for table-miss.";
1272 enum OFPTFPT_APPLY_ACTIONS {
1274 description "Apply Actions property.";
1276 enum OFPTFPT_APPLY_ACTIONS_MISS {
1278 description "Apply Actions for table-miss.";
1280 enum OFPTFPT_MATCH {
1282 description "Match property.";
1284 enum OFPTFPT_WILDCARDS {
1286 description "Wildcards property.";
1288 enum OFPTFPT_WRITE_SETFIELD {
1290 description "Write Set-Field property.";
1292 enum OFPTFPT_WRITE_SETFIELD_MISS {
1294 description "Write Set-Field for table-miss.";
1296 enum OFPTFPT_APPLY_SETFIELD {
1298 description "Apply Set-Field property.";
1300 enum OFPTFPT_APPLY_SETFIELD_MISS {
1302 description "Apply Set-Field for table-miss.";
1304 enum OFPTFPT_EXPERIMENTER {
1306 description "Experimenter property.";
1308 enum OFPTFPT_EXPERIMENTER_MISS {
1309 value 65535; //0xffff
1310 description "Experimenter for table-miss.";
1315 typedef group-types {
1316 /* ofp_group_type */
1319 /* All (multicast/broadcast) group. */
1326 bit OFPGT_INDIRECT {
1327 /* Indirect group. */
1331 /* Fast failover group. */
1337 typedef group-capabilities {
1338 /* ofp_group_capabilities */
1340 bit OFPGFC_SELECT_WEIGHT {
1341 /* Support weight for select groups */
1344 bit OFPGFC_SELECT_LIVENESS {
1345 /* Support liveness for select groups */
1348 bit OFPGFC_CHAINING {
1349 /* Support chaining groups */
1352 bit OFPGFC_CHAINING_CHECKS {
1353 /* Check chaining for loops and delete */
1359 // OPENFLOW v1.0 STRUCTURES
1360 // Structures under this line are needed to support OpenFlow version 1.0
1361 // wire protocol 0x01;
1363 typedef error-type-v10 {
1367 description "Hello Protocol failed.";
1371 description "Request was not understood.";
1375 description "Error in action description.";
1377 enum FLOW_MOD_FAILED {
1379 description "Problem modifying flow entry.";
1381 enum PORT_MOD_FAILED {
1383 description "Port mod request failed.";
1385 enum QUEUE_OP_FAILED {
1387 description "Queue operation failed.";
1392 typedef hello-failed-code-v10 {
1396 description "Hello Protocol failed.";
1400 description "Request was not understood.";
1405 typedef bad-request-code-v10 {
1431 enum BUFFER_UNKNOWN {
1437 typedef bad-action-code-v10 {
1448 enum BAD_VENDOR_TYPE {
1469 typedef flow-mod-failed-code-v10 {
1471 enum ALL_TABLES_FULL {
1480 enum BAD_EMERG_TIMEOUT {
1492 typedef port-mod-failed-code-v10 {
1503 typedef queue-op-failed-code-v10 {
1517 typedef port-number-values-v10 {
1520 value 65280; // 0xff00
1523 value 65528; // 0xfff8
1526 value 65529; // 0xfff9
1529 value 65530; // 0xfffa
1532 value 65531; // 0xfffb
1535 value 65532; // 0xfffc
1538 value 65533; // 0xfffd
1541 value 65534; // 0xfffe
1544 value 65535; // 0xffff
1549 typedef port-config-v10 {
1551 "Flags to indicate behavior of the physical port. These flags are
1552 describe the current configuration and used port_mod message
1553 to configure the port's behavior.";
1556 //description " Port is administratively down.";
1560 //description" Disable 802.1D spanning tree on port.";
1564 //description " Drop all packets received by port.";
1568 //description " Drop received 802.1D STP packets.";
1572 //description " Do not include this port when flooding.";
1576 //description " Drop packets forwarded to port.";
1580 //description "Do not send packet-in msgs for port.";
1586 typedef port-state-v10 {
1588 "Current state of the physical port. These are not configurable from
1592 //description "No physical link present.";
1596 //description "Port is blocked";
1600 //description "Live for Fast Failover Group.";
1604 //description "Live for Fast Failover Group.";
1608 //description "Live for Fast Failover Group.";
1612 //description "Live for Fast Failover Group.";
1616 //description "Live for Fast Failover Group.";
1620 //description "Live for Fast Failover Group.";
1626 typedef port-features-v10 {
1627 ////description "Features of ports available in datapath.";
1628 //reference "ofp_port_features";
1632 //description "10 Mb half-duplex rate support.";
1636 //description "10 Mb full-duplex rate support.";
1640 //description "100 Mb half-duplex rate support.";
1644 //description "100 Mb full-duplex rate support.";
1648 //description "1 Gb half-duplex rate support.";
1652 //description "1 Gb full-duplex rate support.";
1656 //description "10 Gb full-duplex rate support.";
1660 //description "Copper medium.";
1664 //description "Fiber medium.";
1668 //description "Auto-negotiation.";
1672 //description "Pause.";
1676 //description "Asymmetric pause.";
1681 typedef capabilities-v10 {
1683 bit OFPC_FLOW_STATS {
1685 /* Flow statistics. */
1687 bit OFPC_TABLE_STATS {
1689 /* Table statistics. */
1691 bit OFPC_PORT_STATS {
1693 /* Port statistics. */
1697 /* 802.1d spanning tree. */
1701 /* Reserved, must be zero. */
1705 /* Can reassemble IP fragments. */
1707 bit OFPC_QUEUE_STATS {
1709 /* Queue statistics. */
1711 bit OFPC_ARP_MATCH_IP {
1713 /* Match IP addresses in ARP pkts. */
1718 typedef flow-mod-flags-v10 {
1719 /* ofp_flow_mod_flags */
1721 bit OFPFF_SEND_FLOW_REM {
1723 /* Send flow removed message when flow expires or is deleted. */
1725 bit OFPFF_CHECK_OVERLAP {
1727 /* Check for overlapping entries first. */
1731 /* Reset flow packet and byte counts. */
1736 typedef action-type-v10 {
1737 /* ofp_action_type */
1741 /* Output to switch port. */
1743 bit OFPAT_SET_VLAN_VID {
1745 /* Set the 802.1q VLAN id. */
1747 bit OFPAT_SET_VLAN_PCP {
1749 /* Set the 802.1q priority. */
1751 bit OFPAT_STRIP_VLAN {
1753 /* Strip the 802.1q header. */
1755 bit OFPAT_SET_DL_SRC {
1757 /* Ethernet source address. */
1759 bit OFPAT_SET_DL_DST {
1761 /* Ethernet destination address. */
1763 bit OFPAT_SET_NW_SRC {
1765 /* IP source address. */
1767 bit OFPAT_SET_NW_DST {
1769 /* IP destination address. */
1771 bit OFPAT_SET_NW_TOS {
1773 /* IP ToS (DSCP field, 6 bits). */
1775 bit OFPAT_SET_TP_SRC {
1777 /* TCP/UDP source port. */
1779 bit OFPAT_SET_TP_DST {
1781 /* TCP/UDP destination port. */
1785 /* Output to queue. */
1789 /* Experimenter in later versions */