3 AT_SETUP([ofproto - echo request])
5 AT_CHECK([ovs-ofctl -vANY:ANY:WARN probe br0])
9 AT_SETUP([ofproto - feature request, config request])
11 AT_CHECK([ovs-ofctl -vANY:ANY:WARN show br0], [0], [stdout])
12 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
13 OFPT_FEATURES_REPLY: dpid:fedcba9876543210
14 n_tables:255, n_buffers:256
15 capabilities: FLOW_STATS TABLE_STATS PORT_STATS QUEUE_STATS ARP_MATCH_IP
16 actions: OUTPUT SET_VLAN_VID SET_VLAN_PCP STRIP_VLAN SET_DL_SRC SET_DL_DST SET_NW_SRC SET_NW_DST SET_NW_TOS SET_TP_SRC SET_TP_DST ENQUEUE
17 LOCAL(br0): addr:aa:55:aa:55:00:00
20 speed: 100 Mbps now, 100 Mbps max
21 OFPT_GET_CONFIG_REPLY: frags=normal miss_send_len=0
26 dnl This is really bare-bones.
27 dnl It at least checks request and reply serialization and deserialization.
28 AT_SETUP([ofproto - port stats])
30 AT_CHECK([ovs-ofctl -vANY:ANY:WARN dump-ports br0], [0], [stdout])
31 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
32 OFPST_PORT reply: 1 ports
33 port 65534: rx pkts=0, bytes=0, drop=0, errs=0, frame=0, over=0, crc=0
34 tx pkts=0, bytes=0, drop=0, errs=0, coll=0
39 dnl This is really bare-bones.
40 dnl It at least checks request and reply serialization and deserialization.
41 AT_SETUP([ofproto - port-desc stats])
43 AT_CHECK([ovs-ofctl -vwarn dump-ports-desc br0], [0], [stdout])
44 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
45 OFPST_PORT_DESC reply:
46 LOCAL(br0): addr:aa:55:aa:55:00:00
49 speed: 100 Mbps now, 100 Mbps max
54 dnl This is really bare-bones.
55 dnl It at least checks request and reply serialization and deserialization.
56 AT_SETUP([ofproto - queue stats])
58 AT_CHECK([ovs-ofctl -vANY:ANY:WARN queue-stats br0], [0], [stdout])
59 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
60 OFPST_QUEUE reply: 0 queues
65 AT_SETUP([ofproto - mod-port])
67 for command_config_state in \
69 'noflood NO_FLOOD 0' \
70 'down PORT_DOWN,NO_FLOOD LINK_DOWN' \
71 'flood PORT_DOWN LINK_DOWN'
73 set $command_config_state
74 command=$[1] config=`echo $[2] | sed 's/,/ /g'` state=$[3]
75 AT_CHECK([ovs-ofctl -vANY:ANY:WARN mod-port br0 br0 $command])
76 AT_CHECK([ovs-ofctl -vANY:ANY:WARN show br0], [0], [stdout])
77 AT_CHECK_UNQUOTED([STRIP_XIDS stdout], [0], [dnl
78 OFPT_FEATURES_REPLY: dpid:fedcba9876543210
79 n_tables:255, n_buffers:256
80 capabilities: FLOW_STATS TABLE_STATS PORT_STATS QUEUE_STATS ARP_MATCH_IP
81 actions: OUTPUT SET_VLAN_VID SET_VLAN_PCP STRIP_VLAN SET_DL_SRC SET_DL_DST SET_NW_SRC SET_NW_DST SET_NW_TOS SET_TP_SRC SET_TP_DST ENQUEUE
82 LOCAL(br0): addr:aa:55:aa:55:00:00
85 speed: 100 Mbps now, 100 Mbps max
86 OFPT_GET_CONFIG_REPLY: frags=normal miss_send_len=0
92 AT_SETUP([ofproto - basic flow_mod commands (NXM)])
94 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip], [0], [NXST_FLOW reply:
96 AT_CHECK([echo 'in_port=1,actions=0' | ovs-ofctl add-flows br0 -])
97 AT_CHECK([ovs-ofctl add-flow br0 in_port=0,actions=1])
98 AT_CHECK([ovs-ofctl -F nxm add-flow br0 table=1,in_port=3,actions=2])
99 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
100 in_port=0 actions=output:1
101 in_port=1 actions=output:0
102 table=1, in_port=3 actions=output:2
105 AT_CHECK([ovs-ofctl dump-aggregate br0 table=0 | STRIP_XIDS], [0], [dnl
106 NXST_AGGREGATE reply: packet_count=0 byte_count=0 flow_count=2
108 AT_CHECK([ovs-ofctl del-flows br0])
109 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip], [0], [NXST_FLOW reply:
114 AT_SETUP([ofproto - basic flow_mod commands (OpenFlow 1.0)])
116 AT_CHECK([ovs-ofctl -F openflow10 dump-flows br0 | ofctl_strip], [0], [OFPST_FLOW reply:
118 AT_CHECK([echo 'in_port=1,actions=0' | ovs-ofctl -F openflow10 add-flows br0 -])
119 AT_CHECK([ovs-ofctl -F openflow10 add-flow br0 in_port=0,actions=1])
120 AT_CHECK([ovs-ofctl -F openflow10 add-flow br0 table=1,in_port=3,actions=2])
121 AT_CHECK([ovs-ofctl -F openflow10 dump-flows br0 | ofctl_strip | sort], [0], [dnl
122 in_port=0 actions=output:1
123 in_port=1 actions=output:0
124 table=1, in_port=3 actions=output:2
127 AT_CHECK([ovs-ofctl -F openflow10 dump-aggregate br0 table=0 | STRIP_XIDS], [0], [dnl
128 OFPST_AGGREGATE reply: packet_count=0 byte_count=0 flow_count=2
130 AT_CHECK([ovs-ofctl -F openflow10 del-flows br0])
131 AT_CHECK([ovs-ofctl -F openflow10 dump-flows br0 | ofctl_strip], [0], [OFPST_FLOW reply:
136 AT_SETUP([ofproto - dump flows with cookie])
138 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x1,in_port=1,actions=0])
139 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x2,in_port=2,actions=0])
140 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x3,in_port=3,actions=0])
141 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
142 cookie=0x1, in_port=1 actions=output:0
143 cookie=0x2, in_port=2 actions=output:0
144 cookie=0x3, in_port=3 actions=output:0
147 AT_CHECK([ovs-ofctl dump-aggregate br0 table=0 | STRIP_XIDS], [0], [dnl
148 NXST_AGGREGATE reply: packet_count=0 byte_count=0 flow_count=3
150 AT_CHECK([ovs-ofctl dump-flows br0 cookie=0x3 | ofctl_strip | sort], [0], [dnl
151 cookie=0x3, in_port=3 actions=output:0
154 AT_CHECK([ovs-ofctl dump-aggregate br0 cookie=0x3 | STRIP_XIDS], [0], [dnl
155 NXST_AGGREGATE reply: packet_count=0 byte_count=0 flow_count=1
160 AT_SETUP([ofproto - dump flows with cookie mask])
162 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x1,in_port=1,actions=0])
163 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x2,in_port=2,actions=0])
164 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x3,in_port=3,actions=0])
165 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
166 cookie=0x1, in_port=1 actions=output:0
167 cookie=0x2, in_port=2 actions=output:0
168 cookie=0x3, in_port=3 actions=output:0
171 AT_CHECK([ovs-ofctl dump-aggregate br0 table=0 | STRIP_XIDS], [0], [dnl
172 NXST_AGGREGATE reply: packet_count=0 byte_count=0 flow_count=3
174 AT_CHECK([ovs-ofctl dump-flows br0 cookie=0x3/0x1 | ofctl_strip | sort], [0], [dnl
175 cookie=0x1, in_port=1 actions=output:0
176 cookie=0x3, in_port=3 actions=output:0
179 AT_CHECK([ovs-ofctl dump-aggregate br0 cookie=0x3/0x1 | STRIP_XIDS], [0], [dnl
180 NXST_AGGREGATE reply: packet_count=0 byte_count=0 flow_count=2
185 AT_SETUP([ofproto - del flows with cookie])
187 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x1,in_port=1,actions=0])
188 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x2,in_port=2,actions=0])
189 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x3,in_port=3,actions=0])
190 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
191 cookie=0x1, in_port=1 actions=output:0
192 cookie=0x2, in_port=2 actions=output:0
193 cookie=0x3, in_port=3 actions=output:0
197 AT_CHECK([ovs-ofctl del-flows br0 cookie=0x3])
198 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
199 cookie=0x1, in_port=1 actions=output:0
200 cookie=0x2, in_port=2 actions=output:0
206 AT_SETUP([ofproto - del flows with cookie mask])
208 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x1,in_port=1,actions=0])
209 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x2,in_port=2,actions=0])
210 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x3,in_port=3,actions=0])
211 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
212 cookie=0x1, in_port=1 actions=output:0
213 cookie=0x2, in_port=2 actions=output:0
214 cookie=0x3, in_port=3 actions=output:0
217 AT_CHECK([ovs-ofctl del-flows br0 cookie=0x3/0x1])
218 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
219 cookie=0x2, in_port=2 actions=output:0
225 AT_SETUP([ofproto - flow table configuration])
227 # Check the default configuration.
228 (echo "OFPST_TABLE reply (xid=0x1): 255 tables
229 0: classifier: wild=0x3fffff, max=1000000, active=0
232 while test $x -lt 255; do
233 printf " %d: %-8s: wild=0x3fffff, max=1000000, active=0
238 AT_CHECK([ovs-ofctl dump-tables br0], [0], [expout])
239 # Change the configuration.
242 -- --id=@t0 create Flow_Table name=main \
243 -- --id=@t1 create Flow_Table flow-limit=1024 \
244 -- set bridge br0 'flow_tables={1=@t1,0=@t0}' \
245 | perl $srcdir/uuidfilt.pl],
249 # Check that the configuration was updated.
250 mv expout orig-expout
251 (echo "OFPST_TABLE reply (xid=0x1): 255 tables
252 0: main : wild=0x3fffff, max=1000000, active=0
254 1: table1 : wild=0x3fffff, max= 1024, active=0
256 tail -n +6 orig-expout) > expout
257 AT_CHECK([ovs-ofctl dump-tables br0], [0], [expout])
261 AT_SETUP([ofproto - hard limits on flow table size])
263 # Configure a maximum of 4 flows.
266 -- --id=@t0 create Flow_Table flow-limit=4 \
267 -- set bridge br0 flow_tables:0=@t0 \
268 | perl $srcdir/uuidfilt.pl],
272 for in_port in 1 2 3 4; do
273 ovs-ofctl add-flow br0 in_port=$in_port,actions=drop
275 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
276 in_port=1 actions=drop
277 in_port=2 actions=drop
278 in_port=3 actions=drop
279 in_port=4 actions=drop
282 # Adding another flow will be refused.
283 AT_CHECK([ovs-ofctl add-flow br0 in_port=5,actions=drop], [1], [], [stderr])
284 AT_CHECK([head -n 1 stderr | ofctl_strip], [0],
285 [OFPT_ERROR: OFPFMFC_ALL_TABLES_FULL
287 # Also a mod-flow that would add a flow will be refused.
288 AT_CHECK([ovs-ofctl mod-flows br0 in_port=5,actions=drop], [1], [], [stderr])
289 AT_CHECK([head -n 1 stderr | ofctl_strip], [0],
290 [OFPT_ERROR: OFPFMFC_ALL_TABLES_FULL
292 # Replacing or modifying an existing flow is allowed.
293 AT_CHECK([ovs-ofctl add-flow br0 in_port=4,actions=normal])
294 AT_CHECK([ovs-ofctl mod-flows br0 in_port=3,actions=output:1])
295 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
296 in_port=1 actions=drop
297 in_port=2 actions=drop
298 in_port=3 actions=output:1
299 in_port=4 actions=NORMAL
305 AT_SETUP([ofproto - eviction upon table overflow])
307 # Configure a maximum of 4 flows.
310 -- --id=@t0 create Flow_Table flow-limit=4 overflow-policy=evict \
311 -- set bridge br0 flow_tables:0=@t0 \
312 | perl $srcdir/uuidfilt.pl],
316 for in_port in 4 3 2 1; do
317 ovs-ofctl add-flow br0 idle_timeout=${in_port}0,in_port=$in_port,actions=drop
319 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
320 idle_timeout=10, in_port=1 actions=drop
321 idle_timeout=20, in_port=2 actions=drop
322 idle_timeout=30, in_port=3 actions=drop
323 idle_timeout=40, in_port=4 actions=drop
326 # Adding another flow will cause the one that expires soonest to be evicted.
327 AT_CHECK([ovs-ofctl add-flow br0 in_port=5,actions=drop])
328 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
329 idle_timeout=20, in_port=2 actions=drop
330 idle_timeout=30, in_port=3 actions=drop
331 idle_timeout=40, in_port=4 actions=drop
332 in_port=5 actions=drop
335 # A mod-flow that adds a flow also causes eviction, but replacing or
336 # modifying an existing flow doesn't.
337 AT_CHECK([ovs-ofctl mod-flows br0 in_port=6,actions=drop])
338 AT_CHECK([ovs-ofctl add-flow br0 in_port=4,actions=normal])
339 AT_CHECK([ovs-ofctl mod-flows br0 in_port=3,actions=output:1])
340 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
341 idle_timeout=30, in_port=3 actions=output:1
342 in_port=4 actions=NORMAL
343 in_port=5 actions=drop
344 in_port=6 actions=drop
347 # Flows with no timeouts at all cannot be evicted.
348 AT_CHECK([ovs-ofctl add-flow br0 in_port=7,actions=normal])
349 AT_CHECK([ovs-ofctl add-flow br0 in_port=8,actions=drop], [1], [], [stderr])
350 AT_CHECK([head -n 1 stderr | ofctl_strip], [0],
351 [OFPT_ERROR: OFPFMFC_ALL_TABLES_FULL
353 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
354 in_port=4 actions=NORMAL
355 in_port=5 actions=drop
356 in_port=6 actions=drop
357 in_port=7 actions=NORMAL
363 AT_SETUP([ofproto - eviction upon table overflow, with fairness])
365 # Configure a maximum of 4 flows.
368 -- --id=@t0 create Flow_Table name=evict flow-limit=4 \
369 overflow-policy=evict \
370 groups='"NXM_OF_IN_PORT[[]]"' \
371 -- set bridge br0 flow_tables:0=@t0 \
372 | perl $srcdir/uuidfilt.pl],
376 ovs-ofctl add-flows br0 - <<EOF
377 idle_timeout=10 in_port=2 dl_src=00:44:55:66:77:88 actions=drop
378 idle_timeout=20 in_port=1 dl_src=00:11:22:33:44:55 actions=drop
379 idle_timeout=30 in_port=1 dl_src=00:22:33:44:55:66 actions=drop
380 idle_timeout=40 in_port=1 dl_src=00:33:44:55:66:77 actions=drop
382 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
383 idle_timeout=10, in_port=2,dl_src=00:44:55:66:77:88 actions=drop
384 idle_timeout=20, in_port=1,dl_src=00:11:22:33:44:55 actions=drop
385 idle_timeout=30, in_port=1,dl_src=00:22:33:44:55:66 actions=drop
386 idle_timeout=40, in_port=1,dl_src=00:33:44:55:66:77 actions=drop
389 # Adding another flow will cause the one that expires soonest within
390 # the largest group (those with in_port=1) to be evicted. In this
391 # case this is not the same as the one that expires soonest overall
392 # (which is what makes the test interesting):
393 AT_CHECK([ovs-ofctl add-flow br0 in_port=2,dl_src=00:55:66:77:88:99,actions=drop])
394 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
395 idle_timeout=10, in_port=2,dl_src=00:44:55:66:77:88 actions=drop
396 idle_timeout=30, in_port=1,dl_src=00:22:33:44:55:66 actions=drop
397 idle_timeout=40, in_port=1,dl_src=00:33:44:55:66:77 actions=drop
398 in_port=2,dl_src=00:55:66:77:88:99 actions=drop
401 # Enlarge the flow limit, change the eviction policy back to strictly
402 # based on expiration, and and add some flows.
403 AT_CHECK([ovs-vsctl set Flow_Table evict groups='[[]]' flow-limit=7])
404 ovs-ofctl add-flows br0 - <<EOF
405 idle_timeout=50 in_port=2 dl_src=00:66:77:88:99:aa actions=drop
406 idle_timeout=60 in_port=2 dl_src=00:77:88:99:aa:bb actions=drop
407 idle_timeout=70 in_port=2 dl_src=00:88:99:aa:bb:cc actions=drop
409 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
410 idle_timeout=10, in_port=2,dl_src=00:44:55:66:77:88 actions=drop
411 idle_timeout=30, in_port=1,dl_src=00:22:33:44:55:66 actions=drop
412 idle_timeout=40, in_port=1,dl_src=00:33:44:55:66:77 actions=drop
413 idle_timeout=50, in_port=2,dl_src=00:66:77:88:99:aa actions=drop
414 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=drop
415 idle_timeout=70, in_port=2,dl_src=00:88:99:aa:bb:cc actions=drop
416 in_port=2,dl_src=00:55:66:77:88:99 actions=drop
419 # Adding another flow will cause the one that expires soonest overall
421 AT_CHECK([ovs-ofctl add-flow br0 'idle_timeout=80 in_port=2 dl_src=00:99:aa:bb:cc:dd actions=drop'])
422 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
423 idle_timeout=30, in_port=1,dl_src=00:22:33:44:55:66 actions=drop
424 idle_timeout=40, in_port=1,dl_src=00:33:44:55:66:77 actions=drop
425 idle_timeout=50, in_port=2,dl_src=00:66:77:88:99:aa actions=drop
426 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=drop
427 idle_timeout=70, in_port=2,dl_src=00:88:99:aa:bb:cc actions=drop
428 idle_timeout=80, in_port=2,dl_src=00:99:aa:bb:cc:dd actions=drop
429 in_port=2,dl_src=00:55:66:77:88:99 actions=drop
432 # Reducing the flow limit also causes the flows that expire soonest
433 # overall to be evicted.
434 AT_CHECK([ovs-vsctl set Flow_Table evict flow-limit=4])
435 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
436 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=drop
437 idle_timeout=70, in_port=2,dl_src=00:88:99:aa:bb:cc actions=drop
438 idle_timeout=80, in_port=2,dl_src=00:99:aa:bb:cc:dd actions=drop
439 in_port=2,dl_src=00:55:66:77:88:99 actions=drop
445 AT_SETUP([ofproto - asynchronous message control])
447 AT_CHECK([ovs-ofctl -P openflow10 monitor br0 --detach --no-chdir --pidfile])
449 printf '\n\n--- check_async %d ---\n\n\n' $1
452 ovs-appctl -t ovs-ofctl ofctl/barrier
453 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
456 # OFPT_PACKET_IN, OFPR_ACTION (controller_id=0)
457 ovs-ofctl -v packet-out br0 none controller '0001020304050010203040501234'
458 if test X"$1" = X"OFPR_ACTION"; then shift;
459 echo >>expout "OFPT_PACKET_IN: total_len=14 in_port=NONE (via action) data_len=14 (unbuffered)
460 priority:0,tunnel:0,in_port:0000,tci(0) mac(00:10:20:30:40:50->00:01:02:03:04:05) type:1234 proto:0 tos:0 ttl:0 ip(0.0.0.0->0.0.0.0)"
463 # OFPT_PACKET_IN, OFPR_NO_MATCH (controller_id=123)
464 ovs-ofctl -v packet-out br0 none 'controller(reason=no_match,id=123)' '0001020304050010203040501234'
465 if test X"$1" = X"OFPR_NO_MATCH"; then shift;
466 echo >>expout "OFPT_PACKET_IN: total_len=14 in_port=NONE (via no_match) data_len=14 (unbuffered)
467 priority:0,tunnel:0,in_port:0000,tci(0) mac(00:10:20:30:40:50->00:01:02:03:04:05) type:1234 proto:0 tos:0 ttl:0 ip(0.0.0.0->0.0.0.0)"
470 # OFPT_PACKET_IN, OFPR_INVALID_TTL (controller_id=0)
471 ovs-ofctl packet-out br0 none dec_ttl '002583dfb4000026b98cb0f908004500003fb7e200000011339bac11370dac100002d7730035002b8f6d86fb0100000100000000000006626c702d7873066e696369726103636f6d00000f00'
472 if test X"$1" = X"OFPR_INVALID_TTL"; then shift;
473 echo >>expout "OFPT_PACKET_IN: total_len=76 in_port=NONE (via invalid_ttl) data_len=76 (unbuffered)
474 priority:0,tunnel:0,in_port:0000,tci(0) mac(00:26:b9:8c:b0:f9->00:25:83:df:b4:00) type:0800 proto:17 tos:0 ttl:0 ip(172.17.55.13->172.16.0.2) port(55155->53) udp_csum:8f6d"
477 # OFPT_PORT_STATUS, OFPPR_ADD
478 ovs-vsctl add-port br0 test -- set Interface test type=dummy
479 if test X"$1" = X"OFPPR_ADD"; then shift;
480 echo >>expout "OFPT_PORT_STATUS: ADD: 1(test): addr:aa:55:aa:55:00:0x
483 speed: 100 Mbps now, 100 Mbps max"
486 # OFPT_PORT_STATUS, OFPPR_DELETE
487 ovs-vsctl del-port br0 test
488 if test X"$1" = X"OFPPR_DELETE"; then shift;
489 echo >>expout "OFPT_PORT_STATUS: DEL: 1(test): addr:aa:55:aa:55:00:0x
492 speed: 100 Mbps now, 100 Mbps max"
495 # OFPT_FLOW_REMOVED, OFPRR_DELETE
496 ovs-ofctl add-flow br0 send_flow_rem,actions=drop
497 ovs-ofctl --strict del-flows br0 ''
498 if test X"$1" = X"OFPRR_DELETE"; then shift;
499 echo >>expout "OFPT_FLOW_REMOVED: reason=delete"
501 AT_FAIL_IF([test X"$1" != X])
503 ovs-appctl -t ovs-ofctl ofctl/barrier
504 echo >>expout "OFPT_BARRIER_REPLY:"
508 s/ (xid=0x[0-9a-fA-F]*)//
510 s/00:0.$/00:0x/' < monitor.log]],
514 # It's a service connection so initially there should be no async messages.
517 # Set miss_send_len to 128, turning on packet-ins for our service connection.
518 ovs-appctl -t ovs-ofctl ofctl/send 0109000c0123456700000080
519 check_async 2 OFPR_ACTION OFPPR_ADD OFPPR_DELETE OFPRR_DELETE
521 # Set miss_send_len to 128 and enable invalid_ttl.
522 ovs-appctl -t ovs-ofctl ofctl/send 0109000c0123456700040080
523 check_async 3 OFPR_ACTION OFPR_INVALID_TTL OFPPR_ADD OFPPR_DELETE OFPRR_DELETE
525 # Become slave, which should disable everything except port status.
526 ovs-appctl -t ovs-ofctl ofctl/send 0104001400000002000023200000000a00000002
527 check_async 4 OFPPR_ADD OFPPR_DELETE
529 # Use NXT_SET_ASYNC_CONFIG to enable a patchwork of asynchronous messages.
530 ovs-appctl -t ovs-ofctl ofctl/send 01040028000000020000232000000013000000020000000500000005000000020000000200000005
531 check_async 5 OFPR_INVALID_TTL OFPPR_DELETE OFPRR_DELETE
533 # Set controller ID 123.
534 ovs-appctl -t ovs-ofctl ofctl/send 01040018000000030000232000000014000000000000007b
535 check_async 6 OFPR_NO_MATCH OFPPR_DELETE OFPRR_DELETE
537 # Restore controller ID 0.
538 ovs-appctl -t ovs-ofctl ofctl/send 010400180000000300002320000000140000000000000000
541 ovs-appctl -t ovs-ofctl ofctl/send 0104001400000002000023200000000a00000001
542 check_async 7 OFPR_ACTION OFPPR_ADD
544 ovs-appctl -t ovs-ofctl exit
548 dnl This test checks that OFPT_PACKET_OUT accepts both OFPP_NONE (as
549 dnl specified by OpenFlow 1.0) and OFPP_CONTROLLER (used by some
550 dnl controllers despite the spec) as meaning a packet that was generated
551 dnl by the controller.
552 AT_SETUP([ofproto - packet-out from controller])
555 # Start a monitor listening for packet-ins.
556 AT_CHECK([ovs-ofctl -P openflow10 monitor br0 --detach --no-chdir --pidfile])
557 ovs-appctl -t ovs-ofctl ofctl/send 0109000c0123456700000080
558 ovs-appctl -t ovs-ofctl ofctl/barrier
559 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
560 AT_CAPTURE_FILE([monitor.log])
562 # Send some packet-outs with OFPP_NONE and OFPP_CONTROLLER (65533) as in_port.
563 AT_CHECK([ovs-ofctl packet-out br0 none controller '0001020304050010203040501234'])
564 AT_CHECK([ovs-ofctl packet-out br0 65533 controller '0001020304050010203040505678'])
566 # Stop the monitor and check its output.
567 ovs-appctl -t ovs-ofctl ofctl/barrier
568 ovs-appctl -t ovs-ofctl exit
570 AT_CHECK([sed 's/ (xid=0x[[0-9a-fA-F]]*)//' monitor.log], [0], [dnl
571 OFPT_PACKET_IN: total_len=14 in_port=NONE (via action) data_len=14 (unbuffered)
572 priority:0,tunnel:0,in_port:0000,tci(0) mac(00:10:20:30:40:50->00:01:02:03:04:05) type:1234 proto:0 tos:0 ttl:0 ip(0.0.0.0->0.0.0.0)
573 OFPT_PACKET_IN: total_len=14 in_port=CONTROLLER (via action) data_len=14 (unbuffered)
574 priority:0,tunnel:0,in_port:0000,tci(0) mac(00:10:20:30:40:50->00:01:02:03:04:05) type:5678 proto:0 tos:0 ttl:0 ip(0.0.0.0->0.0.0.0)