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 - no group support (OpenFlow 1.0)])
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_DATA([stderr], [dnl
274 ovs-ofctl: none of the usable flow formats (OXM,OpenFlow11) is among the allowed flow formats (OpenFlow10,NXM)
276 AT_CHECK([ovs-ofctl -O OpenFlow10 -vwarn add-groups br0 groups.txt], [1], ,[stderr])
277 AT_CHECK([ovs-ofctl -O OpenFlow10 -vwarn mod-group br0 'group_id=1234,type=all,bucket=output:10'], [1], ,[stderr])
278 AT_CHECK([ovs-ofctl -O OpenFlow10 -vwarn del-groups br0], [1], ,[stderr])
279 AT_CHECK([ovs-ofctl -O OpenFlow10 -vwarn dump-groups br0 ], [1], ,[stderr])
283 dnl This is really bare-bones.
284 dnl It at least checks request and reply serialization and deserialization.
285 dnl Actions definition listed in both supported formats (w/ actions=)
286 AT_SETUP([ofproto - del group (OpenFlow 1.1)])
288 AT_DATA([groups.txt], [dnl
289 group_id=1234,type=all,bucket=output:10
290 group_id=1235,type=all,bucket=actions=output:10
292 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-groups br0 groups.txt])
293 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn dump-groups br0 ], [0], [stdout])
294 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
295 OFPST_GROUP_DESC reply (OF1.1):
296 group_id=1234,type=all,bucket=actions=output:10
297 group_id=1235,type=all,bucket=actions=output:10
299 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn del-groups br0 group_id=1234])
300 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn dump-groups br0], [0], [stdout])
301 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
302 OFPST_GROUP_DESC reply (OF1.1):
303 group_id=1235,type=all,bucket=actions=output:10
305 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn del-groups br0 group_id=1234])
306 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn dump-groups br0], [0], [stdout])
307 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
308 OFPST_GROUP_DESC reply (OF1.1):
309 group_id=1235,type=all,bucket=actions=output:10
311 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn del-groups br0], [0])
312 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn dump-groups br0], [0], [stdout])
313 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
314 OFPST_GROUP_DESC reply (OF1.1):
318 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn del-groups br0 group_id=0xfffffff0],
319 [1], [], [ovs-ofctl: invalid group id 4294967280
324 dnl This is really bare-bones.
325 dnl It at least checks request and reply serialization and deserialization.
326 dnl Actions definition listed in both supported formats (w/ actions=)
327 AT_SETUP([ofproto - add indirect group])
329 dnl indirect group must have exactly one bucket
330 AT_DATA([stderr], [dnl
331 OFPT_ERROR (OF1.1) (xid=0x2): OFPGMFC_INVALID_GROUP
332 OFPT_GROUP_MOD (OF1.1) (xid=0x2): ***decode error: OFPGMFC_INVALID_GROUP***
334 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-group br0 'group_id=1234,type=indirect'], [1], , [stderr])
335 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-group br0 'group_id=1235,type=indirect,bucket=output:10'])
336 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-group br0 'group_id=1236,type=indirect,bucket=output:10,bucket=output:11'], [1], , [stderr])
340 dnl This is really bare-bones.
341 dnl It at least checks request and reply serialization and deserialization.
342 dnl Actions definition listed in both supported formats (w/ actions=)
343 AT_SETUP([ofproto - del group (OpenFlow 1.5)])
345 AT_DATA([groups.txt], [dnl
346 group_id=1234,type=select,selection_method=hash,bucket=output:10,bucket=output:11
347 group_id=1235,type=all,bucket=actions=output:12,bucket=bucket_id:0,actions=output:10,bucket=bucket_id:1,actions=output:11
349 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn add-groups br0 groups.txt])
350 AT_CHECK([ovs-ofctl -F OXM-OpenFlow15 -O OpenFlow15 -vwarn dump-groups br0 1234], [0], [stdout])
351 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
352 OFPST_GROUP_DESC reply (OF1.5):
353 group_id=1234,type=select,selection_method=hash,bucket=bucket_id:0,actions=output:10,bucket=bucket_id:1,actions=output:11
355 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn del-groups br0 group_id=1234])
356 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout])
357 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
358 OFPST_GROUP_DESC reply (OF1.5):
359 group_id=1235,type=all,bucket=bucket_id:2,actions=output:12,bucket=bucket_id:0,actions=output:10,bucket=bucket_id:1,actions=output:11
361 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn del-groups br0 group_id=1234])
362 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout])
363 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
364 OFPST_GROUP_DESC reply (OF1.5):
365 group_id=1235,type=all,bucket=bucket_id:2,actions=output:12,bucket=bucket_id:0,actions=output:10,bucket=bucket_id:1,actions=output:11
367 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn del-groups br0], [0])
368 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout])
369 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
370 OFPST_GROUP_DESC reply (OF1.5):
375 dnl This is really bare-bones.
376 dnl It at least checks request and reply serialization and deserialization.
377 AT_SETUP([ofproto - del group deletes flows])
379 AT_DATA([groups.txt], [dnl
380 group_id=1234,type=all,bucket=output:10
381 group_id=1235,type=all,bucket=output:10
383 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-groups br0 groups.txt])
384 AT_DATA([flows.txt], [dnl
385 tcp actions=group:1234
386 udp actions=group:1235
388 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-flows br0 flows.txt])
389 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn dump-flows br0 | ofctl_strip | sort],
391 tcp actions=group:1234
392 udp actions=group:1235
393 OFPST_FLOW reply (OF1.1):
395 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn del-groups br0 group_id=1234])
396 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn dump-flows br0 | ofctl_strip | sort],
398 udp actions=group:1235
399 OFPST_FLOW reply (OF1.1):
401 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn del-groups br0 group_id=1234])
402 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn dump-flows br0 | ofctl_strip | sort],
404 udp actions=group:1235
405 OFPST_FLOW reply (OF1.1):
407 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn del-groups br0])
408 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn dump-flows br0 | ofctl_strip | sort],
410 OFPST_FLOW reply (OF1.1):
415 dnl This is really bare-bones.
416 dnl It at least checks request and reply serialization and deserialization.
417 dnl Actions definition listed in both supported formats (w/ actions=)
418 AT_SETUP([ofproto - insert buckets])
420 AT_DATA([groups.txt], [dnl
421 group_id=1234,type=all,bucket=bucket_id:10,actions=output:10,bucket=bucket_id:11,actions=output:11
423 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn add-groups br0 groups.txt])
424 AT_CHECK([ovs-ofctl -F OXM-OpenFlow15 -O OpenFlow15 -vwarn dump-groups br0 1234], [0], [stdout])
425 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
426 OFPST_GROUP_DESC reply (OF1.5):
427 group_id=1234,type=all,bucket=bucket_id:10,actions=output:10,bucket=bucket_id:11,actions=output:11
429 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn insert-buckets br0 group_id=1234,command_bucket_id=first,bucket=bucket_id:0,actions=output:0,bucket=bucket_id:1,actions=output:1])
430 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout])
431 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
432 OFPST_GROUP_DESC reply (OF1.5):
433 group_id=1234,type=all,bucket=bucket_id:0,actions=output:0,bucket=bucket_id:1,actions=output:1,bucket=bucket_id:10,actions=output:10,bucket=bucket_id:11,actions=output:11
435 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn insert-buckets br0 group_id=1234,command_bucket_id=last,bucket=bucket_id:14,actions=output:14,bucket=bucket_id:15,actions=output:15])
436 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout])
437 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
438 OFPST_GROUP_DESC reply (OF1.5):
439 group_id=1234,type=all,bucket=bucket_id:0,actions=output:0,bucket=bucket_id:1,actions=output:1,bucket=bucket_id:10,actions=output:10,bucket=bucket_id:11,actions=output:11,bucket=bucket_id:14,actions=output:14,bucket=bucket_id:15,actions=output:15
441 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn insert-buckets br0 group_id=1234,command_bucket_id=15])
442 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout])
443 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
444 OFPST_GROUP_DESC reply (OF1.5):
445 group_id=1234,type=all,bucket=bucket_id:0,actions=output:0,bucket=bucket_id:1,actions=output:1,bucket=bucket_id:10,actions=output:10,bucket=bucket_id:11,actions=output:11,bucket=bucket_id:14,actions=output:14,bucket=bucket_id:15,actions=output:15
447 AT_DATA([buckets.txt], [dnl
448 group_id=1234,command_bucket_id=11,bucket=bucket_id:12,actions=output:12,bucket=bucket_id:13,actions=output:13
450 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn insert-buckets br0 - < buckets.txt])
451 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout])
452 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
453 OFPST_GROUP_DESC reply (OF1.5):
454 group_id=1234,type=all,bucket=bucket_id:0,actions=output:0,bucket=bucket_id:1,actions=output:1,bucket=bucket_id:10,actions=output:10,bucket=bucket_id:11,actions=output:11,bucket=bucket_id:12,actions=output:12,bucket=bucket_id:13,actions=output:13,bucket=bucket_id:14,actions=output:14,bucket=bucket_id:15,actions=output:15
456 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn insert-buckets br0 group_id=1234,command_bucket_id=15,bucket=bucket_id:20,actions=output:20,bucket=bucket_id:21,actions=output:21])
457 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout])
458 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
459 OFPST_GROUP_DESC reply (OF1.5):
460 group_id=1234,type=all,bucket=bucket_id:0,actions=output:0,bucket=bucket_id:1,actions=output:1,bucket=bucket_id:10,actions=output:10,bucket=bucket_id:11,actions=output:11,bucket=bucket_id:12,actions=output:12,bucket=bucket_id:13,actions=output:13,bucket=bucket_id:14,actions=output:14,bucket=bucket_id:15,actions=output:15,bucket=bucket_id:20,actions=output:20,bucket=bucket_id:21,actions=output:21
464 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn insert-buckets br0 group_id=1234,command_bucket_id=0xffffff01,bucket=bucket_id:0,actions=output:0,bucket=bucket_id:1,actions=output:1], [1], [],
465 [ovs-ofctl: invalid command bucket id 4294967041
467 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn insert-buckets br0 group_id=1234,command_bucket_id=first,bucket=bucket_id:0,actions=output:0,bucket=bucket_id:1,actions=output:1], [1], [],
468 [ovs-ofctl: insert-bucket needs OpenFlow 1.5 or later ('-O OpenFlow15')
473 dnl This is really bare-bones.
474 dnl It at least checks request and reply serialization and deserialization.
475 dnl Actions definition listed in both supported formats (w/ actions=)
476 AT_SETUP([ofproto - remove buckets])
478 AT_DATA([groups.txt], [dnl
479 group_id=1234,type=all,bucket=bucket_id:10,actions=output:10,bucket=bucket_id:11,actions=output:11,bucket=bucket_id:12,actions=output:12,bucket=bucket_id:13,actions=output:13,bucket=bucket_id:14,actions=output:14,bucket=bucket_id:15,actions=output:15,bucket=bucket_id:16,actions=output:16
481 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn add-groups br0 groups.txt])
482 AT_CHECK([ovs-ofctl -F OXM-OpenFlow15 -O OpenFlow15 -vwarn dump-groups br0 1234], [0], [stdout])
483 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
484 OFPST_GROUP_DESC reply (OF1.5):
485 group_id=1234,type=all,bucket=bucket_id:10,actions=output:10,bucket=bucket_id:11,actions=output:11,bucket=bucket_id:12,actions=output:12,bucket=bucket_id:13,actions=output:13,bucket=bucket_id:14,actions=output:14,bucket=bucket_id:15,actions=output:15,bucket=bucket_id:16,actions=output:16
487 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn remove-buckets br0 group_id=1234,command_bucket_id=first])
488 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout])
489 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
490 OFPST_GROUP_DESC reply (OF1.5):
491 group_id=1234,type=all,bucket=bucket_id:11,actions=output:11,bucket=bucket_id:12,actions=output:12,bucket=bucket_id:13,actions=output:13,bucket=bucket_id:14,actions=output:14,bucket=bucket_id:15,actions=output:15,bucket=bucket_id:16,actions=output:16
493 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn remove-buckets br0 group_id=1234,command_bucket_id=last])
494 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout])
495 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
496 OFPST_GROUP_DESC reply (OF1.5):
497 group_id=1234,type=all,bucket=bucket_id:11,actions=output:11,bucket=bucket_id:12,actions=output:12,bucket=bucket_id:13,actions=output:13,bucket=bucket_id:14,actions=output:14,bucket=bucket_id:15,actions=output:15
499 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn remove-buckets br0 group_id=1234,command_bucket_id=13])
500 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout])
501 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
502 OFPST_GROUP_DESC reply (OF1.5):
503 group_id=1234,type=all,bucket=bucket_id:11,actions=output:11,bucket=bucket_id:12,actions=output:12,bucket=bucket_id:14,actions=output:14,bucket=bucket_id:15,actions=output:15
505 AT_DATA([buckets.txt], [dnl
508 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn remove-buckets br0 - < buckets.txt])
509 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout])
510 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
511 OFPST_GROUP_DESC reply (OF1.5):
512 group_id=1234,type=all
514 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn remove-buckets br0 group_id=1234,command_bucket_id=first])
515 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn remove-buckets br0 group_id=1234,command_bucket_id=last])
516 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn remove-buckets br0 group_id=1234,command_bucket_id=all])
517 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn remove-buckets br0 group_id=1234,command_bucket_id=1], [1], [], [stderr])
518 AT_CHECK([cat stderr | ofctl_strip], [0], [dnl
519 OFPT_ERROR (OF1.5): OFPGMFC_UNKNOWN_BUCKET
520 OFPT_GROUP_MOD (OF1.5):
521 REMOVE_BUCKET command_bucket_id:1,group_id=1234
524 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn remove-buckets br0 group_id=1234,command_bucket_id=last], [1], [],
525 [ovs-ofctl: remove-bucket needs OpenFlow 1.5 or later ('-O OpenFlow15')
530 dnl This is really bare-bones.
531 dnl It at least checks request and reply serialization and deserialization.
532 AT_SETUP([ofproto - flow mod checks group availability])
534 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-group br0 group_id=1234,type=all,bucket=output:10])
535 AT_DATA([flows.txt], [dnl
536 tcp actions=group:1234
537 udp actions=group:1235
539 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-flow br0 'tcp actions=group:1234'])
540 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-flow br0 'tcp actions=group:1235'], [1], [], [stderr])
542 # The output should look like this:
544 # 00000000 02 0e 00 98 00 00 00 02-00 00 00 00 00 00 00 00 |................|
545 # 00000010 00 00 00 00 00 00 00 00-ff 00 00 00 00 00 80 00 |................|
546 # 00000020 ff ff ff ff ff ff ff ff-ff ff ff ff 00 00 00 00 |................|
547 # 00000030 00 00 00 58 00 00 00 00-00 00 03 d7 00 00 00 00 |...X............|
549 # This 'sed' command captures the error message but drops details.
550 AT_CHECK([sed '/truncated/d
551 /^000000.0/d' stderr | STRIP_XIDS], [0],
552 [OFPT_ERROR (OF1.1): OFPBAC_BAD_OUT_GROUP
553 OFPT_FLOW_MOD (OF1.1):
558 dnl This is really bare-bones.
559 dnl It at least checks request and reply serialization and deserialization.
560 AT_SETUP([ofproto - group description])
562 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-group br0 group_id=1234,type=all,bucket=output:10], [0], [stdout])
563 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn dump-groups br0], [0], [stdout])
564 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
565 OFPST_GROUP_DESC reply (OF1.1):
566 group_id=1234,type=all,bucket=actions=output:10
571 dnl This is really bare-bones.
572 dnl It at least checks request and reply serialization and deserialization.
573 AT_SETUP([ofproto - group description])
575 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-group br0 group_id=1234,type=all,bucket=output:10])
576 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn dump-groups br0], [0], [stdout])
577 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
578 OFPST_GROUP_DESC reply (OF1.1):
579 group_id=1234,type=all,bucket=actions=output:10
584 dnl This is really bare-bones.
585 dnl It at least checks request and reply serialization and deserialization.
586 AT_SETUP([ofproto - group features])
588 AT_CHECK([ovs-ofctl -O OpenFlow12 -vwarn dump-group-features br0], [0], [stdout])
589 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
590 OFPST_GROUP_FEATURES reply (OF1.2):
595 max_groups=0xffffff00
596 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
598 max_groups=0xffffff00
599 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
601 max_groups=0xffffff00
602 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
604 max_groups=0xffffff00
605 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
610 dnl This is really bare-bones.
611 dnl It at least checks request and reply serialization and deserialization.
612 AT_SETUP([ofproto - group stats (OpenFlow 1.1)])
614 AT_DATA([groups.txt], [dnl
615 group_id=1234,type=all,bucket=output:10
616 group_id=1235,type=all,bucket=output:10
618 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-groups br0 groups.txt])
619 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-flow br0 'tcp actions=group:1234'])
620 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn dump-group-stats br0 group_id=1234], [0], [stdout])
621 AT_CHECK([STRIP_XIDS stdout | sort], [0], [dnl
622 group_id=1234,ref_count=1,packet_count=0,byte_count=0,bucket0:packet_count=0,byte_count=0
623 OFPST_GROUP reply (OF1.1):
625 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn dump-group-stats br0], [0], [stdout])
626 AT_CHECK([STRIP_XIDS stdout | sort], [0], [dnl
627 group_id=1234,ref_count=1,packet_count=0,byte_count=0,bucket0:packet_count=0,byte_count=0
628 group_id=1235,ref_count=0,packet_count=0,byte_count=0,bucket0:packet_count=0,byte_count=0
629 OFPST_GROUP reply (OF1.1):
634 dnl This is really bare-bones.
635 dnl It at least checks request and reply serialization and deserialization.
636 AT_SETUP([ofproto - group stats (OpenFlow 1.3)])
638 AT_DATA([groups.txt], [dnl
639 group_id=1234,type=all,bucket=output:10
640 group_id=1235,type=all,bucket=output:10
642 AT_CHECK([ovs-ofctl -O OpenFlow13 -vwarn add-groups br0 groups.txt])
643 AT_CHECK([ovs-ofctl -O OpenFlow13 -vwarn add-flow br0 'tcp actions=group:1234'])
644 AT_CHECK([ovs-ofctl -O OpenFlow13 -vwarn dump-group-stats br0 group_id=1234], [0], [stdout])
645 AT_CHECK([STRIP_XIDS stdout | sed 's/duration=[[0-9.]]*s/duration=?s/' | sort], [0], [dnl
646 group_id=1234,duration=?s,ref_count=1,packet_count=0,byte_count=0,bucket0:packet_count=0,byte_count=0
647 OFPST_GROUP reply (OF1.3):
649 AT_CHECK([ovs-ofctl -O OpenFlow13 -vwarn dump-group-stats br0], [0], [stdout])
650 AT_CHECK([STRIP_XIDS stdout | sed 's/duration=[[0-9.]]*s/duration=?s/' | sort], [0], [dnl
651 group_id=1234,duration=?s,ref_count=1,packet_count=0,byte_count=0,bucket0:packet_count=0,byte_count=0
652 group_id=1235,duration=?s,ref_count=0,packet_count=0,byte_count=0,bucket0:packet_count=0,byte_count=0
653 OFPST_GROUP reply (OF1.3):
658 dnl This is really bare-bones.
659 dnl It at least checks request and reply serialization and deserialization.
660 AT_SETUP([ofproto - group stats (OpenFlow 1.5)])
662 AT_DATA([groups.txt], [dnl
663 group_id=1234,type=all,bucket=output:10
664 group_id=1235,type=all,bucket=output:10
666 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn add-groups br0 groups.txt])
667 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn add-flow br0 'tcp actions=group:1234'])
668 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-group-stats br0 group_id=1234], [0], [stdout])
669 AT_CHECK([STRIP_XIDS stdout | sed 's/duration=[[0-9.]]*s/duration=?s/' | sort], [0], [dnl
670 group_id=1234,duration=?s,ref_count=1,packet_count=0,byte_count=0,bucket0:packet_count=0,byte_count=0
671 OFPST_GROUP reply (OF1.5):
673 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-group-stats br0], [0], [stdout])
674 AT_CHECK([STRIP_XIDS stdout | sed 's/duration=[[0-9.]]*s/duration=?s/' | sort], [0], [dnl
675 group_id=1234,duration=?s,ref_count=1,packet_count=0,byte_count=0,bucket0:packet_count=0,byte_count=0
676 group_id=1235,duration=?s,ref_count=0,packet_count=0,byte_count=0,bucket0:packet_count=0,byte_count=0
677 OFPST_GROUP reply (OF1.5):
682 AT_SETUP([ofproto - mod-port (OpenFlow 1.0)])
684 for command_config_state in \
686 'noflood NO_FLOOD 0' \
687 'down PORT_DOWN,NO_FLOOD LINK_DOWN' \
688 'flood PORT_DOWN LINK_DOWN' \
689 'no-receive PORT_DOWN,NO_RECV LINK_DOWN' \
690 'no-forward PORT_DOWN,NO_RECV,NO_FWD LINK_DOWN' \
691 'no-packet-in PORT_DOWN,NO_RECV,NO_FWD,NO_PACKET_IN LINK_DOWN' \
692 'forward PORT_DOWN,NO_RECV,NO_PACKET_IN LINK_DOWN' \
693 'packet-in PORT_DOWN,NO_RECV LINK_DOWN' \
697 set $command_config_state
698 command=$[1] config=`echo $[2] | sed 's/,/ /g'` state=$[3]
699 AT_CHECK([ovs-ofctl -vwarn mod-port br0 br0 $command])
700 AT_CHECK([ovs-ofctl -vwarn show br0], [0], [stdout])
701 AT_CHECK_UNQUOTED([STRIP_XIDS stdout], [0], [dnl
702 OFPT_FEATURES_REPLY: dpid:fedcba9876543210
703 n_tables:254, n_buffers:256
704 capabilities: FLOW_STATS TABLE_STATS PORT_STATS QUEUE_STATS ARP_MATCH_IP
705 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
706 LOCAL(br0): addr:aa:55:aa:55:00:00
709 speed: 0 Mbps now, 0 Mbps max
710 OFPT_GET_CONFIG_REPLY: frags=normal miss_send_len=0
716 AT_SETUP([ofproto - mod-port (OpenFlow 1.2)])
718 for command_config_state in \
720 'down PORT_DOWN LINK_DOWN' \
721 'no-receive PORT_DOWN,NO_RECV LINK_DOWN' \
722 'no-forward PORT_DOWN,NO_RECV,NO_FWD LINK_DOWN' \
723 'no-packet-in PORT_DOWN,NO_RECV,NO_FWD,NO_PACKET_IN LINK_DOWN' \
724 'forward PORT_DOWN,NO_RECV,NO_PACKET_IN LINK_DOWN' \
725 'packet-in PORT_DOWN,NO_RECV LINK_DOWN' \
729 set $command_config_state
730 command=$[1] config=`echo $[2] | sed 's/,/ /g'` state=$[3]
731 AT_CHECK([ovs-ofctl -O OpenFlow12 -vwarn mod-port br0 br0 $command])
732 AT_CHECK([ovs-ofctl -O OpenFlow12 -vwarn show br0], [0], [stdout])
733 AT_CHECK_UNQUOTED([STRIP_XIDS stdout], [0], [dnl
734 OFPT_FEATURES_REPLY (OF1.2): dpid:fedcba9876543210
735 n_tables:254, n_buffers:256
736 capabilities: FLOW_STATS TABLE_STATS PORT_STATS GROUP_STATS QUEUE_STATS
737 LOCAL(br0): addr:aa:55:aa:55:00:00
740 speed: 0 Mbps now, 0 Mbps max
741 OFPT_GET_CONFIG_REPLY (OF1.2): frags=normal miss_send_len=0
747 AT_SETUP([ofproto - mod-port (OpenFlow 1.4)])
749 for command_config_state in \
751 'down PORT_DOWN LINK_DOWN' \
752 'no-receive PORT_DOWN,NO_RECV LINK_DOWN' \
753 'no-forward PORT_DOWN,NO_RECV,NO_FWD LINK_DOWN' \
754 'no-packet-in PORT_DOWN,NO_RECV,NO_FWD,NO_PACKET_IN LINK_DOWN' \
755 'forward PORT_DOWN,NO_RECV,NO_PACKET_IN LINK_DOWN' \
756 'packet-in PORT_DOWN,NO_RECV LINK_DOWN' \
760 set $command_config_state
761 command=$[1] config=`echo $[2] | sed 's/,/ /g'` state=$[3]
762 AT_CHECK([ovs-ofctl -O OpenFlow14 -vwarn mod-port br0 br0 $command])
763 AT_CHECK([ovs-ofctl -O OpenFlow14 -vwarn show br0], [0], [stdout])
764 AT_CHECK_UNQUOTED([STRIP_XIDS stdout], [0], [dnl
765 OFPT_FEATURES_REPLY (OF1.4): dpid:fedcba9876543210
766 n_tables:254, n_buffers:256
767 capabilities: FLOW_STATS TABLE_STATS PORT_STATS GROUP_STATS QUEUE_STATS
768 OFPST_PORT_DESC reply (OF1.4):
769 LOCAL(br0): addr:aa:55:aa:55:00:00
772 speed: 0 Mbps now, 0 Mbps max
773 OFPT_GET_CONFIG_REPLY (OF1.4): frags=normal miss_send_len=0
779 AT_SETUP([ofproto - basic flow_mod commands (NXM)])
781 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip], [0], [NXST_FLOW reply:
783 AT_CHECK([echo 'in_port=2,actions=1' | ovs-ofctl add-flows br0 -])
784 AT_CHECK([ovs-ofctl add-flow br0 in_port=1,actions=2])
785 AT_CHECK([ovs-ofctl -F nxm add-flow br0 table=1,in_port=4,actions=3])
786 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
787 in_port=1 actions=output:2
788 in_port=2 actions=output:1
789 table=1, in_port=4 actions=output:3
792 AT_CHECK([ovs-ofctl dump-aggregate br0 table=0 | STRIP_XIDS], [0], [dnl
793 NXST_AGGREGATE reply: packet_count=0 byte_count=0 flow_count=2
795 AT_CHECK([ovs-ofctl del-flows br0])
796 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip], [0], [NXST_FLOW reply:
801 AT_SETUP([ofproto - basic flow_mod commands (OpenFlow 1.0)])
803 AT_CHECK([ovs-ofctl -F openflow10 dump-flows br0 | ofctl_strip], [0], [OFPST_FLOW reply:
805 AT_CHECK([echo 'in_port=2,actions=1' | ovs-ofctl -F openflow10 add-flows br0 -])
806 AT_CHECK([ovs-ofctl -F openflow10 add-flow br0 in_port=1,actions=2])
807 AT_CHECK([ovs-ofctl -F openflow10 add-flow br0 table=1,in_port=4,actions=3])
808 AT_CHECK([ovs-ofctl -F openflow10 dump-flows br0 | ofctl_strip | sort], [0], [dnl
809 in_port=1 actions=output:2
810 in_port=2 actions=output:1
811 table=1, in_port=4 actions=output:3
814 AT_CHECK([ovs-ofctl -F openflow10 dump-aggregate br0 table=0 | STRIP_XIDS], [0], [dnl
815 OFPST_AGGREGATE reply: packet_count=0 byte_count=0 flow_count=2
817 AT_CHECK([ovs-ofctl -F openflow10 del-flows br0])
818 AT_CHECK([ovs-ofctl -F openflow10 dump-flows br0 | ofctl_strip], [0], [OFPST_FLOW reply:
823 AT_SETUP([ofproto - basic flow_mod commands (OpenFlow 1.1)])
825 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip], [0], [OFPST_FLOW reply (OF1.1):
827 AT_CHECK([echo 'in_port=2,actions=1' | ovs-ofctl -O OpenFlow11 add-flows br0 -])
828 AT_CHECK([ovs-ofctl -O OpenFlow11 add-flow br0 in_port=1,actions=2])
829 AT_CHECK([ovs-ofctl -O OpenFlow11 add-flow br0 table=1,in_port=4,actions=3])
830 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl
831 in_port=1 actions=output:2
832 in_port=2 actions=output:1
833 table=1, in_port=4 actions=output:3
834 OFPST_FLOW reply (OF1.1):
836 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-aggregate br0 table=0 | STRIP_XIDS], [0], [dnl
837 OFPST_AGGREGATE reply (OF1.1): packet_count=0 byte_count=0 flow_count=2
839 AT_CHECK([ovs-ofctl -O OpenFlow11 del-flows br0])
840 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip], [0], [OFPST_FLOW reply (OF1.1):
841 table=1, in_port=4 actions=output:3
846 AT_SETUP([ofproto - flow_mod negative test (OpenFlow 1.1)])
848 [set bridge br0 protocols=OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13])
849 AT_CHECK([ovs-ofctl add-flow -O OpenFlow11 br0 table=1,action=goto_table:2])
851 # The error message here actually comes from ovs-ofctl, not from ovs-vswitchd,
852 # but at least it's the same code in ofpacts_check() that issues the error.
853 AT_CHECK([ovs-ofctl add-flow -O OpenFlow11 br0 table=1,action=goto_table:1],
855 [ovs-ofctl: actions are invalid with specified match (OFPBIC_BAD_TABLE_ID)
860 AT_SETUP([ofproto - set-field flow_mod commands (NXM)])
862 AT_CHECK([ovs-ofctl add-flow br0 ipv6,table=1,in_port=3,actions=drop])
863 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])
864 AT_CHECK([ovs-ofctl add-flow br0 icmp6,icmp_type=136,table=1,in_port=3,actions=set_field:fe80:8675:3097:890a:a6ba:dbff:f00d:59fa-\>nd_target,set_field:cc:dd:ee:ff:00:11-\>nd_tll])
865 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
866 table=1, icmp6,in_port=3,icmp_type=136 actions=load:0xa6badbfff00d59fa->NXM_NX_ND_TARGET[[0..63]],load:0xfe8086753097890a->NXM_NX_ND_TARGET[[64..127]],load:0xccddeeff0011->NXM_NX_ND_TLL[[]]
867 table=1, ipv6,in_port=3 actions=load:0xa6badbfffefe59fa->NXM_NX_IPV6_SRC[[0..63]],load:0xfe8001234567890a->NXM_NX_IPV6_SRC[[64..127]]
873 AT_SETUP([ofproto - basic flow_mod commands (OpenFlow 1.2)])
875 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip], [0], [OFPST_FLOW reply (OF1.2):
877 AT_CHECK([echo 'in_port=2,actions=1' | ovs-ofctl -O OpenFlow12 add-flows br0 -])
878 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 in_port=1,actions=2])
879 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 table=1,in_port=4,actions=3])
880 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
881 in_port=1 actions=output:2
882 in_port=2 actions=output:1
883 table=1, in_port=4 actions=output:3
884 OFPST_FLOW reply (OF1.2):
886 AT_CHECK([ovs-ofctl -O OpenFlow12 del-flows br0])
887 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip], [0], [OFPST_FLOW reply (OF1.2):
892 AT_SETUP([ofproto - set-field flow_mod commands (OF1.2)])
894 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 ipv6,table=1,in_port=3,actions=drop])
895 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 ipv6,table=1,in_port=3,actions=set_field:fe80:0123:4567:890a:a6ba:dbff:fefe:59fa-\>ipv6_src])
896 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 icmp6,icmp_type=136,table=1,in_port=3,actions=set_field:fe80:8675:3097:890a:a6ba:dbff:f00d:59fa-\>nd_target,set_field:cc:dd:ee:ff:00:11-\>nd_tll])
897 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
898 table=1, icmp6,in_port=3,icmp_type=136 actions=set_field:fe80:8675:3097:890a:a6ba:dbff:f00d:59fa->nd_target,set_field:cc:dd:ee:ff:00:11->nd_tll
899 table=1, ipv6,in_port=3 actions=set_field:fe80:123:4567:890a:a6ba:dbff:fefe:59fa->ipv6_src
900 OFPST_FLOW reply (OF1.2):
905 AT_SETUP([ofproto - dump flows with cookie])
907 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x1,in_port=1,actions=1])
908 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x2,in_port=2,actions=1])
909 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x3,in_port=3,actions=1])
910 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
911 cookie=0x1, in_port=1 actions=output:1
912 cookie=0x2, in_port=2 actions=output:1
913 cookie=0x3, in_port=3 actions=output:1
916 AT_CHECK([ovs-ofctl dump-aggregate br0 table=0 | STRIP_XIDS], [0], [dnl
917 NXST_AGGREGATE reply: packet_count=0 byte_count=0 flow_count=3
919 AT_CHECK([ovs-ofctl dump-flows br0 cookie=0x3/-1 | ofctl_strip | sort], [0], [dnl
920 cookie=0x3, in_port=3 actions=output:1
923 AT_CHECK([ovs-ofctl dump-aggregate br0 cookie=0x3/-1 | STRIP_XIDS], [0], [dnl
924 NXST_AGGREGATE reply: packet_count=0 byte_count=0 flow_count=1
929 AT_SETUP([ofproto - mod flow with cookie change (OpenFlow 1.0)])
931 AT_CHECK([ovs-ofctl -F openflow10 add-flow br0 cookie=0x1,in_port=1,actions=1])
932 AT_CHECK([ovs-ofctl -F openflow10 dump-flows br0 | ofctl_strip | sort], [0], [dnl
933 cookie=0x1, in_port=1 actions=output:1
937 AT_CHECK([ovs-ofctl -F openflow10 mod-flows br0 cookie=0x2,in_port=1,actions=1])
938 AT_CHECK([ovs-ofctl -F openflow10 dump-flows br0 | ofctl_strip | sort], [0], [dnl
939 cookie=0x2, in_port=1 actions=output:1
945 AT_SETUP([ofproto - mod flow with cookie change (NXM)])
947 AT_CHECK([ovs-ofctl -F nxm add-flow br0 cookie=0x1,in_port=1,actions=1])
948 AT_CHECK([ovs-ofctl -F nxm dump-flows br0 | ofctl_strip | sort], [0], [dnl
949 cookie=0x1, in_port=1 actions=output:1
953 AT_CHECK([ovs-ofctl -F nxm mod-flows br0 cookie=0x2,in_port=1,actions=1])
954 AT_CHECK([ovs-ofctl -F nxm dump-flows br0 | ofctl_strip | sort], [0], [dnl
955 cookie=0x2, in_port=1 actions=output:1
961 AT_SETUP([ofproto - no mod flow with cookie change (OpenFlow 1.1)])
963 AT_CHECK([ovs-ofctl -O OpenFlow11 add-flow br0 cookie=0x1,in_port=1,actions=1])
964 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl
965 cookie=0x1, in_port=1 actions=output:1
966 OFPST_FLOW reply (OF1.1):
968 AT_CHECK([ovs-ofctl -O OpenFlow11 mod-flows br0 cookie=0x2,in_port=1,actions=1])
969 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl
970 cookie=0x1, in_port=1 actions=output:1
971 OFPST_FLOW reply (OF1.1):
976 dnl The OpenFlow 1.2 spec states that the cookie may not be modified
977 AT_SETUP([ofproto - no mod flow with cookie change (OpenFlow 1.2)])
979 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 cookie=0x1,in_port=1,actions=1])
980 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
981 cookie=0x1, in_port=1 actions=output:1
982 OFPST_FLOW reply (OF1.2):
985 AT_CHECK([ovs-ofctl -O OpenFlow12 mod-flows br0 cookie=0x2,in_port=1,actions=1])
986 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
987 cookie=0x1, in_port=1 actions=output:1
988 OFPST_FLOW reply (OF1.2):
993 AT_SETUP([ofproto - mod flows based on cookie mask (OpenFlow 1.0)])
995 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x1,in_port=1,actions=1])
996 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x1,in_port=2,actions=1])
997 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x2,in_port=3,actions=1])
998 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
999 cookie=0x1, in_port=1 actions=output:1
1000 cookie=0x1, in_port=2 actions=output:1
1001 cookie=0x2, in_port=3 actions=output:1
1005 AT_CHECK([ovs-ofctl -F nxm mod-flows br0 cookie=0x1/0xff,actions=4])
1006 AT_CHECK([ovs-ofctl -F nxm dump-flows br0 | ofctl_strip | sort], [0], [dnl
1007 cookie=0x1, in_port=1 actions=output:4
1008 cookie=0x1, in_port=2 actions=output:4
1009 cookie=0x2, in_port=3 actions=output:1
1015 AT_SETUP([ofproto - mod flows based on cookie mask (OpenFlow 1.1)])
1017 AT_CHECK([ovs-ofctl -O OpenFlow11 add-flow br0 cookie=0x1,in_port=1,actions=1])
1018 AT_CHECK([ovs-ofctl -O OpenFlow11 add-flow br0 cookie=0x1,in_port=2,actions=1])
1019 AT_CHECK([ovs-ofctl -O OpenFlow11 add-flow br0 cookie=0x2,in_port=3,actions=1])
1020 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1021 cookie=0x1, in_port=1 actions=output:1
1022 cookie=0x1, in_port=2 actions=output:1
1023 cookie=0x2, in_port=3 actions=output:1
1024 OFPST_FLOW reply (OF1.1):
1027 AT_CHECK([ovs-ofctl -O OpenFlow11 mod-flows br0 cookie=0x1/0xff,actions=4])
1028 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1029 cookie=0x1, in_port=1 actions=output:4
1030 cookie=0x1, in_port=2 actions=output:4
1031 cookie=0x2, in_port=3 actions=output:1
1032 OFPST_FLOW reply (OF1.1):
1037 AT_SETUP([ofproto - mod flows based on cookie mask (OpenFlow 1.2)])
1039 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 cookie=0x1,in_port=1,actions=1])
1040 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 cookie=0x1,in_port=2,actions=1])
1041 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 cookie=0x2,in_port=3,actions=1])
1042 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1043 cookie=0x1, in_port=1 actions=output:1
1044 cookie=0x1, in_port=2 actions=output:1
1045 cookie=0x2, in_port=3 actions=output:1
1046 OFPST_FLOW reply (OF1.2):
1049 AT_CHECK([ovs-ofctl -O OpenFlow12 mod-flows br0 cookie=0x1/0xff,actions=4])
1050 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1051 cookie=0x1, in_port=1 actions=output:4
1052 cookie=0x1, in_port=2 actions=output:4
1053 cookie=0x2, in_port=3 actions=output:1
1054 OFPST_FLOW reply (OF1.2):
1059 dnl The OpenFlow 1.2 spec states that the cookie may not be modified
1060 AT_SETUP([ofproto - mod flows based on cookie mask with cookie change])
1062 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x1,in_port=1,actions=1])
1063 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x1,in_port=2,actions=1])
1064 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x2,in_port=3,actions=1])
1065 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1066 cookie=0x1, in_port=1 actions=output:1
1067 cookie=0x1, in_port=2 actions=output:1
1068 cookie=0x2, in_port=3 actions=output:1
1072 AT_CHECK([ovs-ofctl -F nxm mod-flows br0 cookie=1/-1,cookie=4,actions=4])
1073 AT_CHECK([ovs-ofctl -F nxm dump-flows br0 | ofctl_strip | sort], [0], [dnl
1074 cookie=0x2, in_port=3 actions=output:1
1075 cookie=0x4, in_port=1 actions=output:4
1076 cookie=0x4, in_port=2 actions=output:4
1082 AT_SETUP([ofproto - mod flow with cookie miss (mask==0) - NXM])
1084 AT_CHECK([ovs-ofctl -F nxm mod-flows br0 in_port=1,actions=1])
1085 AT_CHECK([ovs-ofctl -F nxm dump-flows br0 | ofctl_strip | sort], [0], [dnl
1086 in_port=1 actions=output:1
1092 AT_SETUP([ofproto - mod flow with cookie miss (mask==0) - OF1.1])
1094 AT_CHECK([ovs-ofctl -O openflow11 mod-flows br0 in_port=1,actions=1])
1095 AT_CHECK([ovs-ofctl -O openflow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1096 in_port=1 actions=output:1
1097 OFPST_FLOW reply (OF1.1):
1102 AT_SETUP([ofproto - mod flow with cookie miss (mask==0) - OF1.2])
1104 AT_CHECK([ovs-ofctl -O openflow12 mod-flows br0 in_port=1,actions=1])
1105 AT_CHECK([ovs-ofctl -O openflow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1106 OFPST_FLOW reply (OF1.2):
1111 AT_SETUP([ofproto - mod flow with cookie miss (mask!=0) - NXM])
1113 AT_CHECK([ovs-ofctl -F nxm mod-flows br0 cookie=1/1,in_port=1,actions=1])
1114 AT_CHECK([ovs-ofctl -F nxm dump-flows br0 | ofctl_strip | sort], [0], [dnl
1120 AT_SETUP([ofproto - mod flow with cookie miss (mask!=0) - OF1.1])
1122 AT_CHECK([ovs-ofctl -O openflow11 mod-flows br0 cookie=1/1,in_port=1,actions=1])
1123 AT_CHECK([ovs-ofctl -O openflow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1124 OFPST_FLOW reply (OF1.1):
1129 AT_SETUP([ofproto - mod flow with cookie miss (mask!=0) - OF1.2])
1131 AT_CHECK([ovs-ofctl -O openflow12 mod-flows br0 cookie=1/1,in_port=1,actions=1])
1132 AT_CHECK([ovs-ofctl -O openflow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1133 OFPST_FLOW reply (OF1.2):
1138 AT_SETUP([ofproto - del flows with cookies])
1140 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x1,in_port=1,actions=1])
1141 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x2,in_port=2,actions=1])
1142 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x3,in_port=3,actions=1])
1143 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1144 cookie=0x1, in_port=1 actions=output:1
1145 cookie=0x2, in_port=2 actions=output:1
1146 cookie=0x3, in_port=3 actions=output:1
1150 AT_CHECK([ovs-ofctl del-flows br0])
1151 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1157 AT_SETUP([ofproto - del flows based on cookie])
1159 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x1,in_port=1,actions=1])
1160 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x2,in_port=2,actions=1])
1161 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x3,in_port=3,actions=1])
1162 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1163 cookie=0x1, in_port=1 actions=output:1
1164 cookie=0x2, in_port=2 actions=output:1
1165 cookie=0x3, in_port=3 actions=output:1
1169 AT_CHECK([ovs-ofctl del-flows br0 cookie=0x3/-1])
1170 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1171 cookie=0x1, in_port=1 actions=output:1
1172 cookie=0x2, in_port=2 actions=output:1
1178 AT_SETUP([ofproto - del flows based on cookie mask])
1180 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x1,in_port=1,actions=1])
1181 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x2,in_port=2,actions=1])
1182 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x3,in_port=3,actions=1])
1183 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1184 cookie=0x1, in_port=1 actions=output:1
1185 cookie=0x2, in_port=2 actions=output:1
1186 cookie=0x3, in_port=3 actions=output:1
1189 AT_CHECK([ovs-ofctl del-flows br0 cookie=0x3/0x1])
1190 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1191 cookie=0x2, in_port=2 actions=output:1
1197 AT_SETUP([ofproto - del flows based on table id (NXM)])
1199 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x1,in_port=1,actions=1])
1200 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x2,in_port=2,table=1,actions=1])
1201 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1202 cookie=0x1, in_port=1 actions=output:1
1203 cookie=0x2, table=1, in_port=2 actions=output:1
1206 AT_CHECK([ovs-ofctl del-flows br0 table=0])
1207 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1208 cookie=0x2, table=1, in_port=2 actions=output:1
1211 AT_CHECK([ovs-ofctl del-flows br0 table=1])
1212 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1215 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x1,in_port=1,actions=1])
1216 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x2,in_port=2,table=1,actions=1])
1217 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1218 cookie=0x1, in_port=1 actions=output:1
1219 cookie=0x2, table=1, in_port=2 actions=output:1
1222 AT_CHECK([ovs-ofctl del-flows br0])
1223 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1229 AT_SETUP([ofproto - del flows based on table id (OpenFlow 1.1)])
1231 AT_CHECK([ovs-ofctl -O OpenFlow11 add-flow br0 cookie=0x1,in_port=1,actions=1])
1232 AT_CHECK([ovs-ofctl -O OpenFlow11 add-flow br0 cookie=0x2,in_port=2,table=1,actions=1])
1233 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1234 cookie=0x1, in_port=1 actions=output:1
1235 cookie=0x2, table=1, in_port=2 actions=output:1
1236 OFPST_FLOW reply (OF1.1):
1238 AT_CHECK([ovs-ofctl -O OpenFlow11 del-flows br0 table=0])
1239 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1240 cookie=0x2, table=1, in_port=2 actions=output:1
1241 OFPST_FLOW reply (OF1.1):
1243 AT_CHECK([ovs-ofctl -O OpenFlow11 del-flows br0 table=1])
1244 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1245 OFPST_FLOW reply (OF1.1):
1247 AT_CHECK([ovs-ofctl -O OpenFlow11 add-flow br0 cookie=0x1,in_port=1,actions=1])
1248 AT_CHECK([ovs-ofctl -O OpenFlow11 add-flow br0 cookie=0x2,in_port=2,table=1,actions=1])
1249 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1250 cookie=0x1, in_port=1 actions=output:1
1251 cookie=0x2, table=1, in_port=2 actions=output:1
1252 OFPST_FLOW reply (OF1.1):
1254 AT_CHECK([ovs-ofctl -O OpenFlow11 del-flows br0])
1255 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip], [0], [dnl
1256 OFPST_FLOW reply (OF1.1):
1257 cookie=0x2, table=1, in_port=2 actions=output:1
1262 AT_SETUP([ofproto - del flows based on table id (OpenFlow 1.2)])
1264 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 cookie=0x1,in_port=1,actions=1])
1265 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 cookie=0x2,in_port=2,table=1,actions=1])
1266 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1267 cookie=0x1, in_port=1 actions=output:1
1268 cookie=0x2, table=1, in_port=2 actions=output:1
1269 OFPST_FLOW reply (OF1.2):
1271 AT_CHECK([ovs-ofctl -O OpenFlow12 del-flows br0 table=0])
1272 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1273 cookie=0x2, table=1, in_port=2 actions=output:1
1274 OFPST_FLOW reply (OF1.2):
1276 AT_CHECK([ovs-ofctl -O OpenFlow12 del-flows br0 table=1])
1277 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1278 OFPST_FLOW reply (OF1.2):
1280 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 cookie=0x1,in_port=1,actions=1])
1281 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 cookie=0x2,in_port=2,table=1,actions=1])
1282 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1283 cookie=0x1, in_port=1 actions=output:1
1284 cookie=0x2, table=1, in_port=2 actions=output:1
1285 OFPST_FLOW reply (OF1.2):
1287 AT_CHECK([ovs-ofctl -O OpenFlow12 del-flows br0])
1288 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1289 OFPST_FLOW reply (OF1.2):
1294 AT_SETUP([ofproto - flow table configuration (OpenFlow 1.0)])
1296 # Check the default configuration.
1297 (printf "OFPST_TABLE reply (xid=0x2):"
1300 while test $x -lt 254; do
1303 active=0, lookup=0, matched=0
1306 in_port: exact match or wildcard
1307 eth_src: exact match or wildcard
1308 eth_dst: exact match or wildcard
1309 eth_type: exact match or wildcard
1310 vlan_vid: exact match or wildcard
1311 vlan_pcp: exact match or wildcard
1312 ip_src: exact match or wildcard
1313 ip_dst: exact match or wildcard
1314 nw_proto: exact match or wildcard
1315 nw_tos: exact match or wildcard
1316 tcp_src: exact match or wildcard
1317 tcp_dst: exact match or wildcard
1322 AT_CHECK([ovs-ofctl dump-tables br0], [0], [expout])
1323 # Change the configuration.
1326 -- --id=@t0 create Flow_Table name=main \
1327 -- --id=@t1 create Flow_Table flow-limit=1024 \
1328 -- set bridge br0 'flow_tables={1=@t1,0=@t0}' \
1329 | ${PERL} $srcdir/uuidfilt.pl],
1333 # Check that the configuration was updated.
1334 mv expout orig-expout
1335 sed -e 's/classifier/main/
1336 21s/1000000/1024/' orig-expout > expout
1337 AT_CHECK([ovs-ofctl dump-tables br0], [0], [expout])
1341 dnl In-band and fail-open add "hidden rules" to table 0. These rules shouldn't
1342 dnl be visible to OpenFlow. This test checks that "dump-flows" and
1343 dnl "dump-tables" don't make them visible.
1344 AT_SETUP([ofproto - hidden rules not in table stats])
1345 # Use an IP address for a controller that won't actually exist: we
1346 # want to create in-band rules but we do not want to actually connect
1347 # to a controller (because that could mess about with our test). The
1348 # Class E range 240.0.0.0 - 255.255.255.255 seems like a good choice.
1349 OVS_VSWITCHD_START([set-controller br0 tcp:240.0.0.1:6653])
1350 for i in 1 2 3 4 5; do ovs-appctl time/warp 1000; done
1352 # Check that no hidden flows are visible in OpenFlow.
1353 AT_CHECK([ovs-ofctl dump-flows br0], [0], [NXST_FLOW reply (xid=0x4):
1356 # Check that some hidden flows related to 240.0.0.1 are actually in table 0.
1358 # We discard flows that mention table_id because we only want table 0 flows,
1359 # which in OVS is implied by the absence of a table_id.
1360 AT_CHECK([ovs-appctl bridge/dump-flows br0], [0], [stdout])
1361 AT_CHECK([test `grep '240\.0\.0\.1' stdout | grep -v table_id= | wc -l` -gt 0])
1363 # Check that dump-tables doesn't count the hidden flows.
1364 (printf "OFPST_TABLE reply (xid=0x2):"
1367 while test $x -lt 254; do
1370 active=0, lookup=0, matched=0
1373 in_port: exact match or wildcard
1374 eth_src: exact match or wildcard
1375 eth_dst: exact match or wildcard
1376 eth_type: exact match or wildcard
1377 vlan_vid: exact match or wildcard
1378 vlan_pcp: exact match or wildcard
1379 ip_src: exact match or wildcard
1380 ip_dst: exact match or wildcard
1381 nw_proto: exact match or wildcard
1382 nw_tos: exact match or wildcard
1383 tcp_src: exact match or wildcard
1384 tcp_dst: exact match or wildcard
1389 AT_CHECK([ovs-ofctl dump-tables br0], [0], [expout])
1390 OVS_VSWITCHD_STOP(["/cannot find route for controller/d"])
1393 AT_SETUP([ofproto - flow table configuration (OpenFlow 1.2)])
1395 # Check the default configuration.
1396 (printf "OFPST_TABLE reply (OF1.2) (xid=0x2):"
1399 while test $x -lt 254; do
1400 if test $x = 253; then
1406 table $x (\"$name\"):
1407 active=0, lookup=0, matched=0
1408 metadata: match=0xffffffffffffffff write=0xffffffffffffffff
1411 instructions (table miss and others):
1412 instructions: apply_actions,clear_actions,write_actions,write_metadata$goto
1413 Write-Actions and Apply-Actions features:
1414 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
1415 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 ipv6_label 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 nd_target nd_sll nd_tll
1417 metadata: exact match or wildcard
1418 in_port_oxm: exact match or wildcard
1419 eth_src: exact match or wildcard
1420 eth_dst: exact match or wildcard
1421 eth_type: exact match or wildcard
1422 vlan_vid: exact match or wildcard
1423 vlan_pcp: exact match or wildcard
1424 mpls_label: exact match or wildcard
1425 mpls_tc: exact match or wildcard
1426 ip_src: exact match or wildcard
1427 ip_dst: exact match or wildcard
1428 ipv6_src: exact match or wildcard
1429 ipv6_dst: exact match or wildcard
1430 ipv6_label: exact match or wildcard
1431 nw_proto: exact match or wildcard
1432 ip_dscp: exact match or wildcard
1433 nw_ecn: exact match or wildcard
1434 arp_op: exact match or wildcard
1435 arp_spa: exact match or wildcard
1436 arp_tpa: exact match or wildcard
1437 arp_sha: exact match or wildcard
1438 arp_tha: exact match or wildcard
1439 tcp_src: exact match or wildcard
1440 tcp_dst: exact match or wildcard
1441 udp_src: exact match or wildcard
1442 udp_dst: exact match or wildcard
1443 sctp_src: exact match or wildcard
1444 sctp_dst: exact match or wildcard
1445 icmp_type: exact match or wildcard
1446 icmp_code: exact match or wildcard
1447 icmpv6_type: exact match or wildcard
1448 icmpv6_code: exact match or wildcard
1449 nd_target: exact match or wildcard
1450 nd_sll: exact match or wildcard
1451 nd_tll: exact match or wildcard"
1455 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-tables br0], [0], [expout])
1456 # Change the configuration.
1459 -- --id=@t0 create Flow_Table name=main \
1460 -- --id=@t1 create Flow_Table flow-limit=1024 \
1461 -- set bridge br0 'flow_tables={1=@t1,0=@t0}' \
1462 | ${PERL} $srcdir/uuidfilt.pl],
1466 # Check that the configuration was updated.
1467 mv expout orig-expout
1468 sed 's/classifier/main/
1469 53s/1000000/1024/' < orig-expout > expout
1470 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-tables br0], [0], [expout])
1474 AT_SETUP([ofproto - table features (OpenFlow 1.3)])
1478 while test $x -lt 254; do
1480 if test $x = 253; then
1485 if test $x = 252; then
1490 next tables: $y-253"
1493 echo " table $x (\"$name\"):
1494 metadata: match=0xffffffffffffffff write=0xffffffffffffffff
1496 instructions (table miss and others):$next
1497 instructions: meter,apply_actions,clear_actions,write_actions,write_metadata$goto
1498 Write-Actions and Apply-Actions features:
1499 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
1500 supported on Set-Field: tun_id tun_src tun_dst tun_gbp_id tun_gbp_flags tun_metadata0 tun_metadata1 tun_metadata2 tun_metadata3 tun_metadata4 tun_metadata5 tun_metadata6 tun_metadata7 tun_metadata8 tun_metadata9 tun_metadata10 tun_metadata11 tun_metadata12 tun_metadata13 tun_metadata14 tun_metadata15 tun_metadata16 tun_metadata17 tun_metadata18 tun_metadata19 tun_metadata20 tun_metadata21 tun_metadata22 tun_metadata23 tun_metadata24 tun_metadata25 tun_metadata26 tun_metadata27 tun_metadata28 tun_metadata29 tun_metadata30 tun_metadata31 tun_metadata32 tun_metadata33 tun_metadata34 tun_metadata35 tun_metadata36 tun_metadata37 tun_metadata38 tun_metadata39 tun_metadata40 tun_metadata41 tun_metadata42 tun_metadata43 tun_metadata44 tun_metadata45 tun_metadata46 tun_metadata47 tun_metadata48 tun_metadata49 tun_metadata50 tun_metadata51 tun_metadata52 tun_metadata53 tun_metadata54 tun_metadata55 tun_metadata56 tun_metadata57 tun_metadata58 tun_metadata59 tun_metadata60 tun_metadata61 tun_metadata62 tun_metadata63 metadata in_port in_port_oxm pkt_mark reg0 reg1 reg2 reg3 reg4 reg5 reg6 reg7 xreg0 xreg1 xreg2 xreg3 eth_src eth_dst vlan_tci vlan_vid vlan_pcp mpls_label mpls_tc ip_src ip_dst ipv6_src ipv6_dst ipv6_label nw_tos ip_dscp nw_ecn nw_ttl arp_op arp_spa arp_tpa arp_sha arp_tha tcp_src tcp_dst udp_src udp_dst sctp_src sctp_dst nd_target nd_sll nd_tll
1502 dp_hash: arbitrary mask
1503 recirc_id: exact match or wildcard
1504 conj_id: exact match or wildcard
1505 tun_id: arbitrary mask
1506 tun_src: arbitrary mask
1507 tun_dst: arbitrary mask
1508 tun_gbp_id: arbitrary mask
1509 tun_gbp_flags: arbitrary mask
1510 tun_metadata0: arbitrary mask
1511 tun_metadata1: arbitrary mask
1512 tun_metadata2: arbitrary mask
1513 tun_metadata3: arbitrary mask
1514 tun_metadata4: arbitrary mask
1515 tun_metadata5: arbitrary mask
1516 tun_metadata6: arbitrary mask
1517 tun_metadata7: arbitrary mask
1518 tun_metadata8: arbitrary mask
1519 tun_metadata9: arbitrary mask
1520 tun_metadata10: arbitrary mask
1521 tun_metadata11: arbitrary mask
1522 tun_metadata12: arbitrary mask
1523 tun_metadata13: arbitrary mask
1524 tun_metadata14: arbitrary mask
1525 tun_metadata15: arbitrary mask
1526 tun_metadata16: arbitrary mask
1527 tun_metadata17: arbitrary mask
1528 tun_metadata18: arbitrary mask
1529 tun_metadata19: arbitrary mask
1530 tun_metadata20: arbitrary mask
1531 tun_metadata21: arbitrary mask
1532 tun_metadata22: arbitrary mask
1533 tun_metadata23: arbitrary mask
1534 tun_metadata24: arbitrary mask
1535 tun_metadata25: arbitrary mask
1536 tun_metadata26: arbitrary mask
1537 tun_metadata27: arbitrary mask
1538 tun_metadata28: arbitrary mask
1539 tun_metadata29: arbitrary mask
1540 tun_metadata30: arbitrary mask
1541 tun_metadata31: arbitrary mask
1542 tun_metadata32: arbitrary mask
1543 tun_metadata33: arbitrary mask
1544 tun_metadata34: arbitrary mask
1545 tun_metadata35: arbitrary mask
1546 tun_metadata36: arbitrary mask
1547 tun_metadata37: arbitrary mask
1548 tun_metadata38: arbitrary mask
1549 tun_metadata39: arbitrary mask
1550 tun_metadata40: arbitrary mask
1551 tun_metadata41: arbitrary mask
1552 tun_metadata42: arbitrary mask
1553 tun_metadata43: arbitrary mask
1554 tun_metadata44: arbitrary mask
1555 tun_metadata45: arbitrary mask
1556 tun_metadata46: arbitrary mask
1557 tun_metadata47: arbitrary mask
1558 tun_metadata48: arbitrary mask
1559 tun_metadata49: arbitrary mask
1560 tun_metadata50: arbitrary mask
1561 tun_metadata51: arbitrary mask
1562 tun_metadata52: arbitrary mask
1563 tun_metadata53: arbitrary mask
1564 tun_metadata54: arbitrary mask
1565 tun_metadata55: arbitrary mask
1566 tun_metadata56: arbitrary mask
1567 tun_metadata57: arbitrary mask
1568 tun_metadata58: arbitrary mask
1569 tun_metadata59: arbitrary mask
1570 tun_metadata60: arbitrary mask
1571 tun_metadata61: arbitrary mask
1572 tun_metadata62: arbitrary mask
1573 tun_metadata63: arbitrary mask
1574 metadata: arbitrary mask
1575 in_port: exact match or wildcard
1576 in_port_oxm: exact match or wildcard
1577 actset_output: exact match or wildcard
1578 pkt_mark: arbitrary mask
1579 reg0: arbitrary mask
1580 reg1: arbitrary mask
1581 reg2: arbitrary mask
1582 reg3: arbitrary mask
1583 reg4: arbitrary mask
1584 reg5: arbitrary mask
1585 reg6: arbitrary mask
1586 reg7: arbitrary mask
1587 xreg0: arbitrary mask
1588 xreg1: arbitrary mask
1589 xreg2: arbitrary mask
1590 xreg3: arbitrary mask
1591 eth_src: arbitrary mask
1592 eth_dst: arbitrary mask
1593 eth_type: exact match or wildcard
1594 vlan_tci: arbitrary mask
1595 vlan_vid: arbitrary mask
1596 vlan_pcp: exact match or wildcard
1597 mpls_label: exact match or wildcard
1598 mpls_tc: exact match or wildcard
1599 mpls_bos: exact match or wildcard
1600 ip_src: arbitrary mask
1601 ip_dst: arbitrary mask
1602 ipv6_src: arbitrary mask
1603 ipv6_dst: arbitrary mask
1604 ipv6_label: arbitrary mask
1605 nw_proto: exact match or wildcard
1606 nw_tos: exact match or wildcard
1607 ip_dscp: exact match or wildcard
1608 nw_ecn: exact match or wildcard
1609 nw_ttl: exact match or wildcard
1610 ip_frag: arbitrary mask
1611 arp_op: exact match or wildcard
1612 arp_spa: arbitrary mask
1613 arp_tpa: arbitrary mask
1614 arp_sha: arbitrary mask
1615 arp_tha: arbitrary mask
1616 tcp_src: arbitrary mask
1617 tcp_dst: arbitrary mask
1618 tcp_flags: arbitrary mask
1619 udp_src: arbitrary mask
1620 udp_dst: arbitrary mask
1621 sctp_src: arbitrary mask
1622 sctp_dst: arbitrary mask
1623 icmp_type: exact match or wildcard
1624 icmp_code: exact match or wildcard
1625 icmpv6_type: exact match or wildcard
1626 icmpv6_code: exact match or wildcard
1627 nd_target: arbitrary mask
1628 nd_sll: arbitrary mask
1629 nd_tll: arbitrary mask"
1633 AT_CHECK([ovs-ofctl -O OpenFlow13 dump-table-features br0 | sed '/^$/d
1634 /^OFPST_TABLE_FEATURES/d'], [0], [expout])
1635 # Change the configuration.
1638 -- --id=@t0 create Flow_Table name=main \
1639 -- --id=@t1 create Flow_Table flow-limit=1024 \
1640 -- set bridge br0 'flow_tables={1=@t1,0=@t0}' \
1641 | ${PERL} $srcdir/uuidfilt.pl],
1645 # Check that the configuration was updated.
1646 mv expout orig-expout
1647 sed 's/classifier/main/
1648 141s/1000000/1024/' < orig-expout > expout
1649 AT_CHECK([ovs-ofctl -O OpenFlow13 dump-table-features br0 | sed '/^$/d
1650 /^OFPST_TABLE_FEATURES/d'], [0], [expout])
1654 AT_SETUP([ofproto - hard limits on flow table size (OpenFlow 1.0)])
1656 # Configure a maximum of 4 flows.
1659 -- --id=@t0 create Flow_Table flow-limit=4 \
1660 -- set bridge br0 flow_tables:0=@t0 \
1661 | ${PERL} $srcdir/uuidfilt.pl],
1665 for in_port in 1 2 3 4; do
1666 ovs-ofctl add-flow br0 in_port=$in_port,actions=drop
1668 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1669 in_port=1 actions=drop
1670 in_port=2 actions=drop
1671 in_port=3 actions=drop
1672 in_port=4 actions=drop
1675 # Adding another flow will be refused.
1676 AT_CHECK([ovs-ofctl add-flow br0 in_port=5,actions=drop], [1], [], [stderr])
1677 AT_CHECK([head -n 1 stderr | ofctl_strip], [0],
1678 [OFPT_ERROR: OFPFMFC_TABLE_FULL
1680 # Also a mod-flow that would add a flow will be refused.
1681 AT_CHECK([ovs-ofctl mod-flows br0 in_port=5,actions=drop], [1], [], [stderr])
1682 AT_CHECK([head -n 1 stderr | ofctl_strip], [0],
1683 [OFPT_ERROR: OFPFMFC_TABLE_FULL
1685 # Replacing or modifying an existing flow is allowed.
1686 AT_CHECK([ovs-ofctl add-flow br0 in_port=4,actions=normal])
1687 AT_CHECK([ovs-ofctl mod-flows br0 in_port=3,actions=output:1])
1688 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1689 in_port=1 actions=drop
1690 in_port=2 actions=drop
1691 in_port=3 actions=output:1
1692 in_port=4 actions=NORMAL
1698 AT_SETUP([ofproto - hard limits on flow table size (OpenFlow 1.2)])
1700 # Configure a maximum of 4 flows.
1703 -- --id=@t0 create Flow_Table flow-limit=4 \
1704 -- set bridge br0 flow_tables:0=@t0 \
1705 | ${PERL} $srcdir/uuidfilt.pl],
1709 for in_port in 1 2 3 4; do
1710 ovs-ofctl -O OpenFlow12 add-flow br0 in_port=$in_port,actions=drop
1712 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1713 in_port=1 actions=drop
1714 in_port=2 actions=drop
1715 in_port=3 actions=drop
1716 in_port=4 actions=drop
1717 OFPST_FLOW reply (OF1.2):
1719 # Adding another flow will be refused.
1720 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 in_port=5,actions=drop], [1], [], [stderr])
1721 AT_CHECK([head -n 1 stderr | ofctl_strip], [0],
1722 [OFPT_ERROR (OF1.2): OFPFMFC_TABLE_FULL
1724 # Replacing or modifying an existing flow is allowed.
1725 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 in_port=4,actions=normal])
1726 AT_CHECK([ovs-ofctl -O OpenFlow12 mod-flows br0 in_port=3,actions=output:1])
1727 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1728 in_port=1 actions=drop
1729 in_port=2 actions=drop
1730 in_port=3 actions=output:1
1731 in_port=4 actions=NORMAL
1732 OFPST_FLOW reply (OF1.2):
1737 AT_SETUP([ofproto - eviction upon table overflow (OpenFlow 1.0)])
1739 # Configure a maximum of 4 flows.
1742 -- --id=@t0 create Flow_Table flow-limit=4 overflow-policy=evict \
1743 -- set bridge br0 flow_tables:0=@t0 \
1744 | ${PERL} $srcdir/uuidfilt.pl],
1748 for in_port in 4 3 2 1; do
1749 ovs-ofctl add-flow br0 idle_timeout=${in_port}0,in_port=$in_port,actions=drop
1751 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1752 idle_timeout=10, in_port=1 actions=drop
1753 idle_timeout=20, in_port=2 actions=drop
1754 idle_timeout=30, in_port=3 actions=drop
1755 idle_timeout=40, in_port=4 actions=drop
1758 # Adding another flow will cause the one that expires soonest to be evicted.
1759 AT_CHECK([ovs-ofctl add-flow br0 in_port=5,actions=drop])
1760 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1761 idle_timeout=20, in_port=2 actions=drop
1762 idle_timeout=30, in_port=3 actions=drop
1763 idle_timeout=40, in_port=4 actions=drop
1764 in_port=5 actions=drop
1767 # A mod-flow that adds a flow also causes eviction, but replacing or
1768 # modifying an existing flow doesn't.
1769 AT_CHECK([ovs-ofctl mod-flows br0 in_port=6,actions=drop])
1770 AT_CHECK([ovs-ofctl add-flow br0 in_port=4,actions=normal])
1771 AT_CHECK([ovs-ofctl mod-flows br0 in_port=3,actions=output:1])
1772 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1773 idle_timeout=30, in_port=3 actions=output:1
1774 in_port=4 actions=NORMAL
1775 in_port=5 actions=drop
1776 in_port=6 actions=drop
1779 # Flows with no timeouts at all cannot be evicted.
1780 AT_CHECK([ovs-ofctl add-flow br0 in_port=7,actions=normal])
1781 AT_CHECK([ovs-ofctl add-flow br0 in_port=8,actions=drop], [1], [], [stderr])
1782 AT_CHECK([head -n 1 stderr | ofctl_strip], [0],
1783 [OFPT_ERROR: OFPFMFC_TABLE_FULL
1785 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1786 in_port=4 actions=NORMAL
1787 in_port=5 actions=drop
1788 in_port=6 actions=drop
1789 in_port=7 actions=NORMAL
1795 AT_SETUP([ofproto - eviction upon table overflow (OpenFlow 1.2)])
1797 # Configure a maximum of 4 flows.
1800 -- --id=@t0 create Flow_Table flow-limit=4 overflow-policy=evict \
1801 -- set bridge br0 flow_tables:0=@t0 \
1802 | ${PERL} $srcdir/uuidfilt.pl],
1806 for in_port in 4 3 2 1; do
1807 ovs-ofctl -O OpenFlow12 add-flow br0 idle_timeout=${in_port}0,in_port=$in_port,actions=drop
1809 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1810 idle_timeout=10, in_port=1 actions=drop
1811 idle_timeout=20, in_port=2 actions=drop
1812 idle_timeout=30, in_port=3 actions=drop
1813 idle_timeout=40, in_port=4 actions=drop
1814 OFPST_FLOW reply (OF1.2):
1816 # Adding another flow will cause the one that expires soonest to be evicted.
1817 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 in_port=5,actions=drop])
1818 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1819 idle_timeout=20, in_port=2 actions=drop
1820 idle_timeout=30, in_port=3 actions=drop
1821 idle_timeout=40, in_port=4 actions=drop
1822 in_port=5 actions=drop
1823 OFPST_FLOW reply (OF1.2):
1825 # In OpenFlow 1.2 a mod-flow does not ever add a flow and thus
1826 # has no effect on eviction
1827 AT_CHECK([ovs-ofctl -O OpenFlow12 mod-flows br0 in_port=6,actions=drop])
1828 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 in_port=4,actions=normal])
1829 AT_CHECK([ovs-ofctl -O OpenFlow12 mod-flows br0 in_port=3,actions=output:1])
1830 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1831 idle_timeout=20, in_port=2 actions=drop
1832 idle_timeout=30, in_port=3 actions=output:1
1833 in_port=4 actions=NORMAL
1834 in_port=5 actions=drop
1835 OFPST_FLOW reply (OF1.2):
1837 # Flows with no timeouts at all cannot be evicted.
1838 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 in_port=6,actions=drop])
1839 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 in_port=7,actions=normal])
1840 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 in_port=8,actions=drop], [1], [], [stderr])
1841 AT_CHECK([head -n 1 stderr | ofctl_strip], [0],
1842 [OFPT_ERROR (OF1.2): OFPFMFC_TABLE_FULL
1844 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1845 in_port=4 actions=NORMAL
1846 in_port=5 actions=drop
1847 in_port=6 actions=drop
1848 in_port=7 actions=NORMAL
1849 OFPST_FLOW reply (OF1.2):
1854 AT_SETUP([ofproto - eviction upon table overflow, with fairness (OpenFlow 1.0)])
1856 # Configure a maximum of 4 flows.
1859 -- --id=@t0 create Flow_Table name=evict flow-limit=4 \
1860 overflow-policy=evict \
1861 groups='"NXM_OF_IN_PORT[[]]"' \
1862 -- set bridge br0 flow_tables:0=@t0 \
1863 | ${PERL} $srcdir/uuidfilt.pl],
1867 ovs-ofctl add-flows br0 - <<EOF
1868 idle_timeout=10 in_port=2 dl_src=00:44:55:66:77:88 actions=drop
1869 idle_timeout=20 in_port=1 dl_src=00:11:22:33:44:55 actions=drop
1870 idle_timeout=30 in_port=1 dl_src=00:22:33:44:55:66 actions=drop
1871 idle_timeout=40 in_port=1 dl_src=00:33:44:55:66:77 actions=drop
1873 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1874 idle_timeout=10, in_port=2,dl_src=00:44:55:66:77:88 actions=drop
1875 idle_timeout=20, in_port=1,dl_src=00:11:22:33:44:55 actions=drop
1876 idle_timeout=30, in_port=1,dl_src=00:22:33:44:55:66 actions=drop
1877 idle_timeout=40, in_port=1,dl_src=00:33:44:55:66:77 actions=drop
1880 # Adding another flow will cause the one that expires soonest within
1881 # the largest group (those with in_port=1) to be evicted. In this
1882 # case this is not the same as the one that expires soonest overall
1883 # (which is what makes the test interesting):
1884 AT_CHECK([ovs-ofctl add-flow br0 in_port=2,dl_src=00:55:66:77:88:99,actions=drop])
1885 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1886 idle_timeout=10, in_port=2,dl_src=00:44:55:66:77:88 actions=drop
1887 idle_timeout=30, in_port=1,dl_src=00:22:33:44:55:66 actions=drop
1888 idle_timeout=40, in_port=1,dl_src=00:33:44:55:66:77 actions=drop
1889 in_port=2,dl_src=00:55:66:77:88:99 actions=drop
1892 # Enlarge the flow limit, change the eviction policy back to strictly
1893 # based on expiration, and and add some flows.
1894 AT_CHECK([ovs-vsctl set Flow_Table evict groups='[[]]' flow-limit=7])
1895 ovs-ofctl add-flows br0 - <<EOF
1896 idle_timeout=50 in_port=2 dl_src=00:66:77:88:99:aa actions=drop
1897 idle_timeout=60 in_port=2 dl_src=00:77:88:99:aa:bb actions=drop
1898 idle_timeout=70 in_port=2 dl_src=00:88:99:aa:bb:cc actions=drop
1900 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1901 idle_timeout=10, in_port=2,dl_src=00:44:55:66:77:88 actions=drop
1902 idle_timeout=30, in_port=1,dl_src=00:22:33:44:55:66 actions=drop
1903 idle_timeout=40, in_port=1,dl_src=00:33:44:55:66:77 actions=drop
1904 idle_timeout=50, in_port=2,dl_src=00:66:77:88:99:aa actions=drop
1905 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=drop
1906 idle_timeout=70, in_port=2,dl_src=00:88:99:aa:bb:cc actions=drop
1907 in_port=2,dl_src=00:55:66:77:88:99 actions=drop
1910 # Adding another flow will cause the one that expires soonest overall
1912 AT_CHECK([ovs-ofctl add-flow br0 'idle_timeout=80 in_port=2 dl_src=00:99:aa:bb:cc:dd actions=drop'])
1913 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1914 idle_timeout=30, in_port=1,dl_src=00:22:33:44:55:66 actions=drop
1915 idle_timeout=40, in_port=1,dl_src=00:33:44:55:66:77 actions=drop
1916 idle_timeout=50, in_port=2,dl_src=00:66:77:88:99:aa actions=drop
1917 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=drop
1918 idle_timeout=70, in_port=2,dl_src=00:88:99:aa:bb:cc actions=drop
1919 idle_timeout=80, in_port=2,dl_src=00:99:aa:bb:cc:dd actions=drop
1920 in_port=2,dl_src=00:55:66:77:88:99 actions=drop
1923 # Reducing the flow limit also causes the flows that expire soonest
1924 # overall to be evicted.
1925 AT_CHECK([ovs-vsctl set Flow_Table evict flow-limit=4])
1926 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1927 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=drop
1928 idle_timeout=70, in_port=2,dl_src=00:88:99:aa:bb:cc actions=drop
1929 idle_timeout=80, in_port=2,dl_src=00:99:aa:bb:cc:dd actions=drop
1930 in_port=2,dl_src=00:55:66:77:88:99 actions=drop
1936 AT_SETUP([ofproto - eviction upon table overflow, with fairness (OpenFlow 1.2)])
1938 # Configure a maximum of 4 flows.
1941 -- --id=@t0 create Flow_Table name=evict flow-limit=4 \
1942 overflow-policy=evict \
1943 groups='"NXM_OF_IN_PORT[[]]"' \
1944 -- set bridge br0 flow_tables:0=@t0 \
1945 | ${PERL} $srcdir/uuidfilt.pl],
1949 ovs-ofctl -O OpenFlow12 add-flows br0 - <<EOF
1950 idle_timeout=10 in_port=2 dl_src=00:44:55:66:77:88 actions=drop
1951 idle_timeout=20 in_port=1 dl_src=00:11:22:33:44:55 actions=drop
1952 idle_timeout=30 in_port=1 dl_src=00:22:33:44:55:66 actions=drop
1953 idle_timeout=40 in_port=1 dl_src=00:33:44:55:66:77 actions=drop
1955 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1956 idle_timeout=10, in_port=2,dl_src=00:44:55:66:77:88 actions=drop
1957 idle_timeout=20, in_port=1,dl_src=00:11:22:33:44:55 actions=drop
1958 idle_timeout=30, in_port=1,dl_src=00:22:33:44:55:66 actions=drop
1959 idle_timeout=40, in_port=1,dl_src=00:33:44:55:66:77 actions=drop
1960 OFPST_FLOW reply (OF1.2):
1962 # Adding another flow will cause the one that expires soonest within
1963 # the largest group (those with in_port=1) to be evicted. In this
1964 # case this is not the same as the one that expires soonest overall
1965 # (which is what makes the test interesting):
1966 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 in_port=2,dl_src=00:55:66:77:88:99,actions=drop])
1967 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1968 idle_timeout=10, in_port=2,dl_src=00:44:55:66:77:88 actions=drop
1969 idle_timeout=30, in_port=1,dl_src=00:22:33:44:55:66 actions=drop
1970 idle_timeout=40, in_port=1,dl_src=00:33:44:55:66:77 actions=drop
1971 in_port=2,dl_src=00:55:66:77:88:99 actions=drop
1972 OFPST_FLOW reply (OF1.2):
1974 # Enlarge the flow limit, change the eviction policy back to strictly
1975 # based on expiration, and and add some flows.
1976 AT_CHECK([ovs-vsctl set Flow_Table evict groups='[[]]' flow-limit=7])
1977 ovs-ofctl -O OpenFlow12 add-flows br0 - <<EOF
1978 idle_timeout=50 in_port=2 dl_src=00:66:77:88:99:aa actions=drop
1979 idle_timeout=60 in_port=2 dl_src=00:77:88:99:aa:bb actions=drop
1980 idle_timeout=70 in_port=2 dl_src=00:88:99:aa:bb:cc actions=drop
1982 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1983 idle_timeout=10, in_port=2,dl_src=00:44:55:66:77:88 actions=drop
1984 idle_timeout=30, in_port=1,dl_src=00:22:33:44:55:66 actions=drop
1985 idle_timeout=40, in_port=1,dl_src=00:33:44:55:66:77 actions=drop
1986 idle_timeout=50, in_port=2,dl_src=00:66:77:88:99:aa actions=drop
1987 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=drop
1988 idle_timeout=70, in_port=2,dl_src=00:88:99:aa:bb:cc actions=drop
1989 in_port=2,dl_src=00:55:66:77:88:99 actions=drop
1990 OFPST_FLOW reply (OF1.2):
1992 # Adding another flow will cause the one that expires soonest overall
1994 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'])
1995 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1996 idle_timeout=30, in_port=1,dl_src=00:22:33:44:55:66 actions=drop
1997 idle_timeout=40, in_port=1,dl_src=00:33:44:55:66:77 actions=drop
1998 idle_timeout=50, in_port=2,dl_src=00:66:77:88:99:aa actions=drop
1999 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=drop
2000 idle_timeout=70, in_port=2,dl_src=00:88:99:aa:bb:cc actions=drop
2001 idle_timeout=80, in_port=2,dl_src=00:99:aa:bb:cc:dd actions=drop
2002 in_port=2,dl_src=00:55:66:77:88:99 actions=drop
2003 OFPST_FLOW reply (OF1.2):
2005 # Reducing the flow limit also causes the flows that expire soonest
2006 # overall to be evicted.
2007 AT_CHECK([ovs-vsctl set Flow_Table evict flow-limit=4])
2008 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
2009 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=drop
2010 idle_timeout=70, in_port=2,dl_src=00:88:99:aa:bb:cc actions=drop
2011 idle_timeout=80, in_port=2,dl_src=00:99:aa:bb:cc:dd actions=drop
2012 in_port=2,dl_src=00:55:66:77:88:99 actions=drop
2013 OFPST_FLOW reply (OF1.2):
2018 AT_SETUP([ofproto - eviction upon table overflow, with modified hard timeout])
2020 # Configure a maximum of 4 flows.
2023 -- --id=@t0 create Flow_Table flow-limit=4 overflow-policy=evict \
2024 -- set bridge br0 flow_tables:0=@t0 \
2025 | ${PERL} $srcdir/uuidfilt.pl],
2028 ovs-appctl time/stop
2030 for in_port in 4 3 2 1; do
2031 ovs-ofctl add-flow br0 hard_timeout=$((10 + in_port * 3)),in_port=$in_port,actions=drop
2033 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
2034 hard_timeout=13, in_port=1 actions=drop
2035 hard_timeout=16, in_port=2 actions=drop
2036 hard_timeout=19, in_port=3 actions=drop
2037 hard_timeout=22, in_port=4 actions=drop
2040 # Sleep and modify the one that expires soonest
2041 ovs-appctl time/warp 5000
2042 AT_CHECK([ovs-ofctl mod-flows br0 in_port=1,actions=drop])
2043 # At this point the table would looks like:
2044 # in_port seconds to expire
2049 ovs-appctl time/warp 2000
2050 # Adding another flow will cause the one that expires soonest to be evicted.
2051 AT_CHECK([ovs-ofctl add-flow br0 in_port=5,actions=drop])
2052 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
2053 hard_timeout=13, in_port=1 actions=drop
2054 hard_timeout=19, in_port=3 actions=drop
2055 hard_timeout=22, in_port=4 actions=drop
2056 in_port=5 actions=drop
2062 AT_SETUP([ofproto - eviction upon table overflow, with modified idle timeout])
2063 OVS_VSWITCHD_START([add-port br0 p1 -- set interface p1 type=dummy ofport_request=1])
2064 # Configure a maximum of 4 flows.
2067 -- --id=@t0 create Flow_Table flow-limit=4 overflow-policy=evict \
2068 -- set bridge br0 flow_tables:0=@t0 \
2069 | ${PERL} $srcdir/uuidfilt.pl],
2073 for in_port in 4 3 2 1; do
2074 ovs-ofctl add-flow br0 idle_timeout=$((10 + in_port * 3)),in_port=$in_port,actions=drop
2076 ovs-appctl time/stop
2077 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
2078 idle_timeout=13, in_port=1 actions=drop
2079 idle_timeout=16, in_port=2 actions=drop
2080 idle_timeout=19, in_port=3 actions=drop
2081 idle_timeout=22, in_port=4 actions=drop
2084 # Sleep and receive on the flow that expires soonest
2085 ovs-appctl time/warp 5000
2086 AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1)'])
2087 # At this point the table would looks like:
2088 # in_port seconds to expire
2093 ovs-appctl time/warp 2000
2094 # Adding another flow will cause the one that expires soonest to be evicted.
2095 AT_CHECK([ovs-ofctl add-flow br0 in_port=5,actions=drop])
2096 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
2097 idle_timeout=19, in_port=3 actions=drop
2098 idle_timeout=22, in_port=4 actions=drop
2099 in_port=5 actions=drop
2100 n_packets=1, n_bytes=60, idle_timeout=13, in_port=1 actions=drop
2106 AT_SETUP([ofproto - asynchronous message control (OpenFlow 1.0)])
2108 AT_CHECK([ovs-ofctl -P openflow10 monitor br0 --detach --no-chdir --pidfile])
2110 printf '\n\n--- check_async %d ---\n\n\n' $1
2113 ovs-appctl -t ovs-ofctl ofctl/barrier
2114 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
2117 # OFPT_PACKET_IN, OFPR_ACTION (controller_id=0)
2118 ovs-ofctl -v packet-out br0 controller controller '0001020304050010203040501234'
2119 if test X"$1" = X"OFPR_ACTION"; then shift;
2120 echo >>expout "OFPT_PACKET_IN: total_len=14 in_port=CONTROLLER (via action) data_len=14 (unbuffered)
2121 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234"
2124 # OFPT_PACKET_IN, OFPR_NO_MATCH (controller_id=123)
2125 ovs-ofctl -v packet-out br0 controller 'controller(reason=no_match,id=123)' '0001020304050010203040501234'
2126 if test X"$1" = X"OFPR_NO_MATCH"; then shift;
2127 echo >>expout "OFPT_PACKET_IN: total_len=14 in_port=CONTROLLER (via no_match) data_len=14 (unbuffered)
2128 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234"
2131 # OFPT_PACKET_IN, OFPR_INVALID_TTL (controller_id=0)
2132 ovs-ofctl packet-out br0 controller dec_ttl '002583dfb4000026b98cb0f908004500003eb7e200000011339bac11370dac100002d7730035002b8f6d86fb0100000100000000000006626c702d7873066e696369726103636f6d00000f00'
2133 if test X"$1" = X"OFPR_INVALID_TTL"; then shift;
2134 echo >>expout "OFPT_PACKET_IN: total_len=76 in_port=CONTROLLER (via invalid_ttl) data_len=76 (unbuffered)
2135 udp,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"
2138 # OFPT_PORT_STATUS, OFPPR_ADD
2139 ovs-vsctl add-port br0 test -- set Interface test type=dummy ofport_request=1
2140 if test X"$1" = X"OFPPR_ADD"; then shift;
2141 echo >>expout "OFPT_PORT_STATUS: ADD: 1(test): addr:aa:55:aa:55:00:0x
2144 speed: 0 Mbps now, 0 Mbps max"
2147 # OFPT_PORT_STATUS, OFPPR_DELETE
2148 ovs-vsctl del-port br0 test
2149 if test X"$1" = X"OFPPR_DELETE"; then shift;
2150 echo >>expout "OFPT_PORT_STATUS: DEL: 1(test): addr:aa:55:aa:55:00:0x
2153 speed: 0 Mbps now, 0 Mbps max"
2156 # OFPT_FLOW_REMOVED, OFPRR_DELETE
2157 ovs-ofctl add-flow br0 send_flow_rem,actions=drop
2158 ovs-ofctl --strict del-flows br0 ''
2159 if test X"$1" = X"OFPRR_DELETE"; then shift;
2160 echo >>expout "OFPT_FLOW_REMOVED: reason=delete"
2162 AT_FAIL_IF([test X"$1" != X])
2164 ovs-appctl -t ovs-ofctl ofctl/barrier
2165 echo >>expout "OFPT_BARRIER_REPLY:"
2169 s/ (xid=0x[0-9a-fA-F]*)//
2171 s/00:0.$/00:0x/' < monitor.log]],
2175 # It's a service connection so initially there should be no async messages.
2178 # Set miss_send_len to 128, turning on packet-ins for our service connection.
2179 ovs-appctl -t ovs-ofctl ofctl/send 0109000c0123456700000080
2180 check_async 2 OFPR_ACTION OFPPR_ADD OFPPR_DELETE OFPRR_DELETE
2182 # Set miss_send_len to 128 and enable invalid_ttl.
2183 ovs-appctl -t ovs-ofctl ofctl/send 0109000c0123456700040080
2184 check_async 3 OFPR_ACTION OFPR_INVALID_TTL OFPPR_ADD OFPPR_DELETE OFPRR_DELETE
2186 # Become slave, which should disable everything except port status.
2187 ovs-appctl -t ovs-ofctl ofctl/send 0104001400000002000023200000000a00000002
2188 check_async 4 OFPPR_ADD OFPPR_DELETE
2190 # Use NXT_SET_ASYNC_CONFIG to enable a patchwork of asynchronous messages.
2191 ovs-appctl -t ovs-ofctl ofctl/send 01040028000000020000232000000013000000020000000500000005000000020000000200000005
2192 check_async 5 OFPR_INVALID_TTL OFPPR_DELETE OFPRR_DELETE
2194 # Set controller ID 123.
2195 ovs-appctl -t ovs-ofctl ofctl/send 01040018000000030000232000000014000000000000007b
2196 check_async 6 OFPR_NO_MATCH OFPPR_DELETE OFPRR_DELETE
2198 # Restore controller ID 0.
2199 ovs-appctl -t ovs-ofctl ofctl/send 010400180000000300002320000000140000000000000000
2202 ovs-appctl -t ovs-ofctl ofctl/send 0104001400000002000023200000000a00000001
2203 check_async 7 OFPR_ACTION OFPPR_ADD
2205 ovs-appctl -t ovs-ofctl exit
2209 AT_SETUP([ofproto - asynchronous message control (OpenFlow 1.2)])
2211 AT_CHECK([ovs-ofctl -O OpenFlow12 monitor br0 --detach --no-chdir --pidfile])
2213 printf '\n\n--- check_async %d ---\n\n\n' $1
2217 ovs-appctl -t ovs-ofctl ofctl/barrier
2218 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
2221 # OFPT_PACKET_IN, OFPR_ACTION (controller_id=0)
2222 ovs-ofctl -O OpenFlow12 -v packet-out br0 none controller '0001020304050010203040501234'
2223 if test X"$1" = X"OFPR_ACTION"; then shift;
2224 echo >>expout "OFPT_PACKET_IN (OF1.2): total_len=14 in_port=ANY (via action) data_len=14 (unbuffered)
2225 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234"
2228 # OFPT_PACKET_IN, OFPR_NO_MATCH (controller_id=123)
2229 ovs-ofctl -O OpenFlow12 -v packet-out br0 none 'controller(reason=no_match,id=123)' '0001020304050010203040501234'
2230 if test X"$1" = X"OFPR_NO_MATCH"; then shift;
2231 echo >>expout "OFPT_PACKET_IN (OF1.2): total_len=14 in_port=ANY (via no_match) data_len=14 (unbuffered)
2232 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234"
2235 # OFPT_PACKET_IN, OFPR_INVALID_TTL (controller_id=0)
2236 ovs-ofctl -O OpenFlow12 packet-out br0 none dec_ttl '002583dfb4000026b98cb0f908004500003eb7e200000011339bac11370dac100002d7730035002b8f6d86fb0100000100000000000006626c702d7873066e696369726103636f6d00000f00'
2237 if test X"$1" = X"OFPR_INVALID_TTL"; then shift;
2238 echo >>expout "OFPT_PACKET_IN (OF1.2): total_len=76 in_port=ANY (via invalid_ttl) data_len=76 (unbuffered)
2239 udp,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"
2242 # OFPT_PORT_STATUS, OFPPR_ADD
2243 ovs-vsctl add-port br0 test -- set Interface test type=dummy
2244 if test X"$1" = X"OFPPR_ADD"; then shift;
2245 echo >>expout "OFPT_PORT_STATUS (OF1.2): ADD: ${INDEX}(test): addr:aa:55:aa:55:00:0x
2248 speed: 0 Mbps now, 0 Mbps max"
2251 # OFPT_PORT_STATUS, OFPPR_DELETE
2252 ovs-vsctl del-port br0 test
2253 if test X"$1" = X"OFPPR_DELETE"; then shift;
2254 echo >>expout "OFPT_PORT_STATUS (OF1.2): DEL: ${INDEX}(test): addr:aa:55:aa:55:00:0x
2257 speed: 0 Mbps now, 0 Mbps max"
2260 # OFPT_FLOW_REMOVED, OFPRR_DELETE
2261 ovs-ofctl -O OpenFlow12 add-flow br0 send_flow_rem,actions=drop
2262 ovs-ofctl -O OpenFlow12 --strict del-flows br0 ''
2263 if test X"$1" = X"OFPRR_DELETE"; then shift;
2264 echo >>expout "OFPT_FLOW_REMOVED (OF1.2): reason=delete table_id=0"
2266 AT_FAIL_IF([test X"$1" != X])
2268 ovs-appctl -t ovs-ofctl ofctl/barrier
2269 echo >>expout "OFPT_BARRIER_REPLY (OF1.2):"
2273 s/ (xid=0x[0-9a-fA-F]*)//
2275 s/00:0.$/00:0x/' < monitor.log]],
2279 # It's a service connection so initially there should be no async messages.
2282 # Set miss_send_len to 128, turning on packet-ins for our service connection.
2283 ovs-appctl -t ovs-ofctl ofctl/send 0309000c0123456700000080
2284 check_async 2 OFPR_ACTION OFPPR_ADD OFPPR_DELETE OFPRR_DELETE
2286 # Set miss_send_len to 128 and enable invalid_ttl.
2287 ovs-appctl -t ovs-ofctl ofctl/send 0309000c0123456700040080
2288 check_async 3 OFPR_ACTION OFPR_INVALID_TTL OFPPR_ADD OFPPR_DELETE OFPRR_DELETE
2290 # Become slave (OF 1.2), which should disable everything except port status.
2291 ovs-appctl -t ovs-ofctl ofctl/send 031800180000000200000003000000000000000000000001
2292 check_async 4 OFPPR_ADD OFPPR_DELETE
2294 # Use NXT_SET_ASYNC_CONFIG to enable a patchwork of asynchronous messages.
2295 ovs-appctl -t ovs-ofctl ofctl/send 03040028000000020000232000000013000000020000000500000005000000020000000200000005
2296 check_async 5 OFPR_INVALID_TTL OFPPR_DELETE OFPRR_DELETE
2298 # Set controller ID 123.
2299 ovs-appctl -t ovs-ofctl ofctl/send 03040018000000030000232000000014000000000000007b
2300 check_async 6 OFPR_NO_MATCH OFPPR_DELETE OFPRR_DELETE
2302 # Restore controller ID 0.
2303 ovs-appctl -t ovs-ofctl ofctl/send 030400180000000300002320000000140000000000000000
2305 # Become master (OF 1.2).
2306 ovs-appctl -t ovs-ofctl ofctl/send 031800180000000400000002000000000000000000000002
2307 check_async 7 OFPR_ACTION OFPPR_ADD
2309 ovs-appctl -t ovs-ofctl exit
2313 AT_SETUP([ofproto - asynchronous message control (OpenFlow 1.3)])
2315 AT_CHECK([ovs-ofctl -O OpenFlow13 monitor br0 --detach --no-chdir --pidfile])
2317 printf '\n\n--- check_async %d ---\n\n\n' $1
2321 ovs-appctl -t ovs-ofctl ofctl/barrier
2322 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
2325 # OFPT_PACKET_IN, OFPR_ACTION (controller_id=0)
2326 ovs-ofctl -O OpenFlow13 -v packet-out br0 none controller '0001020304050010203040501234'
2327 if test X"$1" = X"OFPR_ACTION"; then shift;
2328 echo >>expout "OFPT_PACKET_IN (OF1.3): total_len=14 in_port=ANY (via action) data_len=14 (unbuffered)
2329 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234"
2332 # OFPT_PACKET_IN, OFPR_NO_MATCH (controller_id=123)
2333 ovs-ofctl -O OpenFlow13 -v packet-out br0 none 'controller(reason=no_match,id=123)' '0001020304050010203040501234'
2334 if test X"$1" = X"OFPR_NO_MATCH"; then shift;
2335 echo >>expout "OFPT_PACKET_IN (OF1.3): total_len=14 in_port=ANY (via no_match) data_len=14 (unbuffered)
2336 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234"
2339 # OFPT_PACKET_IN, OFPR_INVALID_TTL (controller_id=0)
2340 ovs-ofctl -O OpenFlow13 packet-out br0 none dec_ttl '002583dfb4000026b98cb0f908004500003eb7e200000011339bac11370dac100002d7730035002b8f6d86fb0100000100000000000006626c702d7873066e696369726103636f6d00000f00'
2341 if test X"$1" = X"OFPR_INVALID_TTL"; then shift;
2342 echo >>expout "OFPT_PACKET_IN (OF1.3): total_len=76 in_port=ANY (via invalid_ttl) data_len=76 (unbuffered)
2343 udp,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"
2346 # OFPT_PORT_STATUS, OFPPR_ADD
2347 ovs-vsctl add-port br0 test -- set Interface test type=dummy
2348 if test X"$1" = X"OFPPR_ADD"; then shift;
2349 echo >>expout "OFPT_PORT_STATUS (OF1.3): ADD: ${INDEX}(test): addr:aa:55:aa:55:00:0x
2352 speed: 0 Mbps now, 0 Mbps max"
2355 # OFPT_PORT_STATUS, OFPPR_DELETE
2356 ovs-vsctl del-port br0 test
2357 if test X"$1" = X"OFPPR_DELETE"; then shift;
2358 echo >>expout "OFPT_PORT_STATUS (OF1.3): DEL: ${INDEX}(test): addr:aa:55:aa:55:00:0x
2361 speed: 0 Mbps now, 0 Mbps max"
2364 # OFPT_FLOW_REMOVED, OFPRR_DELETE
2365 ovs-ofctl -O OpenFlow13 add-flow br0 send_flow_rem,actions=drop
2366 ovs-ofctl -O OpenFlow13 --strict del-flows br0 ''
2367 if test X"$1" = X"OFPRR_DELETE"; then shift;
2368 echo >>expout "OFPT_FLOW_REMOVED (OF1.3): reason=delete table_id=0"
2371 # OFPT_FLOW_REMOVED, OFPRR_GROUP_DELETE
2372 ovs-ofctl -O OpenFlow13 add-group br0 group_id=1234,type=all,bucket=output:10
2373 ovs-ofctl -O OpenFlow13 add-flow br0 send_flow_rem,actions=group:1234
2374 ovs-ofctl -O OpenFlow13 --strict del-groups br0 group_id=1234
2375 if test X"$1" = X"OFPRR_DELETE"; then shift;
2376 echo >>expout "OFPT_FLOW_REMOVED (OF1.3): reason=gropu_delete table_id=0"
2379 AT_FAIL_IF([test X"$1" != X])
2381 ovs-appctl -t ovs-ofctl ofctl/barrier
2382 echo >>expout "OFPT_BARRIER_REPLY (OF1.3):"
2386 s/ (xid=0x[0-9a-fA-F]*)//
2388 s/00:0.$/00:0x/' < monitor.log]],
2392 # It's a service connection so initially there should be no async messages.
2395 # Set miss_send_len to 128, turning on packet-ins for our service connection.
2396 ovs-appctl -t ovs-ofctl ofctl/send 0409000c0123456700000080
2397 check_async 2 OFPR_ACTION OFPPR_ADD OFPPR_DELETE OFPRR_DELETE
2399 # Become slave (OF 1.3), which should disable everything except port status.
2400 ovs-appctl -t ovs-ofctl ofctl/send 041800180000000200000003000000000000000000000001
2401 check_async 3 OFPPR_ADD OFPPR_DELETE
2403 # Use OF 1.3 OFPT_SET_ASYNC to enable a patchwork of asynchronous messages.
2404 ovs-appctl -t ovs-ofctl ofctl/send 041c002000000002000000020000000500000005000000020000000200000005
2405 check_async 4 OFPR_INVALID_TTL OFPPR_DELETE OFPRR_DELETE
2407 # Set controller ID 123.
2408 ovs-appctl -t ovs-ofctl ofctl/send 04040018000000030000232000000014000000000000007b
2409 check_async 5 OFPR_NO_MATCH OFPPR_DELETE OFPRR_DELETE
2411 # Restore controller ID 0.
2412 ovs-appctl -t ovs-ofctl ofctl/send 040400180000000300002320000000140000000000000000
2414 # Become master (OF 1.3).
2415 ovs-appctl -t ovs-ofctl ofctl/send 041800180000000400000002000000000000000000000002
2416 check_async 6 OFPR_ACTION OFPPR_ADD
2418 ovs-appctl -t ovs-ofctl exit
2422 AT_SETUP([ofproto - asynchronous message control (OpenFlow 1.5)])
2424 AT_CHECK([ovs-ofctl -O OpenFlow15 monitor br0 --detach --no-chdir --pidfile])
2426 printf '\n\n--- check_async %d ---\n\n\n' $1
2430 ovs-appctl -t ovs-ofctl ofctl/barrier
2431 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
2434 # Other tests are not working with OF 1.5, and message
2435 # format may change, so leave them out.
2437 # OFPT_PORT_STATUS, OFPPR_ADD
2438 ovs-vsctl add-port br0 test -- set Interface test type=dummy
2439 if test X"$1" = X"OFPPR_ADD"; then shift;
2440 echo >>expout "OFPT_PORT_STATUS (OF1.5): ADD: ${INDEX}(test): addr:aa:55:aa:55:00:0x
2443 speed: 0 Mbps now, 0 Mbps max"
2446 # OFPT_PORT_STATUS, OFPPR_MODIFY
2447 ovs-ofctl -O OpenFlow15 -vwarn mod-port br0 test up
2448 if test X"$1" = X"OFPPR_MODIFY"; then shift;
2449 echo >>expout "OFPT_PORT_STATUS (OF1.5): MOD: ${INDEX}(test): addr:aa:55:aa:55:00:0x
2452 speed: 0 Mbps now, 0 Mbps max
2453 OFPT_PORT_STATUS (OF1.5): MOD: 2(test): addr:aa:55:aa:55:00:0x
2456 speed: 0 Mbps now, 0 Mbps max"
2459 # OFPT_PORT_STATUS, OFPPR_DELETE
2460 ovs-vsctl del-port br0 test
2461 if test X"$1" = X"OFPPR_DELETE"; then shift;
2462 echo >>expout "OFPT_PORT_STATUS (OF1.5): DEL: ${INDEX}(test): addr:aa:55:aa:55:00:0x
2465 speed: 0 Mbps now, 0 Mbps max"
2468 AT_FAIL_IF([test X"$1" != X])
2470 ovs-appctl -t ovs-ofctl ofctl/barrier
2471 echo >>expout "OFPT_BARRIER_REPLY (OF1.5):"
2475 s/ (xid=0x[0-9a-fA-F]*)//
2477 s/00:0.$/00:0x/' < monitor.log]],
2481 # It's a service connection so initially there should be no async messages.
2484 # If we don't set this, async messages are not received.
2485 # Set miss_send_len to 128, turning on packet-ins for our service connection.
2486 ovs-appctl -t ovs-ofctl ofctl/send 0609000c0123456700000080
2487 check_async 2 OFPPR_ADD OFPPR_MODIFY OFPPR_DELETE
2489 # Set-async has changed in OF 1.4 and is not yet implemented.
2491 ovs-appctl -t ovs-ofctl exit
2495 dnl This test checks that the role request/response messaging works
2496 dnl and that generation_id is handled properly.
2497 AT_SETUP([ofproto - controller role (OpenFlow 1.2)])
2499 ON_EXIT([kill `cat c1.pid c2.pid`])
2501 # Start two ovs-ofctl controller processes.
2502 AT_CAPTURE_FILE([monitor1.log])
2503 AT_CAPTURE_FILE([expout1])
2504 AT_CAPTURE_FILE([experr1])
2505 AT_CAPTURE_FILE([monitor2.log])
2506 AT_CAPTURE_FILE([expout2])
2507 AT_CAPTURE_FILE([experr2])
2509 AT_CHECK([ovs-ofctl -O OpenFlow12 monitor br0 --detach --no-chdir --pidfile=`pwd`/c$i.pid --unixctl=`pwd`/c$i])
2510 ovs-appctl -t `pwd`/c$i ofctl/barrier
2511 ovs-appctl -t `pwd`/c$i ofctl/set-output-file monitor$i.log
2515 # find out current role
2516 ovs-appctl -t `pwd`/c$i ofctl/send 031800180000000200000000000000000000000000000000
2517 echo >>experr$i "send: OFPT_ROLE_REQUEST (OF1.2): role=nochange"
2518 echo >>expout$i "OFPT_ROLE_REPLY (OF1.2): role=equal"
2521 # controller 1: Become slave (generation_id is initially undefined, so
2522 # 2^63+2 should not be stale)
2523 ovs-appctl -t `pwd`/c1 ofctl/send 031800180000000300000003000000008000000000000002
2524 echo >>experr1 "send: OFPT_ROLE_REQUEST (OF1.2): role=slave generation_id=9223372036854775810"
2525 echo >>expout1 "OFPT_ROLE_REPLY (OF1.2): role=slave generation_id=9223372036854775810"
2527 # controller 2: Become master.
2528 ovs-appctl -t `pwd`/c2 ofctl/send 031800180000000300000002000000008000000000000003
2529 echo >>experr2 "send: OFPT_ROLE_REQUEST (OF1.2): role=master generation_id=9223372036854775811"
2530 echo >>expout2 "OFPT_ROLE_REPLY (OF1.2): role=master generation_id=9223372036854775811"
2532 # controller 1: Try to become the master using a stale generation ID
2533 ovs-appctl -t `pwd`/c1 ofctl/send 031800180000000400000002000000000000000000000003
2534 echo >>experr1 "send: OFPT_ROLE_REQUEST (OF1.2): role=master generation_id=3"
2535 echo >>expout1 "OFPT_ERROR (OF1.2): OFPRRFC_STALE"
2536 echo >>expout1 "OFPT_ROLE_REQUEST (OF1.2): role=master generation_id=3"
2538 # controller 1: Become master using a valid generation ID
2539 ovs-appctl -t `pwd`/c1 ofctl/send 031800180000000500000002000000000000000000000001
2540 echo >>experr1 "send: OFPT_ROLE_REQUEST (OF1.2): role=master generation_id=1"
2541 echo >>expout1 "OFPT_ROLE_REPLY (OF1.2): role=master generation_id=1"
2544 ovs-appctl -t `pwd`/c$i ofctl/barrier
2545 echo >>expout$i "OFPT_BARRIER_REPLY (OF1.2):"
2551 AT_CHECK([grep -v '^send:' monitor$i.log | STRIP_XIDS], [0], [expout])
2553 AT_CHECK([grep '^send:' monitor$i.log | STRIP_XIDS], [0], [expout])
2558 dnl This test checks that the role request/response messaging works,
2559 dnl that generation_id is handled properly, and that role status update
2560 dnl messages are sent when a controller's role gets changed from master
2562 AT_SETUP([ofproto - controller role (OpenFlow 1.4)])
2564 ON_EXIT([kill `cat c1.pid c2.pid`])
2566 # Start two ovs-ofctl controller processes.
2567 AT_CAPTURE_FILE([monitor1.log])
2568 AT_CAPTURE_FILE([expout1])
2569 AT_CAPTURE_FILE([experr1])
2570 AT_CAPTURE_FILE([monitor2.log])
2571 AT_CAPTURE_FILE([expout2])
2572 AT_CAPTURE_FILE([experr2])
2574 AT_CHECK([ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile=`pwd`/c$i.pid --unixctl=`pwd`/c$i])
2575 ovs-appctl -t `pwd`/c$i ofctl/barrier
2576 ovs-appctl -t `pwd`/c$i ofctl/set-output-file monitor$i.log
2580 # find out current role
2581 ovs-appctl -t `pwd`/c$i ofctl/send 051800180000000200000000000000000000000000000000
2582 echo >>experr$i "send: OFPT_ROLE_REQUEST (OF1.4): role=nochange"
2583 echo >>expout$i "OFPT_ROLE_REPLY (OF1.4): role=equal"
2586 # controller 1: Become slave (generation_id is initially undefined, so
2587 # 2^63+2 should not be stale)
2588 ovs-appctl -t `pwd`/c1 ofctl/send 051800180000000300000003000000008000000000000002
2589 echo >>experr1 "send: OFPT_ROLE_REQUEST (OF1.4): role=slave generation_id=9223372036854775810"
2590 echo >>expout1 "OFPT_ROLE_REPLY (OF1.4): role=slave generation_id=9223372036854775810"
2592 # controller 2: Become master.
2593 ovs-appctl -t `pwd`/c2 ofctl/send 051800180000000300000002000000008000000000000003
2594 echo >>experr2 "send: OFPT_ROLE_REQUEST (OF1.4): role=master generation_id=9223372036854775811"
2595 echo >>expout2 "OFPT_ROLE_REPLY (OF1.4): role=master generation_id=9223372036854775811"
2597 # controller 1: Try to become the master using a stale generation ID
2598 ovs-appctl -t `pwd`/c1 ofctl/send 051800180000000400000002000000000000000000000003
2599 echo >>experr1 "send: OFPT_ROLE_REQUEST (OF1.4): role=master generation_id=3"
2600 echo >>expout1 "OFPT_ERROR (OF1.4): OFPRRFC_STALE"
2601 echo >>expout1 "OFPT_ROLE_REQUEST (OF1.4): role=master generation_id=3"
2603 # controller 1: Become master using a valid generation ID
2604 ovs-appctl -t `pwd`/c1 ofctl/send 051800180000000500000002000000000000000000000001
2605 echo >>experr1 "send: OFPT_ROLE_REQUEST (OF1.4): role=master generation_id=1"
2606 echo >>expout1 "OFPT_ROLE_REPLY (OF1.4): role=master generation_id=1"
2607 echo >>expout2 "OFPT_ROLE_STATUS (OF1.4): role=slave generation_id=1 reason=master_request"
2610 ovs-appctl -t `pwd`/c$i ofctl/barrier
2611 echo >>expout$i "OFPT_BARRIER_REPLY (OF1.4):"
2617 AT_CHECK([grep -v '^send:' monitor$i.log | STRIP_XIDS], [0], [expout])
2619 AT_CHECK([grep '^send:' monitor$i.log | STRIP_XIDS], [0], [expout])
2624 dnl This test checks that OFPT_PACKET_OUT accepts both OFPP_NONE (as
2625 dnl specified by OpenFlow 1.0) and OFPP_CONTROLLER (used by some
2626 dnl controllers despite the spec) as meaning a packet that was generated
2627 dnl by the controller.
2628 AT_SETUP([ofproto - packet-out from controller (OpenFlow 1.0)])
2630 ADD_OF_PORTS([br0], [1])
2632 # Start a monitor listening for packet-ins.
2633 AT_CHECK([ovs-ofctl -P openflow10 monitor br0 --detach --no-chdir --pidfile])
2634 ovs-appctl -t ovs-ofctl ofctl/send 0109000c0123456700000080
2635 ovs-appctl -t ovs-ofctl ofctl/barrier
2636 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
2637 AT_CAPTURE_FILE([monitor.log])
2639 # Send some packet-outs with OFPP_NONE and OFPP_CONTROLLER (65533) as in_port.
2640 AT_CHECK([ovs-ofctl packet-out br0 none controller,1 '0001020304050010203040501234'])
2641 AT_CHECK([ovs-ofctl packet-out br0 controller controller,1 '0001020304050010203040505678'])
2643 # Stop the monitor and check its output.
2644 ovs-appctl -t ovs-ofctl ofctl/barrier
2645 ovs-appctl -t ovs-ofctl exit
2647 ovs-ofctl dump-ports br0
2649 AT_CHECK([sed 's/ (xid=0x[[0-9a-fA-F]]*)//' monitor.log], [0], [dnl
2650 OFPT_PACKET_IN: total_len=14 in_port=ANY (via action) data_len=14 (unbuffered)
2651 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234
2652 OFPT_PACKET_IN: total_len=14 in_port=CONTROLLER (via action) data_len=14 (unbuffered)
2653 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x5678
2660 dnl This test checks that OFPT_PACKET_OUT accepts both OFPP_NONE (as
2661 dnl specified by OpenFlow 1.2) and OFPP_CONTROLLER (used by some
2662 dnl controllers despite the spec) as meaning a packet that was generated
2663 dnl by the controller.
2664 AT_SETUP([ofproto - packet-out from controller (OpenFlow 1.2)])
2667 # Start a monitor listening for packet-ins.
2668 AT_CHECK([ovs-ofctl -O OpenFlow12 monitor br0 --detach --no-chdir --pidfile])
2669 ovs-appctl -t ovs-ofctl ofctl/send 0309000c0123456700000080
2670 ovs-appctl -t ovs-ofctl ofctl/barrier
2671 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
2672 AT_CAPTURE_FILE([monitor.log])
2674 # Send some packet-outs with OFPP_NONE and OFPP_CONTROLLER (65533) as in_port.
2675 AT_CHECK([ovs-ofctl -O OpenFlow12 packet-out br0 none controller '0001020304050010203040501234'])
2676 AT_CHECK([ovs-ofctl -O OpenFlow12 packet-out br0 4294967293 controller '0001020304050010203040505678'])
2678 # Stop the monitor and check its output.
2679 ovs-appctl -t ovs-ofctl ofctl/barrier
2680 ovs-appctl -t ovs-ofctl exit
2682 AT_CHECK([sed 's/ (xid=0x[[0-9a-fA-F]]*)//' monitor.log], [0], [dnl
2683 OFPT_PACKET_IN (OF1.2): total_len=14 in_port=ANY (via action) data_len=14 (unbuffered)
2684 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234
2685 OFPT_PACKET_IN (OF1.2): total_len=14 in_port=CONTROLLER (via action) data_len=14 (unbuffered)
2686 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x5678
2687 OFPT_BARRIER_REPLY (OF1.2):
2693 dnl This test checks that OFPT_PACKET_OUT accepts both OFPP_NONE (as
2694 dnl specified by OpenFlow 1.1) and OFPP_CONTROLLER (used by some
2695 dnl controllers despite the spec) as meaning a packet that was generated
2696 dnl by the controller.
2697 AT_SETUP([ofproto - packet-out from controller (OpenFlow 1.1)])
2700 # Start a monitor listening for packet-ins.
2701 AT_CHECK([ovs-ofctl -O OpenFlow11 monitor br0 --detach --no-chdir --pidfile])
2702 ovs-appctl -t ovs-ofctl ofctl/send 0209000c0123456700000080
2703 ovs-appctl -t ovs-ofctl ofctl/barrier
2704 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
2705 AT_CAPTURE_FILE([monitor.log])
2707 # Send some packet-outs with OFPP_NONE and OFPP_CONTROLLER (65533) as in_port.
2708 AT_CHECK([ovs-ofctl -O OpenFlow11 packet-out br0 none controller '0001020304050010203040501234'])
2709 AT_CHECK([ovs-ofctl -O OpenFlow11 packet-out br0 4294967293 controller '0001020304050010203040505678'])
2711 # Stop the monitor and check its output.
2712 ovs-appctl -t ovs-ofctl ofctl/barrier
2713 ovs-appctl -t ovs-ofctl exit
2715 AT_CHECK([sed 's/ (xid=0x[[0-9a-fA-F]]*)//' monitor.log], [0], [dnl
2716 OFPT_PACKET_IN (OF1.1): total_len=14 in_port=ANY (via action) data_len=14 (unbuffered)
2717 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234
2718 OFPT_PACKET_IN (OF1.1): total_len=14 in_port=CONTROLLER (via action) data_len=14 (unbuffered)
2719 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x5678
2720 OFPT_BARRIER_REPLY (OF1.1):
2726 dnl This test checks that metadata is encoded in packet_in structures,
2727 dnl supported by NXAST.
2728 AT_SETUP([ofproto - packet-out with metadata (NXM)])
2731 # Start a monitor listening for packet-ins.
2732 AT_CHECK([ovs-ofctl -P nxm monitor br0 --detach --no-chdir --pidfile])
2733 ovs-appctl -t ovs-ofctl ofctl/send 0109000c0123456700000080
2734 ovs-appctl -t ovs-ofctl ofctl/barrier
2735 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
2736 AT_CAPTURE_FILE([monitor.log])
2738 # Send a packet-out with a load action to set some metadata, and forward to controller
2739 AT_CHECK([ovs-ofctl packet-out br0 controller 'load(0xfafafafa5a5a5a5a->OXM_OF_METADATA[[0..63]]), load(0xaa->NXM_NX_PKT_MARK[[]]), controller' '0001020304050010203040501234'])
2741 # Stop the monitor and check its output.
2742 ovs-appctl -t ovs-ofctl ofctl/barrier
2743 ovs-appctl -t ovs-ofctl exit
2745 AT_CHECK([sed 's/ (xid=0x[[0-9a-fA-F]]*)//' monitor.log], [0], [dnl
2746 NXT_PACKET_IN: total_len=14 pkt_mark=0xaa,metadata=0xfafafafa5a5a5a5a,in_port=CONTROLLER (via action) data_len=14 (unbuffered)
2747 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234
2754 dnl This test checks that metadata is encoded in packet_in structures,
2755 dnl supported by NXAST.
2756 AT_SETUP([ofproto - packet-out with metadata (OpenFlow 1.2)])
2759 # Start a monitor listening for packet-ins.
2760 AT_CHECK([ovs-ofctl -O OpenFlow12 monitor br0 --detach --no-chdir --pidfile])
2761 ovs-appctl -t ovs-ofctl ofctl/send 0309000c0123456700000080
2762 ovs-appctl -t ovs-ofctl ofctl/barrier
2763 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
2764 AT_CAPTURE_FILE([monitor.log])
2766 # Send a packet-out with a set-field action to set some metadata, and forward to controller
2767 AT_CHECK([ovs-ofctl -O OpenFlow12 packet-out br0 none 'set_field:0xfafafafa5a5a5a5a->metadata, controller' '0001020304050010203040501234'])
2769 # Stop the monitor and check its output.
2770 ovs-appctl -t ovs-ofctl ofctl/barrier
2771 ovs-appctl -t ovs-ofctl exit
2773 AT_CHECK([sed 's/ (xid=0x[[0-9a-fA-F]]*)//' monitor.log], [0], [dnl
2774 OFPT_PACKET_IN (OF1.2): total_len=14 metadata=0xfafafafa5a5a5a5a,in_port=ANY (via action) data_len=14 (unbuffered)
2775 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234
2776 OFPT_BARRIER_REPLY (OF1.2):
2782 dnl This test checks that metadata is encoded in packet_in structures,
2783 dnl supported by NXAST.
2784 AT_SETUP([ofproto - packet-out with metadata and dual set_field (OpenFlow 1.3)])
2787 # Start a monitor listening for packet-ins.
2788 AT_CHECK([ovs-ofctl -O OpenFlow13 monitor br0 --detach --no-chdir --pidfile])
2789 ovs-appctl -t ovs-ofctl ofctl/send 0409000c0123456700000080
2790 ovs-appctl -t ovs-ofctl ofctl/barrier
2791 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
2792 AT_CAPTURE_FILE([monitor.log])
2794 # Send a packet-out with a couple of set-field action to set some metadata, and forward to controller
2795 AT_CHECK([ovs-ofctl -O OpenFlow13 packet-out br0 none 'set_field:0xfafafafa5a5a5a5a->metadata, set_field:0x6b->metadata, controller' '0001020304050010203040501234'])
2797 # Stop the monitor and check its output.
2798 ovs-appctl -t ovs-ofctl ofctl/barrier
2799 ovs-appctl -t ovs-ofctl exit
2801 AT_CHECK([sed 's/ (xid=0x[[0-9a-fA-F]]*)//' monitor.log], [0], [dnl
2802 OFPT_PACKET_IN (OF1.3): total_len=14 metadata=0x6b,in_port=ANY (via action) data_len=14 (unbuffered)
2803 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234
2804 OFPT_BARRIER_REPLY (OF1.3):
2810 dnl This test checks that tunnel metadata is encoded in packet_in structures.
2811 AT_SETUP([ofproto - packet-out with tunnel metadata (OpenFlow 1.2)])
2814 # Start a monitor listening for packet-ins.
2815 AT_CHECK([ovs-ofctl -O OpenFlow12 monitor br0 --detach --no-chdir --pidfile])
2816 ovs-appctl -t ovs-ofctl ofctl/send 0309000c0123456700000080
2817 ovs-appctl -t ovs-ofctl ofctl/barrier
2818 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
2819 AT_CAPTURE_FILE([monitor.log])
2821 # Send a packet-out with set field actions to set some tunnel metadata, and forward to controller
2822 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'])
2824 # Stop the monitor and check its output.
2825 ovs-appctl -t ovs-ofctl ofctl/barrier
2826 ovs-appctl -t ovs-ofctl exit
2828 AT_CHECK([sed 's/ (xid=0x[[0-9a-fA-F]]*)//' monitor.log], [0], [dnl
2829 OFPT_PACKET_IN (OF1.2): total_len=14 tun_id=0x1020304,tun_src=127.0.0.1,tun_dst=192.168.0.1,in_port=ANY (via action) data_len=14 (unbuffered)
2830 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234
2831 OFPT_BARRIER_REPLY (OF1.2):
2837 m4_divert_push([PREPARE_TESTS])
2838 # Sorts groups of lines that start with a space, without moving them
2839 # past the nearest line that does not start with a space.
2849 print $_ foreach sort(@buffer);
2854 print $_ foreach sort(@buffer);
2857 m4_divert_pop([PREPARE_TESTS])
2859 AT_SETUP([ofproto - flow monitoring])
2860 AT_KEYWORDS([monitor])
2863 ovs-ofctl add-flow br0 in_port=0,dl_vlan=123,actions=output:1
2865 # Start a monitor watching the flow table and check the initial reply.
2866 ovs-ofctl monitor br0 watch: --detach --no-chdir --pidfile >monitor.log 2>&1
2867 AT_CAPTURE_FILE([monitor.log])
2868 ovs-appctl -t ovs-ofctl ofctl/barrier
2869 AT_CHECK([sed 's/ (xid=0x[[1-9a-fA-F]][[0-9a-fA-F]]*)//' monitor.log], [0],
2870 [NXST_FLOW_MONITOR reply:
2871 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=123 actions=output:1
2875 # Add, delete, and modify some flows and check the updates.
2876 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
2877 ovs-ofctl add-flow br0 in_port=0,dl_vlan=124,actions=output:2
2878 ovs-ofctl add-flow br0 in_port=0,dl_vlan=123,actions=output:5
2879 ovs-ofctl add-flow br0 in_port=0,dl_vlan=123,dl_vlan_pcp=0,actions=output:6
2880 ovs-ofctl add-flow br0 in_port=0,dl_vlan=123,dl_vlan_pcp=1,actions=output:7
2881 ovs-ofctl add-flow br0 in_port=0,dl_vlan=123,actions=output:8
2882 ovs-ofctl add-flow br0 in_port=0,dl_vlan=65535,dl_vlan_pcp=0,actions=output:9
2883 ovs-ofctl add-flow br0 in_port=0,dl_vlan=65535,dl_vlan_pcp=1,actions=output:10
2884 ovs-ofctl add-flow br0 in_port=0,dl_vlan=65535,actions=output:11
2885 ovs-ofctl add-flow br0 in_port=0,dl_vlan=8191,dl_vlan_pcp=0,actions=output:12
2886 ovs-ofctl add-flow br0 in_port=0,dl_vlan=8191,dl_vlan_pcp=1,actions=output:13
2887 ovs-ofctl add-flow br0 in_port=0,dl_vlan=8191,actions=output:14
2888 ovs-ofctl add-flow br0 in_port=0,dl_vlan=0,dl_vlan_pcp=0,actions=output:15
2889 ovs-ofctl add-flow br0 in_port=0,dl_vlan=0,dl_vlan_pcp=1,actions=output:16
2890 ovs-ofctl add-flow br0 in_port=0,dl_vlan=0,actions=output:17
2891 ovs-ofctl add-flow br0 in_port=0,dl_vlan=0,dl_vlan_pcp=0,actions=output:18
2892 ovs-ofctl add-flow br0 in_port=0,dl_vlan=0,dl_vlan_pcp=1,actions=output:19
2893 ovs-ofctl add-flow br0 in_port=0,dl_vlan=0,actions=output:20
2894 ovs-ofctl add-flow br0 in_port=0,dl_vlan_pcp=0,actions=output:21
2895 ovs-ofctl add-flow br0 in_port=0,dl_vlan_pcp=1,actions=output:22
2896 ovs-ofctl add-flow br0 in_port=0,actions=output:23
2897 ovs-ofctl mod-flows br0 dl_vlan=123,actions=output:3
2898 ovs-ofctl mod-flows br0 cookie=5,dl_vlan=123,actions=output:3
2899 ovs-ofctl del-flows br0 dl_vlan=123
2900 ovs-ofctl del-flows br0
2901 ovs-appctl -t ovs-ofctl ofctl/barrier
2902 AT_CHECK([sed 's/ (xid=0x[[1-9a-fA-F]][[0-9a-fA-F]]*)//' monitor.log | multiline_sort], [0],
2903 [NXST_FLOW_MONITOR reply (xid=0x0):
2904 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=124 actions=output:2
2905 NXST_FLOW_MONITOR reply (xid=0x0):
2906 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=123 actions=output:5
2907 NXST_FLOW_MONITOR reply (xid=0x0):
2908 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=123,dl_vlan_pcp=0 actions=output:6
2909 NXST_FLOW_MONITOR reply (xid=0x0):
2910 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=123,dl_vlan_pcp=1 actions=output:7
2911 NXST_FLOW_MONITOR reply (xid=0x0):
2912 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=123 actions=output:8
2913 NXST_FLOW_MONITOR reply (xid=0x0):
2914 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=0,dl_vlan_pcp=0 actions=output:9
2915 NXST_FLOW_MONITOR reply (xid=0x0):
2916 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=0,dl_vlan_pcp=1 actions=output:10
2917 NXST_FLOW_MONITOR reply (xid=0x0):
2918 event=ADDED table=0 cookie=0 in_port=0,vlan_tci=0x0000 actions=output:11
2919 NXST_FLOW_MONITOR reply (xid=0x0):
2920 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=4095,dl_vlan_pcp=0 actions=output:12
2921 NXST_FLOW_MONITOR reply (xid=0x0):
2922 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=4095,dl_vlan_pcp=1 actions=output:13
2923 NXST_FLOW_MONITOR reply (xid=0x0):
2924 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=4095 actions=output:14
2925 NXST_FLOW_MONITOR reply (xid=0x0):
2926 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=0,dl_vlan_pcp=0 actions=output:15
2927 NXST_FLOW_MONITOR reply (xid=0x0):
2928 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=0,dl_vlan_pcp=1 actions=output:16
2929 NXST_FLOW_MONITOR reply (xid=0x0):
2930 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=0 actions=output:17
2931 NXST_FLOW_MONITOR reply (xid=0x0):
2932 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=0,dl_vlan_pcp=0 actions=output:18
2933 NXST_FLOW_MONITOR reply (xid=0x0):
2934 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=0,dl_vlan_pcp=1 actions=output:19
2935 NXST_FLOW_MONITOR reply (xid=0x0):
2936 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=0 actions=output:20
2937 NXST_FLOW_MONITOR reply (xid=0x0):
2938 event=ADDED table=0 cookie=0 in_port=0,dl_vlan_pcp=0 actions=output:21
2939 NXST_FLOW_MONITOR reply (xid=0x0):
2940 event=ADDED table=0 cookie=0 in_port=0,dl_vlan_pcp=1 actions=output:22
2941 NXST_FLOW_MONITOR reply (xid=0x0):
2942 event=ADDED table=0 cookie=0 in_port=0 actions=output:23
2943 NXST_FLOW_MONITOR reply (xid=0x0):
2944 event=MODIFIED table=0 cookie=0 in_port=0,dl_vlan=123 actions=output:3
2945 event=MODIFIED table=0 cookie=0 in_port=0,dl_vlan=123,dl_vlan_pcp=0 actions=output:3
2946 event=MODIFIED table=0 cookie=0 in_port=0,dl_vlan=123,dl_vlan_pcp=1 actions=output:3
2947 NXST_FLOW_MONITOR reply (xid=0x0):
2948 event=MODIFIED table=0 cookie=0x5 in_port=0,dl_vlan=123 actions=output:3
2949 event=MODIFIED table=0 cookie=0x5 in_port=0,dl_vlan=123,dl_vlan_pcp=0 actions=output:3
2950 event=MODIFIED table=0 cookie=0x5 in_port=0,dl_vlan=123,dl_vlan_pcp=1 actions=output:3
2951 NXST_FLOW_MONITOR reply (xid=0x0):
2952 event=DELETED reason=delete table=0 cookie=0x5 in_port=0,dl_vlan=123 actions=output:3
2953 event=DELETED reason=delete table=0 cookie=0x5 in_port=0,dl_vlan=123,dl_vlan_pcp=0 actions=output:3
2954 event=DELETED reason=delete table=0 cookie=0x5 in_port=0,dl_vlan=123,dl_vlan_pcp=1 actions=output:3
2955 NXST_FLOW_MONITOR reply (xid=0x0):
2956 event=DELETED reason=delete table=0 cookie=0 in_port=0 actions=output:23
2957 event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan=0 actions=output:20
2958 event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan=0,dl_vlan_pcp=0 actions=output:18
2959 event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan=0,dl_vlan_pcp=1 actions=output:19
2960 event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan=124 actions=output:2
2961 event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan=4095 actions=output:14
2962 event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan=4095,dl_vlan_pcp=0 actions=output:12
2963 event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan=4095,dl_vlan_pcp=1 actions=output:13
2964 event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan_pcp=0 actions=output:21
2965 event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan_pcp=1 actions=output:22
2966 event=DELETED reason=delete table=0 cookie=0 in_port=0,vlan_tci=0x0000 actions=output:11
2970 # Check that our own changes are reported as full updates.
2971 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
2972 ovs-ofctl add-flow br0 in_port=1,actions=output:2
2973 ovs-ofctl add-flow br0 in_port=2,actions=output:1
2974 ovs-appctl -t ovs-ofctl ofctl/barrier
2975 ovs-appctl -t ovs-ofctl ofctl/send 010e004812345678003fffff00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003000000000000ffffffffffff0000
2976 ovs-appctl -t ovs-ofctl ofctl/barrier
2977 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip], [0], [NXST_FLOW reply:
2979 AT_CHECK([sed 's/ (xid=0x[[1-9a-fA-F]][[0-9a-fA-F]]*)//' monitor.log | multiline_sort], [0],
2980 [NXST_FLOW_MONITOR reply (xid=0x0):
2981 event=ADDED table=0 cookie=0 in_port=1 actions=output:2
2982 NXST_FLOW_MONITOR reply (xid=0x0):
2983 event=ADDED table=0 cookie=0 in_port=2 actions=output:1
2985 send: OFPT_FLOW_MOD: DEL priority=0 actions=drop
2986 NXST_FLOW_MONITOR reply (xid=0x0):
2987 event=DELETED reason=delete table=0 cookie=0 in_port=1 actions=output:2
2988 event=DELETED reason=delete table=0 cookie=0 in_port=2 actions=output:1
2992 ovs-appctl -t ovs-ofctl exit
2996 AT_SETUP([ofproto - flow monitoring with !own])
2997 AT_KEYWORDS([monitor])
3000 ovs-ofctl add-flow br0 in_port=0,dl_vlan=123,actions=output:1
3002 # Start a monitor watching the flow table and check the initial reply.
3003 ovs-ofctl monitor br0 watch:\!own --detach --no-chdir --pidfile >monitor.log 2>&1
3004 AT_CAPTURE_FILE([monitor.log])
3005 ovs-appctl -t ovs-ofctl ofctl/barrier
3006 AT_CHECK([sed 's/ (xid=0x[[1-9a-fA-F]][[0-9a-fA-F]]*)//' monitor.log], [0],
3007 [NXST_FLOW_MONITOR reply:
3008 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=123 actions=output:1
3012 # Check that our own changes are reported as abbreviations.
3013 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
3014 ovs-ofctl add-flow br0 in_port=1,actions=output:2
3015 ovs-ofctl add-flow br0 in_port=2,actions=output:1
3016 ovs-appctl -t ovs-ofctl ofctl/barrier
3017 ovs-appctl -t ovs-ofctl ofctl/send 010e004812345678003fffff00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003000000000000ffffffffffff0000
3018 ovs-appctl -t ovs-ofctl ofctl/barrier
3019 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip], [0], [NXST_FLOW reply:
3021 AT_CHECK([sed 's/ (xid=0x[[1-9a-fA-F]][[0-9a-fA-F]]*)//' monitor.log], [0],
3022 [NXST_FLOW_MONITOR reply (xid=0x0):
3023 event=ADDED table=0 cookie=0 in_port=1 actions=output:2
3024 NXST_FLOW_MONITOR reply (xid=0x0):
3025 event=ADDED table=0 cookie=0 in_port=2 actions=output:1
3027 send: OFPT_FLOW_MOD: DEL priority=0 actions=drop
3028 NXST_FLOW_MONITOR reply (xid=0x0):
3029 event=ABBREV xid=0x12345678
3033 ovs-appctl -t ovs-ofctl exit
3037 AT_SETUP([ofproto - flow monitoring with out_port])
3038 AT_KEYWORDS([monitor])
3041 ovs-ofctl add-flow br0 in_port=0,dl_vlan=121,actions=output:1
3042 ovs-ofctl add-flow br0 in_port=0,dl_vlan=122,actions=output:1
3043 ovs-ofctl add-flow br0 in_port=0,dl_vlan=123,actions=output:2
3045 # Start a monitor watching the flow table and check the initial reply.
3046 ovs-ofctl monitor br0 watch:out_port=2 --detach --no-chdir --pidfile >monitor.log 2>&1
3047 AT_CAPTURE_FILE([monitor.log])
3048 ovs-appctl -t ovs-ofctl ofctl/barrier
3049 AT_CHECK([sed 's/ (xid=0x[[1-9a-fA-F]][[0-9a-fA-F]]*)//' monitor.log], [0],
3050 [NXST_FLOW_MONITOR reply:
3051 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=123 actions=output:2
3055 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
3057 # Add, modify flows and check the updates.
3058 ovs-ofctl mod-flows br0 dl_vlan=121,actions=drop
3059 ovs-ofctl mod-flows br0 dl_vlan=122,actions=output:1,output:2
3060 ovs-appctl -t ovs-ofctl ofctl/barrier
3062 ovs-ofctl mod-flows br0 dl_vlan=123,actions=output:1,output:2
3063 ovs-appctl -t ovs-ofctl ofctl/barrier
3065 ovs-ofctl mod-flows br0 dl_vlan=122,actions=output:1
3066 ovs-appctl -t ovs-ofctl ofctl/barrier
3067 ovs-ofctl mod-flows br0 dl_vlan=123,actions=output:2
3068 ovs-appctl -t ovs-ofctl ofctl/barrier
3070 AT_CHECK([sed 's/ (xid=0x[[1-9a-fA-F]][[0-9a-fA-F]]*)//' monitor.log], [0],
3071 [NXST_FLOW_MONITOR reply (xid=0x0):
3072 event=MODIFIED table=0 cookie=0 in_port=0,dl_vlan=122 actions=output:1,output:2
3074 NXST_FLOW_MONITOR reply (xid=0x0):
3075 event=MODIFIED table=0 cookie=0 in_port=0,dl_vlan=123 actions=output:1,output:2
3077 NXST_FLOW_MONITOR reply (xid=0x0):
3078 event=MODIFIED table=0 cookie=0 in_port=0,dl_vlan=122 actions=output:1
3080 NXST_FLOW_MONITOR reply (xid=0x0):
3081 event=MODIFIED table=0 cookie=0 in_port=0,dl_vlan=123 actions=output:2
3085 ovs-appctl -t ovs-ofctl exit
3089 AT_SETUP([ofproto - flow monitoring pause and resume])
3090 AT_KEYWORDS([monitor])
3092 # The maximum socket receive buffer size is important for this test, which
3093 # tests behavior when the receive buffer overflows.
3094 if test -e /proc/sys/net/core/rmem_max; then
3096 rmem_max=`cat /proc/sys/net/core/rmem_max`
3097 elif rmem_max=`sysctl -n net.inet.tcp.recvbuf_max 2>/dev/null`; then
3100 # Don't know how to get maximum socket receive buffer on this OS
3103 # Calculate the total amount of queuing: rmem_max in the kernel, 128 kB
3104 # in ofproto sending userspace (see ofmonitor_flush() in connmgr.c).
3105 queue_size=`expr $rmem_max + 128 \* 1024`
3106 echo rmem_max=$rmem_max queue_size=$queue_size
3108 # If there's too much queuing skip the test to avoid timing out.
3109 AT_SKIP_IF([test $rmem_max -gt 1048576])
3111 # Each flow update message takes up at least 48 bytes of space in queues
3112 # and in practice more than that.
3113 n_msgs=`expr $queue_size / 48`
3118 # Start a monitor watching the flow table, then make it block.
3119 ON_EXIT([kill `cat ovs-ofctl.pid`])
3120 ovs-ofctl monitor br0 watch: --detach --no-chdir --pidfile >monitor.log 2>&1
3121 AT_CAPTURE_FILE([monitor.log])
3122 ovs-appctl -t ovs-ofctl ofctl/block
3124 # Add $n_msgs flows.
3125 (echo "in_port=2,actions=output:2"
3127 for ($i = 0; $i < '$n_msgs'; $i++) {
3128 print "cookie=1,reg1=$i,actions=drop\n";
3131 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
3132 # Check that multipart flow dumps work properly:
3133 AT_CHECK([ovs-ofctl diff-flows br0 flows.txt])
3134 AT_CHECK([ovs-ofctl add-flow br0 in_port=1,cookie=3,actions=drop])
3135 AT_CHECK([ovs-ofctl mod-flows br0 in_port=2,cookie=2,actions=output:2])
3136 AT_CHECK([ovs-ofctl del-flows br0 cookie=1/-1])
3138 ovs-appctl -t ovs-ofctl ofctl/unblock
3140 # Wait for the connection resumed.
3141 # A barrier doesn't work for this purpose.
3142 # https://www.mail-archive.com/dev@openvswitch.org/msg27013.html
3143 # https://www.mail-archive.com/dev@openvswitch.org/msg27675.html
3144 OVS_WAIT_UNTIL([grep NXT_FLOW_MONITOR_RESUMED monitor.log])
3146 ovs-appctl -t ovs-ofctl exit
3148 # Check that the flow monitor reported the same number of flows
3149 # added and deleted, but fewer than we actually added and deleted.
3150 adds=`grep -c 'ADDED.*reg1=' monitor.log`
3151 deletes=`grep -c 'DELETED.*reg1=' monitor.log`
3152 echo adds=$adds deletes=$deletes
3153 AT_CHECK([test $adds -gt 100 && test $adds -lt $n_msgs])
3154 AT_CHECK([test $adds = $deletes])
3156 # Check that the flow monitor reported everything in the expected order:
3158 # event=ADDED table=0 cookie=0x1 reg1=0x22
3160 # NXT_FLOW_MONITOR_PAUSED:
3162 # event=DELETED reason=delete table=0 cookie=0x1 reg1=0x22
3164 # event=ADDED table=0 cookie=0x3 in_port=1
3165 # event=MODIFIED table=0 cookie=0x2 in_port=2 actions=output:2
3166 # NXT_FLOW_MONITOR_RESUMED:
3168 # except that, between the PAUSED and RESUMED, the order of the ADDED
3169 # and MODIFIED lines lines depends on hash order, that is, it varies
3170 # as we change the hash function or change architecture. Therefore,
3171 # we use a couple of tests below to accept both orders.
3172 AT_CHECK([ofctl_strip < monitor.log | sed -n -e '
3175 /NXT_FLOW_MONITOR_PAUSED:/p
3176 /NXT_FLOW_MONITOR_RESUMED:/p
3177 ' > monitor.log.subset])
3178 AT_CHECK([grep -v MODIFIED monitor.log.subset], [0], [dnl
3179 event=ADDED table=0 cookie=0x1 reg1=0x22
3180 NXT_FLOW_MONITOR_PAUSED:
3181 event=DELETED reason=delete table=0 cookie=0x1 reg1=0x22
3182 event=ADDED table=0 cookie=0x3 in_port=1
3183 NXT_FLOW_MONITOR_RESUMED:
3185 AT_CHECK([grep -v ADDED monitor.log.subset], [0], [dnl
3186 NXT_FLOW_MONITOR_PAUSED:
3187 event=DELETED reason=delete table=0 cookie=0x1 reg1=0x22
3188 event=MODIFIED table=0 cookie=0x2 in_port=2 actions=output:2
3189 NXT_FLOW_MONITOR_RESUMED:
3195 AT_SETUP([ofproto - event filtering (OpenFlow 1.3)])
3196 AT_KEYWORDS([monitor])
3199 # Start a monitor, use the required protocol version
3200 ovs-ofctl -O OpenFlow13 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1
3201 AT_CAPTURE_FILE([monitor.log])
3203 # Send an OpenFlow13 message (04), OFPT_GET_ASYNC_REQUEST (1a), length (8), xid (0a)
3204 ovs-appctl -t ovs-ofctl ofctl/send 041a00080000000a
3205 ovs-appctl -t ovs-ofctl ofctl/barrier
3207 # Check default setting
3208 read -r -d '' expected <<'EOF'
3211 AT_CHECK([ofctl_strip < monitor.log], [], [dnl
3212 send: OFPT_GET_ASYNC_REQUEST (OF1.3):
3213 OFPT_GET_ASYNC_REPLY (OF1.3):
3215 PACKET_IN: no_match action
3216 PORT_STATUS: add delete modify
3217 FLOW_REMOVED: idle hard delete
3221 PORT_STATUS: add delete modify
3223 OFPT_BARRIER_REPLY (OF1.3):
3229 AT_SETUP([ofproto - ofport_request])
3231 ADD_OF_PORTS([br0], [1], [2], [3])
3233 set_and_check_specific_ofports () {
3234 ovs-vsctl set Interface p1 ofport_request="$1" -- \
3235 set Interface p2 ofport_request="$2" -- \
3236 set Interface p3 ofport_request="$3"
3237 ofports=`ovs-vsctl get Interface p1 ofport -- \
3238 get Interface p2 ofport -- \
3239 get Interface p3 ofport`
3240 AT_CHECK_UNQUOTED([echo $ofports], [0], [$1 $2 $3
3243 for pre in '1 2 3' '1 3 2' '2 1 3' '2 3 1' '3 1 2' '3 2 1'; do
3244 for post in '1 2 3' '1 3 2' '2 1 3' '2 3 1' '3 1 2' '3 2 1'; do
3245 echo -----------------------------------------------------------
3246 echo "Check changing port numbers from $pre to $post"
3247 set_and_check_specific_ofports $pre
3248 set_and_check_specific_ofports $post
3252 ovs-vsctl del-port p3
3254 set_and_check_poorly_specified_ofports () {
3255 ovs-vsctl set Interface p1 ofport_request="$1" -- \
3256 set Interface p2 ofport_request="$2"
3257 p1=`ovs-vsctl get Interface p1 ofport`
3258 p2=`ovs-vsctl get Interface p2 ofport`
3261 AT_CHECK([test "$p1" != "$p2"])
3262 if test "$1" = "$2" && test "$1" != '[[]]'; then
3263 # One port number must be the requested one.
3264 AT_CHECK([test "$p1" = "$1" || test "$p2" = "$1"])
3265 # The other port number must be different (already tested above).
3267 AT_CHECK([test "$1" = '[[]]' || test "$p1" == "$1"])
3268 AT_CHECK([test "$2" = '[[]]' || test "$p2" == "$2"])
3271 for pre in '1 2' '[[]] 2' '1 [[]]' '[[]] [[]]' '2 1' '[[]] 1' '2 [[]]' \
3273 for post in '1 2' '[[]] 2' '1 [[]]' '[[]] [[]]' '2 1' '[[]] 1' '2 [[]]' \
3275 echo -----------------------------------------------------------
3276 echo "Check changing port numbers from $pre to $post"
3277 set_and_check_poorly_specified_ofports $pre
3278 set_and_check_poorly_specified_ofports $post
3285 AT_SETUP([ofproto - bundles, open (OpenFlow 1.4)])
3286 AT_KEYWORDS([monitor])
3289 # Start a monitor, use the required protocol version
3290 ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1
3291 AT_CAPTURE_FILE([monitor.log])
3293 # Send an OpenFlow14 message (05), OFPT_BUNDLE_CONTROL (21), length (10), xid (0a)
3294 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 00 00 02"
3295 ovs-appctl -t ovs-ofctl ofctl/barrier
3296 ovs-appctl -t ovs-ofctl exit
3298 AT_CHECK([ofctl_strip < monitor.log], [], [dnl
3299 send: OFPT_BUNDLE_CONTROL (OF1.4):
3300 bundle_id=0x1 type=OPEN_REQUEST flags=ordered
3301 OFPT_BUNDLE_CONTROL (OF1.4):
3302 bundle_id=0x1 type=OPEN_REPLY flags=0
3303 OFPT_BARRIER_REPLY (OF1.4):
3309 AT_SETUP([ofproto - bundles, double open (OpenFlow 1.4)])
3310 AT_KEYWORDS([monitor])
3313 # Start a monitor, use the required protocol version
3314 ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1
3315 AT_CAPTURE_FILE([monitor.log])
3317 # Send twice an OpenFlow14 message (05), OFPT_BUNDLE_CONTROL (21), length (10), xid (0a)
3318 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 00 00 02"
3319 ovs-appctl -t ovs-ofctl ofctl/barrier
3320 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 00 00 02"
3321 ovs-appctl -t ovs-ofctl ofctl/barrier
3322 ovs-appctl -t ovs-ofctl exit
3324 AT_CHECK([ofctl_strip < monitor.log], [0], [dnl
3325 send: OFPT_BUNDLE_CONTROL (OF1.4):
3326 bundle_id=0x1 type=OPEN_REQUEST flags=ordered
3327 OFPT_BUNDLE_CONTROL (OF1.4):
3328 bundle_id=0x1 type=OPEN_REPLY flags=0
3329 OFPT_BARRIER_REPLY (OF1.4):
3330 send: OFPT_BUNDLE_CONTROL (OF1.4):
3331 bundle_id=0x1 type=OPEN_REQUEST flags=ordered
3332 OFPT_ERROR (OF1.4): OFPBFC_BAD_ID
3333 OFPT_BUNDLE_CONTROL (OF1.4):
3334 bundle_id=0x1 type=OPEN_REQUEST flags=ordered
3335 OFPT_BARRIER_REPLY (OF1.4):
3341 AT_SETUP([ofproto - bundle close without open (OpenFlow 1.4)])
3342 AT_KEYWORDS([monitor])
3345 # Start a monitor, use the required protocol version
3346 ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1
3347 AT_CAPTURE_FILE([monitor.log])
3349 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 02 00 02"
3350 ovs-appctl -t ovs-ofctl ofctl/barrier
3351 ovs-appctl -t ovs-ofctl exit
3353 AT_CHECK([ofctl_strip < monitor.log], [0], [dnl
3354 send: OFPT_BUNDLE_CONTROL (OF1.4):
3355 bundle_id=0x1 type=CLOSE_REQUEST flags=ordered
3356 OFPT_ERROR (OF1.4): OFPBFC_BAD_ID
3357 OFPT_BUNDLE_CONTROL (OF1.4):
3358 bundle_id=0x1 type=CLOSE_REQUEST flags=ordered
3359 OFPT_BARRIER_REPLY (OF1.4):
3365 AT_SETUP([ofproto - bundle double close (OpenFlow 1.4)])
3366 AT_KEYWORDS([monitor])
3369 # Start a monitor, use the required protocol version
3370 ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1
3371 AT_CAPTURE_FILE([monitor.log])
3373 # Open, Close, Close
3374 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 00 00 02"
3375 ovs-appctl -t ovs-ofctl ofctl/barrier
3376 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 02 00 02"
3377 ovs-appctl -t ovs-ofctl ofctl/barrier
3378 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 02 00 02"
3379 ovs-appctl -t ovs-ofctl ofctl/barrier
3380 ovs-appctl -t ovs-ofctl exit
3382 AT_CHECK([ofctl_strip < monitor.log], [0], [dnl
3383 send: OFPT_BUNDLE_CONTROL (OF1.4):
3384 bundle_id=0x1 type=OPEN_REQUEST flags=ordered
3385 OFPT_BUNDLE_CONTROL (OF1.4):
3386 bundle_id=0x1 type=OPEN_REPLY flags=0
3387 OFPT_BARRIER_REPLY (OF1.4):
3388 send: OFPT_BUNDLE_CONTROL (OF1.4):
3389 bundle_id=0x1 type=CLOSE_REQUEST flags=ordered
3390 OFPT_BUNDLE_CONTROL (OF1.4):
3391 bundle_id=0x1 type=CLOSE_REPLY flags=0
3392 OFPT_BARRIER_REPLY (OF1.4):
3393 send: OFPT_BUNDLE_CONTROL (OF1.4):
3394 bundle_id=0x1 type=CLOSE_REQUEST flags=ordered
3395 OFPT_ERROR (OF1.4): OFPBFC_BUNDLE_CLOSED
3396 OFPT_BUNDLE_CONTROL (OF1.4):
3397 bundle_id=0x1 type=CLOSE_REQUEST flags=ordered
3398 OFPT_BARRIER_REPLY (OF1.4):
3404 AT_SETUP([ofproto - bundle close, different flags (OpenFlow 1.4)])
3405 AT_KEYWORDS([monitor])
3408 # Start a monitor, use the required protocol version
3409 ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1
3410 AT_CAPTURE_FILE([monitor.log])
3412 # Open, Close, Close
3413 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 00 00 02"
3414 ovs-appctl -t ovs-ofctl ofctl/barrier
3415 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 02 00 01"
3416 ovs-appctl -t ovs-ofctl ofctl/barrier
3417 ovs-appctl -t ovs-ofctl exit
3419 AT_CHECK([ofctl_strip < monitor.log], [0], [dnl
3420 send: OFPT_BUNDLE_CONTROL (OF1.4):
3421 bundle_id=0x1 type=OPEN_REQUEST flags=ordered
3422 OFPT_BUNDLE_CONTROL (OF1.4):
3423 bundle_id=0x1 type=OPEN_REPLY flags=0
3424 OFPT_BARRIER_REPLY (OF1.4):
3425 send: OFPT_BUNDLE_CONTROL (OF1.4):
3426 bundle_id=0x1 type=CLOSE_REQUEST flags=atomic
3427 OFPT_ERROR (OF1.4): OFPBFC_BAD_FLAGS
3428 OFPT_BUNDLE_CONTROL (OF1.4):
3429 bundle_id=0x1 type=CLOSE_REQUEST flags=atomic
3430 OFPT_BARRIER_REPLY (OF1.4):
3436 AT_SETUP([ofproto - bundle commit without open (OpenFlow 1.4)])
3437 AT_KEYWORDS([monitor])
3440 # Start a monitor, use the required protocol version
3441 ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1
3442 AT_CAPTURE_FILE([monitor.log])
3444 # Open, Close, Close
3445 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 04 00 02"
3446 ovs-appctl -t ovs-ofctl ofctl/barrier
3447 ovs-appctl -t ovs-ofctl exit
3449 AT_CHECK([ofctl_strip < monitor.log], [0], [dnl
3450 send: OFPT_BUNDLE_CONTROL (OF1.4):
3451 bundle_id=0x1 type=COMMIT_REQUEST flags=ordered
3452 OFPT_ERROR (OF1.4): OFPBFC_BAD_ID
3453 OFPT_BUNDLE_CONTROL (OF1.4):
3454 bundle_id=0x1 type=COMMIT_REQUEST flags=ordered
3455 OFPT_BARRIER_REPLY (OF1.4):
3461 AT_SETUP([ofproto - bundle commit, different flags (OpenFlow 1.4)])
3462 AT_KEYWORDS([monitor])
3465 # Start a monitor, use the required protocol version
3466 ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1
3467 AT_CAPTURE_FILE([monitor.log])
3469 # Open, Close, Close
3470 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 00 00 02"
3471 ovs-appctl -t ovs-ofctl ofctl/barrier
3472 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 04 00 01"
3473 ovs-appctl -t ovs-ofctl ofctl/barrier
3474 ovs-appctl -t ovs-ofctl exit
3476 AT_CHECK([ofctl_strip < monitor.log], [0], [dnl
3477 send: OFPT_BUNDLE_CONTROL (OF1.4):
3478 bundle_id=0x1 type=OPEN_REQUEST flags=ordered
3479 OFPT_BUNDLE_CONTROL (OF1.4):
3480 bundle_id=0x1 type=OPEN_REPLY flags=0
3481 OFPT_BARRIER_REPLY (OF1.4):
3482 send: OFPT_BUNDLE_CONTROL (OF1.4):
3483 bundle_id=0x1 type=COMMIT_REQUEST flags=atomic
3484 OFPT_ERROR (OF1.4): OFPBFC_BAD_FLAGS
3485 OFPT_BUNDLE_CONTROL (OF1.4):
3486 bundle_id=0x1 type=COMMIT_REQUEST flags=atomic
3487 OFPT_BARRIER_REPLY (OF1.4):
3493 AT_SETUP([ofproto - bundle discard without open (OpenFlow 1.4)])
3494 AT_KEYWORDS([monitor])
3497 # Start a monitor, use the required protocol version
3498 ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1
3499 AT_CAPTURE_FILE([monitor.log])
3501 # Open, Close, Close
3502 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 06 00 02"
3503 ovs-appctl -t ovs-ofctl ofctl/barrier
3504 ovs-appctl -t ovs-ofctl exit
3506 AT_CHECK([ofctl_strip < monitor.log], [0], [dnl
3507 send: OFPT_BUNDLE_CONTROL (OF1.4):
3508 bundle_id=0x1 type=DISCARD_REQUEST flags=ordered
3509 OFPT_ERROR (OF1.4): OFPBFC_BAD_ID
3510 OFPT_BUNDLE_CONTROL (OF1.4):
3511 bundle_id=0x1 type=DISCARD_REQUEST flags=ordered
3512 OFPT_BARRIER_REPLY (OF1.4):
3519 AT_SETUP([ofproto - bundle with multiple flow mods (OpenFlow 1.4)])
3520 AT_KEYWORDS([monitor])
3523 AT_CHECK([ovs-appctl vlog/set vconn:dbg])
3525 AT_CHECK([ovs-ofctl del-flows br0])
3527 AT_DATA([flows.txt], [dnl
3528 add idle_timeout=50 in_port=2 dl_src=00:66:77:88:99:aa actions=1
3529 add idle_timeout=60 in_port=2 dl_src=00:77:88:99:aa:bb actions=2
3530 add idle_timeout=70 in_port=2 dl_src=00:88:99:aa:bb:cc actions=3
3531 add idle_timeout=50 in_port=2 dl_src=00:66:77:88:99:aa actions=4
3533 add idle_timeout=50 in_port=2 dl_src=00:66:77:88:99:aa actions=5
3534 add idle_timeout=60 in_port=2 dl_src=00:77:88:99:aa:bb actions=6
3535 add idle_timeout=70 in_port=2 dl_src=00:88:99:aa:bb:cc actions=7
3536 delete in_port=2 dl_src=00:88:99:aa:bb:cc
3539 AT_CHECK([ovs-ofctl --bundle add-flows br0 flows.txt])
3541 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
3542 idle_timeout=50, in_port=2,dl_src=00:66:77:88:99:aa actions=output:5
3543 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=output:6
3547 AT_DATA([flows.txt], [dnl
3549 modify_strict in_port=2 dl_src=00:77:88:99:aa:bb actions=7
3552 AT_CHECK([ovs-ofctl --bundle add-flows br0 flows.txt])
3554 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
3555 idle_timeout=50, in_port=2,dl_src=00:66:77:88:99:aa actions=drop
3556 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=output:7
3560 # Adding an existing flow acts as a modify, and delete_strict also works.
3561 AT_DATA([flows.txt], [dnl
3562 add idle_timeout=60 in_port=2 dl_src=00:77:88:99:aa:bb actions=8
3563 delete_strict in_port=2 dl_src=00:66:77:88:99:aa
3564 add in_port=2 dl_src=00:66:77:88:99:aa actions=drop
3567 AT_CHECK([ovs-ofctl --bundle add-flows br0 flows.txt])
3569 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
3570 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=output:8
3571 in_port=2,dl_src=00:66:77:88:99:aa actions=drop
3575 dnl Check logs for OpenFlow trace
3577 OVS_WAIT_UNTIL([cat ovs-vswitchd.log | vconn_windows_sub | test `grep -- "|vconn|DBG|unix: sent (Success): NXST_FLOW reply" | wc -l` -ge 3])
3578 AT_CHECK([print_vconn_debug | vconn_windows_sub | ofctl_strip], [0], [dnl
3579 vconn|DBG|unix: sent (Success): OFPT_HELLO (OF1.5):
3580 version bitmap: 0x01, 0x02, 0x03, 0x04, 0x05, 0x06
3581 vconn|DBG|unix: received: OFPT_HELLO:
3582 version bitmap: 0x01
3583 vconn|DBG|unix: negotiated OpenFlow version 0x01 (we support version 0x06 and earlier, peer supports version 0x01)
3584 vconn|DBG|unix: received: OFPT_FLOW_MOD: DEL actions=drop
3585 vconn|DBG|unix: received: OFPT_BARRIER_REQUEST:
3586 vconn|DBG|unix: sent (Success): OFPT_BARRIER_REPLY:
3587 vconn|DBG|unix: sent (Success): OFPT_HELLO (OF1.5):
3588 version bitmap: 0x01, 0x02, 0x03, 0x04, 0x05, 0x06
3589 vconn|DBG|unix: received: OFPT_HELLO (OF1.4):
3590 version bitmap: 0x01, 0x05
3591 vconn|DBG|unix: negotiated OpenFlow version 0x05 (we support version 0x06 and earlier, peer supports versions 0x01, 0x05)
3592 vconn|DBG|unix: received: OFPT_BUNDLE_CONTROL (OF1.4):
3593 bundle_id=0 type=OPEN_REQUEST flags=atomic ordered
3594 vconn|DBG|unix: sent (Success): OFPT_BUNDLE_CONTROL (OF1.4):
3595 bundle_id=0 type=OPEN_REPLY flags=0
3596 vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4):
3597 bundle_id=0 flags=atomic ordered
3598 OFPT_FLOW_MOD (OF1.4): ADD in_port=2,dl_src=00:66:77:88:99:aa idle:50 actions=output:1
3599 vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4):
3600 bundle_id=0 flags=atomic ordered
3601 OFPT_FLOW_MOD (OF1.4): ADD in_port=2,dl_src=00:77:88:99:aa:bb idle:60 actions=output:2
3602 vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4):
3603 bundle_id=0 flags=atomic ordered
3604 OFPT_FLOW_MOD (OF1.4): ADD in_port=2,dl_src=00:88:99:aa:bb:cc idle:70 actions=output:3
3605 vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4):
3606 bundle_id=0 flags=atomic ordered
3607 OFPT_FLOW_MOD (OF1.4): ADD in_port=2,dl_src=00:66:77:88:99:aa idle:50 actions=output:4
3608 vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4):
3609 bundle_id=0 flags=atomic ordered
3610 OFPT_FLOW_MOD (OF1.4): DEL table:255 actions=drop
3611 vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4):
3612 bundle_id=0 flags=atomic ordered
3613 OFPT_FLOW_MOD (OF1.4): ADD in_port=2,dl_src=00:66:77:88:99:aa idle:50 actions=output:5
3614 vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4):
3615 bundle_id=0 flags=atomic ordered
3616 OFPT_FLOW_MOD (OF1.4): ADD in_port=2,dl_src=00:77:88:99:aa:bb idle:60 actions=output:6
3617 vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4):
3618 bundle_id=0 flags=atomic ordered
3619 OFPT_FLOW_MOD (OF1.4): ADD in_port=2,dl_src=00:88:99:aa:bb:cc idle:70 actions=output:7
3620 vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4):
3621 bundle_id=0 flags=atomic ordered
3622 OFPT_FLOW_MOD (OF1.4): DEL table:255 in_port=2,dl_src=00:88:99:aa:bb:cc actions=drop
3623 vconn|DBG|unix: received: OFPT_BUNDLE_CONTROL (OF1.4):
3624 bundle_id=0 type=COMMIT_REQUEST flags=atomic ordered
3625 vconn|DBG|unix: sent (Success): OFPT_BUNDLE_CONTROL (OF1.4):
3626 bundle_id=0 type=COMMIT_REPLY flags=0
3627 vconn|DBG|unix: sent (Success): OFPT_HELLO (OF1.5):
3628 version bitmap: 0x01, 0x02, 0x03, 0x04, 0x05, 0x06
3629 vconn|DBG|unix: received: OFPT_HELLO:
3630 version bitmap: 0x01
3631 vconn|DBG|unix: negotiated OpenFlow version 0x01 (we support version 0x06 and earlier, peer supports version 0x01)
3632 vconn|DBG|unix: received: NXT_SET_FLOW_FORMAT: format=nxm
3633 vconn|DBG|unix: received: OFPT_BARRIER_REQUEST:
3634 vconn|DBG|unix: sent (Success): OFPT_BARRIER_REPLY:
3635 vconn|DBG|unix: received: NXST_FLOW request:
3636 vconn|DBG|unix: sent (Success): NXST_FLOW reply:
3637 idle_timeout=50, in_port=2,dl_src=00:66:77:88:99:aa actions=output:5
3638 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=output:6
3639 vconn|DBG|unix: sent (Success): OFPT_HELLO (OF1.5):
3640 version bitmap: 0x01, 0x02, 0x03, 0x04, 0x05, 0x06
3641 vconn|DBG|unix: received: OFPT_HELLO (OF1.4):
3642 version bitmap: 0x01, 0x05
3643 vconn|DBG|unix: negotiated OpenFlow version 0x05 (we support version 0x06 and earlier, peer supports versions 0x01, 0x05)
3644 vconn|DBG|unix: received: OFPT_BUNDLE_CONTROL (OF1.4):
3645 bundle_id=0 type=OPEN_REQUEST flags=atomic ordered
3646 vconn|DBG|unix: sent (Success): OFPT_BUNDLE_CONTROL (OF1.4):
3647 bundle_id=0 type=OPEN_REPLY flags=0
3648 vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4):
3649 bundle_id=0 flags=atomic ordered
3650 OFPT_FLOW_MOD (OF1.4): MOD actions=drop
3651 vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4):
3652 bundle_id=0 flags=atomic ordered
3653 OFPT_FLOW_MOD (OF1.4): MOD_STRICT in_port=2,dl_src=00:77:88:99:aa:bb actions=output:7
3654 vconn|DBG|unix: received: OFPT_BUNDLE_CONTROL (OF1.4):
3655 bundle_id=0 type=COMMIT_REQUEST flags=atomic ordered
3656 vconn|DBG|unix: sent (Success): OFPT_BUNDLE_CONTROL (OF1.4):
3657 bundle_id=0 type=COMMIT_REPLY flags=0
3658 vconn|DBG|unix: sent (Success): OFPT_HELLO (OF1.5):
3659 version bitmap: 0x01, 0x02, 0x03, 0x04, 0x05, 0x06
3660 vconn|DBG|unix: received: OFPT_HELLO:
3661 version bitmap: 0x01
3662 vconn|DBG|unix: negotiated OpenFlow version 0x01 (we support version 0x06 and earlier, peer supports version 0x01)
3663 vconn|DBG|unix: received: NXT_SET_FLOW_FORMAT: format=nxm
3664 vconn|DBG|unix: received: OFPT_BARRIER_REQUEST:
3665 vconn|DBG|unix: sent (Success): OFPT_BARRIER_REPLY:
3666 vconn|DBG|unix: received: NXST_FLOW request:
3667 vconn|DBG|unix: sent (Success): NXST_FLOW reply:
3668 idle_timeout=50, in_port=2,dl_src=00:66:77:88:99:aa actions=drop
3669 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=output:7
3670 vconn|DBG|unix: sent (Success): OFPT_HELLO (OF1.5):
3671 version bitmap: 0x01, 0x02, 0x03, 0x04, 0x05, 0x06
3672 vconn|DBG|unix: received: OFPT_HELLO (OF1.4):
3673 version bitmap: 0x01, 0x05
3674 vconn|DBG|unix: negotiated OpenFlow version 0x05 (we support version 0x06 and earlier, peer supports versions 0x01, 0x05)
3675 vconn|DBG|unix: received: OFPT_BUNDLE_CONTROL (OF1.4):
3676 bundle_id=0 type=OPEN_REQUEST flags=atomic ordered
3677 vconn|DBG|unix: sent (Success): OFPT_BUNDLE_CONTROL (OF1.4):
3678 bundle_id=0 type=OPEN_REPLY flags=0
3679 vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4):
3680 bundle_id=0 flags=atomic ordered
3681 OFPT_FLOW_MOD (OF1.4): ADD in_port=2,dl_src=00:77:88:99:aa:bb idle:60 actions=output:8
3682 vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4):
3683 bundle_id=0 flags=atomic ordered
3684 OFPT_FLOW_MOD (OF1.4): DEL_STRICT table:255 in_port=2,dl_src=00:66:77:88:99:aa actions=drop
3685 vconn|DBG|unix: received: OFPT_BUNDLE_ADD_MESSAGE (OF1.4):
3686 bundle_id=0 flags=atomic ordered
3687 OFPT_FLOW_MOD (OF1.4): ADD in_port=2,dl_src=00:66:77:88:99:aa actions=drop
3688 vconn|DBG|unix: received: OFPT_BUNDLE_CONTROL (OF1.4):
3689 bundle_id=0 type=COMMIT_REQUEST flags=atomic ordered
3690 vconn|DBG|unix: sent (Success): OFPT_BUNDLE_CONTROL (OF1.4):
3691 bundle_id=0 type=COMMIT_REPLY flags=0
3692 vconn|DBG|unix: sent (Success): OFPT_HELLO (OF1.5):
3693 version bitmap: 0x01, 0x02, 0x03, 0x04, 0x05, 0x06
3694 vconn|DBG|unix: received: OFPT_HELLO:
3695 version bitmap: 0x01
3696 vconn|DBG|unix: negotiated OpenFlow version 0x01 (we support version 0x06 and earlier, peer supports version 0x01)
3697 vconn|DBG|unix: received: NXT_SET_FLOW_FORMAT: format=nxm
3698 vconn|DBG|unix: received: OFPT_BARRIER_REQUEST:
3699 vconn|DBG|unix: sent (Success): OFPT_BARRIER_REPLY:
3700 vconn|DBG|unix: received: NXST_FLOW request:
3701 vconn|DBG|unix: sent (Success): NXST_FLOW reply:
3702 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=output:8
3703 in_port=2,dl_src=00:66:77:88:99:aa actions=drop
3710 AT_SETUP([ofproto - failing bundle commit (OpenFlow 1.4)])
3711 AT_KEYWORDS([monitor])
3714 AT_CHECK([ovs-ofctl del-flows br0])
3716 ovs-ofctl add-flows br0 - <<EOF
3717 idle_timeout=50 in_port=2 dl_src=00:66:77:88:99:aa actions=11
3718 idle_timeout=60 in_port=2 dl_src=00:77:88:99:aa:bb actions=22
3719 idle_timeout=70 in_port=2 dl_src=00:88:99:aa:bb:cc actions=33
3721 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
3722 idle_timeout=50, in_port=2,dl_src=00:66:77:88:99:aa actions=output:11
3723 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=output:22
3724 idle_timeout=70, in_port=2,dl_src=00:88:99:aa:bb:cc actions=output:33
3728 # last line uses illegal table number (OVS internal table)
3729 AT_DATA([flows.txt], [dnl
3730 add idle_timeout=50 in_port=2 dl_src=00:66:77:88:99:aa actions=1
3731 add idle_timeout=60 in_port=2 dl_src=00:77:88:99:aa:bb actions=2
3732 add idle_timeout=70 in_port=2 dl_src=00:88:99:aa:bb:cc actions=3
3733 modify idle_timeout=50 in_port=2 dl_src=00:66:77:88:99:aa actions=4
3735 add idle_timeout=50 in_port=2 dl_src=00:66:77:88:99:aa actions=5
3736 add idle_timeout=60 in_port=2 dl_src=00:77:88:99:aa:bb actions=6
3737 add idle_timeout=70 in_port=2 dl_src=00:88:99:aa:bb:cc actions=7
3738 delete in_port=2 dl_src=00:88:99:aa:bb:cc
3739 add table=254 actions=drop
3742 AT_CHECK([ovs-ofctl --bundle add-flows br0 flows.txt 2>&1 | sed '/|WARN|/d
3743 s/unix:.*br0\.mgmt/unix:br0.mgmt/' | sed 's/(.* error)/(error)/'],
3745 OFPT_ERROR (OF1.4) (xid=0xb): OFPBRC_EPERM
3746 OFPT_FLOW_MOD (OF1.4) (xid=0xb): ADD table:254 actions=drop
3747 OFPT_ERROR (OF1.4) (xid=0xd): OFPBFC_MSG_FAILED
3748 OFPT_BUNDLE_CONTROL (OF1.4) (xid=0xd):
3749 bundle_id=0 type=COMMIT_REQUEST flags=atomic ordered
3750 ovs-ofctl: talking to unix:br0.mgmt (error)
3753 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
3754 idle_timeout=50, in_port=2,dl_src=00:66:77:88:99:aa actions=output:11
3755 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=output:22
3756 idle_timeout=70, in_port=2,dl_src=00:88:99:aa:bb:cc actions=output:33