5 ryu.app.ofctl_rest provides REST APIs for retrieving the switch stats
6 and Updating the switch stats.
7 This application helps you debug your application and get various statistics.
9 This application supports OpenFlow version 1.0, 1.2, 1.3, 1.4 and 1.5.
15 Retrieve the switch stats
16 =========================
21 Get the list of all switches which connected to the controller.
25 ======= ================
28 ======= ================
30 Response message body:
32 ========== =================== ========
33 Attribute Description Example
34 ========== =================== ========
36 ========== =================== ========
40 $ curl -X GET http://localhost:8080/stats/switches
42 .. code-block:: javascript
52 The result of the REST command is formatted for easy viewing.
58 Get the desc stats of the switch which specified with Datapath ID in URI.
62 ======= ===================
64 URI /stats/desc/<dpid>
65 ======= ===================
67 Response message body:
69 =========== ======================================= ================
70 Attribute Description Example
71 =========== ======================================= ================
73 mfr_desc Manufacturer description "Nicira, Inc.",
74 hw_desc Hardware description "Open vSwitch",
75 sw_desc Software description "2.3.90",
76 serial_num Serial number "None",
77 dp_desc Human readable description of datapath "None"
78 =========== ======================================= ================
82 $ curl -X GET http://localhost:8080/stats/desc/1
84 .. code-block:: javascript
88 "mfr_desc": "Nicira, Inc.",
89 "hw_desc": "Open vSwitch",
97 .. _get-all-flows-stats:
102 Get all flows stats of the switch which specified with Datapath ID in URI.
106 ======= ===================
108 URI /stats/flow/<dpid>
109 ======= ===================
111 Response message body(OpenFlow1.3 or earlier):
113 ============== ============================================================ ===============
114 Attribute Description Example
115 ============== ============================================================ ===============
117 length Length of this entry 88
119 duration_sec Time flow has been alive in seconds 2
120 duration_nsec Time flow has been alive in nanoseconds beyond duration_sec 6.76e+08
121 priority Priority of the entry 11111
122 idle_timeout Number of seconds idle before expiration 0
123 hard_timeout Number of seconds before expiration 0
124 flags Bitmap of OFPFF_* flags 1
125 cookie Opaque controller-issued identifier 1
126 packet_count Number of packets in flow 0
127 byte_count Number of bytes in flow 0
128 match Fields to match {"in_port": 1}
129 actions Instruction set ["OUTPUT:2"]
130 ============== ============================================================ ===============
132 Response message body(OpenFlow1.4 or later):
134 ============== ============================================================ ========================================
135 Attribute Description Example
136 ============== ============================================================ ========================================
138 length Length of this entry 88
140 duration_sec Time flow has been alive in seconds 2
141 duration_nsec Time flow has been alive in nanoseconds beyond duration_sec 6.76e+08
142 priority Priority of the entry 11111
143 idle_timeout Number of seconds idle before expiration 0
144 hard_timeout Number of seconds before expiration 0
145 flags Bitmap of OFPFF_* flags 1
146 cookie Opaque controller-issued identifier 1
147 packet_count Number of packets in flow 0
148 byte_count Number of bytes in flow 0
149 importance Eviction precedence 0
150 match Fields to match {"eth_type": 2054}
151 instructions struct ofp_instruction_header [{"type":GOTO_TABLE", "table_id":1}]
152 ============== ============================================================ ========================================
156 $ curl -X GET http://localhost:8080/stats/flow/1
158 Response (OpenFlow1.3 or earlier):
160 .. code-block:: javascript
168 "duration_nsec": 6.76e+08,
186 Response (OpenFlow1.4 or later):
188 .. code-block:: javascript
196 "duration_nsec": 6.76e+08,
210 "type": "APPLY_ACTIONS",
225 .. _get-flows-stats-filtered:
227 Get flows stats filtered by fields
228 ----------------------------------
230 Get flows stats of the switch filtered by the OFPFlowStats fields.
231 This is POST method version of :ref:`get-all-flows-stats`.
235 ======= ===================
237 URI /stats/flow/<dpid>
238 ======= ===================
240 Request message body:
242 ============ ================================================================== =============== ===============
243 Attribute Description Example Default
244 ============ ================================================================== =============== ===============
245 table_id Table ID (int) 0 OFPTT_ALL
246 out_port Require matching entries to include this as an output port (int) 2 OFPP_ANY
247 out_group Require matching entries to include this as an output group (int) 1 OFPG_ANY
248 cookie Require matching entries to contain this cookie value (int) 1 0
249 cookie_mask Mask used to restrict the cookie bits that must match (int) 1 0
250 match Fields to match (dict) {"in_port": 1} {} #wildcarded
251 priority Priority of the entry (int) (See Note) 11111 #wildcarded
252 ============ ================================================================== =============== ===============
256 OpenFlow Spec does not allow to filter flow entries by priority,
257 but when with a large amount of flow entries, filtering by priority
258 is convenient to get statistics efficiently.
259 So, this app provides priority field for filtering.
262 Response message body:
263 The same as :ref:`get-all-flows-stats`
275 }' http://localhost:8080/stats/flow/1
277 Response (OpenFlow1.3 or earlier):
279 .. code-block:: javascript
287 "duration_nsec": 6.76e+08,
305 Response (OpenFlow1.4 or later):
307 .. code-block:: javascript
315 "duration_nsec": 6.76e+08,
329 "type": "APPLY_ACTIONS",
345 .. _get-aggregate-flow-stats:
347 Get aggregate flow stats
348 ------------------------
350 Get aggregate flow stats of the switch which specified with Datapath ID in URI.
354 ======= ============================
356 URI /stats/aggregateflow/<dpid>
357 ======= ============================
359 Response message body:
361 ============= =========================== ========
362 Attribute Description Example
363 ============= =========================== ========
365 packet_count Number of packets in flows 18
366 byte_count Number of bytes in flows 756
367 flow_count Number of flows 3
368 ============= =========================== ========
372 $ curl -X GET http://localhost:8080/stats/aggregateflow/1
374 .. code-block:: javascript
387 Get aggregate flow stats filtered by fields
388 -------------------------------------------
390 Get aggregate flow stats of the switch filtered by the OFPAggregateStats fields.
391 This is POST method version of :ref:`get-aggregate-flow-stats`.
395 ======= ============================
397 URI /stats/aggregateflow/<dpid>
398 ======= ============================
400 Request message body:
402 ============ ================================================================== =============== ===============
403 Attribute Description Example Default
404 ============ ================================================================== =============== ===============
405 table_id Table ID (int) 0 OFPTT_ALL
406 out_port Require matching entries to include this as an output port (int) 2 OFPP_ANY
407 out_group Require matching entries to include this as an output group (int) 1 OFPG_ANY
408 cookie Require matching entries to contain this cookie value (int) 1 0
409 cookie_mask Mask used to restrict the cookie bits that must match (int) 1 0
410 match Fields to match (dict) {"in_port": 1} {} #wildcarded
411 ============ ================================================================== =============== ===============
413 Response message body:
414 The same as :ref:`get-aggregate-flow-stats`
426 }' http://localhost:8080/stats/aggregateflow/1
428 .. code-block:: javascript
444 Get table stats of the switch which specified with Datapath ID in URI.
448 ======= ===================
450 URI /stats/table/<dpid>
451 ======= ===================
453 Response message body(OpenFlow1.0):
455 =============== ============================================================ ============
456 Attribute Description Example
457 =============== ============================================================ ============
460 name Name of Table "classifier"
461 max_entries Max number of entries supported 1e+06
462 wildcards Bitmap of OFPFW_* wildcards that are supported by the table ["IN_PORT","DL_VLAN"]
463 active_count Number of active entries 0
464 lookup_count Number of packets looked up in table 8
465 matched_count Number of packets that hit table 0
466 =============== ============================================================ ============
468 Response message body(OpenFlow1.2):
470 =============== ============================================================ ====================
471 Attribute Description Example
472 =============== ============================================================ ====================
475 name Name of Table "classifier"
476 match Bitmap of (1 << OFPXMT_*) that indicate the ["OFB_IN_PORT","OFB_METADATA"]
477 fields the table can match on
478 wildcards Bitmap of (1 << OFPXMT_*) wildcards that are ["OFB_IN_PORT","OFB_METADATA"]
479 supported by the table
480 write_actions Bitmap of OFPAT_* that are supported ["OUTPUT","SET_MPLS_TTL"]
481 by the table with OFPIT_WRITE_ACTIONS
482 apply_actions Bitmap of OFPAT_* that are supported ["OUTPUT","SET_MPLS_TTL"]
483 by the table with OFPIT_APPLY_ACTIONS
484 write_setfields Bitmap of (1 << OFPXMT_*) header fields that ["OFB_IN_PORT","OFB_METADATA"]
485 can be set with OFPIT_WRITE_ACTIONS
486 apply_setfields Bitmap of (1 << OFPXMT_*) header fields that ["OFB_IN_PORT","OFB_METADATA"]
487 can be set with OFPIT_APPLY_ACTIONS
488 metadata_match Bits of metadata table can match 18446744073709552000
489 metadata_write Bits of metadata table can write 18446744073709552000
490 instructions Bitmap of OFPIT_* values supported ["GOTO_TABLE","WRITE_METADATA"]
491 config Bitmap of OFPTC_* values []
492 max_entries Max number of entries supported 1e+06
493 active_count Number of active entries 0
494 lookup_count Number of packets looked up in table 0
495 matched_count Number of packets that hit table 8
496 =============== ============================================================ ====================
498 Response message body(OpenFlow1.3):
500 ============== ============================================================= =========
501 Attribute Description Example
502 ============== ============================================================= =========
505 active_count Number of active entries 0
506 lookup_count Number of packets looked up in table 8
507 matched_count Number of packets that hit table 0
508 ============== ============================================================= =========
513 $ curl -X GET http://localhost:8080/stats/table/1
515 Response (OpenFlow1.0):
517 .. code-block:: javascript
524 "max_entries": 1e+06,
526 "name": "classifier",
537 "max_entries": 1e+06,
549 Response (OpenFlow1.2):
551 .. code-block:: javascript
564 "metadata_write": 18446744073709552000,
571 "metadata_match": 18446744073709552000,
585 "name": "classifier",
604 "metadata_write": 18446744073709552000,
611 "metadata_match": 18446744073709552000,
637 Response (OpenFlow1.3):
639 .. code-block:: javascript
663 Get table features of the switch which specified with Datapath ID in URI.
667 ======= ===========================
669 URI /stats/tablefeatures/<dpid>
670 ======= ===========================
672 Response message body:
674 ============== ==================================== =======================================================
675 Attribute Description Example
676 ============== ==================================== =======================================================
679 name Name of Table "table_0"
680 metadata_match Bits of metadata table can match 18446744073709552000
681 metadata_write Bits of metadata table can write 18446744073709552000
682 config Bitmap of OFPTC_* values 0
683 max_entries Max number of entries supported 4096
684 properties struct ofp_table_feature_prop_header [{"type": "INSTRUCTIONS","instruction_ids": [...]},...]
685 ============== ==================================== =======================================================
689 $ curl -X GET http://localhost:8080/stats/tablefeatures/1
691 .. code-block:: javascript
696 "metadata_write": 18446744073709552000,
699 "metadata_match": 18446744073709552000,
703 "type": "INSTRUCTIONS",
717 "metadata_write": 18446744073709552000,
720 "metadata_match": 18446744073709552000,
724 "type": "INSTRUCTIONS",
745 Get ports stats of the switch which specified with Datapath ID in URI.
749 ======= ===========================
751 URI /stats/port/<dpid>[/<port>]
752 ======= ===========================
756 Specification of port number is optional.
759 Response message body(OpenFlow1.3 or earlier):
761 ============== ============================================================ =========
762 Attribute Description Example
763 ============== ============================================================ =========
765 port_no Port number 1
766 rx_packets Number of received packets 9
767 tx_packets Number of transmitted packets 6
768 rx_bytes Number of received bytes 738
769 tx_bytes Number of transmitted bytes 252
770 rx_dropped Number of packets dropped by RX 0
771 tx_dropped Number of packets dropped by TX 0
772 rx_errors Number of receive errors 0
773 tx_errors Number of transmit errors 0
774 rx_frame_err Number of frame alignment errors 0
775 rx_over_err Number of packets with RX overrun 0
776 rx_crc_err Number of CRC errors 0
777 collisions Number of collisions 0
778 duration_sec Time port has been alive in seconds 12
779 duration_nsec Time port has been alive in nanoseconds beyond duration_sec 9.76e+08
780 ============== ============================================================ =========
783 Response message body(OpenFlow1.4 or later):
785 ============== ============================================================ =================================================================================
786 Attribute Description Example
787 ============== ============================================================ =================================================================================
789 port_no Port number 1
790 rx_packets Number of received packets 9
791 tx_packets Number of transmitted packets 6
792 rx_bytes Number of received bytes 738
793 tx_bytes Number of transmitted bytes 252
794 rx_dropped Number of packets dropped by RX 0
795 tx_dropped Number of packets dropped by TX 0
796 rx_errors Number of receive errors 0
797 tx_errors Number of transmit errors 0
798 duration_sec Time port has been alive in seconds 12
799 duration_nsec Time port has been alive in nanoseconds beyond duration_sec 9.76e+08
800 properties struct ofp_port_desc_prop_header [{"rx_frame_err": 0, "rx_over_err": 0, "rx_crc_err": 0, "collisions": 0,...},...]
801 ============== ============================================================ =================================================================================
805 $ curl -X GET http://localhost:8080/stats/port/1
807 Response (OpenFlow1.3 or earlier):
809 .. code-block:: javascript
828 "duration_nsec": 9.76e+08
837 Response (OpenFlow1.4 or later):
839 .. code-block:: javascript
854 "duration_sec": 9.76e+08,
866 "rx_freq_lmda": 1500,
871 "tx_freq_lmda": 1500,
881 "type": "EXPERIMENTER"
894 .. _get-ports-description:
896 Get ports description
897 ---------------------
899 Get ports description of the switch which specified with Datapath ID in URI.
901 Usage(OpenFlow1.4 or earlier):
903 ======= =======================
905 URI /stats/portdesc/<dpid>
906 ======= =======================
908 Usage(OpenFlow1.5 or later):
910 ======= ==================================
912 URI /stats/portdesc/<dpid>/[<port>]
913 ======= ==================================
917 Specification of port number is optional.
920 Response message body(OpenFlow1.3 or earlier):
922 ============== ====================================== ====================
923 Attribute Description Example
924 ============== ====================================== ====================
926 port_no Port number 1
927 hw_addr Ethernet hardware address "0a:b6:d0:0c:e1:d7"
928 name Name of port "s1-eth1"
929 config Bitmap of OFPPC_* flags 0
930 state Bitmap of OFPPS_* flags 0
931 curr Current features 2112
932 advertised Features being advertised by the port 0
933 supported Features supported by the port 0
934 peer Features advertised by peer 0
935 curr_speed Current port bitrate in kbps 1e+07
936 max_speed Max port bitrate in kbps 0
937 ============== ====================================== ====================
939 Response message body(OpenFlow1.4 or later):
941 ============== ====================================== ======================================
942 Attribute Description Example
943 ============== ====================================== ======================================
945 port_no Port number 1
946 hw_addr Ethernet hardware address "0a:b6:d0:0c:e1:d7"
947 name Name of port "s1-eth1"
948 config Bitmap of OFPPC_* flags 0
949 state Bitmap of OFPPS_* flags 0
950 length Length of this entry 168
951 properties struct ofp_port_desc_prop_header [{"length": 32, "curr": 10248,...}...]
952 ============== ====================================== ======================================
956 $ curl -X GET http://localhost:8080/stats/portdesc/1
958 Response (OpenFlow1.3 or earlier):
960 .. code-block:: javascript
966 "hw_addr": "0a:b6:d0:0c:e1:d7",
984 Response (OpenFlow1.4 or later):
986 .. code-block:: javascript
992 "hw_addr": "0a:b6:d0:0c:e1:d7",
1001 "advertised": 10240,
1010 "rx_grid_freq_lmda": 1500,
1011 "tx_grid_freq_lmda": 1500,
1012 "rx_max_freq_lmda": 2000,
1013 "tx_max_freq_lmda": 2000,
1014 "rx_min_freq_lmda": 1000,
1015 "tx_min_freq_lmda": 1000,
1024 "experimenter": 101,
1026 "type": "EXPERIMENTER"
1042 Get queues stats of the switch which specified with Datapath ID in URI.
1046 ======= =========================================
1048 URI /stats/queue/<dpid>[/<port>[/<queue_id>]]
1049 ======= =========================================
1053 Specification of port number and queue id are optional.
1055 If you want to omitting the port number and setting the queue id,
1056 please specify the keyword "ALL" to the port number.
1058 e.g. GET http://localhost:8080/stats/queue/1/ALL/1
1061 Response message body(OpenFlow1.3 or earlier):
1063 ============== ============================================================= ===========
1064 Attribute Description Example
1065 ============== ============================================================= ===========
1066 dpid Datapath ID "1"
1067 port_no Port number 1
1069 tx_bytes Number of transmitted bytes 0
1070 tx_packets Number of transmitted packets 0
1071 tx_errors Number of packets dropped due to overrun 0
1072 duration_sec Time queue has been alive in seconds 4294963425
1073 duration_nsec Time queue has been alive in nanoseconds beyond duration_sec 3912967296
1074 ============== ============================================================= ===========
1076 Response message body(OpenFlow1.4 or later):
1078 ============== ============================================================= ======================================
1079 Attribute Description Example
1080 ============== ============================================================= ======================================
1081 dpid Datapath ID "1"
1082 port_no Port number 1
1084 tx_bytes Number of transmitted bytes 0
1085 tx_packets Number of transmitted packets 0
1086 tx_errors Number of packets dropped due to overrun 0
1087 duration_sec Time queue has been alive in seconds 4294963425
1088 duration_nsec Time queue has been alive in nanoseconds beyond duration_sec 3912967296
1089 length Length of this entry 104
1090 properties struct ofp_queue_stats_prop_header [{"type": 65535,"length": 12,...},...]
1091 ============== ============================================================= ======================================
1095 $ curl -X GET http://localhost:8080/stats/queue/1
1097 Response (OpenFlow1.3 or earlier):
1099 .. code-block:: javascript
1109 "duration_sec": 4294963425,
1110 "duration_nsec": 3912967296
1118 "duration_sec": 4294963425,
1119 "duration_nsec": 3912967296
1124 Response (OpenFlow1.4 or later):
1126 .. code-block:: javascript
1136 "duration_sec": 4294963425,
1137 "duration_nsec": 3912967296,
1141 "OFPQueueStatsPropExperimenter": {
1164 "duration_sec": 4294963425,
1165 "duration_nsec": 3912967296,
1172 .. _get-queues-config:
1177 Get queues config of the switch which specified with Datapath ID and Port in URI.
1181 ======= ==================================
1183 URI /stats/queueconfig/<dpid>/[<port>]
1184 ======= ==================================
1188 Specification of port number is optional.
1193 This message is deprecated in Openflow1.4.
1194 If OpenFlow 1.4 or later is in use, please refer to :ref:`get-queues-description` instead.
1196 Response message body:
1198 ================ ====================================================== ========================================
1199 Attribute Description Example
1200 ================ ====================================================== ========================================
1201 dpid Datapath ID "1"
1202 port Port which was queried 1
1203 queues struct ofp_packet_queue
1204 -- queue_id ID for the specific queue 2
1205 -- port Port this queue is attached to 0
1206 -- properties struct ofp_queue_prop_header properties [{"property": "MIN_RATE","rate": 80}]
1207 ================ ====================================================== ========================================
1211 $ curl -X GET http://localhost:8080/stats/queueconfig/1/1
1213 .. code-block:: javascript
1223 "property": "MIN_RATE",
1233 "property": "MAX_RATE",
1243 "property": "EXPERIMENTER",
1256 .. _get-queues-description:
1258 Get queues description
1259 ----------------------
1261 Get queues description of the switch which specified with Datapath ID, Port and Queue_id in URI.
1265 ======= =============================================
1267 URI /stats/queuedesc/<dpid>[/<port>/[<queue_id>]]
1268 ======= =============================================
1272 Specification of port number and queue id are optional.
1274 If you want to omitting the port number and setting the queue id,
1275 please specify the keyword "ALL" to the port number.
1277 e.g. GET http://localhost:8080/stats/queuedesc/1/ALL/1
1282 This message is available in OpenFlow1.4 or later.
1283 If Openflow1.3 or earlier is in use, please refer to :ref:`get-queues-config` instead.
1286 Response message body:
1288 ================ ====================================================== ========================================
1289 Attribute Description Example
1290 ================ ====================================================== ========================================
1291 dpid Datapath ID "1"
1292 len Length in bytes of this queue desc 88
1293 port_no Port which was queried 1
1295 properties struct ofp_queue_desc_prop_header [{"length": 8, ...},...]
1296 ================ ====================================================== ========================================
1300 $ curl -X GET http://localhost:8080/stats/queuedesc/1/1/1
1302 .. code-block:: javascript
1325 "experimenter": 101,
1327 "type": "EXPERIMENTER"
1343 Get groups stats of the switch which specified with Datapath ID in URI.
1347 ======= ================================
1349 URI /stats/group/<dpid>[/<group_id>]
1350 ======= ================================
1354 Specification of group id is optional.
1357 Response message body:
1359 ================ ============================================================== =========
1360 Attribute Description Example
1361 ================ ============================================================== =========
1362 dpid Datapath ID "1"
1363 length Length of this entry 56
1365 ref_count Number of flows or groups that directly forward to this group 1
1366 packet_count Number of packets processed by group 0
1367 byte_count Number of bytes processed by group 0
1368 duration_sec Time group has been alive in seconds 161
1369 duration_nsec Time group has been alive in nanoseconds beyond duration_sec 3.03e+08
1370 bucket_stats struct ofp_bucket_counter
1371 -- packet_count Number of packets processed by bucket 0
1372 -- byte_count Number of bytes processed by bucket 0
1373 ================ ============================================================== =========
1377 $ curl -X GET http://localhost:8080/stats/group/1
1379 .. code-block:: javascript
1389 "duration_sec": 161,
1390 "duration_nsec": 3.03e+08,
1402 .. _get-group-description-stats:
1404 Get group description stats
1405 ---------------------------
1407 Get group description stats of the switch which specified with Datapath ID in URI.
1409 Usage(Openflow1.4 or earlier):
1411 ======= ========================
1413 URI /stats/groupdesc/<dpid>
1414 ======= ========================
1416 Usage(Openflow1.5 or later):
1418 ======= ====================================
1420 URI /stats/groupdesc/<dpid>/[<group_id>]
1421 ======= ====================================
1425 Specification of group id is optional.
1428 Response message body(Openflow1.3 or earlier):
1430 =============== ======================================================= =============
1431 Attribute Description Example
1432 =============== ======================================================= =============
1433 dpid Datapath ID "1"
1434 type One of OFPGT_* "ALL"
1436 buckets struct ofp_bucket
1437 -- weight Relative weight of bucket 0
1438 (Only defined for select groups)
1439 -- watch_port Port whose state affects whether this bucket is live 4294967295
1440 (Only required for fast failover groups)
1441 -- watch_group Group whose state affects whether this bucket is live 4294967295
1442 (Only required for fast failover groups)
1443 -- actions 0 or more actions associated with the bucket ["OUTPUT:1"]
1444 =============== ======================================================= =============
1446 Response message body(Openflow1.4 or later):
1448 =============== ======================================================= ====================================
1449 Attribute Description Example
1450 =============== ======================================================= ====================================
1451 dpid Datapath ID "1"
1452 type One of OFPGT_* "ALL"
1454 length Length of this entry 40
1455 buckets struct ofp_bucket
1456 -- weight Relative weight of bucket 0
1457 (Only defined for select groups)
1458 -- watch_port Port whose state affects whether this bucket is live 4294967295
1459 (Only required for fast failover groups)
1460 -- watch_group Group whose state affects whether this bucket is live 4294967295
1461 (Only required for fast failover groups)
1462 -- len Length the bucket in bytes, including this header and 32
1463 any adding to make it 64-bit aligned.
1464 -- actions 0 or more actions associated with the bucket [{"OUTPUT:1", "max_len": 65535,...}]
1465 =============== ======================================================= ====================================
1469 $ curl -X GET http://localhost:8080/stats/groupdesc/1
1471 Response (Openflow1.3 or earlier):
1473 .. code-block:: javascript
1483 "watch_port": 4294967295,
1484 "watch_group": 4294967295,
1494 Response (Openflow1.4 or later):
1496 .. code-block:: javascript
1524 Get group features stats
1525 ------------------------
1527 Get group features stats of the switch which specified with Datapath ID in URI.
1531 ======= ============================
1533 URI /stats/groupfeatures/<dpid>
1534 ======= ============================
1536 Response message body:
1538 ============== =========================================== ===============================================
1539 Attribute Description Example
1540 ============== =========================================== ===============================================
1541 dpid Datapath ID "1"
1542 types Bitmap of (1 << OFPGT_*) values supported []
1543 capabilities Bitmap of OFPGFC_* capability supported ["SELECT_WEIGHT","SELECT_LIVENESS","CHAINING"]
1544 max_groups Maximum number of groups for each type [{"ALL": 4294967040},...]
1545 actions Bitmaps of (1 << OFPAT_*) values supported [{"ALL": ["OUTPUT",...]},...]
1546 ============== =========================================== ===============================================
1550 $ curl -X GET http://localhost:8080/stats/groupfeatures/1
1552 .. code-block:: javascript
1568 "SELECT": 4294967040
1571 "INDIRECT": 4294967040
1614 Get meters stats of the switch which specified with Datapath ID in URI.
1618 ======= ================================
1620 URI /stats/meter/<dpid>[/<meter_id>]
1621 ======= ================================
1625 Specification of meter id is optional.
1628 Response message body:
1630 ===================== ============================================================= ========
1631 Attribute Description Example
1632 ===================== ============================================================= ========
1633 dpid Datapath ID "1"
1635 len Length in bytes of this stats 56
1636 flow_count Number of flows bound to meter 0
1637 packet_in_count Number of packets in input 0
1638 byte_in_count Number of bytes in input 0
1639 duration_sec Time meter has been alive in seconds 37
1640 duration_nsec Time meter has been alive in nanoseconds beyond duration_sec 988000
1641 band_stats struct ofp_meter_band_stats
1642 -- packet_band_count Number of packets in band 0
1643 -- byte_band_count Number of bytes in band 0
1644 ===================== ============================================================= ========
1648 $ curl -X GET http://localhost:8080/stats/meter/1
1650 .. code-block:: javascript
1658 "packet_in_count": 0,
1661 "duration_nsec": 988000,
1664 "packet_band_count": 0,
1665 "byte_band_count": 0
1673 .. _get-meter-config-stats:
1675 Get meter config stats
1676 ----------------------
1677 Get meter description stats
1678 ---------------------------
1680 Get meter config stats of the switch which specified with Datapath ID in URI.
1684 This message has been renamed in openflow 1.5.
1685 If Openflow 1.4 or earlier is in use, please used as Get meter description stats.
1686 If Openflow 1.5 or later is in use, please used as Get meter description stats.
1689 Usage(Openflow1.4 or earlier):
1691 ======= ======================================
1693 URI /stats/meterconfig/<dpid>[/<meter_id>]
1694 ======= ======================================
1696 Usage(Openflow1.5 or later):
1698 ======= ======================================
1700 URI /stats/meterdesc/<dpid>[/<meter_id>]
1701 ======= ======================================
1705 Specification of meter id is optional.
1708 Response message body:
1710 ============== ============================================ =========
1711 Attribute Description Example
1712 ============== ============================================ =========
1713 dpid Datapath ID "1"
1714 flags All OFPMC_* that apply "KBPS"
1716 bands struct ofp_meter_band_header
1717 -- type One of OFPMBT_* "DROP"
1718 -- rate Rate for this band 1000
1719 -- burst_size Size of bursts 0
1720 ============== ============================================ =========
1724 $ curl -X GET http://localhost:8080/stats/meterconfig/1
1726 .. code-block:: javascript
1747 Get meter features stats
1748 ------------------------
1750 Get meter features stats of the switch which specified with Datapath ID in URI.
1754 ======= ============================
1756 URI /stats/meterfeatures/<dpid>
1757 ======= ============================
1759 Response message body:
1761 ============= ============================================ ===========================
1762 Attribute Description Example
1763 ============= ============================================ ===========================
1764 dpid Datapath ID "1"
1765 max_meter Maximum number of meters 256
1766 band_types Bitmaps of (1 << OFPMBT_*) values supported ["DROP"]
1767 capabilities Bitmaps of "ofp_meter_flags" ["KBPS", "BURST", "STATS"]
1768 max_bands Maximum bands per meters 16
1769 max_color Maximum color value 8
1770 ============= ============================================ ===========================
1774 $ curl -X GET http://localhost:8080/stats/meterfeatures/1
1776 .. code-block:: javascript
1800 Get the current role of the controller from the switch.
1804 ======= =========================
1806 URI /stats/role/<dpid>
1807 ======= =========================
1809 Response message body(Openflow1.4 or earlier):
1811 ============= ============================= =========
1812 Attribute Description Example
1813 ============= ============================= =========
1815 role One of OFPCR_ROLE_* "EQUAL"
1816 generation_id Master Election Generation Id 0
1817 ============= ============================= =========
1819 Response message body(Openflow1.5 or later):
1821 ============= ============================= =========
1822 Attribute Description Example
1823 ============= ============================= =========
1825 role One of OFPCR_ROLE_* "EQUAL"
1826 short_id ID number for the controller 0
1827 generation_id Master Election Generation Id 0
1828 ============= ============================= =========
1832 $ curl -X GET http://localhost:8080/stats/role/1
1834 Response (Openflow1.4 or earlier):
1836 .. code-block:: javascript
1848 Response (Openflow1.5 or later):
1850 .. code-block:: javascript
1863 Update the switch stats
1864 =======================
1869 Add a flow entry to the switch.
1873 ======= =====================
1875 URI /stats/flowentry/add
1876 ======= =====================
1878 Request message body(Openflow1.3 or earlier):
1880 ============= ===================================================== ============================== ===============
1881 Attribute Description Example Default
1882 ============= ===================================================== ============================== ===============
1883 dpid Datapath ID (int) 1 (Mandatory)
1884 cookie Opaque controller-issued identifier (int) 1 0
1885 cookie_mask Mask used to restrict the cookie bits (int) 1 0
1886 table_id Table ID to put the flow in (int) 0 0
1887 idle_timeout Idle time before discarding (seconds) (int) 30 0
1888 hard_timeout Max time before discarding (seconds) (int) 30 0
1889 priority Priority level of flow entry (int) 11111 0
1890 buffer_id Buffered packet to apply to, or OFP_NO_BUFFER (int) 1 OFP_NO_BUFFER
1891 flags Bitmap of OFPFF_* flags (int) 1 0
1892 match Fields to match (dict) {"in_port":1} {} #wildcarded
1893 actions Instruction set (list of dict) [{"type":"OUTPUT", "port":2}] [] #DROP
1894 ============= ===================================================== ============================== ===============
1896 Request message body(Openflow1.4 or later):
1898 ============= ===================================================== ================================ ===============
1899 Attribute Description Example Default
1900 ============= ===================================================== ================================ ===============
1901 dpid Datapath ID (int) 1 (Mandatory)
1902 cookie Opaque controller-issued identifier (int) 1 0
1903 cookie_mask Mask used to restrict the cookie bits (int) 1 0
1904 table_id Table ID to put the flow in (int) 0 0
1905 idle_timeout Idle time before discarding (seconds) (int) 30 0
1906 hard_timeout Max time before discarding (seconds) (int) 30 0
1907 priority Priority level of flow entry (int) 11111 0
1908 buffer_id Buffered packet to apply to, or OFP_NO_BUFFER (int) 1 OFP_NO_BUFFER
1909 flags Bitmap of OFPFF_* flags (int) 1 0
1910 match Fields to match (dict) {"in_port":1} {} #wildcarded
1911 instructions Instruction set (list of dict) [{"type":"METER", "meter_id":2}] [] #DROP
1912 ============= ===================================================== ================================ ===============
1916 For description of match and actions, please see :ref:`description-of-match-and-actions`.
1918 Example of use(Openflow1.3 or earlier):
1922 $ curl -X POST -d '{
1940 }' http://localhost:8080/stats/flowentry/add
1944 $ curl -X POST -d '{
1952 "type":"GOTO_TABLE",
1956 }' http://localhost:8080/stats/flowentry/add
1960 $ curl -X POST -d '{
1968 "type":"WRITE_METADATA",
1973 }' http://localhost:8080/stats/flowentry/add
1977 $ curl -X POST -d '{
1989 }' http://localhost:8080/stats/flowentry/add
1991 Example of use(Openflow1.4 or later):
1995 $ curl -X POST -d '{
2009 "type": "APPLY_ACTIONS",
2019 }' http://localhost:8080/stats/flowentry/add
2023 $ curl -X POST -d '{
2031 "type":"GOTO_TABLE",
2035 }' http://localhost:8080/stats/flowentry/add
2039 $ curl -X POST -d '{
2047 "type":"WRITE_METADATA",
2052 }' http://localhost:8080/stats/flowentry/add
2056 $ curl -X POST -d '{
2068 }' http://localhost:8080/stats/flowentry/add
2072 To confirm flow entry registration, please see :ref:`get-all-flows-stats` or :ref:`get-flows-stats-filtered`.
2075 Modify all matching flow entries
2076 --------------------------------
2078 Modify all matching flow entries of the switch.
2082 ======= ========================
2084 URI /stats/flowentry/modify
2085 ======= ========================
2087 Request message body:
2089 ============= ===================================================== ============================== ===============
2090 Attribute Description Example Default
2091 ============= ===================================================== ============================== ===============
2092 dpid Datapath ID (int) 1 (Mandatory)
2093 cookie Opaque controller-issued identifier (int) 1 0
2094 cookie_mask Mask used to restrict the cookie bits (int) 1 0
2095 table_id Table ID to put the flow in (int) 0 0
2096 idle_timeout Idle time before discarding (seconds) (int) 30 0
2097 hard_timeout Max time before discarding (seconds) (int) 30 0
2098 priority Priority level of flow entry (int) 11111 0
2099 buffer_id Buffered packet to apply to, or OFP_NO_BUFFER (int) 1 OFP_NO_BUFFER
2100 flags Bitmap of OFPFF_* flags (int) 1 0
2101 match Fields to match (dict) {"in_port":1} {} #wildcarded
2102 actions Instruction set (list of dict) [{"type":"OUTPUT", "port":2}] [] #DROP
2103 ============= ===================================================== ============================== ===============
2107 $ curl -X POST -d '{
2125 }' http://localhost:8080/stats/flowentry/modify
2128 Modify flow entry strictly
2129 --------------------------
2131 Modify flow entry strictly matching wildcards and priority
2135 ======= ===============================
2137 URI /stats/flowentry/modify_strict
2138 ======= ===============================
2140 Request message body:
2142 ============= ===================================================== ============================== ===============
2143 Attribute Description Example Default
2144 ============= ===================================================== ============================== ===============
2145 dpid Datapath ID (int) 1 (Mandatory)
2146 cookie Opaque controller-issued identifier (int) 1 0
2147 cookie_mask Mask used to restrict the cookie bits (int) 1 0
2148 table_id Table ID to put the flow in (int) 0 0
2149 idle_timeout Idle time before discarding (seconds) (int) 30 0
2150 hard_timeout Max time before discarding (seconds) (int) 30 0
2151 priority Priority level of flow entry (int) 11111 0
2152 buffer_id Buffered packet to apply to, or OFP_NO_BUFFER (int) 1 OFP_NO_BUFFER
2153 flags Bitmap of OFPFF_* flags (int) 1 0
2154 match Fields to match (dict) {"in_port":1} {} #wildcarded
2155 actions Instruction set (list of dict) [{"type":"OUTPUT", "port":2}] [] #DROP
2156 ============= ===================================================== ============================== ===============
2160 $ curl -X POST -d '{
2178 }' http://localhost:8080/stats/flowentry/modify_strict
2181 Delete all matching flow entries
2182 --------------------------------
2184 Delete all matching flow entries of the switch.
2188 ======= ========================
2190 URI /stats/flowentry/delete
2191 ======= ========================
2193 Request message body:
2195 ============= ===================================================== ============================== ===============
2196 Attribute Description Example Default
2197 ============= ===================================================== ============================== ===============
2198 dpid Datapath ID (int) 1 (Mandatory)
2199 cookie Opaque controller-issued identifier (int) 1 0
2200 cookie_mask Mask used to restrict the cookie bits (int) 1 0
2201 table_id Table ID to put the flow in (int) 0 0
2202 idle_timeout Idle time before discarding (seconds) (int) 30 0
2203 hard_timeout Max time before discarding (seconds) (int) 30 0
2204 priority Priority level of flow entry (int) 11111 0
2205 buffer_id Buffered packet to apply to, or OFP_NO_BUFFER (int) 1 OFP_NO_BUFFER
2206 out_port Output port (int) 1 OFPP_ANY
2207 out_group Output group (int) 1 OFPG_ANY
2208 flags Bitmap of OFPFF_* flags (int) 1 0
2209 match Fields to match (dict) {"in_port":1} {} #wildcarded
2210 actions Instruction set (list of dict) [{"type":"OUTPUT", "port":2}] [] #DROP
2211 ============= ===================================================== ============================== ===============
2215 $ curl -X POST -d '{
2233 }' http://localhost:8080/stats/flowentry/delete
2236 Delete flow entry strictly
2237 --------------------------
2239 Delete flow entry strictly matching wildcards and priority.
2243 ======= ===============================
2245 URI /stats/flowentry/delete_strict
2246 ======= ===============================
2248 Request message body:
2250 ============= ===================================================== ============================== ===============
2251 Attribute Description Example Default
2252 ============= ===================================================== ============================== ===============
2253 dpid Datapath ID (int) 1 (Mandatory)
2254 cookie Opaque controller-issued identifier (int) 1 0
2255 cookie_mask Mask used to restrict the cookie bits (int) 1 0
2256 table_id Table ID to put the flow in (int) 0 0
2257 idle_timeout Idle time before discarding (seconds) (int) 30 0
2258 hard_timeout Max time before discarding (seconds) (int) 30 0
2259 priority Priority level of flow entry (int) 11111 0
2260 buffer_id Buffered packet to apply to, or OFP_NO_BUFFER (int) 1 OFP_NO_BUFFER
2261 out_port Output port (int) 1 OFPP_ANY
2262 out_group Output group (int) 1 OFPG_ANY
2263 flags Bitmap of OFPFF_* flags (int) 1 0
2264 match Fields to match (dict) {"in_port":1} {} #wildcarded
2265 actions Instruction set (list of dict) [{"type":"OUTPUT", "port":2}] [] #DROP
2266 ============= ===================================================== ============================== ===============
2270 $ curl -X POST -d '{
2288 }' http://localhost:8080/stats/flowentry/delete_strict
2291 Delete all flow entries
2292 -----------------------
2294 Delete all flow entries of the switch which specified with Datapath ID in URI.
2298 ======= ==============================
2300 URI /stats/flowentry/clear/<dpid>
2301 ======= ==============================
2305 $ curl -X DELETE http://localhost:8080/stats/flowentry/clear/1
2311 Add a group entry to the switch.
2315 ======= ======================
2317 URI /stats/groupentry/add
2318 ======= ======================
2320 Request message body:
2322 =============== ============================================================ ================================ ============
2323 Attribute Description Example Default
2324 =============== ============================================================ ================================ ============
2325 dpid Datapath ID (int) 1 (Mandatory)
2326 type One of OFPGT_* (string) "ALL" "ALL"
2327 group_id Group ID (int) 1 0
2328 buckets struct ofp_bucket
2329 -- weight Relative weight of bucket 0 0
2330 (Only defined for select groups)
2331 -- watch_port Port whose state affects whether this bucket is live 4294967295 OFPP_ANY
2332 (Only required for fast failover groups)
2333 -- watch_group Group whose state affects whether this bucket is live 4294967295 OFPG_ANY
2334 (Only required for fast failover groups)
2335 -- actions 0 or more actions associated with the bucket (list of dict) [{"type": "OUTPUT", "port": 1}] [] #DROP
2336 =============== ============================================================ ================================ ============
2340 $ curl -X POST -d '{
2354 }' http://localhost:8080/stats/groupentry/add
2358 To confirm group entry registration, please see :ref:`get-group-description-stats`.
2361 Modify a group entry
2362 --------------------
2364 Modify a group entry to the switch.
2368 ======= =========================
2370 URI /stats/groupentry/modify
2371 ======= =========================
2373 Request message body:
2375 =============== ============================================================ ================================ ============
2376 Attribute Description Example Default
2377 =============== ============================================================ ================================ ============
2378 dpid Datapath ID (int) 1 (Mandatory)
2379 type One of OFPGT_* (string) "ALL" "ALL"
2380 group_id Group ID (int) 1 0
2381 buckets struct ofp_bucket
2382 -- weight Relative weight of bucket 0 0
2383 (Only defined for select groups)
2384 -- watch_port Port whose state affects whether this bucket is live 4294967295 OFPP_ANY
2385 (Only required for fast failover groups)
2386 -- watch_group Group whose state affects whether this bucket is live 4294967295 OFPG_ANY
2387 (Only required for fast failover groups)
2388 -- actions 0 or more actions associated with the bucket (list of dict) [{"type": "OUTPUT", "port": 1}] [] #DROP
2389 =============== ============================================================ ================================ ============
2393 $ curl -X POST -d '{
2407 }' http://localhost:8080/stats/groupentry/modify
2410 Delete a group entry
2411 --------------------
2413 Delete a group entry to the switch.
2417 ======= =========================
2419 URI /stats/groupentry/delete
2420 ======= =========================
2422 Request message body:
2424 =========== ======================== ======== ============
2425 Attribute Description Example Default
2426 =========== ======================== ======== ============
2427 dpid Datapath ID (int) 1 (Mandatory)
2428 group_id Group ID (int) 1 0
2429 =========== ======================== ======== ============
2433 $ curl -X POST -d '{
2436 }' http://localhost:8080/stats/groupentry/delete
2439 Modify the behavior of the port
2440 -------------------------------
2442 Modify the behavior of the physical port.
2446 ======= =======================
2448 URI /stats/portdesc/modify
2449 ======= =======================
2451 Request message body:
2453 =========== ============================================ ======== ============
2454 Attribute Description Example Default
2455 =========== ============================================ ======== ============
2456 dpid Datapath ID (int) 1 (Mandatory)
2457 port_no Port number (int) 1 0
2458 config Bitmap of OFPPC_* flags (int) 1 0
2459 mask Bitmap of OFPPC_* flags to be changed (int) 1 0
2460 =========== ============================================ ======== ============
2464 $ curl -X POST -d '{
2469 }' http://localhost:8080/stats/portdesc/modify
2473 To confirm port description, please see :ref:`get-ports-description`.
2479 Add a meter entry to the switch.
2483 ======= ======================
2485 URI /stats/meterentry/add
2486 ======= ======================
2488 Request message body:
2490 ============== =============================== ========= ============
2491 Attribute Description Example Default
2492 ============== =============================== ========= ============
2493 dpid Datapath ID (int) 1 (Mandatory)
2494 flags Bitmap of OFPMF_* flags (list) ["KBPS"] [] #Empty
2495 meter_id Meter ID (int) 1 0
2496 bands struct ofp_meter_band_header
2497 -- type One of OFPMBT_* (string) "DROP" None
2498 -- rate Rate for this band (int) 1000 None
2499 -- burst_size Size of bursts (int) 100 None
2500 ============== =============================== ========= ============
2504 $ curl -X POST -d '{
2514 }' http://localhost:8080/stats/meterentry/add
2518 To confirm meter entry registration, please see :ref:`get-meter-config-stats`.
2521 Modify a meter entry
2522 --------------------
2524 Modify a meter entry to the switch.
2528 ======= =========================
2530 URI /stats/meterentry/modify
2531 ======= =========================
2533 Request message body:
2535 ============== =============================== ========= ============
2536 Attribute Description Example Default
2537 ============== =============================== ========= ============
2538 dpid Datapath ID (int) 1 (Mandatory)
2539 flags Bitmap of OFPMF_* flags (list) ["KBPS"] [] #Empty
2540 meter_id Meter ID (int) 1 0
2541 bands struct ofp_meter_band_header
2542 -- type One of OFPMBT_* (string) "DROP" None
2543 -- rate Rate for this band (int) 1000 None
2544 -- burst_size Size of bursts (int) 100 None
2545 ============== =============================== ========= ============
2549 $ curl -X POST -d '{
2559 }' http://localhost:8080/stats/meterentry/modify
2562 Delete a meter entry
2563 --------------------
2565 Delete a meter entry to the switch.
2569 ======= =========================
2571 URI /stats/meterentry/delete
2572 ======= =========================
2574 Request message body:
2576 =========== ================== ========= ============
2577 Attribute Description Example Default
2578 =========== ================== ========= ============
2579 dpid Datapath ID (int) 1 (Mandatory)
2580 meter_id Meter ID (int) 1 0
2581 =========== ================== ========= ============
2585 $ curl -X POST -d '{
2588 }' http://localhost:8080/stats/meterentry/delete
2591 --------------------
2593 modify the role of the switch.
2597 ======= =========================
2600 ======= =========================
2602 Request message body:
2604 =========== ============================ ========= =================
2605 Attribute Description Example Default
2606 =========== ============================ ========= =================
2607 dpid Datapath ID (int) 1 (Mandatory)
2608 role One of OFPCR_ROLE_*(string) "MASTER" OFPCR_ROLE_EQUAL
2609 =========== ============================ ========= =================
2613 $ curl -X POST -d '{
2616 }' http://localhost:8080/stats/role
2618 Support for experimenter multipart
2619 ==================================
2621 Send a experimenter message
2622 ---------------------------
2624 Send a experimenter message to the switch which specified with Datapath ID in URI.
2629 ======= ===========================
2631 URI /stats/experimenter/<dpid>
2632 ======= ===========================
2634 Request message body:
2636 ============= ============================================ ======== ============
2637 Attribute Description Example Default
2638 ============= ============================================ ======== ============
2639 dpid Datapath ID (int) 1 (Mandatory)
2640 experimenter Experimenter ID (int) 1 0
2641 exp_type Experimenter defined (int) 1 0
2642 data_type Data format type ("ascii" or "base64") "ascii" "ascii"
2643 data Data to send (string) "data" "" #Empty
2644 ============= ============================================ ======== ============
2648 $ curl -X POST -d '{
2652 "data_type": "ascii",
2654 }' http://localhost:8080/stats/experimenter/1
2657 .. _description-of-match-and-actions:
2659 Reference: Description of Match and Actions
2660 ===========================================
2662 Description of Match on request messages
2663 ----------------------------------------
2665 List of Match fields (OpenFlow1.0):
2667 =============== ================================================ ==============================================
2668 Match field Description Example
2669 =============== ================================================ ==============================================
2670 in_port Input switch port (int) {"in_port": 7}
2671 dl_src Ethernet source address (string) {"dl_src": "aa:bb:cc:11:22:33"}
2672 dl_dst Ethernet destination address (string) {"dl_dst": "aa:bb:cc:11:22:33"}
2673 dl_vlan Input VLAN id (int) {"dl_vlan": 5}
2674 dl_vlan_pcp Input VLAN priority (int) {"dl_vlan_pcp": 3, "dl_vlan": 3}
2675 dl_type Ethernet frame type (int) {"dl_type": 123}
2676 nw_tos IP ToS (int) {"nw_tos": 16, "dl_type": 2048}
2677 nw_proto IP protocol or lower 8 bits of ARP opcode (int) {"nw_proto": 5, "dl_type": 2048}
2678 nw_src IPv4 source address (string) {"nw_src": "192.168.0.1", "dl_type": 2048}
2679 nw_dst IPv4 destination address (string) {"nw_dst": "192.168.0.1/24", "dl_type": 2048}
2680 tp_src TCP/UDP source port (int) {"tp_src": 1, "nw_proto": 6, "dl_type": 2048}
2681 tp_dst TCP/UDP destination port (int) {"tp_dst": 2, "nw_proto": 6, "dl_type": 2048}
2682 =============== ================================================ ==============================================
2686 IPv4 address field can be described as IP Prefix like as follows.
2693 List of Match fields (OpenFlow1.2 or later):
2695 =============== ================================================== =======================================================================================================
2696 Match field Description Example
2697 =============== ================================================== =======================================================================================================
2698 in_port Switch input port (int) {"in_port": 7}
2699 in_phy_port Switch physical input port (int) {"in_phy_port": 5, "in_port": 3}
2700 metadata Metadata passed between tables (int or string) {"metadata": 12345} or {"metadata": "0x1212/0xffff"}
2701 eth_dst Ethernet destination address (string) {"eth_dst": "aa:bb:cc:11:22:33/00:00:00:00:ff:ff"}
2702 eth_src Ethernet source address (string) {"eth_src": "aa:bb:cc:11:22:33"}
2703 eth_type Ethernet frame type (int) {"eth_type": 2048}
2704 vlan_vid VLAN id (int or string) See :ref:`example-of-vlan-id-match-field`
2705 vlan_pcp VLAN priority (int) {"vlan_pcp": 3, "vlan_vid": 3}
2706 ip_dscp IP DSCP (6 bits in ToS field) (int) {"ip_dscp": 3, "eth_type": 2048}
2707 ip_ecn IP ECN (2 bits in ToS field) (int) {"ip_ecn": 0, "eth_type": 34525}
2708 ip_proto IP protocol (int) {"ip_proto": 5, "eth_type": 34525}
2709 ipv4_src IPv4 source address (string) {"ipv4_src": "192.168.0.1", "eth_type": 2048}
2710 ipv4_dst IPv4 destination address (string) {"ipv4_dst": "192.168.10.10/255.255.255.0", "eth_type": 2048}
2711 tcp_src TCP source port (int) {"tcp_src": 3, "ip_proto": 6, "eth_type": 2048}
2712 tcp_dst TCP destination port (int) {"tcp_dst": 5, "ip_proto": 6, "eth_type": 2048}
2713 udp_src UDP source port (int) {"udp_src": 2, "ip_proto": 17, "eth_type": 2048}
2714 udp_dst UDP destination port (int) {"udp_dst": 6, "ip_proto": 17, "eth_type": 2048}
2715 sctp_src SCTP source port (int) {"sctp_src": 99, "ip_proto": 132, "eth_type": 2048}
2716 sctp_dst SCTP destination port (int) {"sctp_dst": 99, "ip_proto": 132, "eth_type": 2048}
2717 icmpv4_type ICMP type (int) {"icmpv4_type": 5, "ip_proto": 1, "eth_type": 2048}
2718 icmpv4_code ICMP code (int) {"icmpv4_code": 6, "ip_proto": 1, "eth_type": 2048}
2719 arp_op ARP opcode (int) {"arp_op": 3, "eth_type": 2054}
2720 arp_spa ARP source IPv4 address (string) {"arp_spa": "192.168.0.11", "eth_type": 2054}
2721 arp_tpa ARP target IPv4 address (string) {"arp_tpa": "192.168.0.44/24", "eth_type": 2054}
2722 arp_sha ARP source hardware address (string) {"arp_sha": "aa:bb:cc:11:22:33", "eth_type": 2054}
2723 arp_tha ARP target hardware address (string) {"arp_tha": "aa:bb:cc:11:22:33/00:00:00:00:ff:ff", "eth_type": 2054}
2724 ipv6_src IPv6 source address (string) {"ipv6_src": "2001::aaaa:bbbb:cccc:1111", "eth_type": 34525}
2725 ipv6_dst IPv6 destination address (string) {"ipv6_dst": "2001::ffff:cccc:bbbb:1111/64", "eth_type": 34525}
2726 ipv6_flabel IPv6 Flow Label (int) {"ipv6_flabel": 2, "eth_type": 34525}
2727 icmpv6_type ICMPv6 type (int) {"icmpv6_type": 3, "ip_proto": 58, "eth_type": 34525}
2728 icmpv6_code ICMPv6 code (int) {"icmpv6_code": 4, "ip_proto": 58, "eth_type": 34525}
2729 ipv6_nd_target Target address for Neighbor Discovery (string) {"ipv6_nd_target": "2001::ffff:cccc:bbbb:1111", "icmpv6_type": 135, "ip_proto": 58, "eth_type": 34525}
2730 ipv6_nd_sll Source link-layer for Neighbor Discovery (string) {"ipv6_nd_sll": "aa:bb:cc:11:22:33", "icmpv6_type": 135, "ip_proto": 58, "eth_type": 34525}
2731 ipv6_nd_tll Target link-layer for Neighbor Discovery (string) {"ipv6_nd_tll": "aa:bb:cc:11:22:33", "icmpv6_type": 136, "ip_proto": 58, "eth_type": 34525}
2732 mpls_label MPLS label (int) {"mpls_label": 3, "eth_type": 34888}
2733 mpls_tc MPLS Traffic Class (int) {"mpls_tc": 2, "eth_type": 34888}
2734 mpls_bos MPLS BoS bit (int) {"mpls_bos": 1, "eth_type": 34888}
2736 pbb_isid PBB I-SID (int or string) {"pbb_isid": 5, "eth_type": 35047} or{"pbb_isid": "0x05/0xff", "eth_type": 35047}
2738 tunnel_id Logical Port Metadata (int or string) {"tunnel_id": 7} or {"tunnel_id": "0x07/0xff"}
2740 ipv6_exthdr IPv6 Extension Header pseudo-field (int or string) {"ipv6_exthdr": 3, "eth_type": 34525} or {"ipv6_exthdr": "0x40/0x1F0", "eth_type": 34525}
2742 pbb_uca PBB UCA hander field(int) {"pbb_uca": 1, "eth_type": 35047}
2744 tcp_flags TCP flags(int) {"tcp_flags": 2, "ip_proto": 6, "eth_type": 2048}
2746 actset_output Output port from action set metadata(int) {"actset_output": 3}
2748 packet_type Packet type value(int) {"packet_type": [1, 2048]}
2750 =============== ================================================== =======================================================================================================
2754 Some field can be described with mask like as follows.
2759 "aa:bb:cc:11:22:33/00:00:00:00:ff:ff"
2765 "192.168.10.10/255.255.255.0"
2769 "2001::ffff:cccc:bbbb:1111"
2770 "2001::ffff:cccc:bbbb:2222/64"
2771 "2001::ffff:cccc:bbbb:2222/ffff:ffff:ffff:ffff::0"
2775 "0x1212121212121212"
2776 "0x3434343434343434/0x01010101010101010"
2779 .. _example-of-vlan-id-match-field:
2781 Example of VLAN ID match field
2782 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2784 The following is available in OpenFlow1.0 or later.
2786 - To match only packets with VLAN tag and VLAN ID equal value 5::
2788 $ curl -X POST -d '{
2799 }' http://localhost:8080/stats/flowentry/add
2802 When "dl_vlan" field is described as decimal int value, OFPVID_PRESENT(0x1000) bit is automatically applied.
2804 The following is available in OpenFlow1.2 or later.
2806 - To match only packets without a VLAN tag::
2808 $ curl -X POST -d '{
2811 "dl_vlan": "0x0000" # Describe OFPVID_NONE(0x0000)
2819 }' http://localhost:8080/stats/flowentry/add
2821 - To match only packets with a VLAN tag regardless of its value::
2823 $ curl -X POST -d '{
2826 "dl_vlan": "0x1000/0x1000" # Describe OFPVID_PRESENT(0x1000/0x1000)
2834 }' http://localhost:8080/stats/flowentry/add
2836 - To match only packets with VLAN tag and VLAN ID equal value 5::
2838 $ curl -X POST -d '{
2841 "dl_vlan": "0x1005" # Describe sum of VLAN-ID(e.g. 5) | OFPVID_PRESENT(0x1000)
2849 }' http://localhost:8080/stats/flowentry/add
2852 When using the descriptions for OpenFlow1.2 or later, please describe "dl_vlan" field as hexadecimal string value,
2853 and OFPVID_PRESENT(0x1000) bit is NOT automatically applied.
2857 Description of Actions on request messages
2858 ------------------------------------------
2860 List of Actions (OpenFlow1.0):
2862 =============== ============================================================================ ======================================================
2863 Actions Description Example
2864 =============== ============================================================================ ======================================================
2865 OUTPUT Output packet from "port" {"type": "OUTPUT", "port": 3}
2866 SET_VLAN_VID Set the 802.1Q VLAN ID using "vlan_vid" {"type": "SET_VLAN_VID", "vlan_vid": 5}
2867 SET_VLAN_PCP Set the 802.1Q priority using "vlan_pcp" {"type": "SET_VLAN_PCP", "vlan_pcp": 3}
2868 STRIP_VLAN Strip the 802.1Q header {"type": "STRIP_VLAN"}
2869 SET_DL_SRC Set ethernet source address using "dl_src" {"type": "SET_DL_SRC", "dl_src": "aa:bb:cc:11:22:33"}
2870 SET_DL_DST Set ethernet destination address using "dl_dst" {"type": "SET_DL_DST", "dl_dst": "aa:bb:cc:11:22:33"}
2871 SET_NW_SRC IP source address using "nw_src" {"type": "SET_NW_SRC", "nw_src": "10.0.0.1"}
2872 SET_NW_DST IP destination address using "nw_dst" {"type": "SET_NW_DST", "nw_dst": "10.0.0.1"}
2873 SET_NW_TOS Set IP ToS (DSCP field, 6 bits) using "nw_tos" {"type": "SET_NW_TOS", "nw_tos": 184}
2874 SET_TP_SRC Set TCP/UDP source port using "tp_src" {"type": "SET_TP_SRC", "tp_src": 8080}
2875 SET_TP_DST Set TCP/UDP destination port using "tp_dst" {"type": "SET_TP_DST", "tp_dst": 8080}
2876 ENQUEUE Output to queue with "queue_id" attached to "port" {"type": "ENQUEUE", "queue_id": 3, "port": 1}
2877 =============== ============================================================================ ======================================================
2879 List of Actions (OpenFlow1.2 or later):
2881 =============== ============================================================================ ========================================================================================================================
2882 Actions Description Example
2883 =============== ============================================================================ ========================================================================================================================
2884 OUTPUT Output packet from "port" {"type": "OUTPUT", "port": 3}
2885 COPY_TTL_OUT Copy TTL outwards {"type": "COPY_TTL_OUT"}
2886 COPY_TTL_IN Copy TTL inwards {"type": "COPY_TTL_IN"}
2887 SET_MPLS_TTL Set MPLS TTL using "mpls_ttl" {"type": "SET_MPLS_TTL", "mpls_ttl": 64}
2888 DEC_MPLS_TTL Decrement MPLS TTL {"type": "DEC_MPLS_TTL"}
2889 PUSH_VLAN Push a new VLAN tag with "ethertype" {"type": "PUSH_VLAN", "ethertype": 33024}
2890 POP_VLAN Pop the outer VLAN tag {"type": "POP_VLAN"}
2891 PUSH_MPLS Push a new MPLS tag with "ethertype" {"type": "PUSH_MPLS", "ethertype": 34887}
2892 POP_MPLS Pop the outer MPLS tag with "ethertype" {"type": "POP_MPLS", "ethertype": 2054}
2893 SET_QUEUE Set queue id using "queue_id" when outputting to a port {"type": "SET_QUEUE", "queue_id": 7}
2894 GROUP Apply group identified by "group_id" {"type": "GROUP", "group_id": 5}
2895 SET_NW_TTL Set IP TTL using "nw_ttl" {"type": "SET_NW_TTL", "nw_ttl": 64}
2896 DEC_NW_TTL Decrement IP TTL {"type": "DEC_NW_TTL"}
2897 SET_FIELD Set a "field" using "value" See :ref:`example-of-set-field-action`
2898 (The set of keywords available for "field" is the same as match field)
2899 PUSH_PBB Push a new PBB service tag with "ethertype" {"type": "PUSH_PBB", "ethertype": 35047}
2901 POP_PBB Pop the outer PBB service tag {"type": "POP_PBB"}
2903 COPY_FIELD Copy value between header and register {"type": "COPY_FIELD", "n_bits": 32, "src_offset": 1, "dst_offset": 2, "src_oxm_id": "eth_src", "dst_oxm_id": "eth_dst"}
2905 METER Apply meter identified by "meter_id" {"type": "METER", "meter_id": 3}
2907 EXPERIMENTER Extensible action for the experimenter {"type": "EXPERIMENTER", "experimenter": 101, "data": "AAECAwQFBgc=", "data_type": "base64"}
2908 (Set "base64" or "ascii" to "data_type" field)
2909 GOTO_TABLE (Instruction) Setup the next table identified by "table_id" {"type": "GOTO_TABLE", "table_id": 8}
2910 WRITE_METADATA (Instruction) Setup the metadata field using "metadata" and "metadata_mask" {"type": "WRITE_METADATA", "metadata": 0x3, "metadata_mask": 0x3}
2911 METER (Instruction) Apply meter identified by "meter_id" {"type": "METER", "meter_id": 3}
2912 (deprecated in Openflow1.5)
2913 WRITE_ACTIONS (Instruction) Write the action(s) onto the datapath action set {"type": "WRITE_ACTIONS", actions":[{"type":"POP_VLAN",},{ "type":"OUTPUT", "port": 2}]}
2914 CLEAR_ACTIONS (Instruction) Clears all actions from the datapath action set {"type": "CLEAR_ACTIONS"}
2915 =============== ============================================================================ ========================================================================================================================
2919 .. _example-of-set-field-action:
2921 Example of set-field action
2922 ^^^^^^^^^^^^^^^^^^^^^^^^^^^
2924 To set VLAN ID to non-VLAN-tagged frame::
2926 $ curl -X POST -d '{
2933 "type": "PUSH_VLAN", # Push a new VLAN tag if a input frame is non-VLAN-tagged
2934 "ethertype": 33024 # Ethertype 0x8100(=33024): IEEE 802.1Q VLAN-tagged frame
2937 "type": "SET_FIELD",
2938 "field": "vlan_vid", # Set VLAN ID
2939 "value": 4102 # Describe sum of vlan_id(e.g. 6) | OFPVID_PRESENT(0x1000=4096)
2946 }' http://localhost:8080/stats/flowentry/add