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 enqueue set_vlan_vid set_vlan_pcp strip_vlan mod_dl_src mod_dl_dst mod_nw_src mod_nw_dst mod_nw_tos mod_tp_src mod_tp_dst
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 enqueue set_vlan_vid set_vlan_pcp strip_vlan mod_dl_src mod_dl_dst mod_nw_src mod_nw_dst mod_nw_tos mod_tp_src mod_tp_dst
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 dnl Actions definition listed in both supported formats (w/ actions=)
267 AT_SETUP([ofproto - del group])
269 AT_DATA([groups.txt], [dnl
270 group_id=1234,type=all,bucket=output:10
271 group_id=1235,type=all,bucket=actions=output:10
273 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-groups br0 groups.txt])
274 AT_CHECK([ovs-ofctl -F OXM-OpenFlow15 -O OpenFlow15 -vwarn dump-groups br0 1234], [0], [stdout])
275 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
276 OFPST_GROUP_DESC reply (OF1.5):
277 group_id=1234,type=all,bucket=actions=output:10
279 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn del-groups br0 group_id=1234])
280 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn dump-groups br0], [0], [stdout])
281 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
282 OFPST_GROUP_DESC reply (OF1.1):
283 group_id=1235,type=all,bucket=actions=output:10
285 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn del-groups br0 group_id=1234])
286 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn dump-groups br0], [0], [stdout])
287 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
288 OFPST_GROUP_DESC reply (OF1.1):
289 group_id=1235,type=all,bucket=actions=output:10
291 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn del-groups br0], [0])
292 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn dump-groups br0], [0], [stdout])
293 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
294 OFPST_GROUP_DESC reply (OF1.1):
299 dnl This is really bare-bones.
300 dnl It at least checks request and reply serialization and deserialization.
301 AT_SETUP([ofproto - del group deletes flows])
303 AT_DATA([groups.txt], [dnl
304 group_id=1234,type=all,bucket=output:10
305 group_id=1235,type=all,bucket=output:10
307 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-groups br0 groups.txt])
308 AT_DATA([flows.txt], [dnl
309 tcp actions=group:1234
310 udp actions=group:1235
312 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-flows br0 flows.txt])
313 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn dump-flows br0 | ofctl_strip | sort],
315 tcp actions=group:1234
316 udp actions=group:1235
317 OFPST_FLOW reply (OF1.1):
319 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn del-groups br0 group_id=1234])
320 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn dump-flows br0 | ofctl_strip | sort],
322 udp actions=group:1235
323 OFPST_FLOW reply (OF1.1):
325 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn del-groups br0 group_id=1234])
326 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn dump-flows br0 | ofctl_strip | sort],
328 udp actions=group:1235
329 OFPST_FLOW reply (OF1.1):
331 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn del-groups br0])
332 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn dump-flows br0 | ofctl_strip | sort],
334 OFPST_FLOW reply (OF1.1):
339 dnl This is really bare-bones.
340 dnl It at least checks request and reply serialization and deserialization.
341 AT_SETUP([ofproto - flow mod checks group availability])
343 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-group br0 group_id=1234,type=all,bucket=output:10])
344 AT_DATA([flows.txt], [dnl
345 tcp actions=group:1234
346 udp actions=group:1235
348 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-flow br0 'tcp actions=group:1234'])
349 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-flow br0 'tcp actions=group:1235'], [1], [], [stderr])
351 # The output should look like this:
353 # 00000000 02 0e 00 98 00 00 00 02-00 00 00 00 00 00 00 00 |................|
354 # 00000010 00 00 00 00 00 00 00 00-ff 00 00 00 00 00 80 00 |................|
355 # 00000020 ff ff ff ff ff ff ff ff-ff ff ff ff 00 00 00 00 |................|
356 # 00000030 00 00 00 58 00 00 00 00-00 00 03 d7 00 00 00 00 |...X............|
358 # This 'sed' command captures the error message but drops details.
359 AT_CHECK([sed '/truncated/d
360 /^000000.0/d' stderr | STRIP_XIDS], [0],
361 [OFPT_ERROR (OF1.1): OFPBAC_BAD_OUT_GROUP
362 OFPT_FLOW_MOD (OF1.1):
367 dnl This is really bare-bones.
368 dnl It at least checks request and reply serialization and deserialization.
369 AT_SETUP([ofproto - group description])
371 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-group br0 group_id=1234,type=all,bucket=output:10], [0], [stdout])
372 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn dump-groups br0], [0], [stdout])
373 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
374 OFPST_GROUP_DESC reply (OF1.1):
375 group_id=1234,type=all,bucket=actions=output:10
380 dnl This is really bare-bones.
381 dnl It at least checks request and reply serialization and deserialization.
382 AT_SETUP([ofproto - group description])
384 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-group br0 group_id=1234,type=all,bucket=output:10])
385 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn dump-groups br0], [0], [stdout])
386 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
387 OFPST_GROUP_DESC reply (OF1.1):
388 group_id=1234,type=all,bucket=actions=output:10
393 dnl This is really bare-bones.
394 dnl It at least checks request and reply serialization and deserialization.
395 AT_SETUP([ofproto - group features])
397 AT_CHECK([ovs-ofctl -O OpenFlow12 -vwarn dump-group-features br0], [0], [stdout])
398 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
399 OFPST_GROUP_FEATURES reply (OF1.2):
407 dnl This is really bare-bones.
408 dnl It at least checks request and reply serialization and deserialization.
409 AT_SETUP([ofproto - group stats])
411 AT_DATA([groups.txt], [dnl
412 group_id=1234,type=all,bucket=output:10
413 group_id=1235,type=all,bucket=output:10
415 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-groups br0 groups.txt])
416 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-flow br0 'tcp actions=group:1234'])
417 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn dump-group-stats br0 group_id=1234], [0], [stdout])
418 AT_CHECK([STRIP_XIDS stdout | sort], [0], [dnl
419 group_id=1234,ref_count=1,packet_count=0,byte_count=0,bucket0:packet_count=0,byte_count=0
420 OFPST_GROUP reply (OF1.1):
422 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn dump-group-stats br0], [0], [stdout])
423 AT_CHECK([STRIP_XIDS stdout | sort], [0], [dnl
424 group_id=1234,ref_count=1,packet_count=0,byte_count=0,bucket0:packet_count=0,byte_count=0
425 group_id=1235,ref_count=0,packet_count=0,byte_count=0,bucket0:packet_count=0,byte_count=0
426 OFPST_GROUP reply (OF1.1):
431 AT_SETUP([ofproto - mod-port (OpenFlow 1.0)])
433 for command_config_state in \
435 'noflood NO_FLOOD 0' \
436 'down PORT_DOWN,NO_FLOOD LINK_DOWN' \
437 'flood PORT_DOWN LINK_DOWN' \
438 'no-receive PORT_DOWN,NO_RECV LINK_DOWN' \
439 'no-forward PORT_DOWN,NO_RECV,NO_FWD LINK_DOWN' \
440 'no-packet-in PORT_DOWN,NO_RECV,NO_FWD,NO_PACKET_IN LINK_DOWN' \
441 'forward PORT_DOWN,NO_RECV,NO_PACKET_IN LINK_DOWN' \
442 'packet-in PORT_DOWN,NO_RECV LINK_DOWN' \
446 set $command_config_state
447 command=$[1] config=`echo $[2] | sed 's/,/ /g'` state=$[3]
448 AT_CHECK([ovs-ofctl -vwarn mod-port br0 br0 $command])
449 AT_CHECK([ovs-ofctl -vwarn show br0], [0], [stdout])
450 AT_CHECK_UNQUOTED([STRIP_XIDS stdout], [0], [dnl
451 OFPT_FEATURES_REPLY: dpid:fedcba9876543210
452 n_tables:254, n_buffers:256
453 capabilities: FLOW_STATS TABLE_STATS PORT_STATS QUEUE_STATS ARP_MATCH_IP
454 actions: output enqueue set_vlan_vid set_vlan_pcp strip_vlan mod_dl_src mod_dl_dst mod_nw_src mod_nw_dst mod_nw_tos mod_tp_src mod_tp_dst
455 LOCAL(br0): addr:aa:55:aa:55:00:00
458 speed: 0 Mbps now, 0 Mbps max
459 OFPT_GET_CONFIG_REPLY: frags=normal miss_send_len=0
465 AT_SETUP([ofproto - mod-port (OpenFlow 1.2)])
467 for command_config_state in \
469 'down PORT_DOWN LINK_DOWN' \
470 'no-receive PORT_DOWN,NO_RECV LINK_DOWN' \
471 'no-forward PORT_DOWN,NO_RECV,NO_FWD LINK_DOWN' \
472 'no-packet-in PORT_DOWN,NO_RECV,NO_FWD,NO_PACKET_IN LINK_DOWN' \
473 'forward PORT_DOWN,NO_RECV,NO_PACKET_IN LINK_DOWN' \
474 'packet-in PORT_DOWN,NO_RECV LINK_DOWN' \
478 set $command_config_state
479 command=$[1] config=`echo $[2] | sed 's/,/ /g'` state=$[3]
480 AT_CHECK([ovs-ofctl -O OpenFlow12 -vwarn mod-port br0 br0 $command])
481 AT_CHECK([ovs-ofctl -O OpenFlow12 -vwarn show br0], [0], [stdout])
482 AT_CHECK_UNQUOTED([STRIP_XIDS stdout], [0], [dnl
483 OFPT_FEATURES_REPLY (OF1.2): dpid:fedcba9876543210
484 n_tables:254, n_buffers:256
485 capabilities: FLOW_STATS TABLE_STATS PORT_STATS QUEUE_STATS
486 LOCAL(br0): addr:aa:55:aa:55:00:00
489 speed: 0 Mbps now, 0 Mbps max
490 OFPT_GET_CONFIG_REPLY (OF1.2): frags=normal miss_send_len=0
496 AT_SETUP([ofproto - mod-port (OpenFlow 1.4)])
498 for command_config_state in \
500 'down PORT_DOWN LINK_DOWN' \
501 'no-receive PORT_DOWN,NO_RECV LINK_DOWN' \
502 'no-forward PORT_DOWN,NO_RECV,NO_FWD LINK_DOWN' \
503 'no-packet-in PORT_DOWN,NO_RECV,NO_FWD,NO_PACKET_IN LINK_DOWN' \
504 'forward PORT_DOWN,NO_RECV,NO_PACKET_IN LINK_DOWN' \
505 'packet-in PORT_DOWN,NO_RECV LINK_DOWN' \
509 set $command_config_state
510 command=$[1] config=`echo $[2] | sed 's/,/ /g'` state=$[3]
511 AT_CHECK([ovs-ofctl -O OpenFlow14 -vwarn mod-port br0 br0 $command])
512 AT_CHECK([ovs-ofctl -O OpenFlow14 -vwarn show br0], [0], [stdout])
513 AT_CHECK_UNQUOTED([STRIP_XIDS stdout], [0], [dnl
514 OFPT_FEATURES_REPLY (OF1.4): dpid:fedcba9876543210
515 n_tables:254, n_buffers:256
516 capabilities: FLOW_STATS TABLE_STATS PORT_STATS QUEUE_STATS
517 OFPST_PORT_DESC reply (OF1.4):
518 LOCAL(br0): addr:aa:55:aa:55:00:00
521 speed: 0 Mbps now, 0 Mbps max
522 OFPT_GET_CONFIG_REPLY (OF1.4): frags=normal miss_send_len=0
528 AT_SETUP([ofproto - basic flow_mod commands (NXM)])
530 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip], [0], [NXST_FLOW reply:
532 AT_CHECK([echo 'in_port=2,actions=1' | ovs-ofctl add-flows br0 -])
533 AT_CHECK([ovs-ofctl add-flow br0 in_port=1,actions=2])
534 AT_CHECK([ovs-ofctl -F nxm add-flow br0 table=1,in_port=4,actions=3])
535 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
536 in_port=1 actions=output:2
537 in_port=2 actions=output:1
538 table=1, in_port=4 actions=output:3
541 AT_CHECK([ovs-ofctl dump-aggregate br0 table=0 | STRIP_XIDS], [0], [dnl
542 NXST_AGGREGATE reply: packet_count=0 byte_count=0 flow_count=2
544 AT_CHECK([ovs-ofctl del-flows br0])
545 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip], [0], [NXST_FLOW reply:
550 AT_SETUP([ofproto - basic flow_mod commands (OpenFlow 1.0)])
552 AT_CHECK([ovs-ofctl -F openflow10 dump-flows br0 | ofctl_strip], [0], [OFPST_FLOW reply:
554 AT_CHECK([echo 'in_port=2,actions=1' | ovs-ofctl -F openflow10 add-flows br0 -])
555 AT_CHECK([ovs-ofctl -F openflow10 add-flow br0 in_port=1,actions=2])
556 AT_CHECK([ovs-ofctl -F openflow10 add-flow br0 table=1,in_port=4,actions=3])
557 AT_CHECK([ovs-ofctl -F openflow10 dump-flows br0 | ofctl_strip | sort], [0], [dnl
558 in_port=1 actions=output:2
559 in_port=2 actions=output:1
560 table=1, in_port=4 actions=output:3
563 AT_CHECK([ovs-ofctl -F openflow10 dump-aggregate br0 table=0 | STRIP_XIDS], [0], [dnl
564 OFPST_AGGREGATE reply: packet_count=0 byte_count=0 flow_count=2
566 AT_CHECK([ovs-ofctl -F openflow10 del-flows br0])
567 AT_CHECK([ovs-ofctl -F openflow10 dump-flows br0 | ofctl_strip], [0], [OFPST_FLOW reply:
572 AT_SETUP([ofproto - basic flow_mod commands (OpenFlow 1.1)])
574 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip], [0], [OFPST_FLOW reply (OF1.1):
576 AT_CHECK([echo 'in_port=2,actions=1' | ovs-ofctl -O OpenFlow11 add-flows br0 -])
577 AT_CHECK([ovs-ofctl -O OpenFlow11 add-flow br0 in_port=1,actions=2])
578 AT_CHECK([ovs-ofctl -O OpenFlow11 add-flow br0 table=1,in_port=4,actions=3])
579 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl
580 in_port=1 actions=output:2
581 in_port=2 actions=output:1
582 table=1, in_port=4 actions=output:3
583 OFPST_FLOW reply (OF1.1):
585 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-aggregate br0 table=0 | STRIP_XIDS], [0], [dnl
586 OFPST_AGGREGATE reply (OF1.1): packet_count=0 byte_count=0 flow_count=2
588 AT_CHECK([ovs-ofctl -O OpenFlow11 del-flows br0])
589 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip], [0], [OFPST_FLOW reply (OF1.1):
590 table=1, in_port=4 actions=output:3
595 AT_SETUP([ofproto - flow_mod negative test (OpenFlow 1.1)])
597 [set bridge br0 protocols=OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13])
598 AT_CHECK([ovs-ofctl add-flow -O OpenFlow11 br0 table=1,action=goto_table:2])
600 # The error message here actually comes from ovs-ofctl, not from ovs-vswitchd,
601 # but at least it's the same code in ofpacts_check() that issues the error.
602 AT_CHECK([ovs-ofctl add-flow -O OpenFlow11 br0 table=1,action=goto_table:1],
604 [ovs-ofctl: actions are invalid with specified match (OFPBRC_BAD_TABLE_ID)
609 AT_SETUP([ofproto - set-field flow_mod commands (NXM)])
611 AT_CHECK([ovs-ofctl add-flow br0 ipv6,table=1,in_port=3,actions=drop])
612 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])
613 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
614 table=1, ipv6,in_port=3 actions=load:0xa6badbfffefe59fa->NXM_NX_IPV6_SRC[[0..63]],load:0xfe8001234567890a->NXM_NX_IPV6_SRC[[64..127]]
620 AT_SETUP([ofproto - basic flow_mod commands (OpenFlow 1.2)])
622 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip], [0], [OFPST_FLOW reply (OF1.2):
624 AT_CHECK([echo 'in_port=2,actions=1' | ovs-ofctl -O OpenFlow12 add-flows br0 -])
625 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 in_port=1,actions=2])
626 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 table=1,in_port=4,actions=3])
627 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
628 in_port=1 actions=output:2
629 in_port=2 actions=output:1
630 table=1, in_port=4 actions=output:3
631 OFPST_FLOW reply (OF1.2):
633 AT_CHECK([ovs-ofctl -O OpenFlow12 del-flows br0])
634 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip], [0], [OFPST_FLOW reply (OF1.2):
639 AT_SETUP([ofproto - dump flows with cookie])
641 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x1,in_port=1,actions=1])
642 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x2,in_port=2,actions=1])
643 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x3,in_port=3,actions=1])
644 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
645 cookie=0x1, in_port=1 actions=output:1
646 cookie=0x2, in_port=2 actions=output:1
647 cookie=0x3, in_port=3 actions=output:1
650 AT_CHECK([ovs-ofctl dump-aggregate br0 table=0 | STRIP_XIDS], [0], [dnl
651 NXST_AGGREGATE reply: packet_count=0 byte_count=0 flow_count=3
653 AT_CHECK([ovs-ofctl dump-flows br0 cookie=0x3/-1 | ofctl_strip | sort], [0], [dnl
654 cookie=0x3, in_port=3 actions=output:1
657 AT_CHECK([ovs-ofctl dump-aggregate br0 cookie=0x3/-1 | STRIP_XIDS], [0], [dnl
658 NXST_AGGREGATE reply: packet_count=0 byte_count=0 flow_count=1
663 AT_SETUP([ofproto - mod flow with cookie change (OpenFlow 1.0)])
665 AT_CHECK([ovs-ofctl -F openflow10 add-flow br0 cookie=0x1,in_port=1,actions=1])
666 AT_CHECK([ovs-ofctl -F openflow10 dump-flows br0 | ofctl_strip | sort], [0], [dnl
667 cookie=0x1, in_port=1 actions=output:1
671 AT_CHECK([ovs-ofctl -F openflow10 mod-flows br0 cookie=0x2,in_port=1,actions=1])
672 AT_CHECK([ovs-ofctl -F openflow10 dump-flows br0 | ofctl_strip | sort], [0], [dnl
673 cookie=0x2, in_port=1 actions=output:1
679 AT_SETUP([ofproto - mod flow with cookie change (NXM)])
681 AT_CHECK([ovs-ofctl -F nxm add-flow br0 cookie=0x1,in_port=1,actions=1])
682 AT_CHECK([ovs-ofctl -F nxm dump-flows br0 | ofctl_strip | sort], [0], [dnl
683 cookie=0x1, in_port=1 actions=output:1
687 AT_CHECK([ovs-ofctl -F nxm mod-flows br0 cookie=0x2,in_port=1,actions=1])
688 AT_CHECK([ovs-ofctl -F nxm dump-flows br0 | ofctl_strip | sort], [0], [dnl
689 cookie=0x2, in_port=1 actions=output:1
695 AT_SETUP([ofproto - no mod flow with cookie change (OpenFlow 1.1)])
697 AT_CHECK([ovs-ofctl -O OpenFlow11 add-flow br0 cookie=0x1,in_port=1,actions=1])
698 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl
699 cookie=0x1, in_port=1 actions=output:1
700 OFPST_FLOW reply (OF1.1):
702 AT_CHECK([ovs-ofctl -O OpenFlow11 mod-flows br0 cookie=0x2,in_port=1,actions=1])
703 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl
704 cookie=0x1, in_port=1 actions=output:1
705 OFPST_FLOW reply (OF1.1):
710 dnl The OpenFlow 1.2 spec states that the cookie may not be modified
711 AT_SETUP([ofproto - no mod flow with cookie change (OpenFlow 1.2)])
713 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 cookie=0x1,in_port=1,actions=1])
714 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
715 cookie=0x1, in_port=1 actions=output:1
716 OFPST_FLOW reply (OF1.2):
719 AT_CHECK([ovs-ofctl -O OpenFlow12 mod-flows br0 cookie=0x2,in_port=1,actions=1])
720 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
721 cookie=0x1, in_port=1 actions=output:1
722 OFPST_FLOW reply (OF1.2):
727 AT_SETUP([ofproto - mod flows based on cookie mask (OpenFlow 1.0)])
729 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x1,in_port=1,actions=1])
730 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x1,in_port=2,actions=1])
731 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x2,in_port=3,actions=1])
732 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
733 cookie=0x1, in_port=1 actions=output:1
734 cookie=0x1, in_port=2 actions=output:1
735 cookie=0x2, in_port=3 actions=output:1
739 AT_CHECK([ovs-ofctl -F nxm mod-flows br0 cookie=0x1/0xff,actions=4])
740 AT_CHECK([ovs-ofctl -F nxm dump-flows br0 | ofctl_strip | sort], [0], [dnl
741 cookie=0x1, in_port=1 actions=output:4
742 cookie=0x1, in_port=2 actions=output:4
743 cookie=0x2, in_port=3 actions=output:1
749 AT_SETUP([ofproto - mod flows based on cookie mask (OpenFlow 1.1)])
751 AT_CHECK([ovs-ofctl -O OpenFlow11 add-flow br0 cookie=0x1,in_port=1,actions=1])
752 AT_CHECK([ovs-ofctl -O OpenFlow11 add-flow br0 cookie=0x1,in_port=2,actions=1])
753 AT_CHECK([ovs-ofctl -O OpenFlow11 add-flow br0 cookie=0x2,in_port=3,actions=1])
754 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl
755 cookie=0x1, in_port=1 actions=output:1
756 cookie=0x1, in_port=2 actions=output:1
757 cookie=0x2, in_port=3 actions=output:1
758 OFPST_FLOW reply (OF1.1):
761 AT_CHECK([ovs-ofctl -O OpenFlow11 mod-flows br0 cookie=0x1/0xff,actions=4])
762 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl
763 cookie=0x1, in_port=1 actions=output:4
764 cookie=0x1, in_port=2 actions=output:4
765 cookie=0x2, in_port=3 actions=output:1
766 OFPST_FLOW reply (OF1.1):
771 AT_SETUP([ofproto - mod flows based on cookie mask (OpenFlow 1.2)])
773 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 cookie=0x1,in_port=1,actions=1])
774 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 cookie=0x1,in_port=2,actions=1])
775 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 cookie=0x2,in_port=3,actions=1])
776 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
777 cookie=0x1, in_port=1 actions=output:1
778 cookie=0x1, in_port=2 actions=output:1
779 cookie=0x2, in_port=3 actions=output:1
780 OFPST_FLOW reply (OF1.2):
783 AT_CHECK([ovs-ofctl -O OpenFlow12 mod-flows br0 cookie=0x1/0xff,actions=4])
784 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
785 cookie=0x1, in_port=1 actions=output:4
786 cookie=0x1, in_port=2 actions=output:4
787 cookie=0x2, in_port=3 actions=output:1
788 OFPST_FLOW reply (OF1.2):
793 dnl The OpenFlow 1.2 spec states that the cookie may not be modified
794 AT_SETUP([ofproto - mod flows based on cookie mask with cookie change])
796 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x1,in_port=1,actions=1])
797 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x1,in_port=2,actions=1])
798 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x2,in_port=3,actions=1])
799 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
800 cookie=0x1, in_port=1 actions=output:1
801 cookie=0x1, in_port=2 actions=output:1
802 cookie=0x2, in_port=3 actions=output:1
806 AT_CHECK([ovs-ofctl -F nxm mod-flows br0 cookie=1/-1,cookie=4,actions=4])
807 AT_CHECK([ovs-ofctl -F nxm dump-flows br0 | ofctl_strip | sort], [0], [dnl
808 cookie=0x2, in_port=3 actions=output:1
809 cookie=0x4, in_port=1 actions=output:4
810 cookie=0x4, in_port=2 actions=output:4
816 AT_SETUP([ofproto - mod flow with cookie miss (mask==0) - NXM])
818 AT_CHECK([ovs-ofctl -F nxm mod-flows br0 in_port=1,actions=1])
819 AT_CHECK([ovs-ofctl -F nxm dump-flows br0 | ofctl_strip | sort], [0], [dnl
820 in_port=1 actions=output:1
826 AT_SETUP([ofproto - mod flow with cookie miss (mask==0) - OF1.1])
828 AT_CHECK([ovs-ofctl -O openflow11 mod-flows br0 in_port=1,actions=1])
829 AT_CHECK([ovs-ofctl -O openflow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl
830 in_port=1 actions=output:1
831 OFPST_FLOW reply (OF1.1):
836 AT_SETUP([ofproto - mod flow with cookie miss (mask==0) - OF1.2])
838 AT_CHECK([ovs-ofctl -O openflow12 mod-flows br0 in_port=1,actions=1])
839 AT_CHECK([ovs-ofctl -O openflow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
840 OFPST_FLOW reply (OF1.2):
845 AT_SETUP([ofproto - mod flow with cookie miss (mask!=0) - NXM])
847 AT_CHECK([ovs-ofctl -F nxm mod-flows br0 cookie=1/1,in_port=1,actions=1])
848 AT_CHECK([ovs-ofctl -F nxm dump-flows br0 | ofctl_strip | sort], [0], [dnl
854 AT_SETUP([ofproto - mod flow with cookie miss (mask!=0) - OF1.1])
856 AT_CHECK([ovs-ofctl -O openflow11 mod-flows br0 cookie=1/1,in_port=1,actions=1])
857 AT_CHECK([ovs-ofctl -O openflow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl
858 OFPST_FLOW reply (OF1.1):
863 AT_SETUP([ofproto - mod flow with cookie miss (mask!=0) - OF1.2])
865 AT_CHECK([ovs-ofctl -O openflow12 mod-flows br0 cookie=1/1,in_port=1,actions=1])
866 AT_CHECK([ovs-ofctl -O openflow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
867 OFPST_FLOW reply (OF1.2):
872 AT_SETUP([ofproto - del flows with cookies])
874 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x1,in_port=1,actions=1])
875 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x2,in_port=2,actions=1])
876 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x3,in_port=3,actions=1])
877 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
878 cookie=0x1, in_port=1 actions=output:1
879 cookie=0x2, in_port=2 actions=output:1
880 cookie=0x3, in_port=3 actions=output:1
884 AT_CHECK([ovs-ofctl del-flows br0])
885 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
891 AT_SETUP([ofproto - del flows based on cookie])
893 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x1,in_port=1,actions=1])
894 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x2,in_port=2,actions=1])
895 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x3,in_port=3,actions=1])
896 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
897 cookie=0x1, in_port=1 actions=output:1
898 cookie=0x2, in_port=2 actions=output:1
899 cookie=0x3, in_port=3 actions=output:1
903 AT_CHECK([ovs-ofctl del-flows br0 cookie=0x3/-1])
904 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
905 cookie=0x1, in_port=1 actions=output:1
906 cookie=0x2, in_port=2 actions=output:1
912 AT_SETUP([ofproto - del flows based on cookie mask])
914 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x1,in_port=1,actions=1])
915 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x2,in_port=2,actions=1])
916 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x3,in_port=3,actions=1])
917 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
918 cookie=0x1, in_port=1 actions=output:1
919 cookie=0x2, in_port=2 actions=output:1
920 cookie=0x3, in_port=3 actions=output:1
923 AT_CHECK([ovs-ofctl del-flows br0 cookie=0x3/0x1])
924 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
925 cookie=0x2, in_port=2 actions=output:1
931 AT_SETUP([ofproto - del flows based on table id (NXM)])
933 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x1,in_port=1,actions=1])
934 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x2,in_port=2,table=1,actions=1])
935 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
936 cookie=0x1, in_port=1 actions=output:1
937 cookie=0x2, table=1, in_port=2 actions=output:1
940 AT_CHECK([ovs-ofctl del-flows br0 table=0])
941 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
942 cookie=0x2, table=1, in_port=2 actions=output:1
945 AT_CHECK([ovs-ofctl del-flows br0 table=1])
946 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
949 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x1,in_port=1,actions=1])
950 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x2,in_port=2,table=1,actions=1])
951 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
952 cookie=0x1, in_port=1 actions=output:1
953 cookie=0x2, table=1, in_port=2 actions=output:1
956 AT_CHECK([ovs-ofctl del-flows br0])
957 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
963 AT_SETUP([ofproto - del flows based on table id (OpenFlow 1.1)])
965 AT_CHECK([ovs-ofctl -O OpenFlow11 add-flow br0 cookie=0x1,in_port=1,actions=1])
966 AT_CHECK([ovs-ofctl -O OpenFlow11 add-flow br0 cookie=0x2,in_port=2,table=1,actions=1])
967 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl
968 cookie=0x1, in_port=1 actions=output:1
969 cookie=0x2, table=1, in_port=2 actions=output:1
970 OFPST_FLOW reply (OF1.1):
972 AT_CHECK([ovs-ofctl -O OpenFlow11 del-flows br0 table=0])
973 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl
974 cookie=0x2, table=1, in_port=2 actions=output:1
975 OFPST_FLOW reply (OF1.1):
977 AT_CHECK([ovs-ofctl -O OpenFlow11 del-flows br0 table=1])
978 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl
979 OFPST_FLOW reply (OF1.1):
981 AT_CHECK([ovs-ofctl -O OpenFlow11 add-flow br0 cookie=0x1,in_port=1,actions=1])
982 AT_CHECK([ovs-ofctl -O OpenFlow11 add-flow br0 cookie=0x2,in_port=2,table=1,actions=1])
983 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl
984 cookie=0x1, in_port=1 actions=output:1
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])
989 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip], [0], [dnl
990 OFPST_FLOW reply (OF1.1):
991 cookie=0x2, table=1, in_port=2 actions=output:1
996 AT_SETUP([ofproto - del flows based on table id (OpenFlow 1.2)])
998 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 cookie=0x1,in_port=1,actions=1])
999 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 cookie=0x2,in_port=2,table=1,actions=1])
1000 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1001 cookie=0x1, in_port=1 actions=output:1
1002 cookie=0x2, table=1, in_port=2 actions=output:1
1003 OFPST_FLOW reply (OF1.2):
1005 AT_CHECK([ovs-ofctl -O OpenFlow12 del-flows br0 table=0])
1006 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1007 cookie=0x2, table=1, in_port=2 actions=output:1
1008 OFPST_FLOW reply (OF1.2):
1010 AT_CHECK([ovs-ofctl -O OpenFlow12 del-flows br0 table=1])
1011 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1012 OFPST_FLOW reply (OF1.2):
1014 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 cookie=0x1,in_port=1,actions=1])
1015 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 cookie=0x2,in_port=2,table=1,actions=1])
1016 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1017 cookie=0x1, in_port=1 actions=output:1
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])
1022 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1023 OFPST_FLOW reply (OF1.2):
1028 AT_SETUP([ofproto - flow table configuration (OpenFlow 1.0)])
1030 # Check the default configuration.
1031 (printf "OFPST_TABLE reply (xid=0x2):"
1034 while test $x -lt 254; do
1037 active=0, lookup=0, matched=0
1040 in_port: exact match or wildcard
1041 eth_src: exact match or wildcard
1042 eth_dst: exact match or wildcard
1043 eth_type: exact match or wildcard
1044 vlan_vid: exact match or wildcard
1045 vlan_pcp: exact match or wildcard
1046 ip_src: exact match or wildcard
1047 ip_dst: exact match or wildcard
1048 nw_proto: exact match or wildcard
1049 nw_tos: exact match or wildcard
1050 tcp_src: exact match or wildcard
1051 tcp_dst: exact match or wildcard
1056 AT_CHECK([ovs-ofctl dump-tables br0], [0], [expout])
1057 # Change the configuration.
1060 -- --id=@t0 create Flow_Table name=main \
1061 -- --id=@t1 create Flow_Table flow-limit=1024 \
1062 -- set bridge br0 'flow_tables={1=@t1,0=@t0}' \
1063 | ${PERL} $srcdir/uuidfilt.pl],
1067 # Check that the configuration was updated.
1068 mv expout orig-expout
1069 sed -e 's/classifier/main/
1070 21s/1000000/1024/' 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 (printf "OFPST_TABLE reply (OF1.2) (xid=0x2):"
1081 while test $x -lt 254; do
1083 table $x (\"$name\"):
1084 active=0, lookup=0, matched=0
1085 metadata: match=0xffffffffffffffff write=0xffffffffffffffff
1088 instructions (table miss and others):
1089 instructions: apply_actions,clear_actions,write_actions,write_metadata,goto_table
1090 Write-Actions and Apply-Actions features:
1091 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
1092 supported on Set-Field: metadata in_port_oxm eth_src eth_dst vlan_vid vlan_pcp mpls_label mpls_tc ip_src ip_dst ipv6_src ipv6_dst ip_dscp nw_ecn arp_op arp_spa arp_tpa arp_sha arp_tha tcp_src tcp_dst udp_src udp_dst sctp_src sctp_dst
1094 metadata: exact match or wildcard
1095 in_port_oxm: exact match or wildcard
1096 eth_src: exact match or wildcard
1097 eth_dst: exact match or wildcard
1098 eth_type: exact match or wildcard
1099 vlan_vid: exact match or wildcard
1100 vlan_pcp: exact match or wildcard
1101 mpls_label: exact match or wildcard
1102 mpls_tc: exact match or wildcard
1103 ip_src: exact match or wildcard
1104 ip_dst: exact match or wildcard
1105 ipv6_src: exact match or wildcard
1106 ipv6_dst: exact match or wildcard
1107 ipv6_label: exact match or wildcard
1108 nw_proto: exact match or wildcard
1109 ip_dscp: exact match or wildcard
1110 nw_ecn: exact match or wildcard
1111 arp_op: exact match or wildcard
1112 arp_spa: exact match or wildcard
1113 arp_tpa: exact match or wildcard
1114 arp_sha: exact match or wildcard
1115 arp_tha: exact match or wildcard
1116 tcp_src: exact match or wildcard
1117 tcp_dst: exact match or wildcard
1118 udp_src: exact match or wildcard
1119 udp_dst: exact match or wildcard
1120 sctp_src: exact match or wildcard
1121 sctp_dst: exact match or wildcard
1122 icmp_type: exact match or wildcard
1123 icmp_code: exact match or wildcard
1124 icmpv6_type: exact match or wildcard
1125 icmpv6_code: exact match or wildcard
1126 nd_target: exact match or wildcard
1127 nd_sll: exact match or wildcard
1128 nd_tll: exact match or wildcard"
1132 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-tables br0], [0], [expout])
1133 # Change the configuration.
1136 -- --id=@t0 create Flow_Table name=main \
1137 -- --id=@t1 create Flow_Table flow-limit=1024 \
1138 -- set bridge br0 'flow_tables={1=@t1,0=@t0}' \
1139 | ${PERL} $srcdir/uuidfilt.pl],
1143 # Check that the configuration was updated.
1144 mv expout orig-expout
1145 sed 's/classifier/main/
1146 53s/1000000/1024/' < orig-expout > expout
1147 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-tables br0], [0], [expout])
1151 AT_SETUP([ofproto - hard limits on flow table size (OpenFlow 1.0)])
1153 # Configure a maximum of 4 flows.
1156 -- --id=@t0 create Flow_Table flow-limit=4 \
1157 -- set bridge br0 flow_tables:0=@t0 \
1158 | ${PERL} $srcdir/uuidfilt.pl],
1162 for in_port in 1 2 3 4; do
1163 ovs-ofctl add-flow br0 in_port=$in_port,actions=drop
1165 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1166 in_port=1 actions=drop
1167 in_port=2 actions=drop
1168 in_port=3 actions=drop
1169 in_port=4 actions=drop
1172 # Adding another flow will be refused.
1173 AT_CHECK([ovs-ofctl add-flow br0 in_port=5,actions=drop], [1], [], [stderr])
1174 AT_CHECK([head -n 1 stderr | ofctl_strip], [0],
1175 [OFPT_ERROR: OFPFMFC_TABLE_FULL
1177 # Also a mod-flow that would add a flow will be refused.
1178 AT_CHECK([ovs-ofctl mod-flows br0 in_port=5,actions=drop], [1], [], [stderr])
1179 AT_CHECK([head -n 1 stderr | ofctl_strip], [0],
1180 [OFPT_ERROR: OFPFMFC_TABLE_FULL
1182 # Replacing or modifying an existing flow is allowed.
1183 AT_CHECK([ovs-ofctl add-flow br0 in_port=4,actions=normal])
1184 AT_CHECK([ovs-ofctl mod-flows br0 in_port=3,actions=output:1])
1185 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1186 in_port=1 actions=drop
1187 in_port=2 actions=drop
1188 in_port=3 actions=output:1
1189 in_port=4 actions=NORMAL
1195 AT_SETUP([ofproto - hard limits on flow table size (OpenFlow 1.2)])
1197 # Configure a maximum of 4 flows.
1200 -- --id=@t0 create Flow_Table flow-limit=4 \
1201 -- set bridge br0 flow_tables:0=@t0 \
1202 | ${PERL} $srcdir/uuidfilt.pl],
1206 for in_port in 1 2 3 4; do
1207 ovs-ofctl -O OpenFlow12 add-flow br0 in_port=$in_port,actions=drop
1209 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1210 in_port=1 actions=drop
1211 in_port=2 actions=drop
1212 in_port=3 actions=drop
1213 in_port=4 actions=drop
1214 OFPST_FLOW reply (OF1.2):
1216 # Adding another flow will be refused.
1217 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 in_port=5,actions=drop], [1], [], [stderr])
1218 AT_CHECK([head -n 1 stderr | ofctl_strip], [0],
1219 [OFPT_ERROR (OF1.2): OFPFMFC_TABLE_FULL
1221 # Replacing or modifying an existing flow is allowed.
1222 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 in_port=4,actions=normal])
1223 AT_CHECK([ovs-ofctl -O OpenFlow12 mod-flows br0 in_port=3,actions=output:1])
1224 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1225 in_port=1 actions=drop
1226 in_port=2 actions=drop
1227 in_port=3 actions=output:1
1228 in_port=4 actions=NORMAL
1229 OFPST_FLOW reply (OF1.2):
1234 AT_SETUP([ofproto - eviction upon table overflow (OpenFlow 1.0)])
1236 # Configure a maximum of 4 flows.
1239 -- --id=@t0 create Flow_Table flow-limit=4 overflow-policy=evict \
1240 -- set bridge br0 flow_tables:0=@t0 \
1241 | ${PERL} $srcdir/uuidfilt.pl],
1245 for in_port in 4 3 2 1; do
1246 ovs-ofctl add-flow br0 idle_timeout=${in_port}0,in_port=$in_port,actions=drop
1248 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1249 idle_timeout=10, in_port=1 actions=drop
1250 idle_timeout=20, in_port=2 actions=drop
1251 idle_timeout=30, in_port=3 actions=drop
1252 idle_timeout=40, in_port=4 actions=drop
1255 # Adding another flow will cause the one that expires soonest to be evicted.
1256 AT_CHECK([ovs-ofctl add-flow br0 in_port=5,actions=drop])
1257 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1258 idle_timeout=20, in_port=2 actions=drop
1259 idle_timeout=30, in_port=3 actions=drop
1260 idle_timeout=40, in_port=4 actions=drop
1261 in_port=5 actions=drop
1264 # A mod-flow that adds a flow also causes eviction, but replacing or
1265 # modifying an existing flow doesn't.
1266 AT_CHECK([ovs-ofctl mod-flows br0 in_port=6,actions=drop])
1267 AT_CHECK([ovs-ofctl add-flow br0 in_port=4,actions=normal])
1268 AT_CHECK([ovs-ofctl mod-flows br0 in_port=3,actions=output:1])
1269 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1270 idle_timeout=30, in_port=3 actions=output:1
1271 in_port=4 actions=NORMAL
1272 in_port=5 actions=drop
1273 in_port=6 actions=drop
1276 # Flows with no timeouts at all cannot be evicted.
1277 AT_CHECK([ovs-ofctl add-flow br0 in_port=7,actions=normal])
1278 AT_CHECK([ovs-ofctl add-flow br0 in_port=8,actions=drop], [1], [], [stderr])
1279 AT_CHECK([head -n 1 stderr | ofctl_strip], [0],
1280 [OFPT_ERROR: OFPFMFC_TABLE_FULL
1282 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1283 in_port=4 actions=NORMAL
1284 in_port=5 actions=drop
1285 in_port=6 actions=drop
1286 in_port=7 actions=NORMAL
1292 AT_SETUP([ofproto - eviction upon table overflow (OpenFlow 1.2)])
1294 # Configure a maximum of 4 flows.
1297 -- --id=@t0 create Flow_Table flow-limit=4 overflow-policy=evict \
1298 -- set bridge br0 flow_tables:0=@t0 \
1299 | ${PERL} $srcdir/uuidfilt.pl],
1303 for in_port in 4 3 2 1; do
1304 ovs-ofctl -O OpenFlow12 add-flow br0 idle_timeout=${in_port}0,in_port=$in_port,actions=drop
1306 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1307 idle_timeout=10, in_port=1 actions=drop
1308 idle_timeout=20, in_port=2 actions=drop
1309 idle_timeout=30, in_port=3 actions=drop
1310 idle_timeout=40, in_port=4 actions=drop
1311 OFPST_FLOW reply (OF1.2):
1313 # Adding another flow will cause the one that expires soonest to be evicted.
1314 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 in_port=5,actions=drop])
1315 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1316 idle_timeout=20, in_port=2 actions=drop
1317 idle_timeout=30, in_port=3 actions=drop
1318 idle_timeout=40, in_port=4 actions=drop
1319 in_port=5 actions=drop
1320 OFPST_FLOW reply (OF1.2):
1322 # In Open Flow 1.2 a mod-flow does not ever add a flow and thus
1323 # has no effect on eviction
1324 AT_CHECK([ovs-ofctl -O OpenFlow12 mod-flows br0 in_port=6,actions=drop])
1325 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 in_port=4,actions=normal])
1326 AT_CHECK([ovs-ofctl -O OpenFlow12 mod-flows br0 in_port=3,actions=output:1])
1327 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1328 idle_timeout=20, in_port=2 actions=drop
1329 idle_timeout=30, in_port=3 actions=output:1
1330 in_port=4 actions=NORMAL
1331 in_port=5 actions=drop
1332 OFPST_FLOW reply (OF1.2):
1334 # Flows with no timeouts at all cannot be evicted.
1335 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 in_port=6,actions=drop])
1336 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 in_port=7,actions=normal])
1337 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 in_port=8,actions=drop], [1], [], [stderr])
1338 AT_CHECK([head -n 1 stderr | ofctl_strip], [0],
1339 [OFPT_ERROR (OF1.2): OFPFMFC_TABLE_FULL
1341 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1342 in_port=4 actions=NORMAL
1343 in_port=5 actions=drop
1344 in_port=6 actions=drop
1345 in_port=7 actions=NORMAL
1346 OFPST_FLOW reply (OF1.2):
1351 AT_SETUP([ofproto - eviction upon table overflow, with fairness (OpenFlow 1.0)])
1353 # Configure a maximum of 4 flows.
1356 -- --id=@t0 create Flow_Table name=evict flow-limit=4 \
1357 overflow-policy=evict \
1358 groups='"NXM_OF_IN_PORT[[]]"' \
1359 -- set bridge br0 flow_tables:0=@t0 \
1360 | ${PERL} $srcdir/uuidfilt.pl],
1364 ovs-ofctl add-flows br0 - <<EOF
1365 idle_timeout=10 in_port=2 dl_src=00:44:55:66:77:88 actions=drop
1366 idle_timeout=20 in_port=1 dl_src=00:11:22:33:44:55 actions=drop
1367 idle_timeout=30 in_port=1 dl_src=00:22:33:44:55:66 actions=drop
1368 idle_timeout=40 in_port=1 dl_src=00:33:44:55:66:77 actions=drop
1370 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1371 idle_timeout=10, in_port=2,dl_src=00:44:55:66:77:88 actions=drop
1372 idle_timeout=20, in_port=1,dl_src=00:11:22:33:44:55 actions=drop
1373 idle_timeout=30, in_port=1,dl_src=00:22:33:44:55:66 actions=drop
1374 idle_timeout=40, in_port=1,dl_src=00:33:44:55:66:77 actions=drop
1377 # Adding another flow will cause the one that expires soonest within
1378 # the largest group (those with in_port=1) to be evicted. In this
1379 # case this is not the same as the one that expires soonest overall
1380 # (which is what makes the test interesting):
1381 AT_CHECK([ovs-ofctl add-flow br0 in_port=2,dl_src=00:55:66:77:88:99,actions=drop])
1382 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1383 idle_timeout=10, in_port=2,dl_src=00:44:55:66:77:88 actions=drop
1384 idle_timeout=30, in_port=1,dl_src=00:22:33:44:55:66 actions=drop
1385 idle_timeout=40, in_port=1,dl_src=00:33:44:55:66:77 actions=drop
1386 in_port=2,dl_src=00:55:66:77:88:99 actions=drop
1389 # Enlarge the flow limit, change the eviction policy back to strictly
1390 # based on expiration, and and add some flows.
1391 AT_CHECK([ovs-vsctl set Flow_Table evict groups='[[]]' flow-limit=7])
1392 ovs-ofctl add-flows br0 - <<EOF
1393 idle_timeout=50 in_port=2 dl_src=00:66:77:88:99:aa actions=drop
1394 idle_timeout=60 in_port=2 dl_src=00:77:88:99:aa:bb actions=drop
1395 idle_timeout=70 in_port=2 dl_src=00:88:99:aa:bb:cc actions=drop
1397 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1398 idle_timeout=10, in_port=2,dl_src=00:44:55:66:77:88 actions=drop
1399 idle_timeout=30, in_port=1,dl_src=00:22:33:44:55:66 actions=drop
1400 idle_timeout=40, in_port=1,dl_src=00:33:44:55:66:77 actions=drop
1401 idle_timeout=50, in_port=2,dl_src=00:66:77:88:99:aa actions=drop
1402 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=drop
1403 idle_timeout=70, in_port=2,dl_src=00:88:99:aa:bb:cc actions=drop
1404 in_port=2,dl_src=00:55:66:77:88:99 actions=drop
1407 # Adding another flow will cause the one that expires soonest overall
1409 AT_CHECK([ovs-ofctl add-flow br0 'idle_timeout=80 in_port=2 dl_src=00:99:aa:bb:cc:dd actions=drop'])
1410 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1411 idle_timeout=30, in_port=1,dl_src=00:22:33:44:55:66 actions=drop
1412 idle_timeout=40, in_port=1,dl_src=00:33:44:55:66:77 actions=drop
1413 idle_timeout=50, in_port=2,dl_src=00:66:77:88:99:aa actions=drop
1414 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=drop
1415 idle_timeout=70, in_port=2,dl_src=00:88:99:aa:bb:cc actions=drop
1416 idle_timeout=80, in_port=2,dl_src=00:99:aa:bb:cc:dd actions=drop
1417 in_port=2,dl_src=00:55:66:77:88:99 actions=drop
1420 # Reducing the flow limit also causes the flows that expire soonest
1421 # overall to be evicted.
1422 AT_CHECK([ovs-vsctl set Flow_Table evict flow-limit=4])
1423 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1424 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=drop
1425 idle_timeout=70, in_port=2,dl_src=00:88:99:aa:bb:cc actions=drop
1426 idle_timeout=80, in_port=2,dl_src=00:99:aa:bb:cc:dd actions=drop
1427 in_port=2,dl_src=00:55:66:77:88:99 actions=drop
1433 AT_SETUP([ofproto - eviction upon table overflow, with fairness (OpenFlow 1.2)])
1435 # Configure a maximum of 4 flows.
1438 -- --id=@t0 create Flow_Table name=evict flow-limit=4 \
1439 overflow-policy=evict \
1440 groups='"NXM_OF_IN_PORT[[]]"' \
1441 -- set bridge br0 flow_tables:0=@t0 \
1442 | ${PERL} $srcdir/uuidfilt.pl],
1446 ovs-ofctl -O OpenFlow12 add-flows br0 - <<EOF
1447 idle_timeout=10 in_port=2 dl_src=00:44:55:66:77:88 actions=drop
1448 idle_timeout=20 in_port=1 dl_src=00:11:22:33:44:55 actions=drop
1449 idle_timeout=30 in_port=1 dl_src=00:22:33:44:55:66 actions=drop
1450 idle_timeout=40 in_port=1 dl_src=00:33:44:55:66:77 actions=drop
1452 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1453 idle_timeout=10, in_port=2,dl_src=00:44:55:66:77:88 actions=drop
1454 idle_timeout=20, in_port=1,dl_src=00:11:22:33:44:55 actions=drop
1455 idle_timeout=30, in_port=1,dl_src=00:22:33:44:55:66 actions=drop
1456 idle_timeout=40, in_port=1,dl_src=00:33:44:55:66:77 actions=drop
1457 OFPST_FLOW reply (OF1.2):
1459 # Adding another flow will cause the one that expires soonest within
1460 # the largest group (those with in_port=1) to be evicted. In this
1461 # case this is not the same as the one that expires soonest overall
1462 # (which is what makes the test interesting):
1463 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 in_port=2,dl_src=00:55:66:77:88:99,actions=drop])
1464 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1465 idle_timeout=10, in_port=2,dl_src=00:44:55:66:77:88 actions=drop
1466 idle_timeout=30, in_port=1,dl_src=00:22:33:44:55:66 actions=drop
1467 idle_timeout=40, in_port=1,dl_src=00:33:44:55:66:77 actions=drop
1468 in_port=2,dl_src=00:55:66:77:88:99 actions=drop
1469 OFPST_FLOW reply (OF1.2):
1471 # Enlarge the flow limit, change the eviction policy back to strictly
1472 # based on expiration, and and add some flows.
1473 AT_CHECK([ovs-vsctl set Flow_Table evict groups='[[]]' flow-limit=7])
1474 ovs-ofctl -O OpenFlow12 add-flows br0 - <<EOF
1475 idle_timeout=50 in_port=2 dl_src=00:66:77:88:99:aa actions=drop
1476 idle_timeout=60 in_port=2 dl_src=00:77:88:99:aa:bb actions=drop
1477 idle_timeout=70 in_port=2 dl_src=00:88:99:aa:bb:cc actions=drop
1479 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1480 idle_timeout=10, in_port=2,dl_src=00:44:55:66:77:88 actions=drop
1481 idle_timeout=30, in_port=1,dl_src=00:22:33:44:55:66 actions=drop
1482 idle_timeout=40, in_port=1,dl_src=00:33:44:55:66:77 actions=drop
1483 idle_timeout=50, in_port=2,dl_src=00:66:77:88:99:aa actions=drop
1484 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=drop
1485 idle_timeout=70, in_port=2,dl_src=00:88:99:aa:bb:cc actions=drop
1486 in_port=2,dl_src=00:55:66:77:88:99 actions=drop
1487 OFPST_FLOW reply (OF1.2):
1489 # Adding another flow will cause the one that expires soonest overall
1491 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'])
1492 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1493 idle_timeout=30, in_port=1,dl_src=00:22:33:44:55:66 actions=drop
1494 idle_timeout=40, in_port=1,dl_src=00:33:44:55:66:77 actions=drop
1495 idle_timeout=50, in_port=2,dl_src=00:66:77:88:99:aa actions=drop
1496 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=drop
1497 idle_timeout=70, in_port=2,dl_src=00:88:99:aa:bb:cc actions=drop
1498 idle_timeout=80, in_port=2,dl_src=00:99:aa:bb:cc:dd actions=drop
1499 in_port=2,dl_src=00:55:66:77:88:99 actions=drop
1500 OFPST_FLOW reply (OF1.2):
1502 # Reducing the flow limit also causes the flows that expire soonest
1503 # overall to be evicted.
1504 AT_CHECK([ovs-vsctl set Flow_Table evict flow-limit=4])
1505 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1506 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=drop
1507 idle_timeout=70, in_port=2,dl_src=00:88:99:aa:bb:cc actions=drop
1508 idle_timeout=80, in_port=2,dl_src=00:99:aa:bb:cc:dd actions=drop
1509 in_port=2,dl_src=00:55:66:77:88:99 actions=drop
1510 OFPST_FLOW reply (OF1.2):
1515 AT_SETUP([ofproto - eviction upon table overflow, with modified hard timeout])
1517 # Configure a maximum of 4 flows.
1520 -- --id=@t0 create Flow_Table flow-limit=4 overflow-policy=evict \
1521 -- set bridge br0 flow_tables:0=@t0 \
1522 | ${PERL} $srcdir/uuidfilt.pl],
1525 ovs-appctl time/stop
1527 for in_port in 4 3 2 1; do
1528 ovs-ofctl add-flow br0 hard_timeout=$((10 + in_port * 3)),in_port=$in_port,actions=drop
1530 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1531 hard_timeout=13, in_port=1 actions=drop
1532 hard_timeout=16, in_port=2 actions=drop
1533 hard_timeout=19, in_port=3 actions=drop
1534 hard_timeout=22, in_port=4 actions=drop
1537 # Sleep and modify the one that expires soonest
1538 ovs-appctl time/warp 5000
1539 AT_CHECK([ovs-ofctl mod-flows br0 in_port=1,actions=drop])
1540 # At this point the table would looks like:
1541 # in_port seconds to expire
1546 ovs-appctl time/warp 2000
1547 # Adding another flow will cause the one that expires soonest to be evicted.
1548 AT_CHECK([ovs-ofctl add-flow br0 in_port=5,actions=drop])
1549 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1550 hard_timeout=13, in_port=1 actions=drop
1551 hard_timeout=19, in_port=3 actions=drop
1552 hard_timeout=22, in_port=4 actions=drop
1553 in_port=5 actions=drop
1559 AT_SETUP([ofproto - eviction upon table overflow, with modified idle timeout])
1560 OVS_VSWITCHD_START([add-port br0 p1 -- set interface p1 type=dummy ofport_request=1])
1561 # Configure a maximum of 4 flows.
1564 -- --id=@t0 create Flow_Table flow-limit=4 overflow-policy=evict \
1565 -- set bridge br0 flow_tables:0=@t0 \
1566 | ${PERL} $srcdir/uuidfilt.pl],
1570 for in_port in 4 3 2 1; do
1571 ovs-ofctl add-flow br0 idle_timeout=$((10 + in_port * 3)),in_port=$in_port,actions=drop
1573 ovs-appctl time/stop
1574 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1575 idle_timeout=13, in_port=1 actions=drop
1576 idle_timeout=16, in_port=2 actions=drop
1577 idle_timeout=19, in_port=3 actions=drop
1578 idle_timeout=22, in_port=4 actions=drop
1581 # Sleep and receive on the flow that expires soonest
1582 ovs-appctl time/warp 5000
1583 AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1)'])
1584 # At this point the table would looks like:
1585 # in_port seconds to expire
1590 ovs-appctl time/warp 2000
1591 # Adding another flow will cause the one that expires soonest to be evicted.
1592 AT_CHECK([ovs-ofctl add-flow br0 in_port=5,actions=drop])
1593 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1594 idle_timeout=19, in_port=3 actions=drop
1595 idle_timeout=22, in_port=4 actions=drop
1596 in_port=5 actions=drop
1597 n_packets=1, n_bytes=60, idle_timeout=13, in_port=1 actions=drop
1603 AT_SETUP([ofproto - asynchronous message control (OpenFlow 1.0)])
1605 AT_CHECK([ovs-ofctl -P openflow10 monitor br0 --detach --no-chdir --pidfile])
1607 printf '\n\n--- check_async %d ---\n\n\n' $1
1610 ovs-appctl -t ovs-ofctl ofctl/barrier
1611 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
1614 # OFPT_PACKET_IN, OFPR_ACTION (controller_id=0)
1615 ovs-ofctl -v packet-out br0 controller controller '0001020304050010203040501234'
1616 if test X"$1" = X"OFPR_ACTION"; then shift;
1617 echo >>expout "OFPT_PACKET_IN: total_len=14 in_port=CONTROLLER (via action) data_len=14 (unbuffered)
1618 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"
1621 # OFPT_PACKET_IN, OFPR_NO_MATCH (controller_id=123)
1622 ovs-ofctl -v packet-out br0 controller 'controller(reason=no_match,id=123)' '0001020304050010203040501234'
1623 if test X"$1" = X"OFPR_NO_MATCH"; then shift;
1624 echo >>expout "OFPT_PACKET_IN: total_len=14 in_port=CONTROLLER (via no_match) data_len=14 (unbuffered)
1625 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"
1628 # OFPT_PACKET_IN, OFPR_INVALID_TTL (controller_id=0)
1629 ovs-ofctl packet-out br0 controller dec_ttl '002583dfb4000026b98cb0f908004500003fb7e200000011339bac11370dac100002d7730035002b8f6d86fb0100000100000000000006626c702d7873066e696369726103636f6d00000f00'
1630 if test X"$1" = X"OFPR_INVALID_TTL"; then shift;
1631 echo >>expout "OFPT_PACKET_IN: total_len=76 in_port=CONTROLLER (via invalid_ttl) data_len=76 (unbuffered)
1632 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"
1635 # OFPT_PORT_STATUS, OFPPR_ADD
1636 ovs-vsctl add-port br0 test -- set Interface test type=dummy ofport_request=1
1637 if test X"$1" = X"OFPPR_ADD"; then shift;
1638 echo >>expout "OFPT_PORT_STATUS: ADD: 1(test): addr:aa:55:aa:55:00:0x
1641 speed: 0 Mbps now, 0 Mbps max"
1644 # OFPT_PORT_STATUS, OFPPR_DELETE
1645 ovs-vsctl del-port br0 test
1646 if test X"$1" = X"OFPPR_DELETE"; then shift;
1647 echo >>expout "OFPT_PORT_STATUS: DEL: 1(test): addr:aa:55:aa:55:00:0x
1650 speed: 0 Mbps now, 0 Mbps max"
1653 # OFPT_FLOW_REMOVED, OFPRR_DELETE
1654 ovs-ofctl add-flow br0 send_flow_rem,actions=drop
1655 ovs-ofctl --strict del-flows br0 ''
1656 if test X"$1" = X"OFPRR_DELETE"; then shift;
1657 echo >>expout "OFPT_FLOW_REMOVED: reason=delete"
1659 AT_FAIL_IF([test X"$1" != X])
1661 ovs-appctl -t ovs-ofctl ofctl/barrier
1662 echo >>expout "OFPT_BARRIER_REPLY:"
1666 s/ (xid=0x[0-9a-fA-F]*)//
1668 s/00:0.$/00:0x/' < monitor.log]],
1672 # It's a service connection so initially there should be no async messages.
1675 # Set miss_send_len to 128, turning on packet-ins for our service connection.
1676 ovs-appctl -t ovs-ofctl ofctl/send 0109000c0123456700000080
1677 check_async 2 OFPR_ACTION OFPPR_ADD OFPPR_DELETE OFPRR_DELETE
1679 # Set miss_send_len to 128 and enable invalid_ttl.
1680 ovs-appctl -t ovs-ofctl ofctl/send 0109000c0123456700040080
1681 check_async 3 OFPR_ACTION OFPR_INVALID_TTL OFPPR_ADD OFPPR_DELETE OFPRR_DELETE
1683 # Become slave, which should disable everything except port status.
1684 ovs-appctl -t ovs-ofctl ofctl/send 0104001400000002000023200000000a00000002
1685 check_async 4 OFPPR_ADD OFPPR_DELETE
1687 # Use NXT_SET_ASYNC_CONFIG to enable a patchwork of asynchronous messages.
1688 ovs-appctl -t ovs-ofctl ofctl/send 01040028000000020000232000000013000000020000000500000005000000020000000200000005
1689 check_async 5 OFPR_INVALID_TTL OFPPR_DELETE OFPRR_DELETE
1691 # Set controller ID 123.
1692 ovs-appctl -t ovs-ofctl ofctl/send 01040018000000030000232000000014000000000000007b
1693 check_async 6 OFPR_NO_MATCH OFPPR_DELETE OFPRR_DELETE
1695 # Restore controller ID 0.
1696 ovs-appctl -t ovs-ofctl ofctl/send 010400180000000300002320000000140000000000000000
1699 ovs-appctl -t ovs-ofctl ofctl/send 0104001400000002000023200000000a00000001
1700 check_async 7 OFPR_ACTION OFPPR_ADD
1702 ovs-appctl -t ovs-ofctl exit
1706 AT_SETUP([ofproto - asynchronous message control (OpenFlow 1.2)])
1708 AT_CHECK([ovs-ofctl -O OpenFlow12 monitor br0 --detach --no-chdir --pidfile])
1710 printf '\n\n--- check_async %d ---\n\n\n' $1
1714 ovs-appctl -t ovs-ofctl ofctl/barrier
1715 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
1718 # OFPT_PACKET_IN, OFPR_ACTION (controller_id=0)
1719 ovs-ofctl -O OpenFlow12 -v packet-out br0 none controller '0001020304050010203040501234'
1720 if test X"$1" = X"OFPR_ACTION"; then shift;
1721 echo >>expout "OFPT_PACKET_IN (OF1.2): total_len=14 in_port=ANY (via action) data_len=14 (unbuffered)
1722 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"
1725 # OFPT_PACKET_IN, OFPR_NO_MATCH (controller_id=123)
1726 ovs-ofctl -O OpenFlow12 -v packet-out br0 none 'controller(reason=no_match,id=123)' '0001020304050010203040501234'
1727 if test X"$1" = X"OFPR_NO_MATCH"; then shift;
1728 echo >>expout "OFPT_PACKET_IN (OF1.2): total_len=14 in_port=ANY (via no_match) data_len=14 (unbuffered)
1729 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"
1732 # OFPT_PACKET_IN, OFPR_INVALID_TTL (controller_id=0)
1733 ovs-ofctl -O OpenFlow12 packet-out br0 none dec_ttl '002583dfb4000026b98cb0f908004500003fb7e200000011339bac11370dac100002d7730035002b8f6d86fb0100000100000000000006626c702d7873066e696369726103636f6d00000f00'
1734 if test X"$1" = X"OFPR_INVALID_TTL"; then shift;
1735 echo >>expout "OFPT_PACKET_IN (OF1.2): total_len=76 in_port=ANY (via invalid_ttl) data_len=76 (unbuffered)
1736 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"
1739 # OFPT_PORT_STATUS, OFPPR_ADD
1740 ovs-vsctl add-port br0 test -- set Interface test type=dummy
1741 if test X"$1" = X"OFPPR_ADD"; then shift;
1742 echo >>expout "OFPT_PORT_STATUS (OF1.2): ADD: ${INDEX}(test): addr:aa:55:aa:55:00:0x
1745 speed: 0 Mbps now, 0 Mbps max"
1748 # OFPT_PORT_STATUS, OFPPR_DELETE
1749 ovs-vsctl del-port br0 test
1750 if test X"$1" = X"OFPPR_DELETE"; then shift;
1751 echo >>expout "OFPT_PORT_STATUS (OF1.2): DEL: ${INDEX}(test): addr:aa:55:aa:55:00:0x
1754 speed: 0 Mbps now, 0 Mbps max"
1757 # OFPT_FLOW_REMOVED, OFPRR_DELETE
1758 ovs-ofctl -O OpenFlow12 add-flow br0 send_flow_rem,actions=drop
1759 ovs-ofctl -O OpenFlow12 --strict del-flows br0 ''
1760 if test X"$1" = X"OFPRR_DELETE"; then shift;
1761 echo >>expout "OFPT_FLOW_REMOVED (OF1.2): reason=delete table_id=0"
1763 AT_FAIL_IF([test X"$1" != X])
1765 ovs-appctl -t ovs-ofctl ofctl/barrier
1766 echo >>expout "OFPT_BARRIER_REPLY (OF1.2):"
1770 s/ (xid=0x[0-9a-fA-F]*)//
1772 s/00:0.$/00:0x/' < monitor.log]],
1776 # It's a service connection so initially there should be no async messages.
1779 # Set miss_send_len to 128, turning on packet-ins for our service connection.
1780 ovs-appctl -t ovs-ofctl ofctl/send 0309000c0123456700000080
1781 check_async 2 OFPR_ACTION OFPPR_ADD OFPPR_DELETE OFPRR_DELETE
1783 # Set miss_send_len to 128 and enable invalid_ttl.
1784 ovs-appctl -t ovs-ofctl ofctl/send 0309000c0123456700040080
1785 check_async 3 OFPR_ACTION OFPR_INVALID_TTL OFPPR_ADD OFPPR_DELETE OFPRR_DELETE
1787 # Become slave (OF 1.2), which should disable everything except port status.
1788 ovs-appctl -t ovs-ofctl ofctl/send 031800180000000200000003000000000000000000000001
1789 check_async 4 OFPPR_ADD OFPPR_DELETE
1791 # Use NXT_SET_ASYNC_CONFIG to enable a patchwork of asynchronous messages.
1792 ovs-appctl -t ovs-ofctl ofctl/send 03040028000000020000232000000013000000020000000500000005000000020000000200000005
1793 check_async 5 OFPR_INVALID_TTL OFPPR_DELETE OFPRR_DELETE
1795 # Set controller ID 123.
1796 ovs-appctl -t ovs-ofctl ofctl/send 03040018000000030000232000000014000000000000007b
1797 check_async 6 OFPR_NO_MATCH OFPPR_DELETE OFPRR_DELETE
1799 # Restore controller ID 0.
1800 ovs-appctl -t ovs-ofctl ofctl/send 030400180000000300002320000000140000000000000000
1802 # Become master (OF 1.2).
1803 ovs-appctl -t ovs-ofctl ofctl/send 031800180000000400000002000000000000000000000002
1804 check_async 7 OFPR_ACTION OFPPR_ADD
1806 ovs-appctl -t ovs-ofctl exit
1810 AT_SETUP([ofproto - asynchronous message control (OpenFlow 1.3)])
1812 AT_CHECK([ovs-ofctl -O OpenFlow13 monitor br0 --detach --no-chdir --pidfile])
1814 printf '\n\n--- check_async %d ---\n\n\n' $1
1818 ovs-appctl -t ovs-ofctl ofctl/barrier
1819 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
1822 # OFPT_PACKET_IN, OFPR_ACTION (controller_id=0)
1823 ovs-ofctl -O OpenFlow13 -v packet-out br0 none controller '0001020304050010203040501234'
1824 if test X"$1" = X"OFPR_ACTION"; then shift;
1825 echo >>expout "OFPT_PACKET_IN (OF1.3): total_len=14 in_port=ANY (via action) data_len=14 (unbuffered)
1826 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"
1829 # OFPT_PACKET_IN, OFPR_NO_MATCH (controller_id=123)
1830 ovs-ofctl -O OpenFlow13 -v packet-out br0 none 'controller(reason=no_match,id=123)' '0001020304050010203040501234'
1831 if test X"$1" = X"OFPR_NO_MATCH"; then shift;
1832 echo >>expout "OFPT_PACKET_IN (OF1.3): total_len=14 in_port=ANY (via no_match) data_len=14 (unbuffered)
1833 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"
1836 # OFPT_PACKET_IN, OFPR_INVALID_TTL (controller_id=0)
1837 ovs-ofctl -O OpenFlow13 packet-out br0 none dec_ttl '002583dfb4000026b98cb0f908004500003fb7e200000011339bac11370dac100002d7730035002b8f6d86fb0100000100000000000006626c702d7873066e696369726103636f6d00000f00'
1838 if test X"$1" = X"OFPR_INVALID_TTL"; then shift;
1839 echo >>expout "OFPT_PACKET_IN (OF1.3): total_len=76 in_port=ANY (via invalid_ttl) data_len=76 (unbuffered)
1840 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"
1843 # OFPT_PORT_STATUS, OFPPR_ADD
1844 ovs-vsctl add-port br0 test -- set Interface test type=dummy
1845 if test X"$1" = X"OFPPR_ADD"; then shift;
1846 echo >>expout "OFPT_PORT_STATUS (OF1.3): ADD: ${INDEX}(test): addr:aa:55:aa:55:00:0x
1849 speed: 0 Mbps now, 0 Mbps max"
1852 # OFPT_PORT_STATUS, OFPPR_DELETE
1853 ovs-vsctl del-port br0 test
1854 if test X"$1" = X"OFPPR_DELETE"; then shift;
1855 echo >>expout "OFPT_PORT_STATUS (OF1.3): DEL: ${INDEX}(test): addr:aa:55:aa:55:00:0x
1858 speed: 0 Mbps now, 0 Mbps max"
1861 # OFPT_FLOW_REMOVED, OFPRR_DELETE
1862 ovs-ofctl -O OpenFlow13 add-flow br0 send_flow_rem,actions=drop
1863 ovs-ofctl -O OpenFlow13 --strict del-flows br0 ''
1864 if test X"$1" = X"OFPRR_DELETE"; then shift;
1865 echo >>expout "OFPT_FLOW_REMOVED (OF1.3): reason=delete table_id=0"
1868 # OFPT_FLOW_REMOVED, OFPRR_GROUP_DELETE
1869 ovs-ofctl -O OpenFlow13 add-group br0 group_id=1234,type=all,bucket=output:10
1870 ovs-ofctl -O OpenFlow13 add-flow br0 send_flow_rem,actions=group:1234
1871 ovs-ofctl -O OpenFlow13 --strict del-groups br0 group_id=1234
1872 if test X"$1" = X"OFPRR_DELETE"; then shift;
1873 echo >>expout "OFPT_FLOW_REMOVED (OF1.3): reason=gropu_delete table_id=0"
1876 AT_FAIL_IF([test X"$1" != X])
1878 ovs-appctl -t ovs-ofctl ofctl/barrier
1879 echo >>expout "OFPT_BARRIER_REPLY (OF1.3):"
1883 s/ (xid=0x[0-9a-fA-F]*)//
1885 s/00:0.$/00:0x/' < monitor.log]],
1889 # It's a service connection so initially there should be no async messages.
1892 # Set miss_send_len to 128, turning on packet-ins for our service connection.
1893 ovs-appctl -t ovs-ofctl ofctl/send 0409000c0123456700000080
1894 check_async 2 OFPR_ACTION OFPPR_ADD OFPPR_DELETE OFPRR_DELETE
1896 # Become slave (OF 1.3), which should disable everything except port status.
1897 ovs-appctl -t ovs-ofctl ofctl/send 041800180000000200000003000000000000000000000001
1898 check_async 3 OFPPR_ADD OFPPR_DELETE
1900 # Use OF 1.3 OFPT_SET_ASYNC to enable a patchwork of asynchronous messages.
1901 ovs-appctl -t ovs-ofctl ofctl/send 041c002000000002000000020000000500000005000000020000000200000005
1902 check_async 4 OFPR_INVALID_TTL OFPPR_DELETE OFPRR_DELETE
1904 # Set controller ID 123.
1905 ovs-appctl -t ovs-ofctl ofctl/send 04040018000000030000232000000014000000000000007b
1906 check_async 5 OFPR_NO_MATCH OFPPR_DELETE OFPRR_DELETE
1908 # Restore controller ID 0.
1909 ovs-appctl -t ovs-ofctl ofctl/send 040400180000000300002320000000140000000000000000
1911 # Become master (OF 1.3).
1912 ovs-appctl -t ovs-ofctl ofctl/send 041800180000000400000002000000000000000000000002
1913 check_async 6 OFPR_ACTION OFPPR_ADD
1915 ovs-appctl -t ovs-ofctl exit
1919 dnl This test checks that the role request/response messaging works
1920 dnl and that generation_id is handled properly.
1921 AT_SETUP([ofproto - controller role (OpenFlow 1.2)])
1923 ON_EXIT([kill `cat c1.pid c2.pid`])
1925 # Start two ovs-ofctl controller processes.
1926 AT_CAPTURE_FILE([monitor1.log])
1927 AT_CAPTURE_FILE([expout1])
1928 AT_CAPTURE_FILE([experr1])
1929 AT_CAPTURE_FILE([monitor2.log])
1930 AT_CAPTURE_FILE([expout2])
1931 AT_CAPTURE_FILE([experr2])
1933 AT_CHECK([ovs-ofctl -O OpenFlow12 monitor br0 --detach --no-chdir --pidfile=`pwd`/c$i.pid --unixctl=`pwd`/c$i])
1934 ovs-appctl -t `pwd`/c$i ofctl/barrier
1935 ovs-appctl -t `pwd`/c$i ofctl/set-output-file monitor$i.log
1939 # find out current role
1940 ovs-appctl -t `pwd`/c$i ofctl/send 031800180000000200000000000000000000000000000000
1941 echo >>experr$i "send: OFPT_ROLE_REQUEST (OF1.2): role=nochange"
1942 echo >>expout$i "OFPT_ROLE_REPLY (OF1.2): role=equal"
1945 # controller 1: Become slave (generation_id is initially undefined, so
1946 # 2^63+2 should not be stale)
1947 ovs-appctl -t `pwd`/c1 ofctl/send 031800180000000300000003000000008000000000000002
1948 echo >>experr1 "send: OFPT_ROLE_REQUEST (OF1.2): role=slave generation_id=9223372036854775810"
1949 echo >>expout1 "OFPT_ROLE_REPLY (OF1.2): role=slave generation_id=9223372036854775810"
1951 # controller 2: Become master.
1952 ovs-appctl -t `pwd`/c2 ofctl/send 031800180000000300000002000000008000000000000003
1953 echo >>experr2 "send: OFPT_ROLE_REQUEST (OF1.2): role=master generation_id=9223372036854775811"
1954 echo >>expout2 "OFPT_ROLE_REPLY (OF1.2): role=master generation_id=9223372036854775811"
1956 # controller 1: Try to become the master using a stale generation ID
1957 ovs-appctl -t `pwd`/c1 ofctl/send 031800180000000400000002000000000000000000000003
1958 echo >>experr1 "send: OFPT_ROLE_REQUEST (OF1.2): role=master generation_id=3"
1959 echo >>expout1 "OFPT_ERROR (OF1.2): OFPRRFC_STALE"
1960 echo >>expout1 "OFPT_ROLE_REQUEST (OF1.2): role=master generation_id=3"
1962 # controller 1: Become master using a valid generation ID
1963 ovs-appctl -t `pwd`/c1 ofctl/send 031800180000000500000002000000000000000000000001
1964 echo >>experr1 "send: OFPT_ROLE_REQUEST (OF1.2): role=master generation_id=1"
1965 echo >>expout1 "OFPT_ROLE_REPLY (OF1.2): role=master generation_id=1"
1968 ovs-appctl -t `pwd`/c$i ofctl/barrier
1969 echo >>expout$i "OFPT_BARRIER_REPLY (OF1.2):"
1975 AT_CHECK([grep -v '^send:' monitor$i.log | STRIP_XIDS], [0], [expout])
1977 AT_CHECK([grep '^send:' monitor$i.log | STRIP_XIDS], [0], [expout])
1982 dnl This test checks that the role request/response messaging works,
1983 dnl that generation_id is handled properly, and that role status update
1984 dnl messages are sent when a controller's role gets changed from master
1986 AT_SETUP([ofproto - controller role (OpenFlow 1.4)])
1988 ON_EXIT([kill `cat c1.pid c2.pid`])
1990 # Start two ovs-ofctl controller processes.
1991 AT_CAPTURE_FILE([monitor1.log])
1992 AT_CAPTURE_FILE([expout1])
1993 AT_CAPTURE_FILE([experr1])
1994 AT_CAPTURE_FILE([monitor2.log])
1995 AT_CAPTURE_FILE([expout2])
1996 AT_CAPTURE_FILE([experr2])
1998 AT_CHECK([ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile=`pwd`/c$i.pid --unixctl=`pwd`/c$i])
1999 ovs-appctl -t `pwd`/c$i ofctl/barrier
2000 ovs-appctl -t `pwd`/c$i ofctl/set-output-file monitor$i.log
2004 # find out current role
2005 ovs-appctl -t `pwd`/c$i ofctl/send 051800180000000200000000000000000000000000000000
2006 echo >>experr$i "send: OFPT_ROLE_REQUEST (OF1.4): role=nochange"
2007 echo >>expout$i "OFPT_ROLE_REPLY (OF1.4): role=equal"
2010 # controller 1: Become slave (generation_id is initially undefined, so
2011 # 2^63+2 should not be stale)
2012 ovs-appctl -t `pwd`/c1 ofctl/send 051800180000000300000003000000008000000000000002
2013 echo >>experr1 "send: OFPT_ROLE_REQUEST (OF1.4): role=slave generation_id=9223372036854775810"
2014 echo >>expout1 "OFPT_ROLE_REPLY (OF1.4): role=slave generation_id=9223372036854775810"
2016 # controller 2: Become master.
2017 ovs-appctl -t `pwd`/c2 ofctl/send 051800180000000300000002000000008000000000000003
2018 echo >>experr2 "send: OFPT_ROLE_REQUEST (OF1.4): role=master generation_id=9223372036854775811"
2019 echo >>expout2 "OFPT_ROLE_REPLY (OF1.4): role=master generation_id=9223372036854775811"
2021 # controller 1: Try to become the master using a stale generation ID
2022 ovs-appctl -t `pwd`/c1 ofctl/send 051800180000000400000002000000000000000000000003
2023 echo >>experr1 "send: OFPT_ROLE_REQUEST (OF1.4): role=master generation_id=3"
2024 echo >>expout1 "OFPT_ERROR (OF1.4): OFPRRFC_STALE"
2025 echo >>expout1 "OFPT_ROLE_REQUEST (OF1.4): role=master generation_id=3"
2027 # controller 1: Become master using a valid generation ID
2028 ovs-appctl -t `pwd`/c1 ofctl/send 051800180000000500000002000000000000000000000001
2029 echo >>experr1 "send: OFPT_ROLE_REQUEST (OF1.4): role=master generation_id=1"
2030 echo >>expout1 "OFPT_ROLE_REPLY (OF1.4): role=master generation_id=1"
2031 echo >>expout2 "OFPT_ROLE_STATUS (OF1.4): role=slave generation_id=1 reason=master_request"
2034 ovs-appctl -t `pwd`/c$i ofctl/barrier
2035 echo >>expout$i "OFPT_BARRIER_REPLY (OF1.4):"
2041 AT_CHECK([grep -v '^send:' monitor$i.log | STRIP_XIDS], [0], [expout])
2043 AT_CHECK([grep '^send:' monitor$i.log | STRIP_XIDS], [0], [expout])
2048 dnl This test checks that OFPT_PACKET_OUT accepts both OFPP_NONE (as
2049 dnl specified by OpenFlow 1.0) and OFPP_CONTROLLER (used by some
2050 dnl controllers despite the spec) as meaning a packet that was generated
2051 dnl by the controller.
2052 AT_SETUP([ofproto - packet-out from controller (OpenFlow 1.0)])
2054 ADD_OF_PORTS([br0], [1])
2056 # Start a monitor listening for packet-ins.
2057 AT_CHECK([ovs-ofctl -P openflow10 monitor br0 --detach --no-chdir --pidfile])
2058 ovs-appctl -t ovs-ofctl ofctl/send 0109000c0123456700000080
2059 ovs-appctl -t ovs-ofctl ofctl/barrier
2060 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
2061 AT_CAPTURE_FILE([monitor.log])
2063 # Send some packet-outs with OFPP_NONE and OFPP_CONTROLLER (65533) as in_port.
2064 AT_CHECK([ovs-ofctl packet-out br0 none controller,1 '0001020304050010203040501234'])
2065 AT_CHECK([ovs-ofctl packet-out br0 controller controller,1 '0001020304050010203040505678'])
2067 # Stop the monitor and check its output.
2068 ovs-appctl -t ovs-ofctl ofctl/barrier
2069 ovs-appctl -t ovs-ofctl exit
2071 ovs-ofctl dump-ports br0
2073 AT_CHECK([sed 's/ (xid=0x[[0-9a-fA-F]]*)//' monitor.log], [0], [dnl
2074 OFPT_PACKET_IN: total_len=14 in_port=ANY (via action) data_len=14 (unbuffered)
2075 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
2076 OFPT_PACKET_IN: total_len=14 in_port=CONTROLLER (via action) data_len=14 (unbuffered)
2077 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
2084 dnl This test checks that OFPT_PACKET_OUT accepts both OFPP_NONE (as
2085 dnl specified by OpenFlow 1.2) and OFPP_CONTROLLER (used by some
2086 dnl controllers despite the spec) as meaning a packet that was generated
2087 dnl by the controller.
2088 AT_SETUP([ofproto - packet-out from controller (OpenFlow 1.2)])
2091 # Start a monitor listening for packet-ins.
2092 AT_CHECK([ovs-ofctl -O OpenFlow12 monitor br0 --detach --no-chdir --pidfile])
2093 ovs-appctl -t ovs-ofctl ofctl/send 0309000c0123456700000080
2094 ovs-appctl -t ovs-ofctl ofctl/barrier
2095 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
2096 AT_CAPTURE_FILE([monitor.log])
2098 # Send some packet-outs with OFPP_NONE and OFPP_CONTROLLER (65533) as in_port.
2099 AT_CHECK([ovs-ofctl -O OpenFlow12 packet-out br0 none controller '0001020304050010203040501234'])
2100 AT_CHECK([ovs-ofctl -O OpenFlow12 packet-out br0 4294967293 controller '0001020304050010203040505678'])
2102 # Stop the monitor and check its output.
2103 ovs-appctl -t ovs-ofctl ofctl/barrier
2104 ovs-appctl -t ovs-ofctl exit
2106 AT_CHECK([sed 's/ (xid=0x[[0-9a-fA-F]]*)//' monitor.log], [0], [dnl
2107 OFPT_PACKET_IN (OF1.2): total_len=14 in_port=ANY (via action) data_len=14 (unbuffered)
2108 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
2109 OFPT_PACKET_IN (OF1.2): total_len=14 in_port=CONTROLLER (via action) data_len=14 (unbuffered)
2110 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
2111 OFPT_BARRIER_REPLY (OF1.2):
2117 dnl This test checks that OFPT_PACKET_OUT accepts both OFPP_NONE (as
2118 dnl specified by OpenFlow 1.1) and OFPP_CONTROLLER (used by some
2119 dnl controllers despite the spec) as meaning a packet that was generated
2120 dnl by the controller.
2121 AT_SETUP([ofproto - packet-out from controller (OpenFlow 1.1)])
2124 # Start a monitor listening for packet-ins.
2125 AT_CHECK([ovs-ofctl -O OpenFlow11 monitor br0 --detach --no-chdir --pidfile])
2126 ovs-appctl -t ovs-ofctl ofctl/send 0209000c0123456700000080
2127 ovs-appctl -t ovs-ofctl ofctl/barrier
2128 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
2129 AT_CAPTURE_FILE([monitor.log])
2131 # Send some packet-outs with OFPP_NONE and OFPP_CONTROLLER (65533) as in_port.
2132 AT_CHECK([ovs-ofctl -O OpenFlow11 packet-out br0 none controller '0001020304050010203040501234'])
2133 AT_CHECK([ovs-ofctl -O OpenFlow11 packet-out br0 4294967293 controller '0001020304050010203040505678'])
2135 # Stop the monitor and check its output.
2136 ovs-appctl -t ovs-ofctl ofctl/barrier
2137 ovs-appctl -t ovs-ofctl exit
2139 AT_CHECK([sed 's/ (xid=0x[[0-9a-fA-F]]*)//' monitor.log], [0], [dnl
2140 OFPT_PACKET_IN (OF1.1): total_len=14 in_port=ANY (via action) data_len=14 (unbuffered)
2141 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
2142 OFPT_PACKET_IN (OF1.1): total_len=14 in_port=CONTROLLER (via action) data_len=14 (unbuffered)
2143 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
2144 OFPT_BARRIER_REPLY (OF1.1):
2150 dnl This test checks that metadata is encoded in packet_in structures,
2151 dnl supported by NXAST.
2152 AT_SETUP([ofproto - packet-out with metadata (NXM)])
2155 # Start a monitor listening for packet-ins.
2156 AT_CHECK([ovs-ofctl -P nxm monitor br0 --detach --no-chdir --pidfile])
2157 ovs-appctl -t ovs-ofctl ofctl/send 0109000c0123456700000080
2158 ovs-appctl -t ovs-ofctl ofctl/barrier
2159 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
2160 AT_CAPTURE_FILE([monitor.log])
2162 # Send a packet-out with a load action to set some metadata, and forward to controller
2163 AT_CHECK([ovs-ofctl packet-out br0 controller 'load(0xfafafafa5a5a5a5a->OXM_OF_METADATA[[0..63]]), load(0xaa->NXM_NX_PKT_MARK[[]]), controller' '0001020304050010203040501234'])
2165 # Stop the monitor and check its output.
2166 ovs-appctl -t ovs-ofctl ofctl/barrier
2167 ovs-appctl -t ovs-ofctl exit
2169 AT_CHECK([sed 's/ (xid=0x[[0-9a-fA-F]]*)//' monitor.log], [0], [dnl
2170 NXT_PACKET_IN: total_len=14 in_port=CONTROLLER metadata=0xfafafafa5a5a5a5a pkt_mark=0xaa (via action) data_len=14 (unbuffered)
2171 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
2178 dnl This test checks that metadata is encoded in packet_in structures,
2179 dnl supported by NXAST.
2180 AT_SETUP([ofproto - packet-out with metadata (OpenFlow 1.2)])
2183 # Start a monitor listening for packet-ins.
2184 AT_CHECK([ovs-ofctl -O OpenFlow12 monitor br0 --detach --no-chdir --pidfile])
2185 ovs-appctl -t ovs-ofctl ofctl/send 0309000c0123456700000080
2186 ovs-appctl -t ovs-ofctl ofctl/barrier
2187 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
2188 AT_CAPTURE_FILE([monitor.log])
2190 # Send a packet-out with a set-field action to set some metadata, and forward to controller
2191 AT_CHECK([ovs-ofctl -O OpenFlow12 packet-out br0 none 'set_field:0xfafafafa5a5a5a5a->metadata, controller' '0001020304050010203040501234'])
2193 # Stop the monitor and check its output.
2194 ovs-appctl -t ovs-ofctl ofctl/barrier
2195 ovs-appctl -t ovs-ofctl exit
2197 AT_CHECK([sed 's/ (xid=0x[[0-9a-fA-F]]*)//' monitor.log], [0], [dnl
2198 OFPT_PACKET_IN (OF1.2): total_len=14 in_port=ANY metadata=0xfafafafa5a5a5a5a (via action) data_len=14 (unbuffered)
2199 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
2200 OFPT_BARRIER_REPLY (OF1.2):
2206 dnl This test checks that tunnel metadata is encoded in packet_in structures.
2207 AT_SETUP([ofproto - packet-out with tunnel metadata (OpenFlow 1.2)])
2210 # Start a monitor listening for packet-ins.
2211 AT_CHECK([ovs-ofctl -O OpenFlow12 monitor br0 --detach --no-chdir --pidfile])
2212 ovs-appctl -t ovs-ofctl ofctl/send 0309000c0123456700000080
2213 ovs-appctl -t ovs-ofctl ofctl/barrier
2214 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
2215 AT_CAPTURE_FILE([monitor.log])
2217 # Send a packet-out with set field actions to set some tunnel metadata, and forward to controller
2218 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'])
2220 # Stop the monitor and check its output.
2221 ovs-appctl -t ovs-ofctl ofctl/barrier
2222 ovs-appctl -t ovs-ofctl exit
2224 AT_CHECK([sed 's/ (xid=0x[[0-9a-fA-F]]*)//' monitor.log], [0], [dnl
2225 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)
2226 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
2227 OFPT_BARRIER_REPLY (OF1.2):
2233 m4_divert_push([PREPARE_TESTS])
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.
2245 print $_ foreach sort(@buffer);
2250 print $_ foreach sort(@buffer);
2253 m4_divert_pop([PREPARE_TESTS])
2255 AT_SETUP([ofproto - flow monitoring])
2256 AT_KEYWORDS([monitor])
2259 ovs-ofctl add-flow br0 in_port=0,dl_vlan=123,actions=output:1
2261 # Start a monitor watching the flow table and check the initial reply.
2262 ovs-ofctl monitor br0 watch: --detach --no-chdir --pidfile >monitor.log 2>&1
2263 AT_CAPTURE_FILE([monitor.log])
2264 ovs-appctl -t ovs-ofctl ofctl/barrier
2265 AT_CHECK([sed 's/ (xid=0x[[1-9a-fA-F]][[0-9a-fA-F]]*)//' monitor.log], [0],
2266 [NXST_FLOW_MONITOR reply:
2267 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=123 actions=output:1
2271 # Add, delete, and modify some flows and check the updates.
2272 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
2273 ovs-ofctl add-flow br0 in_port=0,dl_vlan=124,actions=output:2
2274 ovs-ofctl add-flow br0 in_port=0,dl_vlan=123,actions=output:5
2275 ovs-ofctl add-flow br0 in_port=0,dl_vlan=123,dl_vlan_pcp=0,actions=output:6
2276 ovs-ofctl add-flow br0 in_port=0,dl_vlan=123,dl_vlan_pcp=1,actions=output:7
2277 ovs-ofctl add-flow br0 in_port=0,dl_vlan=123,actions=output:8
2278 ovs-ofctl add-flow br0 in_port=0,dl_vlan=65535,dl_vlan_pcp=0,actions=output:9
2279 ovs-ofctl add-flow br0 in_port=0,dl_vlan=65535,dl_vlan_pcp=1,actions=output:10
2280 ovs-ofctl add-flow br0 in_port=0,dl_vlan=65535,actions=output:11
2281 ovs-ofctl add-flow br0 in_port=0,dl_vlan=8191,dl_vlan_pcp=0,actions=output:12
2282 ovs-ofctl add-flow br0 in_port=0,dl_vlan=8191,dl_vlan_pcp=1,actions=output:13
2283 ovs-ofctl add-flow br0 in_port=0,dl_vlan=8191,actions=output:14
2284 ovs-ofctl add-flow br0 in_port=0,dl_vlan=0,dl_vlan_pcp=0,actions=output:15
2285 ovs-ofctl add-flow br0 in_port=0,dl_vlan=0,dl_vlan_pcp=1,actions=output:16
2286 ovs-ofctl add-flow br0 in_port=0,dl_vlan=0,actions=output:17
2287 ovs-ofctl add-flow br0 in_port=0,dl_vlan=0,dl_vlan_pcp=0,actions=output:18
2288 ovs-ofctl add-flow br0 in_port=0,dl_vlan=0,dl_vlan_pcp=1,actions=output:19
2289 ovs-ofctl add-flow br0 in_port=0,dl_vlan=0,actions=output:20
2290 ovs-ofctl add-flow br0 in_port=0,dl_vlan_pcp=0,actions=output:21
2291 ovs-ofctl add-flow br0 in_port=0,dl_vlan_pcp=1,actions=output:22
2292 ovs-ofctl add-flow br0 in_port=0,actions=output:23
2293 ovs-ofctl mod-flows br0 dl_vlan=123,actions=output:3
2294 ovs-ofctl mod-flows br0 cookie=5,dl_vlan=123,actions=output:3
2295 ovs-ofctl del-flows br0 dl_vlan=123
2296 ovs-ofctl del-flows br0
2297 ovs-appctl -t ovs-ofctl ofctl/barrier
2298 AT_CHECK([sed 's/ (xid=0x[[1-9a-fA-F]][[0-9a-fA-F]]*)//' monitor.log | multiline_sort], [0],
2299 [NXST_FLOW_MONITOR reply (xid=0x0):
2300 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=124 actions=output:2
2301 NXST_FLOW_MONITOR reply (xid=0x0):
2302 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=123 actions=output:5
2303 NXST_FLOW_MONITOR reply (xid=0x0):
2304 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=123,dl_vlan_pcp=0 actions=output:6
2305 NXST_FLOW_MONITOR reply (xid=0x0):
2306 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=123,dl_vlan_pcp=1 actions=output:7
2307 NXST_FLOW_MONITOR reply (xid=0x0):
2308 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=123 actions=output:8
2309 NXST_FLOW_MONITOR reply (xid=0x0):
2310 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=0,dl_vlan_pcp=0 actions=output:9
2311 NXST_FLOW_MONITOR reply (xid=0x0):
2312 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=0,dl_vlan_pcp=1 actions=output:10
2313 NXST_FLOW_MONITOR reply (xid=0x0):
2314 event=ADDED table=0 cookie=0 in_port=0,vlan_tci=0x0000 actions=output:11
2315 NXST_FLOW_MONITOR reply (xid=0x0):
2316 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=4095,dl_vlan_pcp=0 actions=output:12
2317 NXST_FLOW_MONITOR reply (xid=0x0):
2318 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=4095,dl_vlan_pcp=1 actions=output:13
2319 NXST_FLOW_MONITOR reply (xid=0x0):
2320 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=4095 actions=output:14
2321 NXST_FLOW_MONITOR reply (xid=0x0):
2322 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=0,dl_vlan_pcp=0 actions=output:15
2323 NXST_FLOW_MONITOR reply (xid=0x0):
2324 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=0,dl_vlan_pcp=1 actions=output:16
2325 NXST_FLOW_MONITOR reply (xid=0x0):
2326 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=0 actions=output:17
2327 NXST_FLOW_MONITOR reply (xid=0x0):
2328 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=0,dl_vlan_pcp=0 actions=output:18
2329 NXST_FLOW_MONITOR reply (xid=0x0):
2330 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=0,dl_vlan_pcp=1 actions=output:19
2331 NXST_FLOW_MONITOR reply (xid=0x0):
2332 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=0 actions=output:20
2333 NXST_FLOW_MONITOR reply (xid=0x0):
2334 event=ADDED table=0 cookie=0 in_port=0,dl_vlan_pcp=0 actions=output:21
2335 NXST_FLOW_MONITOR reply (xid=0x0):
2336 event=ADDED table=0 cookie=0 in_port=0,dl_vlan_pcp=1 actions=output:22
2337 NXST_FLOW_MONITOR reply (xid=0x0):
2338 event=ADDED table=0 cookie=0 in_port=0 actions=output:23
2339 NXST_FLOW_MONITOR reply (xid=0x0):
2340 event=MODIFIED table=0 cookie=0 in_port=0,dl_vlan=123 actions=output:3
2341 event=MODIFIED table=0 cookie=0 in_port=0,dl_vlan=123,dl_vlan_pcp=0 actions=output:3
2342 event=MODIFIED table=0 cookie=0 in_port=0,dl_vlan=123,dl_vlan_pcp=1 actions=output:3
2343 NXST_FLOW_MONITOR reply (xid=0x0):
2344 event=MODIFIED table=0 cookie=0x5 in_port=0,dl_vlan=123 actions=output:3
2345 event=MODIFIED table=0 cookie=0x5 in_port=0,dl_vlan=123,dl_vlan_pcp=0 actions=output:3
2346 event=MODIFIED table=0 cookie=0x5 in_port=0,dl_vlan=123,dl_vlan_pcp=1 actions=output:3
2347 NXST_FLOW_MONITOR reply (xid=0x0):
2348 event=DELETED reason=delete table=0 cookie=0x5 in_port=0,dl_vlan=123 actions=output:3
2349 event=DELETED reason=delete table=0 cookie=0x5 in_port=0,dl_vlan=123,dl_vlan_pcp=0 actions=output:3
2350 event=DELETED reason=delete table=0 cookie=0x5 in_port=0,dl_vlan=123,dl_vlan_pcp=1 actions=output:3
2351 NXST_FLOW_MONITOR reply (xid=0x0):
2352 event=DELETED reason=delete table=0 cookie=0 in_port=0 actions=output:23
2353 event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan=0 actions=output:20
2354 event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan=0,dl_vlan_pcp=0 actions=output:18
2355 event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan=0,dl_vlan_pcp=1 actions=output:19
2356 event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan=124 actions=output:2
2357 event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan=4095 actions=output:14
2358 event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan=4095,dl_vlan_pcp=0 actions=output:12
2359 event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan=4095,dl_vlan_pcp=1 actions=output:13
2360 event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan_pcp=0 actions=output:21
2361 event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan_pcp=1 actions=output:22
2362 event=DELETED reason=delete table=0 cookie=0 in_port=0,vlan_tci=0x0000 actions=output:11
2366 # Check that our own changes are reported as full updates.
2367 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
2368 ovs-ofctl add-flow br0 in_port=1,actions=output:2
2369 ovs-ofctl add-flow br0 in_port=2,actions=output:1
2370 ovs-appctl -t ovs-ofctl ofctl/barrier
2371 ovs-appctl -t ovs-ofctl ofctl/send 010e004812345678003fffff00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003000000000000ffffffffffff0000
2372 ovs-appctl -t ovs-ofctl ofctl/barrier
2373 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip], [0], [NXST_FLOW reply:
2375 AT_CHECK([sed 's/ (xid=0x[[1-9a-fA-F]][[0-9a-fA-F]]*)//' monitor.log | multiline_sort], [0],
2376 [NXST_FLOW_MONITOR reply (xid=0x0):
2377 event=ADDED table=0 cookie=0 in_port=1 actions=output:2
2378 NXST_FLOW_MONITOR reply (xid=0x0):
2379 event=ADDED table=0 cookie=0 in_port=2 actions=output:1
2381 send: OFPT_FLOW_MOD: DEL priority=0 actions=drop
2382 NXST_FLOW_MONITOR reply (xid=0x0):
2383 event=DELETED reason=delete table=0 cookie=0 in_port=1 actions=output:2
2384 event=DELETED reason=delete table=0 cookie=0 in_port=2 actions=output:1
2388 ovs-appctl -t ovs-ofctl exit
2392 AT_SETUP([ofproto - flow monitoring with !own])
2393 AT_KEYWORDS([monitor])
2396 ovs-ofctl add-flow br0 in_port=0,dl_vlan=123,actions=output:1
2398 # Start a monitor watching the flow table and check the initial reply.
2399 ovs-ofctl monitor br0 watch:\!own --detach --no-chdir --pidfile >monitor.log 2>&1
2400 AT_CAPTURE_FILE([monitor.log])
2401 ovs-appctl -t ovs-ofctl ofctl/barrier
2402 AT_CHECK([sed 's/ (xid=0x[[1-9a-fA-F]][[0-9a-fA-F]]*)//' monitor.log], [0],
2403 [NXST_FLOW_MONITOR reply:
2404 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=123 actions=output:1
2408 # Check that our own changes are reported as abbreviations.
2409 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
2410 ovs-ofctl add-flow br0 in_port=1,actions=output:2
2411 ovs-ofctl add-flow br0 in_port=2,actions=output:1
2412 ovs-appctl -t ovs-ofctl ofctl/barrier
2413 ovs-appctl -t ovs-ofctl ofctl/send 010e004812345678003fffff00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003000000000000ffffffffffff0000
2414 ovs-appctl -t ovs-ofctl ofctl/barrier
2415 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip], [0], [NXST_FLOW reply:
2417 AT_CHECK([sed 's/ (xid=0x[[1-9a-fA-F]][[0-9a-fA-F]]*)//' monitor.log], [0],
2418 [NXST_FLOW_MONITOR reply (xid=0x0):
2419 event=ADDED table=0 cookie=0 in_port=1 actions=output:2
2420 NXST_FLOW_MONITOR reply (xid=0x0):
2421 event=ADDED table=0 cookie=0 in_port=2 actions=output:1
2423 send: OFPT_FLOW_MOD: DEL priority=0 actions=drop
2424 NXST_FLOW_MONITOR reply (xid=0x0):
2425 event=ABBREV xid=0x12345678
2429 ovs-appctl -t ovs-ofctl exit
2433 AT_SETUP([ofproto - flow monitoring with out_port])
2434 AT_KEYWORDS([monitor])
2437 ovs-ofctl add-flow br0 in_port=0,dl_vlan=121,actions=output:1
2438 ovs-ofctl add-flow br0 in_port=0,dl_vlan=122,actions=output:1
2439 ovs-ofctl add-flow br0 in_port=0,dl_vlan=123,actions=output:2
2441 # Start a monitor watching the flow table and check the initial reply.
2442 ovs-ofctl monitor br0 watch:out_port=2 --detach --no-chdir --pidfile >monitor.log 2>&1
2443 AT_CAPTURE_FILE([monitor.log])
2444 ovs-appctl -t ovs-ofctl ofctl/barrier
2445 AT_CHECK([sed 's/ (xid=0x[[1-9a-fA-F]][[0-9a-fA-F]]*)//' monitor.log], [0],
2446 [NXST_FLOW_MONITOR reply:
2447 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=123 actions=output:2
2451 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
2453 # Add, modify flows and check the updates.
2454 ovs-ofctl mod-flows br0 dl_vlan=121,actions=drop
2455 ovs-ofctl mod-flows br0 dl_vlan=122,actions=output:1,output:2
2456 ovs-appctl -t ovs-ofctl ofctl/barrier
2458 ovs-ofctl mod-flows br0 dl_vlan=123,actions=output:1,output:2
2459 ovs-appctl -t ovs-ofctl ofctl/barrier
2461 ovs-ofctl mod-flows br0 dl_vlan=122,actions=output:1
2462 ovs-appctl -t ovs-ofctl ofctl/barrier
2463 ovs-ofctl mod-flows br0 dl_vlan=123,actions=output:2
2464 ovs-appctl -t ovs-ofctl ofctl/barrier
2466 AT_CHECK([sed 's/ (xid=0x[[1-9a-fA-F]][[0-9a-fA-F]]*)//' monitor.log], [0],
2467 [NXST_FLOW_MONITOR reply (xid=0x0):
2468 event=MODIFIED table=0 cookie=0 in_port=0,dl_vlan=122 actions=output:1,output:2
2470 NXST_FLOW_MONITOR reply (xid=0x0):
2471 event=MODIFIED table=0 cookie=0 in_port=0,dl_vlan=123 actions=output:1,output:2
2473 NXST_FLOW_MONITOR reply (xid=0x0):
2474 event=MODIFIED table=0 cookie=0 in_port=0,dl_vlan=122 actions=output:1
2476 NXST_FLOW_MONITOR reply (xid=0x0):
2477 event=MODIFIED table=0 cookie=0 in_port=0,dl_vlan=123 actions=output:2
2481 ovs-appctl -t ovs-ofctl exit
2485 AT_SETUP([ofproto - flow monitoring pause and resume])
2486 AT_KEYWORDS([monitor])
2488 # The maximum socket receive buffer size is important for this test, which
2489 # tests behavior when the receive buffer overflows.
2490 if test -e /proc/sys/net/core/rmem_max; then
2492 rmem_max=`cat /proc/sys/net/core/rmem_max`
2493 elif rmem_max=`sysctl -n net.inet.tcp.recvbuf_max 2>/dev/null`; then
2496 # Don't know how to get maximum socket receive buffer on this OS
2499 # Calculate the total amount of queuing: rmem_max in the kernel, 128 kB
2500 # in ofproto sending userspace (see ofmonitor_flush() in connmgr.c).
2501 queue_size=`expr $rmem_max + 128 \* 1024`
2502 echo rmem_max=$rmem_max queue_size=$queue_size
2504 # If there's too much queuing skip the test to avoid timing out.
2505 AT_SKIP_IF([test $rmem_max -gt 1048576])
2507 # Each flow update message takes up at least 48 bytes of space in queues
2508 # and in practice more than that.
2509 n_msgs=`expr $queue_size / 48`
2514 # Start a monitor watching the flow table, then make it block.
2515 ON_EXIT([kill `cat ovs-ofctl.pid`])
2516 ovs-ofctl monitor br0 watch: --detach --no-chdir --pidfile >monitor.log 2>&1
2517 AT_CAPTURE_FILE([monitor.log])
2518 ovs-appctl -t ovs-ofctl ofctl/block
2520 # Add $n_msgs flows.
2521 (echo "in_port=2,actions=output:2"
2523 for ($i = 0; $i < '$n_msgs'; $i++) {
2524 print "cookie=1,reg1=$i,actions=drop\n";
2527 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
2528 # Check that multipart flow dumps work properly:
2529 AT_CHECK([ovs-ofctl diff-flows br0 flows.txt])
2530 AT_CHECK([ovs-ofctl add-flow br0 in_port=1,cookie=3,actions=drop])
2531 AT_CHECK([ovs-ofctl mod-flows br0 in_port=2,cookie=2,actions=output:2])
2532 AT_CHECK([ovs-ofctl del-flows br0 cookie=1/-1])
2534 ovs-appctl -t ovs-ofctl ofctl/unblock
2536 # Wait for the connection resumed.
2537 # A barrier doesn't work for this purpose.
2538 # https://www.mail-archive.com/dev@openvswitch.org/msg27013.html
2539 # https://www.mail-archive.com/dev@openvswitch.org/msg27675.html
2540 OVS_WAIT_UNTIL([grep NXT_FLOW_MONITOR_RESUMED monitor.log])
2542 ovs-appctl -t ovs-ofctl exit
2544 # Check that the flow monitor reported the same number of flows
2545 # added and deleted, but fewer than we actually added and deleted.
2546 adds=`grep -c 'ADDED.*reg1=' monitor.log`
2547 deletes=`grep -c 'DELETED.*reg1=' monitor.log`
2548 echo adds=$adds deletes=$deletes
2549 AT_CHECK([test $adds -gt 100 && test $adds -lt $n_msgs])
2550 AT_CHECK([test $adds = $deletes])
2552 # Check that the flow monitor reported everything in the expected order:
2554 # event=ADDED table=0 cookie=0x1 reg1=0x22
2556 # NXT_FLOW_MONITOR_PAUSED:
2558 # event=DELETED reason=delete table=0 cookie=0x1 reg1=0x22
2560 # event=ADDED table=0 cookie=0x3 in_port=1
2561 # event=MODIFIED table=0 cookie=0x2 in_port=2 actions=output:2
2562 # NXT_FLOW_MONITOR_RESUMED:
2564 # except that, between the PAUSED and RESUMED, the order of the ADDED
2565 # and MODIFIED lines lines depends on hash order, that is, it varies
2566 # as we change the hash function or change architecture. Therefore,
2567 # we use a couple of tests below to accept both orders.
2568 AT_CHECK([ofctl_strip < monitor.log | sed -n -e '
2571 /NXT_FLOW_MONITOR_PAUSED:/p
2572 /NXT_FLOW_MONITOR_RESUMED:/p
2573 ' > monitor.log.subset])
2574 AT_CHECK([grep -v MODIFIED monitor.log.subset], [0], [dnl
2575 event=ADDED table=0 cookie=0x1 reg1=0x22
2576 NXT_FLOW_MONITOR_PAUSED:
2577 event=DELETED reason=delete table=0 cookie=0x1 reg1=0x22
2578 event=ADDED table=0 cookie=0x3 in_port=1
2579 NXT_FLOW_MONITOR_RESUMED:
2581 AT_CHECK([grep -v ADDED monitor.log.subset], [0], [dnl
2582 NXT_FLOW_MONITOR_PAUSED:
2583 event=DELETED reason=delete table=0 cookie=0x1 reg1=0x22
2584 event=MODIFIED table=0 cookie=0x2 in_port=2 actions=output:2
2585 NXT_FLOW_MONITOR_RESUMED:
2591 AT_SETUP([ofproto - event filtering (OpenFlow 1.3)])
2592 AT_KEYWORDS([monitor])
2595 # Start a monitor, use the required protocol version
2596 ovs-ofctl -O OpenFlow13 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1
2597 AT_CAPTURE_FILE([monitor.log])
2599 # Send an OpenFlow13 message (04), OFPT_GET_ASYNC_REQUEST (1a), length (8), xid (0a)
2600 ovs-appctl -t ovs-ofctl ofctl/send 041a00080000000a
2601 ovs-appctl -t ovs-ofctl ofctl/barrier
2603 # Check default setting
2604 read -r -d '' expected <<'EOF'
2607 AT_CHECK([ofctl_strip < monitor.log], [], [dnl
2608 send: OFPT_GET_ASYNC_REQUEST (OF1.3):
2609 OFPT_GET_ASYNC_REPLY (OF1.3):
2611 PACKET_IN: no_match action
2612 PORT_STATUS: add delete modify
2613 FLOW_REMOVED: idle hard delete
2617 PORT_STATUS: add delete modify
2619 OFPT_BARRIER_REPLY (OF1.3):
2625 AT_SETUP([ofproto - ofport_request])
2627 ADD_OF_PORTS([br0], [1], [2], [3])
2629 set_and_check_specific_ofports () {
2630 ovs-vsctl set Interface p1 ofport_request="$1" -- \
2631 set Interface p2 ofport_request="$2" -- \
2632 set Interface p3 ofport_request="$3"
2633 ofports=`ovs-vsctl get Interface p1 ofport -- \
2634 get Interface p2 ofport -- \
2635 get Interface p3 ofport`
2636 AT_CHECK_UNQUOTED([echo $ofports], [0], [$1 $2 $3
2639 for pre in '1 2 3' '1 3 2' '2 1 3' '2 3 1' '3 1 2' '3 2 1'; do
2640 for post in '1 2 3' '1 3 2' '2 1 3' '2 3 1' '3 1 2' '3 2 1'; do
2641 echo -----------------------------------------------------------
2642 echo "Check changing port numbers from $pre to $post"
2643 set_and_check_specific_ofports $pre
2644 set_and_check_specific_ofports $post
2648 ovs-vsctl del-port p3
2650 set_and_check_poorly_specified_ofports () {
2651 ovs-vsctl set Interface p1 ofport_request="$1" -- \
2652 set Interface p2 ofport_request="$2"
2653 p1=`ovs-vsctl get Interface p1 ofport`
2654 p2=`ovs-vsctl get Interface p2 ofport`
2657 AT_CHECK([test "$p1" != "$p2"])
2658 if test "$1" = "$2" && test "$1" != '[[]]'; then
2659 # One port number must be the requested one.
2660 AT_CHECK([test "$p1" = "$1" || test "$p2" = "$1"])
2661 # The other port number must be different (already tested above).
2663 AT_CHECK([test "$1" = '[[]]' || test "$p1" == "$1"])
2664 AT_CHECK([test "$2" = '[[]]' || test "$p2" == "$2"])
2667 for pre in '1 2' '[[]] 2' '1 [[]]' '[[]] [[]]' '2 1' '[[]] 1' '2 [[]]' \
2669 for post in '1 2' '[[]] 2' '1 [[]]' '[[]] [[]]' '2 1' '[[]] 1' '2 [[]]' \
2671 echo -----------------------------------------------------------
2672 echo "Check changing port numbers from $pre to $post"
2673 set_and_check_poorly_specified_ofports $pre
2674 set_and_check_poorly_specified_ofports $post
2681 AT_SETUP([ofproto - bundles, open (OpenFlow 1.4)])
2682 AT_KEYWORDS([monitor])
2685 # Start a monitor, use the required protocol version
2686 ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1
2687 AT_CAPTURE_FILE([monitor.log])
2689 # Send an OpenFlow14 message (05), OFPT_BUNDLE_CONTROL (21), length (10), xid (0a)
2690 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 00 00 01"
2691 ovs-appctl -t ovs-ofctl ofctl/barrier
2692 ovs-appctl -t ovs-ofctl exit
2694 AT_CHECK([ofctl_strip < monitor.log], [], [dnl
2695 send: OFPT_BUNDLE_CONTROL (OF1.4):
2696 bundle_id=0x1 type=OPEN_REQUEST flags=atomic
2697 OFPT_BUNDLE_CONTROL (OF1.4):
2698 bundle_id=0x1 type=OPEN_REPLY flags=0
2699 OFPT_BARRIER_REPLY (OF1.4):
2705 AT_SETUP([ofproto - bundles, double open (OpenFlow 1.4)])
2706 AT_KEYWORDS([monitor])
2709 # Start a monitor, use the required protocol version
2710 ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1
2711 AT_CAPTURE_FILE([monitor.log])
2713 # Send twice an OpenFlow14 message (05), OFPT_BUNDLE_CONTROL (21), length (10), xid (0a)
2714 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 00 00 01"
2715 ovs-appctl -t ovs-ofctl ofctl/barrier
2716 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 00 00 01"
2717 ovs-appctl -t ovs-ofctl ofctl/barrier
2718 ovs-appctl -t ovs-ofctl exit
2720 AT_CHECK([ofctl_strip < monitor.log], [0], [dnl
2721 send: OFPT_BUNDLE_CONTROL (OF1.4):
2722 bundle_id=0x1 type=OPEN_REQUEST flags=atomic
2723 OFPT_BUNDLE_CONTROL (OF1.4):
2724 bundle_id=0x1 type=OPEN_REPLY flags=0
2725 OFPT_BARRIER_REPLY (OF1.4):
2726 send: OFPT_BUNDLE_CONTROL (OF1.4):
2727 bundle_id=0x1 type=OPEN_REQUEST flags=atomic
2728 OFPT_ERROR (OF1.4): OFPBFC_BAD_ID
2729 OFPT_BUNDLE_CONTROL (OF1.4):
2730 bundle_id=0x1 type=OPEN_REQUEST flags=atomic
2731 OFPT_BARRIER_REPLY (OF1.4):
2737 AT_SETUP([ofproto - bundle close without open (OpenFlow 1.4)])
2738 AT_KEYWORDS([monitor])
2741 # Start a monitor, use the required protocol version
2742 ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1
2743 AT_CAPTURE_FILE([monitor.log])
2745 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 02 00 01"
2746 ovs-appctl -t ovs-ofctl ofctl/barrier
2747 ovs-appctl -t ovs-ofctl exit
2749 AT_CHECK([ofctl_strip < monitor.log], [0], [dnl
2750 send: OFPT_BUNDLE_CONTROL (OF1.4):
2751 bundle_id=0x1 type=CLOSE_REQUEST flags=atomic
2752 OFPT_ERROR (OF1.4): OFPBFC_BAD_ID
2753 OFPT_BUNDLE_CONTROL (OF1.4):
2754 bundle_id=0x1 type=CLOSE_REQUEST flags=atomic
2755 OFPT_BARRIER_REPLY (OF1.4):
2761 AT_SETUP([ofproto - bundle double close (OpenFlow 1.4)])
2762 AT_KEYWORDS([monitor])
2765 # Start a monitor, use the required protocol version
2766 ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1
2767 AT_CAPTURE_FILE([monitor.log])
2769 # Open, Close, Close
2770 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 00 00 01"
2771 ovs-appctl -t ovs-ofctl ofctl/barrier
2772 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 02 00 01"
2773 ovs-appctl -t ovs-ofctl ofctl/barrier
2774 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 02 00 01"
2775 ovs-appctl -t ovs-ofctl ofctl/barrier
2776 ovs-appctl -t ovs-ofctl exit
2778 AT_CHECK([ofctl_strip < monitor.log], [0], [dnl
2779 send: OFPT_BUNDLE_CONTROL (OF1.4):
2780 bundle_id=0x1 type=OPEN_REQUEST flags=atomic
2781 OFPT_BUNDLE_CONTROL (OF1.4):
2782 bundle_id=0x1 type=OPEN_REPLY flags=0
2783 OFPT_BARRIER_REPLY (OF1.4):
2784 send: OFPT_BUNDLE_CONTROL (OF1.4):
2785 bundle_id=0x1 type=CLOSE_REQUEST flags=atomic
2786 OFPT_BUNDLE_CONTROL (OF1.4):
2787 bundle_id=0x1 type=CLOSE_REPLY flags=0
2788 OFPT_BARRIER_REPLY (OF1.4):
2789 send: OFPT_BUNDLE_CONTROL (OF1.4):
2790 bundle_id=0x1 type=CLOSE_REQUEST flags=atomic
2791 OFPT_ERROR (OF1.4): OFPBFC_BUNDLE_CLOSED
2792 OFPT_BUNDLE_CONTROL (OF1.4):
2793 bundle_id=0x1 type=CLOSE_REQUEST flags=atomic
2794 OFPT_BARRIER_REPLY (OF1.4):
2800 AT_SETUP([ofproto - bundle close, different flags (OpenFlow 1.4)])
2801 AT_KEYWORDS([monitor])
2804 # Start a monitor, use the required protocol version
2805 ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1
2806 AT_CAPTURE_FILE([monitor.log])
2808 # Open, Close, Close
2809 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 00 00 01"
2810 ovs-appctl -t ovs-ofctl ofctl/barrier
2811 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 02 00 02"
2812 ovs-appctl -t ovs-ofctl ofctl/barrier
2813 ovs-appctl -t ovs-ofctl exit
2815 AT_CHECK([ofctl_strip < monitor.log], [0], [dnl
2816 send: OFPT_BUNDLE_CONTROL (OF1.4):
2817 bundle_id=0x1 type=OPEN_REQUEST flags=atomic
2818 OFPT_BUNDLE_CONTROL (OF1.4):
2819 bundle_id=0x1 type=OPEN_REPLY flags=0
2820 OFPT_BARRIER_REPLY (OF1.4):
2821 send: OFPT_BUNDLE_CONTROL (OF1.4):
2822 bundle_id=0x1 type=CLOSE_REQUEST flags=ordered
2823 OFPT_ERROR (OF1.4): OFPBFC_BAD_FLAGS
2824 OFPT_BUNDLE_CONTROL (OF1.4):
2825 bundle_id=0x1 type=CLOSE_REQUEST flags=ordered
2826 OFPT_BARRIER_REPLY (OF1.4):
2832 AT_SETUP([ofproto - bundle commit without open (OpenFlow 1.4)])
2833 AT_KEYWORDS([monitor])
2836 # Start a monitor, use the required protocol version
2837 ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1
2838 AT_CAPTURE_FILE([monitor.log])
2840 # Open, Close, Close
2841 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 04 00 01"
2842 ovs-appctl -t ovs-ofctl ofctl/barrier
2843 ovs-appctl -t ovs-ofctl exit
2845 AT_CHECK([ofctl_strip < monitor.log], [0], [dnl
2846 send: OFPT_BUNDLE_CONTROL (OF1.4):
2847 bundle_id=0x1 type=COMMIT_REQUEST flags=atomic
2848 OFPT_ERROR (OF1.4): OFPBFC_BAD_ID
2849 OFPT_BUNDLE_CONTROL (OF1.4):
2850 bundle_id=0x1 type=COMMIT_REQUEST flags=atomic
2851 OFPT_BARRIER_REPLY (OF1.4):
2857 AT_SETUP([ofproto - bundle commit, different flags (OpenFlow 1.4)])
2858 AT_KEYWORDS([monitor])
2861 # Start a monitor, use the required protocol version
2862 ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1
2863 AT_CAPTURE_FILE([monitor.log])
2865 # Open, Close, Close
2866 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 00 00 01"
2867 ovs-appctl -t ovs-ofctl ofctl/barrier
2868 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 04 00 02"
2869 ovs-appctl -t ovs-ofctl ofctl/barrier
2870 ovs-appctl -t ovs-ofctl exit
2872 AT_CHECK([ofctl_strip < monitor.log], [0], [dnl
2873 send: OFPT_BUNDLE_CONTROL (OF1.4):
2874 bundle_id=0x1 type=OPEN_REQUEST flags=atomic
2875 OFPT_BUNDLE_CONTROL (OF1.4):
2876 bundle_id=0x1 type=OPEN_REPLY flags=0
2877 OFPT_BARRIER_REPLY (OF1.4):
2878 send: OFPT_BUNDLE_CONTROL (OF1.4):
2879 bundle_id=0x1 type=COMMIT_REQUEST flags=ordered
2880 OFPT_ERROR (OF1.4): OFPBFC_BAD_FLAGS
2881 OFPT_BUNDLE_CONTROL (OF1.4):
2882 bundle_id=0x1 type=COMMIT_REQUEST flags=ordered
2883 OFPT_BARRIER_REPLY (OF1.4):
2889 AT_SETUP([ofproto - bundle discard without open (OpenFlow 1.4)])
2890 AT_KEYWORDS([monitor])
2893 # Start a monitor, use the required protocol version
2894 ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1
2895 AT_CAPTURE_FILE([monitor.log])
2897 # Open, Close, Close
2898 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 06 00 01"
2899 ovs-appctl -t ovs-ofctl ofctl/barrier
2900 ovs-appctl -t ovs-ofctl exit
2902 AT_CHECK([ofctl_strip < monitor.log], [0], [dnl
2903 send: OFPT_BUNDLE_CONTROL (OF1.4):
2904 bundle_id=0x1 type=DISCARD_REQUEST flags=atomic
2905 OFPT_ERROR (OF1.4): OFPBFC_BAD_ID
2906 OFPT_BUNDLE_CONTROL (OF1.4):
2907 bundle_id=0x1 type=DISCARD_REQUEST flags=atomic
2908 OFPT_BARRIER_REPLY (OF1.4):