3 AT_SETUP([ofproto - echo request])
5 AT_CHECK([ovs-ofctl -vwarn probe br0])
9 AT_SETUP([ofproto - handling messages with bad version])
12 # Start a monitor running OpenFlow 1.0, then send the switch an OF1.1 features
14 AT_CHECK([ovs-ofctl -P openflow10 monitor br0 --detach --no-chdir --pidfile])
15 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
16 AT_CAPTURE_FILE([monitor.log])
17 ovs-appctl -t ovs-ofctl ofctl/send 0205000801234567
18 ovs-appctl -t ovs-ofctl ofctl/barrier
19 ovs-appctl -t ovs-ofctl exit
21 AT_CHECK([sed 's/ (xid=0x[[0-9a-fA-F]]*)//
22 /ECHO/d' monitor.log], [0], [dnl
23 send: OFPT_FEATURES_REQUEST (OF1.1):
24 OFPT_ERROR (OF1.1): OFPBRC_BAD_VERSION
25 OFPT_FEATURES_REQUEST (OF1.1):
29 OVS_VSWITCHD_STOP(["/received OpenFlow version 0x02 != expected 01/d"])
32 AT_SETUP([ofproto - feature request, config request])
34 AT_CHECK([ovs-ofctl -vwarn show br0], [0], [stdout])
35 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
36 OFPT_FEATURES_REPLY: dpid:fedcba9876543210
37 n_tables:254, n_buffers:256
38 capabilities: FLOW_STATS TABLE_STATS PORT_STATS QUEUE_STATS ARP_MATCH_IP
39 actions: OUTPUT SET_VLAN_VID SET_VLAN_PCP STRIP_VLAN SET_DL_SRC SET_DL_DST SET_NW_SRC SET_NW_DST SET_NW_TOS SET_TP_SRC SET_TP_DST ENQUEUE
40 LOCAL(br0): addr:aa:55:aa:55:00:00
43 speed: 0 Mbps now, 0 Mbps max
44 OFPT_GET_CONFIG_REPLY: frags=normal miss_send_len=0
49 AT_SETUP([ofproto - set OpenFlow port number])
51 [add-port br0 p1 -- set Interface p1 type=dummy --\
52 add-port br0 p2 -- set Interface p2 type=dummy ofport_request=99])
53 AT_CHECK([ovs-ofctl -vwarn show br0], [0], [stdout])
55 s/ (xid=0x[0-9a-fA-F]*)//
56 s/00:0.$/00:0x/' < stdout]],
58 OFPT_FEATURES_REPLY: dpid:fedcba9876543210
59 n_tables:254, n_buffers:256
60 capabilities: FLOW_STATS TABLE_STATS PORT_STATS QUEUE_STATS ARP_MATCH_IP
61 actions: OUTPUT SET_VLAN_VID SET_VLAN_PCP STRIP_VLAN SET_DL_SRC SET_DL_DST SET_NW_SRC SET_NW_DST SET_NW_TOS SET_TP_SRC SET_TP_DST ENQUEUE
62 1(p1): addr:aa:55:aa:55:00:0x
65 speed: 0 Mbps now, 0 Mbps max
66 99(p2): addr:aa:55:aa:55:00:0x
69 speed: 0 Mbps now, 0 Mbps max
70 LOCAL(br0): addr:aa:55:aa:55:00:0x
73 speed: 0 Mbps now, 0 Mbps max
74 OFPT_GET_CONFIG_REPLY: frags=normal miss_send_len=0
80 dnl This is really bare-bones.
81 dnl It at least checks request and reply serialization and deserialization.
82 AT_SETUP([ofproto - port stats - (OpenFlow 1.0)])
84 AT_CHECK([ovs-ofctl -vwarn dump-ports br0], [0], [stdout])
85 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
86 OFPST_PORT reply: 1 ports
87 port LOCAL: rx pkts=0, bytes=0, drop=0, errs=0, frame=0, over=0, crc=0
88 tx pkts=0, bytes=0, drop=0, errs=0, coll=0
93 AT_SETUP([ofproto - port stats - (OpenFlow 1.2)])
95 AT_CHECK([ovs-ofctl -O OpenFlow12 -vwarn dump-ports br0], [0], [stdout])
96 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
97 OFPST_PORT reply (OF1.2): 1 ports
98 port LOCAL: rx pkts=0, bytes=0, drop=0, errs=0, frame=0, over=0, crc=0
99 tx pkts=0, bytes=0, drop=0, errs=0, coll=0
104 AT_SETUP([ofproto - port stats - (OpenFlow 1.4)])
106 AT_CHECK([ovs-ofctl -O OpenFlow14 -vwarn dump-ports br0], [0], [stdout])
107 AT_CHECK([STRIP_XIDS stdout | sed 's/duration=[[0-9.]]*s/duration=?s/'],
109 OFPST_PORT reply (OF1.4): 1 ports
110 port LOCAL: rx pkts=0, bytes=0, drop=0, errs=0, frame=0, over=0, crc=0
111 tx pkts=0, bytes=0, drop=0, errs=0, coll=0
117 dnl This is really bare-bones.
118 dnl It at least checks request and reply serialization and deserialization.
119 AT_SETUP([ofproto - port-desc stats (OpenFlow 1.0)])
121 AT_CHECK([ovs-ofctl -vwarn dump-ports-desc br0], [0], [stdout])
122 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
123 OFPST_PORT_DESC reply:
124 LOCAL(br0): addr:aa:55:aa:55:00:00
127 speed: 0 Mbps now, 0 Mbps max
132 dnl This is really bare-bones.
133 dnl It at least checks request and reply serialization and deserialization.
134 AT_SETUP([ofproto - port-desc stats (OpenFlow 1.2)])
136 AT_CHECK([ovs-ofctl -O OpenFlow12 -vwarn dump-ports-desc br0], [0], [stdout])
137 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
138 OFPST_PORT_DESC reply (OF1.2):
139 LOCAL(br0): addr:aa:55:aa:55:00:00
142 speed: 0 Mbps now, 0 Mbps max
147 AT_SETUP([ofproto - port-desc stats (OpenFlow 1.5)])
149 ADD_OF_PORTS([br0], 1, 2, 3)
150 AT_CHECK([ovs-ofctl -F OXM-OpenFlow15 -O OpenFlow15 -vwarn dump-ports-desc br0], [0], [stdout])
151 AT_CHECK([STRIP_XIDS stdout | sed 's/00:0./00:0x/'], [0], [dnl
152 OFPST_PORT_DESC reply (OF1.5):
153 1(p1): addr:aa:55:aa:55:00:0x
156 speed: 0 Mbps now, 0 Mbps max
157 2(p2): addr:aa:55:aa:55:00:0x
160 speed: 0 Mbps now, 0 Mbps max
161 3(p3): addr:aa:55:aa:55:00:0x
164 speed: 0 Mbps now, 0 Mbps max
165 LOCAL(br0): addr:aa:55:aa:55:00:0x
168 speed: 0 Mbps now, 0 Mbps max
170 AT_CHECK([ovs-ofctl -F OXM-OpenFlow15 -O OpenFlow15 -vwarn dump-ports-desc br0 2], [0], [stdout])
171 AT_CHECK([STRIP_XIDS stdout | sed 's/00:0./00:0x/'], [0], [dnl
172 OFPST_PORT_DESC reply (OF1.5):
173 2(p2): addr:aa:55:aa:55:00:0x
176 speed: 0 Mbps now, 0 Mbps max
181 dnl This is really bare-bones.
182 dnl It at least checks request and reply serialization and deserialization.
183 AT_SETUP([ofproto - queue stats - (OpenFlow 1.0)])
185 AT_CHECK([ovs-ofctl -vwarn queue-stats br0], [0], [stdout])
186 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
187 OFPST_QUEUE reply: 0 queues
189 AT_CHECK([ovs-ofctl -vwarn queue-stats br0 ANY 5], [0],
190 [OFPT_ERROR (xid=0x2): OFPQOFC_BAD_QUEUE
191 OFPST_QUEUE request (xid=0x2):port=ANY queue=5
193 AT_CHECK([ovs-ofctl -vwarn queue-stats br0 10], [0],
194 [OFPT_ERROR (xid=0x2): OFPQOFC_BAD_PORT
195 OFPST_QUEUE request (xid=0x2):port=10 queue=ALL
200 AT_SETUP([ofproto - queue stats - (OpenFlow 1.2)])
202 AT_CHECK([ovs-ofctl -O OpenFlow12 -vwarn queue-stats br0], [0], [stdout])
203 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
204 OFPST_QUEUE reply (OF1.2): 0 queues
206 AT_CHECK([ovs-ofctl -O OpenFlow12 -vwarn queue-stats br0 ALL 5], [0],
207 [OFPT_ERROR (OF1.2) (xid=0x2): OFPQOFC_BAD_QUEUE
208 OFPST_QUEUE request (OF1.2) (xid=0x2):port=ANY queue=5
210 AT_CHECK([ovs-ofctl -O OpenFlow12 -vwarn queue-stats br0 10], [0],
211 [OFPT_ERROR (OF1.2) (xid=0x2): OFPQOFC_BAD_PORT
212 OFPST_QUEUE request (OF1.2) (xid=0x2):port=10 queue=ALL
217 AT_SETUP([ofproto - queue stats - (OpenFlow 1.4)])
219 AT_CHECK([ovs-ofctl -O OpenFlow14 -vwarn queue-stats br0], [0], [stdout])
220 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
221 OFPST_QUEUE reply (OF1.4): 0 queues
223 AT_CHECK([ovs-ofctl -O OpenFlow14 -vwarn queue-stats br0 ALL 5], [0],
224 [OFPT_ERROR (OF1.4) (xid=0x2): OFPQOFC_BAD_QUEUE
225 OFPST_QUEUE request (OF1.4) (xid=0x2):port=ANY queue=5
227 AT_CHECK([ovs-ofctl -O OpenFlow14 -vwarn queue-stats br0 10], [0],
228 [OFPT_ERROR (OF1.4) (xid=0x2): OFPQOFC_BAD_PORT
229 OFPST_QUEUE request (OF1.4) (xid=0x2):port=10 queue=ALL
234 dnl This is really bare-bones.
235 dnl It at least checks request and reply serialization and deserialization.
236 AT_SETUP([ofproto - queue configuration - (OpenFlow 1.0)])
238 ADD_OF_PORTS([br0], [1], [2])
239 AT_CHECK([ovs-ofctl queue-get-config br0 1], [0], [stdout])
240 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
241 OFPT_QUEUE_GET_CONFIG_REPLY: port=1
243 AT_CHECK([ovs-ofctl queue-get-config br0 10], [0],
244 [OFPT_ERROR (xid=0x2): OFPQOFC_BAD_PORT
245 OFPT_QUEUE_GET_CONFIG_REQUEST (xid=0x2): port=10
250 AT_SETUP([ofproto - queue configuration - (OpenFlow 1.2)])
252 ADD_OF_PORTS([br0], [1], [2])
253 AT_CHECK([ovs-ofctl -O OpenFlow12 queue-get-config br0 1], [0], [stdout])
254 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
255 OFPT_QUEUE_GET_CONFIG_REPLY (OF1.2): port=1
257 AT_CHECK([ovs-ofctl -O OpenFlow12 queue-get-config br0 10], [0],
258 [OFPT_ERROR (OF1.2) (xid=0x2): OFPQOFC_BAD_PORT
259 OFPT_QUEUE_GET_CONFIG_REQUEST (OF1.2) (xid=0x2): port=10
264 dnl This is really bare-bones.
265 dnl It at least checks request and reply serialization and deserialization.
266 AT_SETUP([ofproto - del group])
268 AT_DATA([groups.txt], [dnl
269 group_id=1234,type=all,bucket=output:10
270 group_id=1235,type=all,bucket=output:10
272 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-groups br0 groups.txt])
273 AT_CHECK([ovs-ofctl -F OXM-OpenFlow15 -O OpenFlow15 -vwarn dump-groups br0 1234], [0], [stdout])
274 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
275 OFPST_GROUP_DESC reply (OF1.5):
276 group_id=1234,type=all,bucket=actions=output:10
278 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn del-groups br0 group_id=1234])
279 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn dump-groups br0], [0], [stdout])
280 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
281 OFPST_GROUP_DESC reply (OF1.1):
282 group_id=1235,type=all,bucket=actions=output:10
284 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn del-groups br0 group_id=1234])
285 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn dump-groups br0], [0], [stdout])
286 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
287 OFPST_GROUP_DESC reply (OF1.1):
288 group_id=1235,type=all,bucket=actions=output:10
290 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn del-groups br0], [0])
291 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn dump-groups br0], [0], [stdout])
292 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
293 OFPST_GROUP_DESC reply (OF1.1):
298 dnl This is really bare-bones.
299 dnl It at least checks request and reply serialization and deserialization.
300 AT_SETUP([ofproto - del group deletes flows])
302 AT_DATA([groups.txt], [dnl
303 group_id=1234,type=all,bucket=output:10
304 group_id=1235,type=all,bucket=output:10
306 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-groups br0 groups.txt])
307 AT_DATA([flows.txt], [dnl
308 tcp actions=group:1234
309 udp actions=group:1235
311 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-flows br0 flows.txt])
312 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn dump-flows br0 | ofctl_strip | sort],
314 tcp actions=group:1234
315 udp actions=group:1235
316 OFPST_FLOW reply (OF1.1):
318 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn del-groups br0 group_id=1234])
319 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn dump-flows br0 | ofctl_strip | sort],
321 udp actions=group:1235
322 OFPST_FLOW reply (OF1.1):
324 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn del-groups br0 group_id=1234])
325 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn dump-flows br0 | ofctl_strip | sort],
327 udp actions=group:1235
328 OFPST_FLOW reply (OF1.1):
330 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn del-groups br0])
331 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn dump-flows br0 | ofctl_strip | sort],
333 OFPST_FLOW reply (OF1.1):
338 dnl This is really bare-bones.
339 dnl It at least checks request and reply serialization and deserialization.
340 AT_SETUP([ofproto - flow mod checks group availability])
342 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-group br0 group_id=1234,type=all,bucket=output:10])
343 AT_DATA([flows.txt], [dnl
344 tcp actions=group:1234
345 udp actions=group:1235
347 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-flow br0 'tcp actions=group:1234'])
348 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-flow br0 'tcp actions=group:1235'], [1], [], [stderr])
350 # The output should look like this:
352 # 00000000 02 0e 00 98 00 00 00 02-00 00 00 00 00 00 00 00 |................|
353 # 00000010 00 00 00 00 00 00 00 00-ff 00 00 00 00 00 80 00 |................|
354 # 00000020 ff ff ff ff ff ff ff ff-ff ff ff ff 00 00 00 00 |................|
355 # 00000030 00 00 00 58 00 00 00 00-00 00 03 d7 00 00 00 00 |...X............|
357 # This 'sed' command captures the error message but drops details.
358 AT_CHECK([sed '/truncated/d
359 /^000000.0/d' stderr | STRIP_XIDS], [0],
360 [OFPT_ERROR (OF1.1): OFPBAC_BAD_OUT_GROUP
361 OFPT_FLOW_MOD (OF1.1):
366 dnl This is really bare-bones.
367 dnl It at least checks request and reply serialization and deserialization.
368 AT_SETUP([ofproto - group description])
370 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-group br0 group_id=1234,type=all,bucket=output:10], [0], [stdout])
371 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn dump-groups br0], [0], [stdout])
372 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
373 OFPST_GROUP_DESC reply (OF1.1):
374 group_id=1234,type=all,bucket=actions=output:10
379 dnl This is really bare-bones.
380 dnl It at least checks request and reply serialization and deserialization.
381 AT_SETUP([ofproto - group description])
383 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-group br0 group_id=1234,type=all,bucket=output:10])
384 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn dump-groups br0], [0], [stdout])
385 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
386 OFPST_GROUP_DESC reply (OF1.1):
387 group_id=1234,type=all,bucket=actions=output:10
392 dnl This is really bare-bones.
393 dnl It at least checks request and reply serialization and deserialization.
394 AT_SETUP([ofproto - group features])
396 AT_CHECK([ovs-ofctl -O OpenFlow12 -vwarn dump-group-features br0], [0], [stdout])
397 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
398 OFPST_GROUP_FEATURES reply (OF1.2):
403 max_groups=0xffffff00
404 actions: output group set_field strip_vlan push_vlan mod_nw_ttl dec_ttl set_mpls_ttl dec_mpls_ttl push_mpls pop_mpls set_queue
406 max_groups=0xffffff00
407 actions: output group set_field strip_vlan push_vlan mod_nw_ttl dec_ttl set_mpls_ttl dec_mpls_ttl push_mpls pop_mpls set_queue
409 max_groups=0xffffff00
410 actions: output group set_field strip_vlan push_vlan mod_nw_ttl dec_ttl set_mpls_ttl dec_mpls_ttl push_mpls pop_mpls set_queue
412 max_groups=0xffffff00
413 actions: output group set_field strip_vlan push_vlan mod_nw_ttl dec_ttl set_mpls_ttl dec_mpls_ttl push_mpls pop_mpls set_queue
418 dnl This is really bare-bones.
419 dnl It at least checks request and reply serialization and deserialization.
420 AT_SETUP([ofproto - group stats])
422 AT_DATA([groups.txt], [dnl
423 group_id=1234,type=all,bucket=output:10
424 group_id=1235,type=all,bucket=output:10
426 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-groups br0 groups.txt])
427 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-flow br0 'tcp actions=group:1234'])
428 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn dump-group-stats br0 group_id=1234], [0], [stdout])
429 AT_CHECK([STRIP_XIDS stdout | sort], [0], [dnl
430 group_id=1234,ref_count=1,packet_count=0,byte_count=0,bucket0:packet_count=0,byte_count=0
431 OFPST_GROUP reply (OF1.1):
433 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn dump-group-stats br0], [0], [stdout])
434 AT_CHECK([STRIP_XIDS stdout | sort], [0], [dnl
435 group_id=1234,ref_count=1,packet_count=0,byte_count=0,bucket0:packet_count=0,byte_count=0
436 group_id=1235,ref_count=0,packet_count=0,byte_count=0,bucket0:packet_count=0,byte_count=0
437 OFPST_GROUP reply (OF1.1):
442 AT_SETUP([ofproto - mod-port (OpenFlow 1.0)])
444 for command_config_state in \
446 'noflood NO_FLOOD 0' \
447 'down PORT_DOWN,NO_FLOOD LINK_DOWN' \
448 'flood PORT_DOWN LINK_DOWN' \
449 'no-receive PORT_DOWN,NO_RECV LINK_DOWN' \
450 'no-forward PORT_DOWN,NO_RECV,NO_FWD LINK_DOWN' \
451 'no-packet-in PORT_DOWN,NO_RECV,NO_FWD,NO_PACKET_IN LINK_DOWN' \
452 'forward PORT_DOWN,NO_RECV,NO_PACKET_IN LINK_DOWN' \
453 'packet-in PORT_DOWN,NO_RECV LINK_DOWN' \
457 set $command_config_state
458 command=$[1] config=`echo $[2] | sed 's/,/ /g'` state=$[3]
459 AT_CHECK([ovs-ofctl -vwarn mod-port br0 br0 $command])
460 AT_CHECK([ovs-ofctl -vwarn show br0], [0], [stdout])
461 AT_CHECK_UNQUOTED([STRIP_XIDS stdout], [0], [dnl
462 OFPT_FEATURES_REPLY: dpid:fedcba9876543210
463 n_tables:254, n_buffers:256
464 capabilities: FLOW_STATS TABLE_STATS PORT_STATS QUEUE_STATS ARP_MATCH_IP
465 actions: OUTPUT SET_VLAN_VID SET_VLAN_PCP STRIP_VLAN SET_DL_SRC SET_DL_DST SET_NW_SRC SET_NW_DST SET_NW_TOS SET_TP_SRC SET_TP_DST ENQUEUE
466 LOCAL(br0): addr:aa:55:aa:55:00:00
469 speed: 0 Mbps now, 0 Mbps max
470 OFPT_GET_CONFIG_REPLY: frags=normal miss_send_len=0
476 AT_SETUP([ofproto - mod-port (OpenFlow 1.2)])
478 for command_config_state in \
480 'down PORT_DOWN LINK_DOWN' \
481 'no-receive PORT_DOWN,NO_RECV LINK_DOWN' \
482 'no-forward PORT_DOWN,NO_RECV,NO_FWD LINK_DOWN' \
483 'no-packet-in PORT_DOWN,NO_RECV,NO_FWD,NO_PACKET_IN LINK_DOWN' \
484 'forward PORT_DOWN,NO_RECV,NO_PACKET_IN LINK_DOWN' \
485 'packet-in PORT_DOWN,NO_RECV LINK_DOWN' \
489 set $command_config_state
490 command=$[1] config=`echo $[2] | sed 's/,/ /g'` state=$[3]
491 AT_CHECK([ovs-ofctl -O OpenFlow12 -vwarn mod-port br0 br0 $command])
492 AT_CHECK([ovs-ofctl -O OpenFlow12 -vwarn show br0], [0], [stdout])
493 AT_CHECK_UNQUOTED([STRIP_XIDS stdout], [0], [dnl
494 OFPT_FEATURES_REPLY (OF1.2): dpid:fedcba9876543210
495 n_tables:254, n_buffers:256
496 capabilities: FLOW_STATS TABLE_STATS PORT_STATS QUEUE_STATS
497 LOCAL(br0): addr:aa:55:aa:55:00:00
500 speed: 0 Mbps now, 0 Mbps max
501 OFPT_GET_CONFIG_REPLY (OF1.2): frags=normal miss_send_len=0
507 AT_SETUP([ofproto - mod-port (OpenFlow 1.4)])
509 for command_config_state in \
511 'down PORT_DOWN LINK_DOWN' \
512 'no-receive PORT_DOWN,NO_RECV LINK_DOWN' \
513 'no-forward PORT_DOWN,NO_RECV,NO_FWD LINK_DOWN' \
514 'no-packet-in PORT_DOWN,NO_RECV,NO_FWD,NO_PACKET_IN LINK_DOWN' \
515 'forward PORT_DOWN,NO_RECV,NO_PACKET_IN LINK_DOWN' \
516 'packet-in PORT_DOWN,NO_RECV LINK_DOWN' \
520 set $command_config_state
521 command=$[1] config=`echo $[2] | sed 's/,/ /g'` state=$[3]
522 AT_CHECK([ovs-ofctl -O OpenFlow14 -vwarn mod-port br0 br0 $command])
523 AT_CHECK([ovs-ofctl -O OpenFlow14 -vwarn show br0], [0], [stdout])
524 AT_CHECK_UNQUOTED([STRIP_XIDS stdout], [0], [dnl
525 OFPT_FEATURES_REPLY (OF1.4): dpid:fedcba9876543210
526 n_tables:254, n_buffers:256
527 capabilities: FLOW_STATS TABLE_STATS PORT_STATS QUEUE_STATS
528 OFPST_PORT_DESC reply (OF1.4):
529 LOCAL(br0): addr:aa:55:aa:55:00:00
532 speed: 0 Mbps now, 0 Mbps max
533 OFPT_GET_CONFIG_REPLY (OF1.4): frags=normal miss_send_len=0
539 AT_SETUP([ofproto - basic flow_mod commands (NXM)])
541 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip], [0], [NXST_FLOW reply:
543 AT_CHECK([echo 'in_port=2,actions=1' | ovs-ofctl add-flows br0 -])
544 AT_CHECK([ovs-ofctl add-flow br0 in_port=1,actions=2])
545 AT_CHECK([ovs-ofctl -F nxm add-flow br0 table=1,in_port=4,actions=3])
546 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
547 in_port=1 actions=output:2
548 in_port=2 actions=output:1
549 table=1, in_port=4 actions=output:3
552 AT_CHECK([ovs-ofctl dump-aggregate br0 table=0 | STRIP_XIDS], [0], [dnl
553 NXST_AGGREGATE reply: packet_count=0 byte_count=0 flow_count=2
555 AT_CHECK([ovs-ofctl del-flows br0])
556 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip], [0], [NXST_FLOW reply:
561 AT_SETUP([ofproto - basic flow_mod commands (OpenFlow 1.0)])
563 AT_CHECK([ovs-ofctl -F openflow10 dump-flows br0 | ofctl_strip], [0], [OFPST_FLOW reply:
565 AT_CHECK([echo 'in_port=2,actions=1' | ovs-ofctl -F openflow10 add-flows br0 -])
566 AT_CHECK([ovs-ofctl -F openflow10 add-flow br0 in_port=1,actions=2])
567 AT_CHECK([ovs-ofctl -F openflow10 add-flow br0 table=1,in_port=4,actions=3])
568 AT_CHECK([ovs-ofctl -F openflow10 dump-flows br0 | ofctl_strip | sort], [0], [dnl
569 in_port=1 actions=output:2
570 in_port=2 actions=output:1
571 table=1, in_port=4 actions=output:3
574 AT_CHECK([ovs-ofctl -F openflow10 dump-aggregate br0 table=0 | STRIP_XIDS], [0], [dnl
575 OFPST_AGGREGATE reply: packet_count=0 byte_count=0 flow_count=2
577 AT_CHECK([ovs-ofctl -F openflow10 del-flows br0])
578 AT_CHECK([ovs-ofctl -F openflow10 dump-flows br0 | ofctl_strip], [0], [OFPST_FLOW reply:
583 AT_SETUP([ofproto - basic flow_mod commands (OpenFlow 1.1)])
585 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip], [0], [OFPST_FLOW reply (OF1.1):
587 AT_CHECK([echo 'in_port=2,actions=1' | ovs-ofctl -O OpenFlow11 add-flows br0 -])
588 AT_CHECK([ovs-ofctl -O OpenFlow11 add-flow br0 in_port=1,actions=2])
589 AT_CHECK([ovs-ofctl -O OpenFlow11 add-flow br0 table=1,in_port=4,actions=3])
590 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl
591 in_port=1 actions=output:2
592 in_port=2 actions=output:1
593 table=1, in_port=4 actions=output:3
594 OFPST_FLOW reply (OF1.1):
596 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-aggregate br0 table=0 | STRIP_XIDS], [0], [dnl
597 OFPST_AGGREGATE reply (OF1.1): packet_count=0 byte_count=0 flow_count=2
599 AT_CHECK([ovs-ofctl -O OpenFlow11 del-flows br0])
600 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip], [0], [OFPST_FLOW reply (OF1.1):
601 table=1, in_port=4 actions=output:3
606 AT_SETUP([ofproto - flow_mod negative test (OpenFlow 1.1)])
608 [set bridge br0 protocols=OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13])
609 AT_CHECK([ovs-ofctl add-flow -O OpenFlow11 br0 table=1,action=goto_table:2])
611 # The error message here actually comes from ovs-ofctl, not from ovs-vswitchd,
612 # but at least it's the same code in ofpacts_check() that issues the error.
613 AT_CHECK([ovs-ofctl add-flow -O OpenFlow11 br0 table=1,action=goto_table:1],
615 [ovs-ofctl: actions are invalid with specified match (OFPBIC_BAD_TABLE_ID)
620 AT_SETUP([ofproto - set-field flow_mod commands (NXM)])
622 AT_CHECK([ovs-ofctl add-flow br0 ipv6,table=1,in_port=3,actions=drop])
623 AT_CHECK([ovs-ofctl add-flow br0 ipv6,table=1,in_port=3,actions=set_field:fe80:0123:4567:890a:a6ba:dbff:fefe:59fa-\>ipv6_src])
624 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
625 table=1, ipv6,in_port=3 actions=load:0xa6badbfffefe59fa->NXM_NX_IPV6_SRC[[0..63]],load:0xfe8001234567890a->NXM_NX_IPV6_SRC[[64..127]]
631 AT_SETUP([ofproto - basic flow_mod commands (OpenFlow 1.2)])
633 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip], [0], [OFPST_FLOW reply (OF1.2):
635 AT_CHECK([echo 'in_port=2,actions=1' | ovs-ofctl -O OpenFlow12 add-flows br0 -])
636 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 in_port=1,actions=2])
637 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 table=1,in_port=4,actions=3])
638 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
639 in_port=1 actions=output:2
640 in_port=2 actions=output:1
641 table=1, in_port=4 actions=output:3
642 OFPST_FLOW reply (OF1.2):
644 AT_CHECK([ovs-ofctl -O OpenFlow12 del-flows br0])
645 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip], [0], [OFPST_FLOW reply (OF1.2):
650 AT_SETUP([ofproto - dump flows with cookie])
652 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x1,in_port=1,actions=1])
653 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x2,in_port=2,actions=1])
654 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x3,in_port=3,actions=1])
655 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
656 cookie=0x1, in_port=1 actions=output:1
657 cookie=0x2, in_port=2 actions=output:1
658 cookie=0x3, in_port=3 actions=output:1
661 AT_CHECK([ovs-ofctl dump-aggregate br0 table=0 | STRIP_XIDS], [0], [dnl
662 NXST_AGGREGATE reply: packet_count=0 byte_count=0 flow_count=3
664 AT_CHECK([ovs-ofctl dump-flows br0 cookie=0x3/-1 | ofctl_strip | sort], [0], [dnl
665 cookie=0x3, in_port=3 actions=output:1
668 AT_CHECK([ovs-ofctl dump-aggregate br0 cookie=0x3/-1 | STRIP_XIDS], [0], [dnl
669 NXST_AGGREGATE reply: packet_count=0 byte_count=0 flow_count=1
674 AT_SETUP([ofproto - mod flow with cookie change (OpenFlow 1.0)])
676 AT_CHECK([ovs-ofctl -F openflow10 add-flow br0 cookie=0x1,in_port=1,actions=1])
677 AT_CHECK([ovs-ofctl -F openflow10 dump-flows br0 | ofctl_strip | sort], [0], [dnl
678 cookie=0x1, in_port=1 actions=output:1
682 AT_CHECK([ovs-ofctl -F openflow10 mod-flows br0 cookie=0x2,in_port=1,actions=1])
683 AT_CHECK([ovs-ofctl -F openflow10 dump-flows br0 | ofctl_strip | sort], [0], [dnl
684 cookie=0x2, in_port=1 actions=output:1
690 AT_SETUP([ofproto - mod flow with cookie change (NXM)])
692 AT_CHECK([ovs-ofctl -F nxm add-flow br0 cookie=0x1,in_port=1,actions=1])
693 AT_CHECK([ovs-ofctl -F nxm dump-flows br0 | ofctl_strip | sort], [0], [dnl
694 cookie=0x1, in_port=1 actions=output:1
698 AT_CHECK([ovs-ofctl -F nxm mod-flows br0 cookie=0x2,in_port=1,actions=1])
699 AT_CHECK([ovs-ofctl -F nxm dump-flows br0 | ofctl_strip | sort], [0], [dnl
700 cookie=0x2, in_port=1 actions=output:1
706 AT_SETUP([ofproto - no mod flow with cookie change (OpenFlow 1.1)])
708 AT_CHECK([ovs-ofctl -O OpenFlow11 add-flow br0 cookie=0x1,in_port=1,actions=1])
709 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl
710 cookie=0x1, in_port=1 actions=output:1
711 OFPST_FLOW reply (OF1.1):
713 AT_CHECK([ovs-ofctl -O OpenFlow11 mod-flows br0 cookie=0x2,in_port=1,actions=1])
714 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl
715 cookie=0x1, in_port=1 actions=output:1
716 OFPST_FLOW reply (OF1.1):
721 dnl The OpenFlow 1.2 spec states that the cookie may not be modified
722 AT_SETUP([ofproto - no mod flow with cookie change (OpenFlow 1.2)])
724 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 cookie=0x1,in_port=1,actions=1])
725 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
726 cookie=0x1, in_port=1 actions=output:1
727 OFPST_FLOW reply (OF1.2):
730 AT_CHECK([ovs-ofctl -O OpenFlow12 mod-flows br0 cookie=0x2,in_port=1,actions=1])
731 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
732 cookie=0x1, in_port=1 actions=output:1
733 OFPST_FLOW reply (OF1.2):
738 AT_SETUP([ofproto - mod flows based on cookie mask (OpenFlow 1.0)])
740 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x1,in_port=1,actions=1])
741 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x1,in_port=2,actions=1])
742 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x2,in_port=3,actions=1])
743 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
744 cookie=0x1, in_port=1 actions=output:1
745 cookie=0x1, in_port=2 actions=output:1
746 cookie=0x2, in_port=3 actions=output:1
750 AT_CHECK([ovs-ofctl -F nxm mod-flows br0 cookie=0x1/0xff,actions=4])
751 AT_CHECK([ovs-ofctl -F nxm dump-flows br0 | ofctl_strip | sort], [0], [dnl
752 cookie=0x1, in_port=1 actions=output:4
753 cookie=0x1, in_port=2 actions=output:4
754 cookie=0x2, in_port=3 actions=output:1
760 AT_SETUP([ofproto - mod flows based on cookie mask (OpenFlow 1.1)])
762 AT_CHECK([ovs-ofctl -O OpenFlow11 add-flow br0 cookie=0x1,in_port=1,actions=1])
763 AT_CHECK([ovs-ofctl -O OpenFlow11 add-flow br0 cookie=0x1,in_port=2,actions=1])
764 AT_CHECK([ovs-ofctl -O OpenFlow11 add-flow br0 cookie=0x2,in_port=3,actions=1])
765 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl
766 cookie=0x1, in_port=1 actions=output:1
767 cookie=0x1, in_port=2 actions=output:1
768 cookie=0x2, in_port=3 actions=output:1
769 OFPST_FLOW reply (OF1.1):
772 AT_CHECK([ovs-ofctl -O OpenFlow11 mod-flows br0 cookie=0x1/0xff,actions=4])
773 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl
774 cookie=0x1, in_port=1 actions=output:4
775 cookie=0x1, in_port=2 actions=output:4
776 cookie=0x2, in_port=3 actions=output:1
777 OFPST_FLOW reply (OF1.1):
782 AT_SETUP([ofproto - mod flows based on cookie mask (OpenFlow 1.2)])
784 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 cookie=0x1,in_port=1,actions=1])
785 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 cookie=0x1,in_port=2,actions=1])
786 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 cookie=0x2,in_port=3,actions=1])
787 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
788 cookie=0x1, in_port=1 actions=output:1
789 cookie=0x1, in_port=2 actions=output:1
790 cookie=0x2, in_port=3 actions=output:1
791 OFPST_FLOW reply (OF1.2):
794 AT_CHECK([ovs-ofctl -O OpenFlow12 mod-flows br0 cookie=0x1/0xff,actions=4])
795 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
796 cookie=0x1, in_port=1 actions=output:4
797 cookie=0x1, in_port=2 actions=output:4
798 cookie=0x2, in_port=3 actions=output:1
799 OFPST_FLOW reply (OF1.2):
804 dnl The OpenFlow 1.2 spec states that the cookie may not be modified
805 AT_SETUP([ofproto - mod flows based on cookie mask with cookie change])
807 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x1,in_port=1,actions=1])
808 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x1,in_port=2,actions=1])
809 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x2,in_port=3,actions=1])
810 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
811 cookie=0x1, in_port=1 actions=output:1
812 cookie=0x1, in_port=2 actions=output:1
813 cookie=0x2, in_port=3 actions=output:1
817 AT_CHECK([ovs-ofctl -F nxm mod-flows br0 cookie=1/-1,cookie=4,actions=4])
818 AT_CHECK([ovs-ofctl -F nxm dump-flows br0 | ofctl_strip | sort], [0], [dnl
819 cookie=0x2, in_port=3 actions=output:1
820 cookie=0x4, in_port=1 actions=output:4
821 cookie=0x4, in_port=2 actions=output:4
827 AT_SETUP([ofproto - mod flow with cookie miss (mask==0) - NXM])
829 AT_CHECK([ovs-ofctl -F nxm mod-flows br0 in_port=1,actions=1])
830 AT_CHECK([ovs-ofctl -F nxm dump-flows br0 | ofctl_strip | sort], [0], [dnl
831 in_port=1 actions=output:1
837 AT_SETUP([ofproto - mod flow with cookie miss (mask==0) - OF1.1])
839 AT_CHECK([ovs-ofctl -O openflow11 mod-flows br0 in_port=1,actions=1])
840 AT_CHECK([ovs-ofctl -O openflow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl
841 in_port=1 actions=output:1
842 OFPST_FLOW reply (OF1.1):
847 AT_SETUP([ofproto - mod flow with cookie miss (mask==0) - OF1.2])
849 AT_CHECK([ovs-ofctl -O openflow12 mod-flows br0 in_port=1,actions=1])
850 AT_CHECK([ovs-ofctl -O openflow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
851 OFPST_FLOW reply (OF1.2):
856 AT_SETUP([ofproto - mod flow with cookie miss (mask!=0) - NXM])
858 AT_CHECK([ovs-ofctl -F nxm mod-flows br0 cookie=1/1,in_port=1,actions=1])
859 AT_CHECK([ovs-ofctl -F nxm dump-flows br0 | ofctl_strip | sort], [0], [dnl
865 AT_SETUP([ofproto - mod flow with cookie miss (mask!=0) - OF1.1])
867 AT_CHECK([ovs-ofctl -O openflow11 mod-flows br0 cookie=1/1,in_port=1,actions=1])
868 AT_CHECK([ovs-ofctl -O openflow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl
869 OFPST_FLOW reply (OF1.1):
874 AT_SETUP([ofproto - mod flow with cookie miss (mask!=0) - OF1.2])
876 AT_CHECK([ovs-ofctl -O openflow12 mod-flows br0 cookie=1/1,in_port=1,actions=1])
877 AT_CHECK([ovs-ofctl -O openflow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
878 OFPST_FLOW reply (OF1.2):
883 AT_SETUP([ofproto - del flows with cookies])
885 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x1,in_port=1,actions=1])
886 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x2,in_port=2,actions=1])
887 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x3,in_port=3,actions=1])
888 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
889 cookie=0x1, in_port=1 actions=output:1
890 cookie=0x2, in_port=2 actions=output:1
891 cookie=0x3, in_port=3 actions=output:1
895 AT_CHECK([ovs-ofctl del-flows br0])
896 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
902 AT_SETUP([ofproto - del flows based on cookie])
904 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x1,in_port=1,actions=1])
905 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x2,in_port=2,actions=1])
906 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x3,in_port=3,actions=1])
907 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
908 cookie=0x1, in_port=1 actions=output:1
909 cookie=0x2, in_port=2 actions=output:1
910 cookie=0x3, in_port=3 actions=output:1
914 AT_CHECK([ovs-ofctl del-flows br0 cookie=0x3/-1])
915 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
916 cookie=0x1, in_port=1 actions=output:1
917 cookie=0x2, in_port=2 actions=output:1
923 AT_SETUP([ofproto - del flows based on cookie mask])
925 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x1,in_port=1,actions=1])
926 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x2,in_port=2,actions=1])
927 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x3,in_port=3,actions=1])
928 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
929 cookie=0x1, in_port=1 actions=output:1
930 cookie=0x2, in_port=2 actions=output:1
931 cookie=0x3, in_port=3 actions=output:1
934 AT_CHECK([ovs-ofctl del-flows br0 cookie=0x3/0x1])
935 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
936 cookie=0x2, in_port=2 actions=output:1
942 AT_SETUP([ofproto - del flows based on table id (NXM)])
944 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x1,in_port=1,actions=1])
945 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x2,in_port=2,table=1,actions=1])
946 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
947 cookie=0x1, in_port=1 actions=output:1
948 cookie=0x2, table=1, in_port=2 actions=output:1
951 AT_CHECK([ovs-ofctl del-flows br0 table=0])
952 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
953 cookie=0x2, table=1, in_port=2 actions=output:1
956 AT_CHECK([ovs-ofctl del-flows br0 table=1])
957 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
960 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x1,in_port=1,actions=1])
961 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x2,in_port=2,table=1,actions=1])
962 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
963 cookie=0x1, in_port=1 actions=output:1
964 cookie=0x2, table=1, in_port=2 actions=output:1
967 AT_CHECK([ovs-ofctl del-flows br0])
968 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
974 AT_SETUP([ofproto - del flows based on table id (OpenFlow 1.1)])
976 AT_CHECK([ovs-ofctl -O OpenFlow11 add-flow br0 cookie=0x1,in_port=1,actions=1])
977 AT_CHECK([ovs-ofctl -O OpenFlow11 add-flow br0 cookie=0x2,in_port=2,table=1,actions=1])
978 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl
979 cookie=0x1, in_port=1 actions=output:1
980 cookie=0x2, table=1, in_port=2 actions=output:1
981 OFPST_FLOW reply (OF1.1):
983 AT_CHECK([ovs-ofctl -O OpenFlow11 del-flows br0 table=0])
984 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl
985 cookie=0x2, table=1, in_port=2 actions=output:1
986 OFPST_FLOW reply (OF1.1):
988 AT_CHECK([ovs-ofctl -O OpenFlow11 del-flows br0 table=1])
989 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl
990 OFPST_FLOW reply (OF1.1):
992 AT_CHECK([ovs-ofctl -O OpenFlow11 add-flow br0 cookie=0x1,in_port=1,actions=1])
993 AT_CHECK([ovs-ofctl -O OpenFlow11 add-flow br0 cookie=0x2,in_port=2,table=1,actions=1])
994 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl
995 cookie=0x1, in_port=1 actions=output:1
996 cookie=0x2, table=1, in_port=2 actions=output:1
997 OFPST_FLOW reply (OF1.1):
999 AT_CHECK([ovs-ofctl -O OpenFlow11 del-flows br0])
1000 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip], [0], [dnl
1001 OFPST_FLOW reply (OF1.1):
1002 cookie=0x2, table=1, in_port=2 actions=output:1
1007 AT_SETUP([ofproto - del flows based on table id (OpenFlow 1.2)])
1009 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 cookie=0x1,in_port=1,actions=1])
1010 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 cookie=0x2,in_port=2,table=1,actions=1])
1011 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1012 cookie=0x1, in_port=1 actions=output:1
1013 cookie=0x2, table=1, in_port=2 actions=output:1
1014 OFPST_FLOW reply (OF1.2):
1016 AT_CHECK([ovs-ofctl -O OpenFlow12 del-flows br0 table=0])
1017 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1018 cookie=0x2, table=1, in_port=2 actions=output:1
1019 OFPST_FLOW reply (OF1.2):
1021 AT_CHECK([ovs-ofctl -O OpenFlow12 del-flows br0 table=1])
1022 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1023 OFPST_FLOW reply (OF1.2):
1025 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 cookie=0x1,in_port=1,actions=1])
1026 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 cookie=0x2,in_port=2,table=1,actions=1])
1027 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1028 cookie=0x1, in_port=1 actions=output:1
1029 cookie=0x2, table=1, in_port=2 actions=output:1
1030 OFPST_FLOW reply (OF1.2):
1032 AT_CHECK([ovs-ofctl -O OpenFlow12 del-flows br0])
1033 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1034 OFPST_FLOW reply (OF1.2):
1039 AT_SETUP([ofproto - flow table configuration (OpenFlow 1.0)])
1041 # Check the default configuration.
1042 (echo "OFPST_TABLE reply (xid=0x2): 254 tables
1043 0: classifier: wild=0x3fffff, max=1000000, active=0
1044 lookup=0, matched=0"
1046 while test $x -lt 254; do
1047 printf " %d: %-8s: wild=0x3fffff, max=1000000, active=0
1052 AT_CHECK([ovs-ofctl dump-tables br0], [0], [expout])
1053 # Change the configuration.
1056 -- --id=@t0 create Flow_Table name=main \
1057 -- --id=@t1 create Flow_Table flow-limit=1024 \
1058 -- set bridge br0 'flow_tables={1=@t1,0=@t0}' \
1059 | ${PERL} $srcdir/uuidfilt.pl],
1063 # Check that the configuration was updated.
1064 mv expout orig-expout
1065 (echo "OFPST_TABLE reply (xid=0x2): 254 tables
1066 0: main : wild=0x3fffff, max=1000000, active=0
1068 1: table1 : wild=0x3fffff, max= 1024, active=0
1069 lookup=0, matched=0"
1070 tail -n +6 orig-expout) > expout
1071 AT_CHECK([ovs-ofctl dump-tables br0], [0], [expout])
1075 AT_SETUP([ofproto - flow table configuration (OpenFlow 1.2)])
1077 # Check the default configuration.
1078 (mid="wild=0xfffffffff, max=1000000,"
1081 match=0xfffffffff, instructions=0x00000007, config=0x00000003
1082 write_actions=0x00000000, apply_actions=0x00000000
1083 write_setfields=0x0000000fffffffff
1084 apply_setfields=0x0000000fffffffff
1085 metadata_match=0xffffffffffffffff
1086 metadata_write=0xffffffffffffffff"
1087 echo "OFPST_TABLE reply (OF1.2) (xid=0x2): 254 tables
1088 0: classifier: $mid active=0$tail"
1090 while test $x -lt 254; do
1091 printf " %d: %-8s: $mid active=0$tail
1095 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-tables br0], [0], [expout])
1096 # Change the configuration.
1099 -- --id=@t0 create Flow_Table name=main \
1100 -- --id=@t1 create Flow_Table flow-limit=1024 \
1101 -- set bridge br0 'flow_tables={1=@t1,0=@t0}' \
1102 | ${PERL} $srcdir/uuidfilt.pl],
1106 # Check that the configuration was updated.
1107 mv expout orig-expout
1108 (echo "OFPST_TABLE reply (OF1.2) (xid=0x2): 254 tables
1109 0: main : wild=0xfffffffff, max=1000000, active=0"
1110 tail -n +3 orig-expout | head -7
1111 echo " 1: table1 : wild=0xfffffffff, max= 1024, active=0"
1112 tail -n +11 orig-expout) > expout
1113 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-tables br0], [0], [expout])
1117 AT_SETUP([ofproto - hard limits on flow table size (OpenFlow 1.0)])
1119 # Configure a maximum of 4 flows.
1122 -- --id=@t0 create Flow_Table flow-limit=4 \
1123 -- set bridge br0 flow_tables:0=@t0 \
1124 | ${PERL} $srcdir/uuidfilt.pl],
1128 for in_port in 1 2 3 4; do
1129 ovs-ofctl add-flow br0 in_port=$in_port,actions=drop
1131 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1132 in_port=1 actions=drop
1133 in_port=2 actions=drop
1134 in_port=3 actions=drop
1135 in_port=4 actions=drop
1138 # Adding another flow will be refused.
1139 AT_CHECK([ovs-ofctl add-flow br0 in_port=5,actions=drop], [1], [], [stderr])
1140 AT_CHECK([head -n 1 stderr | ofctl_strip], [0],
1141 [OFPT_ERROR: OFPFMFC_TABLE_FULL
1143 # Also a mod-flow that would add a flow will be refused.
1144 AT_CHECK([ovs-ofctl mod-flows br0 in_port=5,actions=drop], [1], [], [stderr])
1145 AT_CHECK([head -n 1 stderr | ofctl_strip], [0],
1146 [OFPT_ERROR: OFPFMFC_TABLE_FULL
1148 # Replacing or modifying an existing flow is allowed.
1149 AT_CHECK([ovs-ofctl add-flow br0 in_port=4,actions=normal])
1150 AT_CHECK([ovs-ofctl mod-flows br0 in_port=3,actions=output:1])
1151 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1152 in_port=1 actions=drop
1153 in_port=2 actions=drop
1154 in_port=3 actions=output:1
1155 in_port=4 actions=NORMAL
1161 AT_SETUP([ofproto - hard limits on flow table size (OpenFlow 1.2)])
1163 # Configure a maximum of 4 flows.
1166 -- --id=@t0 create Flow_Table flow-limit=4 \
1167 -- set bridge br0 flow_tables:0=@t0 \
1168 | ${PERL} $srcdir/uuidfilt.pl],
1172 for in_port in 1 2 3 4; do
1173 ovs-ofctl -O OpenFlow12 add-flow br0 in_port=$in_port,actions=drop
1175 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1176 in_port=1 actions=drop
1177 in_port=2 actions=drop
1178 in_port=3 actions=drop
1179 in_port=4 actions=drop
1180 OFPST_FLOW reply (OF1.2):
1182 # Adding another flow will be refused.
1183 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 in_port=5,actions=drop], [1], [], [stderr])
1184 AT_CHECK([head -n 1 stderr | ofctl_strip], [0],
1185 [OFPT_ERROR (OF1.2): OFPFMFC_TABLE_FULL
1187 # Replacing or modifying an existing flow is allowed.
1188 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 in_port=4,actions=normal])
1189 AT_CHECK([ovs-ofctl -O OpenFlow12 mod-flows br0 in_port=3,actions=output:1])
1190 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1191 in_port=1 actions=drop
1192 in_port=2 actions=drop
1193 in_port=3 actions=output:1
1194 in_port=4 actions=NORMAL
1195 OFPST_FLOW reply (OF1.2):
1200 AT_SETUP([ofproto - eviction upon table overflow (OpenFlow 1.0)])
1202 # Configure a maximum of 4 flows.
1205 -- --id=@t0 create Flow_Table flow-limit=4 overflow-policy=evict \
1206 -- set bridge br0 flow_tables:0=@t0 \
1207 | ${PERL} $srcdir/uuidfilt.pl],
1211 for in_port in 4 3 2 1; do
1212 ovs-ofctl add-flow br0 idle_timeout=${in_port}0,in_port=$in_port,actions=drop
1214 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1215 idle_timeout=10, in_port=1 actions=drop
1216 idle_timeout=20, in_port=2 actions=drop
1217 idle_timeout=30, in_port=3 actions=drop
1218 idle_timeout=40, in_port=4 actions=drop
1221 # Adding another flow will cause the one that expires soonest to be evicted.
1222 AT_CHECK([ovs-ofctl add-flow br0 in_port=5,actions=drop])
1223 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1224 idle_timeout=20, in_port=2 actions=drop
1225 idle_timeout=30, in_port=3 actions=drop
1226 idle_timeout=40, in_port=4 actions=drop
1227 in_port=5 actions=drop
1230 # A mod-flow that adds a flow also causes eviction, but replacing or
1231 # modifying an existing flow doesn't.
1232 AT_CHECK([ovs-ofctl mod-flows br0 in_port=6,actions=drop])
1233 AT_CHECK([ovs-ofctl add-flow br0 in_port=4,actions=normal])
1234 AT_CHECK([ovs-ofctl mod-flows br0 in_port=3,actions=output:1])
1235 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1236 idle_timeout=30, in_port=3 actions=output:1
1237 in_port=4 actions=NORMAL
1238 in_port=5 actions=drop
1239 in_port=6 actions=drop
1242 # Flows with no timeouts at all cannot be evicted.
1243 AT_CHECK([ovs-ofctl add-flow br0 in_port=7,actions=normal])
1244 AT_CHECK([ovs-ofctl add-flow br0 in_port=8,actions=drop], [1], [], [stderr])
1245 AT_CHECK([head -n 1 stderr | ofctl_strip], [0],
1246 [OFPT_ERROR: OFPFMFC_TABLE_FULL
1248 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1249 in_port=4 actions=NORMAL
1250 in_port=5 actions=drop
1251 in_port=6 actions=drop
1252 in_port=7 actions=NORMAL
1258 AT_SETUP([ofproto - eviction upon table overflow (OpenFlow 1.2)])
1260 # Configure a maximum of 4 flows.
1263 -- --id=@t0 create Flow_Table flow-limit=4 overflow-policy=evict \
1264 -- set bridge br0 flow_tables:0=@t0 \
1265 | ${PERL} $srcdir/uuidfilt.pl],
1269 for in_port in 4 3 2 1; do
1270 ovs-ofctl -O OpenFlow12 add-flow br0 idle_timeout=${in_port}0,in_port=$in_port,actions=drop
1272 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1273 idle_timeout=10, in_port=1 actions=drop
1274 idle_timeout=20, in_port=2 actions=drop
1275 idle_timeout=30, in_port=3 actions=drop
1276 idle_timeout=40, in_port=4 actions=drop
1277 OFPST_FLOW reply (OF1.2):
1279 # Adding another flow will cause the one that expires soonest to be evicted.
1280 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 in_port=5,actions=drop])
1281 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1282 idle_timeout=20, in_port=2 actions=drop
1283 idle_timeout=30, in_port=3 actions=drop
1284 idle_timeout=40, in_port=4 actions=drop
1285 in_port=5 actions=drop
1286 OFPST_FLOW reply (OF1.2):
1288 # In Open Flow 1.2 a mod-flow does not ever add a flow and thus
1289 # has no effect on eviction
1290 AT_CHECK([ovs-ofctl -O OpenFlow12 mod-flows br0 in_port=6,actions=drop])
1291 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 in_port=4,actions=normal])
1292 AT_CHECK([ovs-ofctl -O OpenFlow12 mod-flows br0 in_port=3,actions=output:1])
1293 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1294 idle_timeout=20, in_port=2 actions=drop
1295 idle_timeout=30, in_port=3 actions=output:1
1296 in_port=4 actions=NORMAL
1297 in_port=5 actions=drop
1298 OFPST_FLOW reply (OF1.2):
1300 # Flows with no timeouts at all cannot be evicted.
1301 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 in_port=6,actions=drop])
1302 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 in_port=7,actions=normal])
1303 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 in_port=8,actions=drop], [1], [], [stderr])
1304 AT_CHECK([head -n 1 stderr | ofctl_strip], [0],
1305 [OFPT_ERROR (OF1.2): OFPFMFC_TABLE_FULL
1307 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1308 in_port=4 actions=NORMAL
1309 in_port=5 actions=drop
1310 in_port=6 actions=drop
1311 in_port=7 actions=NORMAL
1312 OFPST_FLOW reply (OF1.2):
1317 AT_SETUP([ofproto - eviction upon table overflow, with fairness (OpenFlow 1.0)])
1319 # Configure a maximum of 4 flows.
1322 -- --id=@t0 create Flow_Table name=evict flow-limit=4 \
1323 overflow-policy=evict \
1324 groups='"NXM_OF_IN_PORT[[]]"' \
1325 -- set bridge br0 flow_tables:0=@t0 \
1326 | ${PERL} $srcdir/uuidfilt.pl],
1330 ovs-ofctl add-flows br0 - <<EOF
1331 idle_timeout=10 in_port=2 dl_src=00:44:55:66:77:88 actions=drop
1332 idle_timeout=20 in_port=1 dl_src=00:11:22:33:44:55 actions=drop
1333 idle_timeout=30 in_port=1 dl_src=00:22:33:44:55:66 actions=drop
1334 idle_timeout=40 in_port=1 dl_src=00:33:44:55:66:77 actions=drop
1336 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1337 idle_timeout=10, in_port=2,dl_src=00:44:55:66:77:88 actions=drop
1338 idle_timeout=20, in_port=1,dl_src=00:11:22:33:44:55 actions=drop
1339 idle_timeout=30, in_port=1,dl_src=00:22:33:44:55:66 actions=drop
1340 idle_timeout=40, in_port=1,dl_src=00:33:44:55:66:77 actions=drop
1343 # Adding another flow will cause the one that expires soonest within
1344 # the largest group (those with in_port=1) to be evicted. In this
1345 # case this is not the same as the one that expires soonest overall
1346 # (which is what makes the test interesting):
1347 AT_CHECK([ovs-ofctl add-flow br0 in_port=2,dl_src=00:55:66:77:88:99,actions=drop])
1348 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1349 idle_timeout=10, in_port=2,dl_src=00:44:55:66:77:88 actions=drop
1350 idle_timeout=30, in_port=1,dl_src=00:22:33:44:55:66 actions=drop
1351 idle_timeout=40, in_port=1,dl_src=00:33:44:55:66:77 actions=drop
1352 in_port=2,dl_src=00:55:66:77:88:99 actions=drop
1355 # Enlarge the flow limit, change the eviction policy back to strictly
1356 # based on expiration, and and add some flows.
1357 AT_CHECK([ovs-vsctl set Flow_Table evict groups='[[]]' flow-limit=7])
1358 ovs-ofctl add-flows br0 - <<EOF
1359 idle_timeout=50 in_port=2 dl_src=00:66:77:88:99:aa actions=drop
1360 idle_timeout=60 in_port=2 dl_src=00:77:88:99:aa:bb actions=drop
1361 idle_timeout=70 in_port=2 dl_src=00:88:99:aa:bb:cc actions=drop
1363 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1364 idle_timeout=10, in_port=2,dl_src=00:44:55:66:77:88 actions=drop
1365 idle_timeout=30, in_port=1,dl_src=00:22:33:44:55:66 actions=drop
1366 idle_timeout=40, in_port=1,dl_src=00:33:44:55:66:77 actions=drop
1367 idle_timeout=50, in_port=2,dl_src=00:66:77:88:99:aa actions=drop
1368 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=drop
1369 idle_timeout=70, in_port=2,dl_src=00:88:99:aa:bb:cc actions=drop
1370 in_port=2,dl_src=00:55:66:77:88:99 actions=drop
1373 # Adding another flow will cause the one that expires soonest overall
1375 AT_CHECK([ovs-ofctl add-flow br0 'idle_timeout=80 in_port=2 dl_src=00:99:aa:bb:cc:dd actions=drop'])
1376 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1377 idle_timeout=30, in_port=1,dl_src=00:22:33:44:55:66 actions=drop
1378 idle_timeout=40, in_port=1,dl_src=00:33:44:55:66:77 actions=drop
1379 idle_timeout=50, in_port=2,dl_src=00:66:77:88:99:aa actions=drop
1380 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=drop
1381 idle_timeout=70, in_port=2,dl_src=00:88:99:aa:bb:cc actions=drop
1382 idle_timeout=80, in_port=2,dl_src=00:99:aa:bb:cc:dd actions=drop
1383 in_port=2,dl_src=00:55:66:77:88:99 actions=drop
1386 # Reducing the flow limit also causes the flows that expire soonest
1387 # overall to be evicted.
1388 AT_CHECK([ovs-vsctl set Flow_Table evict flow-limit=4])
1389 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1390 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=drop
1391 idle_timeout=70, in_port=2,dl_src=00:88:99:aa:bb:cc actions=drop
1392 idle_timeout=80, in_port=2,dl_src=00:99:aa:bb:cc:dd actions=drop
1393 in_port=2,dl_src=00:55:66:77:88:99 actions=drop
1399 AT_SETUP([ofproto - eviction upon table overflow, with fairness (OpenFlow 1.2)])
1401 # Configure a maximum of 4 flows.
1404 -- --id=@t0 create Flow_Table name=evict flow-limit=4 \
1405 overflow-policy=evict \
1406 groups='"NXM_OF_IN_PORT[[]]"' \
1407 -- set bridge br0 flow_tables:0=@t0 \
1408 | ${PERL} $srcdir/uuidfilt.pl],
1412 ovs-ofctl -O OpenFlow12 add-flows br0 - <<EOF
1413 idle_timeout=10 in_port=2 dl_src=00:44:55:66:77:88 actions=drop
1414 idle_timeout=20 in_port=1 dl_src=00:11:22:33:44:55 actions=drop
1415 idle_timeout=30 in_port=1 dl_src=00:22:33:44:55:66 actions=drop
1416 idle_timeout=40 in_port=1 dl_src=00:33:44:55:66:77 actions=drop
1418 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1419 idle_timeout=10, in_port=2,dl_src=00:44:55:66:77:88 actions=drop
1420 idle_timeout=20, in_port=1,dl_src=00:11:22:33:44:55 actions=drop
1421 idle_timeout=30, in_port=1,dl_src=00:22:33:44:55:66 actions=drop
1422 idle_timeout=40, in_port=1,dl_src=00:33:44:55:66:77 actions=drop
1423 OFPST_FLOW reply (OF1.2):
1425 # Adding another flow will cause the one that expires soonest within
1426 # the largest group (those with in_port=1) to be evicted. In this
1427 # case this is not the same as the one that expires soonest overall
1428 # (which is what makes the test interesting):
1429 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 in_port=2,dl_src=00:55:66:77:88:99,actions=drop])
1430 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1431 idle_timeout=10, in_port=2,dl_src=00:44:55:66:77:88 actions=drop
1432 idle_timeout=30, in_port=1,dl_src=00:22:33:44:55:66 actions=drop
1433 idle_timeout=40, in_port=1,dl_src=00:33:44:55:66:77 actions=drop
1434 in_port=2,dl_src=00:55:66:77:88:99 actions=drop
1435 OFPST_FLOW reply (OF1.2):
1437 # Enlarge the flow limit, change the eviction policy back to strictly
1438 # based on expiration, and and add some flows.
1439 AT_CHECK([ovs-vsctl set Flow_Table evict groups='[[]]' flow-limit=7])
1440 ovs-ofctl -O OpenFlow12 add-flows br0 - <<EOF
1441 idle_timeout=50 in_port=2 dl_src=00:66:77:88:99:aa actions=drop
1442 idle_timeout=60 in_port=2 dl_src=00:77:88:99:aa:bb actions=drop
1443 idle_timeout=70 in_port=2 dl_src=00:88:99:aa:bb:cc actions=drop
1445 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1446 idle_timeout=10, in_port=2,dl_src=00:44:55:66:77:88 actions=drop
1447 idle_timeout=30, in_port=1,dl_src=00:22:33:44:55:66 actions=drop
1448 idle_timeout=40, in_port=1,dl_src=00:33:44:55:66:77 actions=drop
1449 idle_timeout=50, in_port=2,dl_src=00:66:77:88:99:aa actions=drop
1450 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=drop
1451 idle_timeout=70, in_port=2,dl_src=00:88:99:aa:bb:cc actions=drop
1452 in_port=2,dl_src=00:55:66:77:88:99 actions=drop
1453 OFPST_FLOW reply (OF1.2):
1455 # Adding another flow will cause the one that expires soonest overall
1457 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 'idle_timeout=80 in_port=2 dl_src=00:99:aa:bb:cc:dd actions=drop'])
1458 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1459 idle_timeout=30, in_port=1,dl_src=00:22:33:44:55:66 actions=drop
1460 idle_timeout=40, in_port=1,dl_src=00:33:44:55:66:77 actions=drop
1461 idle_timeout=50, in_port=2,dl_src=00:66:77:88:99:aa actions=drop
1462 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=drop
1463 idle_timeout=70, in_port=2,dl_src=00:88:99:aa:bb:cc actions=drop
1464 idle_timeout=80, in_port=2,dl_src=00:99:aa:bb:cc:dd actions=drop
1465 in_port=2,dl_src=00:55:66:77:88:99 actions=drop
1466 OFPST_FLOW reply (OF1.2):
1468 # Reducing the flow limit also causes the flows that expire soonest
1469 # overall to be evicted.
1470 AT_CHECK([ovs-vsctl set Flow_Table evict flow-limit=4])
1471 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1472 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=drop
1473 idle_timeout=70, in_port=2,dl_src=00:88:99:aa:bb:cc actions=drop
1474 idle_timeout=80, in_port=2,dl_src=00:99:aa:bb:cc:dd actions=drop
1475 in_port=2,dl_src=00:55:66:77:88:99 actions=drop
1476 OFPST_FLOW reply (OF1.2):
1481 AT_SETUP([ofproto - eviction upon table overflow, with modified hard timeout])
1483 # Configure a maximum of 4 flows.
1486 -- --id=@t0 create Flow_Table flow-limit=4 overflow-policy=evict \
1487 -- set bridge br0 flow_tables:0=@t0 \
1488 | ${PERL} $srcdir/uuidfilt.pl],
1491 ovs-appctl time/stop
1493 for in_port in 4 3 2 1; do
1494 ovs-ofctl add-flow br0 hard_timeout=$((10 + in_port * 3)),in_port=$in_port,actions=drop
1496 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1497 hard_timeout=13, in_port=1 actions=drop
1498 hard_timeout=16, in_port=2 actions=drop
1499 hard_timeout=19, in_port=3 actions=drop
1500 hard_timeout=22, in_port=4 actions=drop
1503 # Sleep and modify the one that expires soonest
1504 ovs-appctl time/warp 5000
1505 AT_CHECK([ovs-ofctl mod-flows br0 in_port=1,actions=drop])
1506 # At this point the table would looks like:
1507 # in_port seconds to expire
1512 ovs-appctl time/warp 2000
1513 # Adding another flow will cause the one that expires soonest to be evicted.
1514 AT_CHECK([ovs-ofctl add-flow br0 in_port=5,actions=drop])
1515 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1516 hard_timeout=13, in_port=1 actions=drop
1517 hard_timeout=19, in_port=3 actions=drop
1518 hard_timeout=22, in_port=4 actions=drop
1519 in_port=5 actions=drop
1525 AT_SETUP([ofproto - eviction upon table overflow, with modified idle timeout])
1526 OVS_VSWITCHD_START([add-port br0 p1 -- set interface p1 type=dummy ofport_request=1])
1527 # Configure a maximum of 4 flows.
1530 -- --id=@t0 create Flow_Table flow-limit=4 overflow-policy=evict \
1531 -- set bridge br0 flow_tables:0=@t0 \
1532 | ${PERL} $srcdir/uuidfilt.pl],
1536 for in_port in 4 3 2 1; do
1537 ovs-ofctl add-flow br0 idle_timeout=$((10 + in_port * 3)),in_port=$in_port,actions=drop
1539 ovs-appctl time/stop
1540 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1541 idle_timeout=13, in_port=1 actions=drop
1542 idle_timeout=16, in_port=2 actions=drop
1543 idle_timeout=19, in_port=3 actions=drop
1544 idle_timeout=22, in_port=4 actions=drop
1547 # Sleep and receive on the flow that expires soonest
1548 ovs-appctl time/warp 5000
1549 AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1)'])
1550 # At this point the table would looks like:
1551 # in_port seconds to expire
1556 ovs-appctl time/warp 2000
1557 # Adding another flow will cause the one that expires soonest to be evicted.
1558 AT_CHECK([ovs-ofctl add-flow br0 in_port=5,actions=drop])
1559 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1560 idle_timeout=19, in_port=3 actions=drop
1561 idle_timeout=22, in_port=4 actions=drop
1562 in_port=5 actions=drop
1563 n_packets=1, n_bytes=60, idle_timeout=13, in_port=1 actions=drop
1569 AT_SETUP([ofproto - asynchronous message control (OpenFlow 1.0)])
1571 AT_CHECK([ovs-ofctl -P openflow10 monitor br0 --detach --no-chdir --pidfile])
1573 printf '\n\n--- check_async %d ---\n\n\n' $1
1576 ovs-appctl -t ovs-ofctl ofctl/barrier
1577 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
1580 # OFPT_PACKET_IN, OFPR_ACTION (controller_id=0)
1581 ovs-ofctl -v packet-out br0 controller controller '0001020304050010203040501234'
1582 if test X"$1" = X"OFPR_ACTION"; then shift;
1583 echo >>expout "OFPT_PACKET_IN: total_len=14 in_port=CONTROLLER (via action) data_len=14 (unbuffered)
1584 metadata=0,in_port=0,vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234"
1587 # OFPT_PACKET_IN, OFPR_NO_MATCH (controller_id=123)
1588 ovs-ofctl -v packet-out br0 controller 'controller(reason=no_match,id=123)' '0001020304050010203040501234'
1589 if test X"$1" = X"OFPR_NO_MATCH"; then shift;
1590 echo >>expout "OFPT_PACKET_IN: total_len=14 in_port=CONTROLLER (via no_match) data_len=14 (unbuffered)
1591 metadata=0,in_port=0,vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234"
1594 # OFPT_PACKET_IN, OFPR_INVALID_TTL (controller_id=0)
1595 ovs-ofctl packet-out br0 controller dec_ttl '002583dfb4000026b98cb0f908004500003fb7e200000011339bac11370dac100002d7730035002b8f6d86fb0100000100000000000006626c702d7873066e696369726103636f6d00000f00'
1596 if test X"$1" = X"OFPR_INVALID_TTL"; then shift;
1597 echo >>expout "OFPT_PACKET_IN: total_len=76 in_port=CONTROLLER (via invalid_ttl) data_len=76 (unbuffered)
1598 udp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=00:26:b9:8c:b0:f9,dl_dst=00:25:83:df:b4:00,nw_src=172.17.55.13,nw_dst=172.16.0.2,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=55155,tp_dst=53 udp_csum:8f6d"
1601 # OFPT_PORT_STATUS, OFPPR_ADD
1602 ovs-vsctl add-port br0 test -- set Interface test type=dummy ofport_request=1
1603 if test X"$1" = X"OFPPR_ADD"; then shift;
1604 echo >>expout "OFPT_PORT_STATUS: ADD: 1(test): addr:aa:55:aa:55:00:0x
1607 speed: 0 Mbps now, 0 Mbps max"
1610 # OFPT_PORT_STATUS, OFPPR_DELETE
1611 ovs-vsctl del-port br0 test
1612 if test X"$1" = X"OFPPR_DELETE"; then shift;
1613 echo >>expout "OFPT_PORT_STATUS: DEL: 1(test): addr:aa:55:aa:55:00:0x
1616 speed: 0 Mbps now, 0 Mbps max"
1619 # OFPT_FLOW_REMOVED, OFPRR_DELETE
1620 ovs-ofctl add-flow br0 send_flow_rem,actions=drop
1621 ovs-ofctl --strict del-flows br0 ''
1622 if test X"$1" = X"OFPRR_DELETE"; then shift;
1623 echo >>expout "OFPT_FLOW_REMOVED: reason=delete"
1625 AT_FAIL_IF([test X"$1" != X])
1627 ovs-appctl -t ovs-ofctl ofctl/barrier
1628 echo >>expout "OFPT_BARRIER_REPLY:"
1632 s/ (xid=0x[0-9a-fA-F]*)//
1634 s/00:0.$/00:0x/' < monitor.log]],
1638 # It's a service connection so initially there should be no async messages.
1641 # Set miss_send_len to 128, turning on packet-ins for our service connection.
1642 ovs-appctl -t ovs-ofctl ofctl/send 0109000c0123456700000080
1643 check_async 2 OFPR_ACTION OFPPR_ADD OFPPR_DELETE OFPRR_DELETE
1645 # Set miss_send_len to 128 and enable invalid_ttl.
1646 ovs-appctl -t ovs-ofctl ofctl/send 0109000c0123456700040080
1647 check_async 3 OFPR_ACTION OFPR_INVALID_TTL OFPPR_ADD OFPPR_DELETE OFPRR_DELETE
1649 # Become slave, which should disable everything except port status.
1650 ovs-appctl -t ovs-ofctl ofctl/send 0104001400000002000023200000000a00000002
1651 check_async 4 OFPPR_ADD OFPPR_DELETE
1653 # Use NXT_SET_ASYNC_CONFIG to enable a patchwork of asynchronous messages.
1654 ovs-appctl -t ovs-ofctl ofctl/send 01040028000000020000232000000013000000020000000500000005000000020000000200000005
1655 check_async 5 OFPR_INVALID_TTL OFPPR_DELETE OFPRR_DELETE
1657 # Set controller ID 123.
1658 ovs-appctl -t ovs-ofctl ofctl/send 01040018000000030000232000000014000000000000007b
1659 check_async 6 OFPR_NO_MATCH OFPPR_DELETE OFPRR_DELETE
1661 # Restore controller ID 0.
1662 ovs-appctl -t ovs-ofctl ofctl/send 010400180000000300002320000000140000000000000000
1665 ovs-appctl -t ovs-ofctl ofctl/send 0104001400000002000023200000000a00000001
1666 check_async 7 OFPR_ACTION OFPPR_ADD
1668 ovs-appctl -t ovs-ofctl exit
1672 AT_SETUP([ofproto - asynchronous message control (OpenFlow 1.2)])
1674 AT_CHECK([ovs-ofctl -O OpenFlow12 monitor br0 --detach --no-chdir --pidfile])
1676 printf '\n\n--- check_async %d ---\n\n\n' $1
1680 ovs-appctl -t ovs-ofctl ofctl/barrier
1681 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
1684 # OFPT_PACKET_IN, OFPR_ACTION (controller_id=0)
1685 ovs-ofctl -O OpenFlow12 -v packet-out br0 none controller '0001020304050010203040501234'
1686 if test X"$1" = X"OFPR_ACTION"; then shift;
1687 echo >>expout "OFPT_PACKET_IN (OF1.2): total_len=14 in_port=ANY (via action) data_len=14 (unbuffered)
1688 metadata=0,in_port=0,vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234"
1691 # OFPT_PACKET_IN, OFPR_NO_MATCH (controller_id=123)
1692 ovs-ofctl -O OpenFlow12 -v packet-out br0 none 'controller(reason=no_match,id=123)' '0001020304050010203040501234'
1693 if test X"$1" = X"OFPR_NO_MATCH"; then shift;
1694 echo >>expout "OFPT_PACKET_IN (OF1.2): total_len=14 in_port=ANY (via no_match) data_len=14 (unbuffered)
1695 metadata=0,in_port=0,vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234"
1698 # OFPT_PACKET_IN, OFPR_INVALID_TTL (controller_id=0)
1699 ovs-ofctl -O OpenFlow12 packet-out br0 none dec_ttl '002583dfb4000026b98cb0f908004500003fb7e200000011339bac11370dac100002d7730035002b8f6d86fb0100000100000000000006626c702d7873066e696369726103636f6d00000f00'
1700 if test X"$1" = X"OFPR_INVALID_TTL"; then shift;
1701 echo >>expout "OFPT_PACKET_IN (OF1.2): total_len=76 in_port=ANY (via invalid_ttl) data_len=76 (unbuffered)
1702 udp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=00:26:b9:8c:b0:f9,dl_dst=00:25:83:df:b4:00,nw_src=172.17.55.13,nw_dst=172.16.0.2,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=55155,tp_dst=53 udp_csum:8f6d"
1705 # OFPT_PORT_STATUS, OFPPR_ADD
1706 ovs-vsctl add-port br0 test -- set Interface test type=dummy
1707 if test X"$1" = X"OFPPR_ADD"; then shift;
1708 echo >>expout "OFPT_PORT_STATUS (OF1.2): ADD: ${INDEX}(test): addr:aa:55:aa:55:00:0x
1711 speed: 0 Mbps now, 0 Mbps max"
1714 # OFPT_PORT_STATUS, OFPPR_DELETE
1715 ovs-vsctl del-port br0 test
1716 if test X"$1" = X"OFPPR_DELETE"; then shift;
1717 echo >>expout "OFPT_PORT_STATUS (OF1.2): DEL: ${INDEX}(test): addr:aa:55:aa:55:00:0x
1720 speed: 0 Mbps now, 0 Mbps max"
1723 # OFPT_FLOW_REMOVED, OFPRR_DELETE
1724 ovs-ofctl -O OpenFlow12 add-flow br0 send_flow_rem,actions=drop
1725 ovs-ofctl -O OpenFlow12 --strict del-flows br0 ''
1726 if test X"$1" = X"OFPRR_DELETE"; then shift;
1727 echo >>expout "OFPT_FLOW_REMOVED (OF1.2): reason=delete table_id=0"
1729 AT_FAIL_IF([test X"$1" != X])
1731 ovs-appctl -t ovs-ofctl ofctl/barrier
1732 echo >>expout "OFPT_BARRIER_REPLY (OF1.2):"
1736 s/ (xid=0x[0-9a-fA-F]*)//
1738 s/00:0.$/00:0x/' < monitor.log]],
1742 # It's a service connection so initially there should be no async messages.
1745 # Set miss_send_len to 128, turning on packet-ins for our service connection.
1746 ovs-appctl -t ovs-ofctl ofctl/send 0309000c0123456700000080
1747 check_async 2 OFPR_ACTION OFPPR_ADD OFPPR_DELETE OFPRR_DELETE
1749 # Set miss_send_len to 128 and enable invalid_ttl.
1750 ovs-appctl -t ovs-ofctl ofctl/send 0309000c0123456700040080
1751 check_async 3 OFPR_ACTION OFPR_INVALID_TTL OFPPR_ADD OFPPR_DELETE OFPRR_DELETE
1753 # Become slave (OF 1.2), which should disable everything except port status.
1754 ovs-appctl -t ovs-ofctl ofctl/send 031800180000000200000003000000000000000000000001
1755 check_async 4 OFPPR_ADD OFPPR_DELETE
1757 # Use NXT_SET_ASYNC_CONFIG to enable a patchwork of asynchronous messages.
1758 ovs-appctl -t ovs-ofctl ofctl/send 03040028000000020000232000000013000000020000000500000005000000020000000200000005
1759 check_async 5 OFPR_INVALID_TTL OFPPR_DELETE OFPRR_DELETE
1761 # Set controller ID 123.
1762 ovs-appctl -t ovs-ofctl ofctl/send 03040018000000030000232000000014000000000000007b
1763 check_async 6 OFPR_NO_MATCH OFPPR_DELETE OFPRR_DELETE
1765 # Restore controller ID 0.
1766 ovs-appctl -t ovs-ofctl ofctl/send 030400180000000300002320000000140000000000000000
1768 # Become master (OF 1.2).
1769 ovs-appctl -t ovs-ofctl ofctl/send 031800180000000400000002000000000000000000000002
1770 check_async 7 OFPR_ACTION OFPPR_ADD
1772 ovs-appctl -t ovs-ofctl exit
1776 AT_SETUP([ofproto - asynchronous message control (OpenFlow 1.3)])
1778 AT_CHECK([ovs-ofctl -O OpenFlow13 monitor br0 --detach --no-chdir --pidfile])
1780 printf '\n\n--- check_async %d ---\n\n\n' $1
1784 ovs-appctl -t ovs-ofctl ofctl/barrier
1785 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
1788 # OFPT_PACKET_IN, OFPR_ACTION (controller_id=0)
1789 ovs-ofctl -O OpenFlow13 -v packet-out br0 none controller '0001020304050010203040501234'
1790 if test X"$1" = X"OFPR_ACTION"; then shift;
1791 echo >>expout "OFPT_PACKET_IN (OF1.3): total_len=14 in_port=ANY (via action) data_len=14 (unbuffered)
1792 metadata=0,in_port=0,vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234"
1795 # OFPT_PACKET_IN, OFPR_NO_MATCH (controller_id=123)
1796 ovs-ofctl -O OpenFlow13 -v packet-out br0 none 'controller(reason=no_match,id=123)' '0001020304050010203040501234'
1797 if test X"$1" = X"OFPR_NO_MATCH"; then shift;
1798 echo >>expout "OFPT_PACKET_IN (OF1.3): total_len=14 in_port=ANY (via no_match) data_len=14 (unbuffered)
1799 metadata=0,in_port=0,vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234"
1802 # OFPT_PACKET_IN, OFPR_INVALID_TTL (controller_id=0)
1803 ovs-ofctl -O OpenFlow13 packet-out br0 none dec_ttl '002583dfb4000026b98cb0f908004500003fb7e200000011339bac11370dac100002d7730035002b8f6d86fb0100000100000000000006626c702d7873066e696369726103636f6d00000f00'
1804 if test X"$1" = X"OFPR_INVALID_TTL"; then shift;
1805 echo >>expout "OFPT_PACKET_IN (OF1.3): total_len=76 in_port=ANY (via invalid_ttl) data_len=76 (unbuffered)
1806 udp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=00:26:b9:8c:b0:f9,dl_dst=00:25:83:df:b4:00,nw_src=172.17.55.13,nw_dst=172.16.0.2,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=55155,tp_dst=53 udp_csum:8f6d"
1809 # OFPT_PORT_STATUS, OFPPR_ADD
1810 ovs-vsctl add-port br0 test -- set Interface test type=dummy
1811 if test X"$1" = X"OFPPR_ADD"; then shift;
1812 echo >>expout "OFPT_PORT_STATUS (OF1.3): ADD: ${INDEX}(test): addr:aa:55:aa:55:00:0x
1815 speed: 0 Mbps now, 0 Mbps max"
1818 # OFPT_PORT_STATUS, OFPPR_DELETE
1819 ovs-vsctl del-port br0 test
1820 if test X"$1" = X"OFPPR_DELETE"; then shift;
1821 echo >>expout "OFPT_PORT_STATUS (OF1.3): DEL: ${INDEX}(test): addr:aa:55:aa:55:00:0x
1824 speed: 0 Mbps now, 0 Mbps max"
1827 # OFPT_FLOW_REMOVED, OFPRR_DELETE
1828 ovs-ofctl -O OpenFlow13 add-flow br0 send_flow_rem,actions=drop
1829 ovs-ofctl -O OpenFlow13 --strict del-flows br0 ''
1830 if test X"$1" = X"OFPRR_DELETE"; then shift;
1831 echo >>expout "OFPT_FLOW_REMOVED (OF1.3): reason=delete table_id=0"
1833 AT_FAIL_IF([test X"$1" != X])
1835 ovs-appctl -t ovs-ofctl ofctl/barrier
1836 echo >>expout "OFPT_BARRIER_REPLY (OF1.3):"
1840 s/ (xid=0x[0-9a-fA-F]*)//
1842 s/00:0.$/00:0x/' < monitor.log]],
1846 # It's a service connection so initially there should be no async messages.
1849 # Set miss_send_len to 128, turning on packet-ins for our service connection.
1850 ovs-appctl -t ovs-ofctl ofctl/send 0409000c0123456700000080
1851 check_async 2 OFPR_ACTION OFPPR_ADD OFPPR_DELETE OFPRR_DELETE
1853 # Become slave (OF 1.3), which should disable everything except port status.
1854 ovs-appctl -t ovs-ofctl ofctl/send 041800180000000200000003000000000000000000000001
1855 check_async 3 OFPPR_ADD OFPPR_DELETE
1857 # Use OF 1.3 OFPT_SET_ASYNC to enable a patchwork of asynchronous messages.
1858 ovs-appctl -t ovs-ofctl ofctl/send 041c002000000002000000020000000500000005000000020000000200000005
1859 check_async 4 OFPR_INVALID_TTL OFPPR_DELETE OFPRR_DELETE
1861 # Set controller ID 123.
1862 ovs-appctl -t ovs-ofctl ofctl/send 04040018000000030000232000000014000000000000007b
1863 check_async 5 OFPR_NO_MATCH OFPPR_DELETE OFPRR_DELETE
1865 # Restore controller ID 0.
1866 ovs-appctl -t ovs-ofctl ofctl/send 040400180000000300002320000000140000000000000000
1868 # Become master (OF 1.3).
1869 ovs-appctl -t ovs-ofctl ofctl/send 041800180000000400000002000000000000000000000002
1870 check_async 6 OFPR_ACTION OFPPR_ADD
1872 ovs-appctl -t ovs-ofctl exit
1876 dnl This test checks that the role request/response messaging works
1877 dnl and that generation_id is handled properly.
1878 AT_SETUP([ofproto - controller role (OpenFlow 1.2)])
1880 ON_EXIT([kill `cat c1.pid c2.pid`])
1882 # Start two ovs-ofctl controller processes.
1883 AT_CAPTURE_FILE([monitor1.log])
1884 AT_CAPTURE_FILE([expout1])
1885 AT_CAPTURE_FILE([experr1])
1886 AT_CAPTURE_FILE([monitor2.log])
1887 AT_CAPTURE_FILE([expout2])
1888 AT_CAPTURE_FILE([experr2])
1890 AT_CHECK([ovs-ofctl -O OpenFlow12 monitor br0 --detach --no-chdir --pidfile=`pwd`/c$i.pid --unixctl=`pwd`/c$i])
1891 ovs-appctl -t `pwd`/c$i ofctl/barrier
1892 ovs-appctl -t `pwd`/c$i ofctl/set-output-file monitor$i.log
1896 # find out current role
1897 ovs-appctl -t `pwd`/c$i ofctl/send 031800180000000200000000000000000000000000000000
1898 echo >>experr$i "send: OFPT_ROLE_REQUEST (OF1.2): role=nochange"
1899 echo >>expout$i "OFPT_ROLE_REPLY (OF1.2): role=equal"
1902 # controller 1: Become slave (generation_id is initially undefined, so
1903 # 2^63+2 should not be stale)
1904 ovs-appctl -t `pwd`/c1 ofctl/send 031800180000000300000003000000008000000000000002
1905 echo >>experr1 "send: OFPT_ROLE_REQUEST (OF1.2): role=slave generation_id=9223372036854775810"
1906 echo >>expout1 "OFPT_ROLE_REPLY (OF1.2): role=slave generation_id=9223372036854775810"
1908 # controller 2: Become master.
1909 ovs-appctl -t `pwd`/c2 ofctl/send 031800180000000300000002000000008000000000000003
1910 echo >>experr2 "send: OFPT_ROLE_REQUEST (OF1.2): role=master generation_id=9223372036854775811"
1911 echo >>expout2 "OFPT_ROLE_REPLY (OF1.2): role=master generation_id=9223372036854775811"
1913 # controller 1: Try to become the master using a stale generation ID
1914 ovs-appctl -t `pwd`/c1 ofctl/send 031800180000000400000002000000000000000000000003
1915 echo >>experr1 "send: OFPT_ROLE_REQUEST (OF1.2): role=master generation_id=3"
1916 echo >>expout1 "OFPT_ERROR (OF1.2): OFPRRFC_STALE"
1917 echo >>expout1 "OFPT_ROLE_REQUEST (OF1.2): role=master generation_id=3"
1919 # controller 1: Become master using a valid generation ID
1920 ovs-appctl -t `pwd`/c1 ofctl/send 031800180000000500000002000000000000000000000001
1921 echo >>experr1 "send: OFPT_ROLE_REQUEST (OF1.2): role=master generation_id=1"
1922 echo >>expout1 "OFPT_ROLE_REPLY (OF1.2): role=master generation_id=1"
1925 ovs-appctl -t `pwd`/c$i ofctl/barrier
1926 echo >>expout$i "OFPT_BARRIER_REPLY (OF1.2):"
1932 AT_CHECK([grep -v '^send:' monitor$i.log | STRIP_XIDS], [0], [expout])
1934 AT_CHECK([grep '^send:' monitor$i.log | STRIP_XIDS], [0], [expout])
1939 dnl This test checks that the role request/response messaging works,
1940 dnl that generation_id is handled properly, and that role status update
1941 dnl messages are sent when a controller's role gets changed from master
1943 AT_SETUP([ofproto - controller role (OpenFlow 1.4)])
1945 ON_EXIT([kill `cat c1.pid c2.pid`])
1947 # Start two ovs-ofctl controller processes.
1948 AT_CAPTURE_FILE([monitor1.log])
1949 AT_CAPTURE_FILE([expout1])
1950 AT_CAPTURE_FILE([experr1])
1951 AT_CAPTURE_FILE([monitor2.log])
1952 AT_CAPTURE_FILE([expout2])
1953 AT_CAPTURE_FILE([experr2])
1955 AT_CHECK([ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile=`pwd`/c$i.pid --unixctl=`pwd`/c$i])
1956 ovs-appctl -t `pwd`/c$i ofctl/barrier
1957 ovs-appctl -t `pwd`/c$i ofctl/set-output-file monitor$i.log
1961 # find out current role
1962 ovs-appctl -t `pwd`/c$i ofctl/send 051800180000000200000000000000000000000000000000
1963 echo >>experr$i "send: OFPT_ROLE_REQUEST (OF1.4): role=nochange"
1964 echo >>expout$i "OFPT_ROLE_REPLY (OF1.4): role=equal"
1967 # controller 1: Become slave (generation_id is initially undefined, so
1968 # 2^63+2 should not be stale)
1969 ovs-appctl -t `pwd`/c1 ofctl/send 051800180000000300000003000000008000000000000002
1970 echo >>experr1 "send: OFPT_ROLE_REQUEST (OF1.4): role=slave generation_id=9223372036854775810"
1971 echo >>expout1 "OFPT_ROLE_REPLY (OF1.4): role=slave generation_id=9223372036854775810"
1973 # controller 2: Become master.
1974 ovs-appctl -t `pwd`/c2 ofctl/send 051800180000000300000002000000008000000000000003
1975 echo >>experr2 "send: OFPT_ROLE_REQUEST (OF1.4): role=master generation_id=9223372036854775811"
1976 echo >>expout2 "OFPT_ROLE_REPLY (OF1.4): role=master generation_id=9223372036854775811"
1978 # controller 1: Try to become the master using a stale generation ID
1979 ovs-appctl -t `pwd`/c1 ofctl/send 051800180000000400000002000000000000000000000003
1980 echo >>experr1 "send: OFPT_ROLE_REQUEST (OF1.4): role=master generation_id=3"
1981 echo >>expout1 "OFPT_ERROR (OF1.4): OFPRRFC_STALE"
1982 echo >>expout1 "OFPT_ROLE_REQUEST (OF1.4): role=master generation_id=3"
1984 # controller 1: Become master using a valid generation ID
1985 ovs-appctl -t `pwd`/c1 ofctl/send 051800180000000500000002000000000000000000000001
1986 echo >>experr1 "send: OFPT_ROLE_REQUEST (OF1.4): role=master generation_id=1"
1987 echo >>expout1 "OFPT_ROLE_REPLY (OF1.4): role=master generation_id=1"
1988 echo >>expout2 "OFPT_ROLE_STATUS (OF1.4): role=slave generation_id=1 reason=master_request"
1991 ovs-appctl -t `pwd`/c$i ofctl/barrier
1992 echo >>expout$i "OFPT_BARRIER_REPLY (OF1.4):"
1998 AT_CHECK([grep -v '^send:' monitor$i.log | STRIP_XIDS], [0], [expout])
2000 AT_CHECK([grep '^send:' monitor$i.log | STRIP_XIDS], [0], [expout])
2005 dnl This test checks that OFPT_PACKET_OUT accepts both OFPP_NONE (as
2006 dnl specified by OpenFlow 1.0) and OFPP_CONTROLLER (used by some
2007 dnl controllers despite the spec) as meaning a packet that was generated
2008 dnl by the controller.
2009 AT_SETUP([ofproto - packet-out from controller (OpenFlow 1.0)])
2011 ADD_OF_PORTS([br0], [1])
2013 # Start a monitor listening for packet-ins.
2014 AT_CHECK([ovs-ofctl -P openflow10 monitor br0 --detach --no-chdir --pidfile])
2015 ovs-appctl -t ovs-ofctl ofctl/send 0109000c0123456700000080
2016 ovs-appctl -t ovs-ofctl ofctl/barrier
2017 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
2018 AT_CAPTURE_FILE([monitor.log])
2020 # Send some packet-outs with OFPP_NONE and OFPP_CONTROLLER (65533) as in_port.
2021 AT_CHECK([ovs-ofctl packet-out br0 none controller,1 '0001020304050010203040501234'])
2022 AT_CHECK([ovs-ofctl packet-out br0 controller controller,1 '0001020304050010203040505678'])
2024 # Stop the monitor and check its output.
2025 ovs-appctl -t ovs-ofctl ofctl/barrier
2026 ovs-appctl -t ovs-ofctl exit
2028 ovs-ofctl dump-ports br0
2030 AT_CHECK([sed 's/ (xid=0x[[0-9a-fA-F]]*)//' monitor.log], [0], [dnl
2031 OFPT_PACKET_IN: total_len=14 in_port=ANY (via action) data_len=14 (unbuffered)
2032 metadata=0,in_port=0,vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234
2033 OFPT_PACKET_IN: total_len=14 in_port=CONTROLLER (via action) data_len=14 (unbuffered)
2034 metadata=0,in_port=0,vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x5678
2041 dnl This test checks that OFPT_PACKET_OUT accepts both OFPP_NONE (as
2042 dnl specified by OpenFlow 1.2) and OFPP_CONTROLLER (used by some
2043 dnl controllers despite the spec) as meaning a packet that was generated
2044 dnl by the controller.
2045 AT_SETUP([ofproto - packet-out from controller (OpenFlow 1.2)])
2048 # Start a monitor listening for packet-ins.
2049 AT_CHECK([ovs-ofctl -O OpenFlow12 monitor br0 --detach --no-chdir --pidfile])
2050 ovs-appctl -t ovs-ofctl ofctl/send 0309000c0123456700000080
2051 ovs-appctl -t ovs-ofctl ofctl/barrier
2052 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
2053 AT_CAPTURE_FILE([monitor.log])
2055 # Send some packet-outs with OFPP_NONE and OFPP_CONTROLLER (65533) as in_port.
2056 AT_CHECK([ovs-ofctl -O OpenFlow12 packet-out br0 none controller '0001020304050010203040501234'])
2057 AT_CHECK([ovs-ofctl -O OpenFlow12 packet-out br0 4294967293 controller '0001020304050010203040505678'])
2059 # Stop the monitor and check its output.
2060 ovs-appctl -t ovs-ofctl ofctl/barrier
2061 ovs-appctl -t ovs-ofctl exit
2063 AT_CHECK([sed 's/ (xid=0x[[0-9a-fA-F]]*)//' monitor.log], [0], [dnl
2064 OFPT_PACKET_IN (OF1.2): total_len=14 in_port=ANY (via action) data_len=14 (unbuffered)
2065 metadata=0,in_port=0,vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234
2066 OFPT_PACKET_IN (OF1.2): total_len=14 in_port=CONTROLLER (via action) data_len=14 (unbuffered)
2067 metadata=0,in_port=0,vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x5678
2068 OFPT_BARRIER_REPLY (OF1.2):
2074 dnl This test checks that OFPT_PACKET_OUT accepts both OFPP_NONE (as
2075 dnl specified by OpenFlow 1.1) and OFPP_CONTROLLER (used by some
2076 dnl controllers despite the spec) as meaning a packet that was generated
2077 dnl by the controller.
2078 AT_SETUP([ofproto - packet-out from controller (OpenFlow 1.1)])
2081 # Start a monitor listening for packet-ins.
2082 AT_CHECK([ovs-ofctl -O OpenFlow11 monitor br0 --detach --no-chdir --pidfile])
2083 ovs-appctl -t ovs-ofctl ofctl/send 0209000c0123456700000080
2084 ovs-appctl -t ovs-ofctl ofctl/barrier
2085 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
2086 AT_CAPTURE_FILE([monitor.log])
2088 # Send some packet-outs with OFPP_NONE and OFPP_CONTROLLER (65533) as in_port.
2089 AT_CHECK([ovs-ofctl -O OpenFlow11 packet-out br0 none controller '0001020304050010203040501234'])
2090 AT_CHECK([ovs-ofctl -O OpenFlow11 packet-out br0 4294967293 controller '0001020304050010203040505678'])
2092 # Stop the monitor and check its output.
2093 ovs-appctl -t ovs-ofctl ofctl/barrier
2094 ovs-appctl -t ovs-ofctl exit
2096 AT_CHECK([sed 's/ (xid=0x[[0-9a-fA-F]]*)//' monitor.log], [0], [dnl
2097 OFPT_PACKET_IN (OF1.1): total_len=14 in_port=ANY (via action) data_len=14 (unbuffered)
2098 metadata=0,in_port=0,vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234
2099 OFPT_PACKET_IN (OF1.1): total_len=14 in_port=CONTROLLER (via action) data_len=14 (unbuffered)
2100 metadata=0,in_port=0,vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x5678
2101 OFPT_BARRIER_REPLY (OF1.1):
2107 dnl This test checks that metadata is encoded in packet_in structures,
2108 dnl supported by NXAST.
2109 AT_SETUP([ofproto - packet-out with metadata (NXM)])
2112 # Start a monitor listening for packet-ins.
2113 AT_CHECK([ovs-ofctl -P nxm monitor br0 --detach --no-chdir --pidfile])
2114 ovs-appctl -t ovs-ofctl ofctl/send 0109000c0123456700000080
2115 ovs-appctl -t ovs-ofctl ofctl/barrier
2116 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
2117 AT_CAPTURE_FILE([monitor.log])
2119 # Send a packet-out with a load action to set some metadata, and forward to controller
2120 AT_CHECK([ovs-ofctl packet-out br0 controller 'load(0xfafafafa5a5a5a5a->OXM_OF_METADATA[[0..63]]), load(0xaa->NXM_NX_PKT_MARK[[]]), controller' '0001020304050010203040501234'])
2122 # Stop the monitor and check its output.
2123 ovs-appctl -t ovs-ofctl ofctl/barrier
2124 ovs-appctl -t ovs-ofctl exit
2126 AT_CHECK([sed 's/ (xid=0x[[0-9a-fA-F]]*)//' monitor.log], [0], [dnl
2127 NXT_PACKET_IN: total_len=14 in_port=CONTROLLER metadata=0xfafafafa5a5a5a5a pkt_mark=0xaa (via action) data_len=14 (unbuffered)
2128 metadata=0,in_port=0,vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234
2135 dnl This test checks that metadata is encoded in packet_in structures,
2136 dnl supported by NXAST.
2137 AT_SETUP([ofproto - packet-out with metadata (OpenFlow 1.2)])
2140 # Start a monitor listening for packet-ins.
2141 AT_CHECK([ovs-ofctl -O OpenFlow12 monitor br0 --detach --no-chdir --pidfile])
2142 ovs-appctl -t ovs-ofctl ofctl/send 0309000c0123456700000080
2143 ovs-appctl -t ovs-ofctl ofctl/barrier
2144 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
2145 AT_CAPTURE_FILE([monitor.log])
2147 # Send a packet-out with a load action to set some metadata, and forward to controller
2148 AT_CHECK([ovs-ofctl -O OpenFlow12 packet-out br0 none 'load(0xfafafafa5a5a5a5a->OXM_OF_METADATA[[0..63]]), controller' '0001020304050010203040501234'])
2150 # Stop the monitor and check its output.
2151 ovs-appctl -t ovs-ofctl ofctl/barrier
2152 ovs-appctl -t ovs-ofctl exit
2154 AT_CHECK([sed 's/ (xid=0x[[0-9a-fA-F]]*)//' monitor.log], [0], [dnl
2155 OFPT_PACKET_IN (OF1.2): total_len=14 in_port=ANY metadata=0xfafafafa5a5a5a5a (via action) data_len=14 (unbuffered)
2156 metadata=0,in_port=0,vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234
2157 OFPT_BARRIER_REPLY (OF1.2):
2163 dnl This test checks that tunnel metadata is encoded in packet_in structures.
2164 AT_SETUP([ofproto - packet-out with tunnel metadata (OpenFlow 1.2)])
2167 # Start a monitor listening for packet-ins.
2168 AT_CHECK([ovs-ofctl -O OpenFlow12 monitor br0 --detach --no-chdir --pidfile])
2169 ovs-appctl -t ovs-ofctl ofctl/send 0309000c0123456700000080
2170 ovs-appctl -t ovs-ofctl ofctl/barrier
2171 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
2172 AT_CAPTURE_FILE([monitor.log])
2174 # Send a packet-out with set field actions to set some tunnel metadata, and forward to controller
2175 AT_CHECK([ovs-ofctl -O OpenFlow12 packet-out br0 none 'set_field:127.0.0.1->tun_src,set_field:0x01020304->tun_id,set_field:192.168.0.1->tun_dst, controller' '0001020304050010203040501234'])
2177 # Stop the monitor and check its output.
2178 ovs-appctl -t ovs-ofctl ofctl/barrier
2179 ovs-appctl -t ovs-ofctl exit
2181 AT_CHECK([sed 's/ (xid=0x[[0-9a-fA-F]]*)//' monitor.log], [0], [dnl
2182 OFPT_PACKET_IN (OF1.2): total_len=14 in_port=ANY tun_id=0x1020304 tun_src=127.0.0.1 tun_dst=192.168.0.1 (via action) data_len=14 (unbuffered)
2183 metadata=0,in_port=0,vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234
2184 OFPT_BARRIER_REPLY (OF1.2):
2190 AT_SETUP([ofproto - flow monitoring])
2191 AT_KEYWORDS([monitor])
2194 ovs-ofctl add-flow br0 in_port=0,dl_vlan=123,actions=output:1
2196 # Start a monitor watching the flow table and check the initial reply.
2197 ovs-ofctl monitor br0 watch: --detach --no-chdir --pidfile >monitor.log 2>&1
2198 AT_CAPTURE_FILE([monitor.log])
2199 ovs-appctl -t ovs-ofctl ofctl/barrier
2200 AT_CHECK([sed 's/ (xid=0x[[1-9a-fA-F]][[0-9a-fA-F]]*)//' monitor.log], [0],
2201 [NXST_FLOW_MONITOR reply:
2202 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=123 actions=output:1
2206 # Add, delete, and modify some flows and check the updates.
2207 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
2208 ovs-ofctl add-flow br0 in_port=0,dl_vlan=124,actions=output:2
2209 ovs-ofctl add-flow br0 in_port=0,dl_vlan=123,actions=output:5
2210 ovs-ofctl add-flow br0 in_port=0,dl_vlan=123,dl_vlan_pcp=0,actions=output:6
2211 ovs-ofctl add-flow br0 in_port=0,dl_vlan=123,dl_vlan_pcp=1,actions=output:7
2212 ovs-ofctl add-flow br0 in_port=0,dl_vlan=123,actions=output:8
2213 ovs-ofctl add-flow br0 in_port=0,dl_vlan=65535,dl_vlan_pcp=0,actions=output:9
2214 ovs-ofctl add-flow br0 in_port=0,dl_vlan=65535,dl_vlan_pcp=1,actions=output:10
2215 ovs-ofctl add-flow br0 in_port=0,dl_vlan=65535,actions=output:11
2216 ovs-ofctl add-flow br0 in_port=0,dl_vlan=8191,dl_vlan_pcp=0,actions=output:12
2217 ovs-ofctl add-flow br0 in_port=0,dl_vlan=8191,dl_vlan_pcp=1,actions=output:13
2218 ovs-ofctl add-flow br0 in_port=0,dl_vlan=8191,actions=output:14
2219 ovs-ofctl add-flow br0 in_port=0,dl_vlan=0,dl_vlan_pcp=0,actions=output:15
2220 ovs-ofctl add-flow br0 in_port=0,dl_vlan=0,dl_vlan_pcp=1,actions=output:16
2221 ovs-ofctl add-flow br0 in_port=0,dl_vlan=0,actions=output:17
2222 ovs-ofctl add-flow br0 in_port=0,dl_vlan=0,dl_vlan_pcp=0,actions=output:18
2223 ovs-ofctl add-flow br0 in_port=0,dl_vlan=0,dl_vlan_pcp=1,actions=output:19
2224 ovs-ofctl add-flow br0 in_port=0,dl_vlan=0,actions=output:20
2225 ovs-ofctl add-flow br0 in_port=0,dl_vlan_pcp=0,actions=output:21
2226 ovs-ofctl add-flow br0 in_port=0,dl_vlan_pcp=1,actions=output:22
2227 ovs-ofctl add-flow br0 in_port=0,actions=output:23
2228 ovs-ofctl mod-flows br0 dl_vlan=123,actions=output:3
2229 ovs-ofctl mod-flows br0 cookie=5,dl_vlan=123,actions=output:3
2230 ovs-ofctl del-flows br0 dl_vlan=123
2231 ovs-ofctl del-flows br0
2232 ovs-appctl -t ovs-ofctl ofctl/barrier
2234 # Sorts groups of lines that start with a space, without moving them
2235 # past the nearest line that does not start with a space.
2243 print $_ foreach sort(@buffer);
2248 print $_ foreach sort(@buffer);
2250 AT_CHECK([sed 's/ (xid=0x[[1-9a-fA-F]][[0-9a-fA-F]]*)//' monitor.log | ${PERL} -e "$sort"], [0],
2251 [NXST_FLOW_MONITOR reply (xid=0x0):
2252 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=124 actions=output:2
2253 NXST_FLOW_MONITOR reply (xid=0x0):
2254 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=123 actions=output:5
2255 NXST_FLOW_MONITOR reply (xid=0x0):
2256 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=123,dl_vlan_pcp=0 actions=output:6
2257 NXST_FLOW_MONITOR reply (xid=0x0):
2258 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=123,dl_vlan_pcp=1 actions=output:7
2259 NXST_FLOW_MONITOR reply (xid=0x0):
2260 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=123 actions=output:8
2261 NXST_FLOW_MONITOR reply (xid=0x0):
2262 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=0,dl_vlan_pcp=0 actions=output:9
2263 NXST_FLOW_MONITOR reply (xid=0x0):
2264 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=0,dl_vlan_pcp=1 actions=output:10
2265 NXST_FLOW_MONITOR reply (xid=0x0):
2266 event=ADDED table=0 cookie=0 in_port=0,vlan_tci=0x0000 actions=output:11
2267 NXST_FLOW_MONITOR reply (xid=0x0):
2268 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=4095,dl_vlan_pcp=0 actions=output:12
2269 NXST_FLOW_MONITOR reply (xid=0x0):
2270 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=4095,dl_vlan_pcp=1 actions=output:13
2271 NXST_FLOW_MONITOR reply (xid=0x0):
2272 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=4095 actions=output:14
2273 NXST_FLOW_MONITOR reply (xid=0x0):
2274 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=0,dl_vlan_pcp=0 actions=output:15
2275 NXST_FLOW_MONITOR reply (xid=0x0):
2276 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=0,dl_vlan_pcp=1 actions=output:16
2277 NXST_FLOW_MONITOR reply (xid=0x0):
2278 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=0 actions=output:17
2279 NXST_FLOW_MONITOR reply (xid=0x0):
2280 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=0,dl_vlan_pcp=0 actions=output:18
2281 NXST_FLOW_MONITOR reply (xid=0x0):
2282 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=0,dl_vlan_pcp=1 actions=output:19
2283 NXST_FLOW_MONITOR reply (xid=0x0):
2284 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=0 actions=output:20
2285 NXST_FLOW_MONITOR reply (xid=0x0):
2286 event=ADDED table=0 cookie=0 in_port=0,dl_vlan_pcp=0 actions=output:21
2287 NXST_FLOW_MONITOR reply (xid=0x0):
2288 event=ADDED table=0 cookie=0 in_port=0,dl_vlan_pcp=1 actions=output:22
2289 NXST_FLOW_MONITOR reply (xid=0x0):
2290 event=ADDED table=0 cookie=0 in_port=0 actions=output:23
2291 NXST_FLOW_MONITOR reply (xid=0x0):
2292 event=MODIFIED table=0 cookie=0 in_port=0,dl_vlan=123 actions=output:3
2293 event=MODIFIED table=0 cookie=0 in_port=0,dl_vlan=123,dl_vlan_pcp=0 actions=output:3
2294 event=MODIFIED table=0 cookie=0 in_port=0,dl_vlan=123,dl_vlan_pcp=1 actions=output:3
2295 NXST_FLOW_MONITOR reply (xid=0x0):
2296 event=MODIFIED table=0 cookie=0x5 in_port=0,dl_vlan=123 actions=output:3
2297 event=MODIFIED table=0 cookie=0x5 in_port=0,dl_vlan=123,dl_vlan_pcp=0 actions=output:3
2298 event=MODIFIED table=0 cookie=0x5 in_port=0,dl_vlan=123,dl_vlan_pcp=1 actions=output:3
2299 NXST_FLOW_MONITOR reply (xid=0x0):
2300 event=DELETED reason=delete table=0 cookie=0x5 in_port=0,dl_vlan=123 actions=output:3
2301 event=DELETED reason=delete table=0 cookie=0x5 in_port=0,dl_vlan=123,dl_vlan_pcp=0 actions=output:3
2302 event=DELETED reason=delete table=0 cookie=0x5 in_port=0,dl_vlan=123,dl_vlan_pcp=1 actions=output:3
2303 NXST_FLOW_MONITOR reply (xid=0x0):
2304 event=DELETED reason=delete table=0 cookie=0 in_port=0 actions=output:23
2305 event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan=0 actions=output:20
2306 event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan=0,dl_vlan_pcp=0 actions=output:18
2307 event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan=0,dl_vlan_pcp=1 actions=output:19
2308 event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan=124 actions=output:2
2309 event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan=4095 actions=output:14
2310 event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan=4095,dl_vlan_pcp=0 actions=output:12
2311 event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan=4095,dl_vlan_pcp=1 actions=output:13
2312 event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan_pcp=0 actions=output:21
2313 event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan_pcp=1 actions=output:22
2314 event=DELETED reason=delete table=0 cookie=0 in_port=0,vlan_tci=0x0000 actions=output:11
2318 # Check that our own changes are reported as abbreviations.
2319 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
2320 ovs-ofctl add-flow br0 in_port=1,actions=output:2
2321 ovs-ofctl add-flow br0 in_port=2,actions=output:1
2322 ovs-appctl -t ovs-ofctl ofctl/barrier
2323 ovs-appctl -t ovs-ofctl ofctl/send 010e004812345678003fffff00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003000000000000ffffffffffff0000
2324 ovs-appctl -t ovs-ofctl ofctl/barrier
2325 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip], [0], [NXST_FLOW reply:
2327 AT_CHECK([sed 's/ (xid=0x[[1-9a-fA-F]][[0-9a-fA-F]]*)//' monitor.log], [0],
2328 [NXST_FLOW_MONITOR reply (xid=0x0):
2329 event=ADDED table=0 cookie=0 in_port=1 actions=output:2
2330 NXST_FLOW_MONITOR reply (xid=0x0):
2331 event=ADDED table=0 cookie=0 in_port=2 actions=output:1
2333 send: OFPT_FLOW_MOD: DEL priority=0 actions=drop
2334 NXST_FLOW_MONITOR reply (xid=0x0):
2335 event=ABBREV xid=0x12345678
2339 ovs-appctl -t ovs-ofctl exit
2343 AT_SETUP([ofproto - flow monitoring pause and resume])
2344 AT_KEYWORDS([monitor])
2346 # The maximum socket receive buffer size is important for this test, which
2347 # tests behavior when the receive buffer overflows.
2348 if test -e /proc/sys/net/core/rmem_max; then
2350 rmem_max=`cat /proc/sys/net/core/rmem_max`
2351 elif rmem_max=`sysctl -n net.inet.tcp.recvbuf_max 2>/dev/null`; then
2354 # Don't know how to get maximum socket receive buffer on this OS
2357 # Calculate the total amount of queuing: rmem_max in the kernel, 128 kB
2358 # in ofproto sending userspace (see ofmonitor_flush() in connmgr.c).
2359 queue_size=`expr $rmem_max + 128 \* 1024`
2360 echo rmem_max=$rmem_max queue_size=$queue_size
2362 # If there's too much queuing skip the test to avoid timing out.
2363 AT_SKIP_IF([test $rmem_max -gt 1048576])
2365 # Each flow update message takes up at least 48 bytes of space in queues
2366 # and in practice more than that.
2367 n_msgs=`expr $queue_size / 48`
2372 # Start a monitor watching the flow table, then make it block.
2373 ON_EXIT([kill `cat ovs-ofctl.pid`])
2374 ovs-ofctl monitor br0 watch: --detach --no-chdir --pidfile >monitor.log 2>&1
2375 AT_CAPTURE_FILE([monitor.log])
2376 ovs-appctl -t ovs-ofctl ofctl/block
2378 # Add $n_msgs flows.
2379 (echo "in_port=2,actions=output:2"
2381 for ($i = 0; $i < '$n_msgs'; $i++) {
2382 print "cookie=1,reg1=$i,actions=drop\n";
2385 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
2386 # Check that multipart flow dumps work properly:
2387 AT_CHECK([ovs-ofctl diff-flows br0 flows.txt])
2388 AT_CHECK([ovs-ofctl add-flow br0 in_port=1,cookie=3,actions=drop])
2389 AT_CHECK([ovs-ofctl mod-flows br0 in_port=2,cookie=2,actions=output:2])
2390 AT_CHECK([ovs-ofctl del-flows br0 cookie=1/-1])
2392 ovs-appctl -t ovs-ofctl ofctl/unblock
2394 # Wait for the connection resumed.
2395 # A barrier doesn't work for this purpose.
2396 # https://www.mail-archive.com/dev@openvswitch.org/msg27013.html
2397 # https://www.mail-archive.com/dev@openvswitch.org/msg27675.html
2398 OVS_WAIT_UNTIL([grep NXT_FLOW_MONITOR_RESUMED monitor.log])
2400 ovs-appctl -t ovs-ofctl exit
2402 # Check that the flow monitor reported the same number of flows
2403 # added and deleted, but fewer than we actually added and deleted.
2404 adds=`grep -c 'ADDED.*reg1=' monitor.log`
2405 deletes=`grep -c 'DELETED.*reg1=' monitor.log`
2406 echo adds=$adds deletes=$deletes
2407 AT_CHECK([test $adds -gt 100 && test $adds -lt $n_msgs])
2408 AT_CHECK([test $adds = $deletes])
2410 # Check that the flow monitor reported everything in the expected order:
2412 # event=ADDED table=0 cookie=0x1 reg1=0x22
2414 # NXT_FLOW_MONITOR_PAUSED:
2416 # event=DELETED reason=delete table=0 cookie=0x1 reg1=0x22
2418 # event=ADDED table=0 cookie=0x3 in_port=1
2419 # event=MODIFIED table=0 cookie=0x2 in_port=2 actions=output:2
2420 # NXT_FLOW_MONITOR_RESUMED:
2422 # except that, between the PAUSED and RESUMED, the order of the ADDED
2423 # and MODIFIED lines lines depends on hash order, that is, it varies
2424 # as we change the hash function or change architecture. Therefore,
2425 # we use a couple of tests below to accept both orders.
2426 AT_CHECK([ofctl_strip < monitor.log | sed -n -e '
2429 /NXT_FLOW_MONITOR_PAUSED:/p
2430 /NXT_FLOW_MONITOR_RESUMED:/p
2431 ' > monitor.log.subset])
2432 AT_CHECK([grep -v MODIFIED monitor.log.subset], [0], [dnl
2433 event=ADDED table=0 cookie=0x1 reg1=0x22
2434 NXT_FLOW_MONITOR_PAUSED:
2435 event=DELETED reason=delete table=0 cookie=0x1 reg1=0x22
2436 event=ADDED table=0 cookie=0x3 in_port=1
2437 NXT_FLOW_MONITOR_RESUMED:
2439 AT_CHECK([grep -v ADDED monitor.log.subset], [0], [dnl
2440 NXT_FLOW_MONITOR_PAUSED:
2441 event=DELETED reason=delete table=0 cookie=0x1 reg1=0x22
2442 event=MODIFIED table=0 cookie=0x2 in_port=2 actions=output:2
2443 NXT_FLOW_MONITOR_RESUMED:
2449 AT_SETUP([ofproto - event filtering (OpenFlow 1.3)])
2450 AT_KEYWORDS([monitor])
2453 # Start a monitor, use the required protocol version
2454 ovs-ofctl -O OpenFlow13 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1
2455 AT_CAPTURE_FILE([monitor.log])
2457 # Send an OpenFlow13 message (04), OFPT_GET_ASYNC_REQUEST (1a), length (8), xid (0a)
2458 ovs-appctl -t ovs-ofctl ofctl/send 041a00080000000a
2459 ovs-appctl -t ovs-ofctl ofctl/barrier
2461 # Check default setting
2462 read -r -d '' expected <<'EOF'
2465 AT_CHECK([ofctl_strip < monitor.log], [], [dnl
2466 send: OFPT_GET_ASYNC_REQUEST (OF1.3):
2467 OFPT_GET_ASYNC_REPLY (OF1.3):
2469 PACKET_IN: no_match action
2470 PORT_STATUS: add delete modify
2471 FLOW_REMOVED: idle hard delete
2475 PORT_STATUS: add delete modify
2477 OFPT_BARRIER_REPLY (OF1.3):
2483 AT_SETUP([ofproto - ofport_request])
2485 ADD_OF_PORTS([br0], [1], [2], [3])
2487 set_and_check_specific_ofports () {
2488 ovs-vsctl set Interface p1 ofport_request="$1" -- \
2489 set Interface p2 ofport_request="$2" -- \
2490 set Interface p3 ofport_request="$3"
2491 ofports=`ovs-vsctl get Interface p1 ofport -- \
2492 get Interface p2 ofport -- \
2493 get Interface p3 ofport`
2494 AT_CHECK_UNQUOTED([echo $ofports], [0], [$1 $2 $3
2497 for pre in '1 2 3' '1 3 2' '2 1 3' '2 3 1' '3 1 2' '3 2 1'; do
2498 for post in '1 2 3' '1 3 2' '2 1 3' '2 3 1' '3 1 2' '3 2 1'; do
2499 echo -----------------------------------------------------------
2500 echo "Check changing port numbers from $pre to $post"
2501 set_and_check_ofports $pre
2502 set_and_check_ofports $post
2506 ovs-vsctl del-port p3
2508 set_and_check_poorly_specified_ofports () {
2509 ovs-vsctl set Interface p1 ofport_request="$1" -- \
2510 set Interface p2 ofport_request="$2"
2511 p1=`ovs-vsctl get Interface p1 ofport`
2512 p2=`ovs-vsctl get Interface p2 ofport`
2515 AT_CHECK([test "$p1" != "$p2"])
2516 if test "$1" = "$2" && test "$1" != '[[]]'; then
2517 # One port number must be the requested one.
2518 AT_CHECK([test "$p1" = "$1" || test "$p2" = "$1"])
2519 # The other port number must be different (already tested above).
2521 AT_CHECK([test "$1" = '[[]]' || test "$p1" == "$1"])
2522 AT_CHECK([test "$2" = '[[]]' || test "$p2" == "$2"])
2525 for pre in '1 2' '[[]] 2' '1 [[]]' '[[]] [[]]' '2 1' '[[]] 1' '2 [[]]' \
2527 for post in '1 2' '[[]] 2' '1 [[]]' '[[]] [[]]' '2 1' '[[]] 1' '2 [[]]' \
2529 echo -----------------------------------------------------------
2530 echo "Check changing port numbers from $pre to $post"
2531 set_and_check_poorly_specified_ofports $pre
2532 set_and_check_poorly_specified_ofports $post
2539 AT_SETUP([ofproto - bundles, open (OpenFlow 1.4)])
2540 AT_KEYWORDS([monitor])
2543 # Start a monitor, use the required protocol version
2544 ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1
2545 AT_CAPTURE_FILE([monitor.log])
2547 # Send an OpenFlow14 message (05), OFPT_BUNDLE_CONTROL (21), length (10), xid (0a)
2548 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 00 00 01"
2549 ovs-appctl -t ovs-ofctl ofctl/barrier
2550 ovs-appctl -t ovs-ofctl exit
2552 AT_CHECK([ofctl_strip < monitor.log], [], [dnl
2553 send: OFPT_BUNDLE_CONTROL (OF1.4):
2554 bundle_id=0x1 type=OPEN_REQUEST flags=atomic
2555 OFPT_BUNDLE_CONTROL (OF1.4):
2556 bundle_id=0x1 type=OPEN_REPLY flags=0
2557 OFPT_BARRIER_REPLY (OF1.4):
2563 AT_SETUP([ofproto - bundles, double open (OpenFlow 1.4)])
2564 AT_KEYWORDS([monitor])
2567 # Start a monitor, use the required protocol version
2568 ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1
2569 AT_CAPTURE_FILE([monitor.log])
2571 # Send twice an OpenFlow14 message (05), OFPT_BUNDLE_CONTROL (21), length (10), xid (0a)
2572 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 00 00 01"
2573 ovs-appctl -t ovs-ofctl ofctl/barrier
2574 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 00 00 01"
2575 ovs-appctl -t ovs-ofctl ofctl/barrier
2576 ovs-appctl -t ovs-ofctl exit
2578 AT_CHECK([ofctl_strip < monitor.log], [0], [dnl
2579 send: OFPT_BUNDLE_CONTROL (OF1.4):
2580 bundle_id=0x1 type=OPEN_REQUEST flags=atomic
2581 OFPT_BUNDLE_CONTROL (OF1.4):
2582 bundle_id=0x1 type=OPEN_REPLY flags=0
2583 OFPT_BARRIER_REPLY (OF1.4):
2584 send: OFPT_BUNDLE_CONTROL (OF1.4):
2585 bundle_id=0x1 type=OPEN_REQUEST flags=atomic
2586 OFPT_ERROR (OF1.4): OFPBFC_BAD_ID
2587 OFPT_BUNDLE_CONTROL (OF1.4):
2588 bundle_id=0x1 type=OPEN_REQUEST flags=atomic
2589 OFPT_BARRIER_REPLY (OF1.4):
2595 AT_SETUP([ofproto - bundle close without open (OpenFlow 1.4)])
2596 AT_KEYWORDS([monitor])
2599 # Start a monitor, use the required protocol version
2600 ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1
2601 AT_CAPTURE_FILE([monitor.log])
2603 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 02 00 01"
2604 ovs-appctl -t ovs-ofctl ofctl/barrier
2605 ovs-appctl -t ovs-ofctl exit
2607 AT_CHECK([ofctl_strip < monitor.log], [0], [dnl
2608 send: OFPT_BUNDLE_CONTROL (OF1.4):
2609 bundle_id=0x1 type=CLOSE_REQUEST flags=atomic
2610 OFPT_ERROR (OF1.4): OFPBFC_BAD_ID
2611 OFPT_BUNDLE_CONTROL (OF1.4):
2612 bundle_id=0x1 type=CLOSE_REQUEST flags=atomic
2613 OFPT_BARRIER_REPLY (OF1.4):
2619 AT_SETUP([ofproto - bundle double close (OpenFlow 1.4)])
2620 AT_KEYWORDS([monitor])
2623 # Start a monitor, use the required protocol version
2624 ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1
2625 AT_CAPTURE_FILE([monitor.log])
2627 # Open, Close, Close
2628 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 00 00 01"
2629 ovs-appctl -t ovs-ofctl ofctl/barrier
2630 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 02 00 01"
2631 ovs-appctl -t ovs-ofctl ofctl/barrier
2632 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 02 00 01"
2633 ovs-appctl -t ovs-ofctl ofctl/barrier
2634 ovs-appctl -t ovs-ofctl exit
2636 AT_CHECK([ofctl_strip < monitor.log], [0], [dnl
2637 send: OFPT_BUNDLE_CONTROL (OF1.4):
2638 bundle_id=0x1 type=OPEN_REQUEST flags=atomic
2639 OFPT_BUNDLE_CONTROL (OF1.4):
2640 bundle_id=0x1 type=OPEN_REPLY flags=0
2641 OFPT_BARRIER_REPLY (OF1.4):
2642 send: OFPT_BUNDLE_CONTROL (OF1.4):
2643 bundle_id=0x1 type=CLOSE_REQUEST flags=atomic
2644 OFPT_BUNDLE_CONTROL (OF1.4):
2645 bundle_id=0x1 type=CLOSE_REPLY flags=0
2646 OFPT_BARRIER_REPLY (OF1.4):
2647 send: OFPT_BUNDLE_CONTROL (OF1.4):
2648 bundle_id=0x1 type=CLOSE_REQUEST flags=atomic
2649 OFPT_ERROR (OF1.4): OFPBFC_BUNDLE_CLOSED
2650 OFPT_BUNDLE_CONTROL (OF1.4):
2651 bundle_id=0x1 type=CLOSE_REQUEST flags=atomic
2652 OFPT_BARRIER_REPLY (OF1.4):
2658 AT_SETUP([ofproto - bundle close, different flags (OpenFlow 1.4)])
2659 AT_KEYWORDS([monitor])
2662 # Start a monitor, use the required protocol version
2663 ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1
2664 AT_CAPTURE_FILE([monitor.log])
2666 # Open, Close, Close
2667 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 00 00 01"
2668 ovs-appctl -t ovs-ofctl ofctl/barrier
2669 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 02 00 02"
2670 ovs-appctl -t ovs-ofctl ofctl/barrier
2671 ovs-appctl -t ovs-ofctl exit
2673 AT_CHECK([ofctl_strip < monitor.log], [0], [dnl
2674 send: OFPT_BUNDLE_CONTROL (OF1.4):
2675 bundle_id=0x1 type=OPEN_REQUEST flags=atomic
2676 OFPT_BUNDLE_CONTROL (OF1.4):
2677 bundle_id=0x1 type=OPEN_REPLY flags=0
2678 OFPT_BARRIER_REPLY (OF1.4):
2679 send: OFPT_BUNDLE_CONTROL (OF1.4):
2680 bundle_id=0x1 type=CLOSE_REQUEST flags=ordered
2681 OFPT_ERROR (OF1.4): OFPBFC_BAD_FLAGS
2682 OFPT_BUNDLE_CONTROL (OF1.4):
2683 bundle_id=0x1 type=CLOSE_REQUEST flags=ordered
2684 OFPT_BARRIER_REPLY (OF1.4):
2690 AT_SETUP([ofproto - bundle commit without open (OpenFlow 1.4)])
2691 AT_KEYWORDS([monitor])
2694 # Start a monitor, use the required protocol version
2695 ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1
2696 AT_CAPTURE_FILE([monitor.log])
2698 # Open, Close, Close
2699 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 04 00 01"
2700 ovs-appctl -t ovs-ofctl ofctl/barrier
2701 ovs-appctl -t ovs-ofctl exit
2703 AT_CHECK([ofctl_strip < monitor.log], [0], [dnl
2704 send: OFPT_BUNDLE_CONTROL (OF1.4):
2705 bundle_id=0x1 type=COMMIT_REQUEST flags=atomic
2706 OFPT_ERROR (OF1.4): OFPBFC_BAD_ID
2707 OFPT_BUNDLE_CONTROL (OF1.4):
2708 bundle_id=0x1 type=COMMIT_REQUEST flags=atomic
2709 OFPT_BARRIER_REPLY (OF1.4):
2715 AT_SETUP([ofproto - bundle commit, different flags (OpenFlow 1.4)])
2716 AT_KEYWORDS([monitor])
2719 # Start a monitor, use the required protocol version
2720 ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1
2721 AT_CAPTURE_FILE([monitor.log])
2723 # Open, Close, Close
2724 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 00 00 01"
2725 ovs-appctl -t ovs-ofctl ofctl/barrier
2726 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 04 00 02"
2727 ovs-appctl -t ovs-ofctl ofctl/barrier
2728 ovs-appctl -t ovs-ofctl exit
2730 AT_CHECK([ofctl_strip < monitor.log], [0], [dnl
2731 send: OFPT_BUNDLE_CONTROL (OF1.4):
2732 bundle_id=0x1 type=OPEN_REQUEST flags=atomic
2733 OFPT_BUNDLE_CONTROL (OF1.4):
2734 bundle_id=0x1 type=OPEN_REPLY flags=0
2735 OFPT_BARRIER_REPLY (OF1.4):
2736 send: OFPT_BUNDLE_CONTROL (OF1.4):
2737 bundle_id=0x1 type=COMMIT_REQUEST flags=ordered
2738 OFPT_ERROR (OF1.4): OFPBFC_BAD_FLAGS
2739 OFPT_BUNDLE_CONTROL (OF1.4):
2740 bundle_id=0x1 type=COMMIT_REQUEST flags=ordered
2741 OFPT_BARRIER_REPLY (OF1.4):
2747 AT_SETUP([ofproto - bundle discard without open (OpenFlow 1.4)])
2748 AT_KEYWORDS([monitor])
2751 # Start a monitor, use the required protocol version
2752 ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1
2753 AT_CAPTURE_FILE([monitor.log])
2755 # Open, Close, Close
2756 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 06 00 01"
2757 ovs-appctl -t ovs-ofctl ofctl/barrier
2758 ovs-appctl -t ovs-ofctl exit
2760 AT_CHECK([ofctl_strip < monitor.log], [0], [dnl
2761 send: OFPT_BUNDLE_CONTROL (OF1.4):
2762 bundle_id=0x1 type=DISCARD_REQUEST flags=atomic
2763 OFPT_ERROR (OF1.4): OFPBFC_BAD_ID
2764 OFPT_BUNDLE_CONTROL (OF1.4):
2765 bundle_id=0x1 type=DISCARD_REQUEST flags=atomic
2766 OFPT_BARRIER_REPLY (OF1.4):