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.";
866 typedef table-values {
871 description "Last usable table number.";
875 description "Wildcard table used for table config,
876 flow stats and flow deletes.";
882 /* ofp_group - Group numbering. Groups can use any number up to OFPG_MAX.*/
885 value -256; //0xffffff00
886 description "Last usable group number";
891 value -4; //0xfffffffc
892 description "Represents all groups for group delete commands";
895 value -1; //0xffffffff
896 description "Wildcard group used only for flow stats requests.
897 Selects all flows regardless of group (including flows with no group)";
904 typedef multipart-request-flags {
906 "enum ofp_multipart_request_flags ";
908 bit OFPMPF_REQ_MORE {
909 //description "More requests to follow.";
915 typedef multipart-type {
916 /* ofp_multipart_type */
920 description "Description of this OpenFlow switch.
921 The request body is empty.
922 The reply body is struct ofp_desc.";
926 description "Individual flow statistics.
927 The request body is struct ofp_flow_stats_request.
928 The reply body is an array of struct ofp_flow_stats.";
930 enum OFPMP_AGGREGATE {
932 description "Aggregate flow statistics.
933 The request body is struct ofp_aggregate_stats_request.
934 The reply body is struct ofp_aggregate_stats_reply.";
938 description "Flow table statistics.
939 The request body is empty.
940 The reply body is an array of struct ofp_table_stats.";
942 enum OFPMP_PORT_STATS {
944 description "Port statistics.
945 The request body is struct ofp_port_stats_request.
946 The reply body is an array of struct ofp_port_stats.";
950 description "Queue statistics for a port
951 The request body is struct ofp_queue_stats_request.
952 The reply body is an array of struct ofp_queue_stats";
956 description "Group counter statistics.
957 The request body is struct ofp_group_stats_request.
958 The reply is an array of struct ofp_group_stats.";
960 enum OFPMP_GROUP_DESC {
962 description "Group description.
963 The request body is empty.
964 The reply body is an array of struct ofp_group_desc.";
966 enum OFPMP_GROUP_FEATURES {
968 description "Group features.
969 The request body is empty.
970 The reply body is struct ofp_group_features.";
974 description "Meter statistics.
975 The request body is struct ofp_meter_multipart_requests.
976 The reply body is an array of struct ofp_meter_stats.";
978 enum OFPMP_METER_CONFIG {
980 description "Meter configuration.
981 The request body is struct ofp_meter_multipart_requests.
982 The reply body is an array of struct ofp_meter_config.";
984 enum OFPMP_METER_FEATURES {
986 description "Meter features.
987 The request body is empty.
988 The reply body is struct ofp_meter_features.";
990 enum OFPMP_TABLE_FEATURES {
992 description "Table features.
993 The request body is either empty or contains an array of
994 struct ofp_table_features containing the controller’s
995 desired view of the switch. If the switch is unable to
996 set the specified view an error is returned.
997 The reply body is an array of struct ofp_table_features.";
999 enum OFPMP_PORT_DESC {
1001 description "Port description.
1002 The request body is empty.
1003 The reply body is an array of struct ofp_port.";
1005 enum OFPMP_EXPERIMENTER {
1006 value 65535; //0xffff
1007 description "Experimenter extension.
1008 The request and reply bodies begin with
1009 struct ofp_experimenter_multipart_header.
1010 The request and reply bodies are otherwise experimenter-defined.";
1015 typedef queue-properties {
1016 /* ofp_queue_properties */
1020 description "No property defined for queue (default).";
1022 enum OFPQT_MIN_RATE {
1024 description "Minimum datarate guaranteed.";
1026 enum OFPQT_MAX_RATE {
1028 description "Maximum datarate.";
1030 enum OFPQT_EXPERIMENTER {
1031 value 65535; // 0xffff
1032 description "Experimenter defined property.";
1037 typedef controller-role {
1038 /* ofp_controller_role */
1040 enum OFPCR_ROLE_NOCHANGE {
1042 description "Don’t change current role.";
1044 enum OFPCR_ROLE_EQUAL {
1046 description "Default role, full access.";
1048 enum OFPCR_ROLE_MASTER {
1050 description "Full access, at most one master.";
1052 enum OFPCR_ROLE_SLAVE {
1054 description "Read-only access.";
1059 typedef packet-in-reason {
1060 /* ofp_packet_in_reason */
1062 enum OFPR_NO_MATCH {
1064 description "No matching flow (table-miss flow entry). ";
1068 description "Action explicitly output to controller. ";
1070 enum OFPR_INVALID_TTL {
1072 description "Packet has invalid TTL ";
1077 typedef action-type {
1078 /* ofp_action_type */
1082 /* Output to switch port. */
1084 bit OFPAT_COPY_TTL_OUT {
1086 /* Copy TTL "outwards" -- from next-to-outermost to outermost */
1088 bit OFPAT_COPY_TTL_IN {
1090 /* Copy TTL "inwards" -- from outermost to next-to-outermost */
1092 bit OFPAT_SET_MPLS_TTL {
1096 bit OFPAT_DEC_MPLS_TTL {
1098 /* Decrement MPLS TTL */
1100 bit OFPAT_PUSH_VLAN {
1102 /* Push a new VLAN tag */
1104 bit OFPAT_POP_VLAN {
1106 /* Pop the outer VLAN tag */
1108 bit OFPAT_PUSH_MPLS {
1110 /* Push a new MPLS tag */
1112 bit OFPAT_POP_MPLS {
1114 /* Pop the outer MPLS tag */
1116 bit OFPAT_SET_QUEUE {
1118 /* Set queue id when outputting to a port */
1124 bit OFPAT_SET_NW_TTL {
1128 bit OFPAT_DEC_NW_TTL {
1130 /* Decrement IP TTL. */
1132 bit OFPAT_SET_FIELD {
1134 /* Set a header field using OXM TLV format. */
1136 bit OFPAT_PUSH_PBB {
1138 /* Push a new PBB service tag (I-TAG) */
1142 /* Pop the outer PBB service tag (I-TAG) */
1144 bit OFPAT_EXPERIMENTER {
1150 typedef meter-mod-command {
1151 /* ofp_meter_mod_command */
1154 description "New meter. ";
1157 description "Modify specified meter. ";
1160 description "Delete specified meter. ";
1165 typedef meter-flags {
1166 /* ofp_meter_flags */
1170 /* Rate value in kb/s (kilo-bit per second). */
1174 /* Rate value in packet/sec. */
1178 /* Do burst size. */
1182 /* Collect statistics. */
1187 typedef meter-band-type {
1188 /* ofp_meter_band_type */
1192 description "Drop packet. ";
1194 enum OFPMBT_DSCP_REMARK {
1196 description "Remark DSCP in the IP header. ";
1198 enum OFPMBT_EXPERIMENTER {
1199 value 65535; //0xFFFF
1200 description "Experimenter meter band. ";
1205 typedef meter-band-type-bitmap {
1206 /* ofp_meter_band_type */
1210 description "Drop packet. ";
1212 bit OFPMBT_DSCP_REMARK {
1214 description "Remark DSCP in the IP header. ";
1220 /* ofp_meter - Meter numbering. Flow meters can use any number up to OFPM_MAX*/
1223 value -65536; //0xffff0000
1224 description "Last usable meter number";
1227 /* Virtual meters. */
1228 enum OFPM_SLOWPATH {
1229 value -3; //0xfffffffd
1230 description "Meter for slow datapath";
1232 enum OFPM_CONTROLLER {
1233 value -2; //0xfffffffe
1234 description "Meter for controller connection";
1237 value -1; //0xffffffff
1238 description "Represents all meters for stat requests commands";
1244 typedef table-config {
1245 /* ofp_table_config */
1247 bit OFPTC_DEPRECATED_MASK {
1248 /* Deprecated bits */
1254 typedef table-features-prop-type {
1256 enum OFPTFPT_INSTRUCTIONS {
1258 description "Instructions property.";
1260 enum OFPTFPT_INSTRUCTIONS_MISS {
1262 description "Instructions for table-miss.";
1264 enum OFPTFPT_NEXT_TABLES {
1266 description "Next Table property.";
1268 enum OFPTFPT_NEXT_TABLES_MISS {
1270 description "Next Table for table-miss.";
1272 enum OFPTFPT_WRITE_ACTIONS {
1274 description "Write Actions property.";
1276 enum OFPTFPT_WRITE_ACTIONS_MISS {
1278 description "Write Actions for table-miss.";
1280 enum OFPTFPT_APPLY_ACTIONS {
1282 description "Apply Actions property.";
1284 enum OFPTFPT_APPLY_ACTIONS_MISS {
1286 description "Apply Actions for table-miss.";
1288 enum OFPTFPT_MATCH {
1290 description "Match property.";
1292 enum OFPTFPT_WILDCARDS {
1294 description "Wildcards property.";
1296 enum OFPTFPT_WRITE_SETFIELD {
1298 description "Write Set-Field property.";
1300 enum OFPTFPT_WRITE_SETFIELD_MISS {
1302 description "Write Set-Field for table-miss.";
1304 enum OFPTFPT_APPLY_SETFIELD {
1306 description "Apply Set-Field property.";
1308 enum OFPTFPT_APPLY_SETFIELD_MISS {
1310 description "Apply Set-Field for table-miss.";
1312 enum OFPTFPT_EXPERIMENTER {
1314 description "Experimenter property.";
1316 enum OFPTFPT_EXPERIMENTER_MISS {
1317 value 65535; //0xffff
1318 description "Experimenter for table-miss.";
1323 typedef group-types {
1324 /* ofp_group_type */
1327 /* All (multicast/broadcast) group. */
1334 bit OFPGT_INDIRECT {
1335 /* Indirect group. */
1339 /* Fast failover group. */
1345 typedef group-capabilities {
1346 /* ofp_group_capabilities */
1348 bit OFPGFC_SELECT_WEIGHT {
1349 /* Support weight for select groups */
1352 bit OFPGFC_SELECT_LIVENESS {
1353 /* Support liveness for select groups */
1356 bit OFPGFC_CHAINING {
1357 /* Support chaining groups */
1360 bit OFPGFC_CHAINING_CHECKS {
1361 /* Check chaining for loops and delete */
1367 typedef ipv6-exthdr-flags {
1370 description "<No next header> encountered.";
1374 description "Encrypted Sec Payload header present.";
1378 description "Authentication header present.";
1382 description "1 or 2 dest headers present.";
1386 description "Fragment header present.";
1390 description "Router header present.";
1394 description "Hop-by-hop header present.";
1398 description "Unexpected repeats encountered.";
1402 description "Unexpected sequencing encountered.";
1408 // OPENFLOW v1.0 STRUCTURES
1409 // Structures under this line are needed to support OpenFlow version 1.0
1410 // wire protocol 0x01;
1412 typedef error-type-v10 {
1416 description "Hello Protocol failed.";
1420 description "Request was not understood.";
1424 description "Error in action description.";
1426 enum FLOW_MOD_FAILED {
1428 description "Problem modifying flow entry.";
1430 enum PORT_MOD_FAILED {
1432 description "Port mod request failed.";
1434 enum QUEUE_OP_FAILED {
1436 description "Queue operation failed.";
1441 typedef hello-failed-code-v10 {
1445 description "Hello Protocol failed.";
1449 description "Request was not understood.";
1454 typedef bad-request-code-v10 {
1480 enum BUFFER_UNKNOWN {
1486 typedef bad-action-code-v10 {
1497 enum BAD_VENDOR_TYPE {
1518 typedef flow-mod-failed-code-v10 {
1520 enum ALL_TABLES_FULL {
1529 enum BAD_EMERG_TIMEOUT {
1541 typedef port-mod-failed-code-v10 {
1552 typedef queue-op-failed-code-v10 {
1566 typedef port-number-values-v10 {
1569 value 65280; // 0xff00
1572 value 65528; // 0xfff8
1575 value 65529; // 0xfff9
1578 value 65530; // 0xfffa
1581 value 65531; // 0xfffb
1584 value 65532; // 0xfffc
1587 value 65533; // 0xfffd
1590 value 65534; // 0xfffe
1593 value 65535; // 0xffff
1598 typedef port-config-v10 {
1600 "Flags to indicate behavior of the physical port. These flags are
1601 describe the current configuration and used port_mod message
1602 to configure the port's behavior.";
1605 //description " Port is administratively down.";
1609 //description" Disable 802.1D spanning tree on port.";
1613 //description " Drop all packets received by port.";
1617 //description " Drop received 802.1D STP packets.";
1621 //description " Do not include this port when flooding.";
1625 //description " Drop packets forwarded to port.";
1629 //description "Do not send packet-in msgs for port.";
1635 typedef port-state-v10 {
1637 "Current state of the physical port. These are not configurable from
1641 //description "No physical link present.";
1645 //description "Port is blocked";
1649 //description "Live for Fast Failover Group.";
1653 //description "Not learning or relaying frames.";
1656 //description "Learning but not relaying frames.";
1659 //description "Learning and relaying frames.";
1662 //description "Not part of spanning tree.";
1665 //description "Bit mask for OFPPS_STP_* values.";
1670 typedef port-features-v10 {
1671 ////description "Features of ports available in datapath.";
1672 //reference "ofp_port_features";
1676 //description "10 Mb half-duplex rate support.";
1680 //description "10 Mb full-duplex rate support.";
1684 //description "100 Mb half-duplex rate support.";
1688 //description "100 Mb full-duplex rate support.";
1692 //description "1 Gb half-duplex rate support.";
1696 //description "1 Gb full-duplex rate support.";
1700 //description "10 Gb full-duplex rate support.";
1704 //description "Copper medium.";
1708 //description "Fiber medium.";
1712 //description "Auto-negotiation.";
1716 //description "Pause.";
1720 //description "Asymmetric pause.";
1725 typedef capabilities-v10 {
1727 bit OFPC_FLOW_STATS {
1729 /* Flow statistics. */
1731 bit OFPC_TABLE_STATS {
1733 /* Table statistics. */
1735 bit OFPC_PORT_STATS {
1737 /* Port statistics. */
1741 /* 802.1d spanning tree. */
1745 /* Reserved, must be zero. */
1749 /* Can reassemble IP fragments. */
1751 bit OFPC_QUEUE_STATS {
1753 /* Queue statistics. */
1755 bit OFPC_ARP_MATCH_IP {
1757 /* Match IP addresses in ARP pkts. */
1762 typedef flow-mod-flags-v10 {
1763 /* ofp_flow_mod_flags */
1765 bit OFPFF_SEND_FLOW_REM {
1767 /* Send flow removed message when flow expires or is deleted. */
1769 bit OFPFF_CHECK_OVERLAP {
1771 /* Check for overlapping entries first. */
1775 /* Reset flow packet and byte counts. */
1780 typedef action-type-v10 {
1781 /* ofp_action_type */
1785 /* Output to switch port. */
1787 bit OFPAT_SET_VLAN_VID {
1789 /* Set the 802.1q VLAN id. */
1791 bit OFPAT_SET_VLAN_PCP {
1793 /* Set the 802.1q priority. */
1795 bit OFPAT_STRIP_VLAN {
1797 /* Strip the 802.1q header. */
1799 bit OFPAT_SET_DL_SRC {
1801 /* Ethernet source address. */
1803 bit OFPAT_SET_DL_DST {
1805 /* Ethernet destination address. */
1807 bit OFPAT_SET_NW_SRC {
1809 /* IP source address. */
1811 bit OFPAT_SET_NW_DST {
1813 /* IP destination address. */
1815 bit OFPAT_SET_NW_TOS {
1817 /* IP ToS (DSCP field, 6 bits). */
1819 bit OFPAT_SET_TP_SRC {
1821 /* TCP/UDP source port. */
1823 bit OFPAT_SET_TP_DST {
1825 /* TCP/UDP destination port. */
1829 /* Output to queue. */
1833 /* Experimenter in later versions */
1838 typedef flow-wildcards-v10 {
1839 /* ofp_flow_wildcards */