2 * Copyright (c) 2013 Pantheon Technologies s.r.o. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
9 module openflow-types {
10 namespace "urn:opendaylight:openflow:common:types";
13 revision "2013-07-31" {
14 //description "OpenFlow 1.3 - common types model";
21 typedef port-number-values {
24 value -256; // 0xffffff00
27 value -8; // 0xfffffff8
30 value -7; // 0xfffffff9
33 value -6; // 0xfffffffa
36 value -5; // 0xfffffffb
39 value -4; // 0xfffffffc
42 value -3; // 0xfffffffd
45 value -2; // 0xfffffffe
48 value -1; // 0xffffffff
53 typedef port-features {
54 ////description "Features of ports available in datapath.";
55 //reference "ofp_port_features";
59 //description "10 Mb half-duplex rate support.";
63 //description "10 Mb full-duplex rate support.";
67 //description "100 Mb half-duplex rate support.";
71 //description "100 Mb full-duplex rate support.";
75 //description "1 Gb half-duplex rate support.";
79 //description "1 Gb full-duplex rate support.";
83 //description "10 Gb full-duplex rate support.";
87 //description "40 Gb full-duplex rate support.";
91 //description "100 Gb full-duplex rate support.";
95 //description "1 Tb full-duplex rate support.";
99 //description "Other rate, not in the list.";
103 //description "Copper medium.";
107 //description "Fiber medium.";
111 //description "Auto-negotiation.";
115 //description "Pause.";
119 //description "Asymmetric pause.";
124 typedef port-config {
126 "Flags to indicate behavior of the physical port. These flags are
127 describe the current configuration and used port_mod message
128 to configure the port's behavior.";
131 //description " Port is administratively down.";
135 //description " Drop all packets received by port.";
139 //description " Drop packets forwarded to port.";
143 //description "Do not send packet-in msgs for port.";
151 "Current state of the physical port. These are not configurable from
155 //description "No physical link present.";
159 //description "Port is blocked";
163 //description "Live for Fast Failover Group.";
169 identity match-type-base {
171 "The match type indicates the match structure (set of fields that compose the
172 match) in use. The match type is placed in the type field at the beginning
173 of all match structures.Extensions that define match types may be
174 published on the ONF wiki. Support for extensions is optional.";
177 identity standard-match-type {
178 base oft:match-type-base;
181 identity instruction {
212 description "Hello Protocol failed.";
216 description "Request was not understood.";
220 description "Error in action description.";
222 enum BAD_INSTRUCTION {
224 description "Error in instruction list.";
228 description "Error in match.";
230 enum FLOW_MOD_FAILED {
232 description "Problem modifying flow entry.";
234 enum GROUP_MOD_FAILED {
236 description "Problem modifying group entry.";
238 enum PORT_MOD_FAILED {
240 description "Port mod request failed.";
242 enum TABLE_MOD_FAILED {
244 description "Table mod request failed.";
246 enum QUEUE_OP_FAILED {
248 description "Queue operation failed.";
250 enum SWITCH_CONFIG_FAILED {
252 description "Switch config request failed.";
254 enum ROLE_REQUEST_FAILED {
256 description "Controller Role request failed.";
258 enum METER_MOD_FAILED {
260 description "Error in meter.";
262 enum TABLE_FEATURES_FAILED {
264 description "Setting table features failed.";
267 value 65535; //0xffff
268 description "Experimenter error messages.";
273 typedef hello-failed-code {
277 description "Hello Protocol failed.";
281 description "Request was not understood.";
286 typedef bad-request-code {
297 enum BAD_EXPERIMENTER {
312 enum BUFFER_UNKNOWN {
327 enum MULTIPART_BUFFER_OVERFLOW {
333 typedef bad-action-code {
341 enum BAD_EXPERIMENTER {
365 enum MATCH_INCONSISTENT {
368 enum UNSUPPORTED_ORDER {
380 enum BAD_SET_ARGUMENT {
386 typedef bad-instruction-code {
397 enum UNSUP_METADATA {
400 enum UNSUP_METADATA_MASK {
403 enum BAD_EXPERIMENTER {
418 typedef bad-match-code {
429 enum BAD_DL_ADDR_MASK {
432 enum BAD_NW_ADDR_MASK {
459 typedef flow-mod-failed-code {
488 typedef group-mod-failed-code {
496 enum WEIGHT_UNSUPPORTED {
502 enum OUT_OF_BUCKETS {
505 enum CHAINING_UNSUPPORTED {
508 enum WATCH_UNSUPPORTED {
538 typedef port-mod-failed-code {
558 typedef table-mod-failed-code {
572 typedef queue-op-failed-code {
586 typedef switch-config-failed-code {
600 typedef role-request-failed-code {
614 typedef meter-mod-failed-code {
643 enum BAD_BAND_VALUE {
655 typedef table-features-failed-code {
678 typedef hello-element-type {
682 description "Bitmap of version supported.";
687 typedef capabilities {
689 bit OFPC_FLOW_STATS {
691 /* Flow statistics. */
693 bit OFPC_TABLE_STATS {
695 /* Table statistics. */
697 bit OFPC_PORT_STATS {
699 /* Port statistics. */
701 bit OFPC_GROUP_STATS {
703 /* Group statistics. */
707 /* Can reassemble IP fragments. */
709 bit OFPC_QUEUE_STATS {
711 /* Queue statistics. */
713 bit OFPC_PORT_BLOCKED {
715 /* Switch will block looping ports. */
720 typedef switch-config-flag {
721 /* Handling of IP fragments. */
725 description "No special handling for fragments.";
727 enum OFPC_FRAG_DROP {
729 description "Drop fragments.";
731 enum OFPC_FRAG_REASM {
733 description "Reassemble (only if OFPC_IP_REASM set).";
735 enum OFPC_FRAG_MASK {
741 typedef flow-removed-reason {
744 enum OFPRR_IDLE_TIMEOUT {
746 description "Flow idle time exceeded idle_timeout.";
748 enum OFPRR_HARD_TIMEOUT {
750 description "Time exceeded hard_timeout.";
754 description "Evicted by a DELETE flow mod.";
756 enum OFPRR_GROUP_DELETE {
758 description "Group was removed.";
763 typedef port-reason {
768 description "The port was added.";
772 description "he port was removed.";
776 description "Some attribute of the port has changed.";
781 typedef flow-mod-command {
782 /* ofp_flow_mod_command */
786 description "New flow.";
790 description "Modify all matching flows.";
792 enum OFPFC_MODIFY_STRICT {
794 description "Modify entry strictly matching wildcards and priority.";
798 description "Delete all matching flows.";
800 enum OFPFC_DELETE_STRICT {
802 description "Delete entry strictly matching wildcards and priority.";
807 typedef flow-mod-flags {
808 /* ofp_flow_mod_flags */
810 bit OFPFF_SEND_FLOW_REM {
812 /* Send flow removed message when flow expires or is deleted. */
814 bit OFPFF_CHECK_OVERLAP {
816 /* Check for overlapping entries first. */
818 bit OFPFF_RESET_COUNTS {
820 /* Reset flow packet and byte counts. */
822 bit OFPFF_NO_PKT_COUNTS {
824 /* Don't keep track of packet count. */
826 bit OFPFF_NO_BYT_COUNTS {
828 /* Don't keep track of byte count. */
833 typedef group-mod-command {
834 /* ofp_group_mod_command */
838 description "New group.";
842 description "Modify all matching groups.";
846 description "Delete all matching groups.";
857 description "All (multicast/broadcast) group.";
861 description "Select group.";
863 enum OFPGT_INDIRECT {
865 description "Indirect group.";
869 description "Fast failover group.";
874 typedef table-values {
879 description "Last usable table number.";
883 description "Wildcard table used for table config,
884 flow stats and flow deletes.";
890 /* ofp_group - Group numbering. Groups can use any number up to OFPG_MAX.*/
893 value -256; //0xffffff00
894 description "Last usable group number";
899 value -4; //0xfffffffc
900 description "Represents all groups for group delete commands";
903 value -1; //0xffffffff
904 description "Wildcard group used only for flow stats requests.
905 Selects all flows regardless of group (including flows with no group)";
912 typedef multipart-request-flags {
914 "enum ofp_multipart_request_flags ";
916 bit OFPMPF_REQ_MORE {
917 //description "More requests to follow.";
923 typedef multipart-type {
924 /* ofp_multipart_type */
928 description "Description of this OpenFlow switch.
929 The request body is empty.
930 The reply body is struct ofp_desc.";
934 description "Individual flow statistics.
935 The request body is struct ofp_flow_stats_request.
936 The reply body is an array of struct ofp_flow_stats.";
938 enum OFPMP_AGGREGATE {
940 description "Aggregate flow statistics.
941 The request body is struct ofp_aggregate_stats_request.
942 The reply body is struct ofp_aggregate_stats_reply.";
946 description "Flow table statistics.
947 The request body is empty.
948 The reply body is an array of struct ofp_table_stats.";
950 enum OFPMP_PORT_STATS {
952 description "Port statistics.
953 The request body is struct ofp_port_stats_request.
954 The reply body is an array of struct ofp_port_stats.";
958 description "Queue statistics for a port
959 The request body is struct ofp_queue_stats_request.
960 The reply body is an array of struct ofp_queue_stats";
964 description "Group counter statistics.
965 The request body is struct ofp_group_stats_request.
966 The reply is an array of struct ofp_group_stats.";
968 enum OFPMP_GROUP_DESC {
970 description "Group description.
971 The request body is empty.
972 The reply body is an array of struct ofp_group_desc.";
974 enum OFPMP_GROUP_FEATURES {
976 description "Group features.
977 The request body is empty.
978 The reply body is struct ofp_group_features.";
982 description "Meter statistics.
983 The request body is struct ofp_meter_multipart_requests.
984 The reply body is an array of struct ofp_meter_stats.";
986 enum OFPMP_METER_CONFIG {
988 description "Meter configuration.
989 The request body is struct ofp_meter_multipart_requests.
990 The reply body is an array of struct ofp_meter_config.";
992 enum OFPMP_METER_FEATURES {
994 description "Meter features.
995 The request body is empty.
996 The reply body is struct ofp_meter_features.";
998 enum OFPMP_TABLE_FEATURES {
1000 description "Table features.
1001 The request body is either empty or contains an array of
1002 struct ofp_table_features containing the controller’s
1003 desired view of the switch. If the switch is unable to
1004 set the specified view an error is returned.
1005 The reply body is an array of struct ofp_table_features.";
1007 enum OFPMP_PORT_DESC {
1009 description "Port description.
1010 The request body is empty.
1011 The reply body is an array of struct ofp_port.";
1013 enum OFPMP_EXPERIMENTER {
1014 value 65535; //0xffff
1015 description "Experimenter extension.
1016 The request and reply bodies begin with
1017 struct ofp_experimenter_multipart_header.
1018 The request and reply bodies are otherwise experimenter-defined.";
1023 typedef queue-properties {
1024 /* ofp_queue_properties */
1028 description "No property defined for queue (default).";
1030 enum OFPQT_MIN_RATE {
1032 description "Minimum datarate guaranteed.";
1034 enum OFPQT_MAX_RATE {
1036 description "Maximum datarate.";
1038 enum OFPQT_EXPERIMENTER {
1039 value 65535; // 0xffff
1040 description "Experimenter defined property.";
1045 typedef controller-role {
1046 /* ofp_controller_role */
1048 enum OFPCR_ROLE_NOCHANGE {
1050 description "Don’t change current role.";
1052 enum OFPCR_ROLE_EQUAL {
1054 description "Default role, full access.";
1056 enum OFPCR_ROLE_MASTER {
1058 description "Full access, at most one master.";
1060 enum OFPCR_ROLE_SLAVE {
1062 description "Read-only access.";
1067 typedef packet-in-reason {
1068 /* ofp_packet_in_reason */
1070 enum OFPR_NO_MATCH {
1072 description "No matching flow (table-miss flow entry). ";
1076 description "Action explicitly output to controller. ";
1078 enum OFPR_INVALID_TTL {
1080 description "Packet has invalid TTL ";
1085 typedef action-type {
1086 /* ofp_action_type */
1090 /* Output to switch port. */
1092 bit OFPAT_COPY_TTL_OUT {
1094 /* Copy TTL "outwards" -- from next-to-outermost to outermost */
1096 bit OFPAT_COPY_TTL_IN {
1098 /* Copy TTL "inwards" -- from outermost to next-to-outermost */
1100 bit OFPAT_SET_MPLS_TTL {
1104 bit OFPAT_DEC_MPLS_TTL {
1106 /* Decrement MPLS TTL */
1108 bit OFPAT_PUSH_VLAN {
1110 /* Push a new VLAN tag */
1112 bit OFPAT_POP_VLAN {
1114 /* Pop the outer VLAN tag */
1116 bit OFPAT_PUSH_MPLS {
1118 /* Push a new MPLS tag */
1120 bit OFPAT_POP_MPLS {
1122 /* Pop the outer MPLS tag */
1124 bit OFPAT_SET_QUEUE {
1126 /* Set queue id when outputting to a port */
1132 bit OFPAT_SET_NW_TTL {
1136 bit OFPAT_DEC_NW_TTL {
1138 /* Decrement IP TTL. */
1140 bit OFPAT_SET_FIELD {
1142 /* Set a header field using OXM TLV format. */
1144 bit OFPAT_PUSH_PBB {
1146 /* Push a new PBB service tag (I-TAG) */
1150 /* Pop the outer PBB service tag (I-TAG) */
1152 bit OFPAT_EXPERIMENTER {
1158 typedef meter-mod-command {
1159 /* ofp_meter_mod_command */
1162 description "New meter. ";
1165 description "Modify specified meter. ";
1168 description "Delete specified meter. ";
1173 typedef meter-flags {
1174 /* ofp_meter_flags */
1178 /* Rate value in kb/s (kilo-bit per second). */
1182 /* Rate value in packet/sec. */
1186 /* Do burst size. */
1190 /* Collect statistics. */
1195 typedef meter-band-type {
1196 /* ofp_meter_band_type */
1200 description "Drop packet. ";
1202 enum OFPMBT_DSCP_REMARK {
1204 description "Remark DSCP in the IP header. ";
1206 enum OFPMBT_EXPERIMENTER {
1207 value 65535; //0xFFFF
1208 description "Experimenter meter band. ";
1213 typedef meter-band-type-bitmap {
1214 /* ofp_meter_band_type */
1218 description "Drop packet. ";
1220 bit OFPMBT_DSCP_REMARK {
1222 description "Remark DSCP in the IP header. ";
1228 /* ofp_meter - Meter numbering. Flow meters can use any number up to OFPM_MAX*/
1231 value -65536; //0xffff0000
1232 description "Last usable meter number";
1235 /* Virtual meters. */
1236 enum OFPM_SLOWPATH {
1237 value -3; //0xfffffffd
1238 description "Meter for slow datapath";
1240 enum OFPM_CONTROLLER {
1241 value -2; //0xfffffffe
1242 description "Meter for controller connection";
1245 value -1; //0xffffffff
1246 description "Represents all meters for stat requests commands";
1252 typedef table-config {
1253 /* ofp_table_config */
1255 bit OFPTC_DEPRECATED_MASK {
1256 /* Deprecated bits */
1262 typedef table-features-prop-type {
1264 enum OFPTFPT_INSTRUCTIONS {
1266 description "Instructions property.";
1268 enum OFPTFPT_INSTRUCTIONS_MISS {
1270 description "Instructions for table-miss.";
1272 enum OFPTFPT_NEXT_TABLES {
1274 description "Next Table property.";
1276 enum OFPTFPT_NEXT_TABLES_MISS {
1278 description "Next Table for table-miss.";
1280 enum OFPTFPT_WRITE_ACTIONS {
1282 description "Write Actions property.";
1284 enum OFPTFPT_WRITE_ACTIONS_MISS {
1286 description "Write Actions for table-miss.";
1288 enum OFPTFPT_APPLY_ACTIONS {
1290 description "Apply Actions property.";
1292 enum OFPTFPT_APPLY_ACTIONS_MISS {
1294 description "Apply Actions for table-miss.";
1296 enum OFPTFPT_MATCH {
1298 description "Match property.";
1300 enum OFPTFPT_WILDCARDS {
1302 description "Wildcards property.";
1304 enum OFPTFPT_WRITE_SETFIELD {
1306 description "Write Set-Field property.";
1308 enum OFPTFPT_WRITE_SETFIELD_MISS {
1310 description "Write Set-Field for table-miss.";
1312 enum OFPTFPT_APPLY_SETFIELD {
1314 description "Apply Set-Field property.";
1316 enum OFPTFPT_APPLY_SETFIELD_MISS {
1318 description "Apply Set-Field for table-miss.";
1320 enum OFPTFPT_EXPERIMENTER {
1322 description "Experimenter property.";
1324 enum OFPTFPT_EXPERIMENTER_MISS {
1325 value 65535; //0xffff
1326 description "Experimenter for table-miss.";
1331 typedef group-types {
1332 /* ofp_group_type */
1335 /* All (multicast/broadcast) group. */
1342 bit OFPGT_INDIRECT {
1343 /* Indirect group. */
1347 /* Fast failover group. */
1353 typedef group-capabilities {
1354 /* ofp_group_capabilities */
1356 bit OFPGFC_SELECT_WEIGHT {
1357 /* Support weight for select groups */
1360 bit OFPGFC_SELECT_LIVENESS {
1361 /* Support liveness for select groups */
1364 bit OFPGFC_CHAINING {
1365 /* Support chaining groups */
1368 bit OFPGFC_CHAINING_CHECKS {
1369 /* Check chaining for loops and delete */
1375 typedef ipv6-exthdr-flags {
1378 description "<No next header> encountered.";
1382 description "Encrypted Sec Payload header present.";
1386 description "Authentication header present.";
1390 description "1 or 2 dest headers present.";
1394 description "Fragment header present.";
1398 description "Router header present.";
1402 description "Hop-by-hop header present.";
1406 description "Unexpected repeats encountered.";
1410 description "Unexpected sequencing encountered.";
1416 // OPENFLOW v1.0 STRUCTURES
1417 // Structures under this line are needed to support OpenFlow version 1.0
1418 // wire protocol 0x01;
1420 typedef error-type-v10 {
1424 description "Hello Protocol failed.";
1428 description "Request was not understood.";
1432 description "Error in action description.";
1434 enum FLOW_MOD_FAILED {
1436 description "Problem modifying flow entry.";
1438 enum PORT_MOD_FAILED {
1440 description "Port mod request failed.";
1442 enum QUEUE_OP_FAILED {
1444 description "Queue operation failed.";
1449 typedef hello-failed-code-v10 {
1453 description "Hello Protocol failed.";
1457 description "Request was not understood.";
1462 typedef bad-request-code-v10 {
1488 enum BUFFER_UNKNOWN {
1494 typedef bad-action-code-v10 {
1505 enum BAD_VENDOR_TYPE {
1526 typedef flow-mod-failed-code-v10 {
1528 enum ALL_TABLES_FULL {
1537 enum BAD_EMERG_TIMEOUT {
1549 typedef port-mod-failed-code-v10 {
1560 typedef queue-op-failed-code-v10 {
1574 typedef port-number-values-v10 {
1577 value 65280; // 0xff00
1580 value 65528; // 0xfff8
1583 value 65529; // 0xfff9
1586 value 65530; // 0xfffa
1589 value 65531; // 0xfffb
1592 value 65532; // 0xfffc
1595 value 65533; // 0xfffd
1598 value 65534; // 0xfffe
1601 value 65535; // 0xffff
1606 typedef port-config-v10 {
1608 "Flags to indicate behavior of the physical port. These flags are
1609 describe the current configuration and used port_mod message
1610 to configure the port's behavior.";
1613 //description " Port is administratively down.";
1617 //description" Disable 802.1D spanning tree on port.";
1621 //description " Drop all packets received by port.";
1625 //description " Drop received 802.1D STP packets.";
1629 //description " Do not include this port when flooding.";
1633 //description " Drop packets forwarded to port.";
1637 //description "Do not send packet-in msgs for port.";
1643 typedef port-state-v10 {
1645 "Current state of the physical port. These are not configurable from
1649 //description "No physical link present.";
1653 //description "Port is blocked";
1657 //description "Live for Fast Failover Group.";
1661 //description "Not learning or relaying frames.";
1664 //description "Learning but not relaying frames.";
1667 //description "Learning and relaying frames.";
1670 //description "Not part of spanning tree.";
1673 //description "Bit mask for OFPPS_STP_* values.";
1678 typedef port-features-v10 {
1679 ////description "Features of ports available in datapath.";
1680 //reference "ofp_port_features";
1684 //description "10 Mb half-duplex rate support.";
1688 //description "10 Mb full-duplex rate support.";
1692 //description "100 Mb half-duplex rate support.";
1696 //description "100 Mb full-duplex rate support.";
1700 //description "1 Gb half-duplex rate support.";
1704 //description "1 Gb full-duplex rate support.";
1708 //description "10 Gb full-duplex rate support.";
1712 //description "Copper medium.";
1716 //description "Fiber medium.";
1720 //description "Auto-negotiation.";
1724 //description "Pause.";
1728 //description "Asymmetric pause.";
1733 typedef capabilities-v10 {
1735 bit OFPC_FLOW_STATS {
1737 /* Flow statistics. */
1739 bit OFPC_TABLE_STATS {
1741 /* Table statistics. */
1743 bit OFPC_PORT_STATS {
1745 /* Port statistics. */
1749 /* 802.1d spanning tree. */
1753 /* Reserved, must be zero. */
1757 /* Can reassemble IP fragments. */
1759 bit OFPC_QUEUE_STATS {
1761 /* Queue statistics. */
1763 bit OFPC_ARP_MATCH_IP {
1765 /* Match IP addresses in ARP pkts. */
1770 typedef flow-mod-flags-v10 {
1771 /* ofp_flow_mod_flags */
1773 bit OFPFF_SEND_FLOW_REM {
1775 /* Send flow removed message when flow expires or is deleted. */
1777 bit OFPFF_CHECK_OVERLAP {
1779 /* Check for overlapping entries first. */
1783 /* Reset flow packet and byte counts. */
1788 typedef action-type-v10 {
1789 /* ofp_action_type */
1793 /* Output to switch port. */
1795 bit OFPAT_SET_VLAN_VID {
1797 /* Set the 802.1q VLAN id. */
1799 bit OFPAT_SET_VLAN_PCP {
1801 /* Set the 802.1q priority. */
1803 bit OFPAT_STRIP_VLAN {
1805 /* Strip the 802.1q header. */
1807 bit OFPAT_SET_DL_SRC {
1809 /* Ethernet source address. */
1811 bit OFPAT_SET_DL_DST {
1813 /* Ethernet destination address. */
1815 bit OFPAT_SET_NW_SRC {
1817 /* IP source address. */
1819 bit OFPAT_SET_NW_DST {
1821 /* IP destination address. */
1823 bit OFPAT_SET_NW_TOS {
1825 /* IP ToS (DSCP field, 6 bits). */
1827 bit OFPAT_SET_TP_SRC {
1829 /* TCP/UDP source port. */
1831 bit OFPAT_SET_TP_DST {
1833 /* TCP/UDP destination port. */
1837 /* Output to queue. */
1841 /* Experimenter in later versions */
1846 typedef flow-wildcards-v10 {
1847 /* ofp_flow_wildcards */